23 releases

0.9.1 Jul 6, 2018
0.8.1 Jun 17, 2018
0.7.2 Dec 13, 2017
0.7.1 Nov 20, 2017
0.3.0 Jul 31, 2017

#40 in Parsing tools

Download history 21/week @ 2018-05-04 12/week @ 2018-05-11 1/week @ 2018-05-18 38/week @ 2018-05-25 76/week @ 2018-06-01 2/week @ 2018-06-08 70/week @ 2018-06-15 65/week @ 2018-06-22 166/week @ 2018-06-29 52/week @ 2018-07-06 59/week @ 2018-07-13 81/week @ 2018-07-20 59/week @ 2018-07-27

221 downloads per month
Used in 3 crates (2 directly)

BSD-3-Clause

192KB
4K SLoC

GLL 450 parser

Build Status crates.io

This is a GLSL450 parser which aims is to parse a GLSL450-formatted source into an in-memory representation (AST). It strictly follows the grammar rules defined in the official GLSL 450 specifications.

Currently, the parser expects the input source to be &[u8], which provides a pretty poor experience in error reporting. This is a serious issue and is being worked on.


lib.rs:

GLSL compiler

This crate is a GLSL450 compiler. It’s able to parse valid GLSL450 formatted source into an abstract syntax tree (AST). That AST can then be transformed into SPIR-V, your own format or even folded back to a raw GLSL String (think of a minifier, for instance).

You’ll find several modules:

  • parser, which exports the parsing interface (functions, types) to use the GLSL parsers.
  • parsers, which exports most of the parsers to parse the whole or a part of GLSL source (intermediary parsers).
  • syntax, which exports the AST and language definition.

Feel free to inspect those modules for further information.

Quick parsing

If you’re just looking for a parser that would give you the AST for a shader, you might be interested in parse_str and translation_unit.

Dependencies

~607KB
~15K SLoC

  • nom 3.2+verbose-errors