<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/simplesem/version.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -35,12 +35,12 @@ verbosity = 0   # by default do not print what is in Data
 
 opts.each do |opt, arg|
   case opt
-    when '-h'
-      RDoc::usage
-    when '-t'
-      verbosity = 1
-    when '-v'
-      verbosity = 2
+  when '-h'
+    RDoc::usage
+  when '-t'
+    verbosity = 1
+  when '-v'
+    verbosity = 2
   end
 end
 
@@ -49,11 +49,12 @@ if ARGV.length != 1
   exit 0
 end
 
-ssp = SimpleSemProgram.new(ARGV.shift)
+ssp = SimpleSem::Program.new(ARGV.shift)
 ssp.run
 
-if (verbosity == 1)
+case verbosity
+when 1
   puts &quot;\nDATA: \n&quot; + ssp.inspect_data
-elsif (verbosity == 2)
+when 2
   puts &quot;\nDATA: \n&quot; + ssp.inspect_data_with_history
 end</diff>
      <filename>bin/simplesem</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,2 @@
+require 'simplesem/version'
 require 'simplesem/simplesem_program'</diff>
      <filename>lib/simplesem.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,99 +1,101 @@
-grammar Arithmetic  
-  rule expression
-    comparative / additive
-  end
-  
-  rule comparative
-    operand_1:additive space operator:comparison_op space operand_2:additive &lt;BinaryOperation&gt;
-  end
-  
-  rule comparison_op
-    '&gt;=' {
-      def apply(a, b)
-        a &gt;= b
-      end
-    }
-    /
-    '&lt;=' {
-      def apply(a, b)
-        a &lt;= b
-      end
-    }
-    /
-    '&gt;' {
-      def apply(a, b)
-        a &gt; b
-      end
-    }
-    /
-    '&lt;' {
-      def apply(a, b)
-        a &lt; b
-      end
-    }
-    /
-    '!=' {
-      def apply(a, b)
-        a != b
-      end
-    }
-    /
-    '=' {
-      def apply(a, b)
-        a == b
-      end
-    }
-  end
-  
-  rule additive
-    operand_1:multitive space operator:additive_op space operand_2:additive &lt;BinaryOperation&gt;
-    /
-    multitive
-  end
-  
-  rule additive_op
-    '+' {
-      def apply(a, b)
-        a + b
-      end
-    }
-    /
-    '-' {
-      def apply(a, b)
-        a - b
-      end
-    }
-  end
+module SimpleSem
+  grammar Arithmetic
+    rule expression
+      comparative / additive
+    end
 
-  rule multitive
-    operand_1:primary space operator:multitive_op space operand_2:multitive &lt;BinaryOperation&gt;
-    /
-    primary
-  end
-  
-  rule multitive_op
-    '*' {
-      def apply(a, b)
-        a * b
-      end
-    }
-    /
-    '/' {
-      def apply(a, b)
-        a / b
-      end
-    }
-  end  
+    rule comparative
+      operand_1:additive space operator:comparison_op space operand_2:additive &lt;BinaryOperation&gt;
+    end
 
