edu.ksu.cis.bnj.bbn.converter.dsc
Class DscParser

java.lang.Object
  extended byedu.ksu.cis.bnj.bbn.converter.dsc.DscParser
All Implemented Interfaces:
Converter, DscParserConstants, DscParserTreeConstants

public class DscParser
extends java.lang.Object
implements DscParserTreeConstants, Converter, DscParserConstants


Field Summary
protected  BBNGraph graph
           
 Token jj_nt
           
protected  edu.ksu.cis.bnj.bbn.converter.dsc.JJTDscParserState jjtree
           
protected static java.lang.String ln
           
 boolean lookingAhead
           
protected  java.util.Hashtable nodeCache
           
 Token token
           
 DscParserTokenManager token_source
           
protected  java.util.Hashtable valueCache
           
 
Fields inherited from interface edu.ksu.cis.bnj.bbn.converter.dsc.DscParserTreeConstants
jjtNodeName, JJTVOID
 
Fields inherited from interface edu.ksu.cis.bnj.bbn.converter.dsc.DscParserConstants
_DEFAULT, ANDASSIGN, ARRAY, ASG_OPR, ASSIGN, BANG, BIT_AND, BIT_OR, BIT_XOR, CHAR_LIT, CHAR_LIT_CLOSE, CHARACTER_LITERAL, CHOICE, COLON, COMMA, DECIMAL_LITERAL, DECISION, DECR, DEFAULT, DIGIT, DISCRETE, DOT, EOF, EQ, ESCAPE_OCTAL, ESCAPE_SEQ, ESCAPE_UNICODE, ESCAPED_CHAR_LIT, EXPONENT, FLOATING_POINT_LITERAL, FUNCTION, 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, NAME, NE, NETWORK, NODE, NON_ESCAPED_LITERAL, OCTAL_LITERAL, OF, ORASSIGN, PLUS, PLUSASSIGN, POSITION, PROBABILITY, PROPERTIES, RBRACE, RBRACKET, REAL, REMASSIGN, RPAREN, RSIGNEDSHIFT, RSIGNEDSHIFTASSIGN, RUNSIGNEDSHIFT, RUNSIGNEDSHIFTASSIGN, SC_AND, SC_OR, SC_XOR, SEMICOLON, SERVICE, SINGLE_LINE_COMMENT, SLASH, SLASHASSIGN, STAR, STARASSIGN, STRING, STRING_LITERAL, TILDE, tokenImage, TOWARD, TYPE, UTILITY, XORASSIGN
 
Constructor Summary
DscParser()
           
DscParser(DscParserTokenManager tm)
           
DscParser(java.io.InputStream stream)
           
DscParser(java.io.Reader stream)
           
 
Method Summary
 BBNGraph CompilationUnit()
          THE DSC LANGUAGE GRAMMAR STARTS HERE *
 void disable_tracing()
           
 void Edge()
           
 void enable_tracing()
           
 ParseException generateParseException()
           
protected  java.lang.String getFiller(int n)
           
 Token getNextToken()
           
 Token getToken(int index)
           
static void help()
           
 void initialize()
           
 BBNGraph load(java.io.InputStream r)
           
static void main(java.lang.String[] args)
           
protected  java.lang.String mangleString(java.lang.String s)
           
 void Node()
           
 java.util.List NumberList()
           
 java.lang.Double NumberLiteral()
           
protected  java.util.Hashtable processCPT(java.util.LinkedList nodes, BBNNode curNode, java.util.LinkedList parentValues, java.util.Hashtable curInst, java.util.Hashtable rawCPT, java.util.Hashtable cookedCPT)
           
protected  void processEdge(java.lang.String nodeName, java.util.List parentNames, java.util.Hashtable cpt)
           
 void ReInit(DscParserTokenManager 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.lang.String StringLiteral()
           
 java.lang.String StringOrID()
           
 java.util.List StringOrIDList()
           
 
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.dsc.JJTDscParserState jjtree

graph

protected BBNGraph graph

nodeCache

protected java.util.Hashtable nodeCache

valueCache

protected java.util.Hashtable valueCache

ln

protected static java.lang.String ln

token_source

public DscParserTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

DscParser

public DscParser()

DscParser

public DscParser(java.io.InputStream stream)

DscParser

public DscParser(java.io.Reader stream)

DscParser

public DscParser(DscParserTokenManager tm)
Method Detail

initialize

public void initialize()
Specified by:
initialize in interface Converter

load

public BBNGraph load(java.io.InputStream r)
              throws ParseException
Specified by:
load in interface Converter
Throws:
ParseException

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)

mangleString

protected java.lang.String mangleString(java.lang.String s)

getFiller

protected java.lang.String getFiller(int n)

processEdge

protected void processEdge(java.lang.String nodeName,
                           java.util.List parentNames,
                           java.util.Hashtable cpt)

processCPT

protected java.util.Hashtable processCPT(java.util.LinkedList nodes,
                                         BBNNode curNode,
                                         java.util.LinkedList parentValues,
                                         java.util.Hashtable curInst,
                                         java.util.Hashtable rawCPT,
                                         java.util.Hashtable cookedCPT)

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 DSC LANGUAGE GRAMMAR STARTS HERE *

Throws:
ParseException

Node

public final void Node()
                throws ParseException
Throws:
ParseException

Edge

public final void Edge()
                throws ParseException
Throws:
ParseException

StringLiteral

public final java.lang.String StringLiteral()
                                     throws ParseException
Throws:
ParseException

NumberLiteral

public final java.lang.Double NumberLiteral()
                                     throws ParseException
Throws:
ParseException

NumberList

public final java.util.List NumberList()
                                throws ParseException
Throws:
ParseException

StringOrIDList

public final java.util.List StringOrIDList()
                                    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(DscParserTokenManager 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()