2021-10-13 18:05:54 +08:00
|
|
|
#include "PikaParser.h"
|
|
|
|
#include "PikaObj.h"
|
|
|
|
#include "dataQueueObj.h"
|
|
|
|
#include "dataStrs.h"
|
|
|
|
|
|
|
|
AST* pikaParse(char* line) {
|
|
|
|
AST* ast = New_queueObj();
|
|
|
|
Args* buffs = New_strBuff();
|
2021-10-13 18:24:38 +08:00
|
|
|
char* stmt = strsGetCleanCmd(buffs, line);
|
|
|
|
char* assignment = strsGetFirstToken(buffs, stmt, '(');
|
2021-10-13 18:05:54 +08:00
|
|
|
char* direct = NULL;
|
2021-10-13 18:24:38 +08:00
|
|
|
char* method = NULL;
|
2021-10-13 18:05:54 +08:00
|
|
|
if (strIsContain(assignment, '=')) {
|
|
|
|
direct = strsGetFirstToken(buffs, assignment, '=');
|
2021-10-13 18:24:38 +08:00
|
|
|
method = strGetLastToken(buffs, assignment, '=');
|
2021-10-13 18:05:54 +08:00
|
|
|
}
|
2021-10-13 18:24:38 +08:00
|
|
|
method = assignment;
|
|
|
|
char* subStmts = strsCut(buffs, stmt, '(', ')');
|
2021-10-13 18:05:54 +08:00
|
|
|
|
|
|
|
goto exit;
|
|
|
|
exit:
|
|
|
|
args_deinit(buffs);
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
|
|
|
char* AST_toShell(AST* ast, Args* buffs) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
int32_t AST_deinit(AST* ast) {
|
|
|
|
return obj_deinit(ast);
|
|
|
|
}
|