【发布时间】:2014-05-30 03:42:06
【问题描述】:
我正在尝试设置具有以下特征的 xtext 语法。
草图(!):
Class:
properties += Property*
;
Resource:
properties += Property*
;
Link :
// no classes here, so no common for Resource and Class
[Resource] <-> [Resource]
;
BasicType:
'int' | 'long'
;
Property:
// this is not supported
name ':' BasicType | [Resource] | [Class]
// i tried
// name ':' EObject
;
我的问题是:
我该如何解决这种情况,将属性类型交叉引用到“资源”或“类”或 BasicType?
我尝试使用 EObject 作为 BaseType 并在自定义 ScopeProvider 中解析交叉引用, 但后来我不知道如何使用 BasicTypes(int 或 long)作为属性的类型。
【问题讨论】:
标签: xtext