• Home
  • Raw
  • Download

Lines Matching refs:self

15     def __init__(self, tok, txt):  argument
16 self.tok = tok
17 self.txt = txt
20 def __init__(self, el, txt): argument
21 self.el = el
22 self.txt = txt
25 def __init__(self): argument
26 self.license_files = 0
27 self.exception_files = 0
28 self.licenses = [ ]
29 self.exceptions = { }
84 def __init__(self, spdx): argument
85 self.spdx = spdx
86 self.lasttok = None
87 self.lastid = None
88 self.lexer = lex.lex(module = self, reflags = re.UNICODE)
91 self.parser = yacc.yacc(module = self, write_tables = False, debug = False)
92 self.lines_checked = 0
93 self.checked = 0
94 self.spdx_valid = 0
95 self.spdx_errors = 0
96 self.curline = 0
97 self.deepest = 0
100 def validate(self, tok): argument
103 if not id in self.spdx.licenses:
105 self.lastid = id
107 if id not in self.spdx.exceptions:
109 if self.lastid not in self.spdx.exceptions[id]:
110 raise ParserException(tok, 'Exception not valid for license %s' %self.lastid)
111 self.lastid = None
113 self.lastid = None
116 def t_RPAR(self, tok): argument
118 self.lasttok = tok.type
121 def t_LPAR(self, tok): argument
123 self.lasttok = tok.type
126 def t_ID(self, tok): argument
129 if self.lasttok == 'EXC':
136 if val in self.reserved:
138 elif self.lasttok == 'WITH':
141 self.lasttok = tok.type
142 self.validate(tok)
145 def t_error(self, tok): argument
148 def p_expr(self, p): argument
156 def p_error(self, p): argument
162 def parse(self, expr): argument
163 self.lasttok = None
164 self.lastid = None
165 self.parser.parse(expr, lexer = self.lexer)
167 def parse_lines(self, fd, maxlines, fname): argument
168 self.checked += 1
169 self.curline = 0
173 self.curline += 1
174 if self.curline > maxlines:
176 self.lines_checked += 1
186 self.parse(expr)
187 self.spdx_valid += 1
198 sys.stdout.write('%s: %d:%d %s: %s\n' %(fname, self.curline, col, pe.txt, tok))
200 sys.stdout.write('%s: %d:0 %s\n' %(fname, self.curline, col, pe.txt))
201 self.spdx_errors += 1