aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_execution.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-26 12:24:00 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-26 12:24:00 -0800
commit924b8cbe24023985d7bafcec7b79303e2e7cc2e4 (patch)
treea347fbe0c992ffb403d1ecbc20390e4db18a22a4 /parse_execution.h
parent5b1a53265233f837e272aa0936267e04c8848856 (diff)
New ideas about how to use new parser for execution. Beginnings of
implementation.
Diffstat (limited to 'parse_execution.h')
-rw-r--r--parse_execution.h29
1 files changed, 10 insertions, 19 deletions
diff --git a/parse_execution.h b/parse_execution.h
index 6495f944..8977e7e3 100644
--- a/parse_execution.h
+++ b/parse_execution.h
@@ -22,26 +22,16 @@ class parse_execution_context_t
parser_t * const parser;
parse_error_list_t errors;
+ int eval_level;
std::vector<profile_item_t*> profile_items;
- /* We maintain a stack of job lists to be executed, and something to do after the execution is finished. This is a pointer to member function that takes a node, a status, and the statement that was executed */
- typedef void (parse_execution_context_t::*statement_completion_handler_t)(const parse_node_t &node);
-
- struct parse_execution_stack_element_t
- {
- // These point into our tree, which is immutable
- const parse_node_t *job_or_job_list;
- statement_completion_handler_t completion_handler;
- const parse_node_t *node;
- };
- std::vector<parse_execution_stack_element_t> job_stack;
-
- void stack_push(const parse_node_t *job_or_job_list, statement_completion_handler_t completion_handler, const parse_node_t *node);
-
/* No copying allowed */
parse_execution_context_t(const parse_execution_context_t&);
parse_execution_context_t& operator=(const parse_execution_context_t&);
+ /* Should I cancel */
+ bool should_cancel() const;
+
/* Report an error. Always returns true. */
bool append_error(const parse_node_t &node, const wchar_t *fmt, ...);
@@ -52,16 +42,17 @@ class parse_execution_context_t
process_t *create_job_process(job_t *job, const parse_node_t &statement_node);
process_t *create_boolean_process(job_t *job, const parse_node_t &bool_statement);
- process_t *create_for_process(job_t *job, const parse_node_t &header, const parse_node_t &statement);
- process_t *create_while_process(job_t *job, const parse_node_t &header, const parse_node_t &statement);
- process_t *create_begin_process(job_t *job, const parse_node_t &header, const parse_node_t &statement);
process_t *create_plain_process(job_t *job, const parse_node_t &statement);
+ process_t *create_block_process(job_t *job, const parse_node_t &statement_node);
+
+ void run_while_process(const parse_node_t &header, const parse_node_t &statement);
wcstring_list_t determine_arguments(const parse_node_t &parent, const parse_node_t **out_unmatched_wildcard_node);
io_chain_t determine_io_chain(const parse_node_t &statement);
- void eval_1_job(const parse_node_t &job_node);
- void eval_job(job_t *j, const parse_node_t &job_node);
+ int run_1_job(const parse_node_t &job_node);
+ void run_job_list(const parse_node_t &job_list_node);
+ void populate_job_from_job_node(job_t *j, const parse_node_t &job_node);
void eval_next_stack_elem();