skopy/lib/include/parser.h

37 lines
1.1 KiB
C

#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);
struct node* parser_try_assert(struct parser* self);
struct node* parser_try_or(struct parser* self);
struct node* parser_try_and(struct parser* self);
struct node* parser_try_eq(struct parser* self);
struct node* parser_try_cmp(struct parser* self);
struct node* parser_try_term(struct parser* self);
struct node* parser_try_factor(struct parser* self);
struct node* parser_try_usub(struct parser* self);
struct node* parser_try_not(struct parser* self);
struct node* parser_try_pow(struct parser* self);
struct node* parser_try_literal(struct parser* self);
struct node* parser_try_builtin(struct parser* self);
#endif