|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavafe.parser.ParseUtil
Base class for Java parser; provides some basic parsing utilities.
ASTNode
,
ParseType
,
Parse
Field Summary | |
static int[] |
modifierKeywords
Keyword at index i in this array corresponds to bit i in modifier bitset. |
ModifierPragmaVec |
modifierPragmas
As a side effect, parseModifiers mutates this
value. |
protected StackVector |
seqModifierPragma
|
Constructor Summary | |
ParseUtil()
|
Method Summary | |
static java.lang.String |
arrayToString(java.lang.Object[] a,
java.lang.String sep)
|
static void |
error(int loc,
java.lang.String m)
|
void |
expect(Lex l,
int expected)
Takes an expected token from the input stream, calls fail on error. |
static void |
fail(int loc,
java.lang.String m)
Raises a RuntimeException with the argument string including a textual representation of the given source location. |
int |
getJavaModifier(Lex l,
int modifiers)
Checks if the next token is a Java modifier. |
boolean |
isJavaModifier(int ttype)
|
(package private) int |
operatorTokenToTag(int token)
Converts operator tokens to corresponding AST tag. |
ModifierPragmaVec |
parseModifierPragmas(Lex l)
Parse a list of modifier pragmas. |
int |
parseModifiers(Lex l)
Parse a list of modifiers. |
ModifierPragmaVec |
parseMoreModifierPragmas(Lex l,
ModifierPragmaVec orig)
Parse a list of modifier pragmas and adds them to an existing ModifierPragmaVec . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final StackVector seqModifierPragma
public static final int[] modifierKeywords
public ModifierPragmaVec modifierPragmas
parseModifiers
mutates this
value.
Constructor Detail |
public ParseUtil()
Method Detail |
public static void fail(int loc, java.lang.String m)
public static void error(int loc, java.lang.String m)
public void expect(Lex l, int expected)
int operatorTokenToTag(int token)
public ModifierPragmaVec parseModifierPragmas(Lex l)
null
if
l
does not point to a modifier pragma. Otherwise,
reads l
until there are no more modifier pragmas and
returns the resulting list.
public ModifierPragmaVec parseMoreModifierPragmas(Lex l, ModifierPragmaVec orig)
ModifierPragmaVec
. If the existing
ModifierPragmaVec
was null
, then it
either returns null
(if l
does not point
to a modifier pragma), or returns a new
ModifierPragmaVec
.
public int parseModifiers(Lex l)
In addition to parsing Java modifiers, also handles modifier
pragmas (anything with a ttype of TagConstants.MODIFIERPRAGMA).
If no modifier pragmas are seen, sets
Modifiers
public int getJavaModifier(Lex l, int modifiers)
public boolean isJavaModifier(int ttype)
public static java.lang.String arrayToString(java.lang.Object[] a, java.lang.String sep)
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |