[comp.lang.c] Help! DOS version of LEX needed.

ehughes@violet.berkeley.edu (07/07/87)

Help!  I need a LEX that will run under DOS 3.x.  The only one I know of is
the inadequate one that I am currently using (Austin Code Works).  If you can
help me send mail to ucbvax!violet!ehughes, or post if you think it of 
general interest.
 
Eric Hughes
ubcvax!violet!ehughes, etc. etc.
 
 
[ Sob story follows. ]
[ If you have just gotten used to your local system weirdnesses,
 don't read this.  :,)  (smiley face of Steve Martin in "Roxanne") ]
 
The LEX I have from Austin Code Works (ACW) is a port of the DECUS Lex by 
Charles Forsyth.  The original copyright date is 1978.  The most recent 
revision date is 1982.  The woman at ACW said they they had a new version,
but that she didn't know what it was, what its date was, or what new
features it had.  I wasn't about to spend day rates on the phone waiting for
her to look it up, either.  (BTW, ACW is a real bargain, I wasn't going to
hassle them over this.)
 
The version I have does not have the following capabilities:
1)  No ? (optional) marker
2)  No + (repeated >=1) marker
3)  No ^$ (line context) markers
4)  No <start conditions>
5)  No {} repetitions, and definitions are not standard
6)  Not even . for any character!
Definitions are done with the syntax  
        expression_name = regular_expression ;
All strings must therefore be quoted since {} are not used to expand
a definition.  (OK, but messy to look at.)
 
(Wait, but there's more you get :,)
The action words ECHO and REJECT are not supported, although there is a 
which impements ECHO.  The external 'yytext' is not there, although there
is a function to return the pointer.  The function 'yywrap()' is not
supported.
 
And to add insult to injury, the DFA is not minimized;  the analyzers created
are very slow.
 
So, if anybody has a better one that I can get, I would be most grateful.
 
Eric Hughes
ubcvax!violet!ehughes, etc. etc.
 
P.S.  What's even worse is that the YACC I have from ACW references the 
paper by S.C. Johnson as its documentation, i.e. it's perfectly standard.

edw@ius2.cs.cmu.edu (Eddie Wyatt) (07/08/87)

In article <4294@jade.BERKELEY.EDU>, ehughes@violet.berkeley.edu writes:
> 
> Help!  I need a LEX that will run under DOS 3.x.  The only one I know of is
> the inadequate one that I am currently using (Austin Code Works).  If you can
> help me send mail to ucbvax!violet!ehughes, or post if you think it of 
> general interest.
>  
> Eric Hughes
> ubcvax!violet!ehughes, etc. etc.

	(again this really doesn't belong in comp.lang.c but ....)

   Write your own lex analysizer.  I'm not saying rewrite LEX but
write the code that turns the text stream into a token stream
from scratch.   It really isn't that hard and you would probably
write more effecient code than what "lex" turns out.  

    I've rewritten a few modules that used "lex" code. Here's one
example. Profiling the code showed that about .75 msecs were being spent
in yylex (most of that time in yylook).  I rewrote the lexigraphic
analysizer in C to get yylex running at .15 msecs (5 times faster!).
Another one I rewrote didn't get such an astounding increase (1.5
increase in speed).

  So I suggest you scrap "lex" all together.

-- 
					Eddie Wyatt

e-mail: edw@ius2.cs.cmu.edu

terrorist, cryptography, DES, drugs, cipher, secret, decode, NSA, CIA, NRO.