subject

1. Must produce a lex/yacc-based compiler that compiles the example program into assembly code that gcc accepts and can produce an executable from. You may or may not have any separate C source files; this assignment is still small enough that all you might have is your lex and yacc input source files. 2. Your compiler must also correctly compile similar programs as the above, with multiple functions defined, and multiple function call statements inside a function body.
3. You must have a Makefile that compiles your program. For all C compiling, including the output of the lex and yacc commands, it must use -Wall as a compilation flag. It must have a "clean" target that removes all auto-generated files, including those from lex and yacc. It must have a "test" target that invokes your mini-compiler program on an example source file, then invokes gcc on your resulting assembly source file, and then runs the resulting executable file.
4. Your code must have zero warnings under the -Wall flag usage.
5. Submit a zip file with your lex, yacc, and C source files (not generated ones), and your Makefile and the test program referred to in your "test" target.
That's it!
Hints and Help
Above the rules section in your yacc source file, you will want to have something like this:
/* token value data types */
%union { int ival; char* str; }
/* Starting non-terminal */
%start prog
%type function statements statement funcall
/* Token types */
%token cival> NUMBER COMMA SEMICOLON LPAREN RPAREN LBRACE RBRACE
%token ID STRING

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
How often does colleges update the cost of attendance on their website? . a)every two years b) every four years c) every year d) every semester
Answers: 1
You know the right answer?
1. Must produce a lex/yacc-based compiler that compiles the example program into assembly code that...
Questions
question
History, 13.07.2019 09:00