Algernon Software

org.algernon.aam.compile
Class AlgernonCompilerState

java.lang.Object
  extended byorg.algernon.aam.compile.AlgernonCompilerState

public class AlgernonCompilerState
extends Object

This class holds internal state during compilation. It is not intended for public consumption. All variables are public.


Field Summary
 boolean doBackwardChaining
          This is true if backward chaining rules should be activated.
 boolean doCheckSlotDomains
          true if the compiler should check slot domains.
 boolean doForwardChaining
          This is true if forward chaining rules should be activated.
 boolean doMakeContinuations
          true if the compiler should output code to create a continuation while a rule is firing.
 boolean dontSubstituteForFrame
          Causes the opcode SUBSTITUTE1 to be used instead of SUBSTITUTE.
private  Algernon f_algy
           
 boolean failIsGood
          Sometimes (as in the macro :FAIL or :UNP) processing should continue if the command fails.
 boolean hasNoBindings
          When a :SUBR is being compiled we don't want to push bindings onto the BINDINGS register.
 boolean isLastClause
          True if we are compiling the last clause of a path.
 LispValue skipLabel
          This is the label the code should skip to if processing proceeds normally.
 boolean succeedIsGood
          The normal state is that a command should succeed for processing to continue.
 LispValue succeedLabel
          This is the label the code should skip to if processing succeeds.
 LispValue theStateVariable
          Holds the variable being used in a :THE macro.
 int unpMode
          The mode when doing a recursive call to UNP.
 
Constructor Summary
AlgernonCompilerState(Algernon algy)
           
 
Method Summary
 AlgernonCompilerState copy()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

doCheckSlotDomains

public boolean doCheckSlotDomains
true if the compiler should check slot domains. This is turned off only for some special forms or very special circumstances. Normally true.


doMakeContinuations

public boolean doMakeContinuations
true if the compiler should output code to create a continuation while a rule is firing. Normally true.


succeedIsGood

public boolean succeedIsGood
The normal state is that a command should succeed for processing to continue. Normally false.


failIsGood

public boolean failIsGood
Sometimes (as in the macro :FAIL or :UNP) processing should continue if the command fails. Normally false.


hasNoBindings

public boolean hasNoBindings
When a :SUBR is being compiled we don't want to push bindings onto the BINDINGS register. So this is set to true and different code is generated. Normally false.


skipLabel

public LispValue skipLabel
This is the label the code should skip to if processing proceeds normally. Normally null.


succeedLabel

public LispValue succeedLabel
This is the label the code should skip to if processing succeeds. Normally null.


doForwardChaining

public boolean doForwardChaining
This is true if forward chaining rules should be activated. Normally true.


doBackwardChaining

public boolean doBackwardChaining
This is true if backward chaining rules should be activated. Normally true.


isLastClause

public boolean isLastClause
True if we are compiling the last clause of a path. Normally false.


theStateVariable

public LispValue theStateVariable
Holds the variable being used in a :THE macro. Used when compiling the associated :UNP clause.


unpMode

public int unpMode
The mode when doing a recursive call to UNP. Normal value is NORMAL. Other choice is FORC_MODE.


dontSubstituteForFrame

public boolean dontSubstituteForFrame
Causes the opcode SUBSTITUTE1 to be used instead of SUBSTITUTE. SUBSTITUTE1 does not substitute values for the value of the frame argument. This is used with :BIND in order to allow the user to rebind a variable that was already bound once. Normally false.


f_algy

private Algernon f_algy
Constructor Detail

AlgernonCompilerState

public AlgernonCompilerState(Algernon algy)
Method Detail

copy

public AlgernonCompilerState copy()

toString

public String toString()

Algernon Software