💾 Archived View for tris.fyi › pydoc › pycparser captured on 2023-01-29 at 03:50:23. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-07-16)

-=-=-=-=-=-=-

Back to module index

Go to module by name

pycparser (package)

This module has no docstring.

Classes

CParser

p_abstract_declarator_1(self, p)

   abstract_declarator     : pointer
        
p_abstract_declarator_2(self, p)

   abstract_declarator     : pointer direct_abstract_declarator
        
p_abstract_declarator_3(self, p)

   abstract_declarator     : direct_abstract_declarator
        
p_alignment_specifier(self, p)

   alignment_specifier  : _ALIGNAS LPAREN type_name RPAREN
                                   | _ALIGNAS LPAREN constant_expression RPAREN
        
p_argument_expression_list(self, p)

   argument_expression_list    : assignment_expression
                                          | argument_expression_list COMMA assignment_expression
        
p_assignment_expression(self, p)

   assignment_expression   : conditional_expression
                                      | unary_expression assignment_operator assignment_expression
        
p_assignment_operator(self, p)

   assignment_operator : EQUALS
                                  | XOREQUAL
                                  | TIMESEQUAL
                                  | DIVEQUAL
                                  | MODEQUAL
                                  | PLUSEQUAL
                                  | MINUSEQUAL
                                  | LSHIFTEQUAL
                                  | RSHIFTEQUAL
                                  | ANDEQUAL
                                  | OREQUAL
        
p_atomic_specifier(self, p)

   atomic_specifier  : _ATOMIC LPAREN type_name RPAREN
        
p_binary_expression(self, p)

   binary_expression   : cast_expression
                                  | binary_expression TIMES binary_expression
                                  | binary_expression DIVIDE binary_expression
                                  | binary_expression MOD binary_expression
                                  | binary_expression PLUS binary_expression
                                  | binary_expression MINUS binary_expression
                                  | binary_expression RSHIFT binary_expression
                                  | binary_expression LSHIFT binary_expression
                                  | binary_expression LT binary_expression
                                  | binary_expression LE binary_expression
                                  | binary_expression GE binary_expression
                                  | binary_expression GT binary_expression
                                  | binary_expression EQ binary_expression
                                  | binary_expression NE binary_expression
                                  | binary_expression AND binary_expression
                                  | binary_expression OR binary_expression
                                  | binary_expression XOR binary_expression
                                  | binary_expression LAND binary_expression
                                  | binary_expression LOR binary_expression
        
p_block_item(self, p)

   block_item  : declaration
                          | statement
        
p_block_item_list(self, p)

   block_item_list : block_item
                              | block_item_list block_item
        
p_brace_close(self, p)

   brace_close :   RBRACE
        
p_brace_open(self, p)

   brace_open  :   LBRACE
        
p_cast_expression_1(self, p)

   cast_expression : unary_expression 
p_cast_expression_2(self, p)

   cast_expression : LPAREN type_name RPAREN cast_expression 
p_compound_statement_1(self, p)

   compound_statement : brace_open block_item_list_opt brace_close 
p_conditional_expression(self, p)

   conditional_expression  : binary_expression
                                      | binary_expression CONDOP expression COLON conditional_expression
        
p_constant_1(self, p)

   constant    : INT_CONST_DEC
                          | INT_CONST_OCT
                          | INT_CONST_HEX
                          | INT_CONST_BIN
                          | INT_CONST_CHAR
        
p_constant_2(self, p)

   constant    : FLOAT_CONST
                          | HEX_FLOAT_CONST
        
p_constant_3(self, p)

   constant    : CHAR_CONST
                          | WCHAR_CONST
                          | U8CHAR_CONST
                          | U16CHAR_CONST
                          | U32CHAR_CONST
        
p_constant_expression(self, p)

   constant_expression : conditional_expression 
p_decl_body(self, p)

   decl_body : declaration_specifiers init_declarator_list_opt
                        | declaration_specifiers_no_type id_init_declarator_list_opt
        
p_declaration(self, p)

   declaration : decl_body SEMI
        
p_declaration_list(self, p)

   declaration_list    : declaration
                                  | declaration_list declaration
        
