annotate python/ppci/common.py @ 177:460db5669efa

Added clean pass for IR
author Windel Bouwman
date Mon, 22 Apr 2013 23:54:54 +0200
parents 8104fc8b5e90
children 6b2bec5653f1
rev   line source
153
e05b2b216bfc Added common
Windel Bouwman
parents:
diff changeset
1
e05b2b216bfc Added common
Windel Bouwman
parents:
diff changeset
2 from collections import namedtuple
e05b2b216bfc Added common
Windel Bouwman
parents:
diff changeset
3
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
4 #SourceLocation = namedtuple('SourceLocation', ['row', 'col'])
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
5 class SourceLocation:
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
6 def __init__(self, row, col, ln):
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
7 self.row = row
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
8 self.col = col
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
9 self.length = ln
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
10
153
e05b2b216bfc Added common
Windel Bouwman
parents:
diff changeset
11 SourceRange = namedtuple('SourceRange', ['p1', 'p2'])
e05b2b216bfc Added common
Windel Bouwman
parents:
diff changeset
12