diff src/pt-check.cc @ 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 72c96de7a403
line wrap: on
line diff
--- a/src/pt-check.cc	Wed Sep 28 21:46:39 2011 -0400
+++ b/src/pt-check.cc	Thu Sep 29 02:50:53 2011 -0400
@@ -154,6 +154,11 @@
   if (expr)
     expr->accept (*this);
 
+  tree_expression *maxproc = cmd.maxproc_expr ();
+
+  if (maxproc)
+    maxproc->accept (*this);
+
   tree_statement_list *list = cmd.body ();
 
   if (list)