gov.llnl.babel.ast

Class Attribute

Implemented Interfaces:
Comparable

public class Attribute
extends ASTNode
implements 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(String key, String value)
Attribute(ParseTreeNode src)
Attribute(ParseTreeNode src, ASTNode parent)

Method Summary

Object
accept(Visitor v, Object data)
int
compareTo(Object o)
String
getKey()
String
getValue()
boolean
isBuiltin()
String
toString()

Methods inherited from class gov.llnl.babel.ast.ASTNode

accept, getFilename, getFirstToken, getLastToken, getNodeId, getParent, getParseTreeNode, getSymbolTableEntry, setFirstToken, setLastToken, setNodeId, setParent, setParseTreeNode, setSymbolTableEntry

Constructor Details

Attribute

public Attribute(String key,
                 String value)

Attribute

public Attribute(ParseTreeNode src)

Attribute

public Attribute(ParseTreeNode src,
                 ASTNode parent)

Method Details

accept

public Object accept(Visitor v,
                     Object data)
Overrides:
accept in interface ASTNode

compareTo

public int compareTo(Object o)

getKey

public String getKey()

getValue

public String getValue()

isBuiltin

public boolean isBuiltin()

toString

public String toString()