[ANN] CoreParse (Version n+1)

  • Hi All,

    A while ago I showed you all my parsing library 'CoreParse', and got some really useful feedback.  Today, I'd like to show you what's changed since then!

    • Easier processing of syntax trees into your data structures.
      In earlier versions of CoreParse you had to use a parser delegate to construct your data structures from the result of parsing expressions.  Not so in the new version!  Instead, Simply implement the CPParseResult protocol, and CoreParse will call -initWithSyntaxTree: when it finds something of that class.
    • Archiving and Unarchiving of parsers and tokenisers.
      Construction of large parsers can be quite slow and memory consuming, because of that you don't always want to do it at run time.  The new version of CoreParse implements NSCoding for both parsers and tokenisers, allowing you to quickly load them without creating them on the fly.
    • Error handling and recovery.
      Previous versions of CoreParse simply bailed out when they found something that couldn't be tokenised or parsed.  The new version adds support for several delegate callbacks allowing you to specify how the parser should deal with the situation:
      -tokeniser:didNotFindTokenOnInput:position:error: Allows you to advance the token position to skip unrecognised input, and to insert error tokens into the token stream.
      -parser:didEncounterErrorOnInput:expecting: Allows you to specify a recovery action for the parser to take (choose from deleting the token, inserting a dummy token, falling back to the previous item in the parse stack, or fail immediately), and do your own error reporting/handling.

    CoreParse has now been used in a couple of significant projects and proven to be stable and reliable:
    • I have used it to parse MapCSS in OpenStreetPad (https://github.com/beelsebob/OpenStreetPad).
    • Matt Mower has used it in his StateC state machine library (https://github.com/mmower/statec).  He has contributed significant feedback to make sure that the error handling is as robust as possible and provides as much information as it can for you to accurately report errors.

    Thanks

    Tom Davie
    if (*ra4 != 0xffc78948) { return false; }
  • I'm pretty sure I did this the first time I announced CoreParse too >.<

    Thanks for the suggestion Uli: https://github.com/beelsebob/CoreParse

    Tom Davie
    if (*ra4 != 0xffc78948) { return false; }

    On 5 Mar 2012, at 13:45, Uli Kusterer wrote:

    > On 05.03.2012, at 12:09, Thomas Davie wrote:
    >> A while ago I showed you all my parsing library 'CoreParse', and got some really useful feedback.  Today, I'd like to show you what's changed since then!
    >
    >
    > You have a link to CoreParse? :-)
    >
    > Cheers,
    > -- Uli Kusterer
    > "The Witnesses of TeachText are everywhere..."
    >
previous month march 2012 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Go to today