public final class VerilogLiteral
extends java.lang.Object
VerilogLiteral
represents numeric and string literals.Modifier and Type | Class and Description |
---|---|
static class |
VerilogLiteral.Type
VerilogLiteral.Type contains literal types. |
Constructor and Description |
---|
VerilogLiteral(java.math.BigInteger value)
Creates an integer literal.
|
VerilogLiteral(ru.ispras.fortress.data.types.bitvector.BitVector value)
Creates a bit vector literal with no X and Z digits.
|
VerilogLiteral(ru.ispras.fortress.data.types.bitvector.BitVector value,
ru.ispras.fortress.data.types.bitvector.BitVector xmask,
ru.ispras.fortress.data.types.bitvector.BitVector zmask)
Creates a bit vector literal.
|
VerilogLiteral(boolean value)
Creates an integer literal.
|
VerilogLiteral(ru.ispras.fortress.data.Data value)
Creates a literal.
|
VerilogLiteral(double value)
Creates a real literal.
|
VerilogLiteral(int value)
Creates an integer literal.
|
VerilogLiteral(int value,
int width)
Creates a bit vector literal.
|
VerilogLiteral(java.lang.String value)
Creates a string literal.
|
VerilogLiteral(VerilogLiteral other)
Creates a copy of the literal.
|
Modifier and Type | Method and Description |
---|---|
VerilogLiteral |
clone() |
java.math.BigInteger |
getBigInteger()
Returns the big integer value of the literal.
|
int |
getBitSize()
Returns the bit width of the literal.
|
ru.ispras.fortress.data.types.bitvector.BitVector |
getBitVector()
Returns the bit vector value of the literal.
|
boolean |
getBoolean()
Returns the boolean value of the literal.
|
byte[] |
getByteArray()
Returns the byte array representation of the literal.
|
int |
getInteger()
Returns the integer value of the literal.
|
double |
getReal()
Returns the real value of the literal.
|
java.lang.String |
getString()
Returns the string value of the literal.
|
VerilogLiteral.Type |
getType()
Returns the literal type (
INTEGER , REAL , or STRING ). |
ru.ispras.fortress.data.types.bitvector.BitVector |
getXMask()
Returns the X mask of the literal.
|
ru.ispras.fortress.data.types.bitvector.BitVector |
getZMask()
Returns the Z mask of the literal.
|
boolean |
hasX()
Checks whether the literal contains X digits.
|
boolean |
hasXorZ()
Checks whether the literal contains X or Z digits.
|
boolean |
hasZ()
Checks whether the literal contains Z digits.
|
boolean |
isBitVector()
Checks whether the literal is
BIT_VECTOR . |
boolean |
isInteger()
Checks whether the literal is
INTEGER . |
boolean |
isReal()
Checks whether the literal is
REAL . |
boolean |
isString()
Checks whether the literal is
STRING . |
static VerilogLiteral |
parseNumber(java.lang.String text)
Parses the string representing a numeric literal.
|
static VerilogLiteral |
parseString(java.lang.String text,
boolean withQuotes)
Parses the string representing a string literal.
|
java.lang.String |
toString() |
public VerilogLiteral(ru.ispras.fortress.data.types.bitvector.BitVector value, ru.ispras.fortress.data.types.bitvector.BitVector xmask, ru.ispras.fortress.data.types.bitvector.BitVector zmask)
value
- the value.xmask
- the X mask.zmask
- the Z mask.public VerilogLiteral(ru.ispras.fortress.data.types.bitvector.BitVector value)
value
- the value.public VerilogLiteral(int value, int width)
value
- the value.width
- the width.public VerilogLiteral(int value)
value
- the value.public VerilogLiteral(boolean value)
value
- the value.public VerilogLiteral(java.math.BigInteger value)
value
- the value.public VerilogLiteral(double value)
value
- the value.public VerilogLiteral(java.lang.String value)
value
- the value.public VerilogLiteral(ru.ispras.fortress.data.Data value)
value
- the value.public VerilogLiteral(VerilogLiteral other)
other
- the literal to be copied.public static VerilogLiteral parseNumber(java.lang.String text)
text
- the string to be parsed.public static VerilogLiteral parseString(java.lang.String text, boolean withQuotes)
text
- the string to be parsed.withQuotes
- the flag indicating whether the string contains quotes to be removed.public VerilogLiteral.Type getType()
INTEGER
, REAL
, or STRING
).public boolean isBitVector()
BIT_VECTOR
.true
iff the literal is BIT_VECTOR
.public boolean isInteger()
INTEGER
.true
iff the literal is INTEGER
.public boolean isReal()
REAL
.true
iff the literal is REAL
.public boolean isString()
STRING
.true
iff the literal is STRING
.public ru.ispras.fortress.data.types.bitvector.BitVector getBitVector()
public int getInteger()
public boolean getBoolean()
public java.math.BigInteger getBigInteger()
public double getReal()
public java.lang.String getString()
public byte[] getByteArray()
public boolean hasX()
true
iff the literal contains X digits.public boolean hasZ()
true
iff the literal contains Z digits.public boolean hasXorZ()
true
iff the literal contains X or Z digits.public ru.ispras.fortress.data.types.bitvector.BitVector getXMask()
public ru.ispras.fortress.data.types.bitvector.BitVector getZMask()
public int getBitSize()
public java.lang.String toString()
toString
in class java.lang.Object
public VerilogLiteral clone()
clone
in class java.lang.Object