Presentation is loading. Please wait.

Presentation is loading. Please wait.

Project Part 2: Parser. Command line: bison –d translate.y Command line: flex filename.l gcc y.tab.c lex.yy.c -lfl Bison.

Similar presentations


Presentation on theme: "Project Part 2: Parser. Command line: bison –d translate.y Command line: flex filename.l gcc y.tab.c lex.yy.c -lfl Bison."— Presentation transcript:

1 Project Part 2: Parser

2 Command line: bison –d translate.y Command line: flex filename.l gcc y.tab.c lex.yy.c -lfl Bison

3 Input to Bison

4

5 semantic actions (sequence of C statements ) unquoted strings not declared as tokens are taken as nonterminals $$ attribute value of production head $i attribute value of ith symbol in production body Default semantic action is $$=$1

6 Input to Bison

7 bison + flex First use flex to generate yy.lex.c without main function In input to bison, put #include “yy.lex.c” in the declaration part of the file Or Compile both c files with gcc


Download ppt "Project Part 2: Parser. Command line: bison –d translate.y Command line: flex filename.l gcc y.tab.c lex.yy.c -lfl Bison."

Similar presentations


Ads by Google