On Thu, 2008-08-28 at 18:40 +0800, Ronghui Yu wrote:
> I am using ANTLR3.1 for developing a SQL parser
>
> One of my main rule looks like this
>
> sql_statement:
> sql_statement_command (';')?
>
> But when generating parser codes from grammar file to C source, it
> always take a very long time and consume as much as 5G memory because
> of the optional semicolon
> Then in order to make the development easier, I make the semicolon a
> mandatory by removing the question mark, like this
>
> sql_statement:
> sql_statement_command ';'
>
> It does make the building faster and require much less memory.
This indicates that there is something wrong with the formulation of
your grammar - getting the terminators correct in SQL is not easy.
>
> But the problem now is, when parsing a statement without the
> semicolon, such as the following
>
> select * from tt
>
> ANTLR won't handle this but issue a signal 11
> His is the stack information when this happening, when all test has
> been matched and is going to match the last semicolon
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xb7370a09 in getMissingSymbol ()
> from /home/oracle/install/lib/libantlr3c.so
> (gdb) where
> #0 0xb7370a09 in getMissingSymbol ()
> from /home/oracle/install/lib/libantlr3c.so
> #1 0xb73701d0 in recoverFromMismatchedToken ()
> from /home/oracle/install/lib/libantlr3c.so
> #2 0xb736f7bb in match () from /home/oracle/install/lib/libantlr3c.so
Yes - this probably is a bug. TO give me a bettr chance of seeing what
is happening, can you rebuild the runtime with debug information
included (see configure --help) and run it via valgrind? It is probably
some boundary condition that I did not anticipate.
Jim
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address