Question

Make sure you are able to: Given a sample sentence and an explanation of its language,...

Make sure you are able to:

  1. Given a sample sentence and an explanation of its language, produce a BNF grammar for the language.
  2. Convert a BNF grammar into an EBNF grammar.
  3. Convert an EBNF grammar into a BNF grammar.
  4. Given a BNF grammar, determine if it is ambiguous.
  5. Rewrite an ambiguous grammar so that it is unambiguous.
  6. Given a BNF grammar, be able to identify the tokens which a lexical analyzer would be able to produce.
  7. Given a BNF grammar, and a list of tokens, construct a state diagram of the language’s lexical analyzer.
  8. Given a BNF grammar, and the definition of parse tree node types, write a JACC grammar for a language. (You only need write the grammar portion of the JACC file.)
  9. Construct a grammar that implies the correct order of operations and associativity for a given set of operators.
  10. Given a grammar and a sample sentence, compute the following:
    1. If the sentence is valid, produce a set of replacements which will generate the sentence.
    2. If the sentence is invalid, show a set of replacements which ends in an error.

Homework Answers

Answer #1

Answer:- Languages form the terrain of computing.

Programming languages, protocol specifications, query languages, file formats, pattern languages, memory layouts, formal languages, config files, mark-up languages, formatting languages and meta-languages shape the way we compute.

So, what shapes languages?

Grammars do.

Grammars are the language of languages.

Behind every language, there is a grammar that determines its structure.

This article explains grammars and common notations for grammars, such as Backus-Naur Form (BNF), Extended Backus-Naur Form (EBNF) and regular extensions to BNF.

Check The Below Examples:-

I Hope You Got Your Solution!

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions