summaryrefslogtreecommitdiff
path: root/include/parser/proc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/parser/proc.h')
-rw-r--r--include/parser/proc.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/parser/proc.h b/include/parser/proc.h
new file mode 100644
index 0000000..0cc8471
--- /dev/null
+++ b/include/parser/proc.h
@@ -0,0 +1,34 @@
+/*
+ * Procedure parser.
+ * Copyright (c) 2023-2024, Quinn Stephens and the OSMORA team.
+ * Provided under the BSD 3-Clause license.
+ */
+
+#ifndef _PARSER_PROC_H
+#define _PARSER_PROC_H
+
+#include "list.h"
+#include "hashmap.h"
+#include "parser/var.h"
+
+struct parameter {
+ struct variable var;
+ struct list_entry list_entry;
+};
+
+struct procedure {
+ struct hashmap_entry hashmap_entry;
+
+ char *name;
+ size_t name_len;
+
+ struct hashmap vars;
+ struct list params;
+
+ struct type *ret_typ;
+ int ret_n_ptrs;
+};
+
+void parse_proc(struct parser *ctx);
+
+#endif /* !_PARSER_PROC_H */