OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library visitor; | 5 library visitor; |
6 | 6 |
7 import 'package:source_maps/span.dart' show Span; | 7 import 'package:source_maps/span.dart' show Span; |
8 import 'parser.dart'; | 8 import 'parser.dart'; |
9 | 9 |
10 part 'src/css_printer.dart'; | 10 part 'src/css_printer.dart'; |
11 part 'src/tree.dart'; | 11 part 'src/tree.dart'; |
12 part 'src/tree_base.dart'; | 12 part 'src/tree_base.dart'; |
13 part 'src/tree_printer.dart'; | 13 part 'src/tree_printer.dart'; |
14 | 14 |
15 abstract class VisitorBase { | 15 abstract class VisitorBase { |
16 void visitCssComment(CssComment node); | 16 void visitCssComment(CssComment node); |
17 void visitCommentDefinition(CommentDefinition node); | 17 void visitCommentDefinition(CommentDefinition node); |
18 void visitStyleSheet(StyleSheet node); | 18 void visitStyleSheet(StyleSheet node); |
19 void visitTopLevelProduction(TopLevelProduction node); | 19 void visitTopLevelProduction(TopLevelProduction node); |
20 void visitDirective(Directive node); | 20 void visitDirective(Directive node); |
21 void visitMediaExpression(MediaExpression node); | 21 void visitMediaExpression(MediaExpression node); |
22 void visitMediaQuery(MediaQuery node); | 22 void visitMediaQuery(MediaQuery node); |
23 void visitMediaDirective(MediaDirective node); | 23 void visitMediaDirective(MediaDirective node); |
24 void visitPageDirective(PageDirective node); | 24 void visitPageDirective(PageDirective node); |
25 void visitImportDirective(ImportDirective node); | 25 void visitImportDirective(ImportDirective node); |
26 void visitKeyFrameDirective(KeyFrameDirective node); | 26 void visitKeyFrameDirective(KeyFrameDirective node); |
27 void visitKeyFrameBlock(KeyFrameBlock node); | 27 void visitKeyFrameBlock(KeyFrameBlock node); |
28 void visitFontFaceDirective(FontFaceDirective node); | 28 void visitFontFaceDirective(FontFaceDirective node); |
29 void visitIncludeDirective(IncludeDirective node); | |
30 void visitStyletDirective(StyletDirective node); | 29 void visitStyletDirective(StyletDirective node); |
31 void visitNamespaceDirective(NamespaceDirective node); | 30 void visitNamespaceDirective(NamespaceDirective node); |
32 | 31 |
33 void visitRuleSet(RuleSet node); | 32 void visitRuleSet(RuleSet node); |
34 void visitDeclarationGroup(DeclarationGroup node); | 33 void visitDeclarationGroup(DeclarationGroup node); |
35 void visitMarginGroup(DeclarationGroup node); | 34 void visitMarginGroup(DeclarationGroup node); |
36 void visitDeclaration(Declaration node); | 35 void visitDeclaration(Declaration node); |
37 void visitSelectorGroup(SelectorGroup node); | 36 void visitSelectorGroup(SelectorGroup node); |
38 void visitSelector(Selector node); | 37 void visitSelector(Selector node); |
39 void visitSimpleSelectorSequence(SimpleSelectorSequence node); | 38 void visitSimpleSelectorSequence(SimpleSelectorSequence node); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 158 |
160 void visitKeyFrameBlock(KeyFrameBlock node) { | 159 void visitKeyFrameBlock(KeyFrameBlock node) { |
161 visitExpressions(node._blockSelectors); | 160 visitExpressions(node._blockSelectors); |
162 visitDeclarationGroup(node._declarations); | 161 visitDeclarationGroup(node._declarations); |
163 } | 162 } |
164 | 163 |
165 void visitFontFaceDirective(FontFaceDirective node) { | 164 void visitFontFaceDirective(FontFaceDirective node) { |
166 visitDeclarationGroup(node._declarations); | 165 visitDeclarationGroup(node._declarations); |
167 } | 166 } |
168 | 167 |
169 void visitIncludeDirective(IncludeDirective node) { | |
170 if (node._stylesheet != null) { | |
171 visitStyleSheet(node._stylesheet); | |
172 } | |
173 } | |
174 | |
175 void visitStyletDirective(StyletDirective node) { | 168 void visitStyletDirective(StyletDirective node) { |
176 _visitNodeList(node._rulesets); | 169 _visitNodeList(node._rulesets); |
177 } | 170 } |
178 | 171 |
179 void visitNamespaceDirective(NamespaceDirective node) { } | 172 void visitNamespaceDirective(NamespaceDirective node) { } |
180 | 173 |
181 void visitRuleSet(RuleSet node) { | 174 void visitRuleSet(RuleSet node) { |
182 visitSelectorGroup(node._selectorGroup); | 175 visitSelectorGroup(node._selectorGroup); |
183 visitDeclarationGroup(node._declarationGroup); | 176 visitDeclarationGroup(node._declarationGroup); |
184 } | 177 } |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 void visitPaddingExpression(PaddingExpression node) { | 401 void visitPaddingExpression(PaddingExpression node) { |
409 // TODO(terry): TBD | 402 // TODO(terry): TBD |
410 throw UnimplementedError; | 403 throw UnimplementedError; |
411 } | 404 } |
412 | 405 |
413 void visitWidthExpression(WidthExpression node) { | 406 void visitWidthExpression(WidthExpression node) { |
414 // TODO(terry): TBD | 407 // TODO(terry): TBD |
415 throw UnimplementedError; | 408 throw UnimplementedError; |
416 } | 409 } |
417 } | 410 } |
OLD | NEW |