-  rule number
-    ('-'? [1-9] [0-9]* / '0') {
-      def eval(env={})
-        text_value.to_i
-      end
-    }
-  end
-  
-  rule space
-    ' '*
+    rule comparison_op
+      '&gt;=' {
+        def apply(a, b)
+          a &gt;= b
+        end
+      }
+      /
+      '&lt;=' {
+        def apply(a, b)
+          a &lt;= b
+        end
+      }
+      /
+      '&gt;' {
+        def apply(a, b)
+          a &gt; b
+        end
+      }
+      /
+      '&lt;' {
+        def apply(a, b)
+          a &lt; b
+        end
+      }
+      /
+      '!=' {
+        def apply(a, b)
+          a != b
+        end
+      }
+      /
+      '=' {
+        def apply(a, b)
+          a == b
+        end
+      }
+    end
+
+    rule additive
+      operand_1:multitive space operator:additive_op space operand_2:additive &lt;BinaryOperation&gt;
+      /
+      multitive
+    end
+
+    rule additive_op
+      '+' {
+        def apply(a, b)
+          a + b
+        end
+      }
+      /
+      '-' {
+        def apply(a, b)
+          a - b
+        end
+      }
+    end
+
+    rule multitive
+      operand_1:primary space operator:multitive_op space operand_2:multitive &lt;BinaryOperation&gt;
+      /
+      primary
+    end
+
+    rule multitive_op
+      '*' {
+        def apply(a, b)
+          a * b
+        end
+      }
+      /
+      '/' {
+        def apply(a, b)
+          a / b
+        end
+      }
+    end
+
+    rule number
+      ('-'? [1-9] [0-9]* / '0') {
+        def eval(env={})
+          text_value.to_i
+        end
+      }
+    end
+
+    rule space
+      ' '*
+    end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/simplesem/arithmetic.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,11 @@
-module Arithmetic
-  class BinaryOperation &lt; Treetop::Runtime::SyntaxNode
-    def eval(env={})
-      operator.apply(operand_1.eval(env), operand_2.eval(env))      
+module SimpleSem
+  module Arithmetic
+
+    class BinaryOperation &lt; Treetop::Runtime::SyntaxNode
+      def eval(env={})
+        operator.apply(operand_1.eval(env), operand_2.eval(env))
+      end
     end
+
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/simplesem/arithmetic_node_classes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,117 +1,118 @@
-grammar SimpleSem
-  include Arithmetic
-  
-  rule statement
-    set_stmt / jump_stmt / jumpt_stmt / halt
-  end
-  
-  rule halt
-    'halt' {
-      def execute(env={})
-        raise ProgramHalt
-      end
-    }
-  end
-  
-  rule set_stmt
-    set_stmt_assign / set_stmt_write / set_stmt_read
-  end
+module SimpleSem
+  grammar SimpleSem
+    include Arithmetic
+
+    rule statement
+      set_stmt / jump_stmt / jumpt_stmt / halt
+    end
 
-  rule set_stmt_assign
-    'set' space loc:additive comma value:additive {
-      def execute(env)
-        evaled_loc = loc.eval(env)
-        evaled_value = value.eval(env)
-        if env.data[evaled_loc].nil?
-            env.data[evaled_loc] = Array[evaled_value]
-        else
-            env.data[evaled_loc] &lt;&lt; evaled_value
+    rule halt
+      'halt' {
+        def execute(env={})
+          raise ProgramHalt
         end
-      end
-    }
-  end
-  
-  rule set_stmt_write
-    'set' space 'write' comma expression {
-      def execute(env)
-        puts expression.eval(env)
-      end
-    }
-    /
-    'set' space 'write' comma '&quot;' string:(!'&quot;' . )* '&quot;' {
-      def execute(env)
-        puts string.text_value
-      end
-    }
-  end
-  
-  rule set_stmt_read
-    'set' space loc:additive comma 'read' {
-      def execute(env)
-        print &quot;input: &quot;
-        
-        evaled_loc = loc.eval(env)
-        input_value = $stdin.gets.strip.to_i
-        
-        if env.data[evaled_loc].nil?
-            env.data[evaled_loc] = Array[input_value]
-        else
-            env.data[evaled_loc] &lt;&lt; input_value
+      }
+    end
+
+    rule set_stmt
+      set_stmt_assign / set_stmt_write / set_stmt_read
+    end
+
+    rule set_stmt_assign
+      'set' space loc:additive comma value:additive {
+        def execute(env)
+          evaled_loc = loc.eval(env)
+          evaled_value = value.eval(env)
+          if env.data[evaled_loc].nil?
+              env.data[evaled_loc] = Array[evaled_value]
+          else
+              env.data[evaled_loc] &lt;&lt; evaled_value
+          end
         end
-      end  
-    }
-  end
-  
-  rule jump_stmt
-    'jump' space loc:additive {
-      def execute(env)
-        env.pc = loc.eval(env)
-      end
-    }
-  end
-  
-  rule jumpt_stmt
-    'jumpt' space loc:additive comma expression {
-      def execute(env)
-        if expression.eval(env)
+      }
+    end
+
+    rule set_stmt_write
+      'set' space 'write' comma expression {
+        def execute(env)
+          puts expression.eval(env)
+        end
+      }
+      /
+      'set' space 'write' comma '&quot;' string:(!'&quot;' . )* '&quot;' {
+        def execute(env)
+          puts string.text_value
+        end
+      }
+    end
+
+    rule set_stmt_read
+      'set' space loc:additive comma 'read' {
+        def execute(env)
+          print &quot;input: &quot;
+
+          evaled_loc = loc.eval(env)
+          input_value = $stdin.gets.strip.to_i
+
+          if env.data[evaled_loc].nil?
+              env.data[evaled_loc] = Array[input_value]
+          else
+              env.data[evaled_loc] &lt;&lt; input_value
+          end
+        end
+      }
+    end
+
+    rule jump_stmt
+      'jump' space loc:additive {
+        def execute(env)
           env.pc = loc.eval(env)
         end
-      end
-    }
-  end
-  
-  rule primary
-    ip
-    /
-    data_lookup
-    /
-    number
-    /
-    '(' space expression space ')' {
-      def eval(env={})
-        expression.eval(env)
-      end
-    }
-  end
-  
-  rule data_lookup
-    'D[' expr:additive ']' {
-      def eval(env)
-        env.data[expr.eval(env)].last
-      end
-    }
-  end
-  
-  rule ip
-    'ip' {
-      def eval(env)
-        env.pc
-      end
-    }
-  end
-  
-  rule comma
-    space ',' space
+      }
+    end
+
+    rule jumpt_stmt
+      'jumpt' space loc:additive comma expression {
+        def execute(env)
+          if expression.eval(env)
+            env.pc = loc.eval(env)
+          end
+        end
+      }
+    end
+
+    rule primary
+      ip
+      /
+      data_lookup
+      /
+      number
+      /
+      '(' space expression space ')' {
+        def eval(env={})
+          expression.eval(env)
+        end
+      }
+    end
+
+    rule data_lookup
+      'D[' expr:additive ']' {
+        def eval(env)
+          env.data[expr.eval(env)].last
+        end
+      }
+    end
+
+    rule ip
+      'ip' {
+        def eval(env)
+          env.pc
+        end
+      }
+    end
+
+    rule comma
+      space ',' space
+    end
   end
-  
-end
\ No newline at end of file
+end</diff>
      <filename>lib/simplesem/simple_sem.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -4,53 +4,56 @@ dir = File.dirname(__FILE__)
 Treetop.load File.expand_path(File.join(dir, 'arithmetic'))
 Treetop.load File.expand_path(File.join(dir, 'simple_sem'))
 
-class ProgramHalt &lt; Exception
-end
+module SimpleSem
+
+  class ProgramHalt &lt; Exception
+  end
+
+  class Program
+    attr_reader :code
+    attr_accessor :data, :pc
 
