que Ritchie soit avec nous
This commit is contained in:
parent
6ff30f8293
commit
f5247f32dc
7 changed files with 3173 additions and 33 deletions
File diff suppressed because one or more lines are too long
|
|
@ -241,3 +241,246 @@ src/parser/stack_init.c$$
|
||||||
src/parser/sym_free.c$$
|
src/parser/sym_free.c$$
|
||||||
src/parser/tree_func_free.c$$
|
src/parser/tree_func_free.c$$
|
||||||
src/parser/tree_wrapper.c$$
|
src/parser/tree_wrapper.c$$
|
||||||
|
src/builtin/bt_env_opt.c$$
|
||||||
|
src/builtin/bt_read_get.c$$
|
||||||
|
src/builtin/bt_read_term.c$$
|
||||||
|
src/builtin/builtin_cd.c$$
|
||||||
|
src/builtin/builtin_echo.c$$
|
||||||
|
src/builtin/builtin_env.c$$
|
||||||
|
src/builtin/builtin_exit.c$$
|
||||||
|
src/builtin/builtin_export.c$$
|
||||||
|
src/builtin/builtin_func.c$$
|
||||||
|
src/builtin/builtin_hash.c$$
|
||||||
|
src/builtin/builtin_history.c$$
|
||||||
|
src/builtin/builtin_math.c$$
|
||||||
|
src/builtin/builtin_read.c$$
|
||||||
|
src/builtin/builtin_setenv.c$$
|
||||||
|
src/builtin/builtin_unset.c$$
|
||||||
|
src/builtin/builtin_unsetenv.c$$
|
||||||
|
src/builtin/is_builtin.c$$
|
||||||
|
src/completion/c_arrow.c$$
|
||||||
|
src/completion/c_clear.c$$
|
||||||
|
src/completion/c_find_abspath.c$$
|
||||||
|
src/completion/c_find_binary.c$$
|
||||||
|
src/completion/c_find_env.c$$
|
||||||
|
src/completion/c_find_files.c$$
|
||||||
|
src/completion/c_init.c$$
|
||||||
|
src/completion/c_match.c$$
|
||||||
|
src/completion/c_match_glob.c$$
|
||||||
|
src/completion/c_match_update.c$$
|
||||||
|
src/completion/c_misc.c$$
|
||||||
|
src/completion/c_output.c$$
|
||||||
|
src/completion/c_parser.c$$
|
||||||
|
src/completion/c_pathsolver.c$$
|
||||||
|
src/completion/c_printer.c$$
|
||||||
|
src/completion/c_sizing.c$$
|
||||||
|
src/completion/c_terminal.c$$
|
||||||
|
src/completion/completion.c$$
|
||||||
|
src/exec/ast_free.c$$
|
||||||
|
src/exec/bad_fd.c$$
|
||||||
|
src/exec/exec_ampersand.c$$
|
||||||
|
src/exec/exec_and_if.c$$
|
||||||
|
src/exec/exec_bang.c$$
|
||||||
|
src/exec/exec_case_branch.c$$
|
||||||
|
src/exec/exec_destroy.c$$
|
||||||
|
src/exec/exec_elif.c$$
|
||||||
|
src/exec/exec_else.c$$
|
||||||
|
src/exec/exec_func.c$$
|
||||||
|
src/exec/exec_init.c$$
|
||||||
|
src/exec/exec_leaf.c$$
|
||||||
|
src/exec/exec_or_if.c$$
|
||||||
|
src/exec/exec_pipe.c$$
|
||||||
|
src/exec/exec_semi.c$$
|
||||||
|
src/exec/exec_var.c$$
|
||||||
|
src/exec/fd_is_valid.c$$
|
||||||
|
src/exec/ft_exec.c$$
|
||||||
|
src/exec/ft_findexec.c$$
|
||||||
|
src/exec/is_function.c$$
|
||||||
|
src/exec/mark_process_status.c$$
|
||||||
|
src/exec/node_copy.c$$
|
||||||
|
src/exec/pfree_cmd.c$$
|
||||||
|
src/exec/pfree_cond.c$$
|
||||||
|
src/exec/pfree_func.c$$
|
||||||
|
src/exec/pfree_list.c$$
|
||||||
|
src/exec/pfree_subshell.c$$
|
||||||
|
src/exec/plaunch_brace.c$$
|
||||||
|
src/exec/plaunch_builtin.c$$
|
||||||
|
src/exec/plaunch_case.c$$
|
||||||
|
src/exec/plaunch_empty.c$$
|
||||||
|
src/exec/plaunch_file.c$$
|
||||||
|
src/exec/plaunch_for.c$$
|
||||||
|
src/exec/plaunch_function.c$$
|
||||||
|
src/exec/plaunch_if.c$$
|
||||||
|
src/exec/plaunch_subshell.c$$
|
||||||
|
src/exec/plaunch_until.c$$
|
||||||
|
src/exec/plaunch_while.c$$
|
||||||
|
src/exec/process_launch.c$$
|
||||||
|
src/exec/process_redirect.c$$
|
||||||
|
src/exec/process_set.c$$
|
||||||
|
src/exec/process_setgroup.c$$
|
||||||
|
src/exec/process_setsig.c$$
|
||||||
|
src/exec/pset_brace.c$$
|
||||||
|
src/exec/pset_case.c$$
|
||||||
|
src/exec/pset_cmd.c$$
|
||||||
|
src/exec/pset_for.c$$
|
||||||
|
src/exec/pset_if.c$$
|
||||||
|
src/exec/pset_subshell.c$$
|
||||||
|
src/exec/pset_until.c$$
|
||||||
|
src/exec/pset_while.c$$
|
||||||
|
src/exec/redir_copy.c$$
|
||||||
|
src/exec/redir_free.c$$
|
||||||
|
src/exec/redirect_dgreat.c$$
|
||||||
|
src/exec/redirect_dless.c$$
|
||||||
|
src/exec/redirect_great.c$$
|
||||||
|
src/exec/redirect_greatand.c$$
|
||||||
|
src/exec/redirect_less.c$$
|
||||||
|
src/exec/redirect_lessand.c$$
|
||||||
|
src/exec/set_exitstatus.c$$
|
||||||
|
src/exec/token_to_argv.c$$
|
||||||
|
src/glob/command_getoutput.c$$
|
||||||
|
src/glob/dir_glob.c$$
|
||||||
|
src/glob/esc_print.c$$
|
||||||
|
src/glob/expand_bquote.c$$
|
||||||
|
src/glob/expand_brace.c$$
|
||||||
|
src/glob/expand_esc.c$$
|
||||||
|
src/glob/expand_home.c$$
|
||||||
|
src/glob/expand_var.c$$
|
||||||
|
src/glob/ft_strsplit_esc.c$$
|
||||||
|
src/glob/ft_strsplit_spe.c$$
|
||||||
|
src/glob/gen_tab_esc.c$$
|
||||||
|
src/glob/glob.c$$
|
||||||
|
src/glob/is_char_esc.c$$
|
||||||
|
src/glob/match_pattern.c$$
|
||||||
|
src/glob/tab_esc_copy.c$$
|
||||||
|
src/glob/word_is_assignment.c$$
|
||||||
|
src/hash_table/ft_add_hash.c$$
|
||||||
|
src/hash_table/hash.c$$
|
||||||
|
src/hash_table/hash_free.c$$
|
||||||
|
src/hash_table/hash_str.c$$
|
||||||
|
src/hash_table/is_hash.c$$
|
||||||
|
src/history/add_str_in_history.c$$
|
||||||
|
src/history/history.c$$
|
||||||
|
src/history/history_parsing.c$$
|
||||||
|
src/history/history_parsing_toolz.c$$
|
||||||
|
src/history/history_parsing_toolz_2.c$$
|
||||||
|
src/history/list_toolz.c$$
|
||||||
|
src/history/surch_in_history.c$$
|
||||||
|
src/job_control/builtin_bg.c$$
|
||||||
|
src/job_control/builtin_fg.c$$
|
||||||
|
src/job_control/builtin_jobs.c$$
|
||||||
|
src/job_control/do_job_notification.c$$
|
||||||
|
src/job_control/has_running_job.c$$
|
||||||
|
src/job_control/has_stopped_job.c$$
|
||||||
|
src/job_control/job_addprocess.c$$
|
||||||
|
src/job_control/job_cmp_id.c$$
|
||||||
|
src/job_control/job_format.c$$
|
||||||
|
src/job_control/job_format_head.c$$
|
||||||
|
src/job_control/job_free.c$$
|
||||||
|
src/job_control/job_getprocess.c$$
|
||||||
|
src/job_control/job_getrank.c$$
|
||||||
|
src/job_control/job_hup_all.c$$
|
||||||
|
src/job_control/job_is_completed.c$$
|
||||||
|
src/job_control/job_is_stopped.c$$
|
||||||
|
src/job_control/job_notify_change.c$$
|
||||||
|
src/job_control/job_notify_new.c$$
|
||||||
|
src/job_control/job_remove.c$$
|
||||||
|
src/job_control/job_run.c$$
|
||||||
|
src/job_control/job_update_id.c$$
|
||||||
|
src/job_control/job_update_status.c$$
|
||||||
|
src/job_control/job_wait.c$$
|
||||||
|
src/job_control/jobc_destroy.c$$
|
||||||
|
src/job_control/jobc_init.c$$
|
||||||
|
src/job_control/mark_job_as_running.c$$
|
||||||
|
src/job_control/pprint_brace.c$$
|
||||||
|
src/job_control/pprint_case.c$$
|
||||||
|
src/job_control/pprint_cmd.c$$
|
||||||
|
src/job_control/pprint_for.c$$
|
||||||
|
src/job_control/pprint_function.c$$
|
||||||
|
src/job_control/pprint_if.c$$
|
||||||
|
src/job_control/pprint_subshell.c$$
|
||||||
|
src/job_control/pprint_until.c$$
|
||||||
|
src/job_control/pprint_while.c$$
|
||||||
|
src/job_control/process_cmp_pid.c$$
|
||||||
|
src/job_control/process_format.c$$
|
||||||
|
src/job_control/process_free.c$$
|
||||||
|
src/job_control/put_job_in_background.c$$
|
||||||
|
src/job_control/put_job_in_foreground.c$$
|
||||||
|
src/job_control/sigchld_handler.c$$
|
||||||
|
src/job_control/sigint_handler.c$$
|
||||||
|
src/job_control/sigtstp_handler.c$$
|
||||||
|
src/job_control/sigttin_handler.c$$
|
||||||
|
src/job_control/sigttou_handler.c$$
|
||||||
|
src/lexer/do_lexer_routine.c$$
|
||||||
|
src/lexer/get_lexer_stack.c$$
|
||||||
|
src/lexer/get_lexer_stack2.c$$
|
||||||
|
src/lexer/get_reserved_words.c$$
|
||||||
|
src/lexer/get_state_global.c$$
|
||||||
|
src/lexer/get_state_redir.c$$
|
||||||
|
src/lexer/insert_newline.c$$
|
||||||
|
src/lexer/isrw_delim.c$$
|
||||||
|
src/lexer/keep_last_type.c$$
|
||||||
|
src/lexer/lexer_backslash.c$$
|
||||||
|
src/lexer/lexer_bquote.c$$
|
||||||
|
src/lexer/lexer_curly_braces.c$$
|
||||||
|
src/lexer/lexer_default.c$$
|
||||||
|
src/lexer/lexer_delim.c$$
|
||||||
|
src/lexer/lexer_destroy.c$$
|
||||||
|
src/lexer/lexer_dquote.c$$
|
||||||
|
src/lexer/lexer_end.c$$
|
||||||
|
src/lexer/lexer_great.c$$
|
||||||
|
src/lexer/lexer_heredoc.c$$
|
||||||
|
src/lexer/lexer_init.c$$
|
||||||
|
src/lexer/lexer_less.c$$
|
||||||
|
src/lexer/lexer_lex.c$$
|
||||||
|
src/lexer/lexer_newline.c$$
|
||||||
|
src/lexer/lexer_number.c$$
|
||||||
|
src/lexer/lexer_paren.c$$
|
||||||
|
src/lexer/lexer_quote.c$$
|
||||||
|
src/lexer/lexer_sep.c$$
|
||||||
|
src/lexer/lexer_word.c$$
|
||||||
|
src/lexer/token_append.c$$
|
||||||
|
src/lexer/token_cmp_type.c$$
|
||||||
|
src/lexer/token_free.c$$
|
||||||
|
src/lexer/token_init.c$$
|
||||||
|
src/lexer/token_print.c$$
|
||||||
|
src/line_editing/control_features.c$$
|
||||||
|
src/line_editing/ft_prompt.c$$
|
||||||
|
src/line_editing/get_key.c$$
|
||||||
|
src/line_editing/readline.c$$
|
||||||
|
src/line_editing/resize.c$$
|
||||||
|
src/main/data_exit.c$$
|
||||||
|
src/main/data_init.c$$
|
||||||
|
src/main/data_singleton.c$$
|
||||||
|
src/main/ft_putast.c$$
|
||||||
|
src/main/main.c$$
|
||||||
|
src/main/shell_fds.c$$
|
||||||
|
src/main/shell_init.c$$
|
||||||
|
src/main/shell_sig.c$$
|
||||||
|
src/parser/add_bang.c$$
|
||||||
|
src/parser/add_case.c$$
|
||||||
|
src/parser/add_cmd.c$$
|
||||||
|
src/parser/add_condition.c$$
|
||||||
|
src/parser/add_func.c$$
|
||||||
|
src/parser/add_loop.c$$
|
||||||
|
src/parser/add_number.c$$
|
||||||
|
src/parser/add_redir.c$$
|
||||||
|
src/parser/add_sep.c$$
|
||||||
|
src/parser/add_subshell.c$$
|
||||||
|
src/parser/aggregate_sym.c$$
|
||||||
|
src/parser/build_tree.c$$
|
||||||
|
src/parser/do_parser_routine.c$$
|
||||||
|
src/parser/error_syntax.c$$
|
||||||
|
src/parser/eval_sym.c$$
|
||||||
|
src/parser/ft_parse.c$$
|
||||||
|
src/parser/heredoc_parser.c$$
|
||||||
|
src/parser/parser_destroy.c$$
|
||||||
|
src/parser/parser_init.c$$
|
||||||
|
src/parser/pop_stack.c$$
|
||||||
|
src/parser/produce_sym.c$$
|
||||||
|
src/parser/push_stack.c$$
|
||||||
|
src/parser/read_stack.c$$
|
||||||
|
src/parser/redir_init.c$$
|
||||||
|
src/parser/stack_init.c$$
|
||||||
|
src/parser/sym_free.c$$
|
||||||
|
src/parser/tree_func_free.c$$
|
||||||
|
src/parser/tree_wrapper.c$$
|
||||||
|
|
|
||||||
20
42sh/file
20
42sh/file
|
|
@ -1,19 +1 @@
|
||||||
/Users/ariard/Projects/42sh
|
GAGNE
|
||||||
/Users/ariard/Projects/42sh
|
|
||||||
42ShellTester
|
|
||||||
42sh
|
|
||||||
Makefile
|
|
||||||
README.md
|
|
||||||
STDBUG
|
|
||||||
another_file
|
|
||||||
auteur
|
|
||||||
donovan_segaults_06-02
|
|
||||||
file
|
|
||||||
includes
|
|
||||||
libft
|
|
||||||
objs
|
|
||||||
pdf
|
|
||||||
sample
|
|
||||||
scriptheader.sh
|
|
||||||
src
|
|
||||||
update_makefile.sh
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
echo "echo hello" >> sample/again.sh
|
echo "echo hello" >> sample/again.sh
|
||||||
echo hello
|
echo hello
|
||||||
echo hello
|
echo hello
|
||||||
|
echo hello
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/03/11 15:58:38 by ariard #+# #+# */
|
/* Created: 2017/03/11 15:58:38 by ariard #+# #+# */
|
||||||
/* Updated: 2017/03/29 15:19:50 by ariard ### ########.fr */
|
/* Updated: 2017/03/29 16:19:14 by ariard ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -347,6 +347,7 @@ static t_aggrematch g_aggrematch[] =
|
||||||
{AND_OR, CASE_LIST_NS, CASE_LIST_NS, 0},
|
{AND_OR, CASE_LIST_NS, CASE_LIST_NS, 0},
|
||||||
{AND_OR, COMPLETE_CONDITION, COMPOUND_LIST, 0},
|
{AND_OR, COMPLETE_CONDITION, COMPOUND_LIST, 0},
|
||||||
{AND_OR, CONDITION, COMPOUND_LIST, 0},
|
{AND_OR, CONDITION, COMPOUND_LIST, 0},
|
||||||
|
{AND_OR, COMPLETE_CONDITION, COMPOUND_LIST, 0},
|
||||||
{AND_OR, SEPARATOR_OP, LIST, LIST},
|
{AND_OR, SEPARATOR_OP, LIST, LIST},
|
||||||
{AND_OR, NEWLINE_LIST, LIST, 0},
|
{AND_OR, NEWLINE_LIST, LIST, 0},
|
||||||
{AND_OR, LINEBREAK, LIST, 0},
|
{AND_OR, LINEBREAK, LIST, 0},
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/03/11 16:11:21 by ariard #+# #+# */
|
/* Created: 2017/03/11 16:11:21 by ariard #+# #+# */
|
||||||
/* Updated: 2017/03/29 15:52:29 by ariard ### ########.fr */
|
/* Updated: 2017/03/29 16:19:59 by ariard ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -1249,6 +1249,7 @@ static t_stackmatch g_stackmatch[] =
|
||||||
{AND_OR, TK_WHILE},
|
{AND_OR, TK_WHILE},
|
||||||
{AND_OR, TK_UNTIL},
|
{AND_OR, TK_UNTIL},
|
||||||
{AND_OR, TK_IF},
|
{AND_OR, TK_IF},
|
||||||
|
{AND_OR, TK_THEN},
|
||||||
{AND_OR, TK_ELIF},
|
{AND_OR, TK_ELIF},
|
||||||
{AND_OR, TK_ELSE},
|
{AND_OR, TK_ELSE},
|
||||||
{AND_OR, CMD_SUPERIOR},
|
{AND_OR, CMD_SUPERIOR},
|
||||||
|
|
@ -1257,6 +1258,7 @@ static t_stackmatch g_stackmatch[] =
|
||||||
{AND_OR, PIPE_CLOSE_SEQUENCE},
|
{AND_OR, PIPE_CLOSE_SEQUENCE},
|
||||||
{AND_OR, CASE_LIST_NS},
|
{AND_OR, CASE_LIST_NS},
|
||||||
{AND_OR, CONDITION},
|
{AND_OR, CONDITION},
|
||||||
|
{AND_OR, COMPLETE_CONDITION},
|
||||||
{AND_OR, LINEBREAK},
|
{AND_OR, LINEBREAK},
|
||||||
{AND_OR, TK_BANG},
|
{AND_OR, TK_BANG},
|
||||||
{AND_OR, TK_PAREN_OPEN},
|
{AND_OR, TK_PAREN_OPEN},
|
||||||
|
|
@ -1283,6 +1285,7 @@ int eval_sym(t_list **stack, t_sym new_sym)
|
||||||
return (1);
|
return (1);
|
||||||
head = (*stack)->content;
|
head = (*stack)->content;
|
||||||
i = 0;
|
i = 0;
|
||||||
|
DG("eval %s && %s", read_state(*head), read_state(new_sym));
|
||||||
while (g_stackmatch[i].top)
|
while (g_stackmatch[i].top)
|
||||||
{
|
{
|
||||||
if (new_sym == g_stackmatch[i].top && *head == g_stackmatch[i].under)
|
if (new_sym == g_stackmatch[i].top && *head == g_stackmatch[i].under)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2017/02/09 17:58:34 by ariard #+# #+# */
|
/* Created: 2017/02/09 17:58:34 by ariard #+# #+# */
|
||||||
/* Updated: 2017/03/29 14:31:14 by ariard ### ########.fr */
|
/* Updated: 2017/03/29 16:20:29 by ariard ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -129,6 +129,8 @@ static t_prodmatch g_prodmatch[] =
|
||||||
{TK_AMP, PIPE_CLOSE_SEQUENCE, SEPARATOR_OP},
|
{TK_AMP, PIPE_CLOSE_SEQUENCE, SEPARATOR_OP},
|
||||||
{TK_AND_IF, ALL, AND_OR},
|
{TK_AND_IF, ALL, AND_OR},
|
||||||
{TK_OR_IF, ALL, AND_OR},
|
{TK_OR_IF, ALL, AND_OR},
|
||||||
|
{TK_AND_IF, COMPLETE_CONDITION, OTHER},
|
||||||
|
{TK_OR_IF, COMPLETE_CONDITION, OTHER},
|
||||||
{0, 0, 0},
|
{0, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -144,6 +146,7 @@ int produce_sym(t_list **stack, t_sym *new_sym, t_list **lst)
|
||||||
head = (*stack)->content;
|
head = (*stack)->content;
|
||||||
i = 0;
|
i = 0;
|
||||||
*new_sym = 0;
|
*new_sym = 0;
|
||||||
|
DG();
|
||||||
while (g_prodmatch[i].new_sym)
|
while (g_prodmatch[i].new_sym)
|
||||||
{
|
{
|
||||||
if (token->type == g_prodmatch[i].token
|
if (token->type == g_prodmatch[i].token
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue