我有以下 Xtext 语法:
grammar dsl.miniproject.Question2.EclipsePluginLanguage with org.eclipse.xtext.common.Terminals
import "platform:/resource/Question2/model/EclipsePluginModel.ecore"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
Plugin:
{Plugin}
'Plugin' Name = EntityName
'{'
(documentation = Documentation)?
(functions += Functionality)*
manifest = Manifest
'}'
;
Documentation:
{Documentation}
'description =' documentation = STRING
;
Manifest:
{Manifest}
'manifest'
'{'
(dependencies += Dependency)*
(extensionPoints += ExtensionPoint)*
(extensions += Extension)*
'}'
;
Functionality:
{Functionality}
'function' Name = EntityName ';'
;
Dependency:
{Dependency}
Name = EntityName '=>' depends = [Plugin|EntityName]
;
Extension:
{Extension}
Name = EntityName '->' extends = [ExtensionPoint|EntityName]
;
ExtensionPoint:
{ExtensionPoint}
'ExtensionPoint' Name = EntityName
'{'
'ref' functions += [Functionality|EntityName] ';'
'}'
;
EntityName:
ID ('.' ID)*
;
但是,在编写示例脚本时:
Plugin x{
description = "test"
function f;
function f2;
manifest{
dep1 => x
ExtensionPoint ep.ep1{
ref f;
}
ext1 -> ep.ep1
}
}
我收到以下错误:
无法解析对插件“x”的引用。无法解析对功能“f”的引用。... ETC
这是我第一次尝试 xtext,我不知道我做错了什么
提前感谢您的帮助!!