antlr-d 1.3.3

ANTLR4 runtime library


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Antlr4DTarget

The D runtime library for ANTLR 4, mainly a adaption of original Java runtime library.

This Software is under development but tested on different grammars of ANTLR version 4.7.1 yet.

Install

  1. Download or clone the package
  2. Change directory to the root of the package and call dub.
  3. You will find the generated ATLR D runtime library in lib/libantlr-d.a
  4. The ANTLR tool for D will generated by make build_examples in build/antlr4-4.7.1/tool/target/antlr4-4.7.1-complete.jar

Dependencies

D runtime
  • fluent-asserts v0.11.4
  • dshould v01.18
ANTLR tool
  • java 1.8
  • maven

Example

Put the

grammar Expr;		
prog:	(expr NEWLINE)* ;
expr:	expr ('*'|'/') expr
    |	expr ('+'|'-') expr
    |	INT
    |	'(' expr ')'
    ;
NEWLINE : [\r\n]+ ;
INT : [0-9]+ ;

in the file Expr.g4.

Now call

java -jar -Dlanguage=D build/antlr4-4.7.1/tool/target/antlr4-4.7.1-complete.jar Expr.g4

and the correspondig Lexer, Parser and Listener D-Source files are generated.

Restrictions

Authors:
  • Egbert Voigt <Egbert.Voigt@funkwerk-itk.com>
Dependencies:
none
Versions:
1.3.3 2018-Sep-14
1.3.2 2018-Aug-29
1.3.1 2018-Aug-18
1.3.0 2018-Aug-16
1.2.9 2018-Aug-14
Show all 15 versions
Download Stats:
  • 0 downloads today

  • 1 downloads this week

  • 2 downloads this month

  • 27 downloads total

Score:
1.9
Short URL:
antlr-d.dub.pm