elijahr / python-autopxd2

A friendly fork of autopxd
MIT License
44 stars 9 forks source link

pycparser.plyparser.ParseError: /usr/include/c++/4.8.2/bits/memoryfwd.h:50:11: before: std #18

Open Tagar opened 5 years ago

Tagar commented 5 years ago

What do we miss ?

$ autopxd -I /usr/include -I /opt/cloudera/parcels/Anaconda3/include -I /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include -I /usr/include/c++/4.8.2/x86_64-redhat-linux -I /usr/include/c++/4.8.2  VCEUtilities.h VCEUtilities.pxd

Traceback (most recent call last):

  File "/opt/cloudera/parcels/Anaconda3/bin/autopxd", line 11, in <module>
    sys.exit(cli())
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/autopxd/__init__.py", line 94, in cli
    outfile.write(translate(infile.read(), infile.name, extra_cpp_args))
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/autopxd/__init__.py", line 73, in translate
    p.visit(parse(code, extra_cpp_args=extra_cpp_args, whitelist=whitelist))
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/autopxd/__init__.py", line 50, in parse
    ast = parser.parse(preprocessed)
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/pycparser/c_parser.py", line 152, in parse
    debug=debuglevel)
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/pycparser/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/pycparser/ply/yacc.py", line 1199, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/pycparser/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/pycparser/c_parser.py", line 1761, in p_error
    column=self.clex.find_tok_column(p)))
  File "/opt/cloudera/parcels/Anaconda3/lib/python3.6/site-packages/pycparser/plyparser.py", line 66, in _parse_error
    raise ParseError("%s: %s" % (coord, msg))
pycparser.plyparser.ParseError: /usr/include/c++/4.8.2/bits/memoryfwd.h:50:11: before: std

Thanks!

Tagar commented 5 years ago

/usr/include/c++/4.8.2/bits/memoryfwd.h line 50 before std has a keyword namespace.

I wonder if pycparser requires .hpp extension for the header files to be processed as C++ and not as C.

gabrieldemarmiesse commented 5 years ago

Hello, It's been a long time since I worked on this library and I didn't write most of the code. I don't think I'll be able to help you much. Though from what I remember, autopxd cannot not handle C++ code.

Tagar commented 5 years ago

thank you @gabrieldemarmiesse for prompt response

this error seems to happen in pycparser so I will check there too

Tagar commented 5 years ago

https://github.com/eliben/pycparser/issues/332