Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: Passing a Method Name to a Method, Redux Date: Thu, 23 Jun 2011 19:46:07 -0700 Organization: A noiseless patient Spider Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="7Qrvczazr82YckO5XW8Vtw"; logging-data="22870"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eQHMI9ePZ4G3Vb3UBj4GfFI/90ghCrls=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:nXaQvTtcvv5lmoZimM2Ll+kJUSE= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5624 On Thu, 23 Jun 2011 17:24:43 -0700, markspace <-@.> wrote: >On 6/23/2011 4:03 PM, Gene Wirchenko wrote: >> >> So how would you have written this benchmark? >Um, realistically? Is this really what you want to do? > > static boolean TreesetSearch( char CurrChar ) { > return IdentCharsSet.contains( CurrChar ); > } Yes. I wanted a simple method call in the parser so I could cut-and-paste. I did not know if I would need more than one call. I am going to go with a Treeset so I will not have a separate method in the implementation. >All of the identifiers in your "language" are single characters? No. An identifier is a sequence of one or more characters that are in IdentChars (or IdentCharsSet). >I would have used actual strings, preferably from existing code so you >could test performance. Although I appreciate you making a >self-contained example for us'm here on usenet. I wanted an example. I have test files for when I have this worked out. Sincerely, Gene Wirchenko