Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added taboutputdir parameter to control outputdir for tab files #84

Merged
merged 1 commit into from
Jun 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions pycparser/c_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def __init__(
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
Expand Down Expand Up @@ -64,6 +65,10 @@ def __init__(
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,
Expand All @@ -73,7 +78,8 @@ def __init__(

self.clex.build(
optimize=lex_optimize,
lextab=lextab)
lextab=lextab,
outputdir=taboutputdir)
self.tokens = self.clex.tokens

rules_with_opt = [
Expand Down Expand Up @@ -101,7 +107,8 @@ def __init__(
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
Expand Down