gov.llnl.babel.ast
Class Attribute
java.lang.Object
gov.llnl.babel.ast.ASTNode
gov.llnl.babel.ast.Attribute
- All Implemented Interfaces:
- java.lang.Comparable
- public class Attribute
- extends ASTNode
- implements java.lang.Comparable
General encapsulation of built-in attributes (such as final
or
abstract
) as well as user-defined attributes, including both
singletons, or key-value pairs.
Built-in varieties are assumed to have an implicit key with a leading
underscore for instance nonblocking
, oneway
,
local
are all mutually exclusive values on the key
_communication
. Use getVisibleKey
if you
prefer not to be bothered with this implementation detail.
User defined varieties such as %attrib{blue}
are assigned to
keys with the value of null
. Note that keys tend to be
mutually exclusive... so %attrib{color,color=blue}
will cause
a compilation error.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Attribute
public Attribute(ParseTreeNode src)
Attribute
public Attribute(java.lang.String key,
java.lang.String value)
Attribute
public Attribute(ParseTreeNode src,
ASTNode parent)
isBuiltin
public boolean isBuiltin()
setParent
public void setParent(ASTNode parent)
- Overrides:
setParent
in class ASTNode
getKey
public java.lang.String getKey()
getValue
public java.lang.String getValue()
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interface java.lang.Comparable
toString
public java.lang.String toString()
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