int num_tokens = 0;
char delim[] = " ";
char* token = strtok(buffer, delim);
while(token != NULL) {
    num_tokens++;
    token = strtok(NULL, delim);
}

// Make new token
char *new_token = strtok(buffer, delim);
Action *new_act = malloc(sizeof(Action));
new_act->args = malloc(sizeof(char*)*(num_tokens+1));
int i = 0;
while(new_token != NULL) {
    if(new_token[0] == '\t'){
        new_token = new_token + 1;
    }
    new_act->args[i] = malloc(strlen(new_token) + 1);
    strcpy(new_act->args[i], new_token);
    //printf("%s\n", new_token);
    i++;
    new_token = strtok(NULL, delim);
}
new_act->args[i] = NULL;

// Add the action to the current rule
insert_action(curr_rule, new_act);
each string token is not being iterated properly