Crate tagua_parser [−] [src]
This library contains lexical and syntactic analysers, aka the parser, for the PHP language.
This is a parser combinator. The immediate consequence is that the lexical and syntax analyzers form a monolithic algorithm. The organization is the following:
tokensmodule declares all the lexemes,
rulesmodule declares the grammar as a set of rules,
astmodule contains the structure that will constitute the AST.
The parser is based on nom. nom is a parser combinator library with a focus on safe parsing, streaming patterns, and as much as possible zero copy. We try to enforce the zero copy property to hold.
Structures that will constitute the Abstract Syntax Tree.
Internal utilities for the parser.
Extra macros helping to write parsers.
The grammar as a set of rules.
List of lexemes.
Complete parsing of a datum starting by the sentence symbol of the grammar.