Git Product home page Git Product logo

rflex's Introduction

rflex

rflex is a fast lexical analyzer generator for Rust.

GitHub license Crates Status

cargo install rflex

or

Write your Cargo.toml and build.rs

[package]
# ...
build = "build.rs"

[build-dependencies]
# ...
failure = "0.1.5"
rflex = "0.8"
extern crate rflex;
use std::env;
use std::path::Path;

fn main() {
    let out_dir = env::var("OUT_DIR").unwrap();
    let dest = Path::new(&out_dir).join("target.rs");
    let path = Path::new("src").join("target.l");
    if let Err(e) = rflex::process(path, Some(dest)) {
        for cause in failure::Fail::iter_chain(&e) {
            eprintln!("{}: {}", cause.name().unwrap_or("Error"), cause);
        }
        std::process::exit(1);
    }
}

See tutorial.md.

Unsupported regular-expression

  • e{num} ... repeat e num times
  • e{min,max} ... repeat e min to max times
  • e/s ... lookahead s before accept e

License

  • rflex is released under MIT License.

Copyright

  • Copyright (c) 2018 Preferred Networks, Inc.
  • Partial original codes were written in Java under 3-clause BSD license:
    • Copyright (c) Gerwin Klein, Steve Rowe, Regis Decamp. All rights reserved.

Dependent libraries

These libraries are used only rflex lexer generator, generated code doesn't depend on them.

  • fixedbitset released under MIT License
    • Copyright (c) 2015-2017
  • liquid released under MIT License
    • Copyright (c) 2014 cobalt-org
  • failure released under MIT License

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.