mill-antlr_2.13

Antlr support for mill builds.

License

License

MIT
Categories

Categories

Ant Build Tools Net ANTLR Compiler-compiler
GroupId

GroupId

net.mlbox
ArtifactId

ArtifactId

mill-antlr_2.13
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

mill-antlr_2.13
Antlr support for mill builds.
Project URL

Project URL

https://github.com/ml86/mill-antlr
Source Code Management

Source Code Management

https://github.com/ml86/mill-antlr

Download mill-antlr_2.13

How to add to project

<!-- https://jarcasting.com/artifacts/net.mlbox/mill-antlr_2.13/ -->
<dependency>
    <groupId>net.mlbox</groupId>
    <artifactId>mill-antlr_2.13</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.mlbox/mill-antlr_2.13/
implementation 'net.mlbox:mill-antlr_2.13:0.1.0'
// https://jarcasting.com/artifacts/net.mlbox/mill-antlr_2.13/
implementation ("net.mlbox:mill-antlr_2.13:0.1.0")
'net.mlbox:mill-antlr_2.13:jar:0.1.0'
<dependency org="net.mlbox" name="mill-antlr_2.13" rev="0.1.0">
  <artifact name="mill-antlr_2.13" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.mlbox', module='mill-antlr_2.13', version='0.1.0')
)
libraryDependencies += "net.mlbox" % "mill-antlr_2.13" % "0.1.0"
[net.mlbox/mill-antlr_2.13 "0.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.antlr : antlr4 jar 4.8-1

provided (2)

Group / Artifact Type Version
com.lihaoyi : mill-main_2.13 jar 0.7.0
com.lihaoyi : mill-scalalib_2.13 jar 0.7.0

Project Modules

There are no modules declared in this project.

mill-antlr

ANTLR support for mill builds.

Usage

Mandatory

Add dependency and import AntlrModule class in build.sc:

import $ivy.`net.mlbox::mill-antlr:0.1.0`
import net.mlbox.millantlr.AntlrModule

Mixin AntlrModule trait into your project object:

object foo extends ScalaModule with AntlrModule {...}

Specify ANTLR grammar files or directory:

... with AntlrModule {
  override def antlrGrammarSources = T.sources {
    Seq(os.pwd/"grammar1.g4", os.pwd/"grammar2.g4", os.pwd/"grammarDir").map(PathRef(_))
  }
}

Optional

Generate ANTLR visitor/listener interface:

... with AntlrModule {
  override def antlrGenerateVisitor: Boolean = true
  override def antlrGenerateListener: Boolean = true
}

Specify package name of genrate ANTLR parser classes:

... with AntlrModule {
  override def antlrPackage: Option[String] = Some("net.mlbox")
}

Versions

Version
0.1.0