Class: Kwartz::NativeStatement
- Defined in:
- lib/kwartz/node.rb
Overview
represents statement in target language code
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#no_newline ⇒ Object
Returns the value of attribute no_newline.
Class Method Summary collapse
Instance Method Summary collapse
- #_inspect(indent = 0) ⇒ Object
- #accept(translator) ⇒ Object
-
#initialize(code, kind = nil) ⇒ NativeStatement
constructor
A new instance of NativeStatement.
Constructor Details
#initialize(code, kind = nil) ⇒ NativeStatement
Returns a new instance of NativeStatement.
112 113 114 115 |
# File 'lib/kwartz/node.rb', line 112 def initialize(code, kind=nil) @code = code @kind = kind end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
116 117 118 |
# File 'lib/kwartz/node.rb', line 116 def code @code end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
116 117 118 |
# File 'lib/kwartz/node.rb', line 116 def kind @kind end |
#no_newline ⇒ Object
Returns the value of attribute no_newline.
117 118 119 |
# File 'lib/kwartz/node.rb', line 117 def no_newline @no_newline end |
Class Method Details
.new_without_newline(code, kind = nil) ⇒ Object
120 121 122 123 124 |
# File 'lib/kwartz/node.rb', line 120 def self.new_without_newline(code, kind=nil) stmt = self.new(code, kind) stmt.no_newline = true return stmt end |
Instance Method Details
#_inspect(indent = 0) ⇒ Object
127 128 129 |
# File 'lib/kwartz/node.rb', line 127 def _inspect(indent=0) return "<%#{@code}%>\n" end |
#accept(translator) ⇒ Object
132 133 134 |
# File 'lib/kwartz/node.rb', line 132 def accept(translator) translator.translate_native_stmt(self) end |