Class: Mirah::Transform::Transformer

Inherits:
Object
  • Object
show all
Defined in:
lib/mirah/transform/transformer.rb

Defined Under Namespace

Classes: JMetaPosition

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state, typer) ⇒ Transformer

Returns a new instance of Transformer.



28
29
30
31
32
33
34
35
36
37
# File 'lib/mirah/transform/transformer.rb', line 28

def initialize(state, typer)
  @errors = []
  @tmp_count = 0
  @annotations = []
  @extra_body = nil
  @state = state
  @typer = typer
  @types = typer.type_system if typer
  @files = {""=>{:filename => "", :line => 0, :code => ""}}
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



25
26
27
# File 'lib/mirah/transform/transformer.rb', line 25

def errors
  @errors
end

#filenameObject

Returns the value of attribute filename.



26
27
28
# File 'lib/mirah/transform/transformer.rb', line 26

def filename
  @filename
end

#stateObject (readonly)

Returns the value of attribute state.



25
26
27
# File 'lib/mirah/transform/transformer.rb', line 25

def state
  @state
end

Instance Method Details

#tmp(format = "__xform_tmp_%d") ⇒ Object



39
40
41
# File 'lib/mirah/transform/transformer.rb', line 39

def tmp(format="__xform_tmp_%d")
  format % [@tmp_count += 1]
end