37 lines
655 B
C
37 lines
655 B
C
// parser.h
|
|
#ifndef _ZIG0_PARSE_H__
|
|
#define _ZIG0_PARSE_H__
|
|
|
|
#include "ast.h"
|
|
#include "common.h"
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
uint32_t len;
|
|
AstNodeIndex lhs;
|
|
AstNodeIndex rhs;
|
|
bool trailing;
|
|
} Members;
|
|
|
|
typedef struct {
|
|
const char* source;
|
|
uint32_t source_len;
|
|
|
|
TokenizerTag* token_tags;
|
|
AstIndex* token_starts;
|
|
uint32_t tokens_len;
|
|
|
|
AstTokenIndex tok_i;
|
|
|
|
AstNodeList nodes;
|
|
AstNodeIndexSlice extra_data;
|
|
AstNodeIndexSlice scratch;
|
|
} Parser;
|
|
|
|
Parser* parserInit(const char* source, uint32_t len);
|
|
void parserDeinit(Parser* parser);
|
|
void parseRoot(Parser* parser);
|
|
|
|
#endif
|