Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
LL parser
(section)
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!
=== Set up === To explain an LL(1) parser's workings we will consider the following small LL(1) grammar: # S β F # S β '''(''' S '''+''' F ''')''' # F β '''a''' and parse the following input: : '''(''' '''a''' '''+''' '''a''' ''')''' An LL(1) parsing table for a grammar has a row for each of the non-terminals and a column for each terminal (including the special terminal, represented here as '''$''', that is used to indicate the end of the input stream). Each cell of the table may point to at most one rule of the grammar (identified by its number). For example, in the parsing table for the above grammar, the cell for the non-terminal 'S' and terminal '<nowiki/>'''('''<nowiki/>' points to the rule number 2: : {| class="wikitable" ! ! ( ! ) ! a ! + ! $ |- align="center" ! S | 2 || {{sdash}} || 1 || {{sdash}} | {{sdash}} |- align="center" ! F | {{sdash}} || {{sdash}} || 3 || {{sdash}} | {{sdash}} |} The algorithm to construct a parsing table is described in a later section, but first let's see how the parser uses the parsing table to process its input.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)