edu.mit.ai.psg.jevaES
Class JNName
java.lang.Object
|
+--edu.mit.ai.psg.jevaES.SimpleNode
|
+--edu.mit.ai.psg.jevaES.JevaNode
|
+--edu.mit.ai.psg.jevaES.ExpressionNode
|
+--edu.mit.ai.psg.jevaES.JNName
- public class JNName
- extends ExpressionNode
- implements IExpressionStoreNode, JevaESParserConstants
Jeva parse node for names (including parameters, fields, and class names);
A name x.y.z is parsed with nested names as (((x).y).z).
Note: does not always denote an expression (may be type or package).
| Fields inherited from interface edu.mit.ai.psg.jevaES.JevaESParserConstants |
_DEFAULT,
ABSTRACT,
ANDASSIGN,
ASSIGN,
BANG,
BIT_AND,
BIT_OR,
BOOLEAN,
BREAK,
BYTE,
CASE,
CATCH,
CHAR,
CHARACTER_LITERAL,
CLASS,
COLON,
COMMA,
CONST,
CONTINUE,
DECIMAL_LITERAL,
DECR,
DEFAULT,
DIGIT,
DO,
DOT,
DOUBLE,
ELSE,
EOF,
EQ,
EXPONENT,
EXTENDS,
FALSE,
FINAL,
FINALLY,
FLOAT,
FLOATING_POINT_LITERAL,
FOR,
FORMAL_COMMENT,
GE,
GOTO,
GT,
HEX_LITERAL,
HOOK,
IDENTIFIER,
IF,
IMPLEMENTS,
IMPORT,
INCR,
INSTANCEOF,
INT,
INTEGER_LITERAL,
INTERFACE,
LBRACE,
LBRACKET,
LE,
LETTER,
LONG,
LPAREN,
LSHIFT,
LSHIFTASSIGN,
LT,
MINUS,
MINUSASSIGN,
MULTI_LINE_COMMENT,
NATIVE,
NE,
NEW,
NULL,
OCTAL_LITERAL,
ORASSIGN,
PACKAGE,
PLUS,
PLUSASSIGN,
PRIVATE,
PROTECTED,
PUBLIC,
RBRACE,
RBRACKET,
REM,
REMASSIGN,
RETURN,
RPAREN,
RSIGNEDSHIFT,
RSIGNEDSHIFTASSIGN,
RUNSIGNEDSHIFT,
RUNSIGNEDSHIFTASSIGN,
SC_AND,
SC_OR,
SEMICOLON,
SHORT,
SINGLE_LINE_COMMENT,
SLASH,
SLASHASSIGN,
STAR,
STARASSIGN,
STATIC,
STRING_LITERAL,
SUPER,
SWITCH,
SYNCHRONIZED,
THIS,
THROW,
THROWS,
TILDE,
tokenImage,
TRANSIENT,
TRUE,
TRY,
VOID,
VOLATILE,
WHILE,
WHITE_SPACE,
XOR,
XORASSIGN |
| Methods inherited from class edu.mit.ai.psg.jevaES.JevaNode |
getBeginToken,
getEndToken,
notVerified,
print,
print,
printToken,
printToString,
printToString,
setBeginToken,
setEndToken,
shouldNotHappen,
shouldNotHappen,
shouldNotHappen |
AMBIGUOUS_NAME
public static final int AMBIGUOUS_NAME
AMBIGUOUS_EXPRESSION_NAME
public static final int AMBIGUOUS_EXPRESSION_NAME
VARIABLE_NAME
public static final int VARIABLE_NAME
FIELD_NAME
public static final int FIELD_NAME
ARRAY_FIELD_NAME
public static final int ARRAY_FIELD_NAME
TYPE_NAME
public static final int TYPE_NAME
PACKAGE_NAME
public static final int PACKAGE_NAME
SPECIAL_NAME_THIS
public static final int SPECIAL_NAME_THIS
SPECIAL_NAME_SUPER
public static final int SPECIAL_NAME_SUPER
SPECIAL_NAME_CLASS
public static final int SPECIAL_NAME_CLASS
setNameCategoryToAmbiguousExpression
public void setNameCategoryToAmbiguousExpression()
- context requires an expression; can only narrow category, not widen.
setNameCategoryToVariable
public void setNameCategoryToVariable()
setNameCategoryToField
public void setNameCategoryToField(Field f)
setNameCategoryToArrayField
public void setNameCategoryToArrayField()
setNameCategoryToType
public void setNameCategoryToType(Class c)
setNameCategoryToPackage
public void setNameCategoryToPackage(IPackage p)
setNameCategoryToThis
public void setNameCategoryToThis()
setNameCategoryToSuper
public void setNameCategoryToSuper()
setNameCategoryToClassLiteral
public void setNameCategoryToClassLiteral(Class c)
getNameCategory
public int getNameCategory(IEnv env)
throws VerifyingException
getNameCategory
public int getNameCategory()
categorySetError
protected Error categorySetError(String newCategory)
getFullPackageOrClassName
public String getFullPackageOrClassName(IEnv env)
throws VerifyingException
getSimpleName
public String getSimpleName(IEnv env)
throws VerifyingException
getSimpleName
public String getSimpleName()
getFullPackageOrClassName
public String getFullPackageOrClassName()
getNamedClass
public Class getNamedClass(IEnv env)
throws VerifyingException
getNamedClass
protected Class getNamedClass()
getNamedField
protected Field getNamedField()
getNamedPackage
protected IPackage getNamedPackage()
computeType
public Class computeType(IEnv env)
throws VerifyingException
- Description copied from class: ExpressionNode
- Compute the static type of the expression (nodes should not call
this method directly). Called by getType.
- Overrides:
- computeType in class ExpressionNode
- Tags copied from class: ExpressionNode
- Parameters:
env - environment of name bindings, etc.- Throws:
- VerifyingException - if expression is illegal
- See Also:
EvalMethods.getType(IExpressionNode, IEnv)
computeIsConstant
public boolean computeIsConstant(IEnv env)
throws VerifyingException
- Description copied from class: ExpressionNode
- Compute whether this expression is a constant (nodes should not call
this method directly). Called by the isConstant method.
- Overrides:
- computeIsConstant in class ExpressionNode
- Tags copied from class: ExpressionNode
- Parameters:
env - environment of name bindings, etc.- Throws:
- VerifyingException - if expression is illegal.
- See Also:
ExpressionNode.isConstant(edu.mit.ai.psg.jevaES.IEnv),
EvalMethods.isConstant(IExpressionNode, IEnv)
ErrorNotVariableOrField
protected Error ErrorNotVariableOrField()
isFinal
public boolean isFinal(IEnv env)
throws VerifyingException
- used to test whether assignable. A name can be final but not constant
if it is a final field f of a non-constant expression (expr).f
eval
public Object eval(IEnv env)
throws ThrowException
- Description copied from class: ExpressionNode
- Evaluate this expression (nodes should not call this method
directly). Called by the getValue method.
- Overrides:
- eval in class ExpressionNode
- Tags copied from class: ExpressionNode
- Parameters:
env - environment of name bindings, etc.- Throws:
- ThrowException - if abruptly completed with an exception
- See Also:
ExpressionNode.getValue(edu.mit.ai.psg.jevaES.IEnv),
EvalMethods.eval(IExpressionNode, IEnv)
evalToStore
public IStore evalToStore(IEnv env)
throws ThrowException
- Description copied from interface: IExpressionStoreNode
- return an
IStore which can read and write the
location to assign to.
- Specified by:
- evalToStore in interface IExpressionStoreNode
- Tags copied from interface: IExpressionStoreNode
- Throws:
- ThrowException - if completes abruptly with an exception
reclassifyName
protected void reclassifyName(IEnv env)
throws VerifyingException
computePackage
public IPackage computePackage(IEnv env)
throws VerifyingException
computeParentPackage
public IPackage computeParentPackage(IEnv env)
throws VerifyingException
getFullNameAndCurrentCategory
public String getFullNameAndCurrentCategory()
- for error reports
getNameCategoryName
public String getNameCategoryName()