Mercurial > octave
diff libinterp/parse-tree/parse.h @ 28518:b8ab8b58547d
accept spmd command blocks as language elements (bug #58676)
* pt-spmd.h, pt-spmd.cc: New files.
* libinterp/parse-tree/module.mk: Update.
* parse.h, oct-parse.yy (base_parser::make_spmd_command): New function.
(spmd_command): New non-terminal.
(command): Include spmd_command in list of possible commands.
* pt-all.h: Also include pt-spmd.h.
* pt-walk.h, pt-walk.cc (tree_walker::visit_spmd_command):
New virtual function.
* pt-eval.h, pt-eval.cc (tree_evaluator::visit_spmd_command):
New function.
* pt-pr-code.h, pt-pr-code.cc (tree_print_code::visit_spmd_command):
New function.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 30 Jun 2020 15:52:25 -0400 |
parents | 70d155283f33 |
children | 61a089ada620 |
line wrap: on
line diff
--- a/libinterp/parse-tree/parse.h Tue Jun 30 09:34:14 2020 -0700 +++ b/libinterp/parse-tree/parse.h Tue Jun 30 15:52:25 2020 -0400 @@ -81,6 +81,7 @@ class tree_matrix; class tree_matrix; class tree_parameter_list; + class tree_spmd_command; class tree_statement; class tree_statement_list; class tree_statement_listtree_statement; @@ -282,6 +283,12 @@ // Build a return command. tree_command * make_return_command (token *return_tok); + // Build an spmd command. + + tree_spmd_command * + make_spmd_command (token *spmd_tok, tree_statement_list *body, + token *end_tok, comment_list *lc, comment_list *tc); + // Start an if command. tree_if_command_list * start_if_command (tree_expression *expr, tree_statement_list *list);