Guest User

Untitled

a guest
Jul 11th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.82 KB | None | 0 0
  1. ooc_tmp/Regexp.c: In function ‘Regexp_construct’:
  2. ooc_tmp/Regexp.c:206: error: expected expression before ‘RegexpBackend’
  3. ooc_tmp/Regexp.c:207: warning: unused variable ‘regexpBackend’
  4. ooc_tmp/Regexp.c:206: warning: unused variable ‘type’
  5. C compiler failed, aborting compilation process
  6.  
  7.  
  8. /* Regexp header file, generated with ooc */
  9. #ifndef ___Regexp__
  10. #define ___Regexp__
  11.  
  12.  
  13. struct _RegexpBackend;
  14. typedef struct _RegexpBackend RegexpBackend;
  15. struct _RegexpBackendClass;
  16. typedef struct _RegexpBackendClass RegexpBackendClass;
  17. struct _PCRE;
  18. typedef struct _PCRE PCRE;
  19. struct _PCREClass;
  20. typedef struct _PCREClass PCREClass;
  21. struct _Regexp;
  22. typedef struct _Regexp Regexp;
  23. struct _RegexpClass;
  24. typedef struct _RegexpClass RegexpClass;
  25.  
  26. #include <lang/Char.h>
  27. #include <lang/Iterable.h>
  28. #include <lang/Iterator.h>
  29. #include <lang/Object.h>
  30. #include <lang/ooclib.h>
  31. #include <lang/String.h>
  32.  
  33. struct _RegexpBackend
  34. {
  35. struct _Object __super__;
  36. Int PCRE;
  37. Int POSIX;
  38. Int DEFAULT_TYPE;
  39. };
  40.  
  41.  
  42. struct _RegexpBackendClass
  43. {
  44. struct _ObjectClass __super__;
  45. void (*setPattern)(RegexpBackend *this);
  46. Bool (*match)(RegexpBackend *this);
  47. };
  48.  
  49.  
  50. Class *RegexpBackend_class();
  51.  
  52. RegexpBackend *RegexpBackend_new();
  53. void RegexpBackend_construct(RegexpBackend *this);
  54. void RegexpBackend_setPattern(RegexpBackend *this);
  55. Bool RegexpBackend_match(RegexpBackend *this);
  56.  
  57. struct _PCRE
  58. {
  59. struct _RegexpBackend __super__;
  60. };
  61.  
  62.  
  63. struct _PCREClass
  64. {
  65. struct _RegexpBackendClass __super__;
  66. void (*say)(PCRE *this);
  67. };
  68.  
  69.  
  70. Class *PCRE_class();
  71.  
  72. PCRE *PCRE_new();
  73. void PCRE_construct(PCRE *this);
  74. void PCRE_say(PCRE *this);
  75.  
  76. struct _Regexp
  77. {
  78. struct _Object __super__;
  79. RegexpBackend *regexpBackend;
  80. Int type;
  81. };
  82.  
  83.  
  84. struct _RegexpClass
  85. {
  86. struct _ObjectClass __super__;
  87. void (*setPattern)(Regexp *this);
  88. Bool (*match)(Regexp *this);
  89. };
  90.  
  91.  
  92. Class *Regexp_class();
  93.  
  94. Regexp *Regexp_new();
  95. void Regexp_construct(Regexp *this);
  96. void Regexp_setPattern(Regexp *this);
  97. Bool Regexp_match(Regexp *this);
  98.  
  99. Int main();
  100. void _Regexp_load();
  101.  
  102. #endif // ___Regexp__
  103.  
  104.  
  105.  
  106. /* Regexp source file, generated with ooc */
  107. #include "Regexp.h"
  108.  
  109.  
  110. static void RegexpBackend_initialize(RegexpBackend *this)
  111. {
  112. Object_class()->initialize((Object *) this);
  113. this->PCRE = 0;
  114. this->POSIX = 1;
  115. this->DEFAULT_TYPE = 0;
  116. }
  117.  
  118.  
  119. void RegexpBackend_load()
  120. {
  121. static bool __done__ = false;
  122. if (!__done__)
  123. {
  124. __done__ = true;
  125. }
  126. }
  127.  
  128.  
  129.  
  130. static void RegexpBackend_destroy(RegexpBackend *this)
  131. {
  132. {
  133. const Class *super = ((Object *) this)->class->super;
  134. if(super) super->destroy((Object *) this);
  135. }
  136.  
  137.  
  138. }
  139.  
  140.  
  141. RegexpBackend *RegexpBackend_new()
  142. {
  143. RegexpBackend *this = (RegexpBackend *) Class_newInstance((Class *)RegexpBackend_class());
  144. RegexpBackend_construct(this);
  145. return this;
  146. }
  147.  
  148. void RegexpBackend_construct(RegexpBackend *this)
  149. {
  150. }
  151.  
  152. Class *RegexpBackend_class()
  153. {
  154. static bool __done__ = false;
  155. static RegexpBackendClass class =
  156. {
  157. {
  158. {
  159. .size = sizeof(RegexpBackend),
  160. .name = "RegexpBackend",
  161. .initialize = (void (*)(Object *))RegexpBackend_initialize,
  162. .destroy = (void (*)(Object *))RegexpBackend_destroy,
  163. },
  164. },
  165. .setPattern = RegexpBackend_setPattern,
  166. .match = RegexpBackend_match,
  167. };
  168. Class *classPtr = (Class *) &class;
  169. if(!__done__)
  170. {
  171. __done__ = true;
  172. classPtr->super = Object_class();
  173. }
  174. return classPtr;
  175. }
  176.  
  177.  
  178. void RegexpBackend_setPattern(RegexpBackend *this)
  179. {
  180. ((RegexpBackendClass *)((Object *)this)->class)->setPattern(this);
  181. }
  182.  
  183.  
  184. Bool RegexpBackend_match(RegexpBackend *this)
  185. {
  186. return ((RegexpBackendClass *)((Object *)this)->class)->match(this);
  187. }
  188.  
  189.  
  190.  
  191.  
  192. static void PCRE_initialize(PCRE *this)
  193. {
  194. RegexpBackend_class()->initialize((Object *) this);
  195. }
  196.  
  197.  
  198. void PCRE_load()
  199. {
  200. static bool __done__ = false;
  201. if (!__done__)
  202. {
  203. __done__ = true;
  204. }
  205. }
  206.  
  207.  
  208.  
  209. static void PCRE_destroy(PCRE *this)
  210. {
  211. {
  212. const Class *super = ((Object *) this)->class->super;
  213. if(super) super->destroy((Object *) this);
  214. }
  215.  
  216.  
  217. }
  218.  
  219.  
  220. PCRE *PCRE_new()
  221. {
  222. PCRE *this = (PCRE *) Class_newInstance((Class *)PCRE_class());
  223. PCRE_construct(this);
  224. return this;
  225. }
  226.  
  227. void PCRE_construct(PCRE *this)
  228. {
  229. }
  230.  
  231.  
  232. static void PCRE_say_impl(PCRE *this)
  233. {
  234. printf("hi\n");
  235. }
  236.  
  237. Class *PCRE_class()
  238. {
  239. static bool __done__ = false;
  240. static PCREClass class =
  241. {
  242. {
  243. {
  244. {
  245. .size = sizeof(PCRE),
  246. .name = "PCRE",
  247. .initialize = (void (*)(Object *))PCRE_initialize,
  248. .destroy = (void (*)(Object *))PCRE_destroy,
  249. },
  250. },
  251. .setPattern = RegexpBackend_setPattern,
  252. .match = RegexpBackend_match,
  253. },
  254. .say = PCRE_say_impl,
  255. };
  256. Class *classPtr = (Class *) &class;
  257. if(!__done__)
  258. {
  259. __done__ = true;
  260. classPtr->super = RegexpBackend_class();
  261. }
  262. return classPtr;
  263. }
  264.  
  265.  
  266. void PCRE_say(PCRE *this)
  267. {
  268. ((PCREClass *)((Object *)this)->class)->say(this);
  269. }
  270.  
  271.  
  272.  
  273.  
  274. static void Regexp_initialize(Regexp *this)
  275. {
  276. Object_class()->initialize((Object *) this);
  277. }
  278.  
  279.  
  280. void Regexp_load()
  281. {
  282. static bool __done__ = false;
  283. if (!__done__)
  284. {
  285. __done__ = true;
  286. }
  287. }
  288.  
  289.  
  290.  
  291. static void Regexp_destroy(Regexp *this)
  292. {
  293. {
  294. const Class *super = ((Object *) this)->class->super;
  295. if(super) super->destroy((Object *) this);
  296. }
  297.  
  298.  
  299. }
  300.  
  301.  
  302. Regexp *Regexp_new()
  303. {
  304. Regexp *this = (Regexp *) Class_newInstance((Class *)Regexp_class());
  305. Regexp_construct(this);
  306. return this;
  307. }
  308.  
  309. void Regexp_construct(Regexp *this)
  310. {
  311. Int type = RegexpBackend->DEFAULT_TYPE;
  312. PCRE *regexpBackend = PCRE_new();
  313. }
  314.  
  315.  
  316. static void Regexp_setPattern_impl(Regexp *this)
  317. {
  318. RegexpBackend_setPattern(((Regexp *)this)->regexpBackend);
  319. }
  320.  
  321.  
  322. static Bool Regexp_match_impl(Regexp *this)
  323. {
  324. return RegexpBackend_match(((Regexp *)this)->regexpBackend);
  325. }
  326.  
  327. Class *Regexp_class()
  328. {
  329. static bool __done__ = false;
  330. static RegexpClass class =
  331. {
  332. {
  333. {
  334. .size = sizeof(Regexp),
  335. .name = "Regexp",
  336. .initialize = (void (*)(Object *))Regexp_initialize,
  337. .destroy = (void (*)(Object *))Regexp_destroy,
  338. },
  339. },
  340. .setPattern = Regexp_setPattern_impl,
  341. .match = Regexp_match_impl,
  342. };
  343. Class *classPtr = (Class *) &class;
  344. if(!__done__)
  345. {
  346. __done__ = true;
  347. classPtr->super = Object_class();
  348. }
  349. return classPtr;
  350. }
  351.  
  352.  
  353. void Regexp_setPattern(Regexp *this)
  354. {
  355. ((RegexpClass *)((Object *)this)->class)->setPattern(this);
  356. }
  357.  
  358.  
  359. Bool Regexp_match(Regexp *this)
  360. {
  361. return ((RegexpClass *)((Object *)this)->class)->match(this);
  362. }
  363.  
  364.  
  365. Int main()
  366. {
  367. GC_INIT();
  368. _Regexp_load();
  369. Regexp_new();
  370. return 0;
  371. }
  372.  
  373.  
  374. void _Regexp_load()
  375. {
  376. static bool __done__ = false;
  377. if (!__done__)
  378. {
  379. __done__ = true;
  380. RegexpBackend_load();
  381. PCRE_load();
  382. Regexp_load();
  383. _lang_Char_load();
  384. _lang_Iterable_load();
  385. _lang_Iterator_load();
  386. _lang_Object_load();
  387. _lang_ooclib_load();
  388. _lang_String_load();
  389. }
  390. }
Add Comment
Please, Sign In to add comment