Follow
character after the first character in the terminal values
Algorithm
- If S is the start symbol, ex: S -> Ab | c, then $ is the Follow value of S
- If A -> αBβ, then all First of β is the Follow of B except ε
- a. A -> αB, then all Follow of A is the Follow of B
- b. A -> αBβ and First of β is ε, then all Follow of A is the Follow of B
You can only find the follow values of the terminal on the lines before it
You can use this algorithm or a cheat method by looking at the result of the production, and find the terminal value after the terminal
Cheat
Ex:
Abc = b
A + b = +
ADE = ...
Status: #idea
Tags: compilation-techniquesCompilation Techniques Notes* [ ] Assigments
RE to DFA
Example Kenny Jingga CT UTS Quiz
kennydfa1.png
kennydfa2.png
kennydfa3.png
Example Ivan Sebastian CT UTS Quiz
RE to E-NFA to DFA
Example Kenny Jingga CT UTS Quiz
kenny1.png
Example Ivan Sebastian CT UTS Quiz
ivan2.png WRONGGGG
Context Free Grammar
Top down parsing
Example Alvina Aulia Top Down Parsing
1. E -> TE'
1. E' -> +TE' | ε
1. T -> FT'
1. T' -> \FT'* | ε
1. F -> (E) | id
First Values:
1. First E = (, id (this is from E -> T -> F)
1. First E' =