Package ru.ispras.verilog.parser.model
Class VerilogNode
- java.lang.Object
-
- ru.ispras.verilog.parser.core.AbstractSymbolTable<Tag>
-
- ru.ispras.verilog.parser.core.AbstractNode<VerilogNode.Tag>
-
- ru.ispras.verilog.parser.model.VerilogNode
-
- Direct Known Subclasses:
SvaDeclaration
,SvaInstantiation
,SvaPort
,VerilogActivity
,VerilogAssign
,VerilogAssignment
,VerilogAttribute
,VerilogBlockGenerate
,VerilogCaseGenerate
,VerilogCaseGenerateItem
,VerilogCaseStatementItem
,VerilogCode
,VerilogDeclaration
,VerilogDefineParameter
,VerilogGenerate
,VerilogIfGenerate
,VerilogIfGenerateBranch
,VerilogIfStatementBranch
,VerilogInstantiation
,VerilogLoopGenerate
,VerilogModule
,VerilogPathDeclaration
,VerilogPort
,VerilogPortConnection
,VerilogProcedure
,VerilogPulseStyle
,VerilogShowCancelled
,VerilogSpecify
,VerilogStatement
,VerilogTable
,VerilogTableEntry
public abstract class VerilogNode extends AbstractNode<VerilogNode.Tag>
VerilogNode
represents a basic AST node for the Verilog HDL.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VerilogNode.Tag
VerilogNode.Tag
contains the node types.-
Nested classes/interfaces inherited from class ru.ispras.verilog.parser.core.AbstractNode
AbstractNode.NodeKind
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
VerilogNode(VerilogNode.Tag tag, java.util.EnumSet<VerilogNode.Tag> childrenTags, AbstractNode.NodeKind kind)
Creates a top-level node (i.e.protected
VerilogNode(VerilogNode.Tag tag, java.util.EnumSet<VerilogNode.Tag> childrenTags, AbstractNode.NodeKind kind, VerilogNode parent)
Creates a node.protected
VerilogNode(VerilogNode other, VerilogNode parent)
Creates a copy of the node.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract VerilogNode
clone()
Clones the symbol table.java.util.Collection<VerilogAttribute>
getAttributes()
Returns the attributes of the node.VerilogNode
getParentNode()
Returns the parent node.boolean
isActivity()
Checks whether the node isACTIVITY
.boolean
isAssertionStatement()
Checks whether the node isASSERTION_STATEMENT
.boolean
isAssign()
Checks whether the node isASSIGN
.boolean
isAssignment()
Checks whether the node isASSIGNMENT
.boolean
isAssignStatement()
Checks whether the node isASSIGN_STATEMENT
.boolean
isAttribute()
Checks whether the node isATTRIBUTE
.boolean
isBlockGenerate()
Checks whether the node isBLOCK_GENERATE
.boolean
isBlockStatement()
Checks whether the node isBLOCK_STATEMENT
.boolean
isCaseGenerate()
Checks whether the node isCASE_GENERATE
.boolean
isCaseGenerateItem()
Checks whether the node isCASE_GENERATE_ITEM
.boolean
isCaseStatement()
Checks whether the node isCASE_STATEMENT
.boolean
isCaseStatementItem()
Checks whether the node isCASE_STATEMENT_ITEM
.boolean
isCode()
Checks whether the node isCODE
.boolean
isConnection()
Checks whether the node isPORT_CONNECTION
.boolean
isDeclaration()
Checks whether the node isDECLARATION
.boolean
isDelayedStatement()
Checks whether the node isDELAYED_STATEMENT
.boolean
isDisableStatement()
Checks whether the node isDISABLE_STATEMENT
.boolean
isGenerate()
Checks whether the node isGENERATE
.boolean
isIfGenerate()
Checks whether the node isIF_GENERATE
.boolean
isIfGenerateBranch()
Checks whether the node isIF_GENERATE_BRANCH
.boolean
isIfStatement()
Checks whether the node isIF_STATEMENT
.boolean
isIfStatementBranch()
Checks whether the node isIF_STATEMENT_BRANCH
.boolean
isInstantiation()
Checks whether the node isINSTANTIATION
.boolean
isLoopGenerate()
Checks whether the node isLOOP_GENERATE
.boolean
isLoopStatement()
Checks whether the node isLOOP_STATEMENT
.boolean
isModule()
Checks whether the node isMODULE
.boolean
isNullStatement()
Checks whether the node isNULL_STATEMENT
.boolean
isPathDeclaration()
Checks whether the node isPATH_DECLARATION
.boolean
isPort()
Checks whether the node isPORT
.boolean
isPortConnection()
Checks whether the node isPORT_CONNECTION
.boolean
isProcedure()
Checks whether the node isPROCEDURE
.boolean
isPropertyDeclaration()
Checks whether the node isPROPERTY_DECLARATION
.boolean
isPulseStyle()
Checks whether the node isPULSE_STYLE
.boolean
isSequenceDeclaration()
Checks whether the node isSEQUENCE_DECLARATION
.boolean
isShowCancelled()
Checks whether the node isSHOW_CANCELLED
.boolean
isSpecify()
Checks whether the node isSPECIFY
.boolean
isSvaPort()
Checks whether the node isSVA_PORT
.boolean
isTable()
Checks whether the node isTABLE
.boolean
isTableEntry()
Checks whether the node isTABLE_ENTRY
.boolean
isTaskStatement()
Checks whether the node isTASK_STATEMENT
.boolean
isTriggerStatement()
Checks whether the node isTRIGGER_STATEMENT
.boolean
isWaitStatement()
Checks whether the node isWAIT_STATEMENT
.void
setAttributes(java.util.Collection<VerilogAttribute> attributes)
Sets attributes of the node.static java.util.EnumSet<VerilogNode.Tag>
union(java.util.EnumSet<VerilogNode.Tag> lhs, java.util.EnumSet<VerilogNode.Tag> rhs)
Unites two sets of tags.-
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
-
-
-
-
Constructor Detail
-
VerilogNode
protected VerilogNode(VerilogNode.Tag tag, java.util.EnumSet<VerilogNode.Tag> childrenTags, AbstractNode.NodeKind kind, VerilogNode parent)
Creates a node.- Parameters:
tag
- the tag.childrenTags
- the tags of admissible children.kind
- the kind.parent
- the parent node.
-
VerilogNode
protected VerilogNode(VerilogNode.Tag tag, java.util.EnumSet<VerilogNode.Tag> childrenTags, AbstractNode.NodeKind kind)
Creates a top-level node (i.e. a node withnull
parent).- Parameters:
tag
- the tag.childrenTags
- the tags of admissible children.kind
- the kind.
-
VerilogNode
protected VerilogNode(VerilogNode other, VerilogNode parent)
Creates a copy of the node.- Parameters:
other
- the node to be copied.parent
- the parent node to be set.
-
-
Method Detail
-
union
public static java.util.EnumSet<VerilogNode.Tag> union(java.util.EnumSet<VerilogNode.Tag> lhs, java.util.EnumSet<VerilogNode.Tag> rhs)
Unites two sets of tags.- Parameters:
lhs
- the set of tags.rhs
- the set of tags.- Returns:
- the union the given sets.
-
isCode
public boolean isCode()
Checks whether the node isCODE
.- Returns:
true
iff the node isCODE
.
-
isModule
public boolean isModule()
Checks whether the node isMODULE
.- Returns:
true
iff the node isMODULE
.
-
isPort
public boolean isPort()
Checks whether the node isPORT
.- Returns:
true
iff the node isPORT
.
-
isSvaPort
public boolean isSvaPort()
Checks whether the node isSVA_PORT
.- Returns:
true
iff the node isSVA_PORT
.
-
isDeclaration
public boolean isDeclaration()
Checks whether the node isDECLARATION
.- Returns:
true
iff the node isDECLARATION
.
-
isSequenceDeclaration
public boolean isSequenceDeclaration()
Checks whether the node isSEQUENCE_DECLARATION
.- Returns:
true
iff the node isSEQUENCE_DECLARATION
.
-
isPropertyDeclaration
public boolean isPropertyDeclaration()
Checks whether the node isPROPERTY_DECLARATION
.- Returns:
true
iff the node isPROPERTY_DECLARATION
.
-
isActivity
public boolean isActivity()
Checks whether the node isACTIVITY
.- Returns:
true
iff the node isACTIVITY
.
-
isAssign
public boolean isAssign()
Checks whether the node isASSIGN
.- Returns:
true
iff the node isASSIGN
.
-
isAssignment
public boolean isAssignment()
Checks whether the node isASSIGNMENT
.- Returns:
true
iff the node isASSIGNMENT
.
-
isInstantiation
public boolean isInstantiation()
Checks whether the node isINSTANTIATION
.- Returns:
true
iff the node isINSTANTIATION
.
-
isConnection
public boolean isConnection()
Checks whether the node isPORT_CONNECTION
.- Returns:
true
iff the node isPORT_CONNECTION
.
-
isProcedure
public boolean isProcedure()
Checks whether the node isPROCEDURE
.- Returns:
true
iff the node isPROCEDURE
.
-
isTable
public boolean isTable()
Checks whether the node isTABLE
.- Returns:
true
iff the node isTABLE
.
-
isTableEntry
public boolean isTableEntry()
Checks whether the node isTABLE_ENTRY
.- Returns:
true
iff the node isTABLE_ENTRY
.
-
isNullStatement
public boolean isNullStatement()
Checks whether the node isNULL_STATEMENT
.- Returns:
true
iff the node isNULL_STATEMENT
.
-
isAssignStatement
public boolean isAssignStatement()
Checks whether the node isASSIGN_STATEMENT
.- Returns:
true
iff the node isASSIGN_STATEMENT
.
-
isAssertionStatement
public boolean isAssertionStatement()
Checks whether the node isASSERTION_STATEMENT
.- Returns:
true
iff the node isASSERTION_STATEMENT
.
-
isTaskStatement
public boolean isTaskStatement()
Checks whether the node isTASK_STATEMENT
.- Returns:
true
iff the node isTASK_STATEMENT
.
-
isWaitStatement
public boolean isWaitStatement()
Checks whether the node isWAIT_STATEMENT
.- Returns:
true
iff the node isWAIT_STATEMENT
.
-
isDisableStatement
public boolean isDisableStatement()
Checks whether the node isDISABLE_STATEMENT
.- Returns:
true
iff the node isDISABLE_STATEMENT
.
-
isTriggerStatement
public boolean isTriggerStatement()
Checks whether the node isTRIGGER_STATEMENT
.- Returns:
true
iff the node isTRIGGER_STATEMENT
.
-
isDelayedStatement
public boolean isDelayedStatement()
Checks whether the node isDELAYED_STATEMENT
.- Returns:
true
iff the node isDELAYED_STATEMENT
.
-
isIfStatement
public boolean isIfStatement()
Checks whether the node isIF_STATEMENT
.- Returns:
true
iff the node isIF_STATEMENT
.
-
isIfStatementBranch
public boolean isIfStatementBranch()
Checks whether the node isIF_STATEMENT_BRANCH
.- Returns:
true
iff the node isIF_STATEMENT_BRANCH
.
-
isCaseStatement
public boolean isCaseStatement()
Checks whether the node isCASE_STATEMENT
.- Returns:
true
iff the node isCASE_STATEMENT
.
-
isCaseStatementItem
public boolean isCaseStatementItem()
Checks whether the node isCASE_STATEMENT_ITEM
.- Returns:
true
iff the node isCASE_STATEMENT_ITEM
.
-
isLoopStatement
public boolean isLoopStatement()
Checks whether the node isLOOP_STATEMENT
.- Returns:
true
iff the node isLOOP_STATEMENT
.
-
isBlockStatement
public boolean isBlockStatement()
Checks whether the node isBLOCK_STATEMENT
.- Returns:
true
iff the node isBLOCK_STATEMENT
.
-
isGenerate
public boolean isGenerate()
Checks whether the node isGENERATE
.- Returns:
true
iff the node isGENERATE
.
-
isIfGenerate
public boolean isIfGenerate()
Checks whether the node isIF_GENERATE
.- Returns:
true
iff the node isIF_GENERATE
.
-
isIfGenerateBranch
public boolean isIfGenerateBranch()
Checks whether the node isIF_GENERATE_BRANCH
.- Returns:
true
iff the node isIF_GENERATE_BRANCH
.
-
isCaseGenerate
public boolean isCaseGenerate()
Checks whether the node isCASE_GENERATE
.- Returns:
true
iff the node isCASE_GENERATE
.
-
isCaseGenerateItem
public boolean isCaseGenerateItem()
Checks whether the node isCASE_GENERATE_ITEM
.- Returns:
true
iff the node isCASE_GENERATE_ITEM
.
-
isLoopGenerate
public boolean isLoopGenerate()
Checks whether the node isLOOP_GENERATE
.- Returns:
true
iff the node isLOOP_GENERATE
.
-
isBlockGenerate
public boolean isBlockGenerate()
Checks whether the node isBLOCK_GENERATE
.- Returns:
true
iff the node isBLOCK_GENERATE
.
-
isSpecify
public boolean isSpecify()
Checks whether the node isSPECIFY
.- Returns:
true
iff the node isSPECIFY
.
-
isPulseStyle
public boolean isPulseStyle()
Checks whether the node isPULSE_STYLE
.- Returns:
true
iff the node isPULSE_STYLE
.
-
isShowCancelled
public boolean isShowCancelled()
Checks whether the node isSHOW_CANCELLED
.- Returns:
true
iff the node isSHOW_CANCELLED
.
-
isPathDeclaration
public boolean isPathDeclaration()
Checks whether the node isPATH_DECLARATION
.- Returns:
true
iff the node isPATH_DECLARATION
.
-
isAttribute
public boolean isAttribute()
Checks whether the node isATTRIBUTE
.- Returns:
true
iff the node isATTRIBUTE
.
-
isPortConnection
public boolean isPortConnection()
Checks whether the node isPORT_CONNECTION
.- Returns:
true
iff the node isPORT_CONNECTION
.
-
getAttributes
public java.util.Collection<VerilogAttribute> getAttributes()
Returns the attributes of the node.- Returns:
- the attributes.
-
setAttributes
public void setAttributes(java.util.Collection<VerilogAttribute> attributes)
Sets attributes of the node.- Parameters:
attributes
- the attributes to be set.
-
getParentNode
public VerilogNode getParentNode()
Returns the parent node.- Returns:
- the parent node.
-
clone
public abstract VerilogNode clone()
Description copied from class:AbstractSymbolTable
Clones the symbol table.- Specified by:
clone
in classAbstractNode<VerilogNode.Tag>
- Returns:
- a copy of the symbol table.
-
-