Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » invalid tokenType with the content assist parser
invalid tokenType with the content assist parser [message #1722978] Wed, 10 February 2016 15:56 Go to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
Dear all.

I have created my DSL as an extension of Xtend.
Everything is working except the content assist feature.
In some particular cases, the exception below is thrown.

The typical use case is:
agent XXX {
   def myFunction : float {
      Math.
   }
}


If I ask the content assistant to give proposals after "Math.", it fails with:
Quote:

...
Caused by: java.lang.IllegalArgumentException: tokenType 44 seems to be invalid.
at org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser.createLookAheadTerminal(AbstractInternalContentAssistParser.java:533)
at org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser$DefaultFollowElementFactory.createFollowElement(AbstractInternalContentAssistParser.java:76)
at org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser.createFollowElement(AbstractInternalContentAssistParser.java:509)
at org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser$5.announceEof(AbstractInternalContentAssistParser.java:445)
at org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser.announceEof(AbstractInternalContentAssistParser.java:570)
at org.eclipse.xtext.ui.editor.contentassist.antlr.ObservableXtextTokenStream.LA(ObservableXtextTokenStream.java:48)
at io.sarl.lang.ui.contentassist.antlr.internal.InternalSARLParser.rule__XMemberFeatureCall__Group__1__Impl(InternalSARLParser.java:8355)
at io.sarl.lang.ui.contentassist.antlr.internal.InternalSARLParser.rule__XMemberFeatureCall__Group__1(InternalSARLParser.java:8310)
at io.sarl.lang.ui.contentassist.antlr.internal.InternalSARLParser.rule__XMemberFeatureCall__Group__0(InternalSARLParser.java:8232)
at io.sarl.lang.ui.contentassist.antlr.internal.InternalSARLParser.ruleXMemberFeatureCall(InternalSARLParser.java:7763)
at io.sarl.lang.ui.contentassist.antlr.internal.InternalSARLParser.rule__XPostfixOperation__Group__0__Impl(InternalSARLParser.java:7835)
at io.sarl.lang.ui.contentassist.antlr.internal.InternalSARLParser.rule__XPostfixOperation__Group__0(InternalSARLParser.java:7791)
at io.sarl.lang.ui.contentassist.antlr.internal.InternalSARLParser.ruleXPostfixOperation(InternalSARLParser.java:7593)
at io.sarl.lang.ui.contentassist.antlr.internal.InternalSARLParser.rule__XCastedExpression__Group__0__Impl(InternalSARLParser.java:7234)
at io.sarl.lang.ui.contentassist.antlr.internal.InternalSARLParser.rule__XCastedExpression__Group__0(InternalSARLParser.java:7190)




The configuration of my MWE2 script is:
    		fragment = contentAssist.JavaBasedContentAssistFragment auto-inject {}
    
    		fragment = parser.ContentAssistParserGenerator auto-inject {
			options = auto-inject {
				classSplitting = true
			}
		}


Is someone have any idea where I can start my exploration for fixing this issue?



Thank you.
Stéphane.
Re: invalid tokenType with the content assist parser [message #1722985 is a reply to message #1722978] Wed, 10 February 2016 16:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
did you have a look at the specialties that are done in the xtend mwe
https://github.com/eclipse/xtext/blob/v2.8.4/plugins/org.eclipse.xtend.core/src/org/eclipse/xtend/core/GenerateXtend.mwe2

e.g. the use of
- ContentAssistParserGenerator
- JFlexGeneratorFragment
- ....
i dont see these in your mwe2


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: invalid tokenType with the content assist parser [message #1722988 is a reply to message #1722985] Wed, 10 February 2016 16:28 Go to previous messageGo to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
Dear Christian.
Thank you for your reply.
I skipped the JFlex points since we are not using them until now.
I will take a look deeper in details on these mwe fragments.
Keep in touch.
Stéphane.
Re: invalid tokenType with the content assist parser [message #1722995 is a reply to message #1722988] Wed, 10 February 2016 17:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Have a Look at the bindings in xtenduimodule as well. There are tons
regarding flex


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: invalid tokenType with the content assist parser [message #1723003 is a reply to message #1722995] Wed, 10 February 2016 18:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
can you file a bug anyway. the createLookAheadTerminal thing does not seem to handle keywords right

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: invalid tokenType with the content assist parser [message #1723035 is a reply to message #1723003] Thu, 11 February 2016 08:18 Go to previous messageGo to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
Issue submitted: 487638
Re: invalid tokenType with the content assist parser [message #1723043 is a reply to message #1723035] Thu, 11 February 2016 08:57 Go to previous messageGo to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
I added the following lines in my mwe, and the exception is still here:
component = parser.JFlexLoader : jFlexMain {}

fragment = parser.JFlexGeneratorFragment auto-inject {
				ui = true
				patternPath = "/org/eclipse/xtend/core/parser/antlr/internal/patterns.incl"
				additionalRulePath = "/org/eclipse/xtend/core/parser/antlr/internal/rules.incl"
			}



I did not add the following because it causes compilation errors in the generated code (KW_* constants are not declared in the Flex parser):
			fragment = parser.JFlexGeneratorFragment auto-inject {
				patternPath = "/org/eclipse/xtend/core/parser/antlr/internal/patterns.incl"
				additionalRulePath = "/org/eclipse/xtend/core/parser/antlr/internal/rules.incl"
			}


Do you think adding this not-added fragment may solve the initial exception?

I am currently starting migrating from Xtext 2.8.4 to 2.9.1. Do you think it will solve my problem?

Stéphane

[Updated on: Thu, 11 February 2016 09:21]

Report message to a moderator

Re: invalid tokenType with the content assist parser [message #1723066 is a reply to message #1723043] Thu, 11 February 2016 11:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
I have no clues. This was just an idea having a look at the workflows. Btw
why do you extend xtend and not pure xbase


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: invalid tokenType with the content assist parser [message #1723067 is a reply to message #1723066] Thu, 11 February 2016 11:05 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Ps as I said there are tons of bindings in the xtenduimodule as well

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: invalid tokenType with the content assist parser [message #1723076 is a reply to message #1723067] Thu, 11 February 2016 12:08 Go to previous message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
We are needing object-oriented features (class, enum, etc.) in our agent-oriented language. We decided to extend xtend in place of re-coded all the oo support for saving time.

I will explore the injection module today.

Stéphane.
Previous Topic:Auto-completion outside an Eclipse editor, API reuse
Next Topic:Where put dependecy in new maven/gradle project build ?
Goto Forum:
  


Current Time: Thu Mar 28 12:26:48 GMT 2024

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

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

Back to the top