JoshDreamland

Parser_Progress_2012_03_19

Mar 19th, 2012
100
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //====== INPUT =============================================
  2.  
  3. #if false
  4.  
  5. #  error Failure
  6. int zzzzzzzzzzzzzzYOUSHOULDNOTSEETHIS;
  7.  
  8.   #if 1
  9.     int zzzzzzzzzzzzzzzYOUSHOULDNOTSEETHIS;
  10.  
  11.   #else
  12.  
  13.     int zzzzzzzzzzzzzzzzYOUSHOULDNOTSEETHIS;
  14.   #endif
  15.  
  16. #else
  17.   int right_as_rain;
  18.   #if 0
  19.     int zzzzzzzzzzzzzzYOUSHOULDNOTSEETHIS;
  20.    
  21.   #else
  22.     int right_as_rain1;
  23.    
  24.   #endif
  25.  
  26.   #if 0
  27.     int zzzzzzz_YOUSHOULDNTSEETHIS;
  28.   #elif 0
  29.     int zzzzzzzz_YOUSHOULDNTSEETHIS;
  30.   #elif 1
  31.     int right_as_rain2;
  32.   #elif 1
  33.     int zzzzzzzzz_YOUSHOULDNTSEETHIS;
  34.   #elif 0
  35.     int zzzzzzzzzz_YOUSHOULDNTSEETHIS;
  36.   #elif 1
  37.     int zzzzzzzzzzz_YOUSHOULDNTSEETHIS;
  38.   #else
  39.     int zzzzzzzzzzzz_YOUSHOULDNTSEETHIS;
  40.   #endif
  41.  
  42. const int a = 10 + 20 + 30, b, c = 5;
  43. double d, e, f = 10;
  44. namespace justdefineit {
  45.   long unsigned g;
  46.   long unsigned int h;
  47.   long unsigned long k;
  48. }
  49. long double i;
  50. class koalacub {
  51.   int leavesEaten;
  52.   int chutesEaten;
  53. };
  54. class koala: koalacub {
  55.   koalacub *children[10]; // A koala can have at most ten children because of reasons.
  56. };
  57.  
  58. int *level1_simple[10];
  59. unsigned long const int   (  *  level2_better )  [ 10+5+7+9 / 3 ] ;
  60. int* (*(*level3_confusing)[10][12])[15];
  61. long double (*(&*level4_whatthefuck[10])[2][4])(char, short, int, long, double, long double);
  62. long double (*(&*(***level5_okaycutitout[1^2^4^8])(int illegalnest, char (*but)(int oh, int well))[10])[2][4])(char, short, int, long, double, long double);
  63.  
  64.  
  65. int my_implemented_function(int) {
  66.   implementation
  67. }
  68.  
  69. int my_implemented_function_2(int, double, char) {
  70.   implementation
  71. }
  72. int (my_implemented_function_3)(const long double) {
  73.   implementation
  74. }
  75.  
  76. #endif
  77.  
  78. #if 1+1==2
  79.   #if 2+2==3
  80.     #error POOZER
  81.   "#endif"
  82.   /*#endif*/
  83.   //#endif"
  84.   '\
  85.  #endif'
  86.     #error BLEW IT
  87.   #else
  88.     int yes_I_can_do_math;
  89.   #endif
  90. #else
  91.   #error FAILURE
  92. #endif
  93.  
  94. /*
  95.  
  96.  
  97. int my_overloaded_function(int) {
  98.   implementation 1
  99. }
  100. int my_overloaded_function(int,int) {
  101.   implementation 2
  102. }
  103.  
  104. template<typename a> int function2(a b) { }
  105.  
  106. template<typename b> class templateclass { b aidu; }
  107. */
  108.  
  109. int zzzzz_success;
  110.  
  111.  
  112.  
  113. //====== OUTPUT ============================================
  114.  
  115. ============================================================================
  116. =: Test simple macros :=====================================================
  117. ============================================================================
  118.  
  119. #define one_arg_function(x) \
  120.   (1/(1-(\
  121.   x\
  122.   )))
  123. #define scalar_macro
  124.   simple value
  125. #define simple_function() \
  126.   Takes no parameters
  127. #define two_arg_function(a, b) \
  128.   (-(\
  129.   b\
  130.   )/(2*(\
  131.   a\
  132.   )))
  133. #define variadic_three_arg_function(a, b, c...) \
  134.   printf(\
  135.   a\
  136.   ,\
  137.   b\
  138.   ,\
  139.   c\
  140.   )
  141.  
  142.  
  143.  
  144.  
  145. ============================================================================
  146. =: Metrics :================================================================
  147. ============================================================================
  148.  
  149. sizeof(jdip::macro_type):       4
  150. sizeof(jdip::macro_function):   56
  151. sizeof(jdip::macro_scalar):     16
  152.  
  153.  
  154.  
  155.  
  156. ============================================================================
  157. =: Test expression evaluator :==============================================
  158. ============================================================================
  159.  
  160. 10
  161. 20
  162. 30
  163. 40
  164. 50
  165. 60
  166. 1
  167. 12
  168. 123
  169.  
  170.  
  171.  
  172.  
  173. ============================================================================
  174. =: Test parser :============================================================
  175. ============================================================================
  176.  
  177. Parse finished in 344 microseconds.
  178. const int a;
  179. const int b;
  180. const int c;
  181. double d;
  182. double e;
  183. double f;
  184. long double i;
  185. namespace justdefineit {
  186.   unsigned long g;
  187.   unsigned long int h;
  188.   unsigned long long k;
  189. }
  190. class koala: private koalacub {
  191.   koalacub *children[10];
  192. }
  193. class koalacub {
  194.   int chutesEaten;
  195.   int leavesEaten;
  196. }
  197. int *level1_simple[10];
  198. const unsigned long int (*level2_better)[25];
  199. int *(*(*level3_confusing)[10][12])[15];
  200. long double (*(&*level4_whatthefuck[10])[2][4])(char, short, int, long, double, long double);
  201. long double (*(&*(***level5_okaycutitout[15])(int illegalnest, char (*but)(int oh, int well))[10])[2][4])(char, short, int, long, double, long double);
  202. int my_implemented_function(int);
  203. int my_implemented_function_2(int, double, char);
  204. int my_implemented_function_3(const long double);
  205. int right_as_rain;
  206. int right_as_rain1;
  207. int right_as_rain2;
  208. int yes_I_can_do_math;
  209. int zzzzz_success;
  210.  
  211. ====[++++++++++++++++++++++++++++++ SUCCESS! ++++++++++++++++++++++++++++++]====
  212.  
  213.  
  214. Process returned 0 (0x0)   execution time : 0.023 s
  215. Press ENTER to continue.
RAW Paste Data