@@ -2,8 +2,9 @@ part of xml;
2
2
3
3
/**
4
4
* XML grammar definition.
5
+ * Grammar of nodes ot type [TNode] with names of type [TName] .
5
6
*/
6
- abstract class XmlGrammarDefinition extends GrammarDefinition {
7
+ abstract class XmlGrammarDefinition < TNode , TName > extends GrammarDefinition {
7
8
8
9
// name patterns
9
10
static const NAME_START_CHARS =
@@ -35,15 +36,16 @@ abstract class XmlGrammarDefinition extends GrammarDefinition {
35
36
static const CLOSE_PROCESSING = '?>' ;
36
37
37
38
// parser callbacks
38
- createAttribute (name, value);
39
- createComment (value);
40
- createCDATA (value);
41
- createDoctype (value);
42
- createDocument (Iterable children);
43
- createElement (name, Iterable attributes, Iterable children);
44
- createProcessing (target, value);
45
- createQualified (name);
46
- createText (value);
39
+ TNode createAttribute (TName name, String text);
40
+ TNode createComment (String text);
41
+ TNode createCDATA (String text);
42
+ TNode createDoctype (String text);
43
+ TNode createDocument (Iterable <TNode > children);
44
+ TNode createElement (TName name, Iterable <TNode > attributes,
45
+ Iterable <TNode > children);
46
+ TNode createProcessing (String target, String text);
47
+ TName createQualified (String name);
48
+ TNode createText (String text);
47
49
48
50
// productions
49
51
start () => ref (document).end ();
0 commit comments