|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Node
xtc.type.Type
xtc.type.WrappedT
xtc.type.VariableT
public class VariableT
A variable. This pseudo-type captures the name for globals, locals, parameters, fields, and bitfields. For the latter, it also captures the field width.
| Nested Class Summary | |
|---|---|
static class |
VariableT.Kind
The variable kind. |
| Nested classes/interfaces inherited from class xtc.type.Type |
|---|
Type.Tag |
| Constructor Summary | |
|---|---|
VariableT(Type template,
Type type,
java.lang.String name,
int width)
Create a new bit-field. |
|
VariableT(Type template,
Type type,
VariableT.Kind kind,
java.lang.String name)
Create a new variable type. |
|
| Method Summary | |
|---|---|
VariableT |
copy()
Create a deep copy of this type. |
VariableT.Kind |
getKind()
Get the kind. |
java.lang.String |
getName()
Get the name. |
int |
getWidth()
Get this variable's width. |
boolean |
hasKind(VariableT.Kind kind)
Determine whether this variable has the specified kind. |
boolean |
hasName()
Determine whether this variable has a name. |
boolean |
hasName(java.lang.String name)
Determine whether this variable has the specified name. |
boolean |
hasVariable()
Determine whether this type contains a variable. |
boolean |
hasWidth()
Determine whether this variable has a width. |
boolean |
isVariable()
Determine whether this type is a variable. |
static VariableT |
newBitfield(Type type,
java.lang.String name,
int width)
Create a new bitfield. |
static VariableT |
newField(Type type,
java.lang.String name)
Create a new field. |
static VariableT |
newGlobal(Type type,
java.lang.String name)
Create a new global variable. |
static VariableT |
newLocal(Type type,
java.lang.String name)
Create a new local variable. |
static VariableT |
newParam(Type type,
java.lang.String name)
Create a new parameter. |
VariableT |
toVariable()
Get this type as a variable. |
void |
write(java.lang.Appendable out)
Write a human readable representation to the specified appendable. |
Type.Tag |
wtag()
Get this wrapped type's tag. |
| Methods inherited from class xtc.type.WrappedT |
|---|
equals, getAttribute, getConstant, getLanguage, getLocation, getScope, getShape, getType, hasAlias, hasAnnotated, hasAttribute, hasConstant, hasEnum, hasEnumerator, hashCode, hasInstantiated, hasLanguage, hasLocation, hasParameterized, hasScope, hasShape, hasTagged, isWrapped, resolve, seal, setType, tag, toAlias, toAnnotated, toEnum, toEnumerator, toInstantiated, toParameterized, toStructOrUnion, toTagged, toWrapped |
| Methods inherited from class xtc.tree.Node |
|---|
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getNode, getProperty, getString, getStringProperty, getTokenText, hasProperty, hasTraversal, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, remove, set, size, strip, toAnnotation, toList, toString, toToken |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public VariableT(Type template,
Type type,
VariableT.Kind kind,
java.lang.String name)
template - The type whose annotations to copy.type - The type.kind - The kind.name - The name.
public VariableT(Type template,
Type type,
java.lang.String name,
int width)
template - The type whose annotations to copy.type - The type.name - The name.width - The width.| Method Detail |
|---|
public VariableT copy()
Type
copy in class Typepublic Type.Tag wtag()
Type
wtag in class TypeType.tag()public boolean isVariable()
Type
isVariable in class Typetrue if this type is a variable.public boolean hasVariable()
Type
hasVariable in class WrappedTtrue if this type contains a variable.Node.hasTraversal()public VariableT toVariable()
Type
toVariable in class WrappedTpublic boolean hasKind(VariableT.Kind kind)
kind - The kind.
true if this variable has the specified
kind.public VariableT.Kind getKind()
public boolean hasName()
true if this variable has a name.public boolean hasName(java.lang.String name)
hasName in class Nodename - The name.
true if this variable has the name.public java.lang.String getName()
getName in class Nodepublic boolean hasWidth()
true if this variable has a width.public int getWidth()
public void write(java.lang.Appendable out)
throws java.io.IOException
NodeObject.toString().
write in class Nodeout - The appendable.
java.io.IOException - Signals an I/O error.
public static VariableT newGlobal(Type type,
java.lang.String name)
type - The type.name - The name.
public static VariableT newLocal(Type type,
java.lang.String name)
type - The type.name - The name.
public static VariableT newParam(Type type,
java.lang.String name)
type - The type.name - The name.
public static VariableT newField(Type type,
java.lang.String name)
type - The type.name - The name.
public static VariableT newBitfield(Type type,
java.lang.String name,
int width)
type - The type.name - The name.width - The width.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||