Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Ambiguous binary operator in a PLSQL grammar(conflict between the multiplication operator (*) and the wildcard '*' in SQL SELECT sentence)
icon5.gif  Ambiguous binary operator in a PLSQL grammar [message #1728777] Thu, 07 April 2016 08:59 Go to next message
Cristo Rodriguez is currently offline Cristo RodriguezFriend
Messages: 2
Registered: April 2016
Junior Member
Ambiguous binary operator in a PLSQL grammar

I'm developing a grammar for Oracle PLSQL and I found a conflict between the multiplication operator (*, asterisk) and the wildcard '*' in SELECT * FROM.



QueryBlockFoo
: selectSentence='SELECT' '*' 'FROM' ';'
;

Multiplication returns Expression
: UnitaryOperator (({Operation.left=current} op='*') right=UnitaryOperator)*
;


When I test the grammar, the SELECT * FROM sentence works in a correct way, while the arithmetic operation ( var_a := 5*4; ) produces the error "mismatched input '*' expecting ';'


How can I resolve that?

Thanks in advance,
Cristo Rodriguez
Re: Ambiguous binary operator in a PLSQL grammar [message #1728832 is a reply to message #1728777] Thu, 07 April 2016 17:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
can you share a complete grammar that reproduces the problem?

maybe SELECT * FROM; could be a VarableRef(Select) * VariableRef(FROM); in your grammar


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Ambiguous binary operator in a PLSQL grammar [message #1729465 is a reply to message #1728832] Thu, 14 April 2016 10:27 Go to previous message
Cristo Rodriguez is currently offline Cristo RodriguezFriend
Messages: 2
Registered: April 2016
Junior Member
Thank you Christian,

I made a mistake because I defined '*' as a "terminal" rule.
When I remove the clause terminal, the grammar work well.

Regards,
Cristo
Previous Topic:Default Scope Shadowing
Next Topic:how to link new xpand project to existing xtext model
Goto Forum:
  


Current Time: Thu Apr 25 09:37:07 GMT 2024

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

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

Back to the top