macros
This commit is contained in:
18
parser.h
18
parser.h
@@ -1,11 +1,12 @@
|
||||
// parser.h
|
||||
#ifndef _ZIG1_PARSE_H__
|
||||
#define _ZIG1_PARSE_H__
|
||||
|
||||
#include "ast.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ast.h"
|
||||
|
||||
// Standard slice
|
||||
typedef struct {
|
||||
uint32_t len;
|
||||
uint32_t cap;
|
||||
@@ -13,8 +14,15 @@ typedef struct {
|
||||
} ParserNodeIndexSlice;
|
||||
|
||||
typedef struct {
|
||||
uint32_t len;
|
||||
AstNodeIndex lhs;
|
||||
AstNodeIndex rhs;
|
||||
bool trailing;
|
||||
} Members;
|
||||
|
||||
typedef struct Parser {
|
||||
const char* source;
|
||||
const uint32_t source_len;
|
||||
uint32_t source_len;
|
||||
|
||||
TokenizerTag* token_tags;
|
||||
AstIndex* token_starts;
|
||||
@@ -27,6 +35,8 @@ typedef struct {
|
||||
ParserNodeIndexSlice scratch;
|
||||
} Parser;
|
||||
|
||||
int parseRoot(Parser*);
|
||||
Parser* parserInit(const char* source, uint32_t len);
|
||||
void parserDeinit(Parser* parser);
|
||||
int parseRoot(Parser* parser);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user