Package ru.ispras.verilog.parser.model
Class VerilogProcedure
- 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.VerilogProcedure
-
public final class VerilogProcedure extends VerilogNode
VerilogProcedure
represents functions and tasks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VerilogProcedure.Type
VerilogProcedure.Type
contains the procedure 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
-
Constructor Summary
Constructors Constructor Description VerilogProcedure(VerilogNode parent)
Creates a procedure.VerilogProcedure(VerilogProcedure other, VerilogNode parent)
Creates a copy of the procedure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInput(VerilogPort port)
Adds the port to the signature of the procedure.void
addPort(VerilogDeclaration declaration)
Adds the port from the declaration to the signature of the procedure.VerilogProcedure
clone()
Clones the symbol table.VerilogElementType
getElementType()
Returns the return value type of the procedure.VerilogPort
getOutput()
Returns the output of the procedure.java.util.List<VerilogPort>
getPorts()
Returns the signature of the procedure (i.e., the list of its ports).VerilogStatement
getStatement()
Returns the statement of the procedure.VerilogProcedure.Type
getType()
Returns the type of the procedure.boolean
isAutomatic()
Checks whether the procedure is automatic.boolean
isFunction()
Checks whether the procedure isFUNCTION
.boolean
isSystem()
Checks whether the procedure is a system one.boolean
isTask()
Checks whether the procedure isTASK
.void
setAutomatic()
Makes the procedure automatic.void
setFunction()
Sets the type of the procedure toFUNCTION
.void
setOutput(java.lang.String name, VerilogElementType elementType)
Sets the return value type of the procedure and declares the output.void
setOutput(VerilogDeclaration declaration)
Set the output from the declaration.void
setStatement(VerilogStatement statement)
Sets the statement of the procedure.void
setTask()
Sets the type of the procedure toTASK
.void
setType(VerilogProcedure.Type type)
Sets the type of the procedure.-
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
-
VerilogProcedure
public VerilogProcedure(VerilogNode parent)
Creates a procedure.- Parameters:
parent
- the parent node.
-
VerilogProcedure
public VerilogProcedure(VerilogProcedure other, VerilogNode parent)
Creates a copy of the procedure.- Parameters:
other
- the procedure to be copied.parent
- the parent node.
-
-
Method Detail
-
getType
public VerilogProcedure.Type getType()
Returns the type of the procedure.- Returns:
- the procedure type.
-
setType
public void setType(VerilogProcedure.Type type)
Sets the type of the procedure.- Parameters:
type
- the procedure type.
-
isTask
public boolean isTask()
Checks whether the procedure isTASK
.- Returns:
true
iff the procedure isTASK
.
-
isFunction
public boolean isFunction()
Checks whether the procedure isFUNCTION
.- Returns:
true
iff the procedure isFUNCTION
.
-
setTask
public void setTask()
Sets the type of the procedure toTASK
.
-
setFunction
public void setFunction()
Sets the type of the procedure toFUNCTION
.
-
isSystem
public boolean isSystem()
Checks whether the procedure is a system one.- Returns:
true
iff the procedure is a system one.
-
getElementType
public VerilogElementType getElementType()
Returns the return value type of the procedure.- Returns:
- the return value type of the procedure.
-
setOutput
public void setOutput(java.lang.String name, VerilogElementType elementType)
Sets the return value type of the procedure and declares the output.- Parameters:
name
- the procedure name.elementType
- the return value type.
-
setOutput
public void setOutput(VerilogDeclaration declaration)
Set the output from the declaration.- Parameters:
declaration
- the declaration, whose output to be set.
-
isAutomatic
public boolean isAutomatic()
Checks whether the procedure is automatic.- Returns:
true
iff the procedure is automatic.
-
setAutomatic
public void setAutomatic()
Makes the procedure automatic.
-
getPorts
public java.util.List<VerilogPort> getPorts()
Returns the signature of the procedure (i.e., the list of its ports).- Returns:
- the signature of the procedure.
-
addInput
public void addInput(VerilogPort port)
Adds the port to the signature of the procedure.- Parameters:
port
- the port to be added.
-
addPort
public void addPort(VerilogDeclaration declaration)
Adds the port from the declaration to the signature of the procedure.- Parameters:
declaration
- the declaration, whose port to be added.
-
getOutput
public VerilogPort getOutput()
Returns the output of the procedure.- Returns:
- the output of the procedure.
-
getStatement
public VerilogStatement getStatement()
Returns the statement of the procedure.- Returns:
- the procedure statement.
-
setStatement
public void setStatement(VerilogStatement statement)
Sets the statement of the procedure.- Parameters:
statement
- the statement to be added.
-
clone
public VerilogProcedure clone()
Description copied from class:AbstractSymbolTable
Clones the symbol table.- Specified by:
clone
in classVerilogNode
- Returns:
- a copy of the symbol table.
-
-