Michael_Scharf
Michael_Scharf

Reputation: 34548

How to override Xbase rule and call super rule?

Suppose I want to extend Xbase XExpression in my grammar:

XExpression: super| MyRule;

as described here. But I cannot figure out how to override the Xbase XExpression.

Upvotes: 0

Views: 164

Answers (1)

Michael_Scharf
Michael_Scharf

Reputation: 34548

I think I figured it out. The trick is to import Xbase

import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase

XExpression returns xbase::XExpression:
    super | MyRule
;

MyRule:
    'doit' expression= XExpression
;

Upvotes: 1

Related Questions