[antlr-interest] How could I store the data in objects?

Xiaohua Guo X.Guo at 4c.ucc.ie
Tue Jun 16 05:59:37 PDT 2009


Hi, 

I have written a grammar file in antlr to generate a parser and a lexer. I
want to use them to read a .dp file, get the data from tokens and then store
the data in objects. In that way I could use the data in the objects to
generate a data file. Some of the data in the objects will be reused in
future that's why I stored them in objects first. I have written a class in
Java, the objects can be initialized by the DataOfTask class. The return
value may be float or a distribution. 

 

My problem is I don't know how to change my .g file so that I could store
the data in the objects.

 

The attachment is my .g file, .dp file, DataOfTask class, and the test file.
Can some give me some advice? Thank you!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090616/b33279ca/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parserwithantlr.rar
Type: application/octet-stream
Size: 2975 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20090616/b33279ca/attachment.obj 


More information about the antlr-interest mailing list