OLD | NEW |
1 #!/usr/bin/python | |
2 # | |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 3 # found in the LICENSE file. |
6 | 4 |
7 """ Visitor Object for traversing AST """ | 5 """ Visitor Object for traversing AST """ |
8 | 6 |
9 # | 7 # |
10 # IDLVisitor | 8 # IDLVisitor |
11 # | 9 # |
12 # The IDLVisitor class will traverse an AST truncating portions of the tree | 10 # The IDLVisitor class will traverse an AST truncating portions of the tree |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 class IDLRangeVisitor(object): | 72 class IDLRangeVisitor(object): |
75 def __init__(self, vmin, vmax, classList): | 73 def __init__(self, vmin, vmax, classList): |
76 self.vmin = vmin | 74 self.vmin = vmin |
77 self.vmax = vmax | 75 self.vmax = vmax |
78 self.classList = classList | 76 self.classList = classList |
79 | 77 |
80 def Filter(self, node, data): | 78 def Filter(self, node, data): |
81 if self.classList and node.cls not in self.classList: return False | 79 if self.classList and node.cls not in self.classList: return False |
82 if not node.IsVersion(self.version): return False | 80 if not node.IsVersion(self.version): return False |
83 return True | 81 return True |
84 | |
85 | |
OLD | NEW |