diff options
author | Patrick Simianer <p@simianer.de> | 2014-06-18 08:28:36 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-06-18 08:28:36 +0200 |
commit | d92209e3ec223a380c7ad540622caa15712c490c (patch) | |
tree | 91f985fc2d9726a4d1e9f7c86e17cbf7dd2b6ee6 /grammar.rb | |
parent | ae3bc3e1870d009c4d54c55416ebb4b7c07a483f (diff) |
better integration, chart.to_json
Diffstat (limited to 'grammar.rb')
-rw-r--r-- | grammar.rb | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -93,8 +93,10 @@ class Grammar def initialize fn @rules = []; @startn = []; @startt = []; @flat = [] + n = 0 ReadFile.readlines_strip(fn).each_with_index { |s,i| - STDERR.write '.'; STDERR.write " #{i+1}\n" if (i+1)%80==0 + STDERR.write '.'; STDERR.write " #{i+1}\n" if (i+1)%40==0 + n += 1 @rules << Rule.from_s(s) if @rules.last.rhs.first.class == NT @startn << @rules.last @@ -106,7 +108,7 @@ class Grammar end end } - STDERR.write "\n" + STDERR.write " #{n}\n" end def to_s @@ -131,5 +133,5 @@ class Grammar end -end # module +end #module |