|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sc3d.apt.sss.v3.Parser org.sc3d.apt.sss.v3.GrammarParser
public class GrammarParser
A subclass of Parser which parses SSS grammar specifications.
Field Summary | |
---|---|
static Grammar.NonTerminal |
DECLARATION
A Grammar which represents what the specification of SSS grammars calls a 'declaration'. |
static Grammar.NonTerminal |
DECLARATION_PLUS
A Grammar which represents what the specification of SSS grammars calls a 'declaration+'. |
static Grammar.NonTerminal |
GRAMMAR
A Grammar which represents what the specification of SSS grammars calls a 'grammar'. |
static Grammar.NonTerminal |
GRAMMAR_PLUS
A Grammar which represents what the specification of SSS grammars calls a 'grammar+'. |
static GrammarParser |
PARSER
A GrammarParser. |
static Grammar.NonTerminal |
PRODUCTION
A Grammar which represents what the specification of SSS grammars calls a 'production'. |
static Grammar.NonTerminal |
PRODUCTION_PLUS
A Grammar which represents what the specification of SSS grammars calls a 'production+'. |
Fields inherited from class org.sc3d.apt.sss.v3.Parser |
---|
ndfa |
Method Summary | |
---|---|
static Grammar |
fromFile(java.lang.String filename)
Reads the named file, parses it, and returns a Grammar, or dies trying. |
static Grammar |
fromInputStream(java.io.InputStream in)
Reads a string of bytes from 'in', converts it to characters, parses it, and returns a Grammar, or dies trying. |
static Grammar |
fromString(java.lang.String grammar)
Parses 'grammar' and returns a Grammar, or dies trying. |
static void |
main(java.lang.String[] args)
Takes one argument: a filename. |
java.lang.Object |
postProcess(Tree raw)
Parses the contents of all brackets in the grammar file, and returns the Grammar specified by the 'ROOT' declaration. |
Methods inherited from class org.sc3d.apt.sss.v3.Parser |
---|
interactiveTest, parse, parseTokens |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Grammar.NonTerminal GRAMMAR
Note that this is not the Grammar of a grammar specification, which is what the specification of SSS grammars calls a 'declaration+'.
public static final Grammar.NonTerminal GRAMMAR_PLUS
public static final Grammar.NonTerminal PRODUCTION
public static final Grammar.NonTerminal PRODUCTION_PLUS
public static final Grammar.NonTerminal DECLARATION
public static final Grammar.NonTerminal DECLARATION_PLUS
public static final GrammarParser PARSER
Method Detail |
---|
public static Grammar fromString(java.lang.String grammar)
public static Grammar fromFile(java.lang.String filename)
public static Grammar fromInputStream(java.io.InputStream in)
public java.lang.Object postProcess(Tree raw)
postProcess
in class Parser
raw
- a Tree representing a sentence of what the specification of SSS grammars calls a 'declaration+'.
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |