aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_execution.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-27 01:38:43 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-27 01:38:43 -0800
commit6ce4b344e45baaa06bf593a5c0983da7a22eb64e (patch)
tree2358b60e771c42d29aeb26a03dd95f22cbd8ca15 /parse_execution.h
parenta6ca809a4e4873f3fd16e4a763001a109afc2185 (diff)
Hook up for statements, if statements, and function definition in new
parser
Diffstat (limited to 'parse_execution.h')
-rw-r--r--parse_execution.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/parse_execution.h b/parse_execution.h
index 0d679bb6..f465a593 100644
--- a/parse_execution.h
+++ b/parse_execution.h
@@ -35,18 +35,28 @@ class parse_execution_context_t
/* Report an error. Always returns true. */
bool append_error(const parse_node_t &node, const wchar_t *fmt, ...);
+ /* Wildcard error helper */
+ bool append_unmatched_wildcard_error(const parse_node_t &unmatched_wildcard);
/* Utilities */
wcstring get_source(const parse_node_t &node) const;
const parse_node_t *get_child(const parse_node_t &parent, node_offset_t which, parse_token_type_t expected_type = token_type_invalid) const;
node_offset_t get_offset(const parse_node_t &node) const;
+ /* These create process_t structures from statements */
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_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);
+ /* These encapsulate the actual logic of various (block) statements. They just do what the statement says. */
+ int run_block_statement(const parse_node_t &statement);
+ int run_for_statement(const parse_node_t &header, const parse_node_t &contents);
+ int run_if_statement(const parse_node_t &statement);
+ int run_switch_statement(const parse_node_t &statement);
+ int run_while_statement(const parse_node_t &header, const parse_node_t &contents);
+ int run_function_statement(const parse_node_t &header, const parse_node_t &contents);
+ int run_begin_statement(const parse_node_t &header, const parse_node_t &contents);
wcstring_list_t determine_arguments(const parse_node_t &parent, const parse_node_t **out_unmatched_wildcard_node);
@@ -57,13 +67,11 @@ class parse_execution_context_t
int run_job_list(const parse_node_t &job_list_node);
bool populate_job_from_job_node(job_t *j, const parse_node_t &job_node);
- void eval_next_stack_elem();
-
public:
parse_execution_context_t(const parse_node_tree_t &t, const wcstring &s, const io_chain_t &io, parser_t *p);
- /* Actually execute the job list described by the tree */
- int eval_top_level_job_list();
+ /* Start executing at the given node offset, returning the exit status of the last process. */
+ int eval_node_at_offset(node_offset_t offset);
};