Global

Methods

get_parser(options) → {Lark}

This is the main entrypoint into the generated Lark parser.

Source:
Parameters:
Name Type Description
options object

An object with the following optional properties:

  - transformer: an object of {rule: callback}, or an instance of Transformer
  - propagate_positions (bool): should all tree nodes calculate line/column info?
  - tree_class (Tree): a class that extends Tree, to be used for creating the parse tree.
  - debug (bool): in case of error, should the parser output debug info to the console?
Returns:
Type:
Lark

an object which provides the following methods:

- parse
- parse_interactive
- lex

get_parser(options) → {Lark}

This is the main entrypoint into the generated Lark parser.

Source:
Parameters:
Name Type Description
options object

An object with the following optional properties:

  - transformer: an object of {rule: callback}, or an instance of Transformer
  - propagate_positions (bool): should all tree nodes calculate line/column info?
  - tree_class (Tree): a class that extends Tree, to be used for creating the parse tree.
  - debug (bool): in case of error, should the parser output debug info to the console?
Returns:
Type:
Lark

an object which provides the following methods:

- parse
- parse_interactive
- lex

inplace_transformer()

Propagate ambiguous intermediate nodes and their derivations up to the current rule.

In general, converts

rule
  _iambig
    _inter
      someChildren1
      ...
    _inter
      someChildren2
      ...
  someChildren3
  ...

to

_ambig
  rule
    someChildren1
    ...
    someChildren3
    ...
  rule
    someChildren2
    ...
    someChildren3
    ...
  rule
    childrenFromNestedIambigs
    ...
    someChildren3
    ...
  ...

propagating up any nested '_iambig' nodes along the way.
Source:

inplace_transformer()

Propagate ambiguous intermediate nodes and their derivations up to the current rule.

In general, converts

rule
  _iambig
    _inter
      someChildren1
      ...
    _inter
      someChildren2
      ...
  someChildren3
  ...

to

_ambig
  rule
    someChildren1
    ...
    someChildren3
    ...
  rule
    someChildren2
    ...
    someChildren3
    ...
  rule
    childrenFromNestedIambigs
    ...
    someChildren3
    ...
  ...

propagating up any nested '_iambig' nodes along the way.
Source: