edu.ksu.cis.bnj.bbn.converter.bif
Class BifParser
java.lang.Object
edu.ksu.cis.bnj.bbn.converter.bif.BifParser
- All Implemented Interfaces:
- BifParserConstants, BifParserTreeConstants, Converter
- public class BifParser
- extends java.lang.Object
- implements BifParserTreeConstants, Converter, BifParserConstants
Fields inherited from interface edu.ksu.cis.bnj.bbn.converter.bif.BifParserConstants |
_DEFAULT, ANDASSIGN, ASG_OPR, ASSIGN, BANG, BIT_AND, BIT_OR, BIT_XOR, CHAR_LIT, CHAR_LIT_CLOSE, CHARACTER_LITERAL, COLON, COMMA, CONTINUOUS, DECIMAL_LITERAL, DECISION, DECR, DEFAULT, DIGIT, DISCRETE, DOT, EOF, EQ, ESCAPE_OCTAL, ESCAPE_SEQ, ESCAPE_UNICODE, ESCAPED_CHAR_LIT, EXPONENT, FLOATING_POINT_LITERAL, GE, GT, HEX_LITERAL, HOOK, IDENTIFIER, IN_MULTI_LINE_COMMENT, IN_SINGLE_LINE_COMMENT, INCR, INTEGER_LITERAL, LBRACE, LBRACKET, LE, LETTER, LPAREN, LSHIFT, LSHIFTASSIGN, LT, MINUS, MINUSASSIGN, MULTI_LINE_COMMENT, NE, NETWORK, NON_ESCAPED_LITERAL, NORMAL, OCTAL_LITERAL, ORASSIGN, PLUS, PLUSASSIGN, PROBABILITY, PROPERTY, RBRACE, RBRACKET, REMASSIGN, RPAREN, RSIGNEDSHIFT, RSIGNEDSHIFTASSIGN, RUNSIGNEDSHIFT, RUNSIGNEDSHIFTASSIGN, SC_AND, SC_OR, SC_XOR, SEMICOLON, SINGLE_LINE_COMMENT, SLASH, SLASHASSIGN, STAR, STARASSIGN, STRING_LITERAL, TABLE, TILDE, tokenImage, TOWARD, TYPE, UTILITY, VARIABLE, XORASSIGN |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
jjtree
protected edu.ksu.cis.bnj.bbn.converter.bif.JJTBifParserState jjtree
nodeCache
protected java.util.Hashtable nodeCache
edgeCache
protected java.util.Hashtable edgeCache
valueCache
protected java.util.Hashtable valueCache
tableCache
protected java.util.Hashtable tableCache
partialValuesCache
protected java.util.Hashtable partialValuesCache
ln
protected static java.lang.String ln
token_source
public BifParserTokenManager token_source
token
public Token token
jj_nt
public Token jj_nt
lookingAhead
public boolean lookingAhead
BifParser
public BifParser()
BifParser
public BifParser(java.io.InputStream stream)
BifParser
public BifParser(java.io.Reader stream)
BifParser
public BifParser(BifParserTokenManager tm)
initialize
public void initialize()
- Specified by:
initialize
in interface Converter
load
public BBNGraph load(java.io.InputStream r)
- Specified by:
load
in interface Converter
save
public void save(java.io.OutputStream os,
BBNGraph graph)
- We ignore properties in saving, except the position.
- Specified by:
save
in interface Converter
- See Also:
Converter.save(OutputStream, BBNGraph)
processGraph
protected BBNGraph processGraph(BBNGraph g)
formatCPF
protected java.util.Hashtable formatCPF(java.util.LinkedList nodeList,
java.util.LinkedList data,
java.util.Hashtable queryValue,
java.util.Hashtable input)
- Reformat the list of lists into CPF
- Parameters:
nodeList
- Basically list of node name and its value listdata
- The data in listsqueryValue
- BBNQuery entry to be inputtedinput
- the resulting CPF, passed recursively while building
- Returns:
- Hashtable the CPF
resetCache
protected void resetCache()
- This is to reset cache. Useful later if we decided to support OOBN.
help
public static void help()
main
public static void main(java.lang.String[] args)
CompilationUnit
public final BBNGraph CompilationUnit()
throws ParseException
- THE BIF LANGUAGE GRAMMAR STARTS HERE *
- Throws:
ParseException
Property
public final void Property(java.util.Hashtable prop)
throws ParseException
- Throws:
ParseException
Node
public final void Node()
throws ParseException
- Throws:
ParseException
Edge
public final void Edge()
throws ParseException
- Throws:
ParseException
Expr
public final ASTExpr Expr()
throws ParseException
- Throws:
ParseException
MulDivExpr
public final ASTExpr MulDivExpr()
throws ParseException
- Throws:
ParseException
PowExpr
public final ASTExpr PowExpr()
throws ParseException
- Throws:
ParseException
UnaryExpr
public final ASTExpr UnaryExpr()
throws ParseException
- Throws:
ParseException
StringLiteral
public final java.lang.String StringLiteral()
throws ParseException
- Throws:
ParseException
StringList
public final java.util.LinkedList StringList()
throws ParseException
- Throws:
ParseException
NumberLiteral
public final java.lang.Double NumberLiteral()
throws ParseException
- Throws:
ParseException
NumberOrFuncList
public final java.util.LinkedList NumberOrFuncList()
throws ParseException
- Throws:
ParseException
NumberList
public final java.util.LinkedList NumberList()
throws ParseException
- Throws:
ParseException
IDList
public final java.util.LinkedList IDList()
throws ParseException
- Throws:
ParseException
IDOrStarList
public final java.util.LinkedList IDOrStarList()
throws ParseException
- Throws:
ParseException
StringOrID
public final java.lang.String StringOrID()
throws ParseException
- Throws:
ParseException
ReInit
public void ReInit(java.io.InputStream stream)
ReInit
public void ReInit(java.io.Reader stream)
ReInit
public void ReInit(BifParserTokenManager tm)
getNextToken
public final Token getNextToken()
getToken
public final Token getToken(int index)
generateParseException
public final ParseException generateParseException()
enable_tracing
public final void enable_tracing()
disable_tracing
public final void disable_tracing()