|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.joanju.cg.util.CgAntlrUtil
public class CgAntlrUtil
Utilities for working with Antlr and ASTs.
Constructor Summary | |
---|---|
CgAntlrUtil()
|
Method Summary | |
---|---|
static java.lang.Object[] |
match(AST ast,
java.lang.Object[] objarray)
Match an AST to a (possibly nested) array of integer node types. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CgAntlrUtil()
Method Detail |
---|
public static java.lang.Object[] match(AST ast, java.lang.Object[] objarray)
Matches AST node types to the integer values in the input Object[]. The first integer value in the Object[] is expected to match the head node of an AST branch. Multiple Object[] may be nested, to describe the shape of the AST to be matched.
The input Object[] may describe just the beginning portion of the AST. The Object[] is not expected to describe the entire AST in order to match.
ast
- Parent node of the AST branch to match.objarray
- Possibly nested Object[] of integer node types.
Zero may be used like "." in Antlr - match any token/node type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |