PHP 7.2.0 Release Candidate 2 Released

Introduction

The parle extension provides lexing and parsing facilities. The implementation is based on » Ben Hanson's libraries and requires a » C++14 capable compiler. The lexer is based on the regex matching, the parser is LALR(1). Lexers and parsers are generated on the fly and can be used immediately after they've been finalized. Serialization and code generation are not supported by the extension, yet.

Lexer analysis is a process of splitting a character sequence into a list of lexemes. The lexeme list can be then used for the syntax analysis against a formal grammar. These operations are also known as lexing and parsing. This documentation doesn't provide any exhaustive information on lexing and parsing, as there are numerous resources on the net touching this topic. The approach of the underlaying libraries used in parle is in most cases compatible to Flex, Bison and other similar tools. It is also useful to use Parle\Lexer::dump() to inspect the generated state machine, or Parle\Parser::dump() to inspect the generated grammar. The method Parle\Parser::trace() can be also useful to trace the parsing operation.

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top