Re: AT&T lex port

Hans-Bernhard Broeker <>
22 Oct 2000 01:21:22 -0400

          From comp.compilers

Related articles
AT&T lex port (2000-10-19)
Re: AT&T lex port (2000-10-22)
Re: AT&T lex port (Hans-Bernhard Broeker) (2000-10-22)
Re: AT&T lex port (Paul Evans) (2000-10-23)
Re: AT&T lex port (Paul Evans) (2000-10-26)
Re: AT&T lex port (Graham Douglas) (2001-01-09)
| List of all articles for this month |

From: Hans-Bernhard Broeker <>
Newsgroups: comp.compilers
Date: 22 Oct 2000 01:21:22 -0400
Organization: Aachen University of Technology (RWTH)
References: 00-10-145
Keywords: lex

Jason Brink <> wrote:
> Does anyone know of a port of AT&T lex to Windows NT/2000 or Linux?

Windows: maybe MKS's lex is AT&T. Go ask them.
[I'm pretty sure it's not. -John]
Linux: almost certainly doesn't exist.

> I've tried using flex on some of our lexers, and then compiling the
> generated code, and there are lots of problems.

I did a similar thing, very recently, regarding the now open-sourced
tool 'cscope', which also assumed an AT&T lex (it comes from the same
place on the map, after all :-). We had found that flex in '-l' mode
could handle just about all of the problem quite successfully, with
the only drawback being that the resulting scanner was rather slow
(factor of 6 slower than lex, on the same hardware).

The only things that 'flex' really fails to do, in my limited experience,

1) no support for 'yylineno'
2) no yyless() and yymore() calls allowed in the same action

Point 1) is an undocumented feature anyway, it seems, so no sane
scanner should rely on it.

I managed to squish this performance problem by seriously reworking
the scanner source.

So: if all else fails, you can answer me by mail, or post the details
to this newsgroup, and I'll see what I can do.
Hans-Bernhard Broeker (

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.