Home | History | Annotate | Download | only in ply

Lines Matching defs:Lexer

103 # The following Lexer class implements the lexer runtime.   There are only
106 # input() - Store a new string in the lexer
108 # clone() - Clone the lexer
114 class Lexer:
121 self.lexstatere = {} # Dictionary mapping lexer states to master regexs
122 self.lexstateretext = {} # Dictionary mapping lexer states to regex strings
123 self.lexstaterenames = {} # Dictionary mapping lexer states to symbol names
124 self.lexstate = "INITIAL" # Current lexer state
125 self.lexstatestack = [] # Stack of lexer states
145 # lexer to a new object. In this case, we have to rebind all methods in
169 # writetab() - Write lexer information to a table file
212 # readtab() - Read lexer information from a tab file
249 # input() - Push a new string into the lexer
298 # opttoken() - Return the next token from the Lexer
344 tok.lexer = self # Set additional attributes useful in token rules
381 tok.lexer = self
416 # and build a Lexer object from it.
541 # This class represents information needed to build a lexer as extracted from a
866 global lexer
869 lexobj = Lexer()
880 # Get the module dictionary used for the lexer
894 raise SyntaxError("Can't build lexer")
901 lexer = lexobj
1000 lexer = lexobj
1011 # This runs the lexer as a main program
1014 def runmain(lexer=None,data=None):
1025 if lexer:
1026 _input = lexer.input
1030 if lexer:
1031 _token = lexer.token