[antlr-interest] Suggestion needed

CK Ng ckng at nrg.cs.usm.my
Thu May 19 19:28:31 PDT 2005


I come across StringTemplate and it give me the following idea, can 
something like this be done? Anyone?

[my definition file]-->[parser < my definition grammar]-->AST

[AST above] --> [StringTemplate < template] --> [grammar 2]

[InputStream]-->[ parser < grammar 2] -->[output - obj]


Or is there other better approaches?

Regards,
CK Ng


----- Original Message ----- 
Sent: Thursday, May 19, 2005 4:59 PM
Subject: [antlr-interest] Suggestion needed


> Hi,
>
> I'm new in the parser technology, I would like to get some suggestions or 
> opinions for my current project.
>
> I've a byte stream (from a file or a live stream) to be parsed into useful 
> data, preferably into java object. From what I've gathered from reading 
> Antlr, I could write a grammar to define the data layout. However, writing 
> a EBNF grammar is a non-trivial task for normal user. Instead of defining 
> the data specification using EBNF, I would like to use more human friendly 
> interface by defining my own definition language, which can be written and 
> understand more easily by the average user.
>
> I could do
>
> [InputStream]-->[data grammar]-->[output - obj]
>
> But, I'd like to:
>
> [my definition file]-->[my definition grammar]-->[parser]-->AST
>
> [InputStream]-->[ (based on AST above) ???]-->[output - obj]
>
> where I'm missing a connection between the two.
>
> My question is how do I make use of my parsed definition to parse the 
> input stream?
> All examples and questions I found are geared toward 1st scenario, yet to 
> find any that match my case.
>
>
> Thanks.
>
> Regards,
> CK Ng
> 



More information about the antlr-interest mailing list