Liking cljdoc? Tell your friends :D

parka.api

Main namespace for building and using Parka's PEG parsers. The functions in this file create Parka structures to describe, for example, a choice between several expressions. Such an expression can be compiled into a parser engine, and then this engine can be executed repeatedly on input strings.

Parser expressions are constructed from the following:

  • Characters parse exactly themselves.
  • Strings parse as a sequence of characters, exactly as given.
  • Sets of Characters parse any one character which is a member of the set.
  • A vector is a nestable sequence (equivalent to calling seq).
  • Keywords reference a nonterminal in the same grammar.
  • Each of the parser combinators in this namespace produces an expression.

A grammar is a map from keyword labels to parsing expressions, plus a start symbol. Grammars are themselves a parsing expression and can be nested.

Once you have constructured your complete expression, call compile with it. The returned engine can be run by calling parse.

Main namespace for building and using Parka's PEG parsers.
The functions in this file create Parka structures to describe, for example,
a choice between several expressions.
Such an expression can be compiled into a parser engine, and then this engine
can be executed repeatedly on input strings.

Parser expressions are constructed from the following:
- Characters parse exactly themselves.
- Strings parse as a sequence of characters, exactly as given.
- Sets of Characters parse any one character which is a member of the set.
- A vector is a nestable sequence (equivalent to calling `seq`).
- Keywords reference a nonterminal in the same grammar.
- Each of the parser combinators in this namespace produces an expression.

A grammar is a map from keyword labels to parsing expressions, plus a start
symbol. Grammars are themselves a parsing expression and can be nested.

Once you have constructured your complete expression, call `compile` with it.
The returned engine can be run by calling `parse`.
raw docstring

parka.machine.compiler

Handles the compilation from the PEG grammar syntax to the parsing machine instructions.

Handles the compilation from the PEG grammar syntax to the parsing machine
instructions.
raw docstring

parka.streams

Helper stream library for parsing, they're maps, like this:

keydescription
:strEntire input string
:posCurrent index into that string
:filenameSource file name
:lineCurrent line number (1-based)
:colCurrent column number (0-based)
:valueArbitrary parsing result (optional)
:stateArbitrary user state (optional)
Helper stream library for parsing, they're maps, like this:

| key | description |
| --- | ----------- |
| `:str` | Entire input string |
| `:pos` | Current index into that string |
| `:filename` | Source file name |
| `:line` | Current line number (1-based) |
| `:col` | Current column number (0-based) |
| `:value` | Arbitrary parsing result (optional) |
| `:state` | Arbitrary user state (optional) |
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close