-class SimpleSemProgram
-  attr_reader :code
-  attr_accessor :data, :pc
-  
-  # Create a SimpleSemProgram instance
-  # Params:
-  #   (String)filepath: path to SimpleSem source file.
-  #   Optional because it's useful to use in tests without needing to load a file
-  def initialize filepath=nil
-    @code = Array.new
-    if filepath
-      IO.foreach(filepath) do |line|
-        @code &lt;&lt; line.split(&quot;//&quot;, 2)[0].strip # seperate the comment from the code
+    # Create a SimpleSemProgram instance
+    # Params:
+    #   (String)filepath: path to SimpleSem source file.
+    #   Optional because it's useful to use in tests without needing to load a file
+    def initialize filepath=nil
+      @code = Array.new
+      if filepath
+        IO.foreach(filepath) do |line|
+          @code &lt;&lt; line.split(&quot;//&quot;, 2)[0].strip # seperate the comment from the code
+        end
       end
+
+      @data = Array.new
+      @pc = 0
     end
-    
-    @data = Array.new
-    @pc = 0
-  end
-  
-  def run
-    @parser = SimpleSemParser.new
-    
-    @pc = 0
-    loop do
-      instruction = @code[@pc]  # fetch
-      @pc += 1                  # increment
-      begin
-        @parser.parse(instruction).execute(self)  # decode and execute
-      rescue ProgramHalt
-        break
+
+    def run
+      @parser = SimpleSemParser.new
+
+      @pc = 0
+      loop do
+        instruction = @code[@pc]  # fetch
+        @pc += 1                  # increment
+        begin
+          @parser.parse(instruction).execute(self)  # decode and execute
+        rescue ProgramHalt
+          break
+        end
       end
     end
-  end
-  
-  def inspect_data
-    res = String.new
-    @data.each_with_index {|loc, i| res += &quot;#{i}: #{loc.last}\n&quot; }
-    res
-  end
-  
-  def inspect_data_with_history
-    res = String.new
-    @data.each_with_index {|loc, i| res += &quot;#{i}: #{loc.inspect}\n&quot; }
-    res
+
+    def inspect_data
+      res = String.new
+      @data.each_with_index {|loc, i| res += &quot;#{i}: #{loc.last}\n&quot; }
+      res
+    end
+
+    def inspect_data_with_history
+      res = String.new
+      @data.each_with_index {|loc, i| res += &quot;#{i}: #{loc.inspect}\n&quot; }
+      res
+    end
   end
 end</diff>
      <filename>lib/simplesem/simplesem_program.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,10 +5,14 @@ class SimpleSemParserTest &lt; Test::Unit::TestCase
   include ParserTestHelper
   
   def setup
-    @parser = SimpleSemParser.new
-    @ssp = SimpleSemProgram.new
+    @parser = SimpleSem::SimpleSemParser.new
+    @ssp = SimpleSem::Program.new
     @ssp.data[0] = [1]
   end
+
+  def test_version_constant_is_set
+    assert_not_nil SimpleSem::VERSION
+  end
   
   def test_set_stmt_assign
     parse('set 1, D[0]').execute(@ssp)
@@ -129,7 +133,7 @@ class SimpleSemParserTest &lt; Test::Unit::TestCase
   end
   
   def test_halt
-    assert_raise ProgramHalt do
+    assert_raise SimpleSem::ProgramHalt do
       parse('halt').execute(@ssp)
     end
   end</diff>
      <filename>test/simplesem_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>300a5b9e9aee72aeff1abd42ee3efc9522511c10</id>
    </parent>
  </parents>
  <author>
    <name>Rob Olson</name>
    <email>rob@thinkingdigitally.com</email>
  </author>
  <url>http://github.com/robolson/simplesem/commit/4880d123faaa45376e121b4c5eea35c46124aaf8</url>
  <id>4880d123faaa45376e121b4c5eea35c46124aaf8</id>
  <committed-date>2009-09-26T23:58:37-07:00</committed-date>
  <authored-date>2009-09-26T19:48:49-07:00</authored-date>
  <message>Namespace all classes inside of a SimpleSem module.

Namespace all classes inside of a SimpleSem module. Add a SimpleSem::VERSION constant.</message>
  <tree>bccdcb74cb0af9e1d17901c868715a0e17fd987f</tree>
  <committer>
    <name>Rob Olson</name>
    <email>rob@thinkingdigitally.com</email>
  </committer>
</commit>
