Spec: Semantic checking may stop on first error

This commit is contained in:
Alex Hirsch 2020-03-20 13:38:02 +01:00
parent 415baac968
commit 328e73e903

View File

@ -322,8 +322,8 @@ This allows for better IDE integration.
Displaying the offending source code along with the error message is helpful, but not required.
Parsing may stop on the first error.
Pay attention to operator precedence.
Error recovery is optional.
Pay attention to operator precedence.
Note that partial mC programs, like an expression or statement, are not valid inputs to the main *parse* function.
The library *may* provide additional functions for parsing single expressions or statements.
@ -360,6 +360,8 @@ As the parser only does syntactic checking, additional semantic checks are imple
- Includes checking operations on arrays (including array size)
- Includes checking arguments and return types for call expressions
Semantic checking may stop on the first error encountered.
In addition to the AST, *symbol tables* are created and used for semantic checking.
Be sure to correctly model [*shadowing*](https://en.wikipedia.org/wiki/Variable_shadowing).