OLD | NEW |
1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
3 | 3 |
4 library engine.ast; | 4 library engine.ast; |
5 | 5 |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 import 'java_core.dart'; | 7 import 'java_core.dart'; |
8 import 'java_engine.dart'; | 8 import 'java_engine.dart'; |
9 import 'error.dart'; | 9 import 'error.dart'; |
10 import 'source.dart' show LineInfo; | 10 import 'source.dart' show LineInfo; |
(...skipping 11698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11709 try { | 11709 try { |
11710 node.accept(this); | 11710 node.accept(this); |
11711 } on NodeLocator_NodeFoundException catch (exception) { | 11711 } on NodeLocator_NodeFoundException catch (exception) { |
11712 } catch (exception) { | 11712 } catch (exception) { |
11713 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a
t offset (${_startOffset} - ${_endOffset})", exception); | 11713 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a
t offset (${_startOffset} - ${_endOffset})", exception); |
11714 return null; | 11714 return null; |
11715 } | 11715 } |
11716 return _foundNode; | 11716 return _foundNode; |
11717 } | 11717 } |
11718 Object visitNode(ASTNode node) { | 11718 Object visitNode(ASTNode node) { |
| 11719 int start = node.offset; |
| 11720 int end = start + node.length; |
| 11721 if (end < _startOffset) { |
| 11722 return null; |
| 11723 } |
| 11724 if (start > _endOffset) { |
| 11725 return null; |
| 11726 } |
11719 try { | 11727 try { |
11720 node.visitChildren(this); | 11728 node.visitChildren(this); |
11721 } on NodeLocator_NodeFoundException catch (exception) { | 11729 } on NodeLocator_NodeFoundException catch (exception) { |
11722 throw exception; | 11730 throw exception; |
11723 } catch (exception) { | 11731 } catch (exception) { |
11724 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra
versing an AST structure.", exception); | 11732 AnalysisEngine.instance.logger.logInformation2("Exception caught while tra
versing an AST structure.", exception); |
11725 } | 11733 } |
11726 int start = node.offset; | |
11727 int end = start + node.length; | |
11728 if (start <= _startOffset && _endOffset <= end) { | 11734 if (start <= _startOffset && _endOffset <= end) { |
11729 _foundNode = node; | 11735 _foundNode = node; |
11730 throw new NodeLocator_NodeFoundException(); | 11736 throw new NodeLocator_NodeFoundException(); |
11731 } | 11737 } |
11732 return null; | 11738 return null; |
11733 } | 11739 } |
11734 } | 11740 } |
11735 /** | 11741 /** |
11736 * Instances of the class {@code NodeFoundException} are used to cancel visiting
after a node has | 11742 * Instances of the class {@code NodeFoundException} are used to cancel visiting
after a node has |
11737 * been found. | 11743 * been found. |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13285 return elements[elements.length - 1].endToken; | 13291 return elements[elements.length - 1].endToken; |
13286 } | 13292 } |
13287 /** | 13293 /** |
13288 * Return the node that is the parent of each of the elements in the list. | 13294 * Return the node that is the parent of each of the elements in the list. |
13289 * @return the node that is the parent of each of the elements in the list | 13295 * @return the node that is the parent of each of the elements in the list |
13290 */ | 13296 */ |
13291 ASTNode getOwner() { | 13297 ASTNode getOwner() { |
13292 return owner; | 13298 return owner; |
13293 } | 13299 } |
13294 } | 13300 } |
OLD | NEW |