Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "sya.h"
- #include "tokenizer.h"
- int main()
- {
- char *asd = "tan(10.3) * 2";
- queue *q = sy_alghoritm(asd);
- for (int i = 0; i < q->count; i++) {
- printf("%s\n", q_dequeue(q));
- }
- /*stack *s = create_stack(8);
- ops *o1 = malloc(sizeof(ops));
- char *s1 = malloc(5);
- memcpy(s1, "hej1", 5);
- o1->value = s1;
- ops *o2 = malloc(sizeof(ops));
- char *s2 = malloc(5);
- memcpy(s2, "hej2", 5);
- o2->value = s2;
- ops *o3 = malloc(sizeof(ops));
- char *s3 = malloc(5);
- memcpy(s3, "hej3", 5);
- o3->value = s3;
- ops *o4 = malloc(sizeof(ops));
- char *s4 = malloc(5);
- memcpy(s4, "hej4", 5);
- o4->value = s4;
- s_push(s, o1);
- s_push(s, o2);
- s_push(s, o3);
- s_push(s, o4);
- for (int i = 0; i < 4; i++) {
- printf("%s\n", s_pop(s)->value);
- }*/
- //queue *q = create_queue(4);
- //ops *o1 = malloc(sizeof(ops));
- //char *s1 = malloc(5);
- //memcpy(s1, "hej1", 5);
- //o1->value = s1;
- //ops *o2 = malloc(sizeof(ops));
- //char *s2 = malloc(5);
- //memcpy(s2, "hej2", 5);
- //o2->value = s2;
- //ops *o3 = malloc(sizeof(ops));
- //char *s3 = malloc(5);
- //memcpy(s3, "hej3", 5);
- //o3->value = s3;
- //ops *o4 = malloc(sizeof(ops));
- //char *s4 = malloc(5);
- //memcpy(s4, "hej4", 5);
- //o4->value = s4;
- //q_enqueue(q, o1);
- //q_enqueue(q, o2);
- //q_enqueue(q, o3);
- //q_enqueue(q, o4);
- /*for (int i = 0; i < 4; i++) {
- printf("%s\n", q_dequeue(q)->value);
- }*/
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement