feat: Merge branch 'ast-def' into dev
This commit is contained in:
commit
3a8ab44300
3 changed files with 0 additions and 0 deletions
9
src/utils/ast/Makefile.am
Normal file
9
src/utils/ast/Makefile.am
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
lib_LIBRARIES = libast.a
|
||||
|
||||
libast_a_SOURCES = \
|
||||
ast.c \
|
||||
ast.h
|
||||
|
||||
libast_a_CPPFLAGS = -I$(top_srcdir)/src
|
||||
|
||||
noinst_LIBRARIES = libast.a
|
||||
0
src/utils/ast/ast.c
Normal file
0
src/utils/ast/ast.c
Normal file
37
src/utils/ast/ast.h
Normal file
37
src/utils/ast/ast.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef AST_H
|
||||
#define AST_H
|
||||
|
||||
#include "lists.h"
|
||||
|
||||
enum ast_type
|
||||
{
|
||||
AST_END = 0,
|
||||
AST_IF,
|
||||
AST_CMD
|
||||
};
|
||||
|
||||
union ast_node
|
||||
{
|
||||
struct ast_if;
|
||||
struct ast_cmd;
|
||||
};
|
||||
|
||||
struct ast
|
||||
{
|
||||
enum ast_type type;
|
||||
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 */
|
||||
Loading…
Add table
Add a link
Reference in a new issue