Skip to content

parsing error for multiple line file code #4

Description

@aditya9126

greeting sir.
my name is Aditya Gupta. we have been working a project. and wanted to make a python based compiler. so we started following your blog, which by the way is very helpful. but now we are stack at a point where we have to give an file in input.

input file: in.txt
print(1) print(2)

in.txt

output obtained for this input:

Token('PRINT', 'print') Token('OPEN_PAREN', '(') Token('NUMBER', '0') Token('SUM', '+') Token('NUMBER', '9') Token('CLOSE_PAREN', ')') Token('PRINT', 'print') Token('OPEN_PAREN', '(') Token('NUMBER', '9') Token('CLOSE_PAREN', ')') Traceback (most recent call last): File "C:\Users\admin\AppData\Local\Programs\Python\Python37\CompNew\check2.py", line 385, in <module> parser.parse(tokens).eval() File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\rply\parser.py", line 65, in parse raise ParsingError(None, lookahead.getsourcepos()) rply.errors.ParsingError: (None, None)

error.txt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions