Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Canonical LR parser
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Creating new item sets === The rest of the item sets can be created by the following algorithm : 1. For each terminal and nonterminal symbol A appearing after a 'β’' in each already existing item set k, create a new item set m by adding to m all the rules of k where 'β’' is followed by A, but only if m will not be the same as an already existing item set after step 3. : 2. shift all the 'β’'s for each rule in the new item set one symbol to the right : 3. create the closure of the new item set : 4. Repeat from step 1 for all newly created item sets, until no more new sets appear In the example we get 5 more sets from item set 0, item set 1 for nonterminal E, item set 2 for nonterminal T, item set 3 for terminal n, item set 4 for terminal '+' and item set 5 for '('. Item set 1 (E): : [S β E β’, $] Item set 2 (T): : [E β T β’, $] : [T β T β’ + n, $] : [T β T β’ + n, +] : Β· : Β· : Β· Item set 3 (n): : [T β n β’, $] : [T β n β’, +] : [T β n β’, )] Item set 4 ('+'): : [T β + β’ T, $] : [T β + β’ T, +] : [T β β’ n, $] : [T β β’ n, +] : [T β β’ + T, $] : [T β β’ + T, +] : [T β β’ T + n, $] : [T β β’ T + n, +] : Β· : Β· : Β· Item set 5 ('('): : [E β ( β’ E ), $] : [E β β’ T, )] : [E β β’ ( E ), )] : [T β β’ n, )] : [T β β’ n, +] : [T β β’ + T, )] : [T β β’ + T, +] : [T β β’ T + n, )] : [T β β’ T + n, +] : Β· : Β· : Β· From item sets 2, 4 and 5 several more item sets will be produced. The complete list is quite long and thus will not be stated here. Detailed LR(k) treatment of this grammar can e.g. be found in [http://david.tribble.com/text/lrk_parsing.html].
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Canonical LR parser
(section)
Add topic