Add Debian patches.
This commit is contained in:
parent
fad3d0357d
commit
c7211984f5
14
0002-conversion-timeout.patch
Normal file
14
0002-conversion-timeout.patch
Normal file
@ -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?
|
35
0003-fix-c-template.patch
Normal file
35
0003-fix-c-template.patch
Normal file
@ -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)>
|
13
0004-eof-token.patch
Normal file
13
0004-eof-token.patch
Normal file
@ -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);
|
42
0005-reproducible-parsers.patch
Normal file
42
0005-reproducible-parsers.patch
Normal file
@ -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 )
|
18
antlr3.spec
18
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user