Session 7 - Syntax Parsing
Session 7 - Syntax Parsing
Session 7 - Syntax Parsing
Syntax Parsing
If (b==0) a=b;
Examples
How it works
How it works
Rule Table
Parser (PTCP)
Syntax Parser
Symbolic system:
direct derivation
derivation through 0 or more steps
derivation through 1 or more steps
Some properties
with
and then
Left and right inference
The problem of parsing is essentially the
problem of finding the derivation string
where:
-S: the original symbol
-: the string containing the intermediate
symbol
-ß: the string consisting only of the terminal
symbols
Left and right inference
It is easy to see in the above derivation process:
▪ There are many derivation options from S to ß
▪ An intermediate symbol belonging to a must
sooner or later be transformed by a certain
production rule
▪ If the intermediate symbol chosen for
transformation is always the leftmost of a, then
we call this option a left derivation
▪ Similar definition for right derivation
Left and right inference
Input String