@Test public void array() { ArrayTree tree = (ArrayTree) ((JsonTree) parser.parse("[]")).arrayOrObject(); assertThat(tree.openBracketToken().value()).isEqualTo("["); assertThat(tree.closeBracketToken().value()).isEqualTo("]"); assertThat(tree.values()).isNull(); tree =(ArrayTree) ((JsonTree) parser.parse("[ true, false ]")).arrayOrObject(); assertThat(tree.values()).isNotNull(); assertThat(tree.values().element()).isInstanceOf(BuiltInValueTree.class); assertThat(tree.values().commaToken().value()).isEqualTo(","); assertThat(tree.values().next().element()).isInstanceOf(BuiltInValueTree.class); }
public ArrayTree ARRAY() { return b.<ArrayTree>nonterminal(JsonLexer.ARRAY).is( f.array( b.token(JsonLexer.LBRACKET), b.optional(VALUE_LIST()), b.token(JsonLexer.RBRACKET))); }
JsonGrammar { public ArrayTree ARRAY() { return b.<ArrayTree>nonterminal(JsonLexer.ARRAY).is( f.array( b.token(JsonLexer.LBRACKET), b.optional(VALUE_LIST()), b.token(JsonLexer.RBRACKET))); } }
JsonGrammar { public ArrayTree ARRAY() { return b.<ArrayTree>nonterminal(JsonLexer.ARRAY).is( f.array( b.token(JsonLexer.LBRACKET), b.optional(VALUE_LIST()), b.token(JsonLexer.RBRACKET))); } JsonGrammar(GrammarBuilder<InternalSyntaxToken> b, TreeFactory f); }
JsonGrammar { public ArrayTree ARRAY() { return b.<ArrayTree>nonterminal(JsonLexer.ARRAY).is( f.array( b.token(JsonLexer.LBRACKET), b.optional(VALUE_LIST()), b.token(JsonLexer.RBRACKET))); } 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(); }
JsonGrammar { public ArrayTree ARRAY() { return b.<ArrayTree>nonterminal(JsonLexer.ARRAY).is( f.array( b.token(JsonLexer.LBRACKET), b.optional(VALUE_LIST()), b.token(JsonLexer.RBRACKET))); } 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();  }