[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[Instructions]
[Links]
[Search]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Project]
[Readings]
[Reference]
Misc:
[2001S]
[2002F]
[SamR]
Back to Predictive Parsing (4). On to Shift-Reduce Parsing (1).
Held: Wednesday, 3 March 2004
Summary: Today we look at some details in going from grammar to parser.
Related Pages:
Notes:
Overview:
parse_n
.
Node parse_n(TokenStream ts) throws ParseException { Token tok = ts.peek(); Vector children = new Vector(); Code for rules return new Node(Nonterminals.n,children); } // parse_n(TokenStream)
if ((tok == s0) || (tok == s1) || ... || (tok == sk)) { translation of rhs }
if ((tok == t0) || (tok == t1) || ... || (tok == tl)) { translation of rhs }
consume(T,ts)
parse_m(ts)
repetitionis slightly harder, but not much.
Back to Predictive Parsing (4). On to Shift-Reduce Parsing (1).
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[Honesty]
[Instructions]
[Links]
[Search]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Project]
[Readings]
[Reference]
Misc:
[2001S]
[2002F]
[SamR]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Wed May 5 11:47:05 2004.
The source to the document was last modified on Tue Jan 20 23:06:45 2004.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS362/2004S/Outlines/outline.19.html
.
You may wish to
validate this document's HTML
;
;
Check with Bobby