添加符号和数字的解析

This commit is contained in:
ranchuan
2024-10-30 19:08:46 +08:00
parent 93a8c2c265
commit 01a7999d55
7 changed files with 264 additions and 56 deletions

34
main.c
View File

@@ -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( );
}