Commit cd0809ca authored by Seblu's avatar Seblu
Browse files

big work

parent de22dd53
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -19,7 +19,12 @@ bin_PROGRAMS=42sh
		src/ast/ast_while.c			\
		src/builtin/builtin.h			\
		src/builtin/builtin.c			\
		src/builtin/builtin_alias.c		\
		src/builtin/builtin_cd.c		\
		src/builtin/builtin_echo.c		\
		src/builtin/builtin_exit.c		\
		src/builtin/builtin_unalias.c		\
		src/builtin/builtin_shopt.c		\
		src/common/basename.c			\
		src/common/constant.h			\
		src/common/env.c			\
@@ -34,6 +39,8 @@ bin_PROGRAMS=42sh
		src/exec/exec.h				\
		src/exec/exec_and.c			\
		src/exec/exec_bang.c			\
		src/exec/exec_cmd.c			\
		src/exec/exec_funcdec.c			\
		src/exec/exec_node.c			\
		src/exec/exec_or.c			\
		src/exec/exec_if.c			\
@@ -41,13 +48,13 @@ bin_PROGRAMS=42sh
		src/exec/exec_sep.c			\
		src/exec/exec_sepand.c			\
		src/exec/exec_while.c			\
		src/parser/alias.c			\
		src/parser/alias.h			\
		src/parser/getline.c			\
		src/parser/getline.h			\
		src/parser/parser.c			\
		src/parser/parser.h			\
		src/parser/lexer.c			\
		src/shell/alias.c			\
		src/shell/alias.h			\
		src/shell/func.c			\
		src/shell/func.h			\
		src/shell/getoptions.c			\
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
-- Voir probleme de syntax que j'accepte lorsque un EOF apparait avant une quote
fermante. Le token est valide alors que sous bash non. faire un test avant.
Maintenant il renvoie EOF a la place du token.
-- verifier toto \2>sex fonctionne.

