JsonGrammar { public ValueTree VALUE() { return b.<ValueTree>nonterminal(JsonLexer.VALUE).is( b.firstOf( STRING(), NUMBER(), OBJECT(), ARRAY(), BUILT_IN_VALUE())); } JsonGrammar(GrammarBuilder<InternalSyntaxToken> b, TreeFactory f); JsonTree JSON(); ObjectTree OBJECT(); SyntaxList<PairTree> PAIR_LIST(); PairTree PAIR(); ArrayTree ARRAY(); SyntaxList<ValueTree> VALUE_LIST(); ValueTree VALUE(); LiteralTree STRING(); LiteralTree NUMBER(); BuiltInValueTree BUILT_IN_VALUE();  }
@Test public void value() throws Exception { assertValue("\"string\"", LiteralTree.class); assertValue("{}", ObjectTree.class); assertValue("[]", ArrayTree.class); assertValue("42", LiteralTree.class); assertValue("true", BuiltInValueTree.class); assertValue("false", BuiltInValueTree.class); assertValue("null", BuiltInValueTree.class); }