diff options
author | Patrick Simianer <p@simianer.de> | 2014-06-12 14:29:51 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-06-12 14:29:51 +0200 |
commit | 7d267062cd109ac27cff8a818ff368b949d7f6a0 (patch) | |
tree | 56b043be1e4dd85987b5476644d2f6f7063e8d08 /grammar.rb | |
parent | a981df066484f799637c8a0b88209110038e3148 (diff) |
cleanup
Diffstat (limited to 'grammar.rb')
-rw-r--r-- | grammar.rb | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -15,7 +15,7 @@ end class NT attr_accessor :symbol, :index - def initialize symbol=nil, index=nil + def initialize symbol=nil, index=-1 @symbol = symbol @index = index end @@ -119,7 +119,7 @@ class Grammar @rules.map { |r| r.lhs.symbol }.select { |s| s != 'S' }.uniq.each { |symbol| @rules << Rule.new(NT.new('S'), [NT.new(symbol, 0)], [NT.new(symbol, 0)], [0]) @startn << @rules.last - @rules << Rule.new(NT.new('S'), [NT.new('S', 0), NT.new('X'), 1], [NT.new('S', 0), NT.new('X'), 1], [0, 1]) + @rules << Rule.new(NT.new('S'), [NT.new('S', 0), NT.new('X', 1)], [NT.new('S', 0), NT.new('X', 1)], [0, 1]) @startn << @rules.last } end |