annotate python/ppci/common.py @ 191:6b2bec5653f1

Added assembler testset
author Windel Bouwman
date Sun, 26 May 2013 15:28:07 +0200
parents 8104fc8b5e90
children b01429a5d695
rev   line source
153
e05b2b216bfc Added common
Windel Bouwman
parents:
diff changeset
1 from collections import namedtuple
e05b2b216bfc Added common
Windel Bouwman
parents:
diff changeset
2
191
6b2bec5653f1 Added assembler testset
Windel Bouwman
parents: 163
diff changeset
3 # Token is used in the lexical analyzer:
6b2bec5653f1 Added assembler testset
Windel Bouwman
parents: 163
diff changeset
4 Token = namedtuple('Token', 'typ val loc')
6b2bec5653f1 Added assembler testset
Windel Bouwman
parents: 163
diff changeset
5
163
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
6 class SourceLocation:
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
7 def __init__(self, row, col, ln):
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
8 self.row = row
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
9 self.col = col
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
10 self.length = ln
8104fc8b5e90 Added visitor to c3
Windel Bouwman
parents: 153
diff changeset
11
153
e05b2b216bfc Added common
Windel Bouwman
parents:
diff changeset
12 SourceRange = namedtuple('SourceRange', ['p1', 'p2'])
e05b2b216bfc Added common
Windel Bouwman
parents:
diff changeset
13