Class: ValueType

Inherits:
Object
  • Object
show all
Defined in:
lib/lib/value_type.rb

Constant Summary collapse

ISENUM__ =
true
CONSTRUCTS__ =
["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(t, index, p = nil) ⇒ ValueType

Returns a new instance of ValueType.



9
# File 'lib/lib/value_type.rb', line 9

def initialize(t,index,p = nil ) @tag = t; @index = index; @params = p; end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



7
8
9
# File 'lib/lib/value_type.rb', line 7

def index
  @index
end

#paramsObject

Returns the value of attribute params.



8
9
10
# File 'lib/lib/value_type.rb', line 8

def params
  @params
end

#tagObject

Returns the value of attribute tag.



6
7
8
# File 'lib/lib/value_type.rb', line 6

def tag
  @tag
end

Class Method Details

.tboolObject



11
# File 'lib/lib/value_type.rb', line 11

def ValueType.tbool() ValueType.new("TBool",3) end

.tclass(c) ⇒ Object



12
# File 'lib/lib/value_type.rb', line 12

def ValueType.tclass(c)  ValueType.new("TClass",6,[c]) end

.tenum(e) ⇒ Object



13
# File 'lib/lib/value_type.rb', line 13

def ValueType.tenum(e)  ValueType.new("TEnum",7,[e]) end

.tfloatObject



14
# File 'lib/lib/value_type.rb', line 14

def ValueType.tfloat() ValueType.new("TFloat",2) end

.tfunctionObject



15
# File 'lib/lib/value_type.rb', line 15

def ValueType.tfunction() ValueType.new("TFunction",5) end

.tintObject



16
# File 'lib/lib/value_type.rb', line 16

def ValueType.tint() ValueType.new("TInt",1) end

.tnullObject



17
# File 'lib/lib/value_type.rb', line 17

def ValueType.tnull() ValueType.new("TNull",0) end

.tobjectObject



18
# File 'lib/lib/value_type.rb', line 18

def ValueType.tobject() ValueType.new("TObject",4) end

.tunknownObject



19
# File 'lib/lib/value_type.rb', line 19

def ValueType.tunknown() ValueType.new("TUnknown",8) end

Instance Method Details

#==(a) ⇒ Object



21
# File 'lib/lib/value_type.rb', line 21

def ==(a) (!a.nil?) && (a.respond_to? 'ISENUM__') && a.tag === @tag && a.index === @index && a.params == @params end