Cython has moved to github.

cython-devel

view Cython/Compiler/Parsing.pxd @ 3484:b254c4dbc089

support for some Python 3 (or 2.6+) syntax features (found by test_grammar.py in Py3.1.1):
- oct/bin notation: 0o12345, 0b10101
- function annotations (only pure syntax support, not currently used)
also: allow decorators on inner functions
author Stefan Behnel <scoder@users.berlios.de>
date Thu Jan 28 23:05:39 2010 +0100 (2 years ago)
parents d4de887487f9
children 7925926971e9
line source
1 # We declare all of these here to type the first argument.
3 from Cython.Compiler.Scanning cimport PyrexScanner
6 cpdef p_ident(PyrexScanner s, message =*)
7 cpdef p_ident_list(PyrexScanner s)
9 cpdef p_binop_expr(PyrexScanner s, ops, p_sub_expr)
10 cpdef p_simple_expr(PyrexScanner s)
11 cpdef p_lambdef(PyrexScanner s, bint allow_conditional=*)
12 cpdef p_lambdef_nocond(PyrexScanner s)
13 cpdef p_test(PyrexScanner s)
14 cpdef p_test_nocond(PyrexScanner s)
15 cpdef p_or_test(PyrexScanner s)
16 cpdef p_rassoc_binop_expr(PyrexScanner s, ops, p_subexpr)
17 cpdef p_and_test(PyrexScanner s)
18 cpdef p_not_test(PyrexScanner s)
19 cpdef p_comparison(PyrexScanner s)
20 cpdef p_cascaded_cmp(PyrexScanner s)
21 cpdef p_cmp_op(PyrexScanner s)
22 cpdef p_starred_expr(PyrexScanner s)
23 cpdef p_bit_expr(PyrexScanner s)
24 cpdef p_xor_expr(PyrexScanner s)
25 cpdef p_and_expr(PyrexScanner s)
26 cpdef p_shift_expr(PyrexScanner s)
27 cpdef p_arith_expr(PyrexScanner s)
28 cpdef p_term(PyrexScanner s)
29 cpdef p_factor(PyrexScanner s)
30 cpdef p_typecast(PyrexScanner s)
31 cpdef p_sizeof(PyrexScanner s)
32 cpdef p_yield_expression(PyrexScanner s)
33 cpdef p_power(PyrexScanner s)
34 cpdef p_trailer(PyrexScanner s, node1)
35 cpdef p_call(PyrexScanner s, function)
36 cpdef p_index(PyrexScanner s, base)
37 cpdef p_subscript_list(PyrexScanner s)
38 cpdef p_subscript(PyrexScanner s)
39 cpdef p_slice_element(PyrexScanner s, follow_set)
40 cpdef expect_ellipsis(PyrexScanner s)
41 cpdef make_slice_nodes(pos, subscripts)
42 cpdef make_slice_node(pos, start, stop = *, step = *)
43 cpdef p_atom(PyrexScanner s)
44 cpdef p_name(PyrexScanner s, name)
45 cpdef p_cat_string_literal(PyrexScanner s)
46 cpdef p_opt_string_literal(PyrexScanner s)
47 cpdef p_string_literal(PyrexScanner s)
48 cpdef p_list_maker(PyrexScanner s)
49 cpdef p_comp_iter(PyrexScanner s, body)
50 cpdef p_comp_for(PyrexScanner s, body)
51 cpdef p_comp_if(PyrexScanner s, body)
52 cpdef p_dict_or_set_maker(PyrexScanner s)
53 cpdef p_backquote_expr(PyrexScanner s)
54 cpdef p_simple_expr_list(PyrexScanner s)
55 cpdef p_expr(PyrexScanner s)
56 cpdef p_testlist(PyrexScanner s)
58 #-------------------------------------------------------
59 #
60 # Statements
61 #
62 #-------------------------------------------------------
64 cpdef flatten_parallel_assignments(list input, list output)
66 cpdef p_global_statement(PyrexScanner s)
67 cpdef p_expression_or_assignment(PyrexScanner s)
68 cpdef p_print_statement(PyrexScanner s)
69 cpdef p_exec_statement(PyrexScanner s)
70 cpdef p_del_statement(PyrexScanner s)
71 cpdef p_pass_statement(PyrexScanner s, bint with_newline = *)
72 cpdef p_break_statement(PyrexScanner s)
73 cpdef p_continue_statement(PyrexScanner s)
74 cpdef p_return_statement(PyrexScanner s)
75 cpdef p_raise_statement(PyrexScanner s)
76 cpdef p_import_statement(PyrexScanner s)
77 cpdef p_from_import_statement(PyrexScanner s, bint first_statement = *)
78 cpdef p_imported_name(PyrexScanner s, bint is_cimport)
79 cpdef p_dotted_name(PyrexScanner s, bint as_allowed)
80 cpdef p_as_name(PyrexScanner s)
81 cpdef p_assert_statement(PyrexScanner s)
82 cpdef p_if_statement(PyrexScanner s)
83 cpdef p_if_clause(PyrexScanner s)
84 cpdef p_else_clause(PyrexScanner s)
85 cpdef p_while_statement(PyrexScanner s)
86 cpdef p_for_statement(PyrexScanner s)
87 cpdef p_for_bounds(PyrexScanner s)
88 cpdef p_for_from_relation(PyrexScanner s)
89 cpdef p_for_from_step(PyrexScanner s)
90 cpdef p_target(PyrexScanner s, terminator)
91 cpdef p_for_target(PyrexScanner s)
92 cpdef p_for_iterator(PyrexScanner s)
93 cpdef p_try_statement(PyrexScanner s)
94 cpdef p_except_clause(PyrexScanner s)
95 cpdef p_include_statement(PyrexScanner s, ctx)
96 cpdef p_with_statement(PyrexScanner s)
97 cpdef p_simple_statement(PyrexScanner s, bint first_statement = *)
98 cpdef p_simple_statement_list(PyrexScanner s, ctx, bint first_statement = *)
99 cpdef p_compile_time_expr(PyrexScanner s)
100 cpdef p_DEF_statement(PyrexScanner s)
101 cpdef p_IF_statement(PyrexScanner s, ctx)
102 cpdef p_statement(PyrexScanner s, ctx, bint first_statement = *)
103 cpdef p_statement_list(PyrexScanner s, ctx, bint first_statement = *)
104 cpdef p_suite(PyrexScanner s, ctx = *, bint with_doc = *, bint with_pseudo_doc = *)
105 cpdef p_positional_and_keyword_args(PyrexScanner s, end_sy_set, type_positions= *, type_keywords= * )
107 cpdef p_c_base_type(PyrexScanner s, bint self_flag = *, bint nonempty = *)
108 cpdef p_calling_convention(PyrexScanner s)
109 cpdef p_c_complex_base_type(PyrexScanner s)
110 cpdef p_c_simple_base_type(PyrexScanner s, self_flag, nonempty)
111 cpdef p_buffer_access(PyrexScanner s, base_type_node)
112 cpdef bint looking_at_name(PyrexScanner s) except -2
113 cpdef bint looking_at_expr(PyrexScanner s) except -2
114 cpdef bint looking_at_base_type(PyrexScanner s) except -2
115 cpdef bint looking_at_dotted_name(PyrexScanner s) except -2
116 cpdef p_sign_and_longness(PyrexScanner s)
117 cpdef p_opt_cname(PyrexScanner s)
118 cpdef p_c_declarator(PyrexScanner s, ctx = *, bint empty = *, bint is_type = *, bint cmethod_flag = *,
119 bint assignable = *, bint nonempty = *,
120 bint calling_convention_allowed = *)
121 cpdef p_c_array_declarator(PyrexScanner s, base)
122 cpdef p_c_func_declarator(PyrexScanner s, pos, ctx, base, bint cmethod_flag)
123 cpdef p_c_simple_declarator(PyrexScanner s, ctx, bint empty, bint is_type, bint cmethod_flag,
124 bint assignable, bint nonempty)
125 cpdef p_nogil(PyrexScanner s)
126 cpdef p_with_gil(PyrexScanner s)
127 cpdef p_exception_value_clause(PyrexScanner s)
128 cpdef p_c_arg_list(PyrexScanner s, ctx = *, bint in_pyfunc = *, bint cmethod_flag = *,
129 bint nonempty_declarators = *, bint kw_only = *, bint annotated = *)
130 cpdef p_optional_ellipsis(PyrexScanner s)
131 cpdef p_c_arg_decl(PyrexScanner s, ctx, in_pyfunc, bint cmethod_flag = *, bint nonempty = *, bint kw_only = *, bint annotated = *)
132 cpdef p_api(PyrexScanner s)
133 cpdef p_cdef_statement(PyrexScanner s, ctx)
134 cpdef p_cdef_block(PyrexScanner s, ctx)
135 cpdef p_cdef_extern_block(PyrexScanner s, pos, ctx)
136 cpdef p_c_enum_definition(PyrexScanner s, pos, ctx)
137 cpdef p_c_enum_line(PyrexScanner s, list items)
138 cpdef p_c_enum_item(PyrexScanner s, list items)
139 cpdef p_c_struct_or_union_definition(PyrexScanner s, pos, ctx)
140 cpdef p_visibility(PyrexScanner s, prev_visibility)
141 cpdef p_c_modifiers(PyrexScanner s)
142 cpdef p_c_func_or_var_declaration(PyrexScanner s, pos, ctx)
143 cpdef p_ctypedef_statement(PyrexScanner s, ctx)
144 cpdef p_decorators(PyrexScanner s)
145 cpdef p_def_statement(PyrexScanner s, list decorators = *)
146 cpdef p_varargslist(PyrexScanner s, terminator=*, bint annotated = *)
147 cpdef p_py_arg_decl(PyrexScanner s)
148 cpdef p_class_statement(PyrexScanner s, decorators)
149 cpdef p_c_class_definition(PyrexScanner s, pos, ctx)
150 cpdef p_c_class_options(PyrexScanner s)
151 cpdef p_property_decl(PyrexScanner s)
152 cpdef p_doc_string(PyrexScanner s)
153 cpdef p_code(PyrexScanner s, level= *)
154 cpdef p_compiler_directive_comments(PyrexScanner s)
155 cpdef p_module(PyrexScanner s, pxd, full_module_name)