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

lookahead implementation



Hi,

I've added lookahead token support to SableCC (3-beta.2). It's not yet
tested and performance may be very bad, and also the code needs to be
cleaned up, but some of you requested this feature, so use it and please
report the bugs what you find. you can download it from

http://www.hszk.bme.hu/~st340/mofkom/sablecc-3-beta.2.lookahead.tar.gz

The implementation is based on the Dragon Book and JFlex. There are some
restrictions: when te token regexp is variable length, its postfix may not
be te same as the lookahead's prefix.  Ignored tokens are allowed between
the token and it's lookahead. (A NFA accepting (ign_token_1 | ign_token_2
| ... | ign_token_n)* is prepended to the lookahead). This NFA may not be
prepended in future versions. After fixes and cleanups, I will create a
patch for the most recent SableCC versions (2-beta.2 and 3-beta.3). I will
try to minimize existing code modifications as much as possible.
Modifications and additions are described in the ChangeLog file of the
tarball.

Thank you for testing it!
Tibor