Date: Mon, 12 May 1997 13:06:24 -0400 (EDT) From: "Art S. Kagel" To: Gary R Sekinger Cc: djgpp AT delorie DOT com Subject: Re: flex/bison lower/upper case question In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Fri, 9 May 1997, Gary R Sekinger wrote: > > > I'd like to have my grammar be case insensitive but this doesn't seem > very easy. I've started specifying all the various combinations, which > isn't very practical: > > SEED {return SEED;} > Seed {return SEED;} > seed {return SEED;} > > Is there an easy way to do this? I have the Lex & Yacc book by O'Reilly > but would love to look at other example grammars. Any suggestions of > grammars out there in the public domain? > > tia, > Gary Sekinger > > ps. Im using: > > E:\WINDOWS>flex --version > c:/djgpp/bin/flex.exe version 2.5.2 > > E:\WINDOWS>bison --version > GNU Bison version 1.24 > > From the GNU Flex manual Chapter 5.1: ...There are ways for specifying case-insensitive scanners in LEX, but they are generally ugly and difficult to understand. .... From the GNU Flex manual Chapter 5.1.1: Flex has a very simple way of solving this problem. By using the '-i' switch on the command line, you can tell Flex to generate a scanner that ignores case in its input. ... So just add -i to the Flex command line when generating the parser and voila! Art S. Kagel, kagel AT bloomberg DOT com