p_declaration_specifiers_1(self, p)

   declaration_specifiers  : declaration_specifiers type_qualifier
        
p_declaration_specifiers_2(self, p)

   declaration_specifiers  : declaration_specifiers storage_class_specifier
        
p_declaration_specifiers_3(self, p)

   declaration_specifiers  : declaration_specifiers function_specifier
        
p_declaration_specifiers_4(self, p)

   declaration_specifiers  : declaration_specifiers type_specifier_no_typeid
        
p_declaration_specifiers_5(self, p)

   declaration_specifiers  : type_specifier
        
p_declaration_specifiers_6(self, p)

   declaration_specifiers  : declaration_specifiers_no_type type_specifier
        
p_declaration_specifiers_7(self, p)

   declaration_specifiers  : declaration_specifiers alignment_specifier
        
p_declaration_specifiers_no_type_1(self, p)

   declaration_specifiers_no_type  : type_qualifier declaration_specifiers_no_type_opt
        
p_declaration_specifiers_no_type_2(self, p)

   declaration_specifiers_no_type  : storage_class_specifier declaration_specifiers_no_type_opt
        
p_declaration_specifiers_no_type_3(self, p)

   declaration_specifiers_no_type  : function_specifier declaration_specifiers_no_type_opt
        
p_declaration_specifiers_no_type_4(self, p)

   declaration_specifiers_no_type  : atomic_specifier declaration_specifiers_no_type_opt
        
p_declaration_specifiers_no_type_5(self, p)

   declaration_specifiers_no_type  : alignment_specifier declaration_specifiers_no_type_opt
        
p_declarator(self, p)

   declarator  : id_declarator
                          | typeid_declarator
        
p_designation(self, p)

   designation : designator_list EQUALS
        
p_designator(self, p)

   designator  : LBRACKET constant_expression RBRACKET
                          | PERIOD identifier
        
p_designator_list(self, p)

   designator_list : designator
                              | designator_list designator
        
p_direct_abstract_declarator_1(self, p)

   direct_abstract_declarator  : LPAREN abstract_declarator RPAREN 
p_direct_abstract_declarator_2(self, p)

   direct_abstract_declarator  : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET
        
p_direct_abstract_declarator_3(self, p)

   direct_abstract_declarator  : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET
        
p_direct_abstract_declarator_4(self, p)

   direct_abstract_declarator  : direct_abstract_declarator LBRACKET TIMES RBRACKET
        
p_direct_abstract_declarator_5(self, p)

   direct_abstract_declarator  : LBRACKET TIMES RBRACKET
        
p_direct_abstract_declarator_6(self, p)

   direct_abstract_declarator  : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN
        
p_direct_abstract_declarator_7(self, p)

   direct_abstract_declarator  : LPAREN parameter_type_list_opt RPAREN
        
p_direct_id_declarator_1(self, p)

   direct_id_declarator   : ID
        
p_direct_id_declarator_2(self, p)

   direct_id_declarator   : LPAREN id_declarator RPAREN
        
p_direct_id_declarator_3(self, p)

   direct_id_declarator   : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET
        
p_direct_id_declarator_4(self, p)

   direct_id_declarator   : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET
                                      | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET
        
p_direct_id_declarator_5(self, p)

   direct_id_declarator   : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET
        
p_direct_id_declarator_6(self, p)

   direct_id_declarator   : direct_id_declarator LPAREN parameter_type_list RPAREN
                                      | direct_id_declarator LPAREN identifier_list_opt RPAREN
        
p_direct_typeid_declarator_1(self, p)

   direct_typeid_declarator   : TYPEID
        
p_direct_typeid_declarator_2(self, p)

   direct_typeid_declarator   : LPAREN typeid_declarator RPAREN
        
p_direct_typeid_declarator_3(self, p)

   direct_typeid_declarator   : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET
        
p_direct_typeid_declarator_4(self, p)

   direct_typeid_declarator   : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET
                                      | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET
        
p_direct_typeid_declarator_5(self, p)

   direct_typeid_declarator   : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET
        
p_direct_typeid_declarator_6(self, p)

   direct_typeid_declarator   : direct_typeid_declarator LPAREN parameter_type_list RPAREN
                                      | direct_typeid_declarator LPAREN identifier_list_opt RPAREN
        
p_direct_typeid_noparen_declarator_1(self, p)

   direct_typeid_noparen_declarator   : TYPEID
        
p_direct_typeid_noparen_declarator_3(self, p)

   direct_typeid_noparen_declarator   : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET
        
p_direct_typeid_noparen_declarator_4(self, p)

   direct_typeid_noparen_declarator   : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET
                                      | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET
        
p_direct_typeid_noparen_declarator_5(self, p)

   direct_typeid_noparen_declarator   : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET
        
p_direct_typeid_noparen_declarator_6(self, p)

   direct_typeid_noparen_declarator   : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN
                                      | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN
        
p_empty(self, p)

  empty : 
p_enum_specifier_1(self, p)

   enum_specifier  : ENUM ID
                              | ENUM TYPEID
        
p_enum_specifier_2(self, p)

   enum_specifier  : ENUM brace_open enumerator_list brace_close
        
p_enum_specifier_3(self, p)

   enum_specifier  : ENUM ID brace_open enumerator_list brace_close
                              | ENUM TYPEID brace_open enumerator_list brace_close
        
p_enumerator(self, p)

   enumerator  : ID
                          | ID EQUALS constant_expression
        
p_enumerator_list(self, p)

   enumerator_list : enumerator
                              | enumerator_list COMMA
                              | enumerator_list COMMA enumerator
        
p_error(self, p)
p_expression(self, p)

   expression  : assignment_expression
                          | expression COMMA assignment_expression
        
p_expression_statement(self, p)

   expression_statement : expression_opt SEMI 
p_external_declaration_1(self, p)

   external_declaration    : function_definition
        
p_external_declaration_2(self, p)

   external_declaration    : declaration
        
p_external_declaration_3(self, p)

   external_declaration    : pp_directive
                                      | pppragma_directive
        
p_external_declaration_4(self, p)

   external_declaration    : SEMI
        
p_external_declaration_5(self, p)

   external_declaration    : static_assert
        
p_function_definition_1(self, p)

   function_definition : id_declarator declaration_list_opt compound_statement
        
p_function_definition_2(self, p)

   function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement
        
p_function_specifier(self, p)

   function_specifier  : INLINE
                                  | _NORETURN
        
p_id_declarator_1(self, p)

   id_declarator  : direct_id_declarator
        
p_id_declarator_2(self, p)

   id_declarator  : pointer direct_id_declarator
        
p_id_init_declarator(self, p)

   id_init_declarator : id_declarator
                                 | id_declarator EQUALS initializer
        
p_id_init_declarator_list(self, p)

   id_init_declarator_list    : id_init_declarator
                                         | id_init_declarator_list COMMA init_declarator
        
p_identifier(self, p)

   identifier  : ID 
p_identifier_list(self, p)

   identifier_list : identifier
                              | identifier_list COMMA identifier
        
p_init_declarator(self, p)

   init_declarator : declarator
                              | declarator EQUALS initializer
        
p_init_declarator_list(self, p)

   init_declarator_list    : init_declarator
                                      | init_declarator_list COMMA init_declarator
        
p_initializer_1(self, p)

   initializer : assignment_expression
        
p_initializer_2(self, p)

   initializer : brace_open initializer_list_opt brace_close
                          | brace_open initializer_list COMMA brace_close
        
p_initializer_list(self, p)

   initializer_list    : designation_opt initializer
                                  | initializer_list COMMA designation_opt initializer
        
p_iteration_statement_1(self, p)

   iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement 
p_iteration_statement_2(self, p)

   iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI 
p_iteration_statement_3(self, p)

   iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement 
p_iteration_statement_4(self, p)

   iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement 
p_jump_statement_1(self, p)

   jump_statement  : GOTO ID SEMI 
p_jump_statement_2(self, p)

   jump_statement  : BREAK SEMI 
p_jump_statement_3(self, p)

   jump_statement  : CONTINUE SEMI 
p_jump_statement_4(self, p)

   jump_statement  : RETURN expression SEMI
                              | RETURN SEMI
        
p_labeled_statement_1(self, p)

   labeled_statement : ID COLON pragmacomp_or_statement 
