Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / University of California, Irvine ICS 141 Chapter 2 Check your understanding 1)What is the difference between syntax and semantics?   What are the three basic operations that can be used to build complex regular expressions from simpler regular expressions? (CAK) What additional operation (beyond the three of regular expressions) is provided in context-free grammars? What is Backus-Naur form? When and why was it devised? Name a language in which indentation affects program syntax

University of California, Irvine ICS 141 Chapter 2 Check your understanding 1)What is the difference between syntax and semantics?   What are the three basic operations that can be used to build complex regular expressions from simpler regular expressions? (CAK) What additional operation (beyond the three of regular expressions) is provided in context-free grammars? What is Backus-Naur form? When and why was it devised? Name a language in which indentation affects program syntax

Communications

University of California, Irvine

ICS 141

Chapter 2 Check your understanding

1)What is the difference between syntax and semantics?

 

  1. What are the three basic operations that can be used to build complex regular expressions from simpler regular expressions? (CAK)
  2. What additional operation (beyond the three of regular expressions) is provided in context-free grammars?
  3. What is Backus-Naur form? When and why was it devised?
  4. Name a language in which indentation affects program syntax.
  5. When discussing context-free languages, what is a derivation? What is a sentential form?

 

  1. What is the difference between a right-most derivation and a left-most derivation?
  2. What does it mean for a context-free grammar to be ambiguous?
  3. What are associativity and precedence? Why are they significant in parse trees?

 

  1. List the tasks performed by the typical scanner.
  2. What are the advantages of an automatically generated scanner, in comparison to a handwritten one? Why do many commercial compilers use a hand- written scanner anyway?
  3. Explain the difference between deterministic and nondeterministic finite automata. Why do we prefer the deterministic variety for scanning?

 

 

  1. Outline the constructions used to turn a set of regular expressions into a minimal DFA.
  2. What is the “longest possible token” rule?

15. +Why must a scanner sometimes “peek” at upcoming characters?

  1. What is the difference between a keyword and an identifier?
  2. Why must a scanner save the text of tokens?
  3. How does a scanner identify lexical errors? How does it respond?
  4. What is a pragma?
  5. What is the inherent “big-O” complexity of parsing? What is the complexity of parsers used in real compilers?
  6. Summarize the difference between LL and LR parsing. Which one of them is also called “bottom-up”? “Top-down”? Which one is also called “predictive”? “Shift-reduce”? What do “LL” and “LR” stand for?
  7. What kind of parser (top-down or bottom-up) is most common in production compilers?
  8. Why are right-most derivations sometimes called canonical?
  9. What is the significance of the “1” in LR(1)?
  10. Why might we want (or need) different grammars for different parsing algorithms?
  11. What is an epsilon production?
  12. What are recursive descent parsers? Why are they used mostly for small languages?
  13. How might a parser construct an explicit parse tree or syntax tree?

 

  1. Describe two common idioms in context-free grammars that cannot be parsed top-down.

 

  1. What is the “dangling else” problem? How is it avoided in modern languages?

 

  1. Discuss the similarities and differences between recursive descent and table- driven top-down parsing.

 

  1. What are FIRST and FOLLOW sets? What are they used for?
  2. Under what circumstances does a top-down parser predict the production A →α?

 

 

 

 

 

 

  1. What sorts of “obvious” facts form the basis of FIRST set and FOLLOW set construction?
  2. Outline the algorithm used to complete the construction of FIRST and FOLLOW sets. How do we know when we are done?

 

 

 

                                                                                                                    

 

  1. How do we know when a grammar is not LL(1)?
  2. What is the handle of a right sentential form?
  3. Explain the significance of the characteristic finite-state machine in LR parsing
  4. What is the significance of the dot (.) in al LR item?
  5. What is a shift-reduce conflict? How is it resolved in the various kinds of LR- family parsers?

 

 

 

 

 

 

  1. What kind of parser is produced by yacc/bison? By ANTLR?
  2. Why are there never any epsilon productions in an LR(0) grammar?

 

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions