summaryrefslogtreecommitdiff
path: root/dev-java/antlr
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-java/antlr
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-java/antlr')
-rw-r--r--dev-java/antlr/Manifest19
-rw-r--r--dev-java/antlr/antlr-2.7.7-r7.ebuild44
-rw-r--r--dev-java/antlr/antlr-2.7.7-r8.ebuild47
-rw-r--r--dev-java/antlr/antlr-3.2.ebuild95
-rw-r--r--dev-java/antlr/antlr-3.5.2.ebuild86
-rw-r--r--dev-java/antlr/antlr-4.5.1.ebuild90
-rw-r--r--dev-java/antlr/antlr-4.5.3.ebuild90
-rw-r--r--dev-java/antlr/files/3.2-java-8.patch32
-rw-r--r--dev-java/antlr/files/3.2-test-fixes.patch249
-rw-r--r--dev-java/antlr/files/3.5.2-test-fixes.patch36
-rw-r--r--dev-java/antlr/metadata.xml11
11 files changed, 799 insertions, 0 deletions
diff --git a/dev-java/antlr/Manifest b/dev-java/antlr/Manifest
new file mode 100644
index 000000000000..19ee2f8409c6
--- /dev/null
+++ b/dev-java/antlr/Manifest
@@ -0,0 +1,19 @@
+AUX 3.2-java-8.patch 1318 BLAKE2B f7cf19e6da346c50ed066782905fffeac9b9f42c9988bc3ba0d18bc434fecfaa6d4ad3e74d2c84c87854716435be4a596c47b919ce42b310e48dc70d184bc7f5 SHA512 70c9dc23ec64ba75bfcfc0597544b13c2c35c523c6f2c9d82dbc54a44c30a5432a56b6193db74ca9c3d92235bdadc5427857c364abc4df79ffdc1d2b55221d32
+AUX 3.2-test-fixes.patch 10278 BLAKE2B 868e9dc24f26b9933fe169f93b9156b3965473da7e636058ac630455b4f9347f465f86151681ee9734bcf1e435345abb033fbfb7cfbd845d6d41b423ae6478e0 SHA512 b593da8fb05d8ac51b0fd72172b740aeae060bd18c58413c67ff0c5242609b419d4a1b0a4f5ae66d5a3b2103007d4511ece41da6b09dab5f12ffd5f905d45d31
+AUX 3.5.2-test-fixes.patch 2093 BLAKE2B 4016d770a226f1fb86f7f6e630df38c0d2ed0b4a025991f6b88e88506d2a44838c17097fc4ad5f63e506a839ebce0fcfa8e57f22415f777b0bd4c37afc93a0b1 SHA512 dcdde9daabfb3379f85d831a594259b21e1cc0283f7f0972d42801cb144d6932fe5cccff576cc885614db3f9e07b98782c4932a03687658df35f698455588533
+DIST antlr-2.7.7.tar.gz 1816180 BLAKE2B 3a9a51070f8651befeb4d22be344b544e119db34a78522828c2ffc3c481c14b9c7784f0a9997a61f6faedde5b6d1fe12214cfd84fb274f7065f3ffe6a44abf1c SHA512 faa72d2ddcba434ef1233e70c1549e63eba67c00793966322e821cf7f015cccb804448cb92d8fbef0429f59928fad65ec954f8ffbda0acbb8e983de0806d349d
+DIST antlr-3.2.jar 1928009 BLAKE2B 9c56b0142abdb7d0caabebbae12618a665f91001e2f472519549a65b8601b81fcca485898c7420087a7b631351eb26e4b98589d7284960efcc3c65155919fd2a SHA512 25a61404c4b41e48eeaed49d41122f9400092248a10eb776d75ce3513295870eca1acc4b06c74925284a27cc64ca0506e34de39fb91996f09727cc5cc72dd9a6
+DIST antlr-3.2.tar.gz 837320 BLAKE2B 3addcfed45e67a7f8f3841a890be418626d93229dc326fe4670c6b145a457203a26f01723695573692c65bb6c376349a8d8cd852b339b1f6da7b71a52e14bb4f SHA512 8984221cd89253c033a4596dd56cd51b297393a53b4682f5ab401172745d343371bf0d45417fa286ce972add1b4e474f1f3091fa1345158dbfc040702d61607c
+DIST antlr-3.5.2-complete.jar 2456317 BLAKE2B d9afa08ad98dbff16d30425b97a0ddac7402055916e6a7dd290c3b9a2b26a4751c02f405d8d13c186333430c370c94bd73419b14c8e46df2971f68536cc484a0 SHA512 560f208e38759b5e626de56816e1fce9c191c526c04ca782513859d468ac444d1e8e62c03870a68f8f9d8daee0f45fca465150e2bbfc71b46e46b952519044b1
+DIST antlr-3.5.2.tar.gz 6927126 BLAKE2B 1907229549434dfea6ef1fa915137a2f733bd61f0a40aacb131689df619d1c92e125453ec3d1febc5d92da1841ffbde060af196cff1ca8fb6f4684600375e161 SHA512 e2a0520093fb2a77dcd9d44f26a9fdd612dceaffb398c53b2b8cd29f4630830647ede29e8dd55b434cb2c165b0fd1d77968ec6e6de0798f14d9cdfd9e6fccd99
+DIST antlr-4.5.1-complete.jar 1478820 BLAKE2B 7f6ab8d1bad6b75ede4930fe594a3302bd2bdeac8426d65d0a16610a8da4dd3bda23db68b7feafc90449bda5032115ad0f0dbe7c376c4095cb4ccac3e7a70e84 SHA512 1109087c44706694d75a7f88f6ce96e8653467d5721505db747e7e70a4f40a24469b1fb3ffcb327819bba1548b0025412e46a11a41e329b0ecf847cb1094238c
+DIST antlr-4.5.1.tar.gz 6158475 BLAKE2B 17cf84a60393c786d8b8addd93b87998178cea55f2a6bcc4ca244655a6d2aacc15226111b00fc0a8a6424f8a7c6eb3bfa49172e3b2149714a5c0c6ad69943cd9 SHA512 949306b0ee87a0c002664ee7ac0f32c43385c501b4e28f181417559ce09b07cc12a8441c3bb81f8a72feba3d4ccc693a3c03bcccad7fc81223cddb19e10468a9
+DIST antlr-4.5.3-complete.jar 1485121 BLAKE2B 84d41b17bd30dfad7a79e9759802c76d986299cc592c7b2c859225ed00989bb2709b14635ee40c8ecfe79e2441ecb697b2d17b7e6e789a7549868b93a3876f77 SHA512 53dcadf3007c9bdbeb391ea72fb9bab7c086fa0b9d1d93b83050b2ebb726c2f52743b5ba944c68f6da513d915ab5e8721676d74d823c32484928ccad2a28f1e4
+DIST antlr-4.5.3.tar.gz 6760401 BLAKE2B d436b4a964c527e230912a0ba23146af199478570cf5491eadeb5025e814642658cc71d71e6a09b5df3cc18e9b8991abf930cab70677d117a112e0922e046e07 SHA512 d0e61baebb338e5e4e8eaf87aa6ef52a568ec51bc86bc07acf8f82be0c173ea4f0f85978dfd034c2642505888c0849663f6b6fb030c4c19e0571f29277fb54f7
+EBUILD antlr-2.7.7-r7.ebuild 1088 BLAKE2B e142dbcdb4c0d46a6ffe42b9106156e1ded900014521ce184c0b1f124c4424c059034d60ee0ce1e115baa1bc820934ab98047878522294e355291c19310b71d4 SHA512 f4d31e2a60405ad2934321406f6ade73bdb903ee79304a3726351adbdb8f5f89a1b284fe27e796b3aabe8bfa0b71d0b4941fdc045492ea001d1f0005634dba4a
+EBUILD antlr-2.7.7-r8.ebuild 1099 BLAKE2B 33c966b64de3577aada4aa8e19b367104f89e236a42e78b8ea106682030a5989512e24ed0dbbf0b263716c9c7a081fc81ff1fa77b602d39fbac0abb1b0298d3c SHA512 a308fb2c7c359d206a25fc4215b37d72220f5e33425577d126379c960d1a009c7644dd18dd0e5b5b608abb55c7c34a3f25abcd826cc2c617e0a8d581c10eba02
+EBUILD antlr-3.2.ebuild 3242 BLAKE2B 19729b322437e4ef21672eaa432568b94a6f6bc0efde5ac856e148c55a3bcccf9fbb4631421c2f25a7d09f88758033d2f830d1565ff88051eb7016473b778fbd SHA512 38d68d796dc5ea1bf214779642e9ea40840295c6caf69017bfa92ca623289f9ac532e5262a64d48bd8ef1c709b45a1a9590da8e0636c37377649a6c335bddb5f
+EBUILD antlr-3.5.2.ebuild 2995 BLAKE2B b9825d24f8743279add37e97612644fdad2ff5731ad1806fe610b87e926461c1cf5913c64ff5be1321ca88c46a466a66f5d1bbbbeaaf87eefe4b9c52352bfa34 SHA512 abe140c64f10c39f82c5771acdb2a848ca0ecbfe718a0cb9514805c2109c2f4128b97ae8e5abb81f63417507dcbf5b23b42850d48f1eb826c7e0d390e64cc0e9
+EBUILD antlr-4.5.1.ebuild 2452 BLAKE2B eeb1ef4d8aac8a1317fb494c6943f496d39f706ad4f077afb58efc90f5b92ceb7cea296c0fbd4f1f31dc2c7787f9191eda7cb47584692e7984dc53b4e1b1e1e3 SHA512 ccb84e30811f01bb4d28d38117c75c79b8e0048a86d06194bdfe1aeb7de5b33b9d08e907a850a8a3714e637dcee4a7a396cd314ffc6c8472671e236220bbdee2
+EBUILD antlr-4.5.3.ebuild 2455 BLAKE2B 13f8824ca0268841a2ff9493633d3308853e020c5b263ece94598b1db48d1720139b95554eaf8456eb24730d1645dc19f656d2cc4afa52498900d3628c08e7a2 SHA512 03e9c3c64e3c04f14ef82b3fcd5d3018778f39e8c5386da05071634c14791d6335ed3212387cd0ecd7bf4774c5a3d2a49569e566dfb61ea6a66fa71ba4857841
+MISC metadata.xml 313 BLAKE2B 211bde607161c54e23a30950b17cda11291e84a9f745a2c44c17c7c224ad8ef309786ec4952f094e90cc569d86e0186bd2fa426fc1de6718541e207be12c3fd0 SHA512 01f11b9e45bc3c331d445213704287f1f034087930d4b55cbde700a483dcb64260d4805a4c2ec3686a99b59f3225999409d499cb63a40b3d8278d8a2e6213f57
diff --git a/dev-java/antlr/antlr-2.7.7-r7.ebuild b/dev-java/antlr/antlr-2.7.7-r7.ebuild
new file mode 100644
index 000000000000..09dc38c165a3
--- /dev/null
+++ b/dev-java/antlr/antlr-2.7.7-r7.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr2.org/"
+SRC_URI="http://www.antlr2.org/download/${P}.tar.gz"
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples source"
+
+RDEPEND=">=virtual/jre-1.6"
+DEPEND=">=virtual/jdk-1.6
+ source? ( app-arch/zip )"
+
+S="${WORKDIR}/${P}"
+JAVA_SRC_DIR="${S}/${PN}"
+
+java_prepare() {
+ java-pkg_clean
+
+ # Delete build files from examples.
+ find examples \( -name Makefile.in -o -name shiplist \) -delete || die
+}
+
+src_configure() {
+ : # Avoid configure script.
+}
+
+src_install() {
+ java-pkg-simple_src_install
+ java-pkg_dolauncher antlr --main antlr.Tool
+ dodoc {CHANGES,README}.txt
+
+ use doc && java-pkg_dohtml -r doc/*
+ use examples && java-pkg_doexamples examples/java
+ use source && java-pkg_dosrc antlr
+}
diff --git a/dev-java/antlr/antlr-2.7.7-r8.ebuild b/dev-java/antlr/antlr-2.7.7-r8.ebuild
new file mode 100644
index 000000000000..10056965f258
--- /dev/null
+++ b/dev-java/antlr/antlr-2.7.7-r8.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr2.org/"
+SRC_URI="http://www.antlr2.org/download/${P}.tar.gz"
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples"
+
+RDEPEND=">=virtual/jre-1.6"
+DEPEND=">=virtual/jdk-1.6"
+
+S="${WORKDIR}/${P}"
+
+JAVA_SRC_DIR="${S}/${PN}"
+
+DOCS=( CHANGES.txt README.txt )
+
+src_prepare() {
+ default
+ java-pkg_clean
+
+ # Delete build files from examples.
+ find examples \( -name Makefile.in -o -name shiplist \) -delete || die
+}
+
+# Avoid configure script.
+src_configure() { :; }
+
+src_install() {
+ java-pkg-simple_src_install
+ java-pkg_dolauncher antlr --main antlr.Tool
+
+ use doc && java-pkg_dohtml -r doc/*
+ use examples && java-pkg_doexamples examples/java
+ use source && java-pkg_dosrc antlr
+
+ einstalldocs
+}
diff --git a/dev-java/antlr/antlr-3.2.ebuild b/dev-java/antlr/antlr-3.2.ebuild
new file mode 100644
index 000000000000..d8976fb16787
--- /dev/null
+++ b/dev-java/antlr/antlr-3.2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr3.org/"
+SRC_URI="http://www.antlr3.org/download/${P}.tar.gz
+ http://www.antlr3.org/download/${P}.jar" # Prebuilt version needed.
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="amd64 ~arm ~arm64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+CDEPEND=">=dev-java/antlr-2.7.7-r7:0
+ dev-java/stringtemplate:0"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.6"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.6
+ test? ( dev-java/junit:4 )"
+
+S="${WORKDIR}/${P}"
+JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${PN}-runtime.jar"
+JAVA_GENTOO_CLASSPATH="antlr,stringtemplate"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+}
+
+java_prepare() {
+ java-pkg_clean
+
+ # These fixes have been applied in 3.5.
+ epatch "${FILESDIR}/${PV}-test-fixes.patch"
+ epatch "${FILESDIR}/${PV}-java-8.patch"
+
+ # Some tests fail under Java 8 in ways that probably aren't limited
+ # to the tests. This is bad but upstream is never going to update
+ # 3.2 even though other projects still rely on it. If any issues
+ # arise, we can only put pressure on those projects to upgrade.
+ if java-pkg_is-vm-version-ge 1.8; then
+ rm -v tool/src/test/java/org/antlr/test/Test{DFAConversion,SemanticPredicates,TopologicalSort}.java || die
+ fi
+
+ # 3.2 has strange hidden files.
+ find -type f -name "._*.*" -delete || die
+}
+
+src_compile() {
+ cd "${S}/runtime/Java/src/main" || die
+ JAVA_JAR_FILENAME="${S}/${PN}-runtime.jar" JAVA_PKG_IUSE="doc" java-pkg-simple_src_compile
+
+ cd "${S}/tool/src/main" || die
+
+ local G; for G in antlr codegen antlr.print assign.types buildnfa define; do # from pom.xml
+ antlr -o antlr2/org/antlr/grammar/v2/{,${G}.g} || die
+ done
+
+ # We have applied a patch to fix this version under Java 8. Trouble
+ # is that we need to run a prebuilt version before we can build our
+ # own and that version doesn't have the fix applied. We work around
+ # this by building just the offending class against the prebuilt
+ # version and then putting them together in the classpath. That
+ # isn't all. Due to a compiler limitation that Chewi doesn't fully
+ # understand, this class cannot be compiled by itself without a
+ # couple of tweaks that have been applied in the Java 8 patch.
+ ejavac -classpath "${DISTDIR}/${P}.jar" java/org/antlr/tool/CompositeGrammar.java
+
+ java -classpath "java:${DISTDIR}/${P}.jar" org.antlr.Tool $(find antlr3 -name "*.g") || die
+ JAVA_JAR_FILENAME="${S}/${PN}-tool.jar" java-pkg-simple_src_compile
+ java-pkg_addres "${S}/${PN}-tool.jar" resources
+}
+
+src_install() {
+ java-pkg_dojar ${PN}-{runtime,tool}.jar
+ java-pkg_dolauncher ${PN}${SLOT} --main org.antlr.Tool
+ use doc && java-pkg_dojavadoc runtime/Java/src/main/target/api
+}
+
+src_test() {
+ cd tool/src/test/java || die
+ local CP=".:${S}/${PN}-runtime.jar:${S}/${PN}-tool.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
+
+ local TESTS=$(find * -name "Test*.java")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find -name "*.java")
+ ejunit4 -classpath "${CP}" ${TESTS}
+}
diff --git a/dev-java/antlr/antlr-3.5.2.ebuild b/dev-java/antlr/antlr-3.5.2.ebuild
new file mode 100644
index 000000000000..46c6402f4b20
--- /dev/null
+++ b/dev-java/antlr/antlr-3.5.2.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr3.org/"
+SRC_URI="https://github.com/${PN}/${PN}3/archive/${PV}.tar.gz -> ${P}.tar.gz
+ http://www.antlr3.org/download/${P}-complete.jar" # Prebuilt version needed.
+LICENSE="BSD"
+SLOT="3.5"
+KEYWORDS="amd64 ~arm ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+CDEPEND="dev-java/stringtemplate:4"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.6"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.6
+ test? ( dev-java/junit:4 )"
+
+S="${WORKDIR}/${PN}3-${PV}"
+JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${PN}-runtime.jar"
+JAVA_GENTOO_CLASSPATH="stringtemplate-4"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+}
+
+java_prepare() {
+ java-pkg_clean
+
+ # This requires StringTemplate v3 and is only needed for
+ # output=template. Nothing in the tree currently needs that and the
+ # dependency situation is already hairy enough as it is.
+ rm -v runtime/Java/src/main/java/org/antlr/runtime/tree/DOTTreeGenerator.java || die
+
+ # Some tests have to be removed as a result.
+ rm -v tool/src/test/java/org/antlr/test/Test{RewriteTemplates,Templates}.java || die
+ epatch "${FILESDIR}/${PV}-test-fixes.patch"
+
+ # Some tests fail under Java 8 in ways that probably aren't limited
+ # to the tests. This is bad but upstream is never going to update
+ # 3.5. At the time of writing, we only use it to build 4 anyway.
+ if java-pkg_is-vm-version-ge 1.8; then
+ rm -v tool/src/test/java/org/antlr/test/Test{DFAConversion,SemanticPredicates,TopologicalSort}.java || die
+ fi
+}
+
+src_compile() {
+ cd "${S}/runtime/Java/src/main" || die
+ JAVA_JAR_FILENAME="${S}/${PN}-runtime.jar" JAVA_PKG_IUSE="doc" java-pkg-simple_src_compile
+
+ cd "${S}/tool/src/main" || die
+ java -jar "${DISTDIR}/${P}-complete.jar" $(find antlr3 -name "*.g") || die
+ JAVA_JAR_FILENAME="${S}/${PN}-tool.jar" java-pkg-simple_src_compile
+ java-pkg_addres "${S}/${PN}-tool.jar" resources
+}
+
+src_install() {
+ java-pkg_dojar ${PN}-{runtime,tool}.jar
+ java-pkg_dolauncher ${PN}${SLOT} --main org.antlr.Tool
+ use doc && java-pkg_dojavadoc runtime/Java/src/main/target/api
+}
+
+src_test() {
+ cd tool/src/test/java || die
+ local CP=".:${S}/${PN}-runtime.jar:${S}/${PN}-tool.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
+
+ local TESTS=$(find * -name "Test*.java")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find -name "*.java")
+
+ # ejunit automatically adds all registered subdependencies to the
+ # classpath, which is annoying in this case because of the cyclic
+ # dependency on stringtemplate. It will blow up when trying to find
+ # antlr-3.5 on the system before it is installed. The easiest but
+ # somewhat ugly way to avoid this is to unset JAVA_PKG_DEPEND_FILE.
+ JAVA_PKG_DEPEND_FILE= ejunit4 -classpath "${CP}" ${TESTS}
+}
diff --git a/dev-java/antlr/antlr-4.5.1.ebuild b/dev-java/antlr/antlr-4.5.1.ebuild
new file mode 100644
index 000000000000..a7c4c1ffbb73
--- /dev/null
+++ b/dev-java/antlr/antlr-4.5.1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="source"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr.org/"
+SRC_URI="https://github.com/${PN}/${PN}4/archive/${PV}.tar.gz -> ${P}.tar.gz
+ http://www.antlr.org/download/${P}-complete.jar" # Prebuilt version needed.
+LICENSE="BSD"
+SLOT="4"
+KEYWORDS="amd64 ~arm ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+CDEPEND="dev-java/antlr:3.5
+ dev-java/stringtemplate:4
+ dev-java/treelayout:0"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.6"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.6
+ test? (
+ dev-java/hamcrest-core:1.3
+ dev-java/junit:4
+ )"
+
+S="${WORKDIR}/${PN}4-${PV}"
+JAVA_GENTOO_CLASSPATH="stringtemplate-4,treelayout"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+}
+
+java_prepare() {
+ java-pkg_clean
+}
+
+src_configure() {
+ # TODO: Make java-config accept a jar@package query.
+ JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${PN}-runtime.jar:$(java-pkg_getjar antlr-3.5 antlr-runtime.jar)"
+}
+
+src_compile() {
+ cd "${S}/runtime/Java/src"
+ local G PKG
+
+ for G in $(find * -name "*.g4"); do
+ PKG="${G%/*}"
+ PKG="${PKG//\//.}"
+ java -jar "${DISTDIR}/${P}-complete.jar" -package "${PKG}" "${G}" || die
+ done
+
+ JAVA_JAR_FILENAME="${S}/${PN}-runtime.jar" JAVA_PKG_IUSE="doc" java-pkg-simple_src_compile
+
+ cd "${S}/tool/src"
+ antlr3.5 $(find -name "*.g") || die
+ JAVA_JAR_FILENAME="${S}/${PN}-tool.jar" java-pkg-simple_src_compile
+ java-pkg_addres "${S}/${PN}-tool.jar" ../resources
+}
+
+src_install() {
+ java-pkg_dojar ${PN}-{runtime,tool}.jar
+ java-pkg_dolauncher ${PN}${SLOT} --main org.antlr.v4.Tool
+ use doc && java-pkg_dojavadoc runtime/Java/src/target/api
+ use source && java-pkg_dosrc runtime/Java/src/org tool/src/org
+}
+
+junit_suite() {
+ cd "${S}/$1-testsuite/test" || die
+ local CP=".:${S}/runtime-testsuite/test:${S}/${PN}-tool.jar:$(java-pkg_getjars hamcrest-core-1.3,junit-4,${JAVA_GENTOO_CLASSPATH}):${JAVA_GENTOO_CLASSPATH_EXTRA}"
+
+ local TESTS=$(find ${2:-*} -name "Test*.java")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find ${2:-*} -name "*.java")
+ ejunit4 -classpath "${CP}" ${TESTS}
+}
+
+src_test() {
+ # Only run Java runtime tests as we haven't built other languages.
+ junit_suite runtime org/antlr/v4/test/runtime/java
+ junit_suite tool
+}
diff --git a/dev-java/antlr/antlr-4.5.3.ebuild b/dev-java/antlr/antlr-4.5.3.ebuild
new file mode 100644
index 000000000000..3b48b132714c
--- /dev/null
+++ b/dev-java/antlr/antlr-4.5.3.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="source"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr.org/"
+SRC_URI="https://github.com/${PN}/${PN}4/archive/${PV}.tar.gz -> ${P}.tar.gz
+ http://www.antlr.org/download/${P}-complete.jar" # Prebuilt version needed.
+LICENSE="BSD"
+SLOT="4"
+KEYWORDS="~amd64 ~arm ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+CDEPEND="dev-java/antlr:3.5
+ dev-java/stringtemplate:4
+ dev-java/treelayout:0"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.6"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.6
+ test? (
+ dev-java/hamcrest-core:1.3
+ dev-java/junit:4
+ )"
+
+S="${WORKDIR}/${PN}4-${PV}"
+JAVA_GENTOO_CLASSPATH="stringtemplate-4,treelayout"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+}
+
+java_prepare() {
+ java-pkg_clean
+}
+
+src_configure() {
+ # TODO: Make java-config accept a jar@package query.
+ JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${PN}-runtime.jar:$(java-pkg_getjar antlr-3.5 antlr-runtime.jar)"
+}
+
+src_compile() {
+ cd "${S}/runtime/Java/src"
+ local G PKG
+
+ for G in $(find * -name "*.g4"); do
+ PKG="${G%/*}"
+ PKG="${PKG//\//.}"
+ java -jar "${DISTDIR}/${P}-complete.jar" -package "${PKG}" "${G}" || die
+ done
+
+ JAVA_JAR_FILENAME="${S}/${PN}-runtime.jar" JAVA_PKG_IUSE="doc" java-pkg-simple_src_compile
+
+ cd "${S}/tool/src"
+ antlr3.5 $(find -name "*.g") || die
+ JAVA_JAR_FILENAME="${S}/${PN}-tool.jar" java-pkg-simple_src_compile
+ java-pkg_addres "${S}/${PN}-tool.jar" ../resources
+}
+
+src_install() {
+ java-pkg_dojar ${PN}-{runtime,tool}.jar
+ java-pkg_dolauncher ${PN}${SLOT} --main org.antlr.v4.Tool
+ use doc && java-pkg_dojavadoc runtime/Java/src/target/api
+ use source && java-pkg_dosrc runtime/Java/src/org tool/src/org
+}
+
+junit_suite() {
+ cd "${S}/$1-testsuite/test" || die
+ local CP=".:${S}/runtime-testsuite/test:${S}/${PN}-tool.jar:$(java-pkg_getjars hamcrest-core-1.3,junit-4,${JAVA_GENTOO_CLASSPATH}):${JAVA_GENTOO_CLASSPATH_EXTRA}"
+
+ local TESTS=$(find ${2:-*} -name "Test*.java")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find ${2:-*} -name "*.java")
+ ejunit4 -classpath "${CP}" ${TESTS}
+}
+
+src_test() {
+ # Only run Java runtime tests as we haven't built other languages.
+ junit_suite runtime org/antlr/v4/test/runtime/java
+ junit_suite tool
+}
diff --git a/dev-java/antlr/files/3.2-java-8.patch b/dev-java/antlr/files/3.2-java-8.patch
new file mode 100644
index 000000000000..662abfe1e17f
--- /dev/null
+++ b/dev-java/antlr/files/3.2-java-8.patch
@@ -0,0 +1,32 @@
+diff -Naur antlr-3.3.orig/tool/src/main/java/org/antlr/tool/CompositeGrammar.java antlr-3.3/tool/src/main/java/org/antlr/tool/CompositeGrammar.java
+--- antlr-3.3.orig/tool/src/main/java/org/antlr/tool/CompositeGrammar.java 2010-11-30 01:54:04.000000000 +0000
++++ antlr-3.3/tool/src/main/java/org/antlr/tool/CompositeGrammar.java 2015-10-03 14:28:50.063497181 +0100
+@@ -219,7 +219,9 @@
+ public List<Grammar> getIndirectDelegates(Grammar g) {
+ List<Grammar> direct = getDirectDelegates(g);
+ List<Grammar> delegates = getDelegates(g);
+- delegates.removeAll(direct);
++ if (direct != null) {
++ delegates.removeAll(direct);
++ }
+ return delegates;
+ }
+
+@@ -389,7 +391,7 @@
+ Set<String> localRuleDefs = new HashSet<String>();
+ Set<String> overrides = new HashSet<String>();
+ // compute set of non-overridden rules for this delegate
+- for (Rule r : p.grammar.getRules()) {
++ for (Rule r : (Collection<Rule>) p.grammar.getRules()) {
+ if ( !ruleDefs.contains(r.name) ) {
+ localRuleDefs.add(r.name);
+ }
+@@ -409,7 +411,7 @@
+
+ // pass larger set of defined rules to delegates
+ if ( p.children!=null ) {
+- for (CompositeGrammarTree delegate : p.children) {
++ for (CompositeGrammarTree delegate : (List<CompositeGrammarTree>) p.children) {
+ _minimizeRuleSet(ruleDefs, delegate);
+ }
+ }
diff --git a/dev-java/antlr/files/3.2-test-fixes.patch b/dev-java/antlr/files/3.2-test-fixes.patch
new file mode 100644
index 000000000000..0544b7006170
--- /dev/null
+++ b/dev-java/antlr/files/3.2-test-fixes.patch
@@ -0,0 +1,249 @@
+--- tool/src/test/java/org/antlr/test/BaseTest.java.orig 2010-11-30 01:54:04.000000000 +0000
++++ tool/src/test/java/org/antlr/test/BaseTest.java 2015-09-24 22:25:36.872191194 +0100
+@@ -130,8 +130,8 @@
+ try {
+ Process process =
+ Runtime.getRuntime().exec(args, null, outputDir);
+- StreamVacuum stdout = new StreamVacuum(process.getInputStream());
+- StreamVacuum stderr = new StreamVacuum(process.getErrorStream());
++ StreamVacuum stdout = new StreamVacuum(process.getInputStream(), tmpdir+"/"+fileName);
++ StreamVacuum stderr = new StreamVacuum(process.getErrorStream(), tmpdir+"/"+fileName);
+ stdout.start();
+ stderr.start();
+ process.waitFor();
+@@ -406,8 +406,8 @@
+ //System.out.println("execParser: "+cmdLine);
+ Process process =
+ Runtime.getRuntime().exec(args, null, new File(tmpdir));
+- StreamVacuum stdoutVacuum = new StreamVacuum(process.getInputStream());
+- StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream());
++ StreamVacuum stdoutVacuum = new StreamVacuum(process.getInputStream(), tmpdir+"/input");
++ StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream(), tmpdir+"/input");
+ stdoutVacuum.start();
+ stderrVacuum.start();
+ process.waitFor();
+@@ -499,8 +499,10 @@
+ StringBuffer buf = new StringBuffer();
+ BufferedReader in;
+ Thread sucker;
+- public StreamVacuum(InputStream in) {
++ String inputFile;
++ public StreamVacuum(InputStream in, String inputFile) {
+ this.in = new BufferedReader( new InputStreamReader(in) );
++ this.inputFile = inputFile;
+ }
+ public void start() {
+ sucker = new Thread(this);
+@@ -510,6 +512,8 @@
+ try {
+ String line = in.readLine();
+ while (line!=null) {
++ if (line.startsWith(inputFile))
++ line = line.substring(inputFile.length()+1);
+ buf.append(line);
+ buf.append('\n');
+ line = in.readLine();
+--- tool/src/test/java/org/antlr/test/TestTopologicalSort.java.orig 2009-09-23 19:36:14.000000000 +0100
++++ tool/src/test/java/org/antlr/test/TestTopologicalSort.java 2010-11-30 01:54:04.000000000 +0000
+@@ -49,7 +49,7 @@
+ g.addEdge("F", "H");
+ g.addEdge("E", "F");
+
+- String expecting = "[H, F, E, D, A, G, B, C]";
++ String expecting = "[H, F, E, D, G, A, B, C]";
+ List nodes = g.sort();
+ String result = nodes.toString();
+ assertEquals(expecting, result);
+@@ -91,7 +91,7 @@
+ g.addEdge("Def.g", "Java.tokens"); // walkers feed off generated tokens
+ g.addEdge("Ref.g", "Java.tokens");
+
+- String expecting = "[MyJava.tokens, Java.g, Java.tokens, Def.g, Ref.g]";
++ String expecting = "[MyJava.tokens, Java.g, Java.tokens, Ref.g, Def.g]";
+ List nodes = g.sort();
+ String result = nodes.toString();
+ assertEquals(expecting, result);
+@@ -105,7 +105,7 @@
+ g.addEdge("Def.g", "JavaLexer.tokens");
+ g.addEdge("Ref.g", "JavaLexer.tokens");
+
+- String expecting = "[JavaLexer.g, JavaLexer.tokens, JavaParser.g, Def.g, Ref.g]";
++ String expecting = "[JavaLexer.g, JavaLexer.tokens, JavaParser.g, Ref.g, Def.g]";
+ List nodes = g.sort();
+ String result = nodes.toString();
+ assertEquals(expecting, result);
+--- tool/src/test/java/org/antlr/test/TestSemanticPredicates.java.orig 2009-09-23 19:36:12.000000000 +0100
++++ tool/src/test/java/org/antlr/test/TestSemanticPredicates.java 2015-12-05 13:52:05.923411552 +0000
+@@ -731,19 +731,23 @@
+ "c : a\n" +
+ " | b\n" +
+ " ;\n");
+- String expecting =
+- ".s0-X->.s1\n" +
+- ".s1-{((a&&c)||(b&&c))}?->:s2=>1\n" +
+- ".s1-{c}?->:s3=>2\n";
+- int[] unreachableAlts = null;
+- int[] nonDetAlts = null;
+- String ambigInput = null;
+- int[] insufficientPredAlts = null;
+- int[] danglingAlts = null;
+- int numWarnings = 0;
+- checkDecision(g, 3, expecting, unreachableAlts,
+- nonDetAlts, ambigInput, insufficientPredAlts,
+- danglingAlts, numWarnings, false);
++ try {
++ String expecting =
++ ".s0-X->.s1\n" +
++ ".s1-{((a&&c)||(b&&c))}?->:s2=>1\n" +
++ ".s1-{c}?->:s3=>2\n";
++ checkDecision(g, 3, expecting, null,
++ null, null, null,
++ null, 0, false);
++ } catch (org.junit.ComparisonFailure e) {
++ String expecting =
++ ".s0-X->.s1\n" +
++ ".s1-{((b&&c)||(a&&c))}?->:s2=>1\n" +
++ ".s1-{c}?->:s3=>2\n";
++ checkDecision(g, 3, expecting, null,
++ null, null, null,
++ null, 0, false);
++ }
+ }
+
+ @Test
+--- tool/src/test/java/org/antlr/test/TestAttributes.java.orig 2015-12-05 13:55:55.392843185 +0000
++++ tool/src/test/java/org/antlr/test/TestAttributes.java 2015-12-05 14:04:38.120599871 +0000
+@@ -439,20 +439,15 @@
+ ErrorManager.setErrorListener(equeue);
+ Grammar g = new Grammar(
+ "parser grammar t;\n"+
+- "a : x=b {"+action+"} ;\n" +
++ "a : x=b {###"+action+"!!!} ;\n" +
+ "b : B ;\n");
+ Tool antlr = newTool();
+ CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
+ g.setCodeGenerator(generator);
+- generator.genRecognizer(); // forces load of templates
+- ActionTranslator translator = new ActionTranslator(generator,"a",
+- new antlr.CommonToken(ANTLRParser.ACTION,action),1);
+- String rawTranslation =
+- translator.translate();
+- StringTemplateGroup templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- StringTemplate actionST = new StringTemplate(templates, rawTranslation);
+- String found = actionST.toString();
++ generator.genRecognizer(); // codegen phase sets some vars we need
++ StringTemplate codeST = generator.getRecognizerST();
++ String code = codeST.toString();
++ String found = code.substring(code.indexOf("###")+3,code.indexOf("!!!"));
+ assertEquals(expecting, found);
+
+ assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
+@@ -1771,20 +1766,15 @@
+ Grammar g = new Grammar(
+ "parser grammar t;\n" +
+ "options {output=template;}\n"+
+- "a : {"+action+"}\n" +
++ "a : {###"+action+"!!!}\n" +
+ " ;\n");
+ Tool antlr = newTool();
+ CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
+ g.setCodeGenerator(generator);
+- generator.genRecognizer(); // forces load of templates
+- ActionTranslator translator = new ActionTranslator(generator,"a",
+- new antlr.CommonToken(ANTLRParser.ACTION,action),1);
+- String rawTranslation =
+- translator.translate();
+- StringTemplateGroup templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- StringTemplate actionST = new StringTemplate(templates, rawTranslation);
+- String found = actionST.toString();
++ generator.genRecognizer(); // codegen phase sets some vars we need
++ StringTemplate codeST = generator.getRecognizerST();
++ String code = codeST.toString();
++ String found = code.substring(code.indexOf("###")+3,code.indexOf("!!!"));
+ assertEquals(expecting, found);
+
+ assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
+@@ -1869,35 +1859,21 @@
+ ErrorManager.setErrorListener(equeue);
+ Grammar g = new Grammar(
+ "grammar t;\n"+
+- "a : b {"+action+"}\n" +
+- " | c {"+action2+"}\n" +
++ "a : b {###"+action+"!!!}\n" +
++ " | c {^^^"+action2+"&&&}\n" +
+ " ;\n" +
+ "b : 'a';\n" +
+ "c : '0';\n");
+ Tool antlr = newTool();
+ CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
+ g.setCodeGenerator(generator);
+- generator.genRecognizer(); // forces load of templates
+- ActionTranslator translator = new ActionTranslator(generator,"a",
+- new antlr.CommonToken(ANTLRParser.ACTION,action),1);
+- String rawTranslation =
+- translator.translate();
+- StringTemplateGroup templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- StringTemplate actionST = new StringTemplate(templates, rawTranslation);
+- String found = actionST.toString();
++ generator.genRecognizer(); // codegen phase sets some vars we need
++ StringTemplate codeST = generator.getRecognizerST();
++ String code = codeST.toString();
++ String found = code.substring(code.indexOf("###")+3,code.indexOf("!!!"));
+ assertEquals(expecting, found);
+
+- assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
+- translator = new ActionTranslator(generator,
+- "a",
+- new antlr.CommonToken(ANTLRParser.ACTION,action2),2);
+- rawTranslation =
+- translator.translate();
+- templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- actionST = new StringTemplate(templates, rawTranslation);
+- found = actionST.toString();
++ found = code.substring(code.indexOf("^^^")+3,code.indexOf("&&&"));
+
+ assertEquals(expecting2, found);
+
+@@ -3208,7 +3184,7 @@
+
+ @Test public void testAssignToTreeNodeAttribute() throws Exception {
+ String action = "$tree.scope = localScope;";
+- String expecting = "(()retval.tree).scope = localScope;";
++ String expecting = "((Object)retval.tree).scope = localScope;";
+ ErrorQueue equeue = new ErrorQueue();
+ ErrorManager.setErrorListener(equeue);
+ Grammar g = new Grammar(
+@@ -3219,24 +3195,17 @@
+ " Scope localScope=null;\n" +
+ "}\n" +
+ "@after {\n" +
+- " $tree.scope = localScope;\n" +
++ " ###$tree.scope = localScope;!!!\n" +
+ "}\n" +
+ " : 'a' -> ^('a')\n" +
+ ";");
+ Tool antlr = newTool();
+ CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
+ g.setCodeGenerator(generator);
+- generator.genRecognizer(); // forces load of templates
+- ActionTranslator translator = new ActionTranslator(generator,
+- "rule",
+- new antlr.CommonToken(ANTLRParser.ACTION,action),1);
+- String rawTranslation =
+- translator.translate();
+- StringTemplateGroup templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- StringTemplate actionST = new StringTemplate(templates, rawTranslation);
+- String found = actionST.toString();
+- assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
++ generator.genRecognizer(); // codegen phase sets some vars we need
++ StringTemplate codeST = generator.getRecognizerST();
++ String code = codeST.toString();
++ String found = code.substring(code.indexOf("###")+3,code.indexOf("!!!"));
+ assertEquals(expecting, found);
+ }
+
diff --git a/dev-java/antlr/files/3.5.2-test-fixes.patch b/dev-java/antlr/files/3.5.2-test-fixes.patch
new file mode 100644
index 000000000000..f2609ac1f0b5
--- /dev/null
+++ b/dev-java/antlr/files/3.5.2-test-fixes.patch
@@ -0,0 +1,36 @@
+diff -Naur antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestAttributes.java antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestAttributes.java
+--- antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestAttributes.java 2014-03-25 11:47:54.000000000 +0000
++++ antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestAttributes.java 2015-10-02 22:42:56.921263410 +0100
+@@ -2131,7 +2132,7 @@
+ assertEquals(expecting, found);
+ }
+
+- @Test public void testRuleLabelOnTwoDifferentRulesTemplate() throws Exception {
++ @org.junit.Ignore @Test public void testRuleLabelOnTwoDifferentRulesTemplate() throws Exception {
+ String grammar =
+ "grammar T;\n"+
+ "options {output=template;}\n"+
+diff -Naur antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java
+--- antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java 2014-03-25 11:47:54.000000000 +0000
++++ antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java 2015-10-02 22:43:07.303105023 +0100
+@@ -339,7 +340,7 @@
+ assertEquals("b:alt 2 a:alt 1\n", found);
+ }
+
+- @Test public void testSynPredWithOutputTemplate() throws Exception {
++ @org.junit.Ignore @Test public void testSynPredWithOutputTemplate() throws Exception {
+ // really just seeing if it will compile
+ String grammar =
+ "grammar T;\n" +
+diff -Naur antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestTreeParsing.java antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestTreeParsing.java
+--- antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestTreeParsing.java 2014-03-25 11:47:54.000000000 +0000
++++ antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestTreeParsing.java 2015-10-02 22:41:32.235554776 +0100
+@@ -141,7 +142,7 @@
+ assertEquals("alt 1\n", found);
+ }
+
+- @Test public void testTemplateOutput() throws Exception {
++ @org.junit.Ignore @Test public void testTemplateOutput() throws Exception {
+ String grammar =
+ "grammar T;\n" +
+ "options {output=AST;}\n" +
diff --git a/dev-java/antlr/metadata.xml b/dev-java/antlr/metadata.xml
new file mode 100644
index 000000000000..f70ce39614d6
--- /dev/null
+++ b/dev-java/antlr/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">antlr/antlr4</remote-id>
+ </upstream>
+</pkgmetadata>