- Parser
-- aliases
+2 −1
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ AC_ARG_WITH([efence],
  [AS_HELP_STRING([--with-efence], [link with lib efence])],
  [dnl action-if-given
       LDFLAGS="$LDFLAGS -lefence"
       test -r "/usr/include/efence.h" &&
	    CFLAGS="$CFLAGS -include stdlib.h -include efence.h"
  ],
  [dnl action-if-not-given
+97 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
** Login   <seblu@epita.fr>
**
** Started on  Sun Jul 30 04:40:03 2006 Seblu
** Last update Tue Oct 17 17:14:49 2006 seblu
** Last update Thu Nov 16 17:01:11 2006 seblu
*/

#ifndef AST_H_
@@ -179,6 +179,12 @@ struct ast_node
  u_node_item		body;
};

/*
** =================
** FILE: ast_print.c
** =================
*/

/*!
** Print an ast to @arg filename file
**
@@ -197,6 +203,12 @@ void ast_print(s_ast_node *ast, const char *filename);
*/
void		ast_print_node(s_ast_node *ast, FILE *fs, unsigned int *node_id);

/*
** ====================
** FILE: ast_destruct.c
** ====================
*/

/*!
** Destroy node and all its childs
**
@@ -213,6 +225,12 @@ void ast_destruct(s_ast_node *ast);
*/
void		ast_destruct_node(s_ast_node *ast);

/*
** ===========
** ast_if.c
** ===========
*/

/*!
** Create an if ast node
**
@@ -248,6 +266,12 @@ void ast_if_destruct_node(s_ast_node *node);
*/
void		ast_if_destruct(s_ast_node *node);

/*
** ===============
** FILE: ast_for.c
** ===============
*/

/*!
** Create a for ast node
**
@@ -285,6 +309,12 @@ void ast_for_destruct_node(s_ast_node *node);
*/
void		ast_for_destruct(s_ast_node *node);

/*
** ================
** FILE: ast_case.c
** ================
*/

/*!
** Create a case ast node
**
@@ -329,6 +359,12 @@ void ast_case_destruct_node(s_ast_node *node);
*/
void		ast_case_destruct(s_ast_node *node);

/*
** =================
** FILE: ast_while.c
** =================
*/

/*!
** Create a while ast node
**
@@ -362,6 +398,12 @@ void ast_while_destruct_node(s_ast_node *node);
*/
void		ast_while_destruct(s_ast_node *node);

/*
** ===============
** FILE: ast_red.c
** ===============
*/

/*!
** Create a redirection ast node
**
@@ -405,6 +447,12 @@ void ast_red_destruct_node(s_ast_node *node);
*/
void		ast_red_destruct(s_ast_node *node);

/*
** ===============
** FILE: ast_cmd.c
** ===============
*/

/*!
** Create a cmd ast node
**
@@ -451,6 +499,12 @@ void ast_cmd_destruct_node(s_ast_node *node);
*/
void		ast_cmd_destruct(s_ast_node *node);

/*
** ===============
** FILE: ast_and.c
** ===============
*/

/*!
** Create an and (&&) ast node
**
@@ -484,6 +538,12 @@ void ast_and_destruct_node(s_ast_node *node);
*/
void		ast_and_destruct(s_ast_node *node);

/*
** ==============
** FILE: ast_or.c
** ==============
*/

/*!
** Create an or (||) ast node
**
@@ -517,6 +577,12 @@ void ast_or_destruct_node(s_ast_node *node);
*/
void		ast_or_destruct(s_ast_node *node);

/*
** ====================
** FILE: ast_subshell.c
** ====================
*/

/*!
** Create a subshell (()) ast node
**
@@ -549,6 +615,12 @@ void ast_subshell_destruct_node(s_ast_node *node);
*/
void		ast_subshell_destruct(s_ast_node *node);

/*
** ===================
** FILE: ast_funcdec.c
** ===================
*/

/*!
** Create a funcdec (function declaration) ast node
**
@@ -582,6 +654,12 @@ void ast_funcdec_destruct_node(s_ast_node *node);
*/
void		ast_funcdec_destruct(s_ast_node *node);

/*
** ================
** FILE: ast_bang.c
** ================
*/

/*!
** Create a bang (!) ast node
**
@@ -614,6 +692,12 @@ void ast_bang_destruct_node(s_ast_node *node);
*/
void		ast_bang_destruct(s_ast_node *node);

/*
** ================
** FILE: ast_pipe.c
** ================
*/

/*!
** Create a pipe (|) ast node
**
@@ -646,6 +730,12 @@ void ast_pipe_destruct_node(s_ast_node *node);
*/
void		ast_pipe_destruct(s_ast_node *node);

/*
** ===============
** FILE: ast_sep.c
** ===============
*/

/*!
** Create a separtor (;) ast node
**
@@ -678,6 +768,12 @@ void ast_sep_destruct_node(s_ast_node *node);
*/
void		ast_sep_destruct(s_ast_node *node);

/*
** ==================
** FILE: ast_sepand.c
** ==================
*/

/*!
** Create a sepand (&) ast node
**
+7 −4
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
** Login   <seblu@epita.fr>
**
** Started on  Thu Aug  3 02:41:37 2006 Seblu
** Last update Wed Oct 18 17:14:16 2006 seblu
** Last update Thu Nov 16 17:07:14 2006 seblu
*/

#include "ast.h"
@@ -38,6 +38,7 @@ void ast_funcdec_destruct_node(s_ast_node *node)
{
  if (node->type != T_FUNCDEC)
    return;
  if (node->body.child_funcdec.name)
    free(node->body.child_funcdec.name);
  free(node);
}
@@ -46,7 +47,9 @@ void ast_funcdec_destruct(s_ast_node *node)
{
  if (node->type != T_FUNCDEC)
    return;
  if (node->body.child_funcdec.name)
    free(node->body.child_funcdec.name);
  if (node->body.child_funcdec.body)
    ast_destruct(node->body.child_funcdec.body);
  free(node);
}
Loading