Home | History | Annotate | Download | only in ply

Lines Matching defs:Lexer

104 # The following Lexer class implements the lexer runtime.   There are only
107 # input() - Store a new string in the lexer
109 # clone() - Clone the lexer
115 class Lexer:
122 self.lexstatere = {} # Dictionary mapping lexer states to master regexs
123 self.lexstateretext = {} # Dictionary mapping lexer states to regex strings
124 self.lexstaterenames = {} # Dictionary mapping lexer states to symbol names
125 self.lexstate = 'INITIAL' # Current lexer state
126 self.lexstatestack = [] # Stack of lexer states
148 # lexer to a new object. In this case, we have to rebind all methods in
172 # writetab() - Write lexer information to a table file
209 # readtab() - Read lexer information from a tab file
249 # input() - Push a new string into the lexer
299 # opttoken() - Return the next token from the Lexer
346 tok.lexer = self # Set additional attributes useful in token rules
383 tok.lexer = self
404 tok.lexer = self
430 # and build a Lexer object from it.
555 # This class represents information needed to build a lexer as extracted from a
869 global lexer
873 lexobj = Lexer()
884 # Get the module dictionary used for the lexer
910 raise SyntaxError("Can't build lexer")
917 lexer = lexobj
1022 lexer = lexobj
1052 # This runs the lexer as a main program
1055 def runmain(lexer=None, data=None):
1066 if lexer:
1067 _input = lexer.input
1071 if lexer:
1072 _token = lexer.token