Where could I find more examples of using PetitParser? [closed]
Asked Answered
C

2

10

I'm looking for additional examples of using PetitParser beyond PPArithmeticParser and PPLambdaParser that are provided in the tests package and a couple of blog posts by Lukas? If anyone's willing to share theirs, it would be much appreciated.

Updated: https://github.com/NicolasPetton/jtalk/blob/master/st/parser.st
Updated: https://github.com/dmatveev/waste/blob/master/wastex.st

Keep 'em coming!

Casie answered 18/4, 2011 at 13:3 Comment(1)
Well, you have gotten what you expected, namely, answers supported by facts, references and expertise. Also, no debate, arguments, polling or extended discussions were originated. As a result, the reasons given for closing this question have no footing.Largescale
S
10

Have a look at the official PetitParser code repository, there are many grammars ready to download:

  • PetitCSV
  • PetitJson (well tested, builds Smalltalk objects)
  • PetitMSE
  • PetitManifestMf
  • PetitRegex
  • PetitSQL
  • PetitSmalltalk (well tested, can be used as a replacement for the refactoring engine parser)
  • PetitXml (well tested)

Additionally you find various PetitParser grammars on SqueakSource. Just search for 'PetitParser' as a keyword and you find more or less complete grammars for Java, JavaScript, Ada, SQL, and some others.

Steeve answered 18/4, 2011 at 16:24 Comment(0)
I
3

There are a lot of small nice examples on PetitParsers Google+ site.

  • Quickly extract all JavaDoc comments from a file
  • Parse 'self', but not variables like 'selfish' or 'selfism'
  • A PetitParser grammar that only accepts an even number of a's and b's
  • Parse a non context-free language
  • Parse floating point numbers
  • Parse nestable Haskell comments
  • ...
Interruption answered 4/9, 2012 at 9:45 Comment(1)
It's sad that this was on the killed-by-Google G+ social media. Did anyone save it?Fascista

© 2022 - 2024 — McMap. All rights reserved.