MiniDevil As beautiful as a shell
parser.c File Reference

Entry point to parser (validates syntax & builds parse tree) More...

#include "parser.h"
#include <stddef.h>
+ Include dependency graph for parser.c:

Detailed Description

Entry point to parser (validates syntax & builds parse tree)

Definition in file parser.c.

Functions

t_astparse (t_token *tokens)
 Parse a token list into an AST. More...
 

Function Documentation

◆ parse()

t_ast* parse ( t_token tokens)

Parse a token list into an AST.

Validates syntax and then delegates to parse_pipeline() which handles the recursive descent

Parameters
tokensHead of the token list
Returns
Root of the AST or NULL on syntax error / empty input
Warning
The caller has to free the returned AST with free_ast()

Definition at line 26 of file parser.c.

References parse_pipeline(), and validate_syntax().

Referenced by process_input(), and process_ui_input().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Go to the source code of this file.