lol

antlr4_7: init at 4.7

Includes a more recent version of antlr to nixpkgs. Previous
versions exist already, but version 4 brings many changes
to the generated code and runtime targets.

The install location has been changed from previous versions
of antlr to make use of the set-java-classpath hook, which
is required to make use of both the runtime and the binary.

Also includes the testing rig as a script to allow graphical
inspection of parse trees.

+44
+41
pkgs/development/tools/parsing/antlr/4.7.nix
··· 1 + {stdenv, fetchurl, jre}: 2 + 3 + stdenv.mkDerivation rec { 4 + name = "antlr-${version}"; 5 + version = "4.7"; 6 + src = fetchurl { 7 + url ="http://www.antlr.org/download/antlr-${version}-complete.jar"; 8 + sha256 = "0r08ay63s5aajix5j8j7lf7j7l7wiwdkr112b66nyhkj5f6c72yd"; 9 + }; 10 + 11 + unpackPhase = "true"; 12 + 13 + installPhase = '' 14 + mkdir -p "$out"/{share/java,bin} 15 + cp "$src" "$out/share/java/antlr-${version}-complete.jar" 16 + 17 + echo "#! ${stdenv.shell}" >> "$out/bin/antlr" 18 + echo "'${jre}/bin/java' -cp '$out/share/java/antlr-${version}-complete.jar:$CLASSPATH' -Xmx500M org.antlr.v4.Tool \"\$@\"" >> "$out/bin/antlr" 19 + 20 + echo "#! ${stdenv.shell}" >> "$out/bin/grun" 21 + echo "'${jre}/bin/java' -cp '$out/share/java/antlr-${version}-complete.jar:$CLASSPATH' org.antlr.v4.gui.TestRig \"\$@\"" >> "$out/bin/grun" 22 + 23 + chmod a+x "$out/bin/antlr" "$out/bin/grun" 24 + ln -s "$out/bin/antlr"{,4} 25 + ''; 26 + 27 + inherit jre; 28 + 29 + meta = with stdenv.lib; { 30 + description = "Powerful parser generator"; 31 + longDescription = '' 32 + ANTLR (ANother Tool for Language Recognition) is a powerful parser 33 + generator for reading, processing, executing, or translating structured 34 + text or binary files. It's widely used to build languages, tools, and 35 + frameworks. From a grammar, ANTLR generates a parser that can build and 36 + walk parse trees. 37 + ''; 38 + homepage = http://www.antlr.org/; 39 + platforms = platforms.linux; 40 + }; 41 + }
+3
pkgs/top-level/all-packages.nix
··· 6413 6413 antlr3_5 = callPackage ../development/tools/parsing/antlr/3.5.nix { }; 6414 6414 antlr3 = antlr3_5; 6415 6415 6416 + antlr4_7 = callPackage ../development/tools/parsing/antlr/4.7.nix { }; 6417 + antlr4 = antlr4_7; 6418 + 6416 6419 ant = apacheAnt; 6417 6420 6418 6421 apacheAnt = callPackage ../development/tools/build-managers/apache-ant { };