Skip to content
Discussion options

You must be logged in to vote

For anyone reading about this problem, Langium has an excellent means of dealing with MemberAccess and right associative left recursive stuff like this:

PathExpression:
    PrimaryExpression (
        {infer CallExpression.callRoot=current} ("<" typeParameters+=TypeExpression ("," typeParameters+=TypeExpression)* ">")? "(" (parameters+=Expression ("," parameters+=Expression)*)? ")"
        | {infer MemberAccessExpression.memberRoot=current} "." member=ID
        | {infer ArrayAccessExpression.arrayRoot=current} "[" indexExpression=Expression "]"
    )+
    | PrimaryExpression;

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
7 replies
@jtenner
Comment options

@msujew
Comment options

@jtenner
Comment options

@jtenner
Comment options

@msujew
Comment options

Comment options

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

@jtenner
Comment options

Answer selected by jtenner
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