How abhibha1807/semantic-analyser works
This is a C-oriented semantic analyzer: source text is tokenized and parsed, then grammar actions perform context-sensitive checks and maintain a symbol table; the command-line run reports success or failure and displays the table. The README documents checks for reserved names, arithmetic expressions, conflicting declarations, break placement, and function-argument types. The parser excerpt shows its entry point and semantic-action calls, while the lexer excerpt shows token actions. The map omits code generation, which the README describes as a later compiler phase, not an implemented capability here.
Main entry points: y.tab.c Grammar parser · lex.yy.c Token scanner · assgn3.l Lexer rules · assgn3.y Grammar rules
Components 9
Frontend
- Token scanner
code/lex.yy.c - Lexer rules
code/assgn3.l - Grammar parser
code/y.tab.c - Grammar rules
code/assgn3.y
Semantic analysis
- Semantic checks
code/y.tab.c - Symbol table
code/symbolTable.c
Results
- Status and display
code/y.tab.c
Other components
- C source user
- Console output
Connections 8
- C source user → Grammar parser: submits source
README.md - Lexer rules → Token scanner: defines tokens
README.md - Grammar rules → Grammar parser: defines grammar
README.md - Grammar parser → Token scanner: includes scanner
code/y.tab.c - Grammar parser → Semantic checks: runs actions
code/y.tab.c - Semantic checks → Symbol table: queries and updates
code/y.tab.c - Grammar parser → Status and display: runs parse and display
code/y.tab.c - Status and display → Console output: prints results
code/y.tab.c