Giter Site home page Giter Site logo

miden-parsing's Introduction

miden-parsing

This crate provides additional infrastructure on top of miden-diagnostics for parsing within a compiler frontend.

Features

The following are features provided by this crate:

  • An abstraction called Source that provides the core operations required by the scanner component of a parser, along with a "standard" implementation called FileMapSource which builds on the SourceFile type provided by miden-diagnostics
  • Scanner, a low-level component intended for consumption from a lexer. At a high level, the scanner operates on the input source to allow a lexer to precisely control what characters in the source are part of the current token, the ability to get a slice associated with the current token, as well as the ability to control advancement of the underlying source stream (i.e. get the current char, pop the current char, peek the next char, etc).
  • Parse<T> a trait which describes what is needed to parse a T, and exposes the API for doing so
  • Parser<C> represents a parser with a configuration type C that is capable of parsing any compatible Parse implementation. This parser is designed for use with components provided by miden-diagnostics, specifically CodeMap and DiagnosticsHandler. It abstracts away some of the boilerplate involved with common parsing tasks, e.g. parse_file and parse_string.

This crate is known to work well with LALRPOP, and only requires that a compiler frontend provide a lexer and token type specific to the language being parsed. See the examples folder for a complete end-to-end demonstration of how to use this crate (and miden-diagnostics) with LALRPOP for a simple language.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.