Reference no: EM132464474
CSC 460/660 - Compiler Construction - University of Nevada
The Espresso Compiler Project
Question:
You are of course free to do things in which ever order you like, but I suggest the following approach.
• Read through the grammar.
• Using the grammar rules, pick out all the terminals and compile a list of them, in the right order, with their names.
• Finish the flex file by adding in all the missing terminals; use the examples already given in the file to get the syntax correct.
• Add all terminals to the CUP file in the right order, and remember they are all of type Token.
• Add all the non-terminals to the CUP file. Since we are not building a parse tree in this phase, simply use the type AST as the type of all the non-terminals. We will refine this when we start building the parse tree in the next phase.
• Add the productions according to the grammar (see below how to interpret the grammar).
Do not construct any parse tree at this time. You may leave the action part of the production, i.e., the part that appears between {: :} blank. For debugging purposes, you could also put print statements that print out the names (and values) associated with the productions. This makes it easier to trace any potential errors. Be VERY careful when you transcribe the grammar; the slightest mistake can cause many hundreds of shift/reduce and reduce/reduce conflicts. I suggest you do it in an iterative fashion, slowly adding more and more information to the file. Do not type in the grammar by hand-copy it from the web page and then 'fix it up'. This will save you a lot of time and headaches caused by mistyping. Also be careful about semicolons; (!) all CUP productions are terminated by a semicolon. The grammar contains ';' as a terminal symbol, but in CUP that would be represented by the terminal SEMICOLON (this is what the semicolon is called by Flex. If you miss these SEMICOLON terminals you will get a lot of shift/reduce and reduce/reduce conflicts, so look for these as the first thing you do if you have such error messages.
• Compile the compiler using the ant command.
• Run the 'espressoc' script to test your compiler.
• Compare to my reference implementation.
Attachment:- Compiler Construction.rar
PGBM02 Managing and Leading People Assignment
: PGBM02 Managing and Leading People Assignment Help and Solution - The University of Sunderland, UK. Critically analyse the role of Line Manager
|
Selected to head up the team to conduct hand-washing audit
: Selected to head up the team to conduct hand-washing audits on all the nursing units. Whom do you want on your team and why?
|
What types of communication did observe
: What types of communication did you observe?Describe differences in communication amongst people (consider differences such as age, gender, ethnicity).
|
What is the author advice to consumers and to businesses
: What is the difference between how consumers perceive personalized ads and how marketers perceive them?What is author's advice to consumers and to businessess
|
Compile the compiler using the ant command
: The Espresso Compiler Projec - Using the grammar rules, pick out all the terminals and compile a list of them, in the right order, with their names.
|
Accounting firm computer network
: For each of the following, state whether you think X is a Binomial random variable, Poisson random variable or neither.
|
Determine how companies are adopting lean practices
: Determine how Companies are adopting lean practices, including inventory management, to improve their operations.Do you think these principles would help manage
|
Breakeven volume between option 1 and option 2
: What is the breakeven volume between option 1 and option 2? You should calculate this answer, but be sure you verify with your graph.
|
Which statistical test should be used to analyze the data
: As a researcher I am interested to know whether participating in sports positively influences self-esteem in young girls. I go ahead and identify a group
|