I have implemented till Statements and State in Tree Walk Interpreter. I am pissed with an error

37 Views Asked by At

I have implemented till Statements and State in Tree Walk Interpreter. I am pissed with an error. Can you please help me fix this :

print 5 + 4; [line ] Error at 'print': Expect expression. Exception in thread "main" com.piscan.Zealot.Parser$ParseError at com.piscan.Zealot.Parser.error(Parser.java:131) at com.piscan.Zealot.Parser.primary(Parser.java:227) at com.piscan.Zealot.Parser.unary(Parser.java:202) at com.piscan.Zealot.Parser.factor(Parser.java:185) at com.piscan.Zealot.Parser.term(Parser.java:173) at com.piscan.Zealot.Parser.comparison(Parser.java:160) at com.piscan.Zealot.Parser.equality(Parser.java:50) at com.piscan.Zealot.Parser.expression(Parser.java:45) at com.piscan.Zealot.Parser.expressionStatement(Parser.java:78) at com.piscan.Zealot.Parser.statement(Parser.java:66) at com.piscan.Zealot.Parser.parse(Parser.java:37) at com.piscan.Zealot.Zealot.run(Zealot.java:85) at com.piscan.Zealot.Zealot.runPrompt(Zealot.java:66) at com.piscan.Zealot.Zealot.main(Zealot.java:25)

here's the code Github

This program is meant to evaluate

print 5 + 5; as 10

but it is showing above mentioned error.

0

There are 0 best solutions below