Path: utzoo!mnetor!uunet!munnari!mulga!ausmelb!ejp
From: ejp@ausmelb.oz (Esmond Pitt)
Newsgroups: comp.sources.bugs
Subject: flex notes, request, and bugs
Message-ID: <651@ausmelb.oz>
Date: 10 May 88 03:52:30 GMT
References: <1820@uhccux.UUCP>
Reply-To: ejp@ausmelb.oz.au (Esmond Pitt)
Organization: Austec International Limited, Melbourne
Lines: 53
Keywords: flex

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@ausmelb.oz