Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Roger L Costello Newsgroups: comp.compilers Subject: Re: How can the speed of a scanner be independent of the number of rules? Date: Thu, 24 Mar 2022 11:53:31 +0000 Organization: Compilers Central Lines: 18 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-03-056@comp.compilers> References: <22-03-047@comp.compilers> <22-03-048@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="71525"; mail-complaints-to="abuse@iecc.com" Keywords: lex, performance, comment Posted-Date: 24 Mar 2022 13:39:29 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Content-Language: en-US Xref: csiph.com comp.compilers:2954 Kaz Kylheku wrote: > suppose we have some existing scanner with 10 rules, > which correctly tokenizes an input. Then suppose we > add 990 rules to it. None of these rules take precedence > over the 10 rules, and so the the input is handled by the > same rules. Ouch!!! Such a letdown. So the statement "adding rules does not slow down the scanner" really isn't remarkable or awesome. Add 990 more irrelevant rules, and the scanner operates just as fast. Big deal. Thanks Kaz. /Roger [But see other messages -- adding 990 more relevant rules doesn't slow it down either. -John]