invalid tokenType with the content assist parser [message #1722978] |
Wed, 10 February 2016 15:56 |
|
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 #1723043 is a reply to message #1723035] |
Thu, 11 February 2016 08:57 |
|
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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05612 seconds