GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Categories
  • Newsletter
  • Submit
  • Login
  • Awesome C++
  • Containers

This view

  • Original page
  • New address

GeezerVison is showing cpp.libhunt.com — PEGTL Alternatives - C++ Containers | LibHunt

  • Subscribe
  • Submit
  • Categories
  • About
  • Login

PEGTL

Parsing Expression Grammar Template Library

taocpp logo
Source Code    Changelog
Suggest Changes
Take the C++ Developer Survey - About 6 minutes on the tools, libraries and AI you use with C++. You get the results by email. Take the survey »
Popularity
6.6
Stable
Activity
9.4
-
Stars 2,175
Watchers 59
Forks 249
Last Commit 14 days ago

Description

The Parsing Expression Grammar Template Library (PEGTL) is a zero-dependency C++11 header-only library for creating parsers according to a Parsing Expression Grammar (PEG).

Programming language: C++
License: gtkbook License
Tags: Containers     C++11     Parsing     Header Only     Library     Parser    
Latest version: v4.0.0

PEGTL alternatives and similar libraries

Based on the "Containers" category.
Alternatively, view PEGTL alternatives based on common mentions on social networks and blogs.

  • pybind11

    9.5 9.1 PEGTL VS pybind11
    Seamless operability between C++11 and Python
    pybind logo
  • FunctionalPlus

    6.6 5.5 L4 PEGTL VS FunctionalPlus
    Functional Programming Library for C++. Write concise and readable C++ code.
    Dobiasd logo
  • SaaSHub - Software Alternatives and Reviews

    SaaSHub helps you find the best software and product alternatives
    Promo www.saashub.com
    SaaSHub Logo
  • sparsehash

    6.2 0.0 L1 PEGTL VS sparsehash
    C++ associative containers
    sparsehash logo
  • sparsepp

    5.7 3.3 PEGTL VS sparsepp
    A fast, memory efficient hash map for C++
    greg7mdp logo
  • Hopscotch map

    4.8 3.7 L4 PEGTL VS Hopscotch map
    C++ implementation of a fast hash map and hash set using hopscotch hashing
    Tessil logo
  • function2

    4.1 3.3 PEGTL VS function2
    Improved and configurable drop-in replacement to std::function that supports move only types, multiple overloads and more
    Naios logo
  • LSHBOX

    3.8 0.0 L2 PEGTL VS LSHBOX
    A c++ toolbox of locality-sensitive hashing (LSH), provides several popular LSH algorithms, also support python and matlab.
    RSIA-LIESMARS-WHU logo
  • sparsehash-c11

    3.7 0.0 L3 PEGTL VS sparsehash-c11
    Experimental C++11 version of sparsehash
    sparsehash logo
  • Hashmaps

    3.7 0.0 L1 PEGTL VS Hashmaps
    Various open addressing hashmap algorithms in C++
    goossaert logo
  • semver

    3.6 6.9 PEGTL VS semver
    Semantic Versioning for modern C++
    Neargye logo
  • stx-btree

    3.3 0.0 PEGTL VS stx-btree
    OBSOLETE, contained in https://github.com/tlx/tlx - STX B+ Tree C++ Template Classes -
    bingmann logo
  • KOMIHASH

    3.3 4.6 PEGTL VS KOMIHASH
    Very fast, high-quality hash function, discrete-incremental and streamed hashing-capable (non-cryptographic, header-only C/C++) 27GB/s + PRNG
    avaneev logo
  • dynamic_bitset

    2.9 6.2 PEGTL VS dynamic_bitset
    Simple Useful Libraries: C++17/20 header-only dynamic bitset
    pinam45 logo
  • C++ B-tree

    2.3 0.0 PEGTL VS C++ B-tree
    DISCONTINUED. Git mirror of the official (mercurial) repository of cpp-btree
    algorithm-ninja logo
  • flat_map

    1.8 7.6 PEGTL VS flat_map
    Header only associative linear container.
    Flast logo
  • [Boost.]Multi

    1.6 10.0 PEGTL VS [Boost.]Multi
    Multidimensional arrays for C++. (Not an official Boost library) \\ This is a mirror of gitlab.com/correaa/boost-multi
    correaa logo
  • sqlitemap

    1.3 8.1 PEGTL VS sqlitemap
    sqlitemap is a lightweight C++ wrapper around SQLite that provides a simple, map-like interface.
    bw-hro logo
  • Optional Argument in C++

    1.2 0.0 PEGTL VS Optional Argument in C++
    Named Optional Arguments in C++17
    vincent-picaud logo
  • Learn Project

    1.0 0.0 PEGTL VS Learn Project
    go study
    SAMARITAN2046 logo
  • f-code

    1.0 7.2 PEGTL VS f-code
    DISCONTINUED. a C++ library consisting of basic functionality [GET https://api.github.com/repos/StanislavPetrov15/f-code: 404 - Not Found // See: https://docs.github.com/rest/repos/repos#get-a-repository]
    StanislavPetrov15 logo

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.

Do you think we are missing an alternative of PEGTL or a related project?

Add another 'Containers' Library

Popular Comparisons

  • PEGTL
    vs
    C++ B-tree
  • PEGTL
    vs
    pybind11
  • PEGTL
    vs
    sparsepp
  • PEGTL
    vs
    Hopscotch map
  • PEGTL
    vs
    stx-btree

README

Welcome to the PEGTL

Windows macOS Linux Android clang-analyze clang-tidy Sanitizer CodeQL Codecov

The Parsing Expression Grammar Template Library (PEGTL) is a zero-dependency C++ header-only parser combinator library for creating parsers according to a Parsing Expression Grammar (PEG).

The main branch will go through phases of incompatible changes while parts of the evolution branch are back-ported. Please download the latest release rather than using unreleased changes from the main branch.

Documentation

  • [Changelog](doc/Changelog.md)
  • [Development](doc/README.md) (requires C++17)
  • Version 3.x (requires C++17)
  • Version 2.x (requires C++11)
  • Version 1.x (requires C++11)

Contact

For questions and suggestions regarding the PEGTL, success or failure stories, and any other kind of feedback, please feel free to join our Discord server, open a discussion, an issue or a pull request on GitHub or contact the authors at taocpp(at)icemx.net.

Introduction

Grammars are written as regular C++ code, created with template programming (not template meta programming), i.e. nested template instantiations that naturally correspond to the inductive definition of PEGs (and other parser-combinator approaches).

A comprehensive set of [parser rules](doc/Rule-Reference.md) that can be combined and extended by the user is included, as are mechanisms for debugging grammars, and for attaching user-defined [actions](doc/Actions-and-States.md) to grammar rules. Here is an example of how a PEG grammar rule is implemented as C++ class with the PEGTL.

// PEG rule for integers consisting of a non-empty
// sequence of digits with an optional sign:

// sign ::= '+' / '-'
// integer ::= sign? digit+

// The same parsing rule implemented with the PEGTL:

using namespace tao::pegtl;

struct sign : one< '+', '-' > {};
struct integer : seq< opt< sign >, plus< digit > > {};

PEGs are superficially similar to Context-Free Grammars (CFGs), however the more deterministic nature of PEGs gives rise to some very important differences. The included [grammar analysis](doc/Grammar-Analysis.md) finds several typical errors in PEGs, including left recursion.

Design

The PEGTL is designed to be "lean and mean", the core library consists of approximately 6000 lines of code. Emphasis is on simplicity and efficiency, preferring a well-tuned simple approach over complicated optimisations.

The PEGTL is mostly concerned with parsing combinators and grammar rules, and with giving the user of the library (the possibility of) full control over all other aspects of a parsing run. Whether/which actions are taken, and whether/which data structures are created during a parsing run, is entirely up to the user.

Included are some [examples](doc/Contrib-and-Examples.md#examples) for typical situation like unescaping escape sequences in strings, building a generic JSON data structure, and on-the-fly evaluation of arithmetic expressions.

Through the use of template programming and template specialisations it is possible to write a grammar once, and use it in multiple ways with different (semantic) actions in different (or the same) parsing runs.

With the PEG formalism, the separation into lexer and parser stages is usually dropped -- everything is done in a single grammar. The rules are expressed in C++ as template instantiations, and it is the compiler's task to optimise PEGTL grammars.

Status

Each commit is automatically tested with multiple architectures, operating systems, compilers, and versions thereof.

Each commit is checked with GCC's and Clang's sanitizers, Clang's Static Analyzer, and clang-tidy. Additionally, we use CodeQL to scan for (security) issues.

Code coverage is automatically measured and the unit tests cover 100% of the core library code (for releases).

Releases are done in accordance with Semantic Versioning. Incompatible API changes are only allowed to occur between major versions.

Thank You

In appreciation of all contributions here are the people that have directly contributed to the PEGTL and/or its development.

The Art of C++

The PEGTL is part of The Art of C++.

License

Copyright (c) 2007-2022 Daniel Frey and Dr. Colin Hirsch

The PEGTL is certified Open Source software. It is licensed under the terms of the Boost Software License, Version 1.0 reproduced here.

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


*Note that all licence references and agreements mentioned in the PEGTL README section above are relevant to that project's source code only.

Do not miss the trending, libraries, news and articles with our weekly report.

Awesome C++ is part of the LibHunt network. Terms. Privacy Policy.

(CC)
BY-SA
Spin The Wheel Of Names for a cryptographically secure random name picker.
Schedule a when to meet poll.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.