Timeline for How to get lookahead symbol when constructing LR(1) NFA for parser?
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 30, 2012 at 6:42 | vote | accept | greenoldman | ||
Nov 29, 2012 at 22:02 | history | tweeted | twitter.com/#!/StackProgrammer/status/274272052968562688 | ||
Nov 29, 2012 at 21:33 | comment | added | Onno | let us continue this discussion in chat | |
Nov 29, 2012 at 21:30 | comment | added | greenoldman | @Onno, please copy your last comment (with addition about FOLLOW set of what) as answer, I will accept it (btw. you are wrong about homework, seriously, but thanks, you helped me). | |
Nov 29, 2012 at 21:29 | comment | added | Onno | I retraced the statement because I thought it might have been worded a bit offensively, and my first version contained an error as well. For clarity for other readers: the lookahead token is a character (or sequence of characters, it's a token after all) defined as either one of the terminals or those tokens which are in the FOLLOW set. | |
Nov 29, 2012 at 21:15 | comment | added | greenoldman |
Fortune teller in action again, and wrong again. Please stop that, it is actually rude. Now, on topic -- thank you for that hint (the one you deleted). I think you are wrong with FIRST, but now when I look at the examples it would make sense to think of lookahead as symbol from FOLLOW set of lhs of production. This is why n is omitted (for example). I have to digest it more deeply.
|
|
Nov 29, 2012 at 21:14 | answer | added | John R. Strohm | timeline score: 0 | |
Nov 29, 2012 at 21:09 | comment | added | Onno | Please consider that you've not even constructed the FOLLOW set before replying. Please do. | |
Nov 29, 2012 at 21:04 | answer | added | Onno | timeline score: 3 | |
Nov 29, 2012 at 20:43 | comment | added | greenoldman |
- is not in the FIRST of T . In state (5) the only valid tokens are ( and n . Since you "clearly know" this is a homework, by pure curiosity -- what was the question?
|
|
Nov 29, 2012 at 20:35 | comment | added | Onno | I'm not going to give you the answer outright, this is clearly a homework question which needs to be understood by you using your own logic in order to be able to really understand the topic in-depth. Construct the FIRST and FOLLOW sets and you'll know why the - sign is in the look-ahead. You should be able to find the answer you're looking for after you've done this. Otherwise, more reading is in order. | |
Nov 29, 2012 at 20:14 | history | edited | greenoldman | CC BY-SA 3.0 |
added 298 characters in body
|
S Nov 29, 2012 at 19:41 | history | suggested | Jay Elston | CC BY-SA 3.0 |
Improved grammar of question.
|
Nov 29, 2012 at 19:23 | review | Suggested edits | |||
S Nov 29, 2012 at 19:41 | |||||
Nov 29, 2012 at 18:38 | review | First posts | |||
Nov 29, 2012 at 19:23 | |||||
Nov 29, 2012 at 18:33 | history | edited | greenoldman | CC BY-SA 3.0 |
added 25 characters in body
|
Nov 29, 2012 at 18:20 | history | asked | greenoldman | CC BY-SA 3.0 |