SOLUTION RATED A+
✔✔What did the 2nd Gen. Pl's contribute? - ✔✔1. Recursion
2. Some dynamic data
3. Stronger typing
4. Block structure syntax
5. Free format syntax
6. !!! Formal definition of syntax
✔✔3 Examples of 3rd Gen. PL's - ✔✔1. Pascal
2. C
3. Algol 68
✔✔What did the 3rd Gen. PL's contribute? - ✔✔1. Completed structured control
statements
2. Arrays, records, sets, consts, enum, subtypes
3. User controled data = alloc/dealloc (pointers/references)
4. Stronger Typed System
✔✔3 Examples of 4th Gen. PL's - ✔✔1. Ada 83
2. Modula2
3. Fortran 90
✔✔What did the 4th Gen. PL's contribute? - ✔✔!! Data Abstraction (classes)
✔✔3 Examples of 5th Gen. PL's - ✔✔1. C++
2. Java
3. Ada 95
✔✔What did the 5th Gen. PL's Contribute? - ✔✔1. Inheritance
2. Polymorphism
✔✔What are the parts of BNF? - ✔✔General meta-language to describe grammars of
PL's
T = finite set of terminals
N = finite set of non-terminals
S ∈ N = Start symbol
P = Finite set of rules/productions
✔✔Def: Grammar - ✔✔A set of rules over an alphabet that are used to generate a
language
✔✔Def: Language - ✔✔L(G) = { w | w ∈ T* and w has a parse tree using G }
, ✔✔Def: Sentences - ✔✔Legal strings in L(G)
✔✔Def: Ambiguity Sentence - ✔✔When a given sentence gives 2 or more distinct parse
trees
✔✔Def: Ambiguous Grammar - ✔✔When a grammar can generate at least one
ambiguous sentence, it becomes an ambiguous grammar
✔✔Give an example of Inherently ambiguous language - ✔✔English
✔✔What is Precedence of Operators and how do you achieve it with BNF? -
✔✔Precedence of Operators is the hierarchy (order) in which operators should be
applied
Precedence is achieved through creating productions that reference other productions
(and their LHS's) in a descending order:
<S> => <S> * <R> | <R>
<R> => <R> + <Q> | <Q>
<P> => a
✔✔What is Associativity of Operators and how do you achieve it with BNF? -
✔✔Associativity of Operators is the rule that determines which non-terminals that an
operator will expand
Achieved through the left to right or right to left order when defining productions
✔✔What are the meanings of the EBNF symbols, and how do you convert them to/from
BNF? - ✔✔1. [ ] 0 or 1 times
<T> => <T><R> | <R>
i.e.t <T> => [<T>]<R>
2.{ } 0 or more times
<T list> => <T list><T> | <T>
i.e.t. <T list> => <T>{,<T>}
3. ( ... | ... | ... ) Or operators
<term> => <term> ( * | + | - | / ) <factor>
✔✔What are the 6 properties of Variables? - ✔✔1. name
2. address