yacc#
- astropy.utils.parsing.yacc(tabmodule: str, package: str) ThreadSafeParser[source]#
Create a parser from local variables.
It automatically compiles the parser in optimized mode, writing to
tabmodulein the same directory as the calling file.This function is thread-safe, and the returned parser is also thread-safe, provided that it does not share a lexer with any other parser.
It is only intended to work with parsers defined within the calling function, rather than at class or module scope.
- Parameters:
- tabmodule
python:str Name for the file to write with the generated tables, if it does not already exist (without
.pysuffix).- package
python:str Name of a test package which should be run with pytest to regenerate the output file. This is inserted into a comment in the generated file.
- tabmodule