Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic program fails #5

Open
TheGag96 opened this issue Jan 16, 2022 · 0 comments
Open

Basic program fails #5

TheGag96 opened this issue Jan 16, 2022 · 0 comments

Comments

@TheGag96
Copy link

Tried this out today with this program, on Python 3.8.10, Linux Mint 20.1:

Print("asdf");

I get this stack trace when translating:

Traceback (most recent call last):
  File "/home/grayson/.local/bin/secularize", line 8, in <module>
    sys.exit(main())
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/__init__.py", line 174, in main
    translate(args['<file.hc>'])
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/__init__.py", line 152, in translate
    p = Parser(t)
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/parser.py", line 30, in __init__
    self.out = self.parse_toplevel()
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/parser.py", line 218, in parse_toplevel
    while not self.input.eof():
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/token.py", line 279, in eof
    return self.peek() is None
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/token.py", line 267, in peek
    self.current = self.read_next()
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/token.py", line 221, in read_next
    return self.read_ident()
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/token.py", line 147, in read_ident
    return populate_ast(self, 'funccall', **{
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/utils.py", line 5, in populate_ast
    with open(f'config/{ast_type}_ast.json') as ast_file:
FileNotFoundError: [Errno 2] No such file or directory: 'config/funccall_ast.json'

Trying to dump the AST instead yields:

Traceback (most recent call last):
  File "/home/grayson/.local/bin/secularize", line 8, in <module>
    sys.exit(main())
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/__init__.py", line 172, in main
    dump_ast(args['<file.c>'])
  File "/home/grayson/.local/lib/python3.8/site-packages/secularize/__init__.py", line 165, in dump_ast
    ast = parser.parse(c_text, filename=filename)
  File "/home/grayson/.local/lib/python3.8/site-packages/pycparser/c_parser.py", line 147, in parse
    return self.cparser.parse(
  File "/home/grayson/.local/lib/python3.8/site-packages/pycparser/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/home/grayson/.local/lib/python3.8/site-packages/pycparser/ply/yacc.py", line 1199, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/home/grayson/.local/lib/python3.8/site-packages/pycparser/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
  File "/home/grayson/.local/lib/python3.8/site-packages/pycparser/c_parser.py", line 1931, in p_error
    self._parse_error(
  File "/home/grayson/.local/lib/python3.8/site-packages/pycparser/plyparser.py", line 67, in _parse_error
    raise ParseError("%s: %s" % (coord, msg))
pycparser.plyparser.ParseError: test.hc:1:7: before: "asdf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant