Skip to content

Instantly share code, notes, and snippets.

@JeOam
Created April 19, 2016 01:54
Show Gist options
  • Save JeOam/fe78ab80482c6d411455db09d0e3dbd2 to your computer and use it in GitHub Desktop.
Save JeOam/fe78ab80482c6d411455db09d0e3dbd2 to your computer and use it in GitHub Desktop.
Compilers Notes
@JeOam
Copy link
Author

JeOam commented Apr 26, 2016

Formally, given a context-free grammar, a parse tree according to the gram­mar is a tree with the following properties:

  1. The root is labeled by the start symbol.
  2. Each leaf is labeled by a terminal or by €
  3. Each interior node is labeled by a nonterminal.
    1. If A is the nonterminal labeling some interior node and Xl , X2 , • • • , Xn are the labels of the children of that node from left to right, then there must be a production A -> XIX2···Xn. Here, XI,X2,... ,Xn each stand for a symbol that is either a terminal or a nonterminal. As a special case, if A -> € is a production, then a node labeled A may have a single child labeled €.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment