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, 23.06.2019 00:00
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Given a link with a maximum transmission rate of 32.8 mbps. only two computers, x and y, wish to transmit starting at time t = 0 seconds. computer x sends filex (4 mib) and computer y sends filey (244 kib), both starting at time t = 0. statistical multiplexing is used, with details as follows packet payload size = 1000 bytes packet header size = 24 bytes (overhead) ignore processing and queueing delays assume partial packets (packets consisting of less than 1000 bytes of data) are padded so that they are the same size as full packets. assume continuous alternating-packet transmission. computer x gets the transmission medium first. at what time (t = ? ) would filey finish transmitting? give answer in milliseconds, without units, and round to one decimal places (e.g. for an answer of 0.013777 seconds you would enter "13.8" without the quotes)
Answers: 3
question
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
question
Computers and Technology, 23.06.2019 20:30
Column a of irma’s spreadsheet contains titles for each row, but her document is too big and will be printed three pages across. she wants to be sure that every page will be understood. what can irma do to with this problem?
Answers: 3
You know the right answer?
The process of converting an input file (stream of characters) into an understandable format is call...
Questions
question
Geography, 30.04.2021 04:20
question
English, 30.04.2021 04:20
Questions on the website: 13722363