Download the PHP package stratadox/parser without Composer

On this page you can find all versions of the php package stratadox/parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package parser

Parser Combinator

Github Action Scrutinizer Code Quality

Simple Yet Powerful Parsing Library.

What is this

A library to create custom parsers. Based on the "ancient" concept of parser combinators, this library contains a vast variety of base parsers, decorators, combinators and helpers.

Why use this

Parsers made with this library can be used in many ways. Parsing is transforming text into a usable structure.

This can be used for various purposes, whether it be transforming json / csv / xml / yaml / etc. into some kind of data structure, or parsing a custom DSL or expression language into an abstract syntax tree.

Whether you wish to create your own file format, your own programming language, interpret existing file formats or languages... This library is here to help.

How to use this

For hands on how-tos, see the guide.

Installation

Using composer: composer require stratadox/parser

Overview

There's 3 base parsers: any, text and pattern.

These can be upgraded by a fair amount of add-ons ("decorators"), which can be combined as needed:

Parsers can be combined using these combinators:

All the above can be mixed and combined at will. To make life easier, there's a bunch of combinator shortcuts for "everyday tasks":

There's several additional helpers, which are essentially mapping shortcuts:

To enable lazy parsers (and/or to provide a structure), different containers are available:

Example 1: CSV

For a basic "real life" example, here's a simple CSV parser:

(For associative result mapping, see the CSV example)

Example 2: Calculator AST

This next example parses basic arithmetic strings (e.g. 1 + -3 * 3 ^ 2) into an abstract syntax tree:

(For a working example, see the Calculator example)

Documentation

Additional documentation is available through the guide, the tests.


All versions of parser with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stratadox/parser contains the following files

Loading the files please wait ....