cisc 471 first exam review game questions n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
CISC 471 First Exam Review Game Questions PowerPoint Presentation
Download Presentation
CISC 471 First Exam Review Game Questions

Loading in 2 Seconds...

play fullscreen
1 / 16

CISC 471 First Exam Review Game Questions - PowerPoint PPT Presentation


  • 55 Views
  • Uploaded on

CISC 471 First Exam Review Game Questions. Overview 1. Draw the standard phases of a compiler for compiling a high level language to machine code, showing the input and output forms for each phase. Overview 2.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CISC 471 First Exam Review Game Questions' - price-noble


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
overview 1
Overview 1
  • Draw the standard phases of a compiler for compiling a high level language to machine code, showing the input and output forms for each phase.
overview 2
Overview 2
  • State 2 advantages of using an interpreter instead of a compiler for implementing a language.
  • State 2 advantages of using a compiler instead of an interpreter for implementing a language.
overview 3
Overview 3
  • What are the roles of a:
    • Preprocessor
    • Assembler
    • Linker ?
lexical analysis 1
Lexical Analysis 1
  • Demonstrate that you understand the difference between a token and a lexeme, through an example.
  • Give an example of a language feature that makes scanning nontrivial.
lexical analysis 2
Lexical Analysis 2
  • Give a regular expression that represents exactly the set of decimal numbers that contain at least one digit representing the whole number part, no sign, and if there is a decimal point, then at least one digit to the right of the decimal point. Also, 0. is illegal.
lexical analysis 3
Lexical Analysis 3
  • Show the partitioning of the input string below given the following flex spec rule set:

a*b

bba+c

aaba

b | c

Input: abaabbaabaaaabbbccaabbaaba

cfg 1
CFG 1

Show an equivalent Context free grammar for the regular expression:

S -> (A | B)* BA|C

A -> DA | w

B -> w | x

C -> CD | D

D -> y

cfg 2
CFG 2
  • Show that E -> E + E | w is an ambiguous grammar.
  • How would you rewrite the grammar to remove the ambiguity if + is left associative?
cfg 3
CFG 3
  • Show a leftmost derivation for the string (a,a) with the grammar:

S-> (L) | a

L-> L,S | S

Explain the difference between an abstract syntax tree and a concrete syntax tree and justify why most compilers use abstract syntax trees.

parsing 1
Parsing 1

Explain and show an example of two properties of grammars that cause problems for topdown parsers, and require rewrites or special rules in the yacc file.

Name the two different ways that are used to build top-down parsers.

parsing 2
Parsing 2

Write the recursive descent routine for the following nonterminal:

D -> D , id | id | ε

parsing 3
Parsing 3

Explain the actions of an LR bottom up parser for:

Shift

Reduce

Explain how the parser determines the state to put back on top of the stack after a Reduce.

semantic analysis 1
Semantic Analysis 1
  • Give 3 different examples of errors that are caught by semantic analysis and cannot be caught by the first two phases.
  • Explain the difference between inherited and synthesized attributes.
semantic analysis 2
Semantic Analysis 2

Show the attributed tree for -101 with the rules:

semantic analysis 3
Semantic Analysis 3
  • Why is it a nice property to have an attribute grammar that has only synthesized attributes?
  • Why is a circular attribute grammar a bad property?