sanitycheck: allow placing parsetab.py in a custom dir
when running multiple instances of sanitycheck, allow placing the
parsetab.py in a customer location that can be set using an environment
variable.
export PARSETAB_DIR=/tmp/
run sanitycheck and the parsetab.py will be placed in /tmp/.
Fixes #4513
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/scripts/sanity_chk/expr_parser.py b/scripts/sanity_chk/expr_parser.py
index 1436300..575b5c5 100644
--- a/scripts/sanity_chk/expr_parser.py
+++ b/scripts/sanity_chk/expr_parser.py
@@ -164,7 +164,10 @@
else:
raise SyntaxError("Unexpected end of expression")
-parser = yacc.yacc(debug=0)
+if "PARSETAB_DIR" not in os.environ:
+ parser = yacc.yacc(debug=0)
+else:
+ parser = yacc.yacc(debug=0, outputdir=os.environ["PARSETAB_DIR"])
def ast_sym(ast, env):
if ast in env: