Subject Re: [Firebird-Architect] Re: Gpre & the SQL parser
Author Jim Starkey
Stephen Boyd wrote:
>> I turned the DSQL parser into a class in Vulcan. It's not going to get
>> you anywhere. Yacc is yacc and doesn't subclass.
>> GPRE and QLI are both instances of GDML.
>> It shouldn't make any difference that GDML keywords overlap COBOL
>> keywords. The GDML is long gone before it hits the compiler. That's
>> why it's called a preprocessor.
> It matters because the GDML preprocessor sees a Cobol reserved word in
> the middle of a Cobol statement, grabs it and tries to parse it as a
> GDML command. This causes the precompiler to fail or to emit bogus
> Cobol code. Even simple things like a statement label like
> 0080-COMMIT causes the GDML parser to think that it has seen a COMMIT
> command. Thankfully the embedded SQL parser doesn't trigger until it
> sees EXEC SQL so it doesn't have the same problem.
The GPRE parser is supposed to quietly parse on until it is
unambiguously a database statement. That, incidentally, is difference
between the GPRE parser and the QLI or DSQL parsers. Don't try that
with yacc.

That said, the GPRE lex should pass the token 0080-COMMIT as
0080-COMMIT, not 0080, -, COMMIT. I suspect your bug is in lex, not parse.
>> Sorry, if I were smarter then, I would have used an OO API. The only
>> problem was that OO hadn't quite been invented then.
>> Add One to Cobol, anyone?
> A pun on C++. Cute! :)
Old joke. I can't take credit for it. I only take credit for things my
wife does.

James Starkey, Senior Software Architect
MySQL Inc., Manchester, MA, USA,
Office: 978 526-1376