Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
Paul McGuire edited this pageAug 21, 2021 ·3 revisions

Zen of Pyparsing

  • Don't clutter up the parser grammar with whitespace, just handle it! (likewise for comments)
  • Class names are easier to read and understand than specialized typography
  • Use operators to implement an embedded parsing DSL:
    • + for And
    • | for MatchFirst
    • ^ for Or
    • ~ for NotAny
    • & for Each (like And, but accepting out of order)
    • - for And with no backtracking
    • << and<<= for Forward
    • ... for SkipTo
    • [...] for ZeroOrMore
  • Simple grammars can return lists; complex grammars need named results
  • Parsers can do more than just tokenize

Zen of Pyparsing Development

  • Grammars should be:
    • easy (and quick) to write
    • easy to read
    • easy to update
  • No separate code-generation step (like lex/yacc)
  • No forced naming conventions (like PLY)
  • Stay Pure Python
  • Liberally licensed (MIT license – free for commercial use)

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp