OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2012 The Native Client Authors. All rights reserved. | 3 # Copyright 2012 The Native Client Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can | 4 # Use of this source code is governed by a BSD-style license that can |
5 # be found in the LICENSE file. | 5 # be found in the LICENSE file. |
6 # Copyright 2012, Google Inc. | 6 # Copyright 2012, Google Inc. |
7 # | 7 # |
8 | 8 |
9 """ | 9 """ |
10 The core object model for the Decoder Generator. The dg_input and dg_output | 10 The core object model for the Decoder Generator. The dg_input and dg_output |
11 modules both operate in terms of these classes. | 11 modules both operate in terms of these classes. |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 self.action, self.arch) | 270 self.action, self.arch) |
271 | 271 |
272 def __cmp__(self, other): | 272 def __cmp__(self, other): |
273 """Compares two rows, so we can order pattern matches by specificity. | 273 """Compares two rows, so we can order pattern matches by specificity. |
274 """ | 274 """ |
275 return (cmp(self.patterns, other.patterns) | 275 return (cmp(self.patterns, other.patterns) |
276 or cmp(self.action, other.action)) | 276 or cmp(self.action, other.action)) |
277 | 277 |
278 def __repr__(self): | 278 def __repr__(self): |
279 return 'Row(%s, %s)' % (repr(self.patterns), repr(self.action)) | 279 return 'Row(%s, %s)' % (repr(self.patterns), repr(self.action)) |
OLD | NEW |