lex#
- astropy.utils.parsing.lex(lextab, package, reflags=64)[source]#
Create a lexer from local variables.
It automatically compiles the lexer in optimized mode, writing to
lextab
in the same directory as the calling file.This function is thread-safe. The returned lexer is not thread-safe, but if it is used exclusively with a single parser returned by
yacc()
then it will be safe.It is only intended to work with lexers defined within the calling function, rather than at class or module scope.
- Parameters: