feat: ast structs deinitions
This commit is contained in:
parent
919ea7b1ba
commit
7d7acbea67
1 changed files with 18 additions and 3 deletions
|
|
@ -1,22 +1,37 @@
|
||||||
#ifndef AST_H
|
#ifndef AST_H
|
||||||
#define AST_H
|
#define AST_H
|
||||||
|
|
||||||
|
#include "lists.h"
|
||||||
|
|
||||||
enum ast_type
|
enum ast_type
|
||||||
{
|
{
|
||||||
AST_NULL = 0,
|
AST_END = 0,
|
||||||
ATS_IF,
|
ATS_IF,
|
||||||
AST_CMD
|
AST_CMD
|
||||||
};
|
};
|
||||||
|
|
||||||
union ast_union
|
union ast_node
|
||||||
{
|
{
|
||||||
|
struct ast_if;
|
||||||
|
struct ast_cmd;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ast
|
struct ast
|
||||||
{
|
{
|
||||||
enum ast_type type;
|
enum ast_type type;
|
||||||
union ast_union data;
|
union ast_node data;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ast_if
|
||||||
|
{
|
||||||
|
struct ast* condition;
|
||||||
|
struct ast* then_clause;
|
||||||
|
struct ast* else_clause;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ast_cmd
|
||||||
|
{
|
||||||
|
struct list* cmd;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ! AST_H */
|
#endif /* ! AST_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue