Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Crosslinks to rule that further crossreferences to an external metamodel class
Crosslinks to rule that further crossreferences to an external metamodel class [message #50172] Thu, 11 June 2009 09:00 Go to next message
Eclipse UserFriend
Hello Everyone

I'm trying to implement a grammar that should allow to create concrete
models of a graph structure rather than a tree structure.

My requirement is -
For Ex:

(1)
------------------------------------------------------
Pr_dtype id:"pr1"{
name:"pr_dtype_a";
doc:"safwaef";
type:0 ;
}

MessageType id:"mssg_01"{
name:"asdasd";
doc:"sadfasf";
parameters:Parameter type: "pr_dtype_a" ;
}
------------------------------------------------------

which is backed by a grammar of the following pattern:

import "http://q-impress.eu/samm/core" as refn_core
import "http://q-impress.eu/samm/datatype" as refn_datatypes
import "http://q-impress.eu/samm/staticstructure" as refn_staticstructure

import "http://q-impress.eu/identifier" as ident

..
..

MessageType returns refn_staticstructure::MessageType:
'MessageType' 'id:' id=STRING '{'
//parent attrib(s)
'name:' name=STRING';'
'doc:' documentation=STRING';'
//class specific attributes
'parameters:' (parameters+=Parameter)+ ';'
'}'

;

Parameter returns refn_staticstructure::Parameter:
'Parameter' 'type:' type=[refn_datatypes::Type] ';'

;

Type returns refn_datatypes::Type:
CollectionDataType | ComplexDataType | PrimitiveDataType
;

PrimitiveDataType returns refn_datatypes::PrimitiveDataType:
'Pr_dtype' 'id:' id=STRING '{'
'name:' name=STRING ';'
'doc:' documentation=STRING ';'
'type:'type=XSDPrimitiveDatatypes ';'
'}'

;

enum XSDPrimitiveDatatypes returns refn_datatypes::XSDPrimitiveDataTypes:
string='0' | int='1' | float='2' | date='3' | time='4' | boolean='5'
;

..
..
------------------------------------------------------------ --------

So, the problem that I'm facing is that in using the above grammar, the
editor shows the error that:

< mismatched input 'MessageType' expecting EOF > for the model declaration
(1).

and if I alter the sequence of declaration as follows:

(2)

MessageType id:"mssg_01"{
name:"asdasd";
doc:"sadfasf";
parameters:Parameter type: "pr_dtype_a" ;
}

Pr_dtype id:"pr1"{
name:"pr_dtype_a";
doc:"safwaef";
type:0 ;
}
--------------------------------------------------------

errors are :

< Multiple markers at this line
- The feature 'type' of
'eu.qimpress.samm.staticstructure.impl.ParameterImpl@15ee9d9{platform:/resource/Test/test.edifice#//@parameters.0}'
contains an unresolved proxy
' eu.qimpress.samm.datatypes.impl.CollectionDataTypeImpl@1a102 ef{platform:/resource/Test/test.edifice#xtextLink_:://@param eters.0::http://q-impress.eu/samm/staticstructure#//Paramete r/type::/4}'
- Couldn't resolve reference to Type >

< mismatched input 'Pr_dtype' expecting EOF >

---------------------------------------------------------

And yes I'm using TMF XText

Eclipse SDK

Version: 3.5.0
Build id: I20090522-1710


cud anyone suggest a solution.

:)


Durga
Re: Crosslinks to rule that further crossreferences to an external metamodel class [message #50234 is a reply to message #50172] Thu, 11 June 2009 09:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi Durga,

how did you install Xtext? Did you get any warnings when generating your
language?

Regards,
Sebastian

Am 11.06.2009 15:00 Uhr, schrieb Durga Prasana Sahoo:
> Hello Everyone
>
> I'm trying to implement a grammar that should allow to create concrete
> models of a graph structure rather than a tree structure.
>
> My requirement is -
> For Ex:
>
> (1)
> ------------------------------------------------------
> Pr_dtype id:"pr1"{
> name:"pr_dtype_a";
> doc:"safwaef";
> type:0 ;
> }
>
> MessageType id:"mssg_01"{
> name:"asdasd";
> doc:"sadfasf";
> parameters:Parameter type: "pr_dtype_a" ;
> }
> ------------------------------------------------------
>
> which is backed by a grammar of the following pattern:
>
> import "http://q-impress.eu/samm/core" as refn_core
> import "http://q-impress.eu/samm/datatype" as refn_datatypes
> import "http://q-impress.eu/samm/staticstructure" as refn_staticstructure
>
> import "http://q-impress.eu/identifier" as ident
>
> ..
> ..
>
> MessageType returns refn_staticstructure::MessageType:
> 'MessageType' 'id:' id=STRING '{'
> //parent attrib(s)
> 'name:' name=STRING';'
> 'doc:' documentation=STRING';'
> //class specific attributes
> 'parameters:' (parameters+=Parameter)+ ';'
> '}'
>
> ;
>
> Parameter returns refn_staticstructure::Parameter:
> 'Parameter' 'type:' type=[refn_datatypes::Type] ';'
>
> ;
>
> Type returns refn_datatypes::Type:
> CollectionDataType | ComplexDataType | PrimitiveDataType
> ;
>
> PrimitiveDataType returns refn_datatypes::PrimitiveDataType:
> 'Pr_dtype' 'id:' id=STRING '{'
> 'name:' name=STRING ';'
> 'doc:' documentation=STRING ';'
> 'type:'type=XSDPrimitiveDatatypes ';'
> '}'
>
> ;
>
> enum XSDPrimitiveDatatypes returns refn_datatypes::XSDPrimitiveDataTypes:
> string='0' | int='1' | float='2' | date='3' | time='4' | boolean='5'
> ;
>
> ..
> ..
> ------------------------------------------------------------ --------
>
> So, the problem that I'm facing is that in using the above grammar, the
> editor shows the error that:
>
> < mismatched input 'MessageType' expecting EOF > for the model
> declaration (1).
>
> and if I alter the sequence of declaration as follows:
>
> (2)
>
> MessageType id:"mssg_01"{
> name:"asdasd";
> doc:"sadfasf";
> parameters:Parameter type: "pr_dtype_a" ;
> }
>
> Pr_dtype id:"pr1"{
> name:"pr_dtype_a";
> doc:"safwaef";
> type:0 ;
> } --------------------------------------------------------
>
> errors are :
>
> < Multiple markers at this line
> - The feature 'type' of
> 'eu.qimpress.samm.staticstructure.impl.ParameterImpl@15ee9d9{platform:/resource/Test/test.edifice#//@parameters.0}'
> contains an unresolved proxy
> ' eu.qimpress.samm.datatypes.impl.CollectionDataTypeImpl@1a102 ef{platform:/resource/Test/test.edifice#xtextLink_:://@param eters.0::http://q-impress.eu/samm/staticstructure#//Paramete r/type::/4}'
>
> - Couldn't resolve reference to Type >
>
> < mismatched input 'Pr_dtype' expecting EOF >
>
> ---------------------------------------------------------
>
> And yes I'm using TMF XText
>
> Eclipse SDK
>
> Version: 3.5.0
> Build id: I20090522-1710
>
>
> cud anyone suggest a solution.
>
> :)
>
>
> Durga
>
Re: Crosslinks to rule that further crossreferences to an external metamodel class [message #50376 is a reply to message #50234] Thu, 11 June 2009 11:39 Go to previous messageGo to next message
Eclipse UserFriend
Sebastian Zarnekow wrote:

> Hi Durga,

> how did you install Xtext? Did you get any warnings when generating your
> language?

> Regards,
> Sebastian

> Am 11.06.2009 15:00 Uhr, schrieb Durga Prasana Sahoo:
>> Hello Everyone
>>
>> I'm trying to implement a grammar that should allow to create concrete
>> models of a graph structure rather than a tree structure.
>>
>> My requirement is -
>> For Ex:
>>
>> (1)
>> ------------------------------------------------------
>> Pr_dtype id:"pr1"{
>> name:"pr_dtype_a";
>> doc:"safwaef";
>> type:0 ;
>> }
>>
>> MessageType id:"mssg_01"{
>> name:"asdasd";
>> doc:"sadfasf";
>> parameters:Parameter type: "pr_dtype_a" ;
>> }
>> ------------------------------------------------------
>>
>> which is backed by a grammar of the following pattern:
>>
>> import "http://q-impress.eu/samm/core" as refn_core
>> import "http://q-impress.eu/samm/datatype" as refn_datatypes
>> import "http://q-impress.eu/samm/staticstructure" as refn_staticstructure
>>
>> import "http://q-impress.eu/identifier" as ident
>>
>> ..
>> ..
>>
>> MessageType returns refn_staticstructure::MessageType:
>> 'MessageType' 'id:' id=STRING '{'
>> //parent attrib(s)
>> 'name:' name=STRING';'
>> 'doc:' documentation=STRING';'
>> //class specific attributes
>> 'parameters:' (parameters+=Parameter)+ ';'
>> '}'
>>
>> ;
>>
>> Parameter returns refn_staticstructure::Parameter:
>> 'Parameter' 'type:' type=[refn_datatypes::Type] ';'
>>
>> ;
>>
>> Type returns refn_datatypes::Type:
>> CollectionDataType | ComplexDataType | PrimitiveDataType
>> ;
>>
>> PrimitiveDataType returns refn_datatypes::PrimitiveDataType:
>> 'Pr_dtype' 'id:' id=STRING '{'
>> 'name:' name=STRING ';'
>> 'doc:' documentation=STRING ';'
>> 'type:'type=XSDPrimitiveDatatypes ';'
>> '}'
>>
>> ;
>>
>> enum XSDPrimitiveDatatypes returns refn_datatypes::XSDPrimitiveDataTypes:
>> string='0' | int='1' | float='2' | date='3' | time='4' | boolean='5'
>> ;
>>
>> ..
>> ..
>> ------------------------------------------------------------ --------
>>
>> So, the problem that I'm facing is that in using the above grammar, the
>> editor shows the error that:
>>
>> < mismatched input 'MessageType' expecting EOF > for the model
>> declaration (1).
>>
>> and if I alter the sequence of declaration as follows:
>>
>> (2)
>>
>> MessageType id:"mssg_01"{
>> name:"asdasd";
>> doc:"sadfasf";
>> parameters:Parameter type: "pr_dtype_a" ;
>> }
>>
>> Pr_dtype id:"pr1"{
>> name:"pr_dtype_a";
>> doc:"safwaef";
>> type:0 ;
>> } --------------------------------------------------------
>>
>> errors are :
>>
>> < Multiple markers at this line
>> - The feature 'type' of
>>
'eu.qimpress.samm.staticstructure.impl.ParameterImpl@15ee9d9{platform:/resource/Test/test.edifice#//@parameters.0}'
>> contains an unresolved proxy
>>
' eu.qimpress.samm.datatypes.impl.CollectionDataTypeImpl@1a102 ef{platform:/resource/Test/test.edifice#xtextLink_:://@param eters.0::http://q-impress.eu/samm/staticstructure#//Paramete r/type::/4}'
>>
>> - Couldn't resolve reference to Type >
>>
>> < mismatched input 'Pr_dtype' expecting EOF >
>>
>> ---------------------------------------------------------
>>
>> And yes I'm using TMF XText
>>
>> Eclipse SDK
>>
>> Version: 3.5.0
>> Build id: I20090522-1710
>>
>>
>> cud anyone suggest a solution.
>>
>> :)
>>
>>
>> Durga
>>
Hello Sebastian

