26 lines
569 B
C
26 lines
569 B
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_builtin(struct parser* self);
|
||
|
|
||
|
#endif
|
||
|
|