Parser for SystemVerilog expressions.
More...
#include <SystemVerilogExpressionParser.h>
Parser for SystemVerilog expressions.
Definition at line 25 of file SystemVerilogExpressionParser.h.
◆ SystemVerilogExpressionParser() [1/2]
SystemVerilogExpressionParser::SystemVerilogExpressionParser |
( |
| ) |
|
|
default |
◆ ~SystemVerilogExpressionParser()
SystemVerilogExpressionParser::~SystemVerilogExpressionParser |
( |
| ) |
|
|
overridedefault |
◆ SystemVerilogExpressionParser() [2/2]
◆ baseForExpression()
int SystemVerilogExpressionParser::baseForExpression |
( |
QStringView | expression | ) |
const |
|
overridevirtual |
Finds the common base in the expression.
- Parameters
-
[in] | expression | The expression to search in. |
- Returns
- The common base for the expression.
Implements ExpressionParser.
◆ findSymbolValue()
virtual QString SystemVerilogExpressionParser::findSymbolValue |
( |
QStringView | symbol | ) |
const |
|
protectedvirtual |
◆ getBaseForSymbol()
virtual int SystemVerilogExpressionParser::getBaseForSymbol |
( |
QStringView | symbol | ) |
const |
|
protectedvirtual |
Finds the base in the symbol.
- Parameters
-
[in] | symbol | The symbol whose base to find. |
- Returns
- The base for the symbol.
Reimplemented in IPXactSystemVerilogParser.
◆ isArrayExpression()
virtual bool SystemVerilogExpressionParser::isArrayExpression |
( |
QStringView | expression | ) |
const |
|
virtualnoexcept |
Check if the given expression is an array.
- Parameters
-
[in] | expression | The expression to check. |
- Returns
- True, if the expression is an array, otherwise false.
◆ isPlainValue()
bool SystemVerilogExpressionParser::isPlainValue |
( |
QStringView | expression | ) |
const |
|
overridevirtual |
Checks if the given expression is a plain value and does not need evaluation.
- Parameters
-
[in] | expression | The expression to check. |
- Returns
- True, if the expression is a plain value, otherwise false.
Implements ExpressionParser.
◆ isSymbol()
virtual bool SystemVerilogExpressionParser::isSymbol |
( |
QStringView | expression | ) |
const |
|
protectedvirtual |
Checks if the given expression is a symbol e.g. reference.
- Parameters
-
[in] | expression | The expression to check. |
- Returns
- True, if the expression is a symbol, otherwise false.
Reimplemented in IPXactSystemVerilogParser, and ModeConditionParser.
◆ isUnaryOperator()
virtual bool SystemVerilogExpressionParser::isUnaryOperator |
( |
QStringView | token | ) |
const |
|
protectedvirtual |
Checks if the given token is a unary operator.
- Parameters
-
[in] | expression | The token to check. |
- Returns
- True, if the token is a unary operator, otherwise false.
Reimplemented in ModeConditionParser.
◆ operator=()
◆ operatorPrecedence()
static unsigned int SystemVerilogExpressionParser::operatorPrecedence |
( |
QStringView | oper | ) |
|
|
staticprotected |
Get the operator precedence value for the given operator.
- Parameters
-
[in] | oper | The operator whose precedence to get. |
- Returns
- The precedence value where bigger value has higher precedence.
◆ parseConstant()
QString SystemVerilogExpressionParser::parseConstant |
( |
QStringView | token | ) |
const |
|
protected |
Parses a token to a decimal number or string.
- Parameters
-
[in] | token | The constant to parse. |
- Returns
- The decimal value of the constant or the given string.
◆ parseExpression()
QString SystemVerilogExpressionParser::parseExpression |
( |
QStringView | expression, |
|
|
bool * | validExpression = nullptr ) const |
|
overridevirtual |
Parses an expression to decimal number.
- Parameters
-
[in] | expression | The expression to parse. |
[out] | validExpression | Set to true, if the parsing was successful, otherwise false. |
- Returns
- The decimal value of the evaluated expression.
Implements ExpressionParser.
◆ solveUnary()
virtual QString SystemVerilogExpressionParser::solveUnary |
( |
QStringView | operation, |
|
|
QString const & | term ) const |
|
protectedvirtual |
Solves a binary operation.
- Parameters
-
[in] | operation | The operation to solve. |
[in] | term | The term for the operation. |
- Returns
- The result of the operation.
Reimplemented in ModeConditionParser.
The documentation for this class was generated from the following file: