Lines Matching full:line
216 self.text = None # content of current line, with final \n stripped
217 self.line = 0 # number of current line
218 self.pos = 0 # current character position in current line
219 self.len = 0 # length of current line text
222 def setLineText(self,line):
223 """set the content of the (next) current line. should be called
225 self.text = line
226 self.len = len(line)
230 """refresh the content of 'line' with a new line of input"""
237 tok.lineno = self.line + 1
240 tok.lineno = self.line
250 self.line += 1
261 """try to peek the next n chars on the same line"""
335 if c == '/': # C++ comment line
475 """a CppTokenizer derived class that accepts a single line of text as input"""
476 def __init__(self,line,lineno=1):
478 self.line = lineno
479 self.setLineText(line)
488 self.line = lineno
498 def addLine(self,line):
499 """add a line to a CppLinesTokenizer. this can be done after tokenization
502 self.setLineText(line)
504 self.lines.append(line)
520 self.line = lineno
523 line = self.file.readline()
524 if len(line) > 0:
525 if line[-1] == '\n':
526 line = line[:-1]
527 if len(line) > 0 and line[-1] == "\r":
528 line = line[:-1]
529 self.setLineText(line)
553 def expectToken(self,id,line,col):
555 if self.token.lineno != line:
556 raise BadExpectedToken, "### BAD LINENO: token '%s' got '%d' expecting '%d'" % (id,self.token.lineno,line)
560 def expectTokenVal(self,id,value,line,col):
561 self.expectToken(id,line,col)
1258 line = "(" + op
1260 line += " %d)" % e[1]
1262 line += " 0x%x)" % e[1]
1264 line += " %s)" % e[1]
1266 line += " %s)" % e[1]
1269 line += " %s [" % arg[0]
1275 line += "%s%s" % (prefix, par)
1277 line += "])"
1279 line += " %s)" % self.dump_node(e[1])
1281 line += " %s %s)" % (self.dump_node(e[1]), self.dump_node(e[2]))
1283 line += " ?%s)" % repr(e[1])
1285 return line
1723 # state = 1 => previous line was tokLN
1724 # state = 0 => previous line was directive
1759 # an empty line
1767 # this line is not empty, remove trailing spaces
1880 NOTE: empty and line-numbering directives are ignored and removed
1928 # empty or line-numbering, ignore it