}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");
}
#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;
}