[antlr-interest] transforming strings

Manfred.Lotz at web.de Manfred.Lotz at web.de
Sun Dec 2 05:36:50 PST 2001


Hi there,

I want to transform a string which consists of a combination of
possibly 50 tokens into another string.

I defined a t.g with all tokens in it and was able to scan it using
the Lexer class.

The problem with the transform is that depending of certain
combinations  of three consecutive tokens I want to transform
differently.

E.g.:  tn t tm ==> tx ty where tn, tm, tx and ty are certain tokens.
Only t is a fixed token.

Here I have many combinations. 

I have no idea how to tackle the task using antlr. I'm aware that
using the lexer I've created I could write my own program to achieve
it. 

But perhaps I could use a method which is more elegant????


Manfred


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list