racc 1.4.12 → 1.4.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/ext/racc/com/headius/racc/Cparse.java +15 -15
- data/ext/racc/cparse.c +1 -1
- data/lib/racc/info.rb +2 -2
- data/lib/racc/parser-text.rb +4 -4
- data/lib/racc/parser.rb +4 -4
- metadata +6 -11
- data/.gemtest +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63f4e66898f77de945b0df3b04bab131f7c55aed
|
4
|
+
data.tar.gz: 900f1d9ce77c84ea450b5d5f679795c0e0a2cef2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07b41103a1d046166af2d748cacc21a6830d5a70b77a91c9dbf8cbc15469fa83d3367ba6cff6057bb63314cecca05fc18cda889839b5e37416ac29aa8b18131a
|
7
|
+
data.tar.gz: 1edf22c34ccd8cc533a66d513809f07133124dcf0b778f5c0cd8037ec510d4562dd3df4de6c22bc8fd1cd7b8bfccee0f8b7e406dc9e46f3686be5275d334370f
|
data/Rakefile
CHANGED
@@ -30,7 +30,7 @@ import org.jruby.runtime.builtin.IRubyObject;
|
|
30
30
|
import org.jruby.runtime.load.Library;
|
31
31
|
|
32
32
|
public class Cparse implements Library {
|
33
|
-
public static final String RACC_VERSION = "1.4.
|
33
|
+
public static final String RACC_VERSION = "1.4.13"; // TODO: parse from Cparse.c
|
34
34
|
|
35
35
|
public enum TokenType {
|
36
36
|
DEFAULT(-1),
|
@@ -70,8 +70,6 @@ public class Cparse implements Library {
|
|
70
70
|
private CallSite call_d_read_token;
|
71
71
|
private CallSite call_d_next_state;
|
72
72
|
private CallSite call_d_e_pop;
|
73
|
-
private AttrWriterMethod set_errstatus;
|
74
|
-
private AttrReaderMethod get_errstatus;
|
75
73
|
|
76
74
|
private static RubySymbol value_to_id(ThreadContext context, IRubyObject v) {
|
77
75
|
if (!(v instanceof RubySymbol)) {
|
@@ -173,7 +171,7 @@ public class Cparse implements Library {
|
|
173
171
|
this.t = runtime.newFixnum(TokenType.FINAL.id + 1); // must not init to FINAL_TOKEN
|
174
172
|
this.nerr = 0;
|
175
173
|
this.errstatus = 0;
|
176
|
-
|
174
|
+
this.parser.setInstanceVariable(ID_ERRSTATUS, runtime.newFixnum(this.errstatus));
|
177
175
|
|
178
176
|
this.retval = context.nil;
|
179
177
|
this.fin = 0;
|
@@ -349,7 +347,7 @@ public class Cparse implements Library {
|
|
349
347
|
D_puts("shift");
|
350
348
|
if (this.errstatus > 0) {
|
351
349
|
this.errstatus--;
|
352
|
-
|
350
|
+
this.parser.setInstanceVariable(ID_ERRSTATUS, runtime.newFixnum(this.errstatus));
|
353
351
|
}
|
354
352
|
SHIFT(context, act, this.t, val);
|
355
353
|
read_next = true;
|
@@ -401,7 +399,7 @@ public class Cparse implements Library {
|
|
401
399
|
read_next = true;
|
402
400
|
}
|
403
401
|
this.errstatus = 3;
|
404
|
-
|
402
|
+
this.parser.setInstanceVariable(ID_ERRSTATUS, runtime.newFixnum(this.errstatus));
|
405
403
|
|
406
404
|
/* check if we can shift/reduce error token */
|
407
405
|
D_printf("(err) k1=%ld\n", this.curstate);
|
@@ -498,7 +496,7 @@ public class Cparse implements Library {
|
|
498
496
|
try {
|
499
497
|
context.pushCatch(rbContinuation.getContinuation());
|
500
498
|
code = reduce0(context);
|
501
|
-
errstatus = assert_integer(
|
499
|
+
errstatus = assert_integer(parser.getInstanceVariable(ID_ERRSTATUS));
|
502
500
|
} finally {
|
503
501
|
context.popCatch();
|
504
502
|
}
|
@@ -734,8 +732,14 @@ public class Cparse implements Library {
|
|
734
732
|
return v.retval;
|
735
733
|
}
|
736
734
|
|
735
|
+
private class LexerUnroll extends RuntimeException {
|
736
|
+
public Throwable fillInStackTrace() {
|
737
|
+
return this;
|
738
|
+
}
|
739
|
+
}
|
740
|
+
|
737
741
|
private void call_lexer(ThreadContext context, final CparseParams v) {
|
738
|
-
final
|
742
|
+
final LexerUnroll lexerUnroll = new LexerUnroll();
|
739
743
|
try {
|
740
744
|
v.call_lexmid.call(context, v.lexer, v.lexer, CallBlock19.newCallClosure(v, v.getMetaClass(), Arity.ONE_ARGUMENT, new BlockCallback() {
|
741
745
|
@Override
|
@@ -748,14 +752,14 @@ public class Cparse implements Library {
|
|
748
752
|
v.extract_user_token(context, args[0], tokVal);
|
749
753
|
v.parse_main(context, tokVal[0], tokVal[1], true);
|
750
754
|
if (v.fin != 0 && v.fin != CP_FIN_ACCEPT) {
|
751
|
-
throw
|
755
|
+
throw lexerUnroll;
|
752
756
|
}
|
753
757
|
|
754
758
|
return context.nil;
|
755
759
|
}
|
756
760
|
}, context));
|
757
|
-
} catch (
|
758
|
-
if (
|
761
|
+
} catch (LexerUnroll maybeOurs) {
|
762
|
+
if (maybeOurs == lexerUnroll) {
|
759
763
|
return;
|
760
764
|
}
|
761
765
|
}
|
@@ -795,10 +799,6 @@ public class Cparse implements Library {
|
|
795
799
|
call_d_next_state = MethodIndex.getFunctionalCallSite(ID_D_NEXT_STATE);
|
796
800
|
call_d_e_pop = MethodIndex.getFunctionalCallSite(ID_D_E_POP);
|
797
801
|
|
798
|
-
// hacky utility for caching instance var accessor
|
799
|
-
set_errstatus = new AttrWriterMethod(parser, Visibility.PUBLIC, CallConfiguration.FrameNoneScopeNone, ID_ERRSTATUS);
|
800
|
-
get_errstatus = new AttrReaderMethod(parser, Visibility.PUBLIC, CallConfiguration.FrameNoneScopeNone, ID_ERRSTATUS);
|
801
|
-
|
802
802
|
vDEFAULT_TOKEN = runtime.newFixnum(TokenType.DEFAULT.id);
|
803
803
|
vERROR_TOKEN = runtime.newFixnum(TokenType.ERROR.id);
|
804
804
|
vFINAL_TOKEN = runtime.newFixnum(TokenType.FINAL.id);
|
data/ext/racc/cparse.c
CHANGED
data/lib/racc/info.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# $Id:
|
2
|
+
# $Id: 22e498362c014749b453953e8d986243c0b8660c $
|
3
3
|
#
|
4
4
|
# Copyright (c) 1999-2006 Minero Aoki
|
5
5
|
#
|
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
|
12
12
|
module Racc
|
13
|
-
VERSION = '1.4.
|
13
|
+
VERSION = '1.4.13'
|
14
14
|
Version = VERSION
|
15
15
|
Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
|
16
16
|
end
|
data/lib/racc/parser-text.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Racc
|
2
2
|
PARSER_TEXT = <<'__end_of_file__'
|
3
3
|
#
|
4
|
-
# $Id:
|
4
|
+
# $Id: f015c335c3b92ed58b32b8fb00163be48783f689 $
|
5
5
|
#
|
6
6
|
# Copyright (c) 1999-2006 Minero Aoki
|
7
7
|
#
|
@@ -189,12 +189,12 @@ module Racc
|
|
189
189
|
class Parser
|
190
190
|
|
191
191
|
Racc_Runtime_Version = ::Racc::VERSION
|
192
|
-
Racc_Runtime_Revision = '$Id:
|
192
|
+
Racc_Runtime_Revision = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'
|
193
193
|
|
194
194
|
Racc_Runtime_Core_Version_R = ::Racc::VERSION
|
195
|
-
Racc_Runtime_Core_Revision_R = '$Id:
|
195
|
+
Racc_Runtime_Core_Revision_R = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'.split[1]
|
196
196
|
begin
|
197
|
-
if RUBY_ENGINE == 'jruby'
|
197
|
+
if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
|
198
198
|
require 'racc/cparse-jruby.jar'
|
199
199
|
com.headius.racc.Cparse.new.load(JRuby.runtime, false)
|
200
200
|
else
|
data/lib/racc/parser.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# $Id:
|
2
|
+
# $Id: f015c335c3b92ed58b32b8fb00163be48783f689 $
|
3
3
|
#
|
4
4
|
# Copyright (c) 1999-2006 Minero Aoki
|
5
5
|
#
|
@@ -187,12 +187,12 @@ module Racc
|
|
187
187
|
class Parser
|
188
188
|
|
189
189
|
Racc_Runtime_Version = ::Racc::VERSION
|
190
|
-
Racc_Runtime_Revision = '$Id:
|
190
|
+
Racc_Runtime_Revision = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'
|
191
191
|
|
192
192
|
Racc_Runtime_Core_Version_R = ::Racc::VERSION
|
193
|
-
Racc_Runtime_Core_Revision_R = '$Id:
|
193
|
+
Racc_Runtime_Core_Revision_R = '$Id: f015c335c3b92ed58b32b8fb00163be48783f689 $'.split[1]
|
194
194
|
begin
|
195
|
-
if RUBY_ENGINE == 'jruby'
|
195
|
+
if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
|
196
196
|
require 'racc/cparse-jruby.jar'
|
197
197
|
com.headius.racc.Cparse.new.load(JRuby.runtime, false)
|
198
198
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: racc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
61
|
+
version: '3.14'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
68
|
+
version: '3.14'
|
69
69
|
description: |-
|
70
70
|
Racc is a LALR(1) parser generator.
|
71
71
|
It is written in Ruby itself, and generates Ruby program.
|
@@ -92,7 +92,6 @@ extra_rdoc_files:
|
|
92
92
|
- rdoc/ja/grammar.ja.rdoc
|
93
93
|
- rdoc/ja/parser.ja.rdoc
|
94
94
|
files:
|
95
|
-
- ".gemtest"
|
96
95
|
- COPYING
|
97
96
|
- ChangeLog
|
98
97
|
- DEPENDS
|
@@ -216,12 +215,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
215
|
version: '0'
|
217
216
|
requirements: []
|
218
217
|
rubyforge_project:
|
219
|
-
rubygems_version: 2.
|
218
|
+
rubygems_version: 2.5.0
|
220
219
|
signing_key:
|
221
220
|
specification_version: 4
|
222
221
|
summary: Racc is a LALR(1) parser generator
|
223
|
-
test_files:
|
224
|
-
- test/test_chk_y.rb
|
225
|
-
- test/test_grammar_file_parser.rb
|
226
|
-
- test/test_racc_command.rb
|
227
|
-
- test/test_scan_y.rb
|
222
|
+
test_files: []
|
data/.gemtest
DELETED
File without changes
|