I just extracted the entire folder of TMF
XText[eclipse-SDK-3.5RC2-xtext-0.7RC2-win32] using winrar. And run the
eclipse.exe.

That's it.

Did I go wrong?

Didn't get any error messages.Ya..but I just set the parent folder name as
TMF_XText while extracting rather than the default
[eclipse-SDK-3.5RC2-xtext-0.7RC2-win32] before extracting.

Ya..2 warnings while running workflow:

error(10): internal error:
org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
invalid char literal: ''

error(10): internal error:
org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
invalid char literal: ''

--------------------------------------------------
Following is my console message:
--------------------------------------------------
..
..
659 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.datatypes.DatatypesPackage'
664 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.annotation.AnnotationPackage'
664 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.usagemodel.UsagemodelPackage'
2981 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory '../org.xtext.samm_dsl.Edifice/src-gen'
2981 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.samm_dsl.Edifice\..\o rg.xtext.samm_dsl.Edifice\src-gen
2991 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory '../org.xtext.samm_dsl.Edifice.ui/src-gen'
2992 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.samm_dsl.Edifice\..\o rg.xtext.samm_dsl.Edifice.ui\src-gen
2995 [main] INFO e.core.container.CompositeComponent - Generator
3062 [main] INFO ipse.xtext.generator.LanguageConfig - generating
infrastructure for org.xtext.samm_dsl.Edifice with fragments :
ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment,
EcoreGeneratorFragment, ParseTreeConstructorFragment,
ResourceFactoryFragment, DelegatingGeneratorFragment,
JavaValidatorFragment, JavaScopingFragment, FormatterFragment,
LabelProviderFragment, TransformerFragment, JavaBasedContentAssistFragment
error(10): internal error:
org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
invalid char literal: ''

error(10): internal error:
org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
invalid char literal: ''

16124 [main] INFO or.validation.JavaValidatorFragment - executing
generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
16335 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer.NullTokenColorer
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16336 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Comm onAntlrTokenColorer
(contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
16336 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.jface.text.rules.ITokenScanner ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.DefaultTok enScanner
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16336 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.jface.text.rules.ITokenScanner ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Antl rTokenScanner
(contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
16336 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
org.eclipse.xtext.ui.core.editor.FastLineBasedDamagerRepaire r (contributed
by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16337 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
org.eclipse.xtext.ui.core.editor.XtextDamagerRepairer (contributed by
de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
16337 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.jface.viewers.ILabelProvider ->
org.eclipse.xtext.ui.core.DefaultLabelProvider (contributed by
org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16337 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.jface.viewers.ILabelProvider ->
org.xtext.samm_dsl.labeling.EdificeLabelProvider (contributed by
org.eclipse.xtext.ui.generator.labeling.LabelProviderFragmen t)
16338 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
org.eclipse.xtext.ui.common.editor.outline.impl.DefaultSeman ticModelTransformer
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16338 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
org.xtext.samm_dsl.outline.EdificeTransformer (contributed by
org.eclipse.xtext.ui.generator.outline.TransformerFragment)
16338 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider ->
org.eclipse.xtext.common.contentassist.TerminalsProposalProv ider
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16338 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider ->
org.xtext.samm_dsl.contentassist.EdificeProposalProvider (contributed by
org.eclipse.xtext.ui.generator.contentAssist.JavaBasedConten tAssistFragment)
16459 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
completed in 13479ms!
----------------------------------------------------


Thanks.
Durga
Re: Crosslinks to rule that further crossreferences to an external metamodel class [message #50404 is a reply to message #50234] Thu, 11 June 2009 11:43 Go to previous messageGo to next message
Eclipse UserFriend
Hello Sebastian

I just extracted the entire folder of TMF
XText[eclipse-SDK-3.5RC2-xtext-0.7RC2-win32] using winrar. And run the
eclipse.exe.

That's it.

Did I go wrong?

Didn't get any error messages.
Ya..but I just set the parent folder name as TMF_XText while extracting
rather than the default [eclipse-SDK-3.5RC2-xtext-0.7RC2-win32] before
extracting.

--> Ya..2 warnings while running workflow:

error(10): internal error:
org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
invalid char literal: ''

error(10): internal error:
org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
invalid char literal: ''

--------------------------------------------------
Following is my console message:
--------------------------------------------------
..
..
659 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.datatypes.DatatypesPackage'
664 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.annotation.AnnotationPackage'
664 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.usagemodel.UsagemodelPackage'
2981 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory '../org.xtext.samm_dsl.Edifice/src-gen'
2981 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.samm_dsl.Edifice\..\o rg.xtext.samm_dsl.Edifice\src-gen
2991 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory '../org.xtext.samm_dsl.Edifice.ui/src-gen'
2992 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.samm_dsl.Edifice\..\o rg.xtext.samm_dsl.Edifice.ui\src-gen
2995 [main] INFO e.core.container.CompositeComponent - Generator
3062 [main] INFO ipse.xtext.generator.LanguageConfig - generating
infrastructure for org.xtext.samm_dsl.Edifice with fragments :
ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment,
EcoreGeneratorFragment, ParseTreeConstructorFragment,
ResourceFactoryFragment, DelegatingGeneratorFragment,
JavaValidatorFragment, JavaScopingFragment, FormatterFragment,
LabelProviderFragment, TransformerFragment, JavaBasedContentAssistFragment
error(10): internal error:
org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
invalid char literal: ''

error(10): internal error:
org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
invalid char literal: ''

16124 [main] INFO or.validation.JavaValidatorFragment - executing
generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
16335 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer.NullTokenColorer
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16336 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Comm onAntlrTokenColorer
(contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
16336 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.jface.text.rules.ITokenScanner ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.DefaultTok enScanner
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16336 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.jface.text.rules.ITokenScanner ->
org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Antl rTokenScanner
(contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
16336 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
org.eclipse.xtext.ui.core.editor.FastLineBasedDamagerRepaire r (contributed
by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16337 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
org.eclipse.xtext.ui.core.editor.XtextDamagerRepairer (contributed by
de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
16337 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding : org.eclipse.jface.viewers.ILabelProvider ->
org.eclipse.xtext.ui.core.DefaultLabelProvider (contributed by
org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16337 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding : org.eclipse.jface.viewers.ILabelProvider ->
org.xtext.samm_dsl.labeling.EdificeLabelProvider (contributed by
org.eclipse.xtext.ui.generator.labeling.LabelProviderFragmen t)
16338 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
org.eclipse.xtext.ui.common.editor.outline.impl.DefaultSeman ticModelTransformer
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16338 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
org.xtext.samm_dsl.outline.EdificeTransformer (contributed by
org.eclipse.xtext.ui.generator.outline.TransformerFragment)
16338 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
binding :
org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider ->
org.eclipse.xtext.common.contentassist.TerminalsProposalProv ider
(contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
16338 [main] DEBUG enerator.CompositeGeneratorFragment - with new
binding :
org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider ->
org.xtext.samm_dsl.contentassist.EdificeProposalProvider (contributed by
org.eclipse.xtext.ui.generator.contentAssist.JavaBasedConten tAssistFragment)
16459 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
completed in 13479ms!
----------------------------------------------------


Thanks.
Durga



Sebastian Zarnekow wrote:

> Hi Durga,

> how did you install Xtext? Did you get any warnings when generating your
> language?

> Regards,
> Sebastian

> Am 11.06.2009 15:00 Uhr, schrieb Durga Prasana Sahoo:
>> Hello Everyone
>>
>> I'm trying to implement a grammar that should allow to create concrete
>> models of a graph structure rather than a tree structure.
>>
>> My requirement is -
>> For Ex:
>>
>> (1)
>> ------------------------------------------------------
>> Pr_dtype id:"pr1"{
>> name:"pr_dtype_a";
>> doc:"safwaef";
>> type:0 ;
>> }
>>
>> MessageType id:"mssg_01"{
>> name:"asdasd";
>> doc:"sadfasf";
>> parameters:Parameter type: "pr_dtype_a" ;
>> }
>> ------------------------------------------------------
>>
>> which is backed by a grammar of the following pattern:
>>
>> import "http://q-impress.eu/samm/core" as refn_core
>> import "http://q-impress.eu/samm/datatype" as refn_datatypes
>> import "http://q-impress.eu/samm/staticstructure" as refn_staticstructure
>>
>> import "http://q-impress.eu/identifier" as ident
>>
>> ..
>> ..
>>
>> MessageType returns refn_staticstructure::MessageType:
>> 'MessageType' 'id:' id=STRING '{'
>> //parent attrib(s)
>> 'name:' name=STRING';'
>> 'doc:' documentation=STRING';'
>> //class specific attributes
>> 'parameters:' (parameters+=Parameter)+ ';'
>> '}'
>>
>> ;
>>
>> Parameter returns refn_staticstructure::Parameter:
>> 'Parameter' 'type:' type=[refn_datatypes::Type] ';'
>>
>> ;
>>
>> Type returns refn_datatypes::Type:
>> CollectionDataType | ComplexDataType | PrimitiveDataType
>> ;
>>
>> PrimitiveDataType returns refn_datatypes::PrimitiveDataType:
>> 'Pr_dtype' 'id:' id=STRING '{'
>> 'name:' name=STRING ';'
>> 'doc:' documentation=STRING ';'
>> 'type:'type=XSDPrimitiveDatatypes ';'
>> '}'
>>
>> ;
>>
>> enum XSDPrimitiveDatatypes returns refn_datatypes::XSDPrimitiveDataTypes:
>> string='0' | int='1' | float='2' | date='3' | time='4' | boolean='5'
>> ;
>>
>> ..
>> ..
>> ------------------------------------------------------------ --------
>>
>> So, the problem that I'm facing is that in using the above grammar, the
>> editor shows the error that:
>>
>> < mismatched input 'MessageType' expecting EOF > for the model
>> declaration (1).
>>
>> and if I alter the sequence of declaration as follows:
>>
>> (2)
>>
>> MessageType id:"mssg_01"{
>> name:"asdasd";
>> doc:"sadfasf";
>> parameters:Parameter type: "pr_dtype_a" ;
>> }
>>
>> Pr_dtype id:"pr1"{
>> name:"pr_dtype_a";
>> doc:"safwaef";
>> type:0 ;
>> } --------------------------------------------------------
>>
>> errors are :
>>
>> < Multiple markers at this line
>> - The feature 'type' of
>>
'eu.qimpress.samm.staticstructure.impl.ParameterImpl@15ee9d9{platform:/resource/Test/test.edifice#//@parameters.0}'
>> contains an unresolved proxy
>>
' eu.qimpress.samm.datatypes.impl.CollectionDataTypeImpl@1a102 ef{platform:/resource/Test/test.edifice#xtextLink_:://@param eters.0::http://q-impress.eu/samm/staticstructure#//Paramete r/type::/4}'
>>
>> - Couldn't resolve reference to Type >
>>
>> < mismatched input 'Pr_dtype' expecting EOF >
>>
>> ---------------------------------------------------------
>>
>> And yes I'm using TMF XText
>>
>> Eclipse SDK
>>
>> Version: 3.5.0
>> Build id: I20090522-1710
>>
>>
>> cud anyone suggest a solution.
>>
>> :)
>>
>>
>> Durga
>>
Re: Crosslinks to rule that further crossreferences to an external metamodel class [message #50432 is a reply to message #50404] Thu, 11 June 2009 11:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi Durga,

actually this is not a warning but an error. I guess, the Antlr Parser
has not been generated successfully.

The message indicates some wrong character literal in a terminal rule.
Did you define an empty character somewhere ('') or used two single
quotes inside a character literal?
If you don't mind, please send me your grammar and I'll have a look at it.

Thanks,
Sebastian

Am 11.06.2009 17:43 Uhr, schrieb Durga Prasana Sahoo:
> Hello Sebastian
>
> I just extracted the entire folder of TMF
> XText[eclipse-SDK-3.5RC2-xtext-0.7RC2-win32] using winrar. And run the
> eclipse.exe.
>
> That's it.
>
> Did I go wrong?
>
> Didn't get any error messages.
> Ya..but I just set the parent folder name as TMF_XText while extracting
> rather than the default [eclipse-SDK-3.5RC2-xtext-0.7RC2-win32] before
> extracting.
>
> --> Ya..2 warnings while running workflow:
>
> error(10): internal error:
> org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
> invalid char literal: ''
> error(10): internal error:
> org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
> invalid char literal: ''
> --------------------------------------------------
> Following is my console message:
> --------------------------------------------------
> ..
> ..
> 659 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.datatypes.DatatypesPackage'
> 664 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.annotation.AnnotationPackage'
> 664 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
> EPackage 'eu.qimpress.samm.usagemodel.UsagemodelPackage'
> 2981 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
> cleaning directory '../org.xtext.samm_dsl.Edifice/src-gen'
> 2981 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
> C:\Users\Durga\workspace_TMF\org.xtext.samm_dsl.Edifice\..\o rg.xtext.samm_dsl.Edifice\src-gen
>
> 2991 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
> cleaning directory '../org.xtext.samm_dsl.Edifice.ui/src-gen'
> 2992 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
> C:\Users\Durga\workspace_TMF\org.xtext.samm_dsl.Edifice\..\o rg.xtext.samm_dsl.Edifice.ui\src-gen
>
> 2995 [main] INFO e.core.container.CompositeComponent - Generator
> 3062 [main] INFO ipse.xtext.generator.LanguageConfig - generating
> infrastructure for org.xtext.samm_dsl.Edifice with fragments :
> ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment,
> EcoreGeneratorFragment, ParseTreeConstructorFragment,
> ResourceFactoryFragment, DelegatingGeneratorFragment,
> JavaValidatorFragment, JavaScopingFragment, FormatterFragment,
> LabelProviderFragment, TransformerFragment, JavaBasedContentAssistFragment
> error(10): internal error:
> org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
> invalid char literal: ''
> error(10): internal error:
> org.antlr.tool.Grammar.getCharValueFromGrammarCharLiteral(Gr ammar.java:1514):
> invalid char literal: ''
> 16124 [main] INFO or.validation.JavaValidatorFragment - executing
> generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
> 16335 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding :
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer.NullTokenColorer
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 16336 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding :
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITok enColorer ->
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Comm onAntlrTokenColorer
> (contributed by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
> 16336 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding : org.eclipse.jface.text.rules.ITokenScanner ->
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.DefaultTok enScanner
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 16336 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding : org.eclipse.jface.text.rules.ITokenScanner ->
> org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.Antl rTokenScanner (contributed
> by de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
> 16336 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
> org.eclipse.xtext.ui.core.editor.FastLineBasedDamagerRepaire r
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 16337 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding : org.eclipse.xtext.ui.core.editor.IDamagerRepairer ->
> org.eclipse.xtext.ui.core.editor.XtextDamagerRepairer (contributed by
> de.itemis.xtext.antlr.XtextAntlrGeneratorFragment)
> 16337 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding : org.eclipse.jface.viewers.ILabelProvider ->
> org.eclipse.xtext.ui.core.DefaultLabelProvider (contributed by
> org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 16337 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding : org.eclipse.jface.viewers.ILabelProvider ->
> org.xtext.samm_dsl.labeling.EdificeLabelProvider (contributed by
> org.eclipse.xtext.ui.generator.labeling.LabelProviderFragmen t)
> 16338 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding :
> org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
> org.eclipse.xtext.ui.common.editor.outline.impl.DefaultSeman ticModelTransformer
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 16338 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding :
> org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTra nsformer ->
> org.xtext.samm_dsl.outline.EdificeTransformer (contributed by
> org.eclipse.xtext.ui.generator.outline.TransformerFragment)
> 16338 [main] DEBUG enerator.CompositeGeneratorFragment - replacing
> binding :
> org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider
> -> org.eclipse.xtext.common.contentassist.TerminalsProposalProv ider
> (contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment)
> 16338 [main] DEBUG enerator.CompositeGeneratorFragment - with new
> binding :
> org.eclipse.xtext.ui.core.editor.contentassist.IContentPropo salProvider
> -> org.xtext.samm_dsl.contentassist.EdificeProposalProvider (contributed
> by
> org.eclipse.xtext.ui.generator.contentAssist.JavaBasedConten tAssistFragment)
>
> 16459 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
> completed in 13479ms!
> ----------------------------------------------------
>
>
> Thanks.
> Durga
>
>
>
> Sebastian Zarnekow wrote:
>
>> Hi Durga,
>
>> how did you install Xtext? Did you get any warnings when generating
>> your language?
>
>> Regards,
>> Sebastian
>
>> Am 11.06.2009 15:00 Uhr, schrieb Durga Prasana Sahoo:
>>> Hello Everyone
>>>
>>> I'm trying to implement a grammar that should allow to create concrete
>>> models of a graph structure rather than a tree structure.
>>>
>>> My requirement is -
>>> For Ex:
>>>
>>> (1)
>>> ------------------------------------------------------
>>> Pr_dtype id:"pr1"{
>>> name:"pr_dtype_a";
>>> doc:"safwaef";
>>> type:0 ;
>>> }
>>>
>>> MessageType id:"mssg_01"{
>>> name:"asdasd";
>>> doc:"sadfasf";
>>> parameters:Parameter type: "pr_dtype_a" ;
>>> }
>>> ------------------------------------------------------
>>>
>>> which is backed by a grammar of the following pattern:
>>>
>>> import "http://q-impress.eu/samm/core" as refn_core
>>> import "http://q-impress.eu/samm/datatype" as refn_datatypes
>>> import "http://q-impress.eu/samm/staticstructure" as
>>> refn_staticstructure
>>>
>>> import "http://q-impress.eu/identifier" as ident
>>>
>>> ..
>>> ..
>>>
>>> MessageType returns refn_staticstructure::MessageType:
>>> 'MessageType' 'id:' id=STRING '{'
>>> //parent attrib(s)
>>> 'name:' name=STRING';'
>>> 'doc:' documentation=STRING';'
>>> //class specific attributes
>>> 'parameters:' (parameters+=Parameter)+ ';'
>>> '}'
>>>
>>> ;
>>>
>>> Parameter returns refn_staticstructure::Parameter:
>>> 'Parameter' 'type:' type=[refn_datatypes::Type] ';'
>>>
>>> ;
>>>
>>> Type returns refn_datatypes::Type:
>>> CollectionDataType | ComplexDataType | PrimitiveDataType
>>> ;
>>>
>>> PrimitiveDataType returns refn_datatypes::PrimitiveDataType:
>>> 'Pr_dtype' 'id:' id=STRING '{'
>>> 'name:' name=STRING ';'
>>> 'doc:' documentation=STRING ';'
>>> 'type:'type=XSDPrimitiveDatatypes ';'
>>> '}'
>>>
>>> ;
>>>
>>> enum XSDPrimitiveDatatypes returns
>>> refn_datatypes::XSDPrimitiveDataTypes:
>>> string='0' | int='1' | float='2' | date='3' | time='4' | boolean='5'
>>> ;
>>>
>>> ..
>>> ..
>>> ------------------------------------------------------------ --------
>>>
>>> So, the problem that I'm facing is that in using the above grammar, the
>>> editor shows the error that:
>>>
>>> < mismatched input 'MessageType' expecting EOF > for the model
>>> declaration (1).
>>>
>>> and if I alter the sequence of declaration as follows:
>>>
>>> (2)
>>>
>>> MessageType id:"mssg_01"{
>>> name:"asdasd";
>>> doc:"sadfasf";
>>> parameters:Parameter type: "pr_dtype_a" ;
>>> }
>>>
>>> Pr_dtype id:"pr1"{
>>> name:"pr_dtype_a";
>>> doc:"safwaef";
>>> type:0 ;
>>> } --------------------------------------------------------
>>>
>>> errors are :
>>>
>>> < Multiple markers at this line
>>> - The feature 'type' of
>>>
> 'eu.qimpress.samm.staticstructure.impl.ParameterImpl@15ee9d9{platform:/resource/Test/test.edifice#//@parameters.0}'
>
>>> contains an unresolved proxy
>>>
> ' eu.qimpress.samm.datatypes.impl.CollectionDataTypeImpl@1a102 ef{platform:/resource/Test/test.edifice#xtextLink_:://@param eters.0::http://q-impress.eu/samm/staticstructure#//Paramete r/type::/4}'
>
>>>
>>> - Couldn't resolve reference to Type >
>>>
>>> < mismatched input 'Pr_dtype' expecting EOF >
>>>
>>> ---------------------------------------------------------
>>>
>>> And yes I'm using TMF XText
>>>
>>> Eclipse SDK
>>>
>>> Version: 3.5.0
>>> Build id: I20090522-1710
>>>
>>>
>>> cud anyone suggest a solution.
>>>
>>> :)
>>>
>>>
>>> Durga
>>>
>
>
Re: Crosslinks to rule that further crossreferences to an external metamodel class [message #50655 is a reply to message #50432] Fri, 12 June 2009 09:16 Go to previous message
Eclipse UserFriend
Hello Sebastian

You were perfectly correct. Indeed I had left out just '' in one place to
define
an abstract rule with no child inheritances or no assignments.

However, I removed the error.

Infact, I shall send you my grammar along with the intended purpose that I
wish to get out of TMF XText. But Since I have to elaborate what I exactly
need of the grammar, So I'm hoping to send you a detailed mail including
the grammar and the ecore metamodel it has to import as dependency.

I shall try sending it within a day or two.

Thanks a lot.

Durga
Previous Topic:[Xtext] Scoping Provider Implementation
Next Topic:[XText] An internal error occurred during: "XtextReconcilerJob".
Goto Forum:
  


Current Time: Tue Apr 29 02:29:37 EDT 2025

Powered by FUDForum. Page generated in 0.27456 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top