|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norecess.antlr.PostParse
public class PostParse
Allows processing of parser output. PostScan.parseAs(String) returns
post-parse objects. Assert describes how to deal with these objects
in a practical way; read that documentation first.
For those wanting more details...
There are typically two things you want to do with the results of a successful parse:
getTree() returns the tree generated by the parser. You can
analyze this tree yourself, or use the assertion methods in Assert.
treeParseAs(String) creates a tree parser (built using
IANTLRFrontEnd.createTreeParser(Tree)) and invokes the tree-parser
production you specify. This is useful, obviously, for testing tree parsers.
| Constructor Summary | |
|---|---|
PostParse(org.antlr.runtime.tree.Tree tree,
IANTLRFrontEnd frontEnd)
Constructs a post-parse object. |
|
| Method Summary | |
|---|---|
org.antlr.runtime.tree.Tree |
getTree()
Returns the tree saved in this object. |
Object |
treeParseAs(String production)
Creates an instance of your tree parser and invokes the specified production. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PostParse(org.antlr.runtime.tree.Tree tree,
IANTLRFrontEnd frontEnd)
PostScan.parseAs(String) uses
this, and it's unlikely that it would be generally useful.
tree - the result of a parse.frontEnd - the factory for creating a tree parser.| Method Detail |
|---|
public org.antlr.runtime.tree.Tree getTree()
PostScan.parseAs(String).
public Object treeParseAs(String production)
Object is sufficient.
production - the production rule from the tree parser to invoke.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||