[antlr-interest] Noob Question
jacobson.martin at gmail.com
Fri Jul 2 06:22:12 PDT 2010
I suspect the error message is too generic to be useful for a noob like me!
I am trying to parse SVG <path> data and create "Geometry" objects
(using the JTS library) - I have a working, but limited parser that I
hand-coded, and a Java-CUP/JFlex version that has serious issues
surrounding Classpaths. I have started to look at ANTLR, and produced
the following in ANTLRWorks...
========================== begin ==============
INT : '0'..'9'+
: ('0'..'9')+ '.' ('0'..'9')* EXPONENT?
| '.' ('0'..'9')+ EXPONENT?
| ('0'..'9')+ EXPONENT
WS : ( ' '
EXPONENT : ('e'|'E') ('+'|'-')? ('0'..'9')+ ;
CmdM : 'M' FLOAT ','? FLOAT LineArgs?;
Cmdm : 'm' FLOAT ','? FLOAT LineArgs?;
: (FLOAT ','? FLOAT)+;
CmdL : 'L' LineArgs;
Cmdl : 'l' LineArgs;
CmdZ : 'Z'|'z';
: CmdM Cmdm* (CmdL|Cmdl)* CmdZ?;
I also don't know whether/how to indicated that whitespace is allowed,
but optional between lexer tokens.
Thanks for any insights!
On 2 July 2010 13:50, Bart Kiers <bkiers at gmail.com> wrote:
> Hi Martin,
> On Fri, Jul 2, 2010 at 2:35 PM, Martin Jacobson <jacobson.martin at gmail.com>
>> I have the following error:
>> /Users/martin/ANTLR/SVG/PathParser.g:0:0: syntax error: codegen:
>> <AST>:0:0: unexpected end of subtree
>> What does this indicate?
> Not sure. If, after search the below link, you're still stuck, could you
> post the grammar?
>> Is there a searchable archive I can trawl through?
> Yes: http://antlr.markmail.org/
> Bart Kiers.
>From my MacBook Pro
More information about the antlr-interest