From e0f16855cb1e5f0465db13405b6524682847688c Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 1 Oct 2025 17:08:06 -0400 Subject: np: parse: Add AST structure and initial logic Signed-off-by: Ian Moffett --- src/sys/np/core/np_parse.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/sys/np/core/np_parse.c') diff --git a/src/sys/np/core/np_parse.c b/src/sys/np/core/np_parse.c index 12732cd..63f93aa 100644 --- a/src/sys/np/core/np_parse.c +++ b/src/sys/np/core/np_parse.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #define pr_trace(fmt, ...) printf("pirho.parse: " fmt, ##__VA_ARGS__) @@ -173,6 +174,13 @@ parse_work(struct np_work *work) return -EINVAL; } + /* Get the AST root node */ + work->ast_root = ast_alloc(work); + if (work->ast_root == NULL) { + pr_error("failed to alloc root AST|n"); + return -ENOMEM; + } + while (error == 0) { error = lex_nom(work, &tok); if (error < 0) { -- cgit v1.2.3