/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* get_instruction2.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/05 22:05:26 by ariard #+# #+# */ /* Updated: 2017/02/06 20:37:24 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ #include "parser.h" int get_sub_instruction(t_btree **ast, t_list **start, t_list **lst) { t_token *token; token = (*lst)->content; if (token->type & TK_NEWLINE) return (parse_separator(ast, start, lst)); else if (token->type & (TK_WHILE | TK_UNTIL)) return (parse_while(ast, start, lst)); else if (token->type & TK_IF) return (parse_if(ast, start, lst)); else if (token->type & TK_ELIF) return (parse_elif(ast, start, lst)); else if (token->type & TK_ELSE) return (parse_else(ast, start, lst)); else if (token->type & TK_SEMI) return (parse_separator(ast, start, lst)); return (0); }