24 lines
371 B
Markdown
24 lines
371 B
Markdown
# Syntax Analysis
|
|
|
|
|
|
## Context-Free Grammars (CFG)
|
|
|
|
## Parse Tree
|
|
|
|
A tree representation of the derivation
|
|
|
|
parse tree has `terminals` at the leaves, `non-terminals` at the interior.
|
|
|
|
An in-order traversal of the leaves is the original input.
|
|
|
|
* leftmost derivation
|
|
* rightmost derivation
|
|
|
|
### Ambiguity
|
|
|
|
should be resolved
|
|
|
|
for example: `A + B * C` should be resolved
|
|
|
|
|