class_docstr: A lexer for the C language. After building it, set the
  input text with input(), and call token() to get new
  tokens.
  
  The public attribute filename can be set to an initial
  filename, but the lexer will update it upon #line
  directives.
class_docstr_tok: ["A","lexer","for","the","C","language",".","After","building","it",",","set","the","input","text","with","input","(",")",",","and","call","token","(",")","to","get","new","tokens",".","The","public","attribute","filename","can","be","set","to","an","initial","filename",",","but","the","lexer","will","update","it","upon","#","line","directives","."]
docstr: Create a new Lexer.
  
  error_func:
      An error function. Will be called with an error
      message, line and column as arguments, in case of
      an error during lexing.
  
  on_lbrace_func, on_rbrace_func:
      Called when an LBRACE or RBRACE is encountered
      (likely to push/pop type_lookup_func's scope)
  
  type_lookup_func:
      A type lookup function. Given a string, it must
      return True IFF this string is a name of a type
      that was defined with a typedef earlier.
docstr_tok: ["Create","a","new","Lexer",".","error_func",":","An","error","function",".","Will","be","called","with","an","error","message",",","line","and","column","as","arguments",",","in","case","of","an","error","during","lexing",".","on_lbrace_func",",","on_rbrace_func",":","Called","when","an","LBRACE","or","RBRACE","is","encountered","(","likely","to","push\/pop","type_lookup_func","'s","scope",")","type_lookup_func",":","A","type","lookup","function",".","Given","a","string",",","it","must","return","True","IFF","this","string","is","a","name","of","a","type","that","was","defined","with","a","typedef","earlier","."]
code: def __init__(
      self, error_func, on_lbrace_func, on_rbrace_func, type_lookup_func
  ):
      """Create a new Lexer.
  
      error_func:
          An error function. Will be called with an error
          message, line and column as arguments, in case of
          an error during lexing.
  
      on_lbrace_func, on_rbrace_func:
          Called when an LBRACE or RBRACE is encountered
          (likely to push/pop type_lookup_func's scope)
  
      type_lookup_func:
          A type lookup function. Given a string, it must
          return True IFF this string is a name of a type
          that was defined with a typedef earlier.
      """
      self.error_func = error_func
      self.on_lbrace_func = on_lbrace_func
      self.on_rbrace_func = on_rbrace_func
      self.type_lookup_func = type_lookup_func
      self.filename = ""
  
      # Keeps track of the last token returned from self.token()
      self.last_token = None
  
      # Allow either "# line" or "# <num>" to support GCC's
      # cpp output
      #
      self.line_pattern = re.compile(r"([ \t]*line\W)|([ \t]*\d+)")
      self.pragma_pattern = re.compile(r"[ \t]*pragma\W")
  
imports: import re
  from .ply import lex
  from .ply.lex import TOKEN
label_desc: Use image node_id 1 to create a new CLexer object from inherited base classes: object with example: obj = CLexer(error_func, on_lbrace_func, on_rbrace_func, type_lookup_func)