Class: Nendo::SourceInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/nendo/ruby/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSourceInfo

Returns a new instance of SourceInfo.



277
278
279
280
281
282
283
284
# File 'lib/nendo/ruby/types.rb', line 277

def initialize
  @varname       = nil
  @sourcefile    = nil
  @lineno        = nil
  @source_sexp   = Cell.new
  @expanded_sexp = Cell.new
  @compiled_str  = nil
end

Instance Attribute Details

#compiled_strObject (readonly)

Returns the value of attribute compiled_str.



316
317
318
# File 'lib/nendo/ruby/types.rb', line 316

def compiled_str
  @compiled_str
end

#expanded_sexpObject (readonly)

Returns the value of attribute expanded_sexp.



316
317
318
# File 'lib/nendo/ruby/types.rb', line 316

def expanded_sexp
  @expanded_sexp
end

#linenoObject (readonly)

Returns the value of attribute lineno.



316
317
318
# File 'lib/nendo/ruby/types.rb', line 316

def lineno
  @lineno
end

#source_sexpObject (readonly)

Returns the value of attribute source_sexp.



316
317
318
# File 'lib/nendo/ruby/types.rb', line 316

def source_sexp
  @source_sexp
end

#sourcefileObject (readonly)

Returns the value of attribute sourcefile.



316
317
318
# File 'lib/nendo/ruby/types.rb', line 316

def sourcefile
  @sourcefile
end

#varnameObject (readonly)

Returns the value of attribute varname.



316
317
318
# File 'lib/nendo/ruby/types.rb', line 316

def varname
  @varname
end

Instance Method Details

#debugPrintObject



308
309
310
311
312
313
314
# File 'lib/nendo/ruby/types.rb', line 308

def debugPrint
  printf( "=== sourceInfo === \n" )
  printf( "  varname       = %s\n", @varname )
  printf( "  sourcefile    = %s\n", @sourcefile )
  printf( "  lineno        = %s\n", @lineno)
  printf( "  compiled_str  = %s\n", @compiled_str )
end

#deepCopy(sexp) ⇒ Object



286
287
288
# File 'lib/nendo/ruby/types.rb', line 286

def deepCopy( sexp )
  Marshal.load(Marshal.dump( sexp ))
end

#setCompiled(compiled_str) ⇒ Object



304
305
306
# File 'lib/nendo/ruby/types.rb', line 304

def setCompiled( compiled_str )
  @compiled_str   = compiled_str
end

#setExpanded(expanded_sexp) ⇒ Object



300
301
302
# File 'lib/nendo/ruby/types.rb', line 300

def setExpanded( expanded_sexp )
  @expanded_sexp  = self.deepCopy( expanded_sexp )
end

#setSource(sourcefile, lineno, source_sexp) ⇒ Object



294
295
296
297
298
# File 'lib/nendo/ruby/types.rb', line 294

def setSource( sourcefile, lineno, source_sexp )
  @sourcefile     = sourcefile
  @lineno         = lineno
  @source_sexp    = self.deepCopy( source_sexp )
end

#setVarname(varname) ⇒ Object



290
291
292
# File 'lib/nendo/ruby/types.rb', line 290

def setVarname( varname )
  @varname        = varname
end