[antlr-interest] Incompatible type in subrules with OR

Claudio Martella claudio.martella at tis.bz.it
Thu Jul 21 04:16:22 PDT 2011


Hello,

I've this grammar: http://pastebin.com/dNzdGx8R but i get this error
when I test it with AntlrWorks:

[11:23:59] /Users/hammer/output/RDFPathParser.java:383: incompatible types
[11:23:59] found   : RDFPathParser.repeat_return
[11:23:59] required: RDFPathParser.shortestPath_return
[11:23:59]                     v=repeat();
[11:23:59]                             ^
[11:23:59] /Users/hammer/output/RDFPathParser.java:586: incompatible types
[11:23:59] found   : RDFPathParser.filter_return
[11:23:59] required: RDFPathParser.subquery_return
[11:23:59]                     v=filter();
[11:23:59]                             ^
[11:23:59] 2 errors


Basically I think the problem is the assignment in the subrules with ORs
in two statements:

locationStep: edge condition? (v=repeat | v=shortestPath)? ('>'
locationStep)?
    -> ^(LOCATIONSTEP condition $v locationStep);

condition: ( v=filter | v=subquery ) condition?
    -> ^(CONDITION $v condition);

How do I handle these situations where I have the two or more options in
a subrule?


Thanks
Claudio

-- 
Claudio Martella
Free Software & Open Technologies
Analyst

TIS innovation park
Via Siemens 19 | Siemensstr. 19
39100 Bolzano | 39100 Bozen
Tel. +39 0471 068 123
Fax  +39 0471 068 129
claudio.martella at tis.bz.it http://www.tis.bz.it

Short information regarding use of personal data. According to Section 13 of Italian Legislative Decree no. 196 of 30 June 2003, we inform you that we process your personal data in order to fulfil contractual and fiscal obligations and also to send you information regarding our services and events. Your personal data are processed with and without electronic means and by respecting data subjects' rights, fundamental freedoms and dignity, particularly with regard to confidentiality, personal identity and the right to personal data protection. At any time and without formalities you can write an e-mail to privacy at tis.bz.it in order to object the processing of your personal data for the purpose of sending advertising materials and also to exercise the right to access personal data and other rights referred to in Section 7 of Decree 196/2003. The data controller is TIS Techno Innovation Alto Adige, Siemens Street n. 19, Bolzano. You can find the complete information on the web site www.tis.bz.it.






More information about the antlr-interest mailing list