File: elems.py

package info (click to toggle)
coccinelle 1.3.0.deb-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,888 kB
  • sloc: ml: 96,585; ansic: 23,664; sh: 1,695; perl: 1,576; makefile: 1,002; python: 922; lisp: 832; cpp: 655; awk: 70; csh: 12
file content (50 lines) | stat: -rw-r--r-- 1,627 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class Location:
 def __init__(self, file, current_element, ce_line, ce_column, ce_line_end, ce_column_end, line, column, line_end, column_end):
                self.file = file
                self.current_element = current_element
                self.current_element_line = ce_line
                self.current_element_column = ce_column
                self.current_element_line_end = ce_line_end
                self.current_element_column_end = ce_column_end
                self.line = line
                self.column = column
                self.line_end = line_end
                self.column_end = column_end

class Comment:
 def __init__(self, comment_before, comment_middle, comment_after):
                self.before = comment_before
                self.middle = comment_middle
                self.after = comment_after

class ElemBase:
        def __init__(self):
                pass

# class Expression(ElemBase):
#       def __init__(self, expr):
#               ElemBase.__init__(self)
#               self.expr = expr
#
#       def __str__(self):
#               return self.expr

class TermList(ElemBase):
        def __init__(self, expr, elements):
                ElemBase.__init__(self)
                self.expr = expr
                self.elements = elements

        def __getitem__(self,n):
                return self.elements[n]

        def __str__(self):
                return self.expr

# class Identifier(ElemBase):
#       def __init__(self, ident):
#               ElemBase.__init__(self)
#               self.ident = ident
#
#       def __str__(self):
#               return self.ident