Skip to content
Discussion options

You must be logged in to vote

My current idea (inspired by @impworks, thank you!) is to introduce a special kind of "volatile AST node" which will denote this particular case of ambiguous AST.

In my parser, I will generate this node instead of the usual declaration node if I detect the situation of kind x(y); (this detection is certainly easily possible without any knowledge of context).

After that, at a latter stage of compiling (when I am converting the original AST to intermediate AST, which is perhaps a questionable implementation detail of my project), I should be able to choose between two different AST forms (a declaration of a function call) based on the context, and thus will be able to convert this "volatile…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@LPeter1997
Comment options

@ForNeVeR
Comment options

Answer selected by ForNeVeR
Comment options

You must be logged in to vote
2 replies
@ForNeVeR
Comment options

@LPeter1997
Comment options

Comment options

You must be logged in to vote
1 reply
@ForNeVeR
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants