Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366414

Summary: Import statement doesn't work properly
Product: [Modeling] TMF Reporter: hendrik
Component: XtextAssignee: Christian Dietrich <christian.dietrich.opensource>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: christian.dietrich.opensource, karsten.thoms, tmf.xtext-inbox
Version: 2.2.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://github.com/eclipse/xtext-eclipse/pull/52
Whiteboard: v2.11

Description hendrik CLA 2011-12-12 09:43:03 EST
Build Identifier: 20110916-0149

I'm trying to embed xbase expressions into a xtext grammer like it's done in http://www.eclipse.org/Xtext/documentation/2_0_0/199d-xbase-expressions.php.

Unfortunately the import statement doesn't work like I expect it. I'm getting the error 'XExpression cannot by resolved to a rule' in the following grammar:

grammar org.xtext.example.mydsl.MyDsl3 with org.eclipse.xtext.common.Terminals
generate myDsl3 "http://www.xtext.org/example/mydsl/MyDsl3"
import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase
Model: 'Model' body=XExpression;

If I use a full qualified reference (xbase::XExpression) I get multiple syntax errors ('mismatched input ...').

Did I miss some syntax changes?

In contrast to the grammar above the following grammar works:

grammar org.xtext.example.mydsl.MyDsl3 with org.eclipse.xtext.xbase.Xbase
generate myDsl3 "http://www.xtext.org/example/mydsl/MyDsl3"
Model: 'Model' body=XExpression;

I'm using xtext and xtend2 2.2.0 (v201112071226).

Reproducible: Always
Comment 1 Eclipse Genie CLA 2016-08-16 10:49:45 EDT
GitHub Pull Request 52 created by [cdietrich]
https://github.com/eclipse/xtext-eclipse/pull/52