[antlr-interest] Help With Left Recursion Kinda

Glen Miller glenmiller at skyviewsoftware.com
Fri Sep 21 10:26:27 PDT 2007


Does anyone have ideas on how to parse a file like this?  Can I code antlr to 
parse a file like that?

Level   Some Text
1               ObjectType1
2               ObjectType2
3               ObjectType1
3               ObjectType1
2               ObjectType2
3               ObjectType1
3               ObjectType1

So what I want to end up with is with object1 that contains a list of object2, 
and a object2 can contain a list of object1.  The level column tells me the 
nesting level of the object, and which object is the parent object.

Class ObjectType1
{
        List<ObjectType2> dataList;
}

Class ObjectType2
{
        List<Object1> dataList;
}

Thanks,
Glen Miller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070921/b66136e0/attachment.html 


More information about the antlr-interest mailing list