Class: Kwartz::NativeExpression

Inherits:
Expression show all
Defined in:
lib/kwartz/node.rb

Overview

represents expression in target language code

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, escape = nil) ⇒ NativeExpression

Returns a new instance of NativeExpression.



46
47
48
49
# File 'lib/kwartz/node.rb', line 46

def initialize(code, escape=nil)
  @code = code
  @escape = escape unless escape == nil
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



50
51
52
# File 'lib/kwartz/node.rb', line 50

def code
  @code
end

#escapeObject Also known as: escape?

Returns the value of attribute escape.



51
52
53
# File 'lib/kwartz/node.rb', line 51

def escape
  @escape
end

Instance Method Details

#_inspect(indent = 0) ⇒ Object



56
57
58
# File 'lib/kwartz/node.rb', line 56

def _inspect(indent=0)
  return @code
end

#accept(translator) ⇒ Object



61
62
63
# File 'lib/kwartz/node.rb', line 61

def accept(translator)
  translator.translate_native_expr(self)
end