parsingparsing. 2 front-end: parser checks the stream of words and their parts of speech for...
TRANSCRIPT
![Page 1: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/1.jpg)
ParsingParsingParsingParsing
![Page 2: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/2.jpg)
2
Front-End: ParserFront-End: ParserFront-End: ParserFront-End: Parser
Checks the stream of words and their parts of speech for grammatical correctness
scanner parsersourcecode
tokens IR
errors
![Page 3: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/3.jpg)
3
Front-End: ParserFront-End: ParserFront-End: ParserFront-End: Parser
Determines if the input is syntactically well formed
scanner parsersourcecode
tokens IR
errors
![Page 4: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/4.jpg)
4
Front-End: ParserFront-End: ParserFront-End: ParserFront-End: Parser
Guides context-sensitive (“semantic”) analysis (type checking)
scanner parsersourcecode
tokens IR
errors
![Page 5: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/5.jpg)
5
Front-End: ParserFront-End: ParserFront-End: ParserFront-End: Parser
Builds IR for source program
scanner parsersourcecode
tokens IR
errors
![Page 6: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/6.jpg)
6
Syntactic AnalysisSyntactic AnalysisSyntactic AnalysisSyntactic Analysis Natural language analogy:
consider the sentence
He wrote the program
![Page 7: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/7.jpg)
7
Syntactic AnalysisSyntactic AnalysisSyntactic AnalysisSyntactic Analysis
He wrote the program
noun verb article noun
![Page 8: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/8.jpg)
8
Syntactic AnalysisSyntactic AnalysisSyntactic AnalysisSyntactic Analysis
He wrote the program
noun verb article noun
subject predicate object
![Page 9: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/9.jpg)
9
Syntactic AnalysisSyntactic AnalysisSyntactic AnalysisSyntactic Analysis Natural language analogy
He wrote the program
noun verb article noun
subject predicate object
sentence
![Page 10: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/10.jpg)
10
Syntactic AnalysisSyntactic AnalysisSyntactic AnalysisSyntactic Analysis Programming language
if ( b <= 0 ) a = b
bool expr assignment
if-statement
![Page 11: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/11.jpg)
11
Syntactic AnalysisSyntactic AnalysisSyntactic AnalysisSyntactic Analysissyntax errors
int* foo(int i, int j)){ for(k=0; i j; ) fi( i > j ) return j;}
![Page 12: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/12.jpg)
Compiler Compiler ConstructionConstruction
Compiler Compiler ConstructionConstruction
Sohail Aslam
Lecture 11
![Page 13: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/13.jpg)
13
Syntactic AnalysisSyntactic AnalysisSyntactic AnalysisSyntactic Analysisint* foo(int i, int j))
{
for(k=0; i j; )
fi( i > j )
return j;
}
extra parenthesis
Missing expression
not a keyword
![Page 14: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/14.jpg)
14
Semantic AnalysisSemantic AnalysisSemantic AnalysisSemantic Analysis Grammatically correct
He wrote the computer
noun verb article noun
subject predicate object
sentence
![Page 15: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/15.jpg)
15
Semantic AnalysisSemantic AnalysisSemantic AnalysisSemantic Analysis semantically (meaning) wrong!
He wrote the computer
noun verb article noun
subject predicate object
sentence
![Page 16: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/16.jpg)
16
Semantic AnalysisSemantic AnalysisSemantic AnalysisSemantic Analysisint* foo(int i, int j){ for(k=0; i < j; j++ ) if( i < j-2 ) sum = sum+i return sum;}
undeclared var
return type
mismatch
![Page 17: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/17.jpg)
17
Role of the ParserRole of the ParserRole of the ParserRole of the Parser Not all sequences of tokens
are program. Parser must distinguish
between valid and invalid sequences of tokens.
![Page 18: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/18.jpg)
18
Role of the ParserRole of the ParserRole of the ParserRole of the Parser Not all sequences of tokens
are program. Parser must distinguish
between valid and invalid sequences of tokens.
![Page 19: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/19.jpg)
19
Role of the ParserRole of the ParserRole of the ParserRole of the ParserWhat we need
An expressive way to describe the syntax
An acceptor mechanism that determines if input token stream satisfies the syntax
![Page 20: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/20.jpg)
20
Role of the ParserRole of the ParserRole of the ParserRole of the ParserWhat we need
An expressive way to describe the syntax
An acceptor mechanism that determines if input token stream satisfies the syntax
![Page 21: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/21.jpg)
21
Role of the ParserRole of the ParserRole of the ParserRole of the ParserWhat we need
An expressive way to describe the syntax
An acceptor mechanism that determines if input token stream satisfies the syntax
![Page 22: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/22.jpg)
22
Study of ParsingStudy of ParsingStudy of ParsingStudy of Parsing Parsing is the process of
discovering a derivation for some sentence
![Page 23: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/23.jpg)
23
Study of ParsingStudy of ParsingStudy of ParsingStudy of Parsing Mathematical model of
syntax – a grammar G.
Algortihm for testing membership in L(G).
![Page 24: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/24.jpg)
24
Study of ParsingStudy of ParsingStudy of ParsingStudy of Parsing Mathematical model of
syntax – a grammar G.
Algortihm for testing membership in L(G).
![Page 25: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/25.jpg)
25
Context Free GrammarsContext Free GrammarsContext Free GrammarsContext Free GrammarsA CFG is a four tuple
G=(S,N,T,P) S is the start symbol N is a set of non-terminals T is a set of terminals P is a set of productions
![Page 26: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/26.jpg)
26
Why Not Regular Why Not Regular Expressions?Expressions?Why Not Regular Why Not Regular Expressions?Expressions?Reason:
regular languages do not have enough power to express syntax of programming languages.
![Page 27: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/27.jpg)
27
Limitations of Regular Limitations of Regular LanguagesLanguagesLimitations of Regular Limitations of Regular LanguagesLanguages
Finite automaton can’t remember number of times it has visited a particular state
![Page 28: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/28.jpg)
28
Example of CFGExample of CFGExample of CFGExample of CFG
Context-free syntax is specified with a CFG
![Page 29: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/29.jpg)
29
Example of CFGExample of CFGExample of CFGExample of CFG Example
SheepNoise → SheepNoise baa| baa
This CFG defines the set of noises sheep make
![Page 30: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/30.jpg)
30
Example of CFGExample of CFGExample of CFGExample of CFG We can use the
SheepNoise grammar to create sentences
We use the productions as rewriting rules
![Page 31: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/31.jpg)
31
Example of CFGExample of CFGExample of CFGExample of CFGSheepNoise → SheepNoise baa
| baa
Rule Sentential Form- SheepNoise2 baa
![Page 32: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/32.jpg)
32
Example of CFGExample of CFGExample of CFGExample of CFGSheepNoise → SheepNoise baa
| baa
Rule Sentential Form- SheepNoise1 SheepNoise baa2 baa baa
![Page 33: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/33.jpg)
33
Example of CFGExample of CFGExample of CFGExample of CFG
And so on ...
Rule Sentential Form- SheepNoise1 SheepNoise baa1 SheepNoise baa baa2 baa baa baa
![Page 34: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/34.jpg)
34
Example of CFGExample of CFGExample of CFGExample of CFG While it is cute, this
example quickly runs out intellectual steam
To explore uses of CFGs, we need a more complex grammar
![Page 35: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/35.jpg)
35
Example of CFGExample of CFGExample of CFGExample of CFG While it is cute, this
example quickly runs out intellectual steam
To explore uses of CFGs, we need a more complex grammar
![Page 36: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/36.jpg)
36
More Useful GrammarMore Useful GrammarMore Useful GrammarMore Useful Grammar1 expr → expr op expr2 | num3 | id4 op → +5 | –6 | *7 | /
![Page 37: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/37.jpg)
37
Backus-Naur Form (BNF)Backus-Naur Form (BNF)Backus-Naur Form (BNF)Backus-Naur Form (BNF)
Grammar rules in a similar form were first used in the description of the Algol60 Language.
![Page 38: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/38.jpg)
38
Backus-Naur Form (BNF)Backus-Naur Form (BNF)Backus-Naur Form (BNF)Backus-Naur Form (BNF) The notation was developed
by John Backus and adapted by Peter Naur for the Algol60 report.
Thus the term Backus-Naur Form (BNF)
![Page 39: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/39.jpg)
39
Backus-Naur Form (BNF)Backus-Naur Form (BNF)Backus-Naur Form (BNF)Backus-Naur Form (BNF) The notation was developed
by John Backus and adapted by Peter Naur for the Algol60 report.
Thus the term Backus-Naur Form (BNF)
![Page 40: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/40.jpg)
40
Derivation:Derivation:Derivation:Derivation: Let us use the expression
grammar to derive the sentence
x – 2 * y
![Page 41: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/41.jpg)
41
Derivation: Derivation: x – 2 x – 2 ** y yDerivation: Derivation: x – 2 x – 2 ** y yRule Sentential Form
- expr1 expr op expr2 <id,x> op expr5 <id,x> – expr1 <id,x> – expr op
expr
![Page 42: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/42.jpg)
42
Derivation: Derivation: x – 2 x – 2 ** y yDerivation: Derivation: x – 2 x – 2 ** y y
Rule Sentential Form2 <id,x> – <num,2> op
expr6 <id,x> – <num,2>
expr3 <id,x> – <num,2>
<id,y>
![Page 43: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/43.jpg)
43
DerivationDerivationDerivationDerivation Such a process of rewrites
is called a derivation.
Process or discovering a derivations is called parsing
![Page 44: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/44.jpg)
44
DerivationDerivationDerivationDerivation Such a process of rewrites
is called a derivation.
Process or discovering a derivations is called parsing
![Page 45: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/45.jpg)
45
DerivationDerivationDerivationDerivation
We denote this derivation as:
expr →* id – num * id
![Page 46: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/46.jpg)
46
DerivationsDerivationsDerivationsDerivations At each step, we choose a
non-terminal to replace
Different choices can lead to different derivations.
![Page 47: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/47.jpg)
47
DerivationsDerivationsDerivationsDerivations At each step, we choose a
non-terminal to replace
Different choices can lead to different derivations.
![Page 48: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/48.jpg)
48
DerivationsDerivationsDerivationsDerivations Two derivations are of
interest
1. Leftmost derivation
2. Rightmost derivation
![Page 49: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/49.jpg)
49
DerivationsDerivationsDerivationsDerivations Leftmost derivation:
replace leftmost non-terminal (NT) at each step
Rightmost derivation: replace rightmost NT at each step
![Page 50: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/50.jpg)
50
DerivationsDerivationsDerivationsDerivations Leftmost derivation:
replace leftmost non-terminal (NT) at each step
Rightmost derivation: replace rightmost NT at each step
![Page 51: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/51.jpg)
51
DerivationsDerivationsDerivationsDerivations The example on the
preceding slides was leftmost derivation
There is also a rightmost derivation
![Page 52: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/52.jpg)
52
Rightmost DerivationRightmost DerivationRightmost DerivationRightmost DerivationRule Sentential Form
- expr1 expr op expr3 expr op <id,x>6 expr <id,x>1 expr op expr
<id,x>
![Page 53: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/53.jpg)
53
Derivation: Derivation: x – 2 x – 2 ** y yDerivation: Derivation: x – 2 x – 2 ** y y
Rule Sentential Form2 expr op <num,2>
<id,x>5 expr – <num,2>
<id,x>3 <id,x> – <num,2>
<id,y>
![Page 54: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/54.jpg)
54
DerivationsDerivationsDerivationsDerivations In both cases we have
expr →* id – num id
![Page 55: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/55.jpg)
55
DerivationsDerivationsDerivationsDerivations The two derivations produce
different parse trees.
The parse trees imply different evaluation orders!
![Page 56: ParsingParsing. 2 Front-End: Parser Checks the stream of words and their parts of speech for grammatical correctness scannerparser source code tokens](https://reader030.vdocuments.site/reader030/viewer/2022032523/56649d825503460f94a672ab/html5/thumbnails/56.jpg)
56
DerivationsDerivationsDerivationsDerivations The two derivations produce
different parse trees.
The parse trees imply different evaluation orders!