public class BufferStateUtilities
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
BufferStateUtilities.Consistent
means that given the values and the conditions the slots
have, they COULD be equivalent (but still might not be)
means that given the values and the conditions, the two slots can never be equivalent means that the given values and conditions are not sufficient to make any judgement. |
Constructor and Description |
---|
BufferStateUtilities() |
Modifier and Type | Method and Description |
---|---|
static boolean |
conditionIs(org.antlr.runtime.tree.CommonTree slot,
int condition)
uses
IConditionalSlot condition constants, not JACTRBuilder |
static boolean |
contentIsType(org.antlr.runtime.tree.CommonTree slot,
int type) |
static java.util.Collection<org.antlr.runtime.tree.CommonTree> |
expandVariable(java.lang.String slotName,
java.lang.String variableName,
BufferEndStates endStates)
this will search through all the conditions and queries looking for more
information about variableName.
|
static java.util.Collection<org.antlr.runtime.tree.CommonTree> |
getAssignments(java.util.Map<java.lang.Integer,java.util.Collection<org.antlr.runtime.tree.CommonTree>> mapOfTrees)
return all slots that are equality conditions (aka assignments), even
variables
|
static java.lang.String |
getContent(org.antlr.runtime.tree.CommonTree slot) |
static java.util.Collection<org.antlr.runtime.tree.CommonTree> |
getNonVariables(java.util.Map<java.lang.Integer,java.util.Collection<org.antlr.runtime.tree.CommonTree>> mapOfSlots)
return all slots that arent variables
|
static java.util.Map<java.lang.Integer,java.util.Collection<org.antlr.runtime.tree.CommonTree>> |
getSlots(org.antlr.runtime.tree.CommonTree conditionOrAction)
return a map of collections of slot ASTs contained by the condition or
action.
|
static BufferStateUtilities.Consistent |
isConsistentWith(org.antlr.runtime.tree.CommonTree endStateSlot,
org.antlr.runtime.tree.CommonTree conditionalSlot)
return true if the endstate slot is consistent with the conditional slot.
|
static boolean |
slotIsApplicable(org.antlr.runtime.tree.CommonTree endStateSlot,
org.antlr.runtime.tree.CommonTree conditionalSlot)
compare two slots to see if they are applicable, this is just a name check
|
public static java.util.Collection<org.antlr.runtime.tree.CommonTree> expandVariable(java.lang.String slotName, java.lang.String variableName, BufferEndStates endStates)
(p
=goal>
isa fact
- arg1 Z
arg1 =value
==>
+retrieval>
isa other-fact
argA =value
)
slotName
- variableName
- endStates
- public static java.util.Map<java.lang.Integer,java.util.Collection<org.antlr.runtime.tree.CommonTree>> getSlots(org.antlr.runtime.tree.CommonTree conditionOrAction)
JACTRBuilder.IDENTIFIER
, JACTRBuilder.VARIABLE
, or
JACTRBuilder.NUMBER
conditionOrAction
- public static java.util.Collection<org.antlr.runtime.tree.CommonTree> getNonVariables(java.util.Map<java.lang.Integer,java.util.Collection<org.antlr.runtime.tree.CommonTree>> mapOfSlots)
mapOfSlots
- public static java.util.Collection<org.antlr.runtime.tree.CommonTree> getAssignments(java.util.Map<java.lang.Integer,java.util.Collection<org.antlr.runtime.tree.CommonTree>> mapOfTrees)
mapOfTrees
- public static boolean contentIsType(org.antlr.runtime.tree.CommonTree slot, int type)
public static java.lang.String getContent(org.antlr.runtime.tree.CommonTree slot)
public static boolean conditionIs(org.antlr.runtime.tree.CommonTree slot, int condition)
IConditionalSlot
condition constants, not JACTRBuilder
slot
- condition
- public static boolean slotIsApplicable(org.antlr.runtime.tree.CommonTree endStateSlot, org.antlr.runtime.tree.CommonTree conditionalSlot)
endStateSlot
- conditionalSlot
- public static BufferStateUtilities.Consistent isConsistentWith(org.antlr.runtime.tree.CommonTree endStateSlot, org.antlr.runtime.tree.CommonTree conditionalSlot)
slotIsApplicable(CommonTree, CommonTree)
should have returned
true.endStateSlot
- conditionalSlot
- BufferStateUtilities.Consistent
java.lang.IllegalStateException
- if either is a variable or the condition type is not recognized