unable to parse "JOIN" clause with PetitSQLiteGrammar

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

unable to parse "JOIN" clause with PetitSQLiteGrammar

Pharo Smalltalk Users mailing list
Good evening,
I'm working with "PetitSQLParser" on Pharo 7.0.3 and I've some trouble
parsing a "JOIN" query using the class "PetitSQLiteGrammar".

More specifically the code is:

|identSQL|
identSQL:=PetitSQLiteGrammar new.
identSQL parse: 'SELECT Code FROM Code_year INNER JOIN Open USING(Code)'
---->  "a PP2Failure: 'end of input expected'"


Removing "(ECR)"  the string get parsed in this way:

|identSQL|
identSQL:=PetitSQLiteGrammar new.
identSQL parse: 'SELECT Code FROM Code_year INNER JOIN Open USING'   ---->  
"an Array(an Array(nil nil an Array(an Array(an Array('SELECT' nil #(#('Code
' nil)) an Array('FROM' an Array(#(#(nil 'Code_year') nil nil) an
OrderedCollection(#(#(nil 'INNER' 'JOIN') #(#(nil 'Open') #(nil 'USING')
nil) nil)))) nil nil)) nil nil)))"


Where is the problem with the first code?
Why does the second code get parsed, instead of throwing an error?
Is it correct to get all these "nil" objects?

Have anyone some suggestion about where I could find information on this
issue?


Thanks,
Matteo



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html