Class: ValueType
- Inherits:
-
Object
- Object
- ValueType
- 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
-
#index ⇒ Object
Returns the value of attribute index.
-
#params ⇒ Object
Returns the value of attribute params.
-
#tag ⇒ Object
Returns the value of attribute tag.
Class Method Summary collapse
- .tbool ⇒ Object
- .tclass(c) ⇒ Object
- .tenum(e) ⇒ Object
- .tfloat ⇒ Object
- .tfunction ⇒ Object
- .tint ⇒ Object
- .tnull ⇒ Object
- .tobject ⇒ Object
- .tunknown ⇒ Object
Instance Method Summary collapse
- #==(a) ⇒ Object
-
#initialize(t, index, p = nil) ⇒ ValueType
constructor
A new instance of ValueType.
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
#index ⇒ Object
Returns the value of attribute index.
7 8 9 |
# File 'lib/lib/value_type.rb', line 7 def index @index end |
#params ⇒ Object
Returns the value of attribute params.
8 9 10 |
# File 'lib/lib/value_type.rb', line 8 def params @params end |
#tag ⇒ Object
Returns the value of attribute tag.
6 7 8 |
# File 'lib/lib/value_type.rb', line 6 def tag @tag end |
Class Method Details
.tbool ⇒ Object
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 |
.tfloat ⇒ Object
14 |
# File 'lib/lib/value_type.rb', line 14 def ValueType.tfloat() ValueType.new("TFloat",2) end |
.tfunction ⇒ Object
15 |
# File 'lib/lib/value_type.rb', line 15 def ValueType.tfunction() ValueType.new("TFunction",5) end |
.tint ⇒ Object
16 |
# File 'lib/lib/value_type.rb', line 16 def ValueType.tint() ValueType.new("TInt",1) end |
.tnull ⇒ Object
17 |
# File 'lib/lib/value_type.rb', line 17 def ValueType.tnull() ValueType.new("TNull",0) 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 |