de.upb.hni.vmagic.statement
Class ForStatement

java.lang.Object
  extended by de.upb.hni.vmagic.VhdlElement
      extended by de.upb.hni.vmagic.LabeledElement
          extended by de.upb.hni.vmagic.statement.SequentialStatement
              extended by de.upb.hni.vmagic.statement.LoopStatement
                  extended by de.upb.hni.vmagic.statement.ForStatement
All Implemented Interfaces:
DeclarativeRegion

public class ForStatement
extends LoopStatement

For loop.

Example:
vMAGIC code:
ForStatement loop = new ForStatement("I",
    new Range(0, Range.Direction.TO, 127));
loop.getStatements().add(new NullStatement());
VHDL output:
for I in 0 to 127 loop
    null;
end loop;

Constructor Summary
ForStatement(java.lang.String loopParameter, DiscreteRange range)
          Creates a for loop.
 
Method Summary
 Constant getParameter()
          Returns loop parameter.
 DiscreteRange getRange()
          Returns the loop range.
 Scope getScope()
          Returns the scope of this declarative region.
 void setRange(DiscreteRange range)
          Sets the loop range.
 
Methods inherited from class de.upb.hni.vmagic.statement.LoopStatement
getStatements
 
Methods inherited from class de.upb.hni.vmagic.statement.SequentialStatement
getLabel, setLabel
 
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

ForStatement

public ForStatement(java.lang.String loopParameter,
                    DiscreteRange range)
Creates a for loop.

Parameters:
loopParameter - the identifier of the loop parameter
range - the loop range
Method Detail

getParameter

public Constant getParameter()
Returns loop parameter.

Returns:
the loop parameter

getRange

public DiscreteRange getRange()
Returns the loop range.

Returns:
the range

setRange

public void setRange(DiscreteRange range)
Sets the loop range.

Parameters:
range - the range

getScope

public Scope getScope()
Description copied from interface: DeclarativeRegion
Returns the scope of this declarative region.

Specified by:
getScope in interface DeclarativeRegion
Overrides:
getScope in class LoopStatement
Returns:
the scope