Class: Kwartz::Translator

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

Overview

.[abstract] translate list of Statement into target code (eRuby, PHP, …)

Direct Known Subclasses

BaseTranslator

Constant Summary collapse

@@class_table =
{}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get_class(lang) ⇒ Object



66
67
68
# File 'lib/kwartz/translator.rb', line 66

def self.get_class(lang)
  return @@class_table[lang]
end

.register_class(lang, klass) ⇒ Object



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

def self.register_class(lang, klass)
  @@class_table[lang] = klass
end

Instance Method Details

#translate(stmt_list) ⇒ Object

.[abstract] translate list of Statement into String and return it



23
24
25
# File 'lib/kwartz/translator.rb', line 23

def translate(stmt_list)
  not_implemented
end

#translate_native_expr(expr) ⇒ Object

.[abstract] translate NativeExpression using visitor pattern



41
42
43
# File 'lib/kwartz/translator.rb', line 41

def translate_native_expr(expr)
  not_implemented
end

#translate_native_stmt(stmt) ⇒ Object

.[abstract] translate NativeStatement using visitor pattern



29
30
31
# File 'lib/kwartz/translator.rb', line 29

def translate_native_stmt(stmt)
  not_implemented
end

#translate_print_stmt(stmt) ⇒ Object

.[abstract] translate PrintStatement using visitor pattern



35
36
37
# File 'lib/kwartz/translator.rb', line 35

def translate_print_stmt(stmt)
  not_implemented
end

#translate_string(str) ⇒ Object

.[abstract] translate String using visitor pattern



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

def translate_string(str)
  not_implemented
end