Instructions for Compiling Programs: Task 3: Part1 Semantic Analysis
Compilation Command:
- yacc -d semantic.y
- lex semantic.l
- gcc lex.yy.c y.tab.c -ll
- ./a.out
Task 3: Part2 Abstract Syntax Tree
Compilation Command:
- yacc -d ast.y
- lex ast.l
- gcc lex.yy.c y.tab.c -ll
- ./a.out> p1.txt 5.python3 tree.py
Task 4: 3 Address Code
Compilation Command:
- yacc -d 3ac.y
- lex 3ac.l
- gcc lex.yy.c y.tab.c -ll
- ./a.out
Task 5: Compiler Outputs
Compilation Command:
- yacc -d p1.y
- lex p1.l
- gcc lex.yy.c y.tab.c rough.c -ll
- ./a.out