help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: returning two tokens


From: Buday Gergely
Subject: RE: returning two tokens
Date: Wed, 3 Dec 2003 17:26:56 +0100 (MET)

Vincent Zweije writes:

> > I have to return two tokens in response to a single character. How
> > can I write this nicely using flex?
> 
> Assuming there's a parser on top of the scanner, it's probably
> clearer and easier to use an epsilon rule in the parser.
> Reducing by that rule will generate the extra non-terminal
> for you just when you need it.

It's not clear yet what will come on the top of my lexer - I haven't
figured out if yacc/bison is the right tool, or something hand-written.

Another solution is to write a wrapper that transforms this special 
token into two tokens.

> Think again if you really need to return two tokens.  Vincent.

It's a text-to-phoneme transformer, and here x should yield a 'k' and an
's'. So I have to stick to it.

- Gergely





reply via email to

[Prev in Thread] Current Thread [Next in Thread]