Class Farts::Interpreter
In: lib/farts/farts_parser.rb
Parent: Object
SyntaxNode
LiteralSyntaxNode
ProgramSyntaxNode
AttributeSyntaxNode
IfSyntaxNode
CommentSyntaxNode
EndSyntaxNode
LocalVarSyntaxNode
CallSyntaxNode
CommandSyntaxNode
Racc::Parser
Parser
StringScanner
Lexer
Lib
Interpreter
Farts
dot/f_21.png

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

Methods

Attributes

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

Public Class methods

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.

[Source]

# File lib/farts/farts_parser.rb, line 808
    def initialize(vars)
      @vars = vars  # hash table of attribute_name/value pairs
      @hitbreak = false
      @retval = true
      @lib = Lib.new
    end

Public Instance methods

[Source]

# File lib/farts/farts_parser.rb, line 815
    def call_lib_function( fname, args )
      if @lib.respond_to?(fname)
        @lib.send(fname, *args)
      else
        yield
      end
    end

[Validate]