30 lines
794 B
C
30 lines
794 B
C
#ifndef SCIRPT_PARSER_H
|
|
#define SCIRPT_PARSER_H
|
|
|
|
#include "scirpt/ast.h"
|
|
#include "scirpt/lexer.h"
|
|
#include "utils/generic_array.h"
|
|
#include "utils/string.h"
|
|
#include <stdlib.h>
|
|
|
|
typedef struct {
|
|
HeapString message;
|
|
ScirptPosition pos;
|
|
} ScirptParserError;
|
|
|
|
GENERIC_ARRAY(
|
|
ScirptParserError, ScirptParserErrorArray, scirpt_parser_error_array
|
|
)
|
|
typedef struct ScirptParserErrorArray ScirptParserErrorArray;
|
|
|
|
typedef struct ScirptParser ScirptParser;
|
|
|
|
ScirptParser*
|
|
scirpt_parser_new(const char* text, size_t text_length, ScirptLexer* lexer);
|
|
void scirpt_parser_delete(ScirptParser* parser);
|
|
ScirptAstExpr* scirpt_parser_next_expr(ScirptParser* parser);
|
|
bool scirpt_parser_ok(const ScirptParser* parser);
|
|
const ScirptParserErrorArray* scirpt_parser_errors(const ScirptParser* parser);
|
|
|
|
#endif
|