Sha256: b6d21ab5057b4f65ccab5a99f7716ab6da98340bafd4c64f39e724b5cddf2030
Contents?: true
Size: 359 Bytes
Versions: 8
Compression:
Stored size: 359 Bytes
Contents
require File.join(File.dirname(__FILE__),"..","..","lib","babel_bridge") class TuringParser < BabelBridge::Parser rule :add, :int, "+", :add do def evaluate int.evaluate + add.evaluate end end rule :add, :int rule :int, /[-]?[0-9]+/ do def evaluate to_s.to_i end end end BabelBridge::Shell.new(TuringParser.new).start
Version data entries
8 entries across 8 versions & 1 rubygems