Skip to main content



      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 10:56 Go to next message
Eclipse UserFriend
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 11:19 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: invalid tokenType with the content assist parser [message #1722988 is a reply to message #1722985] Wed, 10 February 2016 11:28 Go to previous messageGo to next message
Eclipse UserFriend
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 12:08 Go to previous messageGo to next message
Eclipse UserFriend
Have a Look at the bindings in xtenduimodule as well. There are tons
regarding flex
Re: invalid tokenType with the content assist parser [message #1723003 is a reply to message #1722995] Wed, 10 February 2016 13:38 Go to previous messageGo to next message
Eclipse UserFriend
can you file a bug anyway. the createLookAheadTerminal thing does not seem to handle keywords right
Re: invalid tokenType with the content assist parser [message #1723035 is a reply to message #1723003] Thu, 11 February 2016 03:18 Go to previous messageGo to next message
Eclipse UserFriend
Issue submitted: 487638
Re: invalid tokenType with the content assist parser [message #1723043 is a reply to message #1723035] Thu, 11 February 2016 03:57 Go to previous messageGo to next message
Eclipse UserFriend
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 04:21] by Moderator

Re: invalid tokenType with the content assist parser [message #1723066 is a reply to message #1723043] Thu, 11 February 2016 06:03 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: invalid tokenType with the content assist parser [message #1723067 is a reply to message #1723066] Thu, 11 February 2016 06:05 Go to previous messageGo to next message
Eclipse UserFriend
Ps as I said there are tons of bindings in the xtenduimodule as well
Re: invalid tokenType with the content assist parser [message #1723076 is a reply to message #1723067] Thu, 11 February 2016 07:08 Go to previous message
Eclipse UserFriend
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 Jul 17 17:17:38 EDT 2025

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

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

Back to the top