[antlr-interest] Problem, with minimal problem-causing grammar
Phil Oliver
antlr at olivercomputing.com
Sun Jun 10 18:45:55 PDT 2007
Ter wrote:
> just increase the memory a little bit.
I have a large amount of RAM specified in the java invocation for the
ANTLRWorks jar but I gather it's launching a separate JVM when Debug
is invoked to compile/debug the compiled code. Inspecting the
ANTLRWorks source code, I see this in DBLocal.java (package
org.antlr.works.debugger.local):
remoteParserProcess = Runtime.getRuntime().exec(new String[] {
"java", "-classpath", classPath, remoteParserClassName});
Unless I'm missing something, that would be the logical place to add
a (preference dialog driven) parameter to increase the JVM memory
when launching the compiled grammar for debugging. I will probably
fiddle with this myself but I think this is something that should be
put into the main code, I'm surely not the only one to run into such
problems. Are you interested in getting source code updates?
>ANTLR does not seem to like tokens that can match no characters,
>which you have a grammar:
>
>StrNoHash : CharNoHash*;
>StrNoQuotAmp : CharNoQuotAmp*;
>
>These are meaningless because (...)* loops are optional. I think
>antlr might be going crazy here for these tokens, but I believe I
>have a bug report and already.
Ok. I would not say they are meaningless however - how else can I
match the potentially empty contents of a delimited string, e.g. an
empty string with double quotes ("") or hash marks (##) ? Or is it
that it should say:
StrNoHash : CharNoHash+;
then I simply have StrNoHash* when referenced in parser rules?
I've read that some systems have a truly integrated lexer/parser,
where there is no artificial distinction made between tokens and
parser pattern matching rules - would it fundamentally break the
architecture of ANTLR for it to become that way someday?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070610/a3d4eae8/attachment.html
More information about the antlr-interest
mailing list