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

[3-Code generation] invalid grammar #9

Open
BenShen98 opened this issue Feb 12, 2019 · 2 comments
Open

[3-Code generation] invalid grammar #9

BenShen98 opened this issue Feb 12, 2019 · 2 comments

Comments

@BenShen98
Copy link

How should we handle the syntax error? Would the behaviour be undefined or do we need to exit the programme with a message like syntax error?

Would the testbench test on code that is syntactically correct but has invalid grammar?

@ymherklotz
Copy link
Member

As far as I know, invalid code will not be tested. The lexer and parser are already written for you as well, so however it handles invalid input is good enough. The only functions you should have to complete are Compile and Interpret. As there should be no invalid code constructs from the input, it should be fine to just error out.

@johnwickerson
Copy link
Contributor

Right, I intend only to test using valid testcases. So you can do whatever you like if you encounter a syntax error.

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

3 participants