2. grammar and language

1. grammar G (Z): Z-> aZb | ab definition of what kind of language?

2. Write grammar quaternion form materials 22 pages identifiers in example 2.2.

3. Write the following expressions leftmost derivation and rightmost derivation syntax tree.

G (E):

E=> E + T | T

T=>T * F | F

F=>(E)| i

  • i*i+i
  • i+i*i
  • i+(i+i)

 Observe different leftmost and rightmost derivation process, as well as the similarities and differences of the syntax tree.

 

1.

Rules, also known as rewrite rules, production or formula

 

2.

 3.

 

 

 

Guess you like

Origin www.cnblogs.com/zzj420133722/p/11503108.html