Computers and Technology

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:30, MoneyMike42
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
image
Computers and Technology, 23.06.2019 00:00, destinysmithds7790
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, quanharris2k19
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the
Answers: 1
image
Computers and Technology, 23.06.2019 23:00, Maya629277
Lucas put a lot of thought into the design for his company's new white paper. he made sure to include repeating design elements such as color schemes and decorative images. his goal was to a. add symmetry b. create a unified publication c. provide consistency d. save money
Answers: 1
Do you know the correct answer?
1. Must produce a lex/yacc-based compiler that compiles the example program into assembly code that...

Questions in other subjects:

Konu
Biology, 24.02.2022 03:00