p_labeled_statement_2(self, p)

   labeled_statement : CASE constant_expression COLON pragmacomp_or_statement 
p_labeled_statement_3(self, p)

   labeled_statement : DEFAULT COLON pragmacomp_or_statement 
p_offsetof_member_designator(self, p)

   offsetof_member_designator : identifier
                                           | offsetof_member_designator PERIOD identifier
                                           | offsetof_member_designator LBRACKET expression RBRACKET
        
p_parameter_declaration_1(self, p)

   parameter_declaration   : declaration_specifiers id_declarator
                                      | declaration_specifiers typeid_noparen_declarator
        
p_parameter_declaration_2(self, p)

   parameter_declaration   : declaration_specifiers abstract_declarator_opt
        
p_parameter_list(self, p)

   parameter_list  : parameter_declaration
                              | parameter_list COMMA parameter_declaration
        
p_parameter_type_list(self, p)

   parameter_type_list : parameter_list
                                  | parameter_list COMMA ELLIPSIS
        
p_parenthesized_compound_expression(self, p)

   assignment_expression : LPAREN compound_statement RPAREN 
p_pointer(self, p)

   pointer : TIMES type_qualifier_list_opt
                      | TIMES type_qualifier_list_opt pointer
        
p_postfix_expression_1(self, p)

   postfix_expression  : primary_expression 
p_postfix_expression_2(self, p)

   postfix_expression  : postfix_expression LBRACKET expression RBRACKET 
p_postfix_expression_3(self, p)

   postfix_expression  : postfix_expression LPAREN argument_expression_list RPAREN
                                  | postfix_expression LPAREN RPAREN
        
p_postfix_expression_4(self, p)

   postfix_expression  : postfix_expression PERIOD ID
                                  | postfix_expression PERIOD TYPEID
                                  | postfix_expression ARROW ID
                                  | postfix_expression ARROW TYPEID
        
p_postfix_expression_5(self, p)

   postfix_expression  : postfix_expression PLUSPLUS
                                  | postfix_expression MINUSMINUS
        
p_postfix_expression_6(self, p)

   postfix_expression  : LPAREN type_name RPAREN brace_open initializer_list brace_close
                                  | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close
        
p_pp_directive(self, p)

   pp_directive  : PPHASH
        
p_pppragma_directive(self, p)

   pppragma_directive      : PPPRAGMA
                                      | PPPRAGMA PPPRAGMASTR
        
p_pragmacomp_or_statement(self, p)

   pragmacomp_or_statement     : pppragma_directive statement
                                          | statement
        
p_primary_expression_1(self, p)

   primary_expression  : identifier 
p_primary_expression_2(self, p)

   primary_expression  : constant 
p_primary_expression_3(self, p)

   primary_expression  : unified_string_literal
                                  | unified_wstring_literal
        
p_primary_expression_4(self, p)

   primary_expression  : LPAREN expression RPAREN 
p_primary_expression_5(self, p)

   primary_expression  : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN
        
p_selection_statement_1(self, p)

   selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement 
p_selection_statement_2(self, p)

   selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement 
p_selection_statement_3(self, p)

   selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement 
p_specifier_qualifier_list_1(self, p)

   specifier_qualifier_list    : specifier_qualifier_list type_specifier_no_typeid
        
p_specifier_qualifier_list_2(self, p)

   specifier_qualifier_list    : specifier_qualifier_list type_qualifier
        
p_specifier_qualifier_list_3(self, p)

   specifier_qualifier_list  : type_specifier
        
p_specifier_qualifier_list_4(self, p)

   specifier_qualifier_list  : type_qualifier_list type_specifier
        
p_specifier_qualifier_list_5(self, p)

   specifier_qualifier_list  : alignment_specifier
        
p_specifier_qualifier_list_6(self, p)

   specifier_qualifier_list  : specifier_qualifier_list alignment_specifier
        
p_statement(self, p)

   statement   : labeled_statement
                          | expression_statement
                          | compound_statement
                          | selection_statement
                          | iteration_statement
                          | jump_statement
                          | pppragma_directive
                          | static_assert
        
p_static_assert_declaration(self, p)

   static_assert           : _STATIC_ASSERT LPAREN constant_expression COMMA unified_string_literal RPAREN
                                      | _STATIC_ASSERT LPAREN constant_expression RPAREN
        
p_storage_class_specifier(self, p)

   storage_class_specifier : AUTO
                                      | REGISTER
                                      | STATIC
                                      | EXTERN
                                      | TYPEDEF
                                      | _THREAD_LOCAL
        
p_struct_declaration_1(self, p)

   struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI
        
p_struct_declaration_2(self, p)

   struct_declaration : SEMI
        
p_struct_declaration_3(self, p)

   struct_declaration : pppragma_directive
        
p_struct_declaration_list(self, p)

   struct_declaration_list     : struct_declaration
                                          | struct_declaration_list struct_declaration
        
p_struct_declarator_1(self, p)

   struct_declarator : declarator
        
p_struct_declarator_2(self, p)

   struct_declarator   : declarator COLON constant_expression
                                  | COLON constant_expression
        
p_struct_declarator_list(self, p)

   struct_declarator_list  : struct_declarator
                                      | struct_declarator_list COMMA struct_declarator
        
p_struct_or_union(self, p)

   struct_or_union : STRUCT
                              | UNION
        
p_struct_or_union_specifier_1(self, p)

   struct_or_union_specifier   : struct_or_union ID
                                          | struct_or_union TYPEID
        
p_struct_or_union_specifier_2(self, p)

   struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close
                                        | struct_or_union brace_open brace_close
        
p_struct_or_union_specifier_3(self, p)

   struct_or_union_specifier   : struct_or_union ID brace_open struct_declaration_list brace_close
                                          | struct_or_union ID brace_open brace_close
                                          | struct_or_union TYPEID brace_open struct_declaration_list brace_close
                                          | struct_or_union TYPEID brace_open brace_close
        
p_translation_unit_1(self, p)

   translation_unit    : external_declaration
        
p_translation_unit_2(self, p)

   translation_unit    : translation_unit external_declaration
        
p_translation_unit_or_empty(self, p)

   translation_unit_or_empty   : translation_unit
                                          | empty
        
p_type_name(self, p)

   type_name   : specifier_qualifier_list abstract_declarator_opt
        
p_type_qualifier(self, p)

   type_qualifier  : CONST
                              | RESTRICT
                              | VOLATILE
                              | _ATOMIC
        
p_type_qualifier_list(self, p)

   type_qualifier_list : type_qualifier
                                  | type_qualifier_list type_qualifier
        
p_type_specifier(self, p)

   type_specifier  : typedef_name
                              | enum_specifier
                              | struct_or_union_specifier
                              | type_specifier_no_typeid
                              | atomic_specifier
        
p_type_specifier_no_typeid(self, p)

   type_specifier_no_typeid  : VOID
                                        | _BOOL
                                        | CHAR
                                        | SHORT
                                        | INT
                                        | LONG
                                        | FLOAT
                                        | DOUBLE
                                        | _COMPLEX
                                        | SIGNED
                                        | UNSIGNED
                                        | __INT128
        
p_typedef_name(self, p)

   typedef_name : TYPEID 
p_typeid_declarator_1(self, p)

   typeid_declarator  : direct_typeid_declarator
        
p_typeid_declarator_2(self, p)

   typeid_declarator  : pointer direct_typeid_declarator
        
p_typeid_noparen_declarator_1(self, p)

   typeid_noparen_declarator  : direct_typeid_noparen_declarator
        
p_typeid_noparen_declarator_2(self, p)

   typeid_noparen_declarator  : pointer direct_typeid_noparen_declarator
        
p_unary_expression_1(self, p)

   unary_expression    : postfix_expression 
p_unary_expression_2(self, p)

   unary_expression    : PLUSPLUS unary_expression
                                  | MINUSMINUS unary_expression
                                  | unary_operator cast_expression
        
p_unary_expression_3(self, p)

   unary_expression    : SIZEOF unary_expression
                                  | SIZEOF LPAREN type_name RPAREN
                                  | _ALIGNOF LPAREN type_name RPAREN
        
p_unary_operator(self, p)

   unary_operator  : AND
                              | TIMES
                              | PLUS
                              | MINUS
                              | NOT
                              | LNOT
        
p_unified_string_literal(self, p)

   unified_string_literal  : STRING_LITERAL
                                      | unified_string_literal STRING_LITERAL
        
p_unified_wstring_literal(self, p)

   unified_wstring_literal : WSTRING_LITERAL
                                      | U8STRING_LITERAL
                                      | U16STRING_LITERAL
                                      | U32STRING_LITERAL
                                      | unified_wstring_literal WSTRING_LITERAL
                                      | unified_wstring_literal U8STRING_LITERAL
                                      | unified_wstring_literal U16STRING_LITERAL
                                      | unified_wstring_literal U32STRING_LITERAL
        
parse(self, text, filename='', debug=False)

   Parses C code and returns an AST.

              text:
                  A string containing the C source code

              filename:
                  Name of the file being parsed (for meaningful
                  error messages)

              debug:
                  Debug flag to YACC
        
precedence = (('left', 'LOR'), ('left', 'LAND'), ('left', 'OR'), ('left', 'XOR'), ('left', 'AND'), ('left', 'EQ', 'NE'), ('left', 'GT', 'GE', 'LT', 'LE'), ('left', 'RSHIFT', 'LSHIFT'), ('left', 'PLUS', 'MINUS'), ('left', 'TIMES', 'DIVIDE', 'MOD'))

Functions

check_output

check_output(*popenargs, timeout=None, **kwargs)

  Run command with arguments and return its output.

      If the exit code was non-zero it raises a CalledProcessError.  The
      CalledProcessError object will have the return code in the returncode
      attribute and output in the output attribute.

      The arguments are the same as for the Popen constructor.  Example:

      >>> check_output(["ls", "-l", "/dev/null"])
      b'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

      The stdout argument is not allowed as it is used internally.
      To capture standard error in the result, use stderr=STDOUT.

      >>> check_output(["/bin/sh", "-c",
      ...               "ls -l non_existent_file ; exit 0"],
      ...              stderr=STDOUT)
      b'ls: non_existent_file: No such file or directory\n'

      There is an additional optional argument, "input", allowing you to
      pass a string to the subprocess's stdin.  If you use this argument
      you may not also use the Popen constructor's "stdin" argument, as
      it too will be used internally.  Example:

      >>> check_output(["sed", "-e", "s/foo/bar/"],
      ...              input=b"when in the course of fooman events\n")
      b'when in the course of barman events\n'

      By default, all communication is in bytes, and therefore any "input"
      should be bytes, and the return value will be bytes.  If in text mode,
      any "input" should be a string, and the return value will be a string
      decoded according to locale encoding, or by "encoding" if set. Text mode
      is triggered by setting any of text, encoding, errors or universal_newlines.
    

parse_file

parse_file(filename, use_cpp=False, cpp_path='cpp', cpp_args='', parser=None)

   Parse a C file using pycparser.

          filename:
              Name of the file you want to parse.

          use_cpp:
              Set to True if you want to execute the C pre-processor
              on the file prior to parsing it.

          cpp_path:
              If use_cpp is True, this is the path to 'cpp' on your
              system. If no path is provided, it attempts to just
              execute 'cpp', so it must be in your PATH.

          cpp_args:
              If use_cpp is True, set this to the command line arguments strings
              to cpp. Be careful with quotes - it's best to pass a raw string
              (r'') here. For example:
              r'-I../utils/fake_libc_include'
              If several arguments are required, pass a list of strings.

          parser:
              Optional parser object to be used instead of the default CParser

          When successful, an AST is returned. ParseError can be
          thrown if the file doesn't parse successfully.

          Errors from cpp will be printed out.
    

preprocess_file

preprocess_file(filename, cpp_path='cpp', cpp_args='')

   Preprocess a file using cpp.

          filename:
              Name of the file you want to preprocess.

          cpp_path:
          cpp_args:
              Refer to the documentation of parse_file for the meaning of these
              arguments.

          When successful, returns the preprocessed file's contents.
          Errors from cpp will be printed out.
    

Modules

ast_transforms

c_ast

c_lexer

c_parser

io

ply

plyparser