flex notes, request, and bugs
Esmond Pitt
ejp at ausmelb.oz
Tue May 10 13:52:30 AEST 1988
1. Some things Vern left out of his flex.1 'man' page:
- Lex has no comment facility. Flex does:
lines beginning with '#' are ignored within a flex script.
- You mustn't modify yytext[] or yyleng within a flex action.
- If you refer to yytext outside your script, it's
extern char *yytext.
In lex it's
extern char yytext[];
- If you provide your own yywrap() routine, #undef yywrap first.
- In 'lex', ^ and $ aren't metacharacters within a name expansion.
Flex has the same problem, or feature ...
2. A request: could a 'flex' scanner have something #define'd to help in
configuring scripts for 'lex' or 'flex', e.g. # define FLEX?
3. Bug: The pattern
"DATA"([ \n;,])+/("."|[ \n;,])
which arises in one of my scripts after name expansion, is incorrectly
treated as having variable length head & tail & is thus rejected. The
action for the rule for '|' in parse.y always treats the result as
variable length regardless of reality.
4. Bug: the following script for 80-column Cobol card images
gets 'NULL in input' under flex -f or -F, even after the '-f/-F' patch.
It works under 'lex', but slowly!
%%
" "*.{8}\n.{6}[^-] {
/*
** Delete trailing blanks & columns 73..80 from non-continued line
*/
fputs(&yytext[yyleng-8],yyout);
}
.{8}$ {
/*
** Delete columns 73..80 from any other line
*/
;
}
--
Esmond Pitt, Austec International Ltd
...!uunet.UU.NET!munnari!ausmelb!ejp,ejp at ausmelb.oz
More information about the Comp.sources.bugs
mailing list