gov.llnl.babel.ast
Class Attribute

java.lang.Object
  extended by gov.llnl.babel.ast.ASTNode
      extended by 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.


Field Summary
 
Fields inherited from class gov.llnl.babel.ast.ASTNode
ILLEGAL_NODEID
 
Constructor Summary
Attribute(ParseTreeNode src)
           
Attribute(ParseTreeNode src, ASTNode parent)
           
Attribute(java.lang.String key, java.lang.String value)
           
 
Method Summary
 java.lang.Object accept(Visitor v, java.lang.Object data)
          implements "Visitor Pattern"
 int compareTo(java.lang.Object o)
           
 java.lang.String getKey()
           
 java.lang.String getValue()
           
 boolean isBuiltin()
           
 java.lang.String toString()
           
 
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
 

Constructor Detail

Attribute

public Attribute(ParseTreeNode src)

Attribute

public Attribute(java.lang.String key,
                 java.lang.String value)

Attribute

public Attribute(ParseTreeNode src,
                 ASTNode parent)
Method Detail

isBuiltin

public boolean isBuiltin()

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()
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 class
data - Optional extra data
Returns:
Optional extra data