class Farts::Interpreter

The Interpreter class is an instance of a machine to execute a program

Attributes

hitbreak[RW]
retval[RW]
vars[RW]

Public Class Methods

new(vars) click to toggle source

Construct an interpreter machine

vars

A hash table of attribute name/value pairs.

Currently we support 'actor' and 'this', where they are the first
two parameters of an event respectively.
# File lib/farts/farts_parser.rb, line 769
def initialize(vars)
  @vars = vars  # hash table of attribute_name/value pairs
  @hitbreak = false
  @retval = true
  @lib = Lib.new
end

Public Instance Methods

call_lib_function( fname, args ) { || ... } click to toggle source
# File lib/farts/farts_parser.rb, line 776
def call_lib_function( fname, args )
  if @lib.respond_to?(fname)
    @lib.send(fname, *args)
  else
    yield
  end
end