Permalink
Browse files

Initial commit.

This code dates from between Nov 2005 and Sep 2006.

And it's a mess.
  • Loading branch information...
0 parents commit b1e075a4e668b185b67c63958cb543f6db9ef0da @matthewd committed Oct 23, 2010
Showing with 3,142 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +75 −0 convertor.rb
  3. +15 −0 foo.asp
  4. +371 −0 parser.rb
  5. +1,258 −0 rasp.rb
  6. +79 −0 reformat.rb
  7. +391 −0 reformat.y
  8. +168 −0 run.rb
  9. +20 −0 t/class.vbs
  10. +18 −0 t/math.vbs
  11. +20 −0 t/math2.vbs
  12. +4 −0 t/meta/error.vbs
  13. +1 −0 t/meta/happy.vbs
  14. +1 −0 t/meta/loop.vbs
  15. +4 −0 t/meta/zero.vbs
  16. +5 −0 t/perf/rand1.vbs
  17. +8 −0 t/perf/str.vbs
  18. +32 −0 t/samples/style.css
  19. +58 −0 t/samples/test.vbs
  20. +32 −0 t/samples/test2.vbs
  21. +37 −0 t/samples/test3.asp
  22. +6 −0 t/samples/test3.vbs
  23. +8 −0 t/samples/test4.asp
  24. +9 −0 t/samples/test4.vbs
  25. +20 −0 t/samples/test5.vbs
  26. +7 −0 t/samples/test6.vbs
  27. +58 −0 test.sh
  28. +409 −0 vbscript.y
  29. +24 −0 xyzzy.rb
@@ -0,0 +1,4 @@
+*.output
+*.tab.rb
+*.aspc
+*.vbsc
@@ -0,0 +1,75 @@
+require 'syntax/convertors/abstract'
+
+module Syntax
+ module Convertors
+ class Meta < Abstract
+ def type= new_type
+ @tokenizer.type = new_type
+ end
+ def type
+ @tokenizer.type
+ end
+ def virtual_root= new_value
+ @tokenizer.virtual_root = new_value
+ end
+ def virtual_root; @tokenizer.virtual_root; end
+ def follow_includes= new_value
+ @tokenizer.follow_includes = new_value
+ end
+ def swallow= new_value
+ @tokenizer.swallow = new_value
+ end
+ attr_accessor :start_group
+ def convert text, filename
+ @tokenizer.filename = filename
+ @tokenizer.start( text ) do |token|
+ start_group.call token.group, token
+ end
+ @tokenizer.step until @tokenizer.eos?
+ @tokenizer.finish
+ end
+ end
+ class CodeTree < Abstract
+ def type= new_type
+ @tokenizer.type = new_type
+ end
+ def type
+ @tokenizer.type
+ end
+ def virtual_root; @tokenizer.virtual_root; end
+ def virtual_root= new_value
+ @tokenizer.virtual_root = new_value
+ end
+ def follow_includes= new_value
+ @tokenizer.follow_includes = new_value
+ end
+ def swallow= new_value
+ @tokenizer.swallow = new_value
+ end
+ def convert text, filename
+ @text = text
+ @filename = filename
+ VbScriptRaccParser.new.run_parse self, :go
+ end
+ def go
+ @tokenizer.filename = @filename
+ @tokenizer.start( @text ) do |token|
+ if $DEBUG
+ if token.group.is_a? Symbol then
+ puts "Yielding :#{token.group} for '#{token}'"
+ else
+ puts "Yielding characters for '#{token}'"
+ end
+ end
+ yield [token.group, token] unless token.group == :token_sep
+ end
+ @tokenizer.step until @tokenizer.eos?
+ @tokenizer.finish
+ puts "Yielding final :fake_newline" if $DEBUG
+ yield [:fake_newline, nil]
+ puts "Yielding EOF" if $DEBUG
+ yield [false, false]
+ end
+ end
+ end
+end
15 foo.asp
@@ -0,0 +1,15 @@
+<%
+
+Dim o
+Set o = Server.CreateObject("Scripting.Dictionary")
+
+o.Add "foo", "bar"
+o.Add "baz", "quux"
+
+Response.Write o("foo") & vbCrLf & vbCrLf
+
+o("foo") = o("baz")
+
+Response.Write o("foo")
+
+%>
Oops, something went wrong.

0 comments on commit b1e075a

Please sign in to comment.