GithubHelp home page GithubHelp logo

smily1984 / bazel_rules Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jflex-de/bazel_rules

0.0 2.0 0.0 146 KB

Bazel rules to generate java files with JFlex

Home Page: https://jflex-de.github.io/bazel_rules/

License: Apache License 2.0

Python 42.42% CSS 0.81% Shell 5.55% Java 31.30% Lex 19.92%

bazel_rules's Introduction

Bazel rules for JFlex & Cup

This repository offers two rules for projects using the Bazel build system:

  • Rule to generate java source files from a lexer specification, with JFlex

  • Rule to generate java source files from a parser specification, with CUP

Project health

Status of the master branch: Build status

Disclaimer

This is not an officially supported Google product.

Prepare your Bazel workspace

Load the bazel_rules in your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
        name = "jflex_rules",
        remote = "https://github.com/jflex-de/bazel_rules.git",
        branch = "stable",
)

load("@jflex_rules//jflex:deps.bzl", "jflex_deps")

# If you want to use JFlex.
jflex_deps()

Usage in BUILD files

load("@jflex_rules//jflex:jflex.bzl", "jflex")
load("@jflex_rules//cup:cup.bzl", "cup")

jflex(
    name = "",           # Choose a rule name
    srcs = [],           # A list of flex specifications
    outputs = [],        # List of expected generated files
)

cup(
    name = "",           # Choose a rule name
    src = "",            # Grammar specification
)

As usual, these rules can be used as one of the srcs of another rules, such as a java_library.

For more details, see cup and jflex.

Directory layout

├── assets                 → assets for the web site
├── cup                    → contains the `cup.bzl` Skylark extension
├── java                   → main Java source code
│   └── jflex
│       └── examples       → examples
│           ├── calculator → integration of JFlex and CUP
│           └── helloworld → simple lexer
├── javatests              → tests of the examples
├── jflex                  → contains the `jflex.bzl` Skylark extension
└── third_party            → Aliases for third-party libraries

bazel_rules's People

Contributors

regisd avatar

Watchers

 avatar  avatar

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.