[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 Cancelled. On to Ambiguous Grammars.
Held: Monday, 16 February 2004
Summary: Today we move from lexing to parsing. In particular, we consider the design of more complex languages through BNF grammars.
Related Pages:
Due
Assignments
Notes:
Overview:
simplelanguages that we cannot express.
strings ofa
's andb
's with equal numbers ofa
's andb
's
a
(n+1) as input.
a
i and
a
j, with i
and j different.
a
ib
i and
a
jb
j
(which it should), then it will also accept
a
jb
i and
a
ib
j and
(which it should not).
a
's and b
's may not be implementable on any machine with finite memory.
a
's and b
's if
a
and at least one b
and, if we remove an a
and a b
from the string, we end up with a string with equal numbers of a
's and b
's.
a
's and
b
's if
a
and a b
to a string with an equal number of a
's and b
's.
::=
to separate the two parts of a rule.
Program ::= PROGAM IDENTIFIER OPEN_PAREN identifier-list CLOSE_PAREN declaration-list compound-statement END_PROGRAM
compound-statement ::= BEGIN statement-list END
a statement list can be a statement; it can also be a statement followed by a semicolon and another statement list.
statement-sist ::= statement statement-list ::= statement SEMICOLON statement-list
statement ::= assignment-statement statement ::= compound-statement ... assignment-statement ::= IDENTIFIER BECOMES Expression ...
Back to Cancelled. On to Ambiguous Grammars.
[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:01 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.12.html
.
You may wish to
validate this document's HTML
;
;
Check with Bobby