Debian Codegraph @

pycparser223/pycparser/_build_tables.py

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 #-----------------------------------------------------------------
2 # pycparser: _build_tables.py
3 #
4 # A dummy for generating the lexing/parsing tables and and
5 # compiling them into .pyc for faster execution in optimized mode.
6 # Also generates AST code from the configuration file.
7 # Should be called from the pycparser directory.
8 #
9 # Eli Bendersky [https://eli.thegreenplace.net/]
10 # License: BSD
11 #-----------------------------------------------------------------
12
13 # Insert '.' and '..' as first entries to the search path for modules.
14 # Restricted environments like embeddable python do not include the
15 # current working directory on startup.
16 import sys
17 sys.path[0:0] = ['.', '..']
18
19 # Generate c_ast.py
20 from _ast_gen import ASTCodeGenerator
21 ast_gen = ASTCodeGenerator('_c_ast.cfg')
22 ast_gen.generate(open('c_ast.py', 'w'))
23
24 from pycparser import c_parser
25
26 # Generates the tables
27 #
28 c_parser.CParser(
29 lex_optimize=True,
30 yacc_debug=False,
31 yacc_optimize=True)
32
33 import lextab
34 import yacctab
35 import c_ast