summaryrefslogtreecommitdiff
path: root/prism/node.h
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2023-09-27 12:24:48 -0400
committerKevin Newton <[email protected]>2023-09-27 13:57:38 -0400
commit4f73a7c2f7ff16aa78cf0dec2d4c7f90a2c41c9b (patch)
tree3b6f0cedc858d46d30a28c6d03439d653884a915 /prism/node.h
parent8ab56869a64fdccc094f4a83c6367fb23b72d38b (diff)
Sync to prism rename commits
Diffstat (limited to 'prism/node.h')
-rw-r--r--prism/node.h43
1 files changed, 21 insertions, 22 deletions
diff --git a/prism/node.h b/prism/node.h
index 1b546f086f..a532badef8 100644
--- a/prism/node.h
+++ b/prism/node.h
@@ -1,42 +1,41 @@
-#ifndef YARP_NODE_H
-#define YARP_NODE_H
+#ifndef PRISM_NODE_H
+#define PRISM_NODE_H
-#include "yarp/defines.h"
-#include "yarp/parser.h"
+#include "prism/defines.h"
+#include "prism/parser.h"
// Append a new node onto the end of the node list.
-void yp_node_list_append(yp_node_list_t *list, yp_node_t *node);
+void pm_node_list_append(pm_node_list_t *list, pm_node_t *node);
// Clear the node but preserves the location.
-void yp_node_clear(yp_node_t *node);
+void pm_node_clear(pm_node_t *node);
// Deallocate a node and all of its children.
-YP_EXPORTED_FUNCTION void yp_node_destroy(yp_parser_t *parser, struct yp_node *node);
+PRISM_EXPORTED_FUNCTION void pm_node_destroy(pm_parser_t *parser, struct pm_node *node);
-// This struct stores the information gathered by the yp_node_memsize function.
+// This struct stores the information gathered by the pm_node_memsize function.
// It contains both the memory footprint and additionally metadata about the
// shape of the tree.
typedef struct {
size_t memsize;
size_t node_count;
-} yp_memsize_t;
+} pm_memsize_t;
// Calculates the memory footprint of a given node.
-YP_EXPORTED_FUNCTION void yp_node_memsize(yp_node_t *node, yp_memsize_t *memsize);
+PRISM_EXPORTED_FUNCTION void pm_node_memsize(pm_node_t *node, pm_memsize_t *memsize);
// Returns a string representation of the given node type.
-YP_EXPORTED_FUNCTION const char * yp_node_type_to_str(yp_node_type_t node_type);
+PRISM_EXPORTED_FUNCTION const char * pm_node_type_to_str(pm_node_type_t node_type);
-#define YP_EMPTY_NODE_LIST ((yp_node_list_t) { .nodes = NULL, .size = 0, .capacity = 0 })
+#define PM_EMPTY_NODE_LIST ((pm_node_list_t) { .nodes = NULL, .size = 0, .capacity = 0 })
-#endif // YARP_NODE_H
+// ScopeNodes are helper nodes, and will never be part of the AST. We manually
+// declare them here to avoid generating them.
+typedef struct pm_scope_node {
+ pm_node_t base;
+ struct pm_parameters_node *parameters;
+ pm_node_t *body;
+ pm_constant_id_list_t locals;
+} pm_scope_node_t;
-// ScopeNodes are helper nodes, and will never
-// be part of the AST. We manually declare them
-// here to avoid generating them
-typedef struct yp_scope_node {
- yp_node_t base;
- struct yp_parameters_node *parameters;
- yp_node_t *body;
- yp_constant_id_list_t locals;
-} yp_scope_node_t;
+#endif // PRISM_NODE_H