Question
The process of converting an input file (stream of characters) into an understandable format is called syntax analysis. It is usually divided into two parts.
The process of converting an input file (stream of characters) into an understandable format is called syntax analysis. It is usually divided into two parts. The first, lexical analysis, tokenizes the input via a lexical scanner. The second, parsing, generates an abstract model of the tokens and then generates useful content from that model.
You are to write a syntax analyzer using the flex tool for lexical analysis and the bison tool for parsing. The goal of the program is to parse an input file that contains postal addresses and then to output a representation of those addresses in XML. Usage: scanner
parser
Your program may be called with one of two different names (use UNIX symbolic links to create these names).
If your program is called with the name scanner, then it should only provide lexical analysis of the
If your program is called with the name parser, then it should provide both lexical analysis and parsing of the
stdout - should be a set of statements indicating whether the
stderr - should be an XML representation of the addresses read from the
Your C program should only call yyparse() and provide feedback on its return value.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started