CS450 Compiler Design
78
2) Contextual Analysis --> Decorated AST
Contextual Analysis
Decorated Abstract Syntax Tree
Error Reports
Abstract Syntax Tree
Contextual analysis:
•Scope checking: verify that all applied occurrences of identifiers are declared
•Type checking: verify that all operations in the program are used according to their type rules.
Annotate AST:
•Applied identifier occurrences => declaration
•Expressions => Type