jparse
Class ModifierAST

java.lang.Object
  extended byantlr.BaseAST
      extended byantlr.CommonAST
          extended byantlr.CommonASTWithHiddenTokens
              extended byjparse.JavaAST
                  extended byjparse.ModifierAST
All Implemented Interfaces:
antlr.collections.AST, JavaTokenTypes, Serializable

public final class ModifierAST
extends JavaAST
implements JavaTokenTypes

An AST node that represents a (possibly empty) set of modifiers

Author:
Jerry James
See Also:
Serialized Form

Field Summary
(package private)  int mods
          The modifier values represented by this modifier AST
 
Fields inherited from class jparse.JavaAST
context, currSymTable, noTypes, symTable, topLevel, typeAST
 
Fields inherited from class antlr.CommonASTWithHiddenTokens
hiddenAfter, hiddenBefore
 
Fields inherited from class antlr.CommonAST
 
Fields inherited from class antlr.BaseAST
down, right
 
Fields inherited from interface jparse.JavaTokenTypes
ARRAY_DECLARATOR, ARRAY_INIT, ASSIGN, BAND, BAND_ASSIGN, BNOT, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, CASE_GROUP, CHAR_LITERAL, COLON, COMMA, CONCAT_ASSIGN, CONCATENATION, CONST, CONSTRUCTOR_CALL, CTOR_DEF, DEC, DIV, DIV_ASSIGN, DOT, ELIST, EMPTY_STAT, EOF, EQUAL, ESC, EXPONENT, EXPRESSION_STAT, EXTENDS_CLAUSE, FILE, FLOAT_SUFFIX, FOR_CONDITION, FOR_INIT, FOR_ITERATOR, GE, GOTO, GT, HEX_DIGIT, IDENT, IMPLEMENTS_CLAUSE, INC, INDEX_OP, INSTANCE_INIT, LABELED_STAT, LAND, LBRACK, LCURLY, LE, LITERAL_abstract, LITERAL_boolean, LITERAL_break, LITERAL_byte, LITERAL_case, LITERAL_catch, LITERAL_char, LITERAL_class, LITERAL_continue, LITERAL_default, LITERAL_do, LITERAL_double, LITERAL_else, LITERAL_extends, LITERAL_false, LITERAL_final, LITERAL_finally, LITERAL_float, LITERAL_for, LITERAL_if, LITERAL_implements, LITERAL_import, LITERAL_instanceof, LITERAL_int, LITERAL_interface, LITERAL_long, LITERAL_native, LITERAL_new, LITERAL_null, LITERAL_package, LITERAL_private, LITERAL_protected, LITERAL_public, LITERAL_return, LITERAL_short, LITERAL_static, LITERAL_strictfp, LITERAL_super, LITERAL_switch, LITERAL_synchronized, LITERAL_this, LITERAL_throw, LITERAL_throws, LITERAL_transient, LITERAL_true, LITERAL_try, LITERAL_void, LITERAL_volatile, LITERAL_while, LNOT, LOR, LPAREN, LT, METHOD_CALL, METHOD_DEF, MINUS, MINUS_ASSIGN, ML_COMMENT, MOD, MOD_ASSIGN, MODIFIERS, NOT_EQUAL, NULL_TREE_LOOKAHEAD, NUM_FLOAT, NUM_INT, OBJBLOCK, PARAMETER_DEF, PARAMETERS, PAREN_EXPR, PLUS, PLUS_ASSIGN, POST_DEC, POST_INC, QUESTION, RBRACK, RCURLY, RPAREN, SEMI, SL, SL_ASSIGN, SL_COMMENT, SLIST, SR, SR_ASSIGN, STAR, STAR_ASSIGN, STRING_LITERAL, TYPE, TYPE_STAT, TYPECAST, UNARY_MINUS, UNARY_PLUS, VARIABLE_DEF, VARIABLE_DEFS, VOCAB, WS
 
Constructor Summary
ModifierAST(int modBits)
          Create a new modifier AST node
 
Method Summary
 boolean isAbstract()
          Determine whether this set of modifiers includes the abstract modifier
 boolean isFinal()
          Determine whether this set of modifiers includes the final modifier
 boolean isInterface()
          Determine whether this set of modifiers includes the interface modifier
 boolean isNative()
          Determine whether this set of modifiers includes the native modifier
 boolean isPrivate()
          Determine whether this set of modifiers includes the private modifier
 boolean isProtected()
          Determine whether this set of modifiers includes the protected modifier
 boolean isPublic()
          Determine whether this set of modifiers includes the public modifier
 boolean isStatic()
          Determine whether this set of modifiers includes the static modifier
 boolean isStrict()
          Determine whether this set of modifiers includes the strictfp modifier
 boolean isSynchronized()
          Determine whether this set of modifiers includes the synchronized modifier
 boolean isTransient()
          Determine whether this set of modifiers includes the transient modifier
 boolean isVolatile()
          Determine whether this set of modifiers includes the volatile modifier
(package private)  void setInterface()
          Identify this set of modifiers as belonging to an interface
(package private)  void setInterfaceMethod()
          Identify this as modifiers for an interface method
 String toString()
          Return a string representation of this set of modifiers
 
Methods inherited from class jparse.JavaAST
parseComplete, print, printHiddenAfter, printHiddenBefore
 
Methods inherited from class antlr.CommonASTWithHiddenTokens
getHiddenAfter, getHiddenBefore, initialize
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, initialize, setText, setType
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getColumn, getFirstChild, getLine, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mods

int mods
The modifier values represented by this modifier AST

Constructor Detail

ModifierAST

public ModifierAST(int modBits)
Create a new modifier AST node

Parameters:
modBits - the modifier bits
Method Detail

setInterface

void setInterface()
Identify this set of modifiers as belonging to an interface


setInterfaceMethod

void setInterfaceMethod()
Identify this as modifiers for an interface method


isPublic

public boolean isPublic()
Determine whether this set of modifiers includes the public modifier

Returns:
true if public is included

isPrivate

public boolean isPrivate()
Determine whether this set of modifiers includes the private modifier

Returns:
true if private is included

isProtected

public boolean isProtected()
Determine whether this set of modifiers includes the protected modifier

Returns:
true if protected is included

isStatic

public boolean isStatic()
Determine whether this set of modifiers includes the static modifier

Returns:
true if static is included

isFinal

public boolean isFinal()
Determine whether this set of modifiers includes the final modifier

Returns:
true if final is included

isSynchronized

public boolean isSynchronized()
Determine whether this set of modifiers includes the synchronized modifier

Returns:
true if synchronized is included

isVolatile

public boolean isVolatile()
Determine whether this set of modifiers includes the volatile modifier

Returns:
true if volatile is included

isTransient

public boolean isTransient()
Determine whether this set of modifiers includes the transient modifier

Returns:
true if transient is included

isNative

public boolean isNative()
Determine whether this set of modifiers includes the native modifier

Returns:
true if native is included

isInterface

public boolean isInterface()
Determine whether this set of modifiers includes the interface modifier

Returns:
true if interface is included

isAbstract

public boolean isAbstract()
Determine whether this set of modifiers includes the abstract modifier

Returns:
true if abstract is included

isStrict

public boolean isStrict()
Determine whether this set of modifiers includes the strictfp modifier

Returns:
true if strictfp is included

toString

public String toString()
Return a string representation of this set of modifiers

Specified by:
toString in interface antlr.collections.AST
Returns:
a string representation of this set of modifiers