public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jerry James <loganjerry@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/antlr3] epel10: Add Debian patches.
Date: Wed, 22 Jul 2026 19:37:38 GMT [thread overview]
Message-ID: <178474905857.1.12209759995605738885.rpms-antlr3-c7211984f5a6@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/antlr3
Branch : epel10
Commit : c7211984f5a65d8f9eb8dd333d8e0a54f781f084
Author : Jerry James <loganjerry@gmail.com>
Date : 2019-04-27T16:42:50-06:00
Stats : +121/-1 in 5 file(s)
URL : https://src.fedoraproject.org/rpms/antlr3/c/c7211984f5a65d8f9eb8dd333d8e0a54f781f084?branch=epel10
Log:
Add Debian patches.
---
diff --git a/0002-conversion-timeout.patch b/0002-conversion-timeout.patch
new file mode 100644
index 0000000..8bd8536
--- /dev/null
+++ b/0002-conversion-timeout.patch
@@ -0,0 +1,14 @@
+Description: Increase the default conversion timeout to avoid build failures when complex grammars are processed on slow architectures.
+Author: Emmanuel Bourg <ebourg@apache.org>
+Forwarded: no
+--- a/tool/src/main/java/org/antlr/analysis/DFA.java
++++ b/tool/src/main/java/org/antlr/analysis/DFA.java
+@@ -57,7 +57,7 @@
+ */
+
+ /** Set to 0 to not terminate early (time in ms) */
+- public static int MAX_TIME_PER_DFA_CREATION = 1*1000;
++ public static int MAX_TIME_PER_DFA_CREATION = 30*1000;
+
+ /** How many edges can each DFA state have before a "special" state
+ * is created that uses IF expressions instead of a table?
diff --git a/0003-fix-c-template.patch b/0003-fix-c-template.patch
new file mode 100644
index 0000000..6eabc08
--- /dev/null
+++ b/0003-fix-c-template.patch
@@ -0,0 +1,35 @@
+Description: Fix various issues with the C template (backports of patchs proposed upstream)
+Origin: backport, https://github.com/stephengaito/antlr3/commit/adc5e54
+ https://github.com/stephengaito/antlr3/commit/71df80c
+--- a/tool/src/main/resources/org/antlr/codegen/templates/C/C.stg
++++ b/tool/src/main/resources/org/antlr/codegen/templates/C/C.stg
+@@ -2132,7 +2132,9 @@
+ <if(LEXER)>
+ LRECOVER();
+ <else>
++<! use following code to make it recover inline;
+ RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_<ruleName><elementIndex>);
++!>
+ <endif>
+ goto rule<ruleDescriptor.name>Ex;
+ }<\n>
+@@ -2143,7 +2145,10 @@
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ <if(PARSER)>
++EXCEPTION->expectingSet = NULL;
++<! use following code to make it recover inline;
+ EXCEPTION->expectingSet = &FOLLOW_set_in_<ruleName><elementIndex>;
++!>
+ <endif>
+ >>
+
+@@ -2510,7 +2515,7 @@
+ */
+ static const ANTLR3_INT32 * const dfa<dfa.decisionNumber>_transitions[] =
+ {
+- <dfa.transitionEdgeTables:{xref|dfa<dfa.decisionNumber>_T<xref>}; separator=", ", wrap="\n", null="_empty">
++ <dfa.transitionEdgeTables:{xref|dfa<dfa.decisionNumber>_T<xref>}; separator=", ", wrap="\n", null="NULL">
+ };
+
+ <if(dfa.specialStateSTs)>
diff --git a/0004-eof-token.patch b/0004-eof-token.patch
new file mode 100644
index 0000000..2602ca6
--- /dev/null
+++ b/0004-eof-token.patch
@@ -0,0 +1,13 @@
+Description: Keep the Token.EOF_TOKEN field to preserve the backward compatibility
+Author: Emmanuel Bourg <ebourg@apache.org>
+Forwarded: no
+--- a/runtime/Java/src/main/java/org/antlr/runtime/Token.java
++++ b/runtime/Java/src/main/java/org/antlr/runtime/Token.java
+@@ -38,6 +38,7 @@
+ public static final int MIN_TOKEN_TYPE = UP+1;
+
+ public static final int EOF = CharStream.EOF;
++ public static final Token EOF_TOKEN = new CommonToken(EOF);
+
+ public static final int INVALID_TOKEN_TYPE = 0;
+ public static final Token INVALID_TOKEN = new CommonToken(INVALID_TOKEN_TYPE);
diff --git a/0005-reproducible-parsers.patch b/0005-reproducible-parsers.patch
new file mode 100644
index 0000000..a06bcaf
--- /dev/null
+++ b/0005-reproducible-parsers.patch
@@ -0,0 +1,42 @@
+Description: Replace the HashSets with LinkedHashSets to make the generated parsers reproducible
+Author: Emmanuel Bourg <ebourg@apache.org>
+Forwarded: no
+--- a/tool/src/main/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.g
++++ b/tool/src/main/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.g
+@@ -45,6 +45,7 @@
+ package org.antlr.grammar.v3;
+ import org.antlr.tool.*;
+ import java.util.HashSet;
++import java.util.LinkedHashSet;
+ import java.util.Set;
+ }
+
+@@ -279,7 +280,7 @@
+ throwsSpec returns [HashSet<String> exceptions]
+ @init
+ {
+- $exceptions = new HashSet<String>();
++ $exceptions = new LinkedHashSet<String>();
+ }
+ : ^('throws' (ID {$exceptions.add($ID.text);})+ )
+ ;
+@@ -556,7 +557,7 @@
+ if ( state.backtracking == 0 )
+ {
+ if ( grammar.buildAST() )
+- currentRewriteRule.rewriteRefsDeep = new HashSet<GrammarAST>();
++ currentRewriteRule.rewriteRefsDeep = new LinkedHashSet<GrammarAST>();
+ }
+ }
+ : ^( REWRITES
+@@ -582,8 +583,8 @@
+ {
+ // don't do if guessing
+ currentRewriteBlock=$start; // pts to BLOCK node
+- currentRewriteBlock.rewriteRefsShallow = new HashSet<GrammarAST>();
+- currentRewriteBlock.rewriteRefsDeep = new HashSet<GrammarAST>();
++ currentRewriteBlock.rewriteRefsShallow = new LinkedHashSet<GrammarAST>();
++ currentRewriteBlock.rewriteRefsDeep = new LinkedHashSet<GrammarAST>();
+ }
+ }
+ : ^( BLOCK rewrite_alternative EOB )
diff --git a/antlr3.spec b/antlr3.spec
index 111483c..f14bbdb 100644
--- a/antlr3.spec
+++ b/antlr3.spec
@@ -1,7 +1,7 @@
%global antlr_version 3.5.2
%global c_runtime_version 3.4
%global javascript_runtime_version 3.1
-%global baserelease 21
+%global baserelease 22
Summary: ANother Tool for Language Recognition
Name: antlr3
@@ -18,6 +18,15 @@ Source3: http://www.antlr3.org/download/antlr-javascript-runtime-%{ja
Patch0: 0001-java8-fix.patch
# Generate OSGi metadata
Patch1: osgi-manifest.patch
+# Increase the default conversion timeout to avoid build failures when complex
+# grammars are processed on slow architectures. Patch from Debian.
+Patch2: 0002-conversion-timeout.patch
+# Fix problems with the C template. Patch from Debian.
+Patch3: 0003-fix-c-template.patch
+# Keep Token.EOF_TOKEN for backwards compatibility. Patch from Debian.
+Patch4: 0004-eof-token.patch
+# Make parsers reproducible. Patch from Debian.
+Patch5: 0005-reproducible-parsers.patch
BuildRequires: maven-local
BuildRequires: mvn(org.antlr:antlr)
@@ -130,6 +139,10 @@ C++ runtime support for ANTLR-generated parsers.
sed -i "s,\${buildNumber},`cat %{_sysconfdir}/fedora-release` `date`," tool/src/main/resources/org/antlr/antlr.properties
%patch0 -p1
%patch1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
# remove pre-built artifacts
find -type f -a -name *.jar -delete
@@ -263,6 +276,9 @@ install -pm 644 runtime/Cpp/include/* $RPM_BUILD_ROOT/%{_includedir}/
%doc tool/LICENSE.txt
%changelog
+* Sat Apr 27 2019 Jerry James <loganjerry@gmail.com> - 1:3.5.2-22
+- Add Debian patches
+
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.5.2-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
reply other threads:[~2026-07-22 19:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178474905857.1.12209759995605738885.rpms-antlr3-c7211984f5a6@fedoraproject.org \
--to=loganjerry@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox