I took a brief hiatus to look at MGrammar and ANTLR to see how I can better parse the NOODB queries. I made some progress with MGrammar, but I’m just not very into it at this stage. I don’t have a great desire to learn it. I posted a question on StackOverflow to see if anyone has already written a grammar for query expressions; if that works out, then great. In the meantime, I’m continuing to parse manually.
Queries against string fields were only working if the string didn’t have spaces or quotes. I improved the parsing to work that stuff out. I created a fictional director, O’NEIL, to prove that nested quotes work. Well, at least I think I created him/her. I suppose there could be a director with a name of O’Neil. The fact that I didn’t further qualify the query with a year increases the odds that there could be, in fact, such a director. Wow. The implications are mind bending.
from m in Movie where m.Director='O''Neil' from m in iMovie where m.Director='George Lucas' from m in iMovie where m.ReleaseYear = 2005 from m in imovie where (m.ReleaseYear = 2005 && m.Director='George Lucas') || m.ReleaseYear = 1999 || m.ReleaseYear = 2002 from m in Movie where m.Director='George Lucas' from m in Movie where m.ReleaseYear = 2005 from m in movie where (m.ReleaseYear = 2005 && m.Director='George Lucas') || m.ReleaseYear = 1999 || m.ReleaseYear = 2002 from m in movie where m.Name='StarWars' && m.ReleaseYear=1977