Package ru.ispras.verilog.parser.model
Class VerilogLoopStatement
- java.lang.Object
-
- ru.ispras.verilog.parser.core.AbstractSymbolTable<Tag>
-
- ru.ispras.verilog.parser.core.AbstractNode<VerilogNode.Tag>
-
- ru.ispras.verilog.parser.model.VerilogNode
-
- ru.ispras.verilog.parser.model.VerilogStatement
-
- ru.ispras.verilog.parser.model.VerilogLoopStatement
-
public final class VerilogLoopStatement extends VerilogStatement
VerilogLoopStatement
represents loop statements.There are the following loop types:
forever
;repeat
;while
;for
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VerilogLoopStatement.Type
VerilogLoopStatement.Type
contains the loop statement types.-
Nested classes/interfaces inherited from class ru.ispras.verilog.parser.model.VerilogNode
VerilogNode.Tag
-
Nested classes/interfaces inherited from class ru.ispras.verilog.parser.core.AbstractNode
AbstractNode.NodeKind
-
-
Field Summary
Fields Modifier and Type Field Description static VerilogNode.Tag
TAG
static java.util.EnumSet<VerilogNode.Tag>
TAGS_CHILDREN
-
Fields inherited from class ru.ispras.verilog.parser.model.VerilogStatement
TAGS
-
-
Constructor Summary
Constructors Constructor Description VerilogLoopStatement(VerilogLoopStatement other, VerilogNode parent)
Creates a copy of the loop statement.VerilogLoopStatement(VerilogNode parent)
Creates a loop statement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VerilogLoopStatement
clone()
Clones the symbol table.VerilogExpression
getExpression()
Returns the expression of the loop.VerilogAssignment
getInitialization()
Returns the initialization assignment of theFOR
loop.VerilogAssignment
getIteration()
Returns the iteration assignment of theFOR
loop.VerilogStatement
getStatement()
Returns the loop body.VerilogLoopStatement.Type
getType()
Returns the type of the loop.boolean
isFor()
Checks whether the loop isFOR
.boolean
isForever()
Checks whether the loop isFOREVER
.boolean
isRepeat()
Checks whether the loop isREPEAT
.boolean
isWhile()
Checks whether the loop isWHILE
.void
setExpression(VerilogExpression expression)
Sets the expression of the loop.void
setFor()
Sets the type of loop toFOR
.void
setForever()
Sets the type of loop toFOREVER
.void
setInitialization(VerilogAssignment initialization)
Sets the initialization assignment of theFOR
loop.void
setIteration(VerilogAssignment iteration)
Sets the iteration assignment of theFOR
loop.void
setRepeat()
Sets the type of loop toREPEAT
.void
setStatement(VerilogStatement statement)
Sets the loop body.void
setType(VerilogLoopStatement.Type type)
Sets the type of the loop.void
setWhile()
Sets the type of loop toWHILE
.-
Methods inherited from class ru.ispras.verilog.parser.model.VerilogNode
getAttributes, getParentNode, isActivity, isAssertionStatement, isAssign, isAssignment, isAssignStatement, isAttribute, isBlockGenerate, isBlockStatement, isCaseGenerate, isCaseGenerateItem, isCaseStatement, isCaseStatementItem, isCode, isConnection, isDeclaration, isDelayedStatement, isDisableStatement, isGenerate, isIfGenerate, isIfGenerateBranch, isIfStatement, isIfStatementBranch, isInstantiation, isLoopGenerate, isLoopStatement, isModule, isNullStatement, isPathDeclaration, isPort, isPortConnection, isProcedure, isPropertyDeclaration, isPulseStyle, isSequenceDeclaration, isShowCancelled, isSpecify, isSvaPort, isTable, isTableEntry, isTaskStatement, isTriggerStatement, isWaitStatement, setAttributes, union
-
Methods inherited from class ru.ispras.verilog.parser.core.AbstractNode
add, find, getFullName, getName, getParent, getTag, hasName, hasScope, isTransparent, items, items, items, remove, replace, setName, setParent, setRedefinitionHandler, setTag, toString
-
Methods inherited from class ru.ispras.verilog.parser.core.AbstractSymbolTable
addAll, findAroundRecursively, findAroundRecursively, findRecursively, findRecursively, getUpperTable, items, items, setUpperTable
-
-
-
-
Field Detail
-
TAG
public static final VerilogNode.Tag TAG
-
TAGS_CHILDREN
public static final java.util.EnumSet<VerilogNode.Tag> TAGS_CHILDREN
-
-
Constructor Detail
-
VerilogLoopStatement
public VerilogLoopStatement(VerilogNode parent)
Creates a loop statement.- Parameters:
parent
- the node parent.
-
VerilogLoopStatement
public VerilogLoopStatement(VerilogLoopStatement other, VerilogNode parent)
Creates a copy of the loop statement.- Parameters:
other
- the loop statement to be copied.parent
- the parent node.
-
-
Method Detail
-
getType
public VerilogLoopStatement.Type getType()
Returns the type of the loop.- Returns:
- the loop type.
-
setType
public void setType(VerilogLoopStatement.Type type)
Sets the type of the loop.- Parameters:
type
- the type to be set.
-
isForever
public boolean isForever()
Checks whether the loop isFOREVER
.- Returns:
true
iff the loop isFOREVER
.
-
isRepeat
public boolean isRepeat()
Checks whether the loop isREPEAT
.- Returns:
true
iff the loop isREPEAT
.
-
isWhile
public boolean isWhile()
Checks whether the loop isWHILE
.- Returns:
true
iff the loop isWHILE
.
-
isFor
public boolean isFor()
Checks whether the loop isFOR
.- Returns:
true
iff the loop isFOR
.
-
setForever
public void setForever()
Sets the type of loop toFOREVER
.
-
setRepeat
public void setRepeat()
Sets the type of loop toREPEAT
.
-
setWhile
public void setWhile()
Sets the type of loop toWHILE
.
-
setFor
public void setFor()
Sets the type of loop toFOR
.
-
getInitialization
public VerilogAssignment getInitialization()
Returns the initialization assignment of theFOR
loop.- Returns:
- the initialization assignment.
-
setInitialization
public void setInitialization(VerilogAssignment initialization)
Sets the initialization assignment of theFOR
loop.- Parameters:
initialization
- the assignment to be set.
-
getExpression
public VerilogExpression getExpression()
Returns the expression of the loop.- Returns:
- the expression.
-
setExpression
public void setExpression(VerilogExpression expression)
Sets the expression of the loop.- Parameters:
expression
- the expression to be set.
-
getIteration
public VerilogAssignment getIteration()
Returns the iteration assignment of theFOR
loop.- Returns:
- the iteration assignment.
-
setIteration
public void setIteration(VerilogAssignment iteration)
Sets the iteration assignment of theFOR
loop.- Parameters:
iteration
- the assignment to be set.
-
getStatement
public VerilogStatement getStatement()
Returns the loop body.- Returns:
- the loop body.
-
setStatement
public void setStatement(VerilogStatement statement)
Sets the loop body.- Parameters:
statement
- the body to be set.
-
clone
public VerilogLoopStatement clone()
Description copied from class:AbstractSymbolTable
Clones the symbol table.- Specified by:
clone
in classVerilogStatement
- Returns:
- a copy of the symbol table.
-
-