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 15:00
Who is the first president to use social media as part of his campaign strategy
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
question
Computers and Technology, 23.06.2019 17:20
What is the best assassins creed game?
Answers: 2
question
Computers and Technology, 23.06.2019 19:00
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
You know the right answer?
1. Must produce a lex/yacc-based compiler that compiles the example program into assembly code that...
Questions
question
Mathematics, 14.01.2020 05:31
question
Mathematics, 14.01.2020 05:31
question
Mathematics, 14.01.2020 05:31
Questions on the website: 13722362