com.alexmerz.graphviz
Class Parser

java.lang.Object
  extended by com.alexmerz.graphviz.Parser
All Implemented Interfaces:
ParserConstants

public class Parser
extends java.lang.Object
implements ParserConstants

The parser creates a list of Graph objects found in a Reader object.

Version:
$Id: graphviz.jj,v 1.4 2006/03/20 16:45:41 Alexander Exp $

Field Summary
 Token jj_nt
           
 boolean lookingAhead
           
 Token token
           
 ParserTokenManager token_source
           
 
Fields inherited from interface com.alexmerz.graphviz.ParserConstants
COMMA, DEFAULT, DIGRAPH, DOUBLE, EDGE, EDGE_DIRECTED, EDGE_UNDIRECTED, EOF, EQUAL, GRAPH, ID, IN_COMMENT, IN_COMMENT_OL, LB, LBRACE, LBRACKET, NODE, NUMBER, RBRACE, RBRACKET, SEMI, SPACE, STRICT, STRING, SUBGRAPH, tokenImage
 
Constructor Summary
Parser()
           
Parser(java.io.InputStream stream)
           
Parser(java.io.InputStream stream, java.lang.String encoding)
           
Parser(ParserTokenManager tm)
           
Parser(java.io.Reader stream)
           
 
Method Summary
 java.lang.String attrib_value()
           
 java.util.Hashtable<java.lang.String,java.lang.String> attribute_list()
           
 java.lang.String[] attribute()
           
 void disable_tracing()
           
 void edge_op()
           
 void edge()
           
 void enable_tracing()
           
 ParseException generateParseException()
           
 void generic_attributes()
           
 java.util.ArrayList<Graph> getGraphs()
          Returns the main Graphs found in the Reader stream
 Token getNextToken()
           
 Token getToken(int index)
           
 void graph_attrib_assign()
           
 void graph(java.util.ArrayList<Graph> gglist)
          Production for a single graph
 void graphs(java.util.ArrayList<Graph> gglist)
          Production for all graph definitions in the stream
 Id id()
           
 void lb()
           
 java.util.ArrayList<Node> matrix()
           
 void node_listing()
           
 PortNode node_port()
           
 Node node()
           
 boolean parse(java.io.Reader in)
          Parses a Graphviz document
 boolean parse(java.lang.StringBuffer sb)
          Parses a Graphviz document
 void reallist()
          Production for more then one statement in a graph
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.InputStream stream, java.lang.String encoding)
           
 void ReInit(ParserTokenManager tm)
           
 void ReInit(java.io.Reader stream)
           
 void sg_stmt_list()
           
 void single_node()
           
 void stmt_list()
          Production for the statements in the graph
 void stmt()
           
 Node subgraph()
           
 java.lang.String value()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public ParserTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

Parser

public Parser()

Parser

public Parser(java.io.InputStream stream)

Parser

public Parser(java.io.InputStream stream,
              java.lang.String encoding)

Parser

public Parser(java.io.Reader stream)

Parser

public Parser(ParserTokenManager tm)
Method Detail

getGraphs

public java.util.ArrayList<Graph> getGraphs()
Returns the main Graphs found in the Reader stream

Returns:
the list of main Graphs

parse

public boolean parse(java.io.Reader in)
              throws ParseException
Parses a Graphviz document

Parameters:
in - the Reader to parse
Returns:
normally true should be returned, if false then something in the JDK is broken...
Throws:
ParseException

parse

public boolean parse(java.lang.StringBuffer sb)
              throws ParseException
Parses a Graphviz document

Parameters:
sb - the StringBuffer containing the document
Returns:
normally true should be returned, if false then something in the JDK is broken...
Throws:
ParseException

graphs

public final void graphs(java.util.ArrayList<Graph> gglist)
                  throws ParseException
Production for all graph definitions in the stream

Throws:
ParseException

graph

public final void graph(java.util.ArrayList<Graph> gglist)
                 throws ParseException
Production for a single graph

Throws:
ParseException

stmt_list

public final void stmt_list()
                     throws ParseException
Production for the statements in the graph

Throws:
ParseException

reallist

public final void reallist()
                    throws ParseException
Production for more then one statement in a graph

Throws:
ParseException

stmt

public final void stmt()
                throws ParseException
Throws:
ParseException

lb

public final void lb()
              throws ParseException
Throws:
ParseException

edge

public final void edge()
                throws ParseException
Throws:
ParseException

edge_op

public final void edge_op()
                   throws ParseException
Throws:
ParseException

matrix

public final java.util.ArrayList<Node> matrix()
                                       throws ParseException
Throws:
ParseException

generic_attributes

public final void generic_attributes()
                              throws ParseException
Throws:
ParseException

subgraph

public final Node subgraph()
                    throws ParseException
Throws:
ParseException

sg_stmt_list

public final void sg_stmt_list()
                        throws ParseException
Throws:
ParseException

graph_attrib_assign

public final void graph_attrib_assign()
                               throws ParseException
Throws:
ParseException

node_port

public final PortNode node_port()
                         throws ParseException
Throws:
ParseException

node_listing

public final void node_listing()
                        throws ParseException
Throws:
ParseException

single_node

public final void single_node()
                       throws ParseException
Throws:
ParseException

attribute_list

public final java.util.Hashtable<java.lang.String,java.lang.String> attribute_list()
                                                                            throws ParseException
Throws:
ParseException

attribute

public final java.lang.String[] attribute()
                                   throws ParseException
Throws:
ParseException

attrib_value

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

node

public final Node node()
                throws ParseException
Throws:
ParseException

id

public final Id id()
            throws ParseException
Throws:
ParseException

value

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

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.InputStream stream,
                   java.lang.String encoding)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(ParserTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()