comparison src/octave.gperf @ 13245:027a2186cd90

parfor keyword and infrastructure, but handle parfor as normal for loop for now * octave.gperf (octave_kw_id): New keyword ids, parfor_kw and end_parfor_kw. (octave_kw): Add parfor and end_parfor to the struct. * lex.ll (is_keyword_token): Handle parfor and end_parfor. * token.h (token::parfor_end): New end_tok_type enum value. * oct-parse.yy (PARFOR): New token. (loop_command): Handle PARFOR statements. (make_for_command): New args tok_id and maxproc. Handle PARFOR loops. * pt-loop.h (tree_simple_for_command::parallel, tree_simple_for_command:maxproc): New data members. (tree_simple_for_command::tree_simple_for_command): New args parallel_arg and maxproc_arg. Initialize new data members. (tree_simple_for_command::parallel): New function. (tree_simple_for_command::maxproc_expr): New function. * pt-loop.cc (tree_simple_for_command::~tree_simple_for_command): Delete maxproc. (tree_simple_for_command::dup): Pass parallel and maxproc to constructor for duplicate object. * pt-pr-code.cc (tree_print_code::visit_simple_for_command): Handle parallel form. * pt-check.cc (tree_checker::visit_simple_for_command): Likewise. * pt-eval.cc (tree_evaluator::visit_simple_for_command): Note that this is where parallel loops need to be handled.
author John W. Eaton <jwe@octave.org>
date Thu, 29 Sep 2011 02:50:53 -0400
parents fd0a3ac60b0e
children 0c69a564f2be
comparison
equal deleted inserted replaced
13243:f9aec0bcf826 13245:027a2186cd90
33 continue_kw, 33 continue_kw,
34 do_kw, 34 do_kw,
35 else_kw, 35 else_kw,
36 elseif_kw, 36 elseif_kw,
37 end_kw, 37 end_kw,
38 end_parfor_kw,
38 end_try_catch_kw, 39 end_try_catch_kw,
39 end_unwind_protect_kw, 40 end_unwind_protect_kw,
40 endclassdef_kw, 41 endclassdef_kw,
41 endevents_kw, 42 endevents_kw,
42 endfor_kw, 43 endfor_kw,
54 if_kw, 55 if_kw,
55 magic_file_kw, 56 magic_file_kw,
56 magic_line_kw, 57 magic_line_kw,
57 methods_kw, 58 methods_kw,
58 otherwise_kw, 59 otherwise_kw,
60 parfor_kw,
59 properties_kw, 61 properties_kw,
60 return_kw, 62 return_kw,
61 set_kw, 63 set_kw,
62 static_kw, 64 static_kw,
63 switch_kw, 65 switch_kw,
77 continue, CONTINUE, continue_kw 79 continue, CONTINUE, continue_kw
78 do, DO, do_kw 80 do, DO, do_kw
79 else, ELSE, else_kw 81 else, ELSE, else_kw
80 elseif, ELSEIF, elseif_kw 82 elseif, ELSEIF, elseif_kw
81 end, END, end_kw 83 end, END, end_kw
84 end_parfor, END, end_parfor_kw
82 end_try_catch, END, end_try_catch_kw 85 end_try_catch, END, end_try_catch_kw
83 end_unwind_protect, END, end_unwind_protect_kw 86 end_unwind_protect, END, end_unwind_protect_kw
84 endclassdef, END, endclassdef_kw 87 endclassdef, END, endclassdef_kw
85 endevents, END, endevents_kw 88 endevents, END, endevents_kw
86 endfor, END, endfor_kw 89 endfor, END, endfor_kw
96 get, GET, get_kw 99 get, GET, get_kw
97 global, GLOBAL, global_kw 100 global, GLOBAL, global_kw
98 if, IF, if_kw 101 if, IF, if_kw
99 methods, METHODS, methods_kw 102 methods, METHODS, methods_kw
100 otherwise, OTHERWISE, otherwise_kw 103 otherwise, OTHERWISE, otherwise_kw
104 parfor, PARFOR, parfor_kw
101 persistent, STATIC, static_kw 105 persistent, STATIC, static_kw
102 properties, PROPERTIES, properties_kw 106 properties, PROPERTIES, properties_kw
103 return, FUNC_RET, return_kw 107 return, FUNC_RET, return_kw
104 set, SET, set_kw 108 set, SET, set_kw
105 static, STATIC, static_kw 109 static, STATIC, static_kw