treetop 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +9 -0
- data/bin/tt +0 -1
- data/lib/treetop/runtime/syntax_node.rb +7 -7
- data/lib/treetop/version.rb +1 -1
- metadata +3 -3
data/Rakefile
CHANGED
@@ -18,6 +18,15 @@ Rake::GemPackageTask.new($gemspec) do |pkg|
|
|
18
18
|
pkg.need_tar = true
|
19
19
|
end
|
20
20
|
|
21
|
+
task :spec => :regenerate_metagrammar
|
22
|
+
task :regenerate_metagrammar => 'lib/treetop/compiler/metagrammar.treetop' do |t|
|
23
|
+
unless $bootstrapped_gen_1_metagrammar
|
24
|
+
load File.join(File.dirname(__FILE__), 'lib', 'treetop', 'bootstrap_gen_1_metagrammar.rb')
|
25
|
+
end
|
26
|
+
|
27
|
+
Treetop::Compiler::GrammarCompiler.new.compile(METAGRAMMAR_PATH)
|
28
|
+
end
|
29
|
+
|
21
30
|
task :version do
|
22
31
|
puts RUBY_VERSION
|
23
32
|
end
|
data/bin/tt
CHANGED
@@ -3,9 +3,6 @@ module Treetop
|
|
3
3
|
class SyntaxNode
|
4
4
|
attr_reader :input, :interval
|
5
5
|
attr_accessor :parent
|
6
|
-
attr_reader :dot_id
|
7
|
-
|
8
|
-
@@dot_id_counter = 0
|
9
6
|
|
10
7
|
def initialize(input, interval, elements = nil)
|
11
8
|
@input = input
|
@@ -26,9 +23,6 @@ module Treetop
|
|
26
23
|
last_element = element
|
27
24
|
end
|
28
25
|
|
29
|
-
@dot_id = @@dot_id_counter
|
30
|
-
@@dot_id_counter += 1
|
31
|
-
|
32
26
|
@comprehensive_elements
|
33
27
|
end
|
34
28
|
|
@@ -90,8 +84,14 @@ module Treetop
|
|
90
84
|
)
|
91
85
|
end
|
92
86
|
|
87
|
+
@@dot_id_counter = 0
|
88
|
+
|
89
|
+
def dot_id
|
90
|
+
@dot_id ||= @@dot_id_counter += 1
|
91
|
+
end
|
92
|
+
|
93
93
|
def write_dot(io)
|
94
|
-
io.puts "node#{dot_id} [label=\"#{text_value}\"];"
|
94
|
+
io.puts "node#{dot_id} [label=\"'#{text_value}'\"];"
|
95
95
|
if nonterminal? then
|
96
96
|
elements.each do
|
97
97
|
|x|
|
data/lib/treetop/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: treetop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Sobo
|
@@ -9,7 +9,7 @@ autorequire: treetop
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-02-20 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
23
|
+
version: 0.3.0
|
24
24
|
version:
|
25
25
|
description:
|
26
26
|
email: nathansobo@gmail.com
|