• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Splitting strings....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Splitting strings....


  • Subject: Re: Splitting strings....
  • From: Allan Odgaard <email@hidden>
  • Date: Sat, 28 Feb 2004 17:12:53 +0100

On 28. Feb 2004, at 15:46, Public Look wrote:

Scanning and parsing strings are two of the most mature disciplines in Computer Science and there is no reason to ever write this type of code the hard way again IMHO.

Although parsing is a mature theoretic discipline, I can think of a few practical reasons why the OP would not want to do as you suggest:

flex generate switch/case-code rather than parser-tables, leading to larger executables.

flex is for ASCII, not unicode, so at best the NSString should be converted to UTF8.

flex, by default, reads from a FILE* (stdin), the OP needs to work on a string (although flex actually use a macro to get the next byte, which can be re-defined to something else).

flex generate code rather than data, so only one grammar can be used pr. program (unless pre-processing the flex source to add namespace-prefixes or similar).

flex generate code which use global variables, so the program would not be re-entrant.

flex generate a parser for regular languages, so the OP would also need to use bison to solve his task -- now writing a grammar for both flex and bison and setting it up to solve his task starts to be more complicated than the task itself.

etc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Splitting strings....
      • From: Jerry LeVan <email@hidden>
References: 
 >Splitting strings.... (From: Jerry LeVan <email@hidden>)
 >Re: Splitting strings.... (From: Jerry LeVan <email@hidden>)
 >Re: Splitting strings.... (From: Public Look <email@hidden>)

  • Prev by Date: Help with unresponsive First Responder
  • Next by Date: OT: API to access ambient light sensor readings in PowerBook ?
  • Previous by thread: Re: Splitting strings....
  • Next by thread: Re: Splitting strings....
  • Index(es):
    • Date
    • Thread