2020-12-22 11:18:54 -05:00
|
|
|
#ifndef PARSER_INTERNAL_H
|
|
|
|
#define PARSER_INTERNAL_H
|
|
|
|
#include <string.h>
|
|
|
|
#include "parser.h"
|
|
|
|
|
|
|
|
#define next(parser) parser->current = p->current->next
|
2020-12-22 12:38:10 -05:00
|
|
|
#define anchorparser(parser) p->checkpoint = p->current
|
|
|
|
#define rewindparser(parser) p->current = p->checkpoint
|
2020-12-22 11:18:54 -05:00
|
|
|
#define differs(parser, str) strcmp(parser->current->token, str)
|
|
|
|
#define nextdiffers(parser, str) strcmp(parser->current->next->token, str)
|
|
|
|
#define equals(parser, str) !differs(parser, str)
|
|
|
|
#define nextequals(parser, str) !nextdiffers(parser, str)
|
|
|
|
|
|
|
|
void unexpected(PARSER* p);
|
|
|
|
char* parseidentifier(PARSER* p);
|
|
|
|
void checkcontent(PARSER* p, const char* content);
|
|
|
|
DEBUGINFO* getdebug(PARSER* p);
|
|
|
|
#endif
|