Class VerilogExpression
- java.lang.Object
-
- ru.ispras.verilog.parser.model.basis.VerilogExpression
-
- Direct Known Subclasses:
SvaCaseExpression
,SvaDelayedExpression
,SvaEventExpression
,SvaFirstMatchExpression
,SvaOperatorExpression
,SvaRepeatedExpression
,SvaStrengthExpression
public class VerilogExpression extends java.lang.Object
VerilogExpression
represents expressions.
-
-
Constructor Summary
Constructors Constructor Description VerilogExpression()
Creates a null expression.VerilogExpression(ru.ispras.fortress.expression.Node node)
Creates an expression with the given syntax.VerilogExpression(VerilogExpression other)
Creates a copy of the expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VerilogExpression
clone()
java.util.List<VerilogAttribute>
getAttributes()
Returns the expression attributes.VerilogProcedure
getDeclaration()
Returns the function declaration (for function calls only).VerilogLiteral
getLiteral()
Returns the literal.ru.ispras.fortress.expression.Node
getNode()
Returns the expression representation.ru.ispras.fortress.expression.NodeOperation
getOperation()
Returns the operation node (if the expression is an operation).VerilogPath
getPath()
Returns the path to the source-code function.VerilogReference
getReference()
Returns the reference (if the expression is primary).ru.ispras.fortress.expression.NodeValue
getValue()
Returns the value node (if the expression is a value).ru.ispras.fortress.expression.NodeVariable
getVariable()
Returns the variable node (if the expression is a variable).boolean
isNull()
Checks whether the expression is null.boolean
isOperation()
Checks whether the expression is an operation.boolean
isReference()
Checks whether the expression is a reference.boolean
isValue()
Checks whether the expression is a value.boolean
isVariable()
Checks whether the expression is a variable.void
setAttributes(java.util.List<VerilogAttribute> attributes)
Sets the expression attributes.void
setDeclaration(VerilogProcedure declaration)
Sets the function declaration (for function calls only).void
setNode(ru.ispras.fortress.expression.Node node)
Sets the original representation of the expression and resets the elaborated representation.void
setPath(VerilogPath path)
Sets a path to the source-code function.void
setReference(VerilogReference reference)
Sets the reference.java.lang.String
toString()
-
-
-
Constructor Detail
-
VerilogExpression
public VerilogExpression()
Creates a null expression.
-
VerilogExpression
public VerilogExpression(ru.ispras.fortress.expression.Node node)
Creates an expression with the given syntax.- Parameters:
node
- the expression syntax.
-
VerilogExpression
public VerilogExpression(VerilogExpression other)
Creates a copy of the expression.- Parameters:
other
- the expression to be copied.
-
-
Method Detail
-
getNode
public ru.ispras.fortress.expression.Node getNode()
Returns the expression representation.- Returns:
- the expression representation.
-
setNode
public void setNode(ru.ispras.fortress.expression.Node node)
Sets the original representation of the expression and resets the elaborated representation.- Parameters:
node
- the expression representation.
-
isNull
public boolean isNull()
Checks whether the expression is null.- Returns:
true
iff the expression is null.
-
isValue
public boolean isValue()
Checks whether the expression is a value.- Returns:
true
iff the expression is a value.
-
isVariable
public boolean isVariable()
Checks whether the expression is a variable.- Returns:
true
iff the expression is a variable.
-
isOperation
public boolean isOperation()
Checks whether the expression is an operation.- Returns:
true
iff the expression is an operation.
-
getValue
public ru.ispras.fortress.expression.NodeValue getValue()
Returns the value node (if the expression is a value).- Returns:
- the value node.
-
getLiteral
public VerilogLiteral getLiteral()
Returns the literal.- Returns:
- the literal if the expression is a value.
-
getVariable
public ru.ispras.fortress.expression.NodeVariable getVariable()
Returns the variable node (if the expression is a variable).- Returns:
- the variable node.
-
getOperation
public ru.ispras.fortress.expression.NodeOperation getOperation()
Returns the operation node (if the expression is an operation).- Returns:
- the operation node.
-
isReference
public boolean isReference()
Checks whether the expression is a reference.- Returns:
true
iff the expression is a reference.
-
getReference
public VerilogReference getReference()
Returns the reference (if the expression is primary).- Returns:
- the reference.
-
setReference
public void setReference(VerilogReference reference)
Sets the reference.- Parameters:
reference
- the reference to be set.
-
getPath
public VerilogPath getPath()
Returns the path to the source-code function.- Returns:
- the path to the function.
-
setPath
public void setPath(VerilogPath path)
Sets a path to the source-code function.- Parameters:
path
- the path to be set.
-
getAttributes
public java.util.List<VerilogAttribute> getAttributes()
Returns the expression attributes.- Returns:
- the attributes.
-
setAttributes
public void setAttributes(java.util.List<VerilogAttribute> attributes)
Sets the expression attributes.- Parameters:
attributes
- the attributes to be set.
-
getDeclaration
public VerilogProcedure getDeclaration()
Returns the function declaration (for function calls only).- Returns:
- the function declaration.
-
setDeclaration
public void setDeclaration(VerilogProcedure declaration)
Sets the function declaration (for function calls only).- Parameters:
declaration
- the function declaration to be set.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clone
public VerilogExpression clone()
- Overrides:
clone
in classjava.lang.Object
-
-