Class: RubyRTL::Sig
Overview
further defined in dsl.rb attributes :
-
type
-
subscript_of
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#subscript_of ⇒ Object
Returns the value of attribute subscript_of.
-
#subsignals ⇒ Object
Returns the value of attribute subsignals.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Ast
Instance Method Summary collapse
- #!=(other) ⇒ Object
-
#!@ ⇒ Object
unary expressions.
- #&(other) ⇒ Object
- #*(other) ⇒ Object
-
#+(other) ⇒ Object
arith.
- #-(other) ⇒ Object
- #-@ ⇒ Object
- #/(other) ⇒ Object
-
#<(other) ⇒ Object
comparison.
- #<=(other) ⇒ Object
- #==(other) ⇒ Object
- #>(other) ⇒ Object
- #>=(other) ⇒ Object
- #[](index) ⇒ Object
- #^(other) ⇒ Object
- #coerce(other) ⇒ Object
-
#initialize(name, type = :bit) ⇒ Sig
constructor
A new instance of Sig.
- #treat_int(other) ⇒ Object
- #|(other) ⇒ Object
Methods inherited from Ast
Constructor Details
#initialize(name, type = :bit) ⇒ Sig
Returns a new instance of Sig.
57 58 59 60 |
# File 'lib/ruby_rtl/dsl.rb', line 57 def initialize name,type=:bit @name=name @type=build_type(type) end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
52 53 54 |
# File 'lib/ruby_rtl/dsl.rb', line 52 def name @name end |
#subscript_of ⇒ Object
Returns the value of attribute subscript_of.
54 55 56 |
# File 'lib/ruby_rtl/dsl.rb', line 54 def subscript_of @subscript_of end |
#subsignals ⇒ Object
Returns the value of attribute subsignals.
55 56 57 |
# File 'lib/ruby_rtl/dsl.rb', line 55 def subsignals @subsignals end |
#type ⇒ Object
Returns the value of attribute type.
53 54 55 |
# File 'lib/ruby_rtl/dsl.rb', line 53 def type @type end |
Instance Method Details
#!=(other) ⇒ Object
138 139 140 141 |
# File 'lib/ruby_rtl/dsl.rb', line 138 def !=(other) other=treat_int(other) Binary.new(self,"!=",other) end |
#!@ ⇒ Object
unary expressions
144 145 146 |
# File 'lib/ruby_rtl/dsl.rb', line 144 def !@ Unary.new("!",self) end |
#&(other) ⇒ Object
82 83 84 85 |
# File 'lib/ruby_rtl/dsl.rb', line 82 def &(other) other=treat_int(other) Binary.new(self,"&",other) end |
#*(other) ⇒ Object
128 129 130 131 |
# File 'lib/ruby_rtl/dsl.rb', line 128 def *(other) other=treat_int(other) Binary.new(self,"*",other) end |
#+(other) ⇒ Object
arith
118 119 120 121 |
# File 'lib/ruby_rtl/dsl.rb', line 118 def +(other) other=treat_int(other) Binary.new(self,"+",other) end |
#-(other) ⇒ Object
123 124 125 126 |
# File 'lib/ruby_rtl/dsl.rb', line 123 def -(other) other=treat_int(other) Binary.new(self,"-",other) end |
#-@ ⇒ Object
148 149 150 |
# File 'lib/ruby_rtl/dsl.rb', line 148 def -@ Unary.new("-",self) end |
#/(other) ⇒ Object
133 134 135 136 |
# File 'lib/ruby_rtl/dsl.rb', line 133 def /(other) other=treat_int(other) Binary.new(self,"/",other) end |
#<(other) ⇒ Object
comparison
93 94 95 96 |
# File 'lib/ruby_rtl/dsl.rb', line 93 def <(other) other=treat_int(other) Binary.new(self,"<",other) end |
#<=(other) ⇒ Object
98 99 100 101 |
# File 'lib/ruby_rtl/dsl.rb', line 98 def <=(other) other=treat_int(other) Binary.new(self,"<=",other) end |
#==(other) ⇒ Object
113 114 115 116 |
# File 'lib/ruby_rtl/dsl.rb', line 113 def ==(other) other=treat_int(other) Binary.new(self,"==",other) end |
#>(other) ⇒ Object
103 104 105 106 |
# File 'lib/ruby_rtl/dsl.rb', line 103 def >(other) other=treat_int(other) Binary.new(self,"<",other) end |
#>=(other) ⇒ Object
108 109 110 111 |
# File 'lib/ruby_rtl/dsl.rb', line 108 def >=(other) other=treat_int(other) Binary.new(self,"<=",other) end |
#[](index) ⇒ Object
152 153 154 155 156 |
# File 'lib/ruby_rtl/dsl.rb', line 152 def [](index) @indexed||={} index=treat_int(index) @indexed[index.to_s]||=Indexed.new(self,index,@type.type) end |
#^(other) ⇒ Object
87 88 89 90 |
# File 'lib/ruby_rtl/dsl.rb', line 87 def ^(other) other=treat_int(other) Binary.new(self,"^",other) end |
#coerce(other) ⇒ Object
158 159 160 |
# File 'lib/ruby_rtl/dsl.rb', line 158 def coerce(other) [IntLit.new(other), self] end |
#treat_int(other) ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/ruby_rtl/dsl.rb', line 62 def treat_int(other) case other when Integer if other >=0 #return UIntLit.new(other) return RUIntLit.new(other) else #return IntLit.new(other) return RIntLit.new(other) end else return other end end |
#|(other) ⇒ Object
77 78 79 80 |
# File 'lib/ruby_rtl/dsl.rb', line 77 def |(other) other=treat_int(other) Binary.new(self,"|",other) end |