Class: Nendo::SourceInfo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSourceInfo

Returns a new instance of SourceInfo.



206
207
208
209
210
211
212
213
# File 'lib/nendo.rb', line 206

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.



245
246
247
# File 'lib/nendo.rb', line 245

def compiled_str
  @compiled_str
end

#expanded_sexpObject (readonly)

Returns the value of attribute expanded_sexp.



245
246
247
# File 'lib/nendo.rb', line 245

def expanded_sexp
  @expanded_sexp
end

#linenoObject (readonly)

Returns the value of attribute lineno.



245
246
247
# File 'lib/nendo.rb', line 245

def lineno
  @lineno
end

#source_sexpObject (readonly)

Returns the value of attribute source_sexp.



245
246
247
# File 'lib/nendo.rb', line 245

def source_sexp
  @source_sexp
end

#sourcefileObject (readonly)

Returns the value of attribute sourcefile.



245
246
247
# File 'lib/nendo.rb', line 245

def sourcefile
  @sourcefile
end

#varnameObject (readonly)

Returns the value of attribute varname.



245
246
247
# File 'lib/nendo.rb', line 245

def varname
  @varname
end

Instance Method Details

#debugPrintObject



237
238
239
240
241
242
243
# File 'lib/nendo.rb', line 237

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



215
216
217
# File 'lib/nendo.rb', line 215

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

#setCompiled(compiled_str) ⇒ Object



233
234
235
# File 'lib/nendo.rb', line 233

def setCompiled( compiled_str )
  @compiled_str   = compiled_str
end

#setExpanded(expanded_sexp) ⇒ Object



229
230
231
# File 'lib/nendo.rb', line 229

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

#setSource(sourcefile, lineno, source_sexp) ⇒ Object



223
224
225
226
227
# File 'lib/nendo.rb', line 223

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

#setVarname(varname) ⇒ Object



219
220
221
# File 'lib/nendo.rb', line 219

def setVarname( varname )
  @varname        = varname
end