Download presentation
Presentation is loading. Please wait.
Published byBrett Gray Modified over 8 years ago
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
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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.