{"id":28600760,"url":"https://github.com/jflex-de/bazel_rules","last_synced_at":"2025-06-11T14:38:55.010Z","repository":{"id":55117552,"uuid":"152211970","full_name":"jflex-de/bazel_rules","owner":"jflex-de","description":"Bazel rules to generate java files with JFlex","archived":false,"fork":false,"pushed_at":"2023-03-11T06:51:16.000Z","size":303,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-03-24T04:39:00.986Z","etag":null,"topics":["bazel-rules","cup","jflex","lexer-generator","parser-generator"],"latest_commit_sha":null,"homepage":"https://jflex-de.github.io/bazel_rules/","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jflex-de.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2018-10-09T08:03:12.000Z","updated_at":"2023-03-24T04:39:00.986Z","dependencies_parsed_at":"2022-08-14T12:31:03.605Z","dependency_job_id":null,"html_url":"https://github.com/jflex-de/bazel_rules","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflex-de%2Fbazel_rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflex-de%2Fbazel_rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflex-de%2Fbazel_rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflex-de%2Fbazel_rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jflex-de","download_url":"https://codeload.github.com/jflex-de/bazel_rules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jflex-de%2Fbazel_rules/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259280897,"owners_count":22833473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel-rules","cup","jflex","lexer-generator","parser-generator"],"created_at":"2025-06-11T14:38:53.451Z","updated_at":"2025-06-11T14:38:55.000Z","avatar_url":"https://github.com/jflex-de.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bazel rules for JFlex \u0026 Cup\n\nThis repository offers two rules for projects using the [Bazel build system][bazel]:\n\n- Rule to generate java source files from a lexer specification, with [JFlex][gh-jflex]\n\n- Rule to generate java source files from a parser specification, with [CUP][cup]\n\n## Project health\n\nStatus of the **master** branch:\n\u003ca href=\"https://cirrus-ci.com/github/jflex-de/bazel_rules\"\u003e\n\u003cimg src=\"https://api.cirrus-ci.com/github/jflex-de/bazel_rules.svg\" alt=\"Build status\" height=\"20\"\u003e\n\u003c/a\u003e\n\n\n## Disclaimer\n\nThis is not an officially supported Google product.\n\n## Prepare your Bazel workspace\n\n### Add a dependency on rules_jvm_external\n\nSee [bazelbuild/rules_jvm_external][bb_jvm_external].\n\n### Load the jflex rule\n\nLoad the **bazel_rules** in your [`WORKSPACE` file][be_workspace]\nand add `JFLEX_ARTIFACTS` in your `maven_install` rule:\n\n    load(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n    load(\"@rules_jvm_external//:defs.bzl\", \"maven_install\")\n\n    http_archive(\n        name = \"jflex_rules\",\n        sha256 = \"c4d68bde12f47af86b6f80a34dd55c67e82cf77b7ff2317cb472c07b1d09a6da\",\n        strip_prefix = \"bazel_rules-1.9.1\",\n        url = \"https://github.com/jflex-de/bazel_rules/archive/v1.9.1.tar.gz\",\n    )\n\n    load(\"@jflex_rules//jflex:deps.bzl\", \"JFLEX_ARTIFACTS\")\n\n    maven_install(\n        name = \"maven\",\n        artifacts = JFLEX_ARTIFACTS,\n        maven_install_json = \"//:maven_install.json\",\n        repositories = [\n            \"https://jcenter.bintray.com/\",\n            \"https://maven.google.com\",\n            \"https://repo1.maven.org/maven2\",\n        ],\n    )\n\nIf this is the first time you use `maven_install`, you need to generate the `maven_install.json` with\n\n    bazel run @maven//:pin\n\nIf you already used `maven_install` before, you need to update the pinned artifacts with:\n\n    bazel run @unpinned_maven//:pin\n\n## Usage in BUILD files\n\n    load(\"@jflex_rules//jflex:jflex.bzl\", \"jflex\")\n    load(\"@jflex_rules//cup:cup.bzl\", \"cup\")\n\n    jflex(\n        name = \"\",           # Choose a rule name\n        srcs = [],           # A list of flex specifications\n        outputs = [],        # List of expected generated files\n    )\n\n    cup(\n        name = \"\",           # Choose a rule name\n        src = \"\",            # Grammar specification\n    )\n\nAs usual, these rules can be used as one of the `srcs` of another rules, such as a `java_library`.\n\nFor more details, see [cup](cup) and [jflex](jflex).\n\n## Directory layout\n\n    ├── assets                 → assets for the web site\n    ├── cup                    → contains the `cup.bzl` Skylark extension\n    ├── java                   → main Java source code\n    │   └── jflex\n    │       └── examples       → examples\n    │           ├── calculator → integration of JFlex and CUP\n    │           └── helloworld → simple lexer\n    ├── javatests              → tests of the examples\n    ├── jflex                  → contains the `jflex.bzl` Skylark extension\n    └── third_party            → Aliases for third-party libraries\n\n\n[bazel]: http://bazel.build/\n[gh-jflex]: https://github.com/jflex-de/jflex\n[cup]: http://www2.cs.tum.edu/projects/cup/\n[be_workspace]: https://docs.bazel.build/versions/master/tutorial/java.html#set-up-the-workspace\n[bb_jvm_external]: https://github.com/bazelbuild/rules_jvm_external\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjflex-de%2Fbazel_rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjflex-de%2Fbazel_rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjflex-de%2Fbazel_rules/lists"}