feat: redirection rules
This commit is contained in:
parent
18c1da6bdf
commit
32f56beb6b
8 changed files with 218 additions and 25 deletions
|
|
@ -0,0 +1,28 @@
|
|||
#include "grammar_advanced.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "grammar_basic.h"
|
||||
|
||||
struct ast *parse_redirection(struct lexer_context *ctx)
|
||||
{
|
||||
struct token *token = PEEK_TOKEN();
|
||||
if (token->type == TOKEN_IONUMBER)
|
||||
{
|
||||
// TODO
|
||||
POP_TOKEN();
|
||||
token = PEEK_TOKEN();
|
||||
}
|
||||
|
||||
if (token->type != TOKEN_REDIRECTION)
|
||||
{
|
||||
puts("Syntax error: expected a redirection token but got something "
|
||||
"else");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
struct ast *parse_prefix(struct lexer_context *ctx)
|
||||
{
|
||||
return parse_redirection(ctx);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue