src/Grammar.java
public void addProduction(String lhs, ArrayList<String> rhs) {
        Collection<ArrayList<String>> prods = productions.get(lhs);
        if (prods == null) {
            prods = new ArrayList<>();
            lhss.add(lhs);
        }
        prods.add(rhs);
        productions.put(lhs, prods);
    }
/** Add a production to the grammar. */
Add a production to the grammar.
Add a production to the grammar .
public void addProduction(String lhs, ArrayList<String> rhs) {
        Collection<ArrayList<String>> prods = productions.get(lhs);
        if (prods == null) {
            prods = new ArrayList<>();
            lhss.add(lhs);
        }
        prods.add(rhs);
        productions.put(lhs, prods);
    }
public void addProduction ( String lhs , ArrayList < String > rhs ) { Collection < ArrayList < String > > prods = productions . get ( lhs ) ; if ( prods == null ) { prods = new ArrayList < > ( ) ; lhss . add ( lhs ) ; } prods . add ( rhs ) ; productions . put ( lhs , prods ) ; }
Add a production to the grammar.
Add a production to the grammar .