skopy/lib/include/parser.h

41 lines
1.3 KiB
C
Raw Normal View History

2024-03-31 21:10:56 +00:00
#ifndef SK_PARSER_H
#define SK_PARSER_H
#include "commons.h"
#include "node.h"
#include "lexer.h"
struct parser
{
struct lexer lexer;
};
void parser_init(struct parser* self, char const* source);
void parser_free(struct parser* self);
struct node* parser_try(struct parser* self,
struct node* (*rule)(struct parser*));
struct node* parser_try_parse(struct parser* self);
struct node* parser_try_root(struct parser* self);
struct node* parser_try_expr(struct parser* self);
2024-04-02 15:33:31 +00:00
struct node* parser_try_block(struct parser* self);
struct node* parser_try_assign(struct parser* self);
struct node* parser_try_var_decl(struct parser* self);
struct node* parser_try_const_decl(struct parser* self);
struct node* parser_try_assert(struct parser* self);
2024-04-01 12:00:06 +00:00
struct node* parser_try_or(struct parser* self);
struct node* parser_try_and(struct parser* self);
2024-04-01 21:33:43 +00:00
struct node* parser_try_eq(struct parser* self);
struct node* parser_try_cmp(struct parser* self);
2024-03-31 23:32:47 +00:00
struct node* parser_try_term(struct parser* self);
struct node* parser_try_factor(struct parser* self);
struct node* parser_try_usub(struct parser* self);
2024-04-01 12:00:06 +00:00
struct node* parser_try_not(struct parser* self);
2024-03-31 23:32:47 +00:00
struct node* parser_try_pow(struct parser* self);
struct node* parser_try_literal(struct parser* self);
2024-03-31 21:10:56 +00:00
struct node* parser_try_builtin(struct parser* self);
#endif