treetop 1.6.6 → 1.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +18 -0
- data/History.txt +18 -0
- data/README.md +2 -0
- data/Rakefile +10 -43
- data/Treetop.tmbundle/Preferences/Comments.tmPreferences +28 -0
- data/Treetop.tmbundle/Snippets/grammar ___ end.tmSnippet +20 -0
- data/Treetop.tmbundle/Snippets/rule ___ end.tmSnippet +18 -0
- data/Treetop.tmbundle/Support/nibs/SyntaxTreeViewer.nib/designable.nib +1524 -0
- data/Treetop.tmbundle/Support/nibs/SyntaxTreeViewer.nib/keyedobjects.nib +0 -0
- data/Treetop.tmbundle/Support/syntax_tree_viewer.rb +117 -0
- data/Treetop.tmbundle/Syntaxes/Treetop Grammar.tmLanguage +358 -0
- data/Treetop.tmbundle/info.plist +10 -0
- data/doc/pitfalls_and_advanced_techniques.markdown +6 -0
- data/doc/syntactic_recognition.markdown +2 -2
- data/lib/treetop/compiler/grammar_compiler.rb +6 -3
- data/lib/treetop/compiler/metagrammar.rb +97 -77
- data/lib/treetop/compiler/metagrammar.treetop +1 -1
- data/lib/treetop/compiler/ruby_builder.rb +2 -2
- data/lib/treetop/ruby_extensions/string.rb +0 -6
- data/lib/treetop/runtime/compiled_parser.rb +15 -2
- data/lib/treetop/version.rb +1 -1
- data/treetop.gemspec +25 -157
- metadata +15 -61
- data/doc/site.rb +0 -112
- data/doc/sitegen.rb +0 -65
- data/spec/compiler/and_predicate_spec.rb +0 -36
- data/spec/compiler/anything_symbol_spec.rb +0 -47
- data/spec/compiler/character_class_spec.rb +0 -304
- data/spec/compiler/choice_spec.rb +0 -89
- data/spec/compiler/circular_compilation_spec.rb +0 -30
- data/spec/compiler/failure_propagation_functional_spec.rb +0 -21
- data/spec/compiler/grammar_compiler_spec.rb +0 -113
- data/spec/compiler/grammar_spec.rb +0 -44
- data/spec/compiler/multibyte_chars_spec.rb +0 -38
- data/spec/compiler/namespace_spec.rb +0 -42
- data/spec/compiler/nonterminal_symbol_spec.rb +0 -40
- data/spec/compiler/not_predicate_spec.rb +0 -52
- data/spec/compiler/occurrence_range_spec.rb +0 -186
- data/spec/compiler/one_or_more_spec.rb +0 -35
- data/spec/compiler/optional_spec.rb +0 -37
- data/spec/compiler/parenthesized_expression_spec.rb +0 -34
- data/spec/compiler/parsing_rule_spec.rb +0 -61
- data/spec/compiler/repeated_subrule_spec.rb +0 -29
- data/spec/compiler/semantic_predicate_spec.rb +0 -176
- data/spec/compiler/sequence_spec.rb +0 -129
- data/spec/compiler/terminal_spec.rb +0 -177
- data/spec/compiler/terminal_symbol_spec.rb +0 -40
- data/spec/compiler/test_grammar.treetop +0 -7
- data/spec/compiler/test_grammar.tt +0 -7
- data/spec/compiler/test_grammar_do.treetop +0 -7
- data/spec/compiler/test_grammar_magic_coding.treetop +0 -8
- data/spec/compiler/test_grammar_magic_encoding.treetop +0 -8
- data/spec/compiler/tt_compiler_spec.rb +0 -224
- data/spec/compiler/zero_or_more_spec.rb +0 -58
- data/spec/composition/a.treetop +0 -11
- data/spec/composition/b.treetop +0 -11
- data/spec/composition/c.treetop +0 -10
- data/spec/composition/d.treetop +0 -10
- data/spec/composition/f.treetop +0 -17
- data/spec/composition/grammar_composition_spec.rb +0 -40
- data/spec/composition/subfolder/e_includes_c.treetop +0 -15
- data/spec/ruby_extensions/string_spec.rb +0 -32
- data/spec/runtime/compiled_parser_spec.rb +0 -153
- data/spec/runtime/syntax_node_spec.rb +0 -77
- data/spec/spec_helper.rb +0 -123
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>name</key>
|
6
|
+
<string>Treetop</string>
|
7
|
+
<key>uuid</key>
|
8
|
+
<string>83A8B700-143D-4BD6-B4EA-D73796E8F883</string>
|
9
|
+
</dict>
|
10
|
+
</plist>
|
@@ -49,3 +49,9 @@ This says that `'end'` must be followed by a space, but this space is not consum
|
|
49
49
|
end
|
50
50
|
|
51
51
|
In general, when the syntax gets tough, it helps to focus on what you really mean. A keyword is a character not followed by another character that isn't a space.
|
52
|
+
|
53
|
+
## Poor Performance with Large Unicode Strings
|
54
|
+
|
55
|
+
Treetop may perform poorly when parsing very large (more than 100KB) unicode strings. This is due to the fact that substring lookups on Ruby unicode strings are linear-time operations, and not constant-time operations like they are on ASCII encoded strings. This means that parse times for larger strings can be exponentially worse than for smaller strings.
|
56
|
+
|
57
|
+
If your input and grammar only expect ASCII strings, you can achieve significant performance improvements for large strings by re-encoding them to ASCII using `input.encode(Encoding::US_ASCII)`. See [this issue on GitHub](https://github.com/cjheath/treetop/issues/31) for more information and other possible workarounds for unicode strings.
|
@@ -32,9 +32,9 @@ The main keywords are:
|
|
32
32
|
|
33
33
|
* `rule` : This defines a parsing rule within the grammar. It is followed by a name by which this rule can be referenced within other rules. It is then followed by a parsing expression defining the rule.
|
34
34
|
|
35
|
-
A grammar may be surrounded by one or more nested `module` statements, which provides a namespace for the generated Ruby parser.
|
35
|
+
A grammar may be surrounded by one or more nested `module` or `class` statements, which provides a namespace for the generated Ruby parser. Note that you cannot specify a superclass for a class, so if your class has a superclass, it must be declared elsewhere and loaded first.
|
36
36
|
|
37
|
-
Treetop will emit a module called `GrammarName` and a parser class called `GrammarNameParser` (in the
|
37
|
+
Treetop will emit a module called `GrammarName` and a parser class called `GrammarNameParser` (in the namespace, if specified).
|
38
38
|
|
39
39
|
#Parsing Expressions
|
40
40
|
Each rule associates a name with a _parsing expression_. Parsing expressions are a generalization of vanilla regular expressions. Their key feature is the ability to reference other expressions in the grammar by name.
|
@@ -33,10 +33,13 @@ module Treetop
|
|
33
33
|
|
34
34
|
# compile a treetop source file and load it
|
35
35
|
def self.load(path)
|
36
|
-
|
37
|
-
|
36
|
+
unless path =~ Treetop::Polyglot::VALID_GRAMMAR_EXT_REGEXP
|
37
|
+
ext = Treetop::Polyglot::VALID_GRAMMAR_EXT.select {|ext| File.exist?(path+".#{ext}")}.shift
|
38
|
+
path += ".#{ext}" unless ext.nil?
|
39
|
+
end
|
40
|
+
File.open(path) do |source_file|
|
38
41
|
source = source_file.read
|
39
|
-
source.gsub!(/\b__FILE__\b/, %Q{"#{
|
42
|
+
source.gsub!(/\b__FILE__\b/, %Q{"#{path}"})
|
40
43
|
load_from_string(source)
|
41
44
|
end
|
42
45
|
end
|
@@ -320,102 +320,122 @@ module Treetop
|
|
320
320
|
|
321
321
|
i0, s0 = index, []
|
322
322
|
i1, s1 = index, []
|
323
|
+
i2 = index
|
323
324
|
if (match_len = has_terminal?('module', false, index))
|
324
|
-
|
325
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
325
326
|
@index += match_len
|
326
327
|
else
|
327
328
|
terminal_parse_failure('\'module\'')
|
328
|
-
|
329
|
+
r3 = nil
|
330
|
+
end
|
331
|
+
if r3
|
332
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
333
|
+
r2 = r3
|
334
|
+
else
|
335
|
+
if (match_len = has_terminal?('class', false, index))
|
336
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
337
|
+
@index += match_len
|
338
|
+
else
|
339
|
+
terminal_parse_failure('\'class\'')
|
340
|
+
r4 = nil
|
341
|
+
end
|
342
|
+
if r4
|
343
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
344
|
+
r2 = r4
|
345
|
+
else
|
346
|
+
@index = i2
|
347
|
+
r2 = nil
|
348
|
+
end
|
329
349
|
end
|
330
350
|
s1 << r2
|
331
351
|
if r2
|
332
|
-
|
333
|
-
s1 <<
|
334
|
-
if
|
335
|
-
|
352
|
+
r5 = _nt_space
|
353
|
+
s1 << r5
|
354
|
+
if r5
|
355
|
+
i6, s6 = index, []
|
336
356
|
if has_terminal?(@regexps[gr = '\A[A-Z]'] ||= Regexp.new(gr), :regexp, index)
|
337
|
-
|
357
|
+
r7 = true
|
338
358
|
@index += 1
|
339
359
|
else
|
340
360
|
terminal_parse_failure('[A-Z]')
|
341
|
-
|
361
|
+
r7 = nil
|
342
362
|
end
|
343
|
-
|
344
|
-
if
|
345
|
-
|
363
|
+
s6 << r7
|
364
|
+
if r7
|
365
|
+
s8, i8 = [], index
|
346
366
|
loop do
|
347
|
-
|
348
|
-
if
|
349
|
-
|
367
|
+
r9 = _nt_alphanumeric_char
|
368
|
+
if r9
|
369
|
+
s8 << r9
|
350
370
|
else
|
351
371
|
break
|
352
372
|
end
|
353
373
|
end
|
354
|
-
|
355
|
-
|
356
|
-
if
|
357
|
-
|
374
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
375
|
+
s6 << r8
|
376
|
+
if r8
|
377
|
+
s10, i10 = [], index
|
358
378
|
loop do
|
359
|
-
|
379
|
+
i11, s11 = index, []
|
360
380
|
if (match_len = has_terminal?('::', false, index))
|
361
|
-
|
381
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
362
382
|
@index += match_len
|
363
383
|
else
|
364
384
|
terminal_parse_failure('\'::\'')
|
365
|
-
|
385
|
+
r12 = nil
|
366
386
|
end
|
367
|
-
|
368
|
-
if
|
387
|
+
s11 << r12
|
388
|
+
if r12
|
369
389
|
if has_terminal?(@regexps[gr = '\A[A-Z]'] ||= Regexp.new(gr), :regexp, index)
|
370
|
-
|
390
|
+
r13 = true
|
371
391
|
@index += 1
|
372
392
|
else
|
373
393
|
terminal_parse_failure('[A-Z]')
|
374
|
-
|
394
|
+
r13 = nil
|
375
395
|
end
|
376
|
-
|
377
|
-
if
|
378
|
-
|
396
|
+
s11 << r13
|
397
|
+
if r13
|
398
|
+
s14, i14 = [], index
|
379
399
|
loop do
|
380
|
-
|
381
|
-
if
|
382
|
-
|
400
|
+
r15 = _nt_alphanumeric_char
|
401
|
+
if r15
|
402
|
+
s14 << r15
|
383
403
|
else
|
384
404
|
break
|
385
405
|
end
|
386
406
|
end
|
387
|
-
|
388
|
-
|
407
|
+
r14 = instantiate_node(SyntaxNode,input, i14...index, s14)
|
408
|
+
s11 << r14
|
389
409
|
end
|
390
410
|
end
|
391
|
-
if
|
392
|
-
|
393
|
-
|
411
|
+
if s11.last
|
412
|
+
r11 = instantiate_node(SyntaxNode,input, i11...index, s11)
|
413
|
+
r11.extend(ModuleDeclaration0)
|
394
414
|
else
|
395
|
-
@index =
|
396
|
-
|
415
|
+
@index = i11
|
416
|
+
r11 = nil
|
397
417
|
end
|
398
|
-
if
|
399
|
-
|
418
|
+
if r11
|
419
|
+
s10 << r11
|
400
420
|
else
|
401
421
|
break
|
402
422
|
end
|
403
423
|
end
|
404
|
-
|
405
|
-
|
424
|
+
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
|
425
|
+
s6 << r10
|
406
426
|
end
|
407
427
|
end
|
408
|
-
if
|
409
|
-
|
410
|
-
|
428
|
+
if s6.last
|
429
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
430
|
+
r6.extend(ModuleDeclaration1)
|
411
431
|
else
|
412
|
-
@index =
|
413
|
-
|
432
|
+
@index = i6
|
433
|
+
r6 = nil
|
414
434
|
end
|
415
|
-
s1 <<
|
416
|
-
if
|
417
|
-
|
418
|
-
s1 <<
|
435
|
+
s1 << r6
|
436
|
+
if r6
|
437
|
+
r16 = _nt_space
|
438
|
+
s1 << r16
|
419
439
|
end
|
420
440
|
end
|
421
441
|
end
|
@@ -428,44 +448,44 @@ module Treetop
|
|
428
448
|
end
|
429
449
|
s0 << r1
|
430
450
|
if r1
|
431
|
-
|
432
|
-
|
433
|
-
if
|
434
|
-
|
435
|
-
|
451
|
+
i17 = index
|
452
|
+
r18 = _nt_module_declaration
|
453
|
+
if r18
|
454
|
+
r18 = SyntaxNode.new(input, (index-1)...index) if r18 == true
|
455
|
+
r17 = r18
|
436
456
|
else
|
437
|
-
|
438
|
-
if
|
439
|
-
|
440
|
-
|
457
|
+
r19 = _nt_grammar
|
458
|
+
if r19
|
459
|
+
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
460
|
+
r17 = r19
|
441
461
|
else
|
442
|
-
@index =
|
443
|
-
|
462
|
+
@index = i17
|
463
|
+
r17 = nil
|
444
464
|
end
|
445
465
|
end
|
446
|
-
s0 <<
|
447
|
-
if
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
if
|
466
|
+
s0 << r17
|
467
|
+
if r17
|
468
|
+
i20, s20 = index, []
|
469
|
+
r21 = _nt_space
|
470
|
+
s20 << r21
|
471
|
+
if r21
|
452
472
|
if (match_len = has_terminal?('end', false, index))
|
453
|
-
|
473
|
+
r22 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
454
474
|
@index += match_len
|
455
475
|
else
|
456
476
|
terminal_parse_failure('\'end\'')
|
457
|
-
|
477
|
+
r22 = nil
|
458
478
|
end
|
459
|
-
|
479
|
+
s20 << r22
|
460
480
|
end
|
461
|
-
if
|
462
|
-
|
463
|
-
|
481
|
+
if s20.last
|
482
|
+
r20 = instantiate_node(SyntaxNode,input, i20...index, s20)
|
483
|
+
r20.extend(ModuleDeclaration3)
|
464
484
|
else
|
465
|
-
@index =
|
466
|
-
|
485
|
+
@index = i20
|
486
|
+
r20 = nil
|
467
487
|
end
|
468
|
-
s0 <<
|
488
|
+
s0 << r20
|
469
489
|
end
|
470
490
|
end
|
471
491
|
if s0.last
|
@@ -18,7 +18,7 @@ module Treetop
|
|
18
18
|
end
|
19
19
|
|
20
20
|
rule module_declaration
|
21
|
-
module_prefix:('module' space name:([A-Z] alphanumeric_char* ('::' [A-Z] alphanumeric_char*)*) space) module_contents:(module_declaration / grammar) suffix:(space 'end') {
|
21
|
+
module_prefix:(('module'/'class') space name:([A-Z] alphanumeric_char* ('::' [A-Z] alphanumeric_char*)*) space) module_contents:(module_declaration / grammar) suffix:(space 'end') {
|
22
22
|
def compile
|
23
23
|
module_prefix.text_value + module_contents.compile + suffix.text_value
|
24
24
|
end
|
@@ -9,11 +9,11 @@ module Treetop
|
|
9
9
|
def initialize
|
10
10
|
@level = 0
|
11
11
|
@address_space = LexicalAddressSpace.new
|
12
|
-
@ruby = ""
|
12
|
+
@ruby = String.new("")
|
13
13
|
end
|
14
14
|
|
15
15
|
def <<(ruby_line)
|
16
|
-
return if ruby_line
|
16
|
+
return if ruby_line == ''
|
17
17
|
ruby << ruby_line.tabto(level) << "\n"
|
18
18
|
end
|
19
19
|
|
@@ -52,10 +52,10 @@ module Treetop
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def terminal_failures
|
55
|
-
if @terminal_failures.empty? || @terminal_failures[
|
55
|
+
if @terminal_failures.empty? || @terminal_failures[-1].is_a?(TerminalParseFailure)
|
56
56
|
@terminal_failures
|
57
57
|
else
|
58
|
-
@terminal_failures.map! {|tf_ary| TerminalParseFailure.new(*tf_ary) }
|
58
|
+
@terminal_failures.map! {|tf_ary| tf_ary.is_a?(TerminalParseFailure) ? tf_ary : TerminalParseFailure.new(*tf_ary) }
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -75,6 +75,11 @@ module Treetop
|
|
75
75
|
@max_terminal_failure_index = 0
|
76
76
|
end
|
77
77
|
|
78
|
+
def forget_failures_to_here
|
79
|
+
@terminal_failures = []
|
80
|
+
@max_terminal_failure_index = -1
|
81
|
+
end
|
82
|
+
|
78
83
|
def reset_index
|
79
84
|
@index = 0
|
80
85
|
end
|
@@ -113,12 +118,20 @@ module Treetop
|
|
113
118
|
end
|
114
119
|
|
115
120
|
def terminal_parse_failure(expected_string, unexpected = false)
|
121
|
+
if @max_terminal_failure_index == -1
|
122
|
+
@max_terminal_failure_index = 0
|
123
|
+
return nil
|
124
|
+
end
|
116
125
|
return nil if index < max_terminal_failure_index
|
117
126
|
if index > max_terminal_failure_index
|
118
127
|
@max_terminal_failure_index = index
|
119
128
|
@terminal_failures = []
|
120
129
|
end
|
121
130
|
@terminal_failures << [index, expected_string, unexpected]
|
131
|
+
# It's very slow, but this shows the last 5 nested rules:
|
132
|
+
# caller.reject{|l| l =~ /`loop'|`block in /}[0..5].reverse.map{|l| l.sub(/[^`]*`_nt_/,'').sub(/'/,'')}
|
133
|
+
|
134
|
+
terminal_failures
|
122
135
|
return nil
|
123
136
|
end
|
124
137
|
end
|
data/lib/treetop/version.rb
CHANGED
data/treetop.gemspec
CHANGED
@@ -1,166 +1,34 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
5
|
-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'date'
|
5
|
+
require 'treetop/version'
|
6
6
|
|
7
|
-
Gem::Specification.new do |
|
8
|
-
|
9
|
-
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "treetop"
|
9
|
+
spec.version = Treetop::VERSION::STRING
|
10
|
+
spec.authors = ["Nathan Sobo", "Clifford Heath"]
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
spec.email = "cliffordheath@gmail.com"
|
13
|
+
spec.date = Date.today.strftime("%F")
|
14
|
+
spec.summary = "A Ruby-based text parsing and interpretation DSL"
|
15
|
+
spec.description = "A Parsing Expression Grammar (PEG) Parser generator DSL for Ruby"
|
16
|
+
spec.homepage = "https://github.com/cjheath/treetop"
|
17
|
+
spec.licenses = ["MIT"]
|
18
|
+
|
19
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|website|script|\.|benchmark)}) }
|
20
|
+
spec.executables = ["tt"]
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
spec.extra_rdoc_files = [
|
19
23
|
"LICENSE",
|
20
24
|
"README.md"
|
21
25
|
]
|
22
|
-
s.files = [
|
23
|
-
"LICENSE",
|
24
|
-
"README.md",
|
25
|
-
"Rakefile",
|
26
|
-
"bin/tt",
|
27
|
-
"doc/contributing_and_planned_features.markdown",
|
28
|
-
"doc/grammar_composition.markdown",
|
29
|
-
"doc/index.markdown",
|
30
|
-
"doc/pitfalls_and_advanced_techniques.markdown",
|
31
|
-
"doc/semantic_interpretation.markdown",
|
32
|
-
"doc/site.rb",
|
33
|
-
"doc/sitegen.rb",
|
34
|
-
"doc/syntactic_recognition.markdown",
|
35
|
-
"doc/tt.1",
|
36
|
-
"doc/using_in_ruby.markdown",
|
37
|
-
"examples/indented_blocks/indented_blocks.tt",
|
38
|
-
"examples/indented_blocks/indented_blocks_test.rb",
|
39
|
-
"examples/lambda_calculus/arithmetic.rb",
|
40
|
-
"examples/lambda_calculus/arithmetic.treetop",
|
41
|
-
"examples/lambda_calculus/arithmetic_node_classes.rb",
|
42
|
-
"examples/lambda_calculus/arithmetic_test.rb",
|
43
|
-
"examples/lambda_calculus/lambda_calculus.rb",
|
44
|
-
"examples/lambda_calculus/lambda_calculus.treetop",
|
45
|
-
"examples/lambda_calculus/lambda_calculus_node_classes.rb",
|
46
|
-
"examples/lambda_calculus/lambda_calculus_test.rb",
|
47
|
-
"examples/lambda_calculus/test_helper.rb",
|
48
|
-
"lib/treetop.rb",
|
49
|
-
"lib/treetop/bootstrap_gen_1_metagrammar.rb",
|
50
|
-
"lib/treetop/compiler.rb",
|
51
|
-
"lib/treetop/compiler/grammar_compiler.rb",
|
52
|
-
"lib/treetop/compiler/lexical_address_space.rb",
|
53
|
-
"lib/treetop/compiler/metagrammar.rb",
|
54
|
-
"lib/treetop/compiler/metagrammar.treetop",
|
55
|
-
"lib/treetop/compiler/node_classes.rb",
|
56
|
-
"lib/treetop/compiler/node_classes/anything_symbol.rb",
|
57
|
-
"lib/treetop/compiler/node_classes/atomic_expression.rb",
|
58
|
-
"lib/treetop/compiler/node_classes/character_class.rb",
|
59
|
-
"lib/treetop/compiler/node_classes/choice.rb",
|
60
|
-
"lib/treetop/compiler/node_classes/declaration_sequence.rb",
|
61
|
-
"lib/treetop/compiler/node_classes/grammar.rb",
|
62
|
-
"lib/treetop/compiler/node_classes/inline_module.rb",
|
63
|
-
"lib/treetop/compiler/node_classes/nonterminal.rb",
|
64
|
-
"lib/treetop/compiler/node_classes/optional.rb",
|
65
|
-
"lib/treetop/compiler/node_classes/parenthesized_expression.rb",
|
66
|
-
"lib/treetop/compiler/node_classes/parsing_expression.rb",
|
67
|
-
"lib/treetop/compiler/node_classes/parsing_rule.rb",
|
68
|
-
"lib/treetop/compiler/node_classes/predicate.rb",
|
69
|
-
"lib/treetop/compiler/node_classes/predicate_block.rb",
|
70
|
-
"lib/treetop/compiler/node_classes/repetition.rb",
|
71
|
-
"lib/treetop/compiler/node_classes/sequence.rb",
|
72
|
-
"lib/treetop/compiler/node_classes/terminal.rb",
|
73
|
-
"lib/treetop/compiler/node_classes/transient_prefix.rb",
|
74
|
-
"lib/treetop/compiler/node_classes/treetop_file.rb",
|
75
|
-
"lib/treetop/compiler/ruby_builder.rb",
|
76
|
-
"lib/treetop/polyglot.rb",
|
77
|
-
"lib/treetop/ruby_extensions.rb",
|
78
|
-
"lib/treetop/ruby_extensions/string.rb",
|
79
|
-
"lib/treetop/runtime.rb",
|
80
|
-
"lib/treetop/runtime/compiled_parser.rb",
|
81
|
-
"lib/treetop/runtime/interval_skip_list.rb",
|
82
|
-
"lib/treetop/runtime/interval_skip_list/head_node.rb",
|
83
|
-
"lib/treetop/runtime/interval_skip_list/interval_skip_list.rb",
|
84
|
-
"lib/treetop/runtime/interval_skip_list/node.rb",
|
85
|
-
"lib/treetop/runtime/syntax_node.rb",
|
86
|
-
"lib/treetop/runtime/terminal_parse_failure.rb",
|
87
|
-
"lib/treetop/runtime/terminal_syntax_node.rb",
|
88
|
-
"lib/treetop/version.rb",
|
89
|
-
"spec/compiler/and_predicate_spec.rb",
|
90
|
-
"spec/compiler/anything_symbol_spec.rb",
|
91
|
-
"spec/compiler/character_class_spec.rb",
|
92
|
-
"spec/compiler/choice_spec.rb",
|
93
|
-
"spec/compiler/circular_compilation_spec.rb",
|
94
|
-
"spec/compiler/failure_propagation_functional_spec.rb",
|
95
|
-
"spec/compiler/grammar_compiler_spec.rb",
|
96
|
-
"spec/compiler/grammar_spec.rb",
|
97
|
-
"spec/compiler/multibyte_chars_spec.rb",
|
98
|
-
"spec/compiler/namespace_spec.rb",
|
99
|
-
"spec/compiler/nonterminal_symbol_spec.rb",
|
100
|
-
"spec/compiler/not_predicate_spec.rb",
|
101
|
-
"spec/compiler/occurrence_range_spec.rb",
|
102
|
-
"spec/compiler/one_or_more_spec.rb",
|
103
|
-
"spec/compiler/optional_spec.rb",
|
104
|
-
"spec/compiler/parenthesized_expression_spec.rb",
|
105
|
-
"spec/compiler/parsing_rule_spec.rb",
|
106
|
-
"spec/compiler/repeated_subrule_spec.rb",
|
107
|
-
"spec/compiler/semantic_predicate_spec.rb",
|
108
|
-
"spec/compiler/sequence_spec.rb",
|
109
|
-
"spec/compiler/terminal_spec.rb",
|
110
|
-
"spec/compiler/terminal_symbol_spec.rb",
|
111
|
-
"spec/compiler/test_grammar.treetop",
|
112
|
-
"spec/compiler/test_grammar.tt",
|
113
|
-
"spec/compiler/test_grammar_do.treetop",
|
114
|
-
"spec/compiler/test_grammar_magic_coding.treetop",
|
115
|
-
"spec/compiler/test_grammar_magic_encoding.treetop",
|
116
|
-
"spec/compiler/tt_compiler_spec.rb",
|
117
|
-
"spec/compiler/zero_or_more_spec.rb",
|
118
|
-
"spec/composition/a.treetop",
|
119
|
-
"spec/composition/b.treetop",
|
120
|
-
"spec/composition/c.treetop",
|
121
|
-
"spec/composition/d.treetop",
|
122
|
-
"spec/composition/f.treetop",
|
123
|
-
"spec/composition/grammar_composition_spec.rb",
|
124
|
-
"spec/composition/subfolder/e_includes_c.treetop",
|
125
|
-
"spec/ruby_extensions/string_spec.rb",
|
126
|
-
"spec/runtime/compiled_parser_spec.rb",
|
127
|
-
"spec/runtime/syntax_node_spec.rb",
|
128
|
-
"spec/spec_helper.rb",
|
129
|
-
"treetop.gemspec"
|
130
|
-
]
|
131
|
-
s.homepage = "https://github.com/cjheath/treetop"
|
132
|
-
s.licenses = ["MIT"]
|
133
|
-
s.rubygems_version = "2.4.5"
|
134
|
-
s.summary = "A Ruby-based text parsing and interpretation DSL"
|
135
|
-
|
136
|
-
if s.respond_to? :specification_version then
|
137
|
-
s.specification_version = 4
|
138
26
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
s.add_development_dependency(%q<rspec>, ["~> 3"])
|
146
|
-
s.add_development_dependency(%q<rake>, ["~> 11"])
|
147
|
-
else
|
148
|
-
s.add_dependency(%q<polyglot>, ["~> 0.3"])
|
149
|
-
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
150
|
-
s.add_dependency(%q<activesupport>, ["~> 5"])
|
151
|
-
s.add_dependency(%q<i18n>, ["~> 0.6"])
|
152
|
-
s.add_dependency(%q<rr>, ["~> 1.0"])
|
153
|
-
s.add_dependency(%q<rspec>, ["~> 3"])
|
154
|
-
s.add_dependency(%q<rake>, ["~> 11"])
|
155
|
-
end
|
156
|
-
else
|
157
|
-
s.add_dependency(%q<polyglot>, ["~> 0.3"])
|
158
|
-
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
159
|
-
s.add_dependency(%q<activesupport>, ["~> 5"])
|
160
|
-
s.add_dependency(%q<i18n>, ["~> 0.6"])
|
161
|
-
s.add_dependency(%q<rr>, ["~> 1.0"])
|
162
|
-
s.add_dependency(%q<rspec>, ["~> 3"])
|
163
|
-
s.add_dependency(%q<rake>, ["~> 11"])
|
164
|
-
end
|
27
|
+
spec.add_runtime_dependency(%q<polyglot>, ["~> 0.3"])
|
28
|
+
spec.add_development_dependency(%q<activesupport>, ["~> 4"])
|
29
|
+
spec.add_development_dependency(%q<i18n>, ["~> 0.6"])
|
30
|
+
spec.add_development_dependency(%q<rr>, ["~> 1.0"])
|
31
|
+
spec.add_development_dependency(%q<rspec>, ["~> 3"])
|
32
|
+
spec.add_development_dependency(%q<rake>, ["~> 11"])
|
165
33
|
end
|
166
34
|
|