fix generators after raise-from merge
[cython.git] / Cython / Compiler / Parsing.pxd
1 # We declare all of these here to type the first argument.
2
3 cimport cython
4 from Cython.Compiler.Scanning cimport PyrexScanner
5
6 ctypedef object (*p_sub_expr_func)(object)
7
8 # entry points
9
10 cpdef p_module(PyrexScanner s, pxd, full_module_name)
11 cpdef p_code(PyrexScanner s, level= *)
12
13 # internal parser states
14
15 cdef p_ident(PyrexScanner s, message =*)
16 cdef p_ident_list(PyrexScanner s)
17
18 cdef tuple p_binop_operator(PyrexScanner s)
19 cdef p_binop_expr(PyrexScanner s, ops, p_sub_expr_func p_sub_expr)
20 cpdef p_lambdef(PyrexScanner s, bint allow_conditional=*)
21 cdef p_lambdef_nocond(PyrexScanner s)
22 cdef p_test(PyrexScanner s)
23 cdef p_test_nocond(PyrexScanner s)
24 cdef p_or_test(PyrexScanner s)
25 cdef p_rassoc_binop_expr(PyrexScanner s, ops, p_subexpr)
26 cpdef p_and_test(PyrexScanner s)
27 cpdef p_not_test(PyrexScanner s)
28 cdef p_comparison(PyrexScanner s)
29 cdef p_test_or_starred_expr(PyrexScanner s)
30 cdef p_starred_expr(PyrexScanner s)
31 cdef p_cascaded_cmp(PyrexScanner s)
32 cdef p_cmp_op(PyrexScanner s)
33 cdef p_bit_expr(PyrexScanner s)
34 cdef p_xor_expr(s)
35 cdef p_and_expr(s)
36 cdef p_shift_expr(s)
37 cdef p_arith_expr(s)
38 cdef p_term(s)
39 cdef p_factor(s)
40 cdef _p_factor(PyrexScanner s)
41 cdef p_typecast(PyrexScanner s)
42 cdef p_sizeof(PyrexScanner s)
43 cdef p_yield_expression(PyrexScanner s)
44 cdef p_yield_statement(PyrexScanner s)
45 cdef p_power(PyrexScanner s)
46 cdef p_new_expr(PyrexScanner s)
47 cdef p_trailer(PyrexScanner s, node1)
48 cpdef p_call_parse_args(PyrexScanner s, bint allow_genexp = *)
49 cdef p_call_build_packed_args(pos, positional_args, keyword_args, star_arg)
50 cdef p_call(PyrexScanner s, function)
51 cdef p_index(PyrexScanner s, base)
52 cdef p_subscript_list(PyrexScanner s)
53 cdef p_subscript(PyrexScanner s)
54 cdef p_slice_element(PyrexScanner s, follow_set)
55 cdef expect_ellipsis(PyrexScanner s)
56 cdef make_slice_nodes(pos, subscripts)
57 cpdef make_slice_node(pos, start, stop = *, step = *)
58 cdef p_atom(PyrexScanner s)
59 @cython.locals(value=unicode)
60 cdef p_int_literal(PyrexScanner s)
61 cdef p_name(PyrexScanner s, name)
62 cdef p_cat_string_literal(PyrexScanner s)
63 cdef p_opt_string_literal(PyrexScanner s, required_type=*)
64 cdef bint check_for_non_ascii_characters(unicode string)
65 @cython.locals(systr=unicode, is_python3_source=bint)
66 cdef p_string_literal(PyrexScanner s, kind_override=*)
67 cdef p_list_maker(PyrexScanner s)
68 cdef p_comp_iter(PyrexScanner s, body)
69 cdef p_comp_for(PyrexScanner s, body)
70 cdef p_comp_if(PyrexScanner s, body)
71 cdef p_dict_or_set_maker(PyrexScanner s)
72 cdef p_backquote_expr(PyrexScanner s)
73 cpdef p_simple_expr_list(PyrexScanner s, expr=*)
74 cdef p_test_or_starred_expr_list(PyrexScanner s, expr=*)
75 cdef p_testlist(PyrexScanner s)
76 cdef p_testlist_star_expr(PyrexScanner s)
77 cdef p_testlist_comp(PyrexScanner s)
78 cdef p_genexp(PyrexScanner s, expr)
79
80 #-------------------------------------------------------
81 #
82 #   Statements
83 #
84 #-------------------------------------------------------
85
86 cdef p_global_statement(PyrexScanner s)
87 cdef p_nonlocal_statement(PyrexScanner s)
88 cdef p_expression_or_assignment(PyrexScanner s)
89 cdef p_print_statement(PyrexScanner s)
90 cdef p_exec_statement(PyrexScanner s)
91 cdef p_del_statement(PyrexScanner s)
92 cpdef p_pass_statement(PyrexScanner s, bint with_newline = *)
93 cdef p_break_statement(PyrexScanner s)
94 cdef p_continue_statement(PyrexScanner s)
95 cdef p_return_statement(PyrexScanner s)
96 cdef p_raise_statement(PyrexScanner s)
97 cdef p_import_statement(PyrexScanner s)
98 cpdef p_from_import_statement(PyrexScanner s, bint first_statement = *)
99 cdef p_imported_name(PyrexScanner s, bint is_cimport)
100 cpdef p_dotted_name(PyrexScanner s, bint as_allowed)
101 cdef p_as_name(PyrexScanner s)
102 cdef p_assert_statement(PyrexScanner s)
103 cdef p_if_statement(PyrexScanner s)
104 cdef p_if_clause(PyrexScanner s)
105 cdef p_else_clause(PyrexScanner s)
106 cdef p_while_statement(PyrexScanner s)
107 cdef p_for_statement(PyrexScanner s)
108 cpdef dict p_for_bounds(PyrexScanner s, bint allow_testlist = *)
109 cdef p_for_from_relation(PyrexScanner s)
110 cdef p_for_from_step(PyrexScanner s)
111 cdef p_target(PyrexScanner s, terminator)
112 cdef p_for_target(PyrexScanner s)
113 cdef p_for_iterator(PyrexScanner s, bint allow_testlist = *)
114 cdef p_try_statement(PyrexScanner s)
115 cdef p_except_clause(PyrexScanner s)
116 cdef p_include_statement(PyrexScanner s, ctx)
117 cdef p_with_statement(PyrexScanner s)
118 cdef p_with_items(PyrexScanner s)
119 cpdef p_simple_statement(PyrexScanner s, bint first_statement = *)
120 cpdef p_simple_statement_list(PyrexScanner s, ctx, bint first_statement = *)
121 cdef p_compile_time_expr(PyrexScanner s)
122 cdef p_DEF_statement(PyrexScanner s)
123 cdef p_IF_statement(PyrexScanner s, ctx)
124 cpdef p_statement(PyrexScanner s, ctx, bint first_statement = *)
125 cpdef p_statement_list(PyrexScanner s, ctx, bint first_statement = *)
126 cpdef p_suite(PyrexScanner s, ctx = *, bint with_doc = *, bint with_pseudo_doc = *)
127 cdef p_positional_and_keyword_args(PyrexScanner s, end_sy_set, templates = *)
128
129 cpdef p_c_base_type(PyrexScanner s, bint self_flag = *, bint nonempty = *, templates = *)
130 cdef p_calling_convention(PyrexScanner s)
131 cdef p_c_complex_base_type(PyrexScanner s)
132 cpdef p_c_simple_base_type(PyrexScanner s, bint self_flag, bint nonempty, templates = *)
133 cdef p_buffer_or_template(PyrexScanner s, base_type_node, templates)
134 cdef bint looking_at_name(PyrexScanner s) except -2
135 cdef bint looking_at_expr(PyrexScanner s) except -2
136 cdef bint looking_at_base_type(PyrexScanner s) except -2
137 cdef bint looking_at_dotted_name(PyrexScanner s) except -2
138 cdef p_sign_and_longness(PyrexScanner s)
139 cdef p_opt_cname(PyrexScanner s)
140 cpdef p_c_declarator(PyrexScanner s, ctx = *, bint empty = *, bint is_type = *, bint cmethod_flag = *,
141                    bint assignable = *, bint nonempty = *,
142                    bint calling_convention_allowed = *)
143 cdef p_c_array_declarator(PyrexScanner s, base)
144 cdef p_c_func_declarator(PyrexScanner s, pos, ctx, base, bint cmethod_flag)
145 cdef p_c_simple_declarator(PyrexScanner s, ctx, bint empty, bint is_type, bint cmethod_flag,
146                           bint assignable, bint nonempty)
147 cdef p_nogil(PyrexScanner s)
148 cdef p_with_gil(PyrexScanner s)
149 cdef p_exception_value_clause(PyrexScanner s)
150 cpdef p_c_arg_list(PyrexScanner s, ctx = *, bint in_pyfunc = *, bint cmethod_flag = *,
151                    bint nonempty_declarators = *, bint kw_only = *, bint annotated = *)
152 cdef p_optional_ellipsis(PyrexScanner s)
153 cpdef p_c_arg_decl(PyrexScanner s, ctx, in_pyfunc, bint cmethod_flag = *, bint nonempty = *, bint kw_only = *, bint annotated = *)
154 cdef p_api(PyrexScanner s)
155 cdef p_cdef_statement(PyrexScanner s, ctx)
156 cdef p_cdef_block(PyrexScanner s, ctx)
157 cdef p_cdef_extern_block(PyrexScanner s, pos, ctx)
158 cdef p_c_enum_definition(PyrexScanner s, pos, ctx)
159 cdef p_c_enum_line(PyrexScanner s, ctx, list items)
160 cdef p_c_enum_item(PyrexScanner s, ctx, list items)
161 cdef p_c_struct_or_union_definition(PyrexScanner s, pos, ctx)
162 cdef p_visibility(PyrexScanner s, prev_visibility)
163 cdef p_c_modifiers(PyrexScanner s)
164 cdef p_c_func_or_var_declaration(PyrexScanner s, pos, ctx)
165 cdef p_ctypedef_statement(PyrexScanner s, ctx)
166 cdef p_decorators(PyrexScanner s)
167 cdef p_def_statement(PyrexScanner s, list decorators = *)
168 cpdef p_varargslist(PyrexScanner s, terminator=*, bint annotated = *)
169 cpdef p_py_arg_decl(PyrexScanner s, bint annotated = *)
170 cdef p_class_statement(PyrexScanner s, decorators)
171 cdef p_c_class_definition(PyrexScanner s, pos,  ctx)
172 cdef p_c_class_options(PyrexScanner s)
173 cdef p_property_decl(PyrexScanner s)
174 cdef p_doc_string(PyrexScanner s)
175 cdef p_compiler_directive_comments(PyrexScanner s)
176 cdef p_cpp_class_definition(PyrexScanner s, pos, ctx)