Skip to content

dfreit4ss/typed-peg

 
 

Repository files navigation

Typed-PEG

Intro

Definition of a racket language for parsing expression grammars that generate a parse tree and also provide a type directed semantics for pretty printing them. The library also uses a type inference algorithm which determines if the PEG is complete, i.e. terminates its execution on all inputs.

Requirements

In order to type check, the tool need a working installation of Z3 SMT Solver. The project is known to work with Z3 version 4.8.14.

Languages

Following the racket approach to build small languages, we have build some auxiliar languages to ease the task of use/debug the tool.

  • #lang peg: default language, provides a parse and pretty printing function for the specified PEG, after infering types for the input PEG.
  • #lang peg/untyped: disable the type-inference engine. Use at your own risk!
  • #lang peg/debug/tokenize-only: outputs the result of the lexical analyser.
  • #lang peg/debug/parse-only: outputs the result of the parser.
  • #lang peg/debug/constraints-only: outputs the constraints generated by the algorithm.
  • #lang peg/debug/z3-script-only: outputs the z3 script that encode the constraints.
  • #lang peg/debug/infer-only: outputs the infered types for each grammar non-terminal.

About

No description, website, or topics provided.

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE-APACHE
Unknown
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Racket 100.0%