diff options
author | Shai Berger <Shai.Berger@emc.com> | 2015-06-09 18:05:02 +0300 |
---|---|---|
committer | Shai Berger <Shai.Berger@emc.com> | 2015-06-09 18:30:20 +0300 |
commit | ec80dde76b34415c26ff53ccd21871fdafc4f900 (patch) | |
tree | 975ca001434721784c39ed169415513974e6e15a | |
parent | 3a5bfeab5d0a4e76bb1399b0208950072b28d6af (diff) | |
download | pycparser-ec80dde76b34415c26ff53ccd21871fdafc4f900.tar.gz |
Added taboutputdir parameter to control outputdir for tab files
-rw-r--r-- | pycparser/c_parser.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py index b10bba1..f4f7453 100644 --- a/pycparser/c_parser.py +++ b/pycparser/c_parser.py @@ -23,7 +23,8 @@ class CParser(PLYParser): lextab='pycparser.lextab', yacc_optimize=True, yacctab='pycparser.yacctab', - yacc_debug=False): + yacc_debug=False, + taboutputdir=''): """ Create a new CParser. Some arguments for controlling the debug/optimization @@ -64,6 +65,10 @@ class CParser(PLYParser): yacc_debug: Generate a parser.out file that explains how yacc built the parsing table from the grammar. + + taboutputdir: + Set this parameter to control the location of generated + lextab and yacctab files. """ self.clex = CLexer( error_func=self._lex_error_func, @@ -73,7 +78,8 @@ class CParser(PLYParser): self.clex.build( optimize=lex_optimize, - lextab=lextab) + lextab=lextab, + outputdir=taboutputdir) self.tokens = self.clex.tokens rules_with_opt = [ @@ -101,7 +107,8 @@ class CParser(PLYParser): start='translation_unit_or_empty', debug=yacc_debug, optimize=yacc_optimize, - tabmodule=yacctab) + tabmodule=yacctab, + outputdir=taboutputdir) # Stack of scopes for keeping track of symbols. _scope_stack[-1] is # the current (topmost) scope. Each scope is a dictionary that |