'Create a new CParser.
Some arguments for controlling the debug/optimization
level of the parser are provided. The defaults are
tuned for release/performance mode.
The simple rules for using them are:
*) When tweaking CParser/CLexer, set these to False
*) When releasing a stable parser, set to True
lex_optimize:
Set to False when you\'re modifying the lexer.
Otherwise, changes in the lexer won\'t be used, if
some lextab.py file exists.
When releasing with a stable lexer, set to True
to save the re-generation of the lexer table on
each run.
lextab:
Points to the lex table that\'s used for optimized
mode. Only if you\'re modifying the lexer and want
some tests to avoid re-generating the table, make
this point to a local lex table file (that\'s been
earlier generated with lex_optimize=True)
yacc_optimize:
Set to False when you\'re modifying the parser.
Otherwise, changes in the parser won\'t be used, if
some parsetab.py file exists.
When releasing with a stable parser, set to True
to save the re-generation of the parser table on
each run.
yacctab:
Points to the yacc table that\'s used for optimized
mode. Only if you\'re modifying the parser, make
this point to a local yacc table file
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.'

def __init__(self, lex_optimize=True, lextab='pycparser.lextab', yacc_optimize=True, yacctab='pycparser.yacctab', yacc_debug=False, taboutputdir=''):

    self.clex = CLexer(error_func=self._lex_error_func, on_lbrace_func=self._lex_on_lbrace_func, on_rbrace_func=self._lex_on_rbrace_func, type_lookup_func=self._lex_type_lookup_func)
    self.clex.build(optimize=lex_optimize, lextab=lextab, outputdir=taboutputdir)
    self.tokens = self.clex.tokens
    rules_with_opt = ['abstract_declarator', 'assignment_expression', 'declaration_list', 'declaration_specifiers', 'designation', 'expression', 'identifier_list', 'init_declarator_list', 'initializer_list', 'parameter_type_list', 'specifier_qualifier_list', 'block_item_list', 'type_qualifier_list', 'struct_declarator_list']
    for rule in rules_with_opt:
        self._create_opt_rule(rule)
    self.cparser = yacc.yacc(module=self, start='translation_unit_or_empty', debug=yacc_debug, optimize=yacc_optimize, tabmodule=yacctab, outputdir=taboutputdir)
    self._scope_stack = [dict()]
    self._last_yielded_token = None
