straightline/src/main/java/org/poormanscastle/studies/compilers/utils/grammartools/lr/LR0TableCreator.java
/**
     * uses graphviz dot to craete a graph for the griven grammar's state machine.
     * <p/>
     * the states will be the nodes of the graph. the edges between states will be the edges of the graph.
     *
     * @param grammarArg
     * @return
     */
uses graphviz dot to craete a graph for the griven grammar's state machine.

the states will be the nodes of the graph. the edges between states will be the edges of the graph.

@param grammarArg
@return
uses graphviz dot to craete a graph for the griven grammar ' s state machine . the states will be the nodes of the graph . the edges between states will be the edges of the graph . @param grammarArg @return
@Override
    public String createTable(Grammar grammarArg) {
        LR0Grammar grammar = (LR0Grammar) grammarArg;
        StringBuilder output = new StringBuilder("digraph LR0StateMachine {\n");
        output.append("\nnode [shape = rectangle]\n");
        for (LRState state : grammar.getStates()) {
            output.append(createDotNodeFromLRState(state));
        }
        for (LREdge edge : grammar.getEdges()) {
            output.append(createDotEdgeFromLREdge(edge));
        }
        output.append("}\n");
        return output.toString();
    }
@ Override public String createTable ( Grammar grammarArg ) { LR0Grammar grammar = ( LR0Grammar ) grammarArg ; StringBuilder output = new StringBuilder ( "digraph LR0StateMachine {\n" ) ; output . append ( "\nnode [shape = rectangle]\n" ) ; for ( LRState state : grammar . getStates ( ) ) { output . append ( createDotNodeFromLRState ( state ) ) ; } for ( LREdge edge : grammar . getEdges ( ) ) { output . append ( createDotEdgeFromLREdge ( edge ) ) ; } output . append ( "}\n" ) ; return output . toString ( ) ; }
uses graphviz dot to craete a graph for the griven grammar's state machine.
uses graphviz dot to craete a graph for the griven grammar ' s state machine .
// create the graph nodes from the grammar's states.