Update parser

This commit is contained in:
2026-02-22 09:21:51 +11:00
parent 929482d7d4
commit c94e5ba4cc
4 changed files with 33 additions and 1 deletions

5
src/parser/parser.c Normal file
View File

@@ -0,0 +1,5 @@
#include "parser.h"
ResultType(SolsParser, charptr) createSolsParser(SolsTokens* input) {
return Error(SolsParser, charptr, "Work in progress");
}

View File

@@ -2,5 +2,27 @@
#define PARSER_H
#include "SolsNode.h"
#include "../lexer/SolsToken.h"
#include "../include/error.h"
// Holds information about the parser.
// .input is lexed tokens, produced by a lexer.
// .current is the token currently being parsed.
// .output is the final product of the parser.
// .currentParent points to the current node being processed
typedef struct SolsParser {
SolsTokens* input;
size_t current;
SolsNode output;
SolsNode* currentParent;
} SolsParser;
Result(SolsParser, charptr);
// Creates a SolsParser.
// Returns:
// Success: Constructed SolsParser
// Failure: char* detailing what went wrong (usually memory failure)
ResultType(SolsParser, charptr) createSolsParser(SolsTokens* input);
#endif