de.upb.hni.vmagic.object
Class Variable

java.lang.Object
  extended by de.upb.hni.vmagic.VhdlElement
      extended by de.upb.hni.vmagic.expression.Expression
          extended by de.upb.hni.vmagic.expression.Primary
              extended by de.upb.hni.vmagic.expression.VhdlObject<T>
                  extended by de.upb.hni.vmagic.object.Variable
All Implemented Interfaces:
Choice, NamedEntity, Target<Variable>, VhdlObjectProvider<Variable>

public class Variable
extends VhdlObject<T>
implements Target<Variable>

Variable.


Nested Class Summary
 
Nested classes/interfaces inherited from class de.upb.hni.vmagic.expression.VhdlObject
VhdlObject.Mode, VhdlObject.ObjectClass
 
Constructor Summary
Variable(java.lang.String identifier, SubtypeIndication type)
          Creates a variable.
Variable(java.lang.String identifier, SubtypeIndication type, Expression defaultValue)
          Creates a variable with a default value.
 
Method Summary
 ArrayElement<T> getArrayElement(Expression... indices)
          Returns an array element of this object.
 ArrayElement<T> getArrayElement(Expression index)
          Returns an array element of this object.
 ArrayElement<T> getArrayElement(int index)
          Returns an array element of this object.
 ArrayElement<T> getArrayElement(java.util.List<Expression> indices)
          Returns an array element of this object.
 AttributeExpression<T> getAttributeExpression(Attribute attribute)
          Returns a attribute expression of this object.
 AttributeExpression<T> getAttributeExpression(Attribute attribute, Expression parameter)
          Returns a attribute expression of this object.
 Expression getDefaultValue()
          Returns the default value.
 java.lang.String getIdentifier()
          Returns the identifier of this object.
 VhdlObject.Mode getMode()
          Returns the mode of this vhdl object.
 VhdlObject.ObjectClass getObjectClass()
          Returns the type of this VhdlObject.
 RecordElement<T> getRecordElement(java.lang.String element)
          Returns a record element of this object.
 Slice<T> getSlice(DiscreteRange range)
          Returns a slice of this vhdl object.
 SubtypeIndication getType()
          Returns the type of this object.
 java.util.List<Variable> getVhdlObjects()
          Returns a list of VhdlObject that are contained in this VhdlObjectProvider.
 boolean isShared()
          Returns if this variable is shared.
 void setDefaultValue(Expression defaultValue)
          Sets the default value.
 void setIdentifier(java.lang.String identifier)
          Sets the identifier of this object.
 void setMode(VhdlObject.Mode mode)
          Sets the mode of this vhdl object.
 void setShared(boolean shared)
          Sets if this variable is shared.
 void setType(SubtypeIndication type)
          Sets the type of this object.
 
Methods inherited from class de.upb.hni.vmagic.expression.Primary
getPrecedence
 
Methods inherited from class de.upb.hni.vmagic.VhdlElement
getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variable

public Variable(java.lang.String identifier,
                SubtypeIndication type)
Creates a variable.

Parameters:
identifier - the identifier
type - the type

Variable

public Variable(java.lang.String identifier,
                SubtypeIndication type,
                Expression defaultValue)
Creates a variable with a default value.

Parameters:
identifier - the identifier
type - the type
defaultValue - the default value
Method Detail

getDefaultValue

public Expression getDefaultValue()
Returns the default value.

Returns:
the default value

setDefaultValue

public void setDefaultValue(Expression defaultValue)
Sets the default value.

Parameters:
defaultValue - the default value

isShared

public boolean isShared()
Returns if this variable is shared.

Returns:
true if the variable is shared

setShared

public void setShared(boolean shared)
Sets if this variable is shared.

Parameters:
shared - true if the variabel should be shared

setMode

public void setMode(VhdlObject.Mode mode)
Sets the mode of this vhdl object.

Parameters:
mode - the mode

getVhdlObjects

public java.util.List<Variable> getVhdlObjects()
Description copied from interface: VhdlObjectProvider
Returns a list of VhdlObject that are contained in this VhdlObjectProvider.

Specified by:
getVhdlObjects in interface VhdlObjectProvider<Variable>
Returns:
list of VhdlObjects

getObjectClass

public VhdlObject.ObjectClass getObjectClass()
Description copied from class: VhdlObject
Returns the type of this VhdlObject.

Specified by:
getObjectClass in class VhdlObject<Variable>
Returns:
the object class

getIdentifier

public java.lang.String getIdentifier()
Returns the identifier of this object.

Specified by:
getIdentifier in interface NamedEntity
Specified by:
getIdentifier in class VhdlObject<T extends VhdlObject>
Returns:
the identifier

setIdentifier

public void setIdentifier(java.lang.String identifier)
Sets the identifier of this object.

Specified by:
setIdentifier in class VhdlObject<T extends VhdlObject>
Parameters:
identifier - the identifier

getType

public SubtypeIndication getType()
Returns the type of this object.

Specified by:
getType in class VhdlObject<T extends VhdlObject>
Returns:
the type

setType

public void setType(SubtypeIndication type)
Sets the type of this object.

Specified by:
setType in class VhdlObject<T extends VhdlObject>
Parameters:
type - the type

getMode

public VhdlObject.Mode getMode()
Returns the mode of this vhdl object.

Specified by:
getMode in class VhdlObject<T extends VhdlObject>
Returns:
the mode

getSlice

public Slice<T> getSlice(DiscreteRange range)
Returns a slice of this vhdl object.

Specified by:
getSlice in class VhdlObject<T extends VhdlObject>
Parameters:
range - the slice range.
Returns:
the slice

getArrayElement

public ArrayElement<T> getArrayElement(Expression index)
Returns an array element of this object.

Specified by:
getArrayElement in class VhdlObject<T extends VhdlObject>
Parameters:
index - the index of the array element
Returns:
the array element

getArrayElement

public ArrayElement<T> getArrayElement(int index)
Returns an array element of this object.

Specified by:
getArrayElement in class VhdlObject<T extends VhdlObject>
Parameters:
index - the index of the array element
Returns:
the array element

getArrayElement

public ArrayElement<T> getArrayElement(java.util.List<Expression> indices)
Returns an array element of this object.

Specified by:
getArrayElement in class VhdlObject<T extends VhdlObject>
Parameters:
indices - the indices of the array element
Returns:
the array element

getArrayElement

public ArrayElement<T> getArrayElement(Expression... indices)
Returns an array element of this object.

Specified by:
getArrayElement in class VhdlObject<T extends VhdlObject>
Parameters:
indices - the indices of the array element
Returns:
the array element

getRecordElement

public RecordElement<T> getRecordElement(java.lang.String element)
Returns a record element of this object.

Specified by:
getRecordElement in class VhdlObject<T extends VhdlObject>
Parameters:
element - the identifier of the record element
Returns:
the record element

getAttributeExpression

public AttributeExpression<T> getAttributeExpression(Attribute attribute)
Returns a attribute expression of this object.

Specified by:
getAttributeExpression in class VhdlObject<T extends VhdlObject>
Parameters:
attribute - the attribute
Returns:
the record element

getAttributeExpression

public AttributeExpression<T> getAttributeExpression(Attribute attribute,
                                                     Expression parameter)
Returns a attribute expression of this object.

Specified by:
getAttributeExpression in class VhdlObject<T extends VhdlObject>
Parameters:
attribute - the attribute
parameter - the parameter
Returns:
the record element