Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
itod committed Jan 27, 2010
1 parent a021b95 commit 9f7de30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ slash chars now produce individual Symbol tokens rather than causing the tokeniz
h3. Parsing

ParseKit also includes a collection of token parser subclasses (of the abstract PKParser class) including collection parsers such as PKAlternation, PKSequence, and PKRepetition as well as terminal parsers including PKWord, PKNum, PKSymbol, PKQuotedString, etc. Also included are parser subclasses which work in individual chars such as PKChar, PKDigit, and PKSpecificChar. These char parsers are useful for things like RegEx parsing. Generally speaking though, the token parsers will be more useful and interesting.

The parser classes represent a **Composite** pattern. Programs can build a composite parser, in **Objective-C** (rather than a separate language like with lex&yacc), from a collection of terminal parsers composed into alternations, sequences, and repetitions to represent an infinite number of languages.

Parsers built from ParseKit are **non-deterministic, recursive descent parsers**, which basically means they trade some performance for ease of user programming and simplicity of implementation.

Here is an example of how one might build a parser for a simple voice-search command language (note: ParseKit does not include any kind of speech recognition technology). The language consists of:

<pre>search google for? <search-term></pre>
Expand Down

0 comments on commit 9f7de30

Please sign in to comment.