I need to parse the following
model {
// any content, including brackets {}
var x= {} ;
// any content, including brackets {}
}
If I do it like this :
model : MODEL OBR modelBody CBR;
modelBody: modelBodyLine;
modelBodyLine: TEXT* (OBR TEXT* CBR)* TEXT*;
TEXT : ('a'..'z'|'A'..'Z'| '_' | '-')+ ;
OBR: '{';
CBR: '}';
I get this error
warning(200): /SWL Parser/src/ro/sft/swl/language/parser/SWL.g:46:16: Decision can match input such as "TEXT" using multiple alternatives: 1, 2 As a result, alternative(s) 2 were disabled for that input |---> modelBodyLine: TEXT* (OBR TEXT* CBR)* TEXT*;
So what would be the best way to parse it ?