WOW, finally making some sense, i think i get it, finally got the skelleton, gonna keep reading for adding more interesting things and doing things right, for now i think i got the parse_expr
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "lexer.h"
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
ASTNode *head;
|
||||
@@ -9,13 +10,13 @@ typedef struct {
|
||||
size_t pos;
|
||||
} ASTNodeSlice;
|
||||
|
||||
ASTNode ASTNodeSlice_peek(ASTNodeSlice slice);
|
||||
ASTNode ASTNodeSlice_next(ASTNodeSlice slice);
|
||||
ASTNode ASTNodeSlice_peek(ASTNodeSlice *slice);
|
||||
ASTNode ASTNodeSlice_next(ASTNodeSlice *slice);
|
||||
|
||||
ASTNode *nud(ASTNodeSlice *slice);
|
||||
ASTNode *led(ASTNodeSlice *slice, size_t right_precedence);
|
||||
|
||||
size_t node_lbp(ASTNode node);
|
||||
size_t node_rbp(ASTNode node);
|
||||
uint8_t node_lbp(ASTNode node);
|
||||
uint8_t node_rbp(ASTNode node);
|
||||
AST parse(ASTNodeArray arr);
|
||||
AST parse_expr(ASTNodeSlice *arr);
|
||||
ASTNode *parse_expr(ASTNodeSlice *slice, uint8_t min_bp);
|
||||
|
||||
Reference in New Issue
Block a user