2026-01-24 15:34:10 +01:00
|
|
|
#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);
|
|
|
|
|
}
|