Lines Matching refs:line

151         self.text = None   # content of current line, with final \n stripped
152 self.line = 0 # number of current line
153 self.pos = 0 # current character position in current line
154 self.len = 0 # length of current line text
157 def setLineText(self,line):
158 """set the content of the (next) current line. should be called
160 self.text = line
161 self.len = len(line)
165 """refresh the content of 'line' with a new line of input"""
172 tok.lineno = self.line + 1
175 tok.lineno = self.line
185 self.line += 1
196 """try to peek the next n chars on the same line"""
270 if c == '/': # C++ comment line
408 """a CppTokenizer derived class that accepts a single line of text as input"""
409 def __init__(self,line,lineno=1):
411 self.line = lineno
412 self.setLineText(line)
421 self.line = lineno
431 def addLine(self,line):
432 """add a line to a CppLinesTokenizer. this can be done after tokenization
435 self.setLineText(line)
437 self.lines.append(line)
453 self.line = lineno
456 line = self.file.readline()
457 if len(line) > 0:
458 if line[-1] == '\n':
459 line = line[:-1]
460 if len(line) > 0 and line[-1] == "\r":
461 line = line[:-1]
462 self.setLineText(line)
486 def expectToken(self,id,line,col):
488 if self.token.lineno != line:
489 raise BadExpectedToken, "### BAD LINENO: token '%s' got '%d' expecting '%d'" % (id,self.token.lineno,line)
493 def expectTokenVal(self,id,value,line,col):
494 self.expectToken(id,line,col)
829 line = "(" + op
831 line += " %d)" % e[1]
833 line += " 0x%x)" % e[1]
835 line += " %s)" % e[1]
837 line += " %s)" % e[1]
840 line += " %s [" % arg[0]
846 line += "%s%s" % (prefix, par)
848 line += "])"
850 line += " %s)" % self.dump_node(e[1])
852 line += " %s %s)" % (self.dump_node(e[1]), self.dump_node(e[2]))
854 line += " ?%s)" % repr(e[1])
856 return line
1197 line = 0 # index of line start
1205 # one the line start or the previous character. Don't append
1213 # If this is a line space, ignore the spaces we found previously
1214 # on the line, and remove empty lines.
1216 old_line = line
1219 line = ii
1221 if old_space == old_line: # line only contains spaces
1223 if ii-1 == old_line: # line is empty
1549 NOTE: empty and line-numbering directives are ignored and removed
1597 # empty or line-numbering, ignore it