|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IANTLRFrontEnd
Used as a factory to create the front-end components for an ANTLR tester. You
need only provide useful definitions for the front-end components that you
actually test. (If you don't test the component, ANTLRTester won't
instantiate them.)
ANTLRTester| Method Summary | |
|---|---|
org.antlr.runtime.Lexer |
createLexer(String input)
Creates a lexer. |
org.antlr.runtime.Parser |
createParser(org.antlr.runtime.TokenStream stream)
Creates a parser from the token stream. |
org.antlr.runtime.tree.TreeParser |
createTreeParser(org.antlr.runtime.tree.Tree tree)
Creates a tree parser from the given tree. |
| Method Detail |
|---|
org.antlr.runtime.Lexer createLexer(String input)
String) that
should be processed by the lexer. Use ANTLRStringStream to
convert the String for the lexer:
return new MyOwnLexer(new ANTLRStringStream(input));
input - the raw code to be scanned.
org.antlr.runtime.Parser createParser(org.antlr.runtime.TokenStream stream)
createLexer(String) (done automatically by
ANTLRTester). Your parser's constructor should be able to
receive the token stream directly:
return new MyOwnParser(stream);
stream - the token stream.
org.antlr.runtime.tree.TreeParser createTreeParser(org.antlr.runtime.tree.Tree tree)
createParser(TokenStream) when used with an
ANTLRTester. Your tree-parser's constructor needs a tree-node
stream (and you can use CommonTreeNodeStream):
return new MyOwnTreeParser(new CommonTreeNodeStream(tree));
tree - the tree to parse.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||