Workflow Problem [message #51242] |
Sun, 14 June 2009 12:21  |
Eclipse User |
|
|
|
Hello,
I am relatively new to xText and began with the oAW release, and have
migrated my code to tmf now. My grammar seems fine but when I generate a
concrete model I get a workflow error.
What could be the problem? Thanks in advance for any tips.
My grammar:
grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/MyDsl"
//Our ORM2 Model
Model:
(elements+=Element)*;
//Elements can be Objects or Predicates
Element:
Object_Type | Predicate;
//Objects are Entities or Values
Object_Type:
Entity_Type | Value_Type (IsPrimitive?="subtype"
supertype=[Object_Type])?;
//Entities
Entity_Type:
"entity" name=ID (IsPrimitive?="subtype" supertype=[Object_Type])? "{"
(IsNested?="nests" Predicate=[Predicate])?
("definition" def=STRING)?
("subconstr" sub=STRING)?
("role" role=STRING Predicate=[Predicate])*
"}";
//Value is a DataType or not
Value_Type:
("value" type=[DataType|ID] name=ID) | DataType (IsPrimitive?="subtype")?;
//DataTypes includes Integer, String, Boolean...
DataType:
"datatype" name=ID;
//Predicate
Predicate:
"predicate" name=ID "{"
"part" (Participants+=Participant)+
(Arity=Arity ";")?
(IsDerived?="derived" ";")?
"}";
//Participants in the predicate
Participant:
type=[Object_Type];
//Arity
Arity:
"arity" name=INT;
My test model:
entity student{}
entity person{}
entity professor{
nests teaches
definition "he teaches"
subconst "alot"
}
entity teacher subtype person{}
predicate teaches {
part professor student
arity 3;
derived;
}
I get the error:
2016 [main] ERROR org.eclipse.xpand2.Generator - Error in
Component of type org.eclipse.xpand2.Generator:
EvaluationException : Couldn't find property 'elements' for type
myDsl::Model
templates::Template.xpt[110,13] on line 8 'this.elements'
[23,42] on line 1 'EXPAND templates::Template::main FOR model'
2016 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - Workflow
interrupted. Reason: Couldn't find property 'elements' for type
myDsl::Model
2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: Couldn't
find property 'elements' for type myDsl::Model(Element: this.elements;
Reported by: Generator: generating 'templates::Template::main FOR model'
=> [])
2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: Couldn't
find property 'elements' for type myDsl::Model(Element:
org.eclipse.internal.xpand2.ast.ForEachStatement@1493102; Reported by:
Generator: generating 'templates::Template::main FOR model' => [])
2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: Couldn't
find property 'elements' for type myDsl::Model(Element:
org.eclipse.internal.xpand2.ast.FileStatement@30ae41; Reported by:
Generator: generating 'templates::Template::main FOR model' => [])
2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: Couldn't
find property 'elements' for type myDsl::Model(Element: main : Model;
Reported by: Generator: generating 'templates::Template::main FOR model'
=> [])
2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: Couldn't
find property 'elements' for type myDsl::Model(Element: EXPAND
templates::Template::main FOR model; Reported by: Generator: generating
'templates::Template::main FOR model' => [])
|
|
|
Re: Workflow Problem [message #51322 is a reply to message #51242] |
Sun, 14 June 2009 15:48   |
Eclipse User |
|
|
|
Originally posted by: peter.friese.itemis.com
Aurel,
could you also please post your template, as this seems to be the place
the error ocurrs?
Cheers,
Peter
On 2009-06-14 18:21:19 +0200, aurel_ganga@yahoo.com (Aurel Ganga) said:
> Hello,
>
> I am relatively new to xText and began with the oAW release, and have
> migrated my code to tmf now. My grammar seems fine but when I generate
> a concrete model I get a workflow error.
> What could be the problem? Thanks in advance for any tips.
>
> My grammar:
>
> grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
>
> generate myDsl "http://www.xtext.org/example/MyDsl"
>
>
> //Our ORM2 Model
> Model:
> (elements+=Element)*;
> //Elements can be Objects or Predicates
> Element:
> Object_Type | Predicate;
> //Objects are Entities or Values
> Object_Type:
> Entity_Type | Value_Type (IsPrimitive?="subtype" supertype=[Object_Type])?;
> //Entities
> Entity_Type:
> "entity" name=ID (IsPrimitive?="subtype" supertype=[Object_Type])?
> "{" (IsNested?="nests" Predicate=[Predicate])? ("definition"
> def=STRING)?
> ("subconstr" sub=STRING)?
> ("role" role=STRING Predicate=[Predicate])* "}";
>
> //Value is a DataType or not
> Value_Type:
> ("value" type=[DataType|ID] name=ID) | DataType (IsPrimitive?="subtype")?;
>
> //DataTypes includes Integer, String, Boolean...
> DataType:
> "datatype" name=ID;
>
>
> //Predicate Predicate:
> "predicate" name=ID "{"
> "part" (Participants+=Participant)+
> (Arity=Arity ";")? (IsDerived?="derived" ";")?
> "}";
>
> //Participants in the predicate
> Participant:
> type=[Object_Type];
>
> //Arity Arity:
> "arity" name=INT;
>
>
> My test model:
>
> entity student{}
>
> entity person{}
>
> entity professor{
> nests teaches
> definition "he teaches"
> subconst "alot"
> }
>
> entity teacher subtype person{}
>
> predicate teaches {
> part professor student
> arity 3;
> derived;
> }
>
>
> I get the error:
>
> 2016 [main] ERROR org.eclipse.xpand2.Generator - Error in
> Component of type org.eclipse.xpand2.Generator: EvaluationException :
> Couldn't find property 'elements' for type myDsl::Model
> templates::Template.xpt[110,13] on line 8 'this.elements' [23,42]
> on line 1 'EXPAND templates::Template::main FOR model'
>
> 2016 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - Workflow
> interrupted. Reason: Couldn't find property 'elements' for type
> myDsl::Model
> 2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Couldn't find property 'elements' for type myDsl::Model(Element:
> this.elements; Reported by: Generator: generating
> 'templates::Template::main FOR model' => [])
> 2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Couldn't find property 'elements' for type myDsl::Model(Element:
> org.eclipse.internal.xpand2.ast.ForEachStatement@1493102; Reported by:
> Generator: generating 'templates::Template::main FOR model' => [])
> 2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Couldn't find property 'elements' for type myDsl::Model(Element:
> org.eclipse.internal.xpand2.ast.FileStatement@30ae41; Reported by:
> Generator: generating 'templates::Template::main FOR model' => [])
> 2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Couldn't find property 'elements' for type myDsl::Model(Element: main :
> Model; Reported by: Generator: generating 'templates::Template::main
> FOR model' => [])
> 2032 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Couldn't find property 'elements' for type myDsl::Model(Element: EXPAND
> templates::Template::main FOR model; Reported by: Generator: generating
> 'templates::Template::main FOR model' => [])
|
|
|
|
|
|
Re: Workflow Problem [message #51542 is a reply to message #51379] |
Mon, 15 June 2009 06:00   |
Eclipse User |
|
|
|
Originally posted by: peter.friese.itemis.com
Aurel,
On 2009-06-14 22:49:03 +0200, aurel_ganga@yahoo.com (Aurel Ganga) said:
> My Template is the default one, havent changed anything.
[...]
> My Extensions file is also almost the default, but with a part
> commented out because it gave another error:
>
> import myDsl;
>
> //referencedBy(Class this) :
> // this.eRootContainer.eAllContents.typeSelect(Class).select(e| e.references
> == this).name.toString(",");
>
>
> After some minor code optimization and tampering, the error is:
>
> 3016 [main] ERROR org.eclipse.xpand2.Generator - Error in
> Component of type org.eclipse.xpand2.Generator: EvaluationException :
> Couldn't find operation 'referencedBy()' for myDsl::Entity_Type.
> templates::Template.xpt[158,16] on line 9 'e.referencedBy()' [23,42]
> on line 1 'EXPAND templates::Template::main FOR model'
[...]
> It seems as the problem is in the template still, but i haven't changed
> the default at all. Maybe i have to change the template?
No, the problem is in the extension. As you commented out the extension
"referencedBy()", there is extension named "referencedBy()" any more
and thus you're getting an error when invoking this non-existing
extension from your template.
Maybe you could point out what you're trying to achieve so we can help you.
Cheers,
Peter
|
|
|
|
Powered by
FUDForum. Page generated in 0.03681 seconds