Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include "sya.h"
  5. #include "tokenizer.h"
  6.  
  7. int main()
  8. {
  9.  
  10. char *asd = "tan(10.3) * 2";
  11.  
  12.  
  13. queue *q = sy_alghoritm(asd);
  14. for (int i = 0; i < q->count; i++) {
  15. printf("%s\n", q_dequeue(q));
  16. }
  17. /*stack *s = create_stack(8);
  18.  
  19. ops *o1 = malloc(sizeof(ops));
  20. char *s1 = malloc(5);
  21. memcpy(s1, "hej1", 5);
  22. o1->value = s1;
  23.  
  24. ops *o2 = malloc(sizeof(ops));
  25. char *s2 = malloc(5);
  26. memcpy(s2, "hej2", 5);
  27. o2->value = s2;
  28.  
  29. ops *o3 = malloc(sizeof(ops));
  30. char *s3 = malloc(5);
  31. memcpy(s3, "hej3", 5);
  32. o3->value = s3;
  33.  
  34. ops *o4 = malloc(sizeof(ops));
  35. char *s4 = malloc(5);
  36. memcpy(s4, "hej4", 5);
  37. o4->value = s4;
  38.  
  39.  
  40.  
  41. s_push(s, o1);
  42. s_push(s, o2);
  43. s_push(s, o3);
  44. s_push(s, o4);
  45.  
  46.  
  47.  
  48. for (int i = 0; i < 4; i++) {
  49. printf("%s\n", s_pop(s)->value);
  50. }*/
  51. //queue *q = create_queue(4);
  52.  
  53. //ops *o1 = malloc(sizeof(ops));
  54. //char *s1 = malloc(5);
  55. //memcpy(s1, "hej1", 5);
  56. //o1->value = s1;
  57.  
  58. //ops *o2 = malloc(sizeof(ops));
  59. //char *s2 = malloc(5);
  60. //memcpy(s2, "hej2", 5);
  61. //o2->value = s2;
  62.  
  63. //ops *o3 = malloc(sizeof(ops));
  64. //char *s3 = malloc(5);
  65. //memcpy(s3, "hej3", 5);
  66. //o3->value = s3;
  67.  
  68. //ops *o4 = malloc(sizeof(ops));
  69. //char *s4 = malloc(5);
  70. //memcpy(s4, "hej4", 5);
  71. //o4->value = s4;
  72.  
  73.  
  74.  
  75. //q_enqueue(q, o1);
  76. //q_enqueue(q, o2);
  77. //q_enqueue(q, o3);
  78. //q_enqueue(q, o4);
  79.  
  80.  
  81.  
  82. /*for (int i = 0; i < 4; i++) {
  83. printf("%s\n", q_dequeue(q)->value);
  84. }*/
  85.  
  86.  
  87.  
  88. getchar();
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. return 0;
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement