Commit 30a57534 authored by Seblu's avatar Seblu

--no commit message

--no commit message
parent bd4960f1
......@@ -15,19 +15,22 @@ echo "checking CFLAGS..."
AC_CANONICAL_HOST
case $host_os in
*osf*)
*osf*)
CFLAGS='-Wall -W -ansi -pedantic -D_XOPEN_SOURCE=600'
;;
*solaris*)
*solaris*)
CFLAGS='-Wall -W -ansi -pedantic -D_XOPEN_SOURCE=600'
;;
*linux*|*netbsd*)
*linux*|*netbsd*)
CFLAGS='-Wall -Wextra -std=c99 -pedantic -D_XOPEN_SOURCE=600 -pipe'
;;
*)
pl="`uname -s`"
AC_MSG_ERROR([Platform $pl not supported.])
*darwin*)
CFLAGS='-Wall -W -std=c99 -pedantic -D_XOPEN_SOURCE=600 -pipe'
;;
*)
pl="`uname -s`"
AC_MSG_ERROR([Platform $pl not supported.])
;;
esac
# Check for C compiler
......@@ -85,8 +88,6 @@ AC_CHECK_HEADERS([limits.h])
dnl Memo:
dnl AC ARG WITH(package, help-string, [action-if-given], [action-if-not-given])
AC_ARG_WITH([noerror],
[AS_HELP_STRING([--with-noerror], [Warning dont create compilation error])],
[dnl action-if-given
......
......@@ -5,7 +5,7 @@
** Login <seblu@epita.fr>
**
** Started on Sun Mar 30 16:02:07 2006 Seblu
** Last update Sun Nov 12 03:43:20 2006 seblu
** Last update Sun Nov 12 13:29:49 2006 seblu
*/
#ifndef EXEC_H_
......@@ -16,21 +16,12 @@
# include "../ast/ast.h"
# include "../shell/shell.h"
void exec_node(s_ast_node *node);
/* 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); */
/* void exec_until(struct s_while *node, struct s_42sh *sh); */
/* void exec_and(struct s_op *node, struct s_42sh *sh); */
/* void exec_or(struct s_op *node, struct s_42sh *sh); */
/* void exec_cmd(struct s_cmd *node, struct s_42sh *sh); */
/* void exec_pipe(struct s_op *node, struct s_42sh *sh); */
/* void exec_bang(struct s_op *node, struct s_42sh *sh); */
/* void exec_sepand(struct s_op *node, struct s_42sh *sh); */
/* void exec_sepsemicolon(struct s_op *node, struct s_42sh *sh); */
/* void exec_line(struct s_op *node, struct s_42sh *sh); */
/* void exec_subshell(struct s_subshell *node, struct s_42sh *sh); */
void exec_node(s_ast_node *node);
void exec_and(s_bin_node *node);
void exec_or(s_bin_node *node);
void exec_bang(s_bin_node *node);
void exec_if(s_if_node *node);
void exec_while(s_while_node *node);
/* FIXME */
......
......@@ -5,14 +5,14 @@
** Login <seblu@epita.fr>
**
** Started on Sat Mar 25 15:27:20 2006 Seblu
** Last update Sun Nov 12 03:43:57 2006 seblu
** Last update Sun Nov 12 13:40:37 2006 seblu
*/
#include "exec.h"
void exec_and(s_bin_node *node)
{
assert(node && node->lhs && node->rhs);
assert(node);
exec_node(node->lhs);
//FIXME: error with chained "or" and "and"
if (!shell->status)
......
......@@ -5,12 +5,12 @@
** Login <seblu@epita.fr>
**
** Started on Sat Mar 25 15:27:20 2006 Seblu
** Last update Sun Nov 12 03:45:42 2006 seblu
** Last update Sun Nov 12 13:11:02 2006 seblu
*/
#include "exec.h"
void exec_if(s_if_node *node)
void exec_if(s_if_node *node)
{
assert(node);
exec_node(node->cond);
......
......@@ -5,51 +5,29 @@
** Login <seblu@epita.fr>
**
** Started on Sat Mar 25 14:51:09 2006 Seblu
** Last update Tue Aug 29 00:19:35 2006 Seblu
** Last update Sun Nov 12 13:36:41 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_node(s_ast_node *node)
{
node = node;
if (node == NULL)
return;
switch (node->type) {
case T_SEP: break;
case T_SEPAND: break;
case T_CMD: break;
case T_RED: break;
case T_PIPE: break;
case T_AND: exec_and(&node->body.child_and); break;
case T_OR: exec_or(&node->body.child_or); break;
case T_IF: exec_if(&node->body.child_if); break;
case T_WHILE: exec_while(&node->body.child_while); break;
case T_BANG: exec_bang(&node->body.child_bang); break;
case T_SUBSHELL: break;
case T_FUNCDEC: break;
case T_CASE: break;
default: assert(0);
}
}
/* { */
/* 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); */
/* } */
......@@ -5,14 +5,14 @@
** Login <seblu@epita.fr>
**
** Started on Sat Mar 25 15:27:20 2006 Seblu
** Last update Sun Nov 12 03:45:03 2006 seblu
** Last update Sun Nov 12 13:40:45 2006 seblu
*/
#include "exec.h"
void exec_or(s_bin_node *node)
{
assert(node && node->lhs && node->rhs);
assert(node);
exec_node(node->lhs);
//FIXME: error with chained "or" and "and"
if (shell->status)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment