예제 #1
0
파일: shell.c 프로젝트: e-learning/aptu-os
void execute(char* command)
{
	if (create_tokens(command))
	{
		create_process();
		delete_tokens();
	}
}
예제 #2
0
파일: main.c 프로젝트: vvaleriu/ecole
void		proceed_to_execution(t_var *var)
{
	var->list = lexer(var, var->lex);
	var->list = create_tokens(var->list);
	var->root = parser(var->list);
	execute_tree(var, var->root);
	clean_tree(var->root);
	var->root = NULL;
	var->list = NULL;
	clean_line_pointers(var);
}
예제 #3
0
}END_TEST

START_TEST(test_create_tokens){
	TokenList token;
	TokenList *tok=&token;
	char arg[]="one\"'te\\xt'\"two";
	tok->next=create_tokens(arg);
	fail_unless(tok->next->token.type==TOK_NULL &&
				tok->next->next->token.type==TOK_QUOTE &&
				tok->next->next->next->token.type==TOK_QUOTE_STR &&
				tok->next->next->next->next->token.type==TOK_QUOTE &&
				tok->next->next->next->next->next->token.type==TOK_NULL);
}END_TEST