Skip to content

Commit

Permalink
Most loading but doing nothing with what it loads
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed May 30, 2014
1 parent dae5ac3 commit 4119749
Show file tree
Hide file tree
Showing 15 changed files with 520 additions and 0 deletions.
21 changes: 21 additions & 0 deletions bin/alienist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env ruby

require 'optparse'
require 'alienist/parser'
require 'alienist/reader'

debug = 0

opts = OptionParser.new do |opts|
opts.banner = "Usage: alienist [options] dump_file"
opts.on("-d", "--debug value", "turn on debugging") do |v|
debug = v.to_i
end
end
opts.parse!(ARGV)

File.open(ARGV.shift, "rb") do |io|
dump = Alienist::Parser.new Alienist::Reader.new(io, debug), debug
dump.parse
# p dump
end
9 changes: 9 additions & 0 deletions lib/alienist/model/java_boolean.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'alienist/model/java_primitive'

module Alienist
class JavaBoolean < Alienist::JavaPrimitive
def self.parse(reader)
new reader.read_boolean
end
end
end
9 changes: 9 additions & 0 deletions lib/alienist/model/java_byte.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'alienist/model/java_primitive'

module Alienist
class JavaByte < Alienist::JavaPrimitive
def self.parse(reader)
new reader.read_byte
end
end
end
9 changes: 9 additions & 0 deletions lib/alienist/model/java_char.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'alienist/model/java_primitive'

module Alienist
class JavaChar < Alienist::JavaPrimitive
def self.parse(reader)
new reader.read_char
end
end
end
9 changes: 9 additions & 0 deletions lib/alienist/model/java_double.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'alienist/model/java_primitive'

module Alienist
class JavaDouble < Alienist::JavaPrimitive
def self.parse(reader)
new reader.read_double
end
end
end
6 changes: 6 additions & 0 deletions lib/alienist/model/java_field.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Alienist
class JavaField
def initialize(*r)
end
end
end
9 changes: 9 additions & 0 deletions lib/alienist/model/java_float.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'alienist/model/java_primitive'

module Alienist
class JavaFloat < Alienist::JavaPrimitive
def self.parse(reader)
new reader.read_float
end
end
end
9 changes: 9 additions & 0 deletions lib/alienist/model/java_int.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'alienist/model/java_primitive'

module Alienist
class JavaInt < Alienist::JavaPrimitive
def self.parse(reader)
new reader.read_int
end
end
end
9 changes: 9 additions & 0 deletions lib/alienist/model/java_long.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'alienist/model/java_primitive'

module Alienist
class JavaLong < Alienist::JavaPrimitive
def self.parse(reader)
new reader.read_long
end
end
end
13 changes: 13 additions & 0 deletions lib/alienist/model/java_object_ref.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Alienist
class JavaObjectRef
attr_reader :value

def initialize(value)
@value = value
end

def self.parse(reader)
new reader.read_id
end
end
end
9 changes: 9 additions & 0 deletions lib/alienist/model/java_primitive.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Alienist
class JavaPrimitive
attr_reader :value

def initialize(value)
@value = value
end
end
end
15 changes: 15 additions & 0 deletions lib/alienist/model/java_short.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'alienist/model/java_primitive'

module Alienist
class JavaShort
attr_reader :value

def initialize(value)
@value = value
end

def self.parse(reader)
Alienist::JavaShort.new reader.read_short
end
end
end
6 changes: 6 additions & 0 deletions lib/alienist/model/java_static.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Alienist
class JavaStatic
def initialize(*r)
end
end
end
Loading

0 comments on commit 4119749

Please sign in to comment.