infosapient.rulecompiler
Class CompileSPRule

java.lang.Object
  |
  +--infosapient.rulecompiler.CompileSPRule

public class CompileSPRule
extends java.lang.Object
implements CompileSPRuleConstants

Created by Sun Microsystems JavaCC (java compiler compiler) from sprulegrammar.jj. WARNING: Do NOT modify CompileSPRule, CompileSPRuleTokenManager, CompileSPRuleConstants as they are machine generated. Code is subject to change without notice.

If you find it necessary to change CompileSPRule, CompileSPRuleTokenManager, or CompileSPRuleConstants: modify sprulegrammar.jj and then re-generate the CompileSPRule.java classes. Send me the changes you made. JavaCC is now supported by and, can be obtained from: http://www.webgain.com/products/metamata/java_doc.html

Version:
$Revision: 1.1.1.1 $

Field Summary
private  java.util.Vector attribNames
           
private  java.util.Hashtable deducingRules
           
private  int errors
           
private  java.util.Observable handler
           
private  java.util.Vector hedgeCollection
           
private  java.util.Vector jj_expentries
           
private  int[] jj_expentry
           
private  int jj_gen
           
(package private)  ASCII_CharStream jj_input_stream
           
private  int jj_kind
           
private  int[] jj_la1
           
private  int[] jj_la1_0
           
private  int[] jj_la1_1
           
private  int[] jj_la1_2
           
private  int[] jj_la1_3
           
 Token jj_nt
           
private  int jj_ntk
           
private  java.lang.String kbName
           
private  java.util.Hashtable referringRules
           
private  java.util.Vector ruleNames
           
private  java.util.Vector setNames
           
private  java.util.Hashtable solutionSetDict
           
private  FzyKnowledgebase theKB
           
 Token token
           
 CompileSPRuleTokenManager token_source
           
private  boolean trace_enabled
           
private  int trace_indent
           
 
Fields inherited from interface infosapient.rulecompiler.CompileSPRuleConstants
ABOUT, ABOVE, ADDAGGREGATION, AFTER, ALPHACUT, AND, ARE, AROUND, ATTRIBUTES, AVERAGEMAX, AVERAGESPACE, AVERAGESUPPORT, BACKWARDCHAIN, BE, BEFORE, BELOW, BESTEVIDENCE, BETA, BETAWEIGHT, BOOLEANATTRIBUTE, BOUNDED_ADD, BOUNDED_AND, BOUNDED_MEAN, CENTER, CENTROID, CLOSE, CMEMBERSHIP, CORRELATIONMETHOD, COSINE_NOT, CURRENTVALUE, DECIMALPT, DECREASED, DEFAULT, DEFINITELY, DIGIT, ELSE, EOF, EXTREMELY, FLEXPOINT, FP_LITERAL, GAUSSIAN, GENERALLY, GTOREQLS, HIGHDOMAIN, IDENTIFIER, IF, IMPLICATIONMETHOD, IN_COMMENT, IN_LINE_COMMENT, INCREASED, IS, KNOWLEDGEBASE, LEAST_ENTROPY, LESSTHANOREQLS, LETTER, LOWDOMAIN, MAXIMUM, MEAN_AND, MEAN_OR, MINIMUM, MINMAX, MINUS, MOSTLY, MUST, MY, N, NEAR, NEGATIVE, NEGATIVELY, NOT, NP, NPN, OR, OUR, PI, PLUS, PN, POSITIVE, POSITIVELY, PRODUCT, PRODUCT_AND, PRODUCT_OR, RESOLUTIONMETHOD, ROUGHLY, RULES, RUNUNCONDITIONALS, SC, SETTYPE, SHOULD, SINGLETON, SINUSOIDAL, SLASH, SLIGHTLY, SOMEWHAT, SPLAT, SUGENO_NOT, THE, THEN, THRESHOLD_NOT, TO, tokenImage, TRIANGLE, VERY, VICINITY, VOTE_BOUNDED, WEIGHTEDBETA, WIDTH, YAGER_AND, YAGER_NOT, YAGER_OR
 
Constructor Summary
CompileSPRule(CompileSPRuleTokenManager tm)
           
CompileSPRule(FzyKnowledgebase kb, CompileSPRuleTokenManager tm)
           
CompileSPRule(java.io.InputStream stream)
           
CompileSPRule(java.io.Reader stream)
           
 
Method Summary
private  void addDeducingRule(FzyRule r, FzyAttribute aac)
           
 void addObserver(java.util.Observer o)
           
private  void addReferringRule(FzyRule r, FzyAttribute aac2)
           
 java.lang.String attribId()
           
 FzyAttribClause attributeClause(FzyRule r)
           
 FzyRule compileRule()
          compileRule
 FzyConsequent consequent(FzyRule r)
           
 void disable_tracing()
           
 void enable_tracing()
           
 FzyClauseComponent expression(FzyRule r)
           
 ParseException generateParseException()
           
 java.util.Observable getHandler()
           
 FzyKnowledgebase getKB()
           
 Token getNextToken()
           
 Token getToken(int index)
           
 FzyHedge hedge()
           
 java.util.Vector hedgeCollection()
           
 java.lang.Object[] id(FzyAttribute fa)
          Return an identifier of some sort.
private  Token jj_consume_token(int kind)
           
private  int jj_ntk()
           
 java.lang.String kbId()
           
static CompileSPRule newCompiler(FzyKnowledgebase kb, java.lang.String ruleAsString)
           
 java.lang.Double nLiteral()
           
 FzyOperator operator()
           
 FzyClauseComponent parenClause(FzyRule r)
           
 FzyPremise premise(FzyRule r)
           
 void ReInit(CompileSPRuleTokenManager tm)
           
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.Reader stream)
           
 void ReInit(java.lang.String aRule)
          Reinitialize the compiler without having to create a new one.
 FzyHedge restrictionHedge()
           
 java.lang.String ruleId()
           
 java.lang.String setId()
           
 void setKB(FzyKnowledgebase kb)
           
static void testCompiler()
          Runs a couple of quick tests
private  void trace_call(java.lang.String s)
           
private  void trace_return(java.lang.String s)
           
private  void trace_scan(Token t1, int t2)
           
private  void trace_token(Token t, java.lang.String where)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

handler

private java.util.Observable handler

errors

private int errors

kbName

private java.lang.String kbName

theKB

private FzyKnowledgebase theKB

hedgeCollection

private java.util.Vector hedgeCollection

setNames

private java.util.Vector setNames

attribNames

private java.util.Vector attribNames

ruleNames

private java.util.Vector ruleNames

referringRules

private java.util.Hashtable referringRules

deducingRules

private java.util.Hashtable deducingRules

solutionSetDict

private java.util.Hashtable solutionSetDict

trace_enabled

private boolean trace_enabled

trace_indent

private int trace_indent

token_source

public CompileSPRuleTokenManager token_source

jj_input_stream

ASCII_CharStream jj_input_stream

token

public Token token

jj_nt

public Token jj_nt

jj_ntk

private int jj_ntk

jj_gen

private int jj_gen

jj_la1

private final int[] jj_la1

jj_la1_0

private final int[] jj_la1_0

jj_la1_1

private final int[] jj_la1_1

jj_la1_2

private final int[] jj_la1_2

jj_la1_3

private final int[] jj_la1_3

jj_expentries

private java.util.Vector jj_expentries

jj_expentry

private int[] jj_expentry

jj_kind

private int jj_kind
Constructor Detail

CompileSPRule

public CompileSPRule(CompileSPRuleTokenManager tm)

CompileSPRule

public CompileSPRule(java.io.InputStream stream)

CompileSPRule

public CompileSPRule(java.io.Reader stream)

CompileSPRule

public CompileSPRule(FzyKnowledgebase kb,
                     CompileSPRuleTokenManager tm)
Method Detail

addDeducingRule

private void addDeducingRule(FzyRule r,
                             FzyAttribute aac)

addObserver

public void addObserver(java.util.Observer o)

addReferringRule

private void addReferringRule(FzyRule r,
                              FzyAttribute aac2)

attribId

public final java.lang.String attribId()
                                throws ParseException

attributeClause

public final FzyAttribClause attributeClause(FzyRule r)
                                      throws ParseException

compileRule

public final FzyRule compileRule()
                          throws ParseException
compileRule

consequent

public final FzyConsequent consequent(FzyRule r)
                               throws ParseException

disable_tracing

public final void disable_tracing()

enable_tracing

public final void enable_tracing()

expression

public final FzyClauseComponent expression(FzyRule r)
                                    throws ParseException

generateParseException

public final ParseException generateParseException()

getHandler

public java.util.Observable getHandler()

getKB

public FzyKnowledgebase getKB()

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

hedge

public final FzyHedge hedge()
                     throws ParseException

hedgeCollection

public final java.util.Vector hedgeCollection()
                                       throws ParseException

id

public final java.lang.Object[] id(FzyAttribute fa)
                            throws ParseException
Return an identifier of some sort. If FzyAttribute is null, then I expect the identifier to be an attribute name. If FzyAttribute is not null, then I expect the identifier to be a fzyset name within the attribute specified.
Parameters:
FzyAttribute - fa - the fuzzy attribute
Returns:
Object[] - an array with 2 values: the actual name found as a string, and the object that is named. (FzyAttribute or FzySet).
Throws:
ParseException -  

jj_consume_token

private final Token jj_consume_token(int kind)
                              throws ParseException

jj_ntk

private final int jj_ntk()

kbId

public final java.lang.String kbId()
                            throws ParseException

newCompiler

public static CompileSPRule newCompiler(FzyKnowledgebase kb,
                                        java.lang.String ruleAsString)

nLiteral

public final java.lang.Double nLiteral()
                                throws ParseException

operator

public final FzyOperator operator()
                           throws ParseException

parenClause

public final FzyClauseComponent parenClause(FzyRule r)
                                     throws ParseException

premise

public final FzyPremise premise(FzyRule r)
                         throws ParseException

ReInit

public void ReInit(CompileSPRuleTokenManager tm)

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(java.lang.String aRule)
Reinitialize the compiler without having to create a new one. (Creates a new TokenManager).

restrictionHedge

public final FzyHedge restrictionHedge()
                                throws ParseException

ruleId

public final java.lang.String ruleId()
                              throws ParseException

setId

public final java.lang.String setId()
                             throws ParseException

setKB

public void setKB(FzyKnowledgebase kb)

testCompiler

public static void testCompiler()
Runs a couple of quick tests

trace_call

private final void trace_call(java.lang.String s)

trace_return

private final void trace_return(java.lang.String s)

trace_scan

private final void trace_scan(Token t1,
                              int t2)

trace_token

private final void trace_token(Token t,
                               java.lang.String where)

License to use this program is provided under the TERMS OF THE COMMON PUBLIC LICENSE 0.5. ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

Copyright (c) 2001, Workplace Performance Tools, All Rights Reserved