public class ProgressAst extends AnnotatedAst
This also provides static implementations of the 4GL built-in functions KEYWORD and KEYWORD-ALL,
Modifier and Type | Field and Description |
---|---|
private static KeywordDictionary |
kwDict
Progress 4GL keyword forward lookup services.
|
private static java.util.HashMap |
reverse
Provide a reverse lookup of token types to keyword text.
|
Constructor and Description |
---|
ProgressAst()
Default constructor.
|
ProgressAst(antlr.Token token)
Constructor which accepts and wrappers token.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescriptiveTokenText()
Returns a descriptive string for the current node.
|
java.lang.String |
getSymbolicTokenType()
Returns the symbolic representation of this AST's token type.
|
static character |
keyword(character text)
Duplicates the Progress 4GL KEYWORD built-in function, which allows
code to lookup if given text is a case-insensitive match (abbreviated or
not) for any valid 4GL keyword.
|
static character |
keyword(java.lang.String text)
Duplicates the Progress 4GL KEYWORD built-in function, which allows
code to lookup if given text is a case-insensitive match (abbreviated or
not) for any valid 4GL keyword.
|
static character |
keywordAll(character text)
Duplicates the Progress 4GL KEYWORD-ALL built-in function, which allows
code to lookup if given text is a case-insensitive match (abbreviated or
not) for any valid 4GL RESERVED keyword.
|
static character |
keywordAll(java.lang.String text)
Duplicates the Progress 4GL KEYWORD-ALL built-in function, which allows
code to lookup if given text is a case-insensitive match (abbreviated or
not) for any valid 4GL RESERVED keyword.
|
java.lang.String |
keywordText(int type)
Returns the "canonical" keyword text that is associated with a given
token type if that type represents a known Progress 4GL language
keyword.
|
java.lang.String |
lookupTokenName(int type)
Translates an integer value of a token type into the associated
human readable text representation.
|
int |
lookupTokenType(java.lang.String tokenName)
Translates a text representation of a token type into the
actual integer value.
|
private static Keyword |
lookupWorker(java.lang.String text)
Lookup a keyword given partial (abbreviated) or full keyword text.
|
absolutePath, ancestor, ancestor, ancestor, annotationCount, annotationKeys, annotationSize, brainwash, brainwash, clearAnnotations, clearIds, compareWith, compareWith, descendant, descendant, descendant, downPath, dumpTree, dumpTree, duplicate, duplicate, duplicateFresh, duplicateFresh, fixupParent, fixups, fixups, getAncestor, getAncestor, getAncestor, getAnnotation, getAnnotation, getAnnotationList, getChildAt, getColumn, getDepth, getFilename, getId, getImmediateChild, getImmediateChild, getIndexPos, getLastImmediateChild, getLeftShadowNode, getLine, getLocal, getNumChildren, getNumImmediateChildren, getNumImmediateChildren, getNumLeftSiblings, getNumRightSiblings, getParent, getPath, getPrevSibling, getRightShadowNode, getShadowNodeList, graft, graftAt, graftCopyTo, graftCopyTo, initialize, initialize, intern, isAncestorOf, isAnnotation, isHidden, isLeaf, isRoot, iterator, iterator, iterator, move, nearestEnclosing, putAnnotation, putAnnotation, putAnnotation, putAnnotation, putAnnotation, putAnnotation, putAnnotation, putAnnotation, putAnnotation, putAnnotationObject, relativePath, remove, removeAnnotation, removeAnnotation, setColumn, setHidden, setId, setLine, setLocal, setParent, sibling, toString, toStringVerbose, upPath
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addChild, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getText, getType, initialize, setFirstChild, setNextSibling, setText, setType, toStringList, toStringTree
private static java.util.HashMap reverse
private static KeywordDictionary kwDict
public ProgressAst()
public ProgressAst(antlr.Token token)
token
- Token upon which this node is based.public static character keyword(character text)
text
- The text to lookup.unknown
if there is no match.public static character keyword(java.lang.String text)
text
- The text to lookup.unknown
if there is no match.public static character keywordAll(character text)
text
- The text to lookup.unknown
if there is no match.public static character keywordAll(java.lang.String text)
text
- The text to lookup.unknown
if there is no match.public java.lang.String keywordText(int type)
type
- The token type for which to reverse lookup the text.null
if this type is not
associated with a language keyword.public int lookupTokenType(java.lang.String tokenName)
lookupTokenType
in interface Aast
lookupTokenType
in class AnnotatedAst
tokenName
- The text representation of the token type.public java.lang.String lookupTokenName(int type)
lookupTokenName
in interface Aast
lookupTokenName
in class AnnotatedAst
type
- The integer token type.null
if
no match was found.public java.lang.String getSymbolicTokenType()
getSymbolicTokenType
in interface Aast
getSymbolicTokenType
in class AnnotatedAst
public java.lang.String getDescriptiveTokenText()
getSymbolicTokenType()
. Otherwise this will result in the
keyword text followed by the symbolic token type in quare brackets.getDescriptiveTokenText
in interface Aast
getDescriptiveTokenText
in class AnnotatedAst
private static Keyword lookupWorker(java.lang.String text)
text
- The keyword text to lookup.null
if no match is
found.