edu.ksu.cis.bnj.bbn.converter.bif
Class BifParser

java.lang.Object
  extended byedu.ksu.cis.bnj.bbn.converter.bif.BifParser
All Implemented Interfaces:
BifParserConstants, BifParserTreeConstants, Converter

public class BifParser
extends java.lang.Object
implements BifParserTreeConstants, Converter, BifParserConstants


Field Summary
protected  java.util.Hashtable edgeCache
           
 Token jj_nt
           
protected  edu.ksu.cis.bnj.bbn.converter.bif.JJTBifParserState jjtree
           
protected static java.lang.String ln
           
 boolean lookingAhead
           
protected  java.util.Hashtable nodeCache
           
protected  java.util.Hashtable partialValuesCache
           
protected  java.util.Hashtable tableCache
           
 Token token
           
 BifParserTokenManager token_source
           
protected  java.util.Hashtable valueCache
           
 
Fields inherited from interface edu.ksu.cis.bnj.bbn.converter.bif.BifParserTreeConstants
jjtNodeName, JJTVOID
 
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
 
Constructor Summary
BifParser()
           
BifParser(BifParserTokenManager tm)
           
BifParser(java.io.InputStream stream)
           
BifParser(java.io.Reader stream)
           
 
Method Summary
 BBNGraph CompilationUnit()
          THE BIF LANGUAGE GRAMMAR STARTS HERE *
 void disable_tracing()
           
 void Edge()
           
 void enable_tracing()
           
 ASTExpr Expr()
           
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
 ParseException generateParseException()
           
 Token getNextToken()
           
 Token getToken(int index)
           
static void help()
           
 java.util.LinkedList IDList()
           
 java.util.LinkedList IDOrStarList()
           
 void initialize()
           
 BBNGraph load(java.io.InputStream r)
           
static void main(java.lang.String[] args)
           
 ASTExpr MulDivExpr()
           
 void Node()
           
 java.util.LinkedList NumberList()
           
 java.lang.Double NumberLiteral()
           
 java.util.LinkedList NumberOrFuncList()
           
 ASTExpr PowExpr()
           
protected  BBNGraph processGraph(BBNGraph g)
           
 void Property(java.util.Hashtable prop)
           
 void ReInit(BifParserTokenManager tm)
           
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.Reader stream)
           
protected  void resetCache()
          This is to reset cache.
 void save(java.io.OutputStream os, BBNGraph graph)
          We ignore properties in saving, except the position.
 java.util.LinkedList StringList()
           
 java.lang.String StringLiteral()
           
 java.lang.String StringOrID()
           
 ASTExpr UnaryExpr()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

BifParser

public BifParser()

BifParser

public BifParser(java.io.InputStream stream)

BifParser

public BifParser(java.io.Reader stream)

BifParser

public BifParser(BifParserTokenManager tm)
Method Detail

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 list
data - The data in lists
queryValue - BBNQuery entry to be inputted
input - 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()