Commit 43b02983 authored by Seblu's avatar Seblu
Browse files

ajout des fichiers d'execution dans le makefile.am

correction de ses fichiers
correction d'un problem leger dans le parser
nettoyage
parent cf1158bc
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -27,7 +27,14 @@ bin_PROGRAMS=42sh
		src/common/strvmerge.c			\
		src/common/strndup.c			\
		src/exec/exec.h				\
		src/exec/exec_and.c			\
		src/exec/exec_bang.c			\
		src/exec/exec_node.c			\
		src/exec/exec_or.c			\
		src/exec/exec_if.c			\
		src/exec/exec_sep.c			\
		src/exec/exec_sepand.c			\
		src/exec/exec_while.c			\
		src/parser/alias.h			\
		src/parser/alias.c			\
		src/parser/getline.h			\
@@ -44,7 +51,7 @@ bin_PROGRAMS=42sh
		src/shell/shell_destroy.c		\
		src/shell/prompt.c

CLEANFILES= *~ '\#*'
CLEANFILES= *~ \#*\#

EXTRA_DIST = AUTHORS README TODO

src/Makefile.am

deleted100644 → 0
+0 −50
Original line number Diff line number Diff line
bin_PROGRAMS=42sh

#42sh_LDADD  = parser/libparse.a ../check/leaktrack/libmem.a evalexpr/libevalexpr.a


42sh_SOURCES=	ast/ast.h			\
		ast/ast_and.c			\
		ast/ast_bang.c			\
		ast/ast_case.c			\
		ast/ast_cmd.c			\
		ast/ast_destruct.c		\
		ast/ast_for.c			\
		ast/ast_funcdec.c		\
		ast/ast_if.c			\
		ast/ast_or.c			\
		ast/ast_pipe.c			\
		ast/ast_print.c			\
		ast/ast_red.c			\
		ast/ast_sep.c			\
		ast/ast_sepand.c		\
		ast/ast_subshell.c		\
		ast/ast_while.c			\
		common/basename.c		\
		common/common.h			\
		common/constant.h		\
		common/isdigitstr.c		\
		common/macro.h			\
		common/strmerge.c		\
		common/strvectoradd.c		\
		common/strvmerge.c		\
		common/strndup.c		\
		exec/exec.h			\
		exec/exec_node.c		\
		parser/alias.h			\
		parser/alias.c			\
		parser/getline.h		\
		parser/getline.c		\
		parser/parser.h			\
		parser/parser.c			\
		parser/lexer.c			\
		shell/getoptions.c		\
		shell/option.h			\
		shell/option.c			\
		shell/shell.h			\
		shell/shell_entry.c		\
		shell/shell_init.c		\
		shell/shell_destroy.c		\
		shell/prompt.c

CLEANFILES= *~ '\#*'
+3 −3
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
** Login   <seblu@epita.fr>
**
** Started on  Sun Mar 30 16:02:07 2006 Seblu
** Last update Tue Aug 29 00:15:59 2006 Seblu
** Last update Sun Nov 12 03:43:20 2006 seblu
*/

#ifndef EXEC_H_
@@ -14,10 +14,10 @@
# include <assert.h>
# include <stdio.h>
# include "../ast/ast.h"
# include "../shell/shell.h"

void	exec_node(s_ast_node *node);

/* void exec_node(struct s_ast *node, struct s_42sh *sh); */
/* void exec_list(struct s_list *node, struct s_42sh *sh); */
/* void exec_if(struct s_if *node, struct s_42sh *sh); */
/* void exec_while(struct s_while *node, struct s_42sh *sh); */
@@ -32,7 +32,7 @@ void exec_node(s_ast_node *node);
/* void exec_line(struct s_op *node, struct s_42sh *sh); */
/* void exec_subshell(struct s_subshell *node, struct s_42sh *sh); */

/* /\* FIXME *\/ */
/* FIXME */

/* void exec_for(struct s_for *node, struct s_42sh *sh); */
/* void exec_case(struct s_case *node, struct s_42sh *sh); */
+9 −16
Original line number Diff line number Diff line
/*
** exec_and.c for 42sh in /home/seblu
** exec_and.c for 42sh
**
** Made by Seblu
** Login   <seblu@epita.fr>
**
** Started on  Sat Mar 25 15:27:20 2006 Seblu
** Last update Sun Apr  9 12:04:03 2006 SIGOURE Benoit
** Last update Sun Nov 12 03:43:57 2006 seblu
*/

#include "execution.h"
#include "exec.h"

#include "mem.h"

/*!
** Execution an AND node
**
** @param node node to treat
** @param sh sh data
*/
void		exec_and(struct s_op *node, struct s_42sh *sh)
void		exec_and(s_bin_node *node)
{
  assert(node && sh);
  exec_node(node->left, sh);
  if (!sh->last_status)
    exec_node(node->right, sh);
  assert(node && node->lhs && node->rhs);
  exec_node(node->lhs);
  //FIXME: error with chained "or" and "and"
  if (!shell->status)
    exec_node(node->rhs);
}

src/exec/exec_ast.c

deleted100644 → 0
+0 −55
Original line number Diff line number Diff line
/*
** exec_node.c for 42sh
**
** Made by Seblu
** Login   <seblu@epita.fr>
**
** Started on  Sat Mar 25 14:51:09 2006 Seblu
** Last update Sat Apr 15 09:12:38 2006 Seblu
*/

#include "exec.h"

/*!
** Execute a node of ast by calling the good function
**
** @param node node to execute
** @param sh shell struct
*/
void		exec_ast(ts_ast_node *node)
{
  node = node;
}

/* { */
/*   if (node == NULL) */
/*     return; */
/*   else if (node->type == T_CMD) */
/*     exec_cmd(&node->data.node_cmd, sh); */
/*   else if (node->type == T_PIPE) */
/*     exec_pipe(&node->data.node_op, sh); */
/*   else if (node->type == T_LINE) */
/*     exec_line(&node->data.node_op, sh); */
/*   else if (node->type == T_SEP_AND) */
/*     exec_sepand(&node->data.node_op, sh); */
/*   else if (node->type == T_SEP_SEMICOMMA) */
/*     exec_sepsemicolon(&node->data.node_op, sh); */
/*   else if (node->type == T_IF) */
/*     exec_if(&node->data.node_if, sh); */
/*   else if (node->type == T_FOR) */
/*     exec_for(&node->data.node_for, sh); */
/*   else if (node->type == T_AND) */
/*     exec_and(&node->data.node_op, sh); */
/*   else if (node->type == T_OR) */
/*     exec_or(&node->data.node_op, sh); */
/*   else if (node->type == T_WHILE) */
/*     exec_while(&node->data.node_while, sh); */
/*   else if (node->type == T_UNTIL) */
/*     exec_until(&node->data.node_while, sh); */
/*   else if (node->type == T_BANG) */
/*     exec_bang(&node->data.node_op, sh); */
/*   else if (node->type == T_SUBSHELL) */
/*     exec_subshell(&node->data.node_subshell, sh); */
/*   else */
/*     assert(0); */
/* } */
Loading