Title: CS 2130
1CS 2130
Revised Version
- Lecture 18
- Bottom-Up Parsing
- or
- Shift-Reduce Parsing
Warning The precedence table given for the Wff
grammar is in error.
2Parsing
- Parsing -- Syntax/Semantic Analysis
- Top-down Parsing
- 1. Root node ? leaves
- 2. Abstract ? concrete
- 3. Uses grammar left ? right
- 4. Works by "guessing"
- Bottom-up Parsing
- 1. Leaves ? root node
- 2. Concrete ? abstract
- 3. Uses grammar right ? left
- 4. Works by "pattern matching"
3Introduction
- Top down parsing
- Scan across the string to be parsed
- Attempt to find patterns that match the right
hand side of a rule - Reduce them to the left hand side of the rule
- If the eventual result is reduction to the start
symbol then parse is successful
4Imagine...
- We are parsing
- 1 2 3
- or
- num num num
- We need some way to make sure that we don't turn
the num num into ltexprgt lttermgt and reduce it
to ltexprgt - Can num num be reduced to ltexprgt ?
- Why is it a problem?
5Problem...
- We cannot reduce
- ltexprgt num
-
- What we need is a way of recognizing that we must
reduce first - num num num
6Recall our expression grammar
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
- It would suggest that what follows a must be a
term. - It would also suggest that if a num is followed
by a then we will somehow need to find a factor
to perform - lttermgt lttermgt ltfactorgt
-
7Bottom Up Parsing
- Bottom up parsing tries to group tokens into
things it can reduce (based on a rule in the
grammar) in the correct sequence - This group of symbols is known as a handle.
- Handles are indicated using special symbols known
as Wirth-Weber operators - These symbols function like parentheses which can
be used to indicate precedence - 1 (2 3)
- We will determine where to put these symbols by
examining the grammar and developing additional
information to assist us
8Wirth-Weber Operators
x lt y y has higher precedence than x (We
expect y will be involved in a reduction before
x) x y x and y have equal precedence (We
expect x and y will be involved in a reduction
together) x gt y x has higher precedence than
y (We expect y will be involved in a reduction
before x)
9Bottom Up Parsing
- Two Things must be understood
- Given the ability to determine precedence between
symbols how can we use this to parse a string? - How do we determine this precedence between
symbols/tokens? - We deliberately choose to explain in this order
and we'll use a very simple grammar to explain
10Recall Well Formed Formulae
- ltwffgt p q r sltwffgt N ltwffgtltwffgt
( C A K E ) ltwffgt ltwffgt - Suppose we wish to parse
- CANpqp
11Bottom Up Parsing
12Bottom Up Parsing
- lt C A N p q p
- We can assume that the string has a leading less
than precedence operator
13Bottom Up Parsing
- lt C lt A N p q p
- We move from left to right (and in fact in
reality we would normally proceed by asking a
lexical scanner for the next token - As we get to each token or symbol we get its
precedence from a precedence table that we'll
present later
14Bottom Up Parsing
- lt C lt A lt N p q p
- We continue in this fashion as long as we place
the lt and operators
15Bottom Up Parsing
- lt C lt A lt N lt p q p
- We continue in this fashion as long as we place
the lt and operators
16Bottom Up Parsing
- lt C lt A lt N lt p q p
- We continue in this fashion as long as we place
lt and operators - We are postponing the discussion on the
precedence table because this part of the
algorithm must be clear to be able to understand
where the precedence table comes from!
17Bottom Up Parsing
- lt C lt A lt N lt p gt q p
- When we place a gt operator we have found a handle
or something that we should be able to reduce - We examine the rules of the grammer to see if
there is a rule to match this handle
18Bottom Up Parsing
- lt C lt A lt N lt p gt q p
- We find
- ltwffgt p
- Note If no rule is found we have a parse error
19Bottom Up Parsing
- lt C lt A lt N ltwffgt q p
- Note that we have removed the entire handle and
replaced it with the appropriate symbol from the
grammar. We "backup" to examine the relationship
between N and ltwffgt
20Bottom Up Parsing
- lt C lt A lt N ltwffgt q p
- We continue
21Bottom Up Parsing
- lt C lt A lt N ltwffgt gt q p
- We continue, again, until we find a handle
22Bottom Up Parsing
- lt C lt A ltwffgt q p
- We can reduce this using the rule
- ltwffgt N ltwffgt
23Bottom Up Parsing
- lt C lt A ltwffgt q p
- We continue
24Bottom Up Parsing
- lt C lt A ltwffgt lt q p
- We continue
25Bottom Up Parsing
- lt C lt A ltwffgt lt q gt p
- We can reduce this one also
26Bottom Up Parsing
- lt C lt A ltwffgt ltwffgt p
- Once again backtracking
27Bottom Up Parsing
- lt C lt A ltwffgt ltwffgt p
- Once again backtracking
28Bottom Up Parsing
- lt C lt A ltwffgt ltwffgt gt p
- Continuing
29Bottom Up Parsing
- lt C ltwffgt p
- Continuing
30Bottom Up Parsing
- lt C ltwffgt p
- Continuing
31Bottom Up Parsing
- lt C ltwffgt lt p
- Continuing
32Bottom Up Parsing
- lt C ltwffgt lt p gt
- A greater than precedence symbol is assumed after
the last symbol in the input.
33Bottom Up Parsing
- lt C ltwffgt ltwffgt
- Continuing
34Bottom Up Parsing
- lt C ltwffgt ltwffgt
- Continuing
35Bottom Up Parsing
- lt C ltwffgt ltwffgt gt
- Again a trailing greater than can be added
36Bottom Up Parsing
- ltwffgt
- Since ltwffgt is our start symbol
- (and we have nothing left over)
- Successful Parse!
37Bottom Up Parsing
- What kind of algorithm?
- Stack based
- Known as semantic stack or shift/reduce algorithm
- We won't code this algorithm but understanding
this parsing technique will make some concepts
found in yacc clearer
38Example
Our stream of tokens C A N p q
p
39Example
Stack
Our stream of tokens C A N p q
p
40Example
Stack
Our stream of tokens C A N p q
p
- Color Commentary
- Welcome to Monday Night Parsing
41Example
Stack
Our stream of tokens A N p q p
lt C
We will place the Wirth-Weber operator and
following token on the stack. Encountering the
end of a handle gt will initiate additional
processing
42Example
Stack
Our stream of tokens N p q p
lt A lt C
Working
43Example
Stack
Our stream of tokens p q p
lt N lt A lt C
Working
44Example
Stack
Our stream of tokens q p
lt p lt N lt A lt C
Working
45Example
Stack
Our stream of tokens q p
lt p lt N lt A lt C
Now, between the next token in the stream (q) and
the symbol on top of the stack, we find a greater
than precedence gt indicating we have the end of
a handle. We must now go down the stack and
search for the beginning
46Example
Stack
Our stream of tokens q p
lt N lt A lt C
We can remove the p and looking at the grammar
determine it can be reduced to be a ltwffgt. We
then examine the ltwffgt in relation to the top of
the stack
47Example
Stack
Our stream of tokens q p
ltwffgt lt N lt A lt C
We can remove the p and looking at the grammar
determine it can be reduced to be a ltwffgt. We
then examine the ltwffgt in relation to the top of
the stack
48Example
Stack
Our stream of tokens q p
ltwffgt lt N lt A lt C
Looking at the ltwffgt followed bt the q we again
find a greater than precedence relationship. We
find that we can reduce the N ltwffgt to a ltwffgt.
49Example
Stack
Our stream of tokens q p
lt A lt C
Now have ltwffgt from previous reduction. Compare
it with A
50Example
Stack
Our stream of tokens q p
ltwffgt lt A lt C
Now have ltwffgt from previous reduction. Compare
it with A
51Example
Stack
Our stream of tokens p
lt q ltwffgt lt A lt C
Working
52Example
Stack
Our stream of tokens p
ltwffgt ltwffgt lt A lt C
q followed by p yields greater than allowing us
to reduce the q to a ltwffgt
53Example
Stack
Our stream of tokens p
ltwffgt ltwffgt lt A lt C
ltwffgt followed by p yields greater than gt so we
reduce the Altwffgtltwffgt to a ltwffgt
54Example
Stack
Our stream of tokens p
ltwffgt lt C
C followed by a ltwffgt yields equal precedence
55Example
Stack
Our stream of tokens
lt p ltwffgt lt C
Working
56Example
Stack
Our stream of tokens
EOS lt p ltwffgt lt C
End of input stream (EOS) allows us to place
greater than precedence operator
57Example
Stack
Our stream of tokens
EOS ltwffgt ltwffgt lt C
End of input stream allows us to reduce
Cltwffgtltwffgt
58Example
Stack
Our stream of tokens
End of input stream allows us to place greater
than precedence operator allowing reduction to
final ltwffgt Since ltwffgt is our start
symbol Successful Parse
59Questions?
60Constructing the Precedence Table
- Being a table which when given two successive
symbols will return to us the correct
interstitial Wirth-Weber Operator
61Precedence Table
Right Hand Symbol
ltwffgt
CAKE
pqrs
N
ltwffgt
CAKE
Left Hand Symbol
pqrs
N
62The Grammar
- ltwffgt p q r s
- ltwffgt N ltwffgt
- ltwffgt C ltwffgt ltwffgt
- ltwffgt A ltwffgt ltwffgt
- ltwffgt K ltwffgt ltwffgt
- ltwffgt E ltwffgt ltwffgt
- Consider the previous slides
- As we move through a string we want to capture as
a handle an occurrences of the rules above
63The Grammar
- ltwffgt p q r s
- ltwffgt N ltwffgt
- ltwffgt C ltwffgt ltwffgt
- ltwffgt A ltwffgt ltwffgt
- ltwffgt K ltwffgt ltwffgt
- ltwffgt E ltwffgt ltwffgt
- Does this seem logical???
64Precedence Table
Right Hand Symbol
ltwffgt
CAKE
pqrs
N
ltwffgt
CAKE
Left Hand Symbol
pqrs
N
65Now consider
- Whenever we come across a p, q, r or s
- We will want to follow this sequence
- A p
- A lt p
- A lt p gt
- A ltwffgt
- So we might reason that any of the terminals C,
A, K, E or N followed by a p, q, r,s will be lt - And a p, q, r or s will always be followed by a gt
66Precedence Table
Right Hand Symbol
ltwffgt
CAKE
pqrs
N
ltwffgt
lt
CAKE
lt
Left Hand Symbol
pqrs
gt
gt
gt
gt
N
lt
67We
- continue to use this reasoning
- Note that anything followed by a C, A, K, E or N
should have lt precedence to allow a proper WFF
to be formed first i.e. - ltanythinggt C ???
- Note also that the exception which we have
already taken care of is p, q, r or s followed by
C, A, K, E or N
68Precedence Table
Right Hand Symbol
ltwffgt
CAKE
pqrs
N
ltwffgt
lt
lt
lt
CAKE
lt
lt
lt
Left Hand Symbol
pqrs
gt
gt
gt
gt
N
lt
lt
lt
Note The exception which we have already taken
care of is p, q, r or s followed by C, A, K, E or
N
69So
- It appears that this technique is quite simple
- We
- Construct a grammar
- Examine it to produce a precedence table
- Write a program to execute our stack based
algorithm - Not so fast!
- There are two issues to deal with
- Simple precedence
- Size
70Simple Precedence
- The technique we have been using is known as
Bottom-Up Parsing or Shift-Reduce Parsing - The action we take during operation is based on
the precedence relationship found - x lt y
- x y
- x gt y
- What happens if there is no relationship in the
table? - What happens if there is more than one
relationship in the table???
Shift
Reduce
71More than one relationship!
- Gadzooks!
- Actually we could deal with lt using lookahead
- (we'll see that in a moment)
- However rules that allowed gt or gtlt would be
known as a shift reduce error - Speaking of errors finding two rules that match
is known as a reduce-reduce error - Not finding a rule that matches is a syntax error
72But how can we have multiple precedence
relationships?
73Recall our expression grammar
- ltexprgt ltexprgt lttermgt lttermgtlttermgt
lttermgt ltfactorgt ltfactorgtltfactorgt '('
ltexprgt ')' num id -
74Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
lttermgt
ltfactorgt
(
)
num
id
75Some things are impossible
76Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
lttermgt
ltfactorgt
(
)
num
id
77We know
- From our WFF example we note that certain items
must be reduced immediately (e.g. p, q, r and s) - In a similar fashion we have
- ltfactorgt num id
- So, anything followed by a num or an id will have
lt and a num or an id followed by anything will
have gt
78Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
lttermgt
ltfactorgt
lt
lt
lt
lt
lt
lt
(
)
gt
gt
gt
num
gt
gt
gt
id
79Precedence
- Between symbols there must be ?
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
80Precedence
- Between symbols there must be
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
-
81Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
lttermgt
ltfactorgt
lt
lt
lt
lt
lt
lt
(
)
gt
gt
gt
num
gt
gt
gt
id
82Precedence
- To determine "end points" we must look at
multiple rules to see how they interact...
ltwffgt
N
ltwffgt
Do not be alarmed We are returning to the wff
example just for a moment
83Precedence
- To determine "end points" we must look at
multiple rules to see how they interact...
ltwffgt
N
ltwffgt
To determine what goes here...
Do not be alarmed We are returning to the wff
example just for a moment
84Precedence
- To determine "end points" we must look at
multiple rules to see how they interact...
ltwffgt
N
ltwffgt
We look here.
Do not be alarmed We are returning to the wff
example just for a moment
85Precedence
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
What is the relationship between and ( ?
? (
86Precedence
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
What is the relationship between and ( If we
have parentheses it must be this form
? (
ltexprgt )
87Precedence
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
ltfactorgt
We go up the parse tree. Since ( ltexprgt ) will
be a factor and a factor will need to be reduced
as part of lttermgt ltfactorgt we conclude that we
will need to reduce the ( ltexprgt ) first
lt (
ltexprgt )
88Precedence
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
What is the relationship between and (
? (
89Precedence
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
Again the grammar reveals that ( must come from
( ltexprgt )
? (
ltexprgt )
90Precedence
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
lttermgt
We examine the parse tree noting that a can
only be followed by a lttermgt
lt ltfactorgt
lt (
ltexprgt )
91Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
lttermgt
ltfactorgt
lt
lt
lt
lt
lt
lt
lt
lt
lt
(
)
gt
gt
gt
num
gt
gt
gt
id
92Continuing to analyze in this way...
93Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
gt
gt
lttermgt
gt
gt
gt
ltfactorgt
lt
lt
lt
lt
lt
lt
lt
lt
lt
lt
(
gt
gt
gt
)
gt
gt
gt
num
gt
gt
gt
id
94Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
gt
gt
lttermgt
gt
gt
gt
ltfactorgt
lt
lt
lt
lt
lt
lt
lt
lt
lt
lt
(
'(' ltexprgt... '(' lt '(' ltexprgt...
gt
gt
gt
)
gt
gt
gt
num
gt
gt
gt
id
95Now for the complex part
- Consider ( followed by ltexprgt
- ( ltexprgt
- Is it
- ( ltexprgt )
- or
- ( ltexprgt lt
ltexprgt ltexprgt lttermgt lttermgt lttermgt
lttermgt ltfactorgt ltfactorgt ltfactorgt '('
ltexprgt ')' num id
96Or
- Consider followed by lttermgt
- lttermgt
- Is it
- lttermgt
- lttermgt )
- lttermgt lt
ltexprgt ltexprgt lttermgt lttermgt lttermgt
lttermgt ltfactorgt ltfactorgt ltfactorgt '('
ltexprgt ')' num id
97Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
gt
gt
lttermgt
gt
gt
gt
ltfactorgt
lt
lt
lt
lt
lt
lt
lt
lt
lt
lt
lt
(
lt
gt
gt
gt
)
gt
gt
gt
num
gt
gt
gt
id
98Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
gt
gt
lttermgt
gt
gt
gt
ltfactorgt
lt
lt
lt
lt
lt
lt
lt
lt
lt
lt
lt
(
lt
gt
gt
gt
)
gt
gt
gt
num
gt
gt
gt
id
99Precedence Table
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
L R
ltexprgt
lttermgt
ltfactorgt
(
num
id
)
ltexprgt
gt
gt
lttermgt
'(' ltexprgt ')'
gt
gt
gt
ltfactorgt
lt
lt
lt
lt
lt
lt
lt
lt
lt
lt
lt
(
lt
gt
gt
gt
)
'(' lt ltexprgt
gt
gt
gt
num
gt
gt
gt
id
100Resolving Ambiguity
- lttermgt
- lt lttermgt ltfactorgt
- Solve by lookahead
- lttermgt or )
- lt lttermgt
- Ambiguity can be resolved by increasing k in
LR(k) but that's not the only way - We could rewrite grammar
101Original Grammar
- ltexprgt ltexprgt lttermgt lttermgtlttermgt
lttermgt ltfactorgt ltfactorgtltfactorgt '('
ltexprgt ')' num id -
102Sources of Ambiguity
- ltexprgt ltexprgt lttermgt lttermgtlttermgt
lttermgt ltfactorgt ltfactorgtltfactorgt '('
ltexprgt ')' num id -
103Add 2 New Rules
- ltexprgt ltexprgt lttermgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltexprgt ')' num id
- ltegt ltexprgt
- lttgt lttermgt
-
104Modify
- ltexprgt ltexprgt lttgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltegt ')' num id
- ltegt ltexprgt
- lttgt lttermgt
-
105Original Grammar
ltexprgt ltexprgt lttermgt lttermgtlttermgt
lttermgt ltfactorgt ltfactorgtltfactorgt '('
ltexprgt ')' num id
Rewritten Grammar
- ltexprgt ltexprgt lttgt lttermgt
- lttermgt lttermgt ltfactorgt ltfactorgt
- ltfactorgt '(' ltegt ')' num id
- ltegt ltexprgt
- lttgt lttermgt
106Bottom-Up Parsing
- No issues regarding left-recursive versus
right-recursive such as those found with Top-down
parsing - Note There are grammars that will break a
bottom-up parser.
107So
- It appears that this technique is quite simple
- We
- Construct a grammar
- Examine it to produce a precedence table
- Write a program to execute our stack based
algorithm - Not so fast!
- There are two issues to deal with
- Simple precedence
- Size
108Performance
- Size of table is O(n2)
- For a "real" language this can be a problem
- One possibility Use operator precedence
- Only uses terminals
- Thus the table size is not affected by adding
non-terminals - We will not go into details of Operator
Precedence Tables - You should be aware that they exist
109Question
- Where do precedence relationships come from?
- Make a table by hand
- Write a program to make table
- How such a program works or how to write it are
topics beyond the scope of this course.
110Example
1111 2 3 Tokenized num num num
112- lt num gt
- lt ltfactorgt gt
1 2 3 Tokenized num num num
113- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
1 2 3 Tokenized num num num
114- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
1 2 3 Tokenized num num num
115- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
- lt ltexprgt lt num
1 2 3 Tokenized num num num
116- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
- lt ltexprgt lt num
- lt ltexprgt lt num gt
1 2 3 Tokenized num num num
117- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
- lt ltexprgt lt num
- lt ltexprgt lt num gt
- lt ltexprgt lt ltfactorgt gt
1 2 3 Tokenized num num num
118- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
- lt ltexprgt lt num
- lt ltexprgt lt num gt
- lt ltexprgt lt ltfactorgt gt
- lt ltexprgt lt lttermgt
1 2 3 Tokenized num num num
119- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
- lt ltexprgt lt num
- lt ltexprgt lt num gt
- lt ltexprgt lt ltfactorgt gt
- lt ltexprgt lt lttermgt
- lt ltexprgt lt lttermgt lt num
1 2 3 Tokenized num num num
120- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
- lt ltexprgt lt num
- lt ltexprgt lt num gt
- lt ltexprgt lt ltfactorgt gt
- lt ltexprgt lt lttermgt
- lt ltexprgt lt lttermgt lt num
- lt ltexprgt lt lttermgt lt num gt
1 2 3 Tokenized num num num
121- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
- lt ltexprgt lt num
- lt ltexprgt lt num gt
- lt ltexprgt lt ltfactorgt gt
- lt ltexprgt lt lttermgt
- lt ltexprgt lt lttermgt lt num
- lt ltexprgt lt lttermgt lt num gt
- lt ltexprgt lt lttermgt ltfactorgt gt
1 2 3 Tokenized num num num
122- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
- lt ltexprgt lt num
- lt ltexprgt lt num gt
- lt ltexprgt lt ltfactorgt gt
- lt ltexprgt lt lttermgt
- lt ltexprgt lt lttermgt lt num
- lt ltexprgt lt lttermgt lt num gt
- lt ltexprgt lt lttermgt ltfactorgt gt
- lt ltexprgt lttermgt gt
1 2 3 Tokenized num num num
123- lt num gt
- lt ltfactorgt gt
- lt lttermgt gt
- lt ltexprgt
- lt ltexprgt lt num
- lt ltexprgt lt num gt
- lt ltexprgt lt ltfactorgt gt
- lt ltexprgt lt lttermgt
- lt ltexprgt lt lttermgt lt num
- lt ltexprgt lt lttermgt lt num gt
- lt ltexprgt lt lttermgt ltfactorgt gt
- lt ltexprgt lttermgt gt
- lt ltexprgt gt
1 2 3 Tokenized num num num
124Questions?
125(No Transcript)