Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » JavaValidator Xtext 2.0 Migration(Literals not found)
JavaValidator Xtext 2.0 Migration [message #692695] Tue, 05 July 2011 04:02 Go to next message
JJ Mising name is currently offline JJ Mising name
Messages: 12
Registered: November 2010
Junior Member
I am migrating my DSL to Xtext 2.0, so far so good, except for one little snag. The method signature of error and warning has changed. They now require an EFeature instead of an int. No big deal except that I can't find the Literals interface anywhere. Did a project wide search.

Am I missing something?
Re: JavaValidator Xtext 2.0 Migration [message #692699 is a reply to message #692695] Tue, 05 July 2011 04:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6395
Registered: July 2009
Senior Member
Hi,

The Literals Interface is contained in the YourdslPackage class. (nested) ~Christian
Re: JavaValidator Xtext 2.0 Migration [message #692749 is a reply to message #692695] Tue, 05 July 2011 06:59 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2911
Registered: July 2009
Senior Member
Hi JJ,

if your EPackage contains too many EClassifiers, EMF may decide to skip
the literals interface to avoid too large classes. You may want to use
MyPackage.eInstance().getEClassifier("name" OR
INT).getEStructuralFeature("name" or INT) instead.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

On 05.07.11 06:02, JJ wrote:
> I am migrating my DSL to Xtext 2.0, so far so good, except for one
> little snag. The method signature of error and warning has changed. They
> now require an EFeature instead of an int. No big deal except that I
> can't find the Literals interface anywhere. Did a project wide search.
> Am I missing something?
Re: JavaValidator Xtext 2.0 Migration [message #692969 is a reply to message #692699] Tue, 05 July 2011 15:06 Go to previous messageGo to next message
JJ Mising name is currently offline JJ Mising name
Messages: 12
Registered: November 2010
Junior Member
Yes, I understand that. I searched the entire project and "Literals" is nowhere to be found, not even in the generated XXXPackage class, where XXX is my DSL name.

All I did was to take my xtext file and start a new project in 2.0.
Re: JavaValidator Xtext 2.0 Migration [message #693029 is a reply to message #692969] Tue, 05 July 2011 16:31 Go to previous messageGo to next message
JJ Mising name is currently offline JJ Mising name
Messages: 12
Registered: November 2010
Junior Member
I just tried creating a blank project and it generates the class with the Literals interface. When I process my xtext file I get a long series of warnings all related to the same and last line in my InternalXXX.g file (see below): RULE_ANY_OTHER : .;

All the code generation happens properly (as far as I can tell) except that the Internals is not present in the XXXPackage file. Looks like I am going to have to fix these warnings.

As a result, token(s) T__41,T__42,RULE_ANY_OTHER were disabled for that input
error(208): ../com.canappi.metamodels.mdsl/src-gen/com/canappi/metamodels/mdsl/parser/antlr/internal/InternalMDsl.g:11830:1: The following token definitions can never be matched because prior tokens match the same input: T__27,T__31,T__41,T__42,T__45,T__46,T__47,T__48,T__51,T__54,T__55,T__57,T__58,T__59,T__60,T__61,T__63,T__64,T__65,T__67,T__68,T__70,T__71,T__72,T__73,T__74,T__75,T__76,T__77,T__78,T__79,T__80,T__81,T__82,T__83,T__84,T__85,T__86,T__87,T__88,T__89,T__90,T__91,T__92,T__93,T__94,T__95,T__96,T__97,T__98,T__99,T__100,T__101,T__102,T__103,T__104,T__105,T__106,T__107,T__108,T__109,T__110,T__111,T__112,T__113,T__114,T__115,T__117,T__118,T__119,T__120,T__121,T__122,T__123,T__124,T__125,T__126,T__127,T__128,T__129,T__130,T__132,T__133,T__134,T__135,T__137,T__139,T__140,T__141,T__142,T__143,T__144,T__145,T__146,T__147,T__148,T__149,T__150,T__151,T__152,T__153,T__154,T__155,T__156,T__157,T__158,T__159,T__161,T__162,T__163,T__164,T__165,T__166,T__167,T__168,T__169,T__171,T__172,T__173,T__174,T__175,T__176,T__177,T__178,T__179,T__180,T__181,T__182,T__183,T__184,T__185,T__186,T__187,T__188,T__189,T__190,T__191,T__192,T__193,T__194,T__195,T__196,T__197,T__198,T__199,T__200,T__201,T__203,T__205,T__206,T__207,T__208,T__209,T__210,T__211,T__212,T__213,T__214,T__215,T__216,T__217,T__218,T__220,T__221,T__222,T__223,T__224,T__225,T__226,T__227,T__228,T__229,T__230,T__231,T__232,T__233,T__234,T__235,T__236,T__237,T__238,T__239,T__240,T__241,T__242,T__243,T__244,T__248,T__249,T__250,T__251,T__252,T__253,T__258,T__259,T__260,T__261,T__262,T__263,T__264,T__265,T__266,T__268,T__269,T__271,T__273,T__274,T__275,T__276,T__277,T__278,T__279,T__280,T__281,T__283,T__284,T__285,T__286,T__287,T__288,T__289,T__290,T__291,T__292,T__293,T__294,T__295,T__296,T__297,T__298,T__300,T__301,T__302,T__303,T__304,T__305,T__306,T__309,T__310,T__311,T__312,T__313,T__314,T__315,T__316,T__317,T__318,T__319,T__320,T__321,T__322,T__323,T__324,T__325,RULE_INT,RULE_POSINTNUMBER,RULE_NEGINTNUMBER,RULE_SL_COMMENT
Re: JavaValidator Xtext 2.0 Migration [message #693067 is a reply to message #693029] Tue, 05 July 2011 17:58 Go to previous messageGo to next message
JJ Mising name is currently offline JJ Mising name
Messages: 12
Registered: November 2010
Junior Member
Ok, I have corrected my warnings now. It is quite strange, all I had to do is replace ('0'..'9')+ with ('0'..'9')('0'..'9')* in all my terminal declarations.

However, I am now able to process the xtext file without warnings (or errors) and the XXXPackage class does not contain any Literals interface.

This is the output of the xtext file processing:

0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri '/Users/jjdubray/Documents/moppr/releases/V1.1/workspace'
5136 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning /Users/jjdubray/Documents/moppr/releases/V1.1/workspace/com.canappi.metamodels.mdsl/../com.canappi.metamodels.mdsl/src-gen
5545 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning /Users/jjdubray/Documents/moppr/releases/V1.1/workspace/com.canappi.metamodels.mdsl/../com.canappi.metamodels.mdsl.ui/src-gen
6536 [main] INFO ipse.xtext.generator.LanguageConfig - generating infrastructure for com.canappi.metamodels.mdsl.MDsl with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, GeneratorFragment, FormatterFragment, LabelProviderFragment, OutlineTreeProviderFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment, Junit4Fragment, TypesGeneratorFragment, XbaseGeneratorFragment, CodetemplatesGeneratorFragment
32946 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.canappi.com/metamodels/mdsl/MDsl' from 'file:/Users/jjdubray/Documents/moppr/releases/V1.1/workspace/com.canappi.metamodels.mdsl/src-gen/com/canappi/metamodels/mdsl/MDsl.genmodel'
193469 [main] INFO or.validation.JavaValidatorFragment - generating Java-based EValidator API
277411 [main] INFO text.generator.junit.Junit4Fragment - generating Junit4 Test support classes
283476 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
Re: JavaValidator Xtext 2.0 Migration [message #693069 is a reply to message #693067] Tue, 05 July 2011 18:00 Go to previous message
JJ Mising name is currently offline JJ Mising name
Messages: 12
Registered: November 2010
Junior Member
Sorry, I just saw

MyPackage.eInstance().getEClassifier("name" OR
INT).getEStructuralFeature("name" or INT) instead.

Looks like it will solve my problem.

thanks,
Previous Topic:Bug in "align fields in columns" Formatter with inline comments
Next Topic:Maintain order in the file?
Goto Forum:
  


Current Time: Fri Oct 31 04:22:45 GMT 2014

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

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