添加符号和数字的解析
This commit is contained in:
34
main.c
34
main.c
@@ -6,15 +6,26 @@
|
||||
#include "soft/mythread.h"
|
||||
#include "unistd.h"
|
||||
#include "soft/debug.h"
|
||||
#include "string.h"
|
||||
#include "soft/clexical.h"
|
||||
|
||||
|
||||
int thread_fun(void *t){
|
||||
|
||||
|
||||
const char g_str[ ] = "int main(){\n"
|
||||
"int index;\n"
|
||||
"while(1){\n"
|
||||
"printf(index)\n"
|
||||
"}\n"
|
||||
"}";
|
||||
|
||||
|
||||
|
||||
|
||||
int thread_fun(void* t) {
|
||||
DBG_INFO("run in thread_fun.\n");
|
||||
lex_analysis(g_str , strlen(g_str));
|
||||
|
||||
while(1){
|
||||
sleep(5);
|
||||
throw_("s");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -26,18 +37,9 @@ int main(int argc,char *argv[]){
|
||||
debug_init(NULL);
|
||||
DBG_INFO("hello world.%ld\n",(size_t)pthread_self());
|
||||
|
||||
myth_create(thread_fun , NULL);
|
||||
|
||||
|
||||
// while(p&&(*p)){
|
||||
|
||||
// printf("%s\n",*p++);
|
||||
// }
|
||||
|
||||
// printf("a+b=%d",test_add(3,5));
|
||||
myth_create(thread_fun,NULL);
|
||||
myth_create(NULL,NULL);
|
||||
// sleep(10);
|
||||
myth_join();
|
||||
myth_join( );
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user