Skip to content

PegCompiler

[Source]

Compiles a PEG grammar source into an executable Parser. Returns either the compiled parser or an array of errors found during compilation. The grammar must define a start rule and may define a hidden rule for whitespace/comments.

primitive val PegCompiler

Constructors

create

[Source]

new val create()
: PegCompiler val^

Returns


Public Functions

apply

[Source]

Compile source as a PEG grammar. On success, returns a Parser val ready to parse input. On failure, returns the accumulated errors.

fun box apply(
  source: Source val)
: (Parser box | Array[PegError box] ref)

Parameters

Returns


eq

[Source]

fun box eq(
  that: PegCompiler val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: PegCompiler val)
: Bool val

Parameters

Returns