summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/java-antlr4-Add-standalone-generator.patch
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2020-09-20 03:06:48 +0200
committerJulien Lepiller <julien@lepiller.eu>2020-09-20 13:56:44 +0200
commit5d115440c20817a63d4ee12d627ff24c0717b6e1 (patch)
tree6bf011cb543f0f9c175ea9023447ed0e60985058 /gnu/packages/patches/java-antlr4-Add-standalone-generator.patch
parent1d630fe0f64d16d7428a78ee4bf94e8179ce4a94 (diff)
gnu: Add java-antlr4-runtime.
* gnu/packages/java.scm (java-antlr4-runtime): New variable. * gnu/packages/patches/java-antlr4-Add-standalone-generator.patch: New file. * gnu/packages/patches/java-antlr4-fix-code-too-large.java: New file. * gnu/local.mk (dist_patch_DATA): Add them.
Diffstat (limited to 'gnu/packages/patches/java-antlr4-Add-standalone-generator.patch')
-rw-r--r--gnu/packages/patches/java-antlr4-Add-standalone-generator.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/gnu/packages/patches/java-antlr4-Add-standalone-generator.patch b/gnu/packages/patches/java-antlr4-Add-standalone-generator.patch
new file mode 100644
index 0000000000..75b6dce39f
--- /dev/null
+++ b/gnu/packages/patches/java-antlr4-Add-standalone-generator.patch
@@ -0,0 +1,52 @@
+From 3b43b79da15be994348f13035474925ba592fe1f Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Fri, 15 Sep 2017 10:06:42 +0200
+Subject: [PATCH] Add standalone template generator
+
+---
+ tool/src/org/antlr/v4/unicode/UnicodeRenderer.java | 33 ++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+ create mode 100644 tool/src/org/antlr/v4/unicode/UnicodeRenderer.java
+
+diff --git a/tool/src/org/antlr/v4/unicode/UnicodeRenderer.java b/tool/src/org/antlr/v4/unicode/UnicodeRenderer.java
+new file mode 100644
+index 0000000..9e53213
+--- /dev/null
++++ b/tool/src/org/antlr/v4/unicode/UnicodeRenderer.java
+@@ -0,0 +1,33 @@
++package org.antlr.v4.unicode;
++
++import org.stringtemplate.v4.*;
++import org.stringtemplate.v4.misc.ErrorBuffer;
++import org.antlr.v4.unicode.UnicodeDataTemplateController;
++
++import java.io.File;
++import java.io.FileWriter;
++import java.io.IOException;
++import java.util.Map;
++import java.util.Map.Entry;
++
++public class UnicodeRenderer extends UnicodeDataTemplateController {
++ public static void main(String[] arg)
++ throws IOException {
++ String inputdir = arg[0];
++ String input = arg[1];
++ String output = arg[2];
++
++ FileWriter fileWriter = new FileWriter(new File(output));
++ ErrorBuffer listener = new ErrorBuffer();
++
++ STGroupDir group = new STGroupDir(inputdir);
++ ST st = group.getInstanceOf(input);
++
++ for(Entry<String, Object> entry : getProperties().entrySet())
++ st.add(entry.getKey(), entry.getValue());
++
++ st.write(new AutoIndentWriter(fileWriter), listener);
++ fileWriter.flush();
++ fileWriter.close();
++ }
++}
+--
+2.13.5
+