diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-06-19 03:20:59 +0200 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-06-19 15:25:07 +0200 |
commit | ef0dbc726749df434036b23480b89f01cbe67d44 (patch) | |
tree | b7573b77a0662773ffe30b100d7537de3d56f21a /pyGHDL/dom/Expression.py | |
parent | 89f835733c4019c5cb087885a874f34cf4ff183d (diff) | |
download | ghdl-ef0dbc726749df434036b23480b89f01cbe67d44.tar.gz ghdl-ef0dbc726749df434036b23480b89f01cbe67d44.tar.bz2 ghdl-ef0dbc726749df434036b23480b89f01cbe67d44.zip |
Added handling of Parenthesis.
Diffstat (limited to 'pyGHDL/dom/Expression.py')
-rw-r--r-- | pyGHDL/dom/Expression.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pyGHDL/dom/Expression.py b/pyGHDL/dom/Expression.py index a6b88ac23..fec347b57 100644 --- a/pyGHDL/dom/Expression.py +++ b/pyGHDL/dom/Expression.py @@ -52,6 +52,7 @@ from pyVHDLModel.VHDLModel import ( IdentityExpression as VHDLModel_IdentityExpression, NegationExpression as VHDLModel_NegationExpression, AbsoluteExpression as VHDLModel_AbsoluteExpression, + ParenthesisExpression as VHDLModel_ParenthesisExpression, TypeConversion as VHDLModel_TypeConversion, FunctionCall as VHDLModel_FunctionCall, QualifiedExpression as VHDLModel_QualifiedExpression, @@ -136,6 +137,20 @@ class AbsoluteExpression(VHDLModel_AbsoluteExpression, _ParseUnaryExpression): @export +class ParenthesisExpression(VHDLModel_ParenthesisExpression, _ParseUnaryExpression): + def __init__(self, operand: Expression): + super().__init__() + self._operand = operand + + @classmethod + def parse(cls, node): + from pyGHDL.dom._Translate import GetExpressionFromNode + + operand = GetExpressionFromNode(nodes.Get_Expression(node)) + return cls(operand) + + +@export class TypeConversion(VHDLModel_TypeConversion): def __init__(self, operand: Expression): super().__init__() |