std/path/z/parser

Standard Library documentation

Pure Zuzu parser for ZPath expressions.

Module

Name
std/path/z/parser
Area
Standard Library
Source
modules/std/path/z/parser.zzm

NAME

std/path/z/parser - Pure Zuzu parser for ZPath expressions.

IMPLEMENTATION SUPPORT

This module is supported by all implementations of ZuzuScript.

DESCRIPTION

This module provides the pure-Zuzu parser used by ZPath.

EXPORTS

Classes

  • Parser({ lexer_class?, allowed_operators })

    Constructs a ZPath parser. Returns: Parser.

    • parser.parse_top_level_terms(src)

      Parameters: src is a ZPath expression string. Returns: Array. Parses comma-separated top-level expression terms.

    • parser.parse_expression(lx)

      Parameters: lx is a Lexer. Returns: Dict. Parses an expression.

    • parser.parse_ternary(lx)

      Parameters: lx is a Lexer. Returns: Dict. Parses ternary and Elvis expressions.

    • parser.parse_subexpression(lx, min_prec)

      Parameters: lx is a Lexer and min_prec is a precedence floor. Returns: Dict. Parses a precedence-climbing subexpression.

    • parser.parse_primary(lx)

      Parameters: lx is a Lexer. Returns: Dict. Parses a primary expression.

COPYRIGHT AND LICENCE

std/path/z/parser is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.