Skip to content

ASTIdentifierNode now inherits from ASTExpressionNode directly - #44

Open
nedyoNK wants to merge 1 commit into
openqasm:mainfrom
nedyoNK:feature/identifier-inherits-expression-node
Open

ASTIdentifierNode now inherits from ASTExpressionNode directly#44
nedyoNK wants to merge 1 commit into
openqasm:mainfrom
nedyoNK:feature/identifier-inherits-expression-node

Conversation

@nedyoNK

@nedyoNK nedyoNK commented Jul 31, 2026

Copy link
Copy Markdown

Addressing this PR to resolve issue #6.

Changes made to simplify the code:
ASTExpressionNode is moved from ASTTypes.h into ASTExpression.h. The constructors and methods of ASTExpressionNode that require a complete ASTIdentifierNode type are placed in ASTExpressionNodeImpl.h, which is included at the bottom of ASTExpression.h after ASTIdentifierNode is fully defined.

ASTQualifiers.h had its circular includes removed; the three qualifier constructors taking const ASTIdentifierNode& are moved to ASTExpressionNodeImpl.h.

ASTIdentifierNode now inherits ASTExpressionNode instead of ASTExpression. The EXP member field and the SetExpression/GetExpression/HasExpression methods are removed from ASTIdentifierNode since the relationship is now expressed via the inheritance hierarchy.

GetIndexIdentifier() in ASTIdentifierNode is renamed to GetIndexIdentifierName() to avoid a return-type conflict with ASTExpressionNode::GetIndexIdentifier(). Callers in ASTBuilder.cpp are updated correspondingly."

If this solution is viable feel free to merge it. :)

@nedyoNK
nedyoNK requested a review from a team as a code owner July 31, 2026 12:43
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Nedyo Kolibanekov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants