The grammars parsed by the present Groan system are context-free
grammars. They consist of a set of rules that expand non-terminal nodes
(categories) into sequences of non-terminal and terminal nodes (words). The
first symbol in the grammar is always called 'top'. For example:
Grammar
Generates
top --> s; s --> np vp np; np --> det n; vp --> v; v --> "kicks"; v --> "strokes"; det --> "the"; n --> "cat"; n --> "dog"; n --> "boy"; n --> "girl";
The boy kicks the dog.
The girl strokes the cat.
The cat kicks the dog.
The boy strokes the girl.
etc.
Each rule in the grammar must be terminated by a semi-colon, and the
head of the rule is separated from the body by '-->'. The body of the
rule may contain preterminals (symbols consisting of the letters 'a..z',
'A..Z' and '_') or terminals (quoted strings, delimited by double quotes).
Groan performs no recursion checking so be careful not to create infinite
loops in your grammars.
Implements an applet that generates and displays random texts.
RTNGrammar
Implements a class of objects to represent simple RTN grammars.
RTNParser
Implements a parser to read RTN grammars from a text file.
RTNGrammarNode
Basic element of the RTNGrammar, this represents the base class for grammar nodes.
RTNGrammarPreTerminal
A subclass of RTNGrammarNode, this class implements nodes which can be further expanded (i.e. syntactic categories).
RTNGrammarTerminal
A subclass of RTNGrammarNode, this class implements terminal nodes (i.e. lexical items).
ImageButton
Implements a simple button that displays an image and responds to mouse-clicks.
TextDisplayPane
Implements a pane that can display a block of text
ExtendedApplet
Implements parameter parsing and other frequently-required applet functionality.
Project Archive (StuffIt)
Sources and CodeWarrior project in StuffIt 5 format for Macintosh users.
Project Archive (ZIP)
Sources in ZIP format for PC users.
To download source or class files, click on the file icon with your right mouse button (Windows/UNIX) or click and hold (Macintosh) and choose "Save ..." or "Download ...". Archives containing the sources for this applet are provided in StuffIt 5 and Zip format.