|
|
Re: Rules priority xtext [message #1735770 is a reply to message #1735765] |
Wed, 22 June 2016 14:54 |
Josselin Kerdraon Messages: 29 Registered: February 2016 |
Junior Member |
|
|
Hi Chistian,
here is a minimal version of my grammar:
Script:
instructions+=Instruction*;
Instruction:
statemement=Statement ';' |
call=FunctionCall ';'
Statement:
function=BarToMBar
BarToMBar:
'BarToMBar('input=[Assignable|STR] ',' output=[Assignable|STR]')'
;
FunctionCall:
functionName=[newFunction|STR] '('(arguments+=[Assignable|STR] ',')* arguments+=[Assignable|STR] ')'
;
CalcDeclaration returns newFunction:
'def' name=STR '('inParameters+=InVariable (',' inParameters+=InVariable )* (',' outParameters+=OutVariable)* ')' '{'
instructions+=Instruction*
'}'
;
terminal STR : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'\\')*;
ANTLR returns this to me:
warning(200): ../fr.snecma.saturne.script/src-gen/fr/snecma/saturne/script/parser/antlr/internal/InternalScript.g:1210:1: Decision can match input such as "RULE_STRING" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
warning(200): ../fr.snecma.saturne.script/src-gen/fr/snecma/saturne/script/parser/antlr/internal/InternalScript.g:3476:2: Decision can match input such as "'-'" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
|
|
|
|
|
|
|
Re: Rules priority xtext [message #1735779 is a reply to message #1735778] |
Wed, 22 June 2016 15:36 |
|
as i said: when i cannot reproduce this i cannot tell
setting
Expression value=ID does not help to make it fail.
did you have a look at the generated antlr file in the lines
1210 and 3476
it is complaining about "-" and the STRING rule which both are not used in what you posted
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.03737 seconds