1 {lib, stdenv, fetchpatch, fetchurl, fetchFromGitHub, jre}:
3 stdenv.mkDerivation rec {
7 url = "https://www.antlr3.org/download/antlr-${version}-complete.jar";
8 sha256 = "0srjwxipwsfzmpi0v32d1l5lzk9gi5in8ayg33sq8wyp8ygnbji6";
10 src = fetchFromGitHub {
13 rev = "5c2a916a10139cdb5c7c8851ee592ed9c3b3d4ff";
14 sha256 = "1i0w2v9prrmczlwkfijfp4zfqfgrss90a7yk2hg3y0gkg2s4abbk";
19 url = "https://src.fedoraproject.org/rpms/antlr3/raw/f1bb8d639678047935e1761c3bf3c1c7da8d0f1d/f/0006-antlr3memory.hpp-fix-for-C-20-mode.patch";
20 sha256 = "0apk904afjqbad6c7z9r72a9lkbz69vwrl8j2a6zgxjn8dfb2p8b";
25 mkdir -p "$out"/{lib/antlr,bin,include}
26 cp "$jar" "$out/lib/antlr/antlr-${version}-complete.jar"
27 cp runtime/Cpp/include/* $out/include/
29 echo "#! ${stdenv.shell}" >> "$out/bin/antlr"
30 echo "'${jre}/bin/java' -cp '$out/lib/antlr/antlr-${version}-complete.jar' -Xms200M -Xmx400M org.antlr.Tool \"\$@\"" >> "$out/bin/antlr"
32 chmod a+x "$out/bin/antlr"
33 ln -s "$out/bin/antlr"{,3}
39 description = "Powerful parser generator";
41 ANTLR (ANother Tool for Language Recognition) is a powerful parser
42 generator for reading, processing, executing, or translating structured
43 text or binary files. It's widely used to build languages, tools, and
44 frameworks. From a grammar, ANTLR generates a parser that can build and
47 homepage = "https://www.antlr.org/";
48 sourceProvenance = with sourceTypes; [ binaryBytecode ];
49 license = licenses.bsd3;
50 platforms = platforms.linux;
51 maintainers = [ lib.maintainers.farlion ];