Coccinelle release-1.0.0-rc11
[bpt/coccinelle.git] / python / coccilib / elems.py
1 class Location:
2 def __init__(self, file, current_element, line, column, line_end, column_end):
3 self.file = file
4 self.current_element = current_element
5 self.line = line
6 self.column = column
7 self.line_end = line_end
8 self.column_end = column_end
9
10 class ElemBase:
11 def __init__(self):
12 pass
13
14 # class Expression(ElemBase):
15 # def __init__(self, expr):
16 # ElemBase.__init__(self)
17 # self.expr = expr
18 #
19 # def __str__(self):
20 # return self.expr
21
22 class TermList(ElemBase):
23 def __init__(self, expr, elements):
24 ElemBase.__init__(self)
25 self.expr = expr
26 self.elements = elements
27
28 def __getitem__(self,n):
29 return self.elements[n]
30
31 def __str__(self):
32 return self.expr
33
34 # class Identifier(ElemBase):
35 # def __init__(self, ident):
36 # ElemBase.__init__(self)
37 # self.ident = ident
38 #
39 # def __str__(self):
40 # return self.ident