]> Nishi Git Mirror - dataworks.git/commitdiff
gonna make parser work later
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 22 May 2024 05:42:14 +0000 (05:42 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 22 May 2024 05:42:14 +0000 (05:42 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@73 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

Client/main.c
Library/parser.c

index f00043347df2ca139f4dfa7c3d4ce66807e77537..ff54203619fe7f31dab45109c4a9311a265fdcce 100644 (file)
@@ -181,6 +181,10 @@ int main(int argc, char** argv) {
                        }else if(strlen(buf) > 0){
                                struct __dw_token* token = __dw_parser_parse(buf);
                                if(token != NULL){
+                                       if(token->error){
+                                               printf("%s\n", dataworks_database_strerror(token->errnum));
+                                       }else{
+                                       }
                                }else{
                                        printf("Parser returned NULL. Help!\n");
                                }
index 162c66cebe3a1829b3825974827a25d4e489481e..489fbace1c913deca10fb925dc95ae4b544b716a 100644 (file)
 
 #include "dw_parser.h"
 
+#include "dw_database.h"
+
 #include <stddef.h>
+#include <stdlib.h>
+#include <stdbool.h>
 
 struct __dw_token* __dw_parser_parse(const char* str){
-       return NULL;
+       struct __dw_token* token = malloc(sizeof(*token));
+       token->error = false;
+       token->errnum = DW_ERR_SUCCESS;
+       token->token = NULL;
+       return token;
 }