Hi comunity;
When I'm runing the tree grammar I defined I'm getting errors like
Error: mismatched input '[]' expecting FN_ID
So the it seems that it doesn't recognize ([])*. I 've already checked
the entry sintactically, so why antlr get confused?
What could be the problem, here is a part of my tree gramar:
type_return: 'void' | 'integer' ('[]')* | 'float'('[]')* |
'double'('[]')* | 'char'('[]')* | 'string'('[]')* | 'boolean'('[]')*;
decl_funcion
scope {
String ambito;
}
: ^(DECL_FUN type_return FN_ID LISTA_PARAMS lista_instrucciones (t2=inst_return{
if(!types_checker.areTypesEqual($type_return.text,$t2.type))
emitErrorMessage("Funcion '"+ $FN_ID.text + "' en la linea
" + $FN_ID.line +" : " + " devuelve un tipo de dato incoherente con
el definido.");
})?{if($type_return.text.equals("void") && ($t2.type!= null || $t2.type!=""))
emitErrorMessage("Funcion '"+ $FN_ID.text + "' en la
linea " +
$FN_ID.line +" : " + " devuelve void, no hay que devolver nada รณ
cambia su tipo de retorno.");
$decl_funcion::ambito = $FN_ID.text;
}
);
Thx in advance for any help;
--
Marouane
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---