radish/include/parser.h

23 lines
576 B
C
Raw Normal View History

2025-01-06 03:00:01 +01:00
#ifndef PARSER_H
#define PARSER_H
/*
expression equality ;
equality comparison ( ( "!=" | "==" ) comparison )* ;
comparison term ( ( ">" | ">=" | "<" | "<=" ) term )* ;
term factor ( ( "-" | "+" ) factor )* ;
factor unary ( ( "/" | "*" ) unary )* ;
unary ( "!" | "-" ) unary
| primary ;
primary NUMBER | STRING | "true" | "false" | "nil"
| "(" expression ")" ;
*/
#include "ast.h"
#include "lexer.h"
expr_t *parse(token_t *tks);
void free_expr(expr_t *expr);
#endif