Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Terminal Rules token definitions are unreachable
Terminal Rules token definitions are unreachable [message #537038] Tue, 01 June 2010 06:55 Go to next message
Mattia Fazzini is currently offline Mattia FazziniFriend
Messages: 8
Registered: March 2010
Junior Member
Hi,
I am using Xtext 1.0.0 RC1 and I am working on the definition of some terminal rules inside the grammar file.

Using a terminal rule like the following, no problem.
terminal COMPONENTTYPE:
	'aaaa'|'bbbb'
;


If I declare a terminal rule like the following one:
terminal INPUTOUTPUT:
	'input'|'output'
;


This is the warning message that appears:
...
937  [main] INFO  ipse.xtext.generator.LanguageConfig  - generating infrastructure for .../tdsl.Tdsl with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, FormatterFragment, LabelProviderFragment, TransformerFragment, OutlineNodeAdapterFactoryFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment
warning(208): ../tdsl/parser/antlr/internal/InternalTdsl.g:2370:1: The following token definitions are unreachable: RULE_INPUTOUTPUT
14091 [main] INFO  or.validation.JavaValidatorFragment  - executing generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
warning(208): ../tdsl/ui/contentassist/antlr/internal/InternalTdsl.g:8289:1: The following token definitions are unreachable: RULE_INPUTOUTPUT
16419 [main] INFO  .emf.mwe2.runtime.workflow.Workflow  - Done.


is there any explanation to this behavior?
Re: Terminal Rules token definitions are unreachable [message #537067 is a reply to message #537038] Tue, 01 June 2010 08:47 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Mattia,

do you use the keyword 'input' or 'output' anywhere in your grammar
besides the terminal rule?

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

Am 01.06.10 08:55, schrieb Mattia Fazzini:
> Hi,
> I am using Xtext 1.0.0 RC1 and I am working on the definition of some
> terminal rules inside the grammar file.
>
> Using a terminal rule like the following, no problem.
>
> terminal COMPONENTTYPE:
> 'aaaa'|'bbbb'
> ;
>
>
> If I declare a terminal rule like the following one:
>
> terminal INPUTOUTPUT:
> 'input'|'output'
> ;
>
>
> This is the warning message that appears:
>
> ...
> 937 [main] INFO ipse.xtext.generator.LanguageConfig - generating
> infrastructure for .../tdsl.Tdsl with fragments :
> ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment,
> EcoreGeneratorFragment, ParseTreeConstructorFragment,
> ResourceFactoryFragment, XtextAntlrGeneratorFragment,
> JavaValidatorFragment, ImportNamespacesScopingFragment,
> QualifiedNamesFragment, BuilderIntegrationFragment, FormatterFragment,
> LabelProviderFragment, TransformerFragment,
> OutlineNodeAdapterFactoryFragment, QuickOutlineFragment,
> QuickfixProviderFragment, JavaBasedContentAssistFragment,
> XtextAntlrUiGeneratorFragment
> warning(208): ../tdsl/parser/antlr/internal/InternalTdsl.g:2370:1: The
> following token definitions are unreachable: RULE_INPUTOUTPUT
> 14091 [main] INFO or.validation.JavaValidatorFragment - executing
> generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
> warning(208):
> ../tdsl/ui/contentassist/antlr/internal/InternalTdsl.g:8289: 1: The
> following token definitions are unreachable: RULE_INPUTOUTPUT
> 16419 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
>
>
> is there any explanation to this behavior?
Re: Terminal Rules token definitions are unreachable [message #537073 is a reply to message #537067] Tue, 01 June 2010 09:00 Go to previous messageGo to next message
Mattia Fazzini is currently offline Mattia FazziniFriend
Messages: 8
Registered: March 2010
Junior Member
Yes I do, in fact I was thinking that was the problem.
If this is the problem, why just a warning message and not an error message?

Thank you.

Mattia.
Re: Terminal Rules token definitions are unreachable [message #537080 is a reply to message #537073] Tue, 01 June 2010 09:21 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Mattia Fazzini wrote on Tue, 01 June 2010 05:00
Yes I do, in fact I was thinking that was the problem.
If this is the problem, why just a warning message and not an error message?

Thank you.

Mattia.

Those messages are launched by ANTLR itself when compiling the grammar and not by xText as xText only generates the grammar then compiled by ANTLR so I think you gotta ask the ANTLR guys about this.

The explanation is clear though as it's not a blocking error so it's only a warning.
Re: Terminal Rules token definitions are unreachable [message #537089 is a reply to message #537073] Tue, 01 June 2010 09:14 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Mattia,

the warnings are produced by Antlr. I guess its not an error because
it's sometimes okay to have syntactically conflicting terminal rules -
especially in combination with syntactic or semantic predicates.

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

Am 01.06.10 11:00, schrieb Mattia Fazzini:
> Yes I do, in fact I was thinking that was the problem.
> If this is the problem, why just a warning message and not an error
> message?
>
> Thank you.
>
> Mattia.
Re: Terminal Rules token definitions are unreachable [message #537328 is a reply to message #537089] Wed, 02 June 2010 01:27 Go to previous message
Mattia Fazzini is currently offline Mattia FazziniFriend
Messages: 8
Registered: March 2010
Junior Member
Thank you for the information, I agree. But on the practical point of view, the DSL does not work. So, this is why I was a bit perplexed about it. However is not a problem.
Maybe a check message inside the editor should be really helpful. But I now this behavior does not depends from Xtext but from ANTLR.

Anyway thank you again.

Mattia.
Previous Topic:How to get the path of workspace ?
Next Topic:ANTLR Works question
Goto Forum:
  


Current Time: Thu Apr 25 04:17:20 GMT 2024

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

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

Back to the top