开发者

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

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

I'm looking for additional examples of using PetitParser beyond 开发者_Python百科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!


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.


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
  • ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