LEX question -- can yytext be overwritten safely?

LEX question -- can yytext be overwritten safely?

Post by Mike Kels » Thu, 18 Nov 1993 10:31:38

I have perused O'Reilly's "lex & yacc" book (2d edition) to no avail.  In
a standalone lexer (no yacc grammar), can the execution code for a matched
expression overwrite the contents of yytext?
                                                -- Mike Kelsey
[  My opinions are not endorsed by SLAC, Caltech, or the US government  ]
"I've seen things you people wouldn't believe.  Attack ships on fire off
the shoulder  of Orion.   I've watched  C-beams glitter in  the darkness
near the Tannhauser Gate.  All these memories will be lost in time, like
tears in the rain."  -- Roy Batty

1. Question: lex/yacc yytext buf size (YYLMAX)

Solaris 2.5:

I have a question about lex/yacc and the size of the token buffer.  I am
trying to
increase the size of this buffer from its default size.  This buffer,
yytext, is
defined to be YYLMAX bytes, where YYLMAX defaults to BUFSIZ (1024).  The

"MKS LEX & YACC" book states that you can change this by redefining it
in the
definitions section of the lex source.  I tried doing this, but it still
seems to have a max
size of 1024 bytes.  However, on HP-UX, AIX, and Unixware it works fine.

In looking at the generated C code (filename_lex.c), I can see that
YYLMAX is indeed
redefined (in fact, I gret the warning "macro redefined: YYLMAX" when
However, the yytext character buffer is defined only once.  This differs
from HP-UX,
where yytext is redefined again later on in the filename_lex.c file.

Does anyone know if the size of the token buffer (yytext) can be
increased on Solaris?
If so, how do you do it?

2. Anyone else having apm problems in 4.0-STABLE ?

3. Lex maximum - Error when compiling with "lex"


5. Basic question: how to remove log safely

6. please help with this script

7. Question: Redefining drive size safely?

8. does kdm have any flags

9. Probs with yytext?

10. yytext?!?!

11. It's not bad canned meat...

12. Canned Proxy URLs to Filter