package com.xqbase.baiji.io.parsing;

/**
 * The class that generates a grammar suitable to parse Baiji data
 * in JSON format.
 */
public class JsonGrammarGenerator extends ValidatingGrammarGenerator {
}

@@ -31,16 +31,105 @@
 rsing;%0A%0A
+import com.xqbase.baiji.schema.Schema;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A
 /**%0A * T
@@ -284,11 +284,730 @@
 erator %7B
+%0A%0A    /**%0A     * Returns the non-terminal that is the start symbol%0A     * for the grammar for the grammar for the given schema %3Ctt%3Esc%3C/tt%3E.%0A     */%0A    @Override%0A    public Symbol generate(Schema schema) %7B%0A        return Symbol.root(generate(schema, new HashMap%3CLitS, Symbol%3E()));%0A    %7D%0A%0A    @Override%0A    public Symbol generate(Schema sc, Map%3CLitS, Symbol%3E seen) %7B%0A        switch (sc.getType()) %7B%0A            case NULL:%0A            case BOOLEAN:%0A            case INT:%0A            case LONG:%0A            case FLOAT:%0A            case DOUBLE:%0A            case STRING:%0A            case BYTES:%0A            case UNION:%0A                return super.generate(sc, seen);%0A        %7D%0A        return super.generate(sc, seen);%0A    %7D
 %0A%7D%0A

Add the JsonGrammarGenerator...