Ragel lexer and Bison parser integration example

  •        571

This a sample of win(bison) parser and Ragel lexer integration, with unicode support

http://ragelbison.codeplex.com/

Tags
Implementation
License
Platform

   




Related Projects

language - A fast PEG parser written in JavaScript with first class errors

  •    Objective-J

Language.js is an experimental new parser based on PEG (Parsing Expression Grammar), with the special addition of the "naughty OR" operator to handle errors in a unique new way. It makes use of memoization to achieve linear time parsing speed, and support for automatic cut placement is coming to maintain mostly constant space as well (for a discussion of cut operators see: www.ialab.cs.tsukuba.ac.jp/~mizusima/publications/paste513-mizushima.pdf). The most unique addition Language.js makes to PEG is how it handles errors. No parse ever fails in Language.js, instead SyntaxErrorNodes are placed into the resultant tree. This makes it trivial to do things like write syntax highlighters that have live error reporting. This also means that Language.js is very competent at handling multiple errors (as opposed to aborting on the first one that is reached).

ANLP - Another .NET Lexer Parser

  •    Silverlight

This project aims to have a lexer/parser working in Silverlight and help people to write their own grammar and make the lexer/parser available in Silverlight.

csstree - A tool set for working with CSS including fast detailed parser, walker, generator and lexer based on W3C specs and browser implementations

  •    Javascript

CSSTree is a tool set to work with CSS, including fast detailed parser (string->AST), walker (AST traversal), generator (AST->string) and lexer (validation and matching) based on knowledge of spec and browser implementations. The main goal is to be efficient and W3C spec compliant, with focus on CSS analyzing and source-to-source transforming tasks. NOTE: The project is in alpha stage since some parts need further improvements, AST format and API are subjects to change. However it's stable enough and used by packages like CSSO (CSS minifier) and SVGO (SVG optimizer) in production.

eu.h8me.Parsing - (G)LR parsing/lexing library for .NET

  •    

Library implementing a regular expression based lexer and LR(1) based parser generator, using inline code to define lexer and grammar rules. The generated parser uses a GLR parsing engine to allow for ambiguous grammars.

cucumber-gherkin

  •    Ruby

A fast Gherkin parser in Ragel (The parser behind Cucumber)


lark - A modern parsing library for Python, implementing Earley & LALR(1) and an easy interface

  •    Python

Beginners: Lark is not just another parser. It can parse any grammar you throw at it, no matter how complicated or ambiguous, and do so efficiently. It also constructs a parse-tree for you, without additional code on your part. Experts: Lark lets you choose between Earley and LALR(1), to trade-off power and speed. It also contains a CYK parser and experimental features such as a contextual-lexer.

chevrotain - Parser Building Toolkit for JavaScript

  •    TypeScript

Chevrotain is a blazing fast and feature rich Parser Building Toolkit for JavaScript. It can be used to build parsers/compilers/interpreters for various use cases ranging from simple configuration files, to full fledged programing languages. A more in depth description of Chevrotain can be found in this great article on: Parsing in JavaScript: Tools and Libraries.

sql-parser - A SQL parser written in pure JS

  •    Javascript

SQL Parser is a lexer, grammar and parser for SQL written in JS. Currently it is only capable of parsing fairly basic SELECT queries but full SQL support will hopefully come in time. See the specs for examples of currently supported queries. The package is distributed on NPM and can be installed with...

CSP LR(1) Parser Generator

  •    C++

CSP Canonical LR(1) Parser Generator. Includes lexer and parser generator. Supports all OS. Produces code as standard ANSI C++ w/ minimal STL and usable in commercial or non-commercial purposes.

VRML 1.0 Parser

  •    C++

This is a parser for VRML 1.0c based on flex and bison.

Hyacc

  •    C

Hyacc is an efficient and practical Yacc/Bison-compatible full LR(1)/LALR(1)/LR(0) and partial LR(k) parser generator in ANSI C based on Knuth and Pager's LR(1) algorithms. Generated parser can be used in open-source or commercial software.

OILexer

  •    CSharp

OILexer is a LL parser generator for C# aimed at simple language parsing for language enthusiasts. Does not use recursive descent or bottom-up parsing methods, but rather, a top-down deterministic model is employed. This is a portion of the Abstraction Project.

parboiled2 - A macro-based PEG parser generator for Scala 2.10+

  •    Scala

parboiled2 is a Scala 2.11+ library enabling lightweight and easy-to-use, yet powerful, fast and elegant parsing of arbitrary input text. It implements a macro-based parser generator for Parsing Expression Grammars (PEGs), which runs at compile time and translates a grammar rule definition (written in an internal Scala DSL) into corresponding JVM bytecode.PEGs are an alternative to Context-Free Grammars (CFGs) for formally specifying syntax, they make a good replacement for regular expressions and have some advantages over the "traditional" way of building parsers via CFGs (like not needing a separate lexer/scanner phase).

slimit - SlimIt - a JavaScript minifier/parser in Python

  •    Python

SlimIt is a JavaScript minifier written in Python. It compiles JavaScript into more compact code so that it downloads and runs faster. SlimIt also provides a library that includes a JavaScript parser, lexer, pretty printer and a tree visitor.

YooParse

  •    C++

YooParse stands for Yet-another Object-Oriented Parser code generator. It is the complement of YooLex, a lexer code generator. The purpose of YooParse is to generate a parser that integrates tightly with the scanner generated by YooLex.

phpy

  •    PHP

Convert Yacc/Bison -v output to a php parser script to develop custom languages for use in php

bisonc++

  •    C++

The program bisonc++ creates a C++ parser function and -class having a cleaner setup than the code generated by Alain Coetmeur\'s bison++. Furthermore, since bisonc++ more closely follows current-day ideas about C++ programming its code is easier to read

bioawk - BWK awk modified for biological data

  •    C

Bioawk is an extension to Brian Kernighan's awk, adding the support of several common biological data formats, including optionally gzip'ed BED, GFF, SAM, VCF, FASTA/Q and TAB-delimited formats with column names. It also adds a few built-in functions and an command line option to use TAB as the input/output delimiter. When the new functionality is not used, bioawk is intended to behave exactly the same as the original BWK awk. The original awk requires a YACC-compatible parser generator (e.g. Byacc or Bison). Bioawk further depends on zlib so as to work with gzip'd files.

MGFp

  •    Flex

MGFp is open parser implementation for the Mascot Generic Format (MGF). It uses bison/flex to define a formal grammar and provides the necessary C++ adapter classes. The software is provided under a BSD license. Development on SF.net has ceased. You can find the project at http://kirchnerlab.github.com/libmgf/

lexer - Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.

  •    PHP

Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers. This lexer is used in Doctrine Annotations and in Doctrine ORM (DQL).