gov.llnl.babel.ast
Class EnumItem
java.lang.Object
gov.llnl.babel.ast.ASTNode
gov.llnl.babel.ast.EnumItem
- All Implemented Interfaces:
- INameable
public class EnumItem
- extends ASTNode
- implements INameable
A single item inside an enumeration. It has a name and (minimally) and
implicit value. The value may also be set explicitly. The name and final
value should both be unique to the enumeration.
Methods inherited from class gov.llnl.babel.ast.ASTNode |
getFilename, getFirstToken, getLastToken, getNodeId, getParent, getParseTreeNode, getSymbolTableEntry, setFirstToken, setLastToken, setNodeId, setParent, setParseTreeNode, setSymbolTableEntry |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EnumItem
public EnumItem(ParseTreeNode src)
EnumItem
public EnumItem(ParseTreeNode src,
ASTNode parent)
EnumItem
public EnumItem()
getName
public Name getName()
- Specified by:
getName
in interface INameable
setName
public void setName(Name name)
- Specified by:
setName
in interface INameable
hasValue
public boolean hasValue()
getValue
public int getValue()
throws java.lang.NullPointerException
- Throws:
java.lang.NullPointerException
setValue
public void setValue(int i)
isUserValue
public boolean isUserValue()
getExplicitValue
public IntLiteral getExplicitValue()
setExplicitValue
public void setExplicitValue(IntLiteral intLiteral)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
accept
public java.lang.Object accept(Visitor v,
java.lang.Object data)
- Description copied from class:
ASTNode
- implements "Visitor Pattern"
- Specified by:
accept
in class ASTNode
- Parameters:
v
- The visitor classdata
- Optional extra data
- Returns:
- Optional extra data