subject

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 . (lexical Scanning only )

parser (Lexical Scanning and Parsing)

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 file. In this case, the output should be a list of tokens along with any meta-information about the tokens that may be needed. This should be sent to stdout.

If your program is called with the name "parser", then it should provide both lexical analysis and parsing of the file. In this case, output will be sent to both stdout and stderr:

stdout - should be a set of statements indicating whether the file was successfully processed and should include information about bad addresses.

stderr - should be an XML representation of the addresses read from the file. If errors are encountered during the parsing of an address, you should output the best XML possible and ignore the bad information. In parse mode, all work should be performed by the parser.

Your C program should only call yyparse() and provide feedback on its return value.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i.e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
question
Computers and Technology, 22.06.2019 22:00
Discuss the ways in which electronic information associated with payments is addressed in terms of security. include encryption, secure sockets layers, and secure electronic transactions in your discussion. are there any other ways that consumers and businesses can keep their payment information secure in an electronic commerce environment? do you feel that your information is safe when conducting electronic business? why or why not?
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
You know the right answer?
The process of converting an input file (stream of characters) into an understandable format is call...
Questions
question
Mathematics, 03.11.2020 01:00
question
Physics, 03.11.2020 01:00
question
Mathematics, 03.11.2020 01:00
question
Mathematics, 03.11.2020 01:00
question
Mathematics, 03.11.2020 01:00
question
Advanced Placement (AP), 03.11.2020 01:00
question
English, 03.11.2020 01:00