pyg will be a PEG parser library formed as an internal Python DSL. it will be used in cramex, a copycat of cram with expect support.

The surface is heading to resemble Boost.Spirit: grammars are composed using a vaguely (xBNF/PEG)-like syntax enabled through operator overloading.

>>> from pyg import Rule, chr_, int_

>>> n = Rule('number')
>>> o = Rule('operator')
>>> e = Rule('expression')

>>> e %= n >> o >> n
>>> o %= chr_('+-')
>>> n %= int_

>>> e.matches('42 + 69')
True, None
>>> e.matches('69')
True, None
>>> e.matches('42 69')
False, "Failed on line 1 column 3:\n42 69\n  ^\n"

Looking for hackers with the skills:

python parsing peg

This project is part of:

Hack Week 10

Activity

  • about 12 years ago: rneuhauser added keyword "python" to this project.
  • about 12 years ago: rneuhauser added keyword "parsing" to this project.
  • about 12 years ago: rneuhauser added keyword "peg" to this project.
  • about 12 years ago: rneuhauser started this project.
  • about 12 years ago: rneuhauser originated this project.

  • Comments

    • rneuhauser
      about 12 years ago by rneuhauser | Reply

      https://github.com/roman-neuhauser/py-impala - Import packages and modules from arbitrary directories and files

    Similar Projects

    Bring to Cockpit + System Roles capabilities from YAST by miguelpc

    Bring to Cockpit + System Roles features from YAST

    Cockpit and System Roles have been added to SLES 16 There are several capabilities in YAST that are not yet present in Cockpit and System Roles We will follow the principle of "automate first, UI later" being System Roles the automation component and Cockpit the UI one.

    Goals

    The idea is to implement service configuration in System Roles and then add an UI to manage these in Cockpit. For some capabilities it will be required to have an specific Cockpit Module as they will interact with a reasource already configured.

    Resources

    A plan on capabilities missing and suggested implementation is available here: https://docs.google.com/spreadsheets/d/1ZhX-Ip9MKJNeKSYV3bSZG4Qc5giuY7XSV0U61Ecu9lo/edit

    Linux System Roles: https://linux-system-roles.github.io/