Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15664 lines
406 KiB

  1. #include "precomp.h"
  2. /* Copyright (C) Boris Nikolaus, Germany, 1996-1997. All rights reserved. */
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <ctype.h>
  6. #include "defs.h"
  7. #include "builtin.h"
  8. #include "hackdir.h"
  9. extern int pass;
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <stdarg.h>
  13. #include <limits.h>
  14. #include "parser.h"
  15. int llcpos;
  16. int *llstk;
  17. unsigned llstksize;
  18. unsigned llcstp = 1;
  19. LLTERM *lltokens;
  20. int llntokens;
  21. char llerrormsg[256];
  22. LLPOS llerrorpos;
  23. int llepos;
  24. LLSTYPE lllval;
  25. int llterm(int token, LLSTYPE *lval, LLSTATE *llin, LLSTATE *llout);
  26. void llfailed(LLPOS *pos, char *fmt, ...);
  27. void llresizestk();
  28. #define LLCHECKSTK do{if (llcstp + 1 >= llstksize) llresizestk();}while(/*CONSTCOND*/0)
  29. #define LLFAILED(_err) do{llfailed _err; goto failed;}while(/*CONSTCOND*/0)
  30. #define LLCUTOFF do{unsigned i; for (i = llstp; i < llcstp; i++) if (llstk[i] > 0) llstk[i] = -llstk[i];}while(/*CONSTCOND*/0)
  31. #define LLCUTTHIS do{if (llstk[llstp] > 0) llstk[llstp] = -llstk[llstp];}while(/*CONSTCOND*/0)
  32. #define LLCUTALL do{unsigned i; for (i = 0; i < llcstp; i++) if (llstk[i] > 0) llstk[i] = -llstk[i];}while(/*CONSTCOND*/0)
  33. #if LLDEBUG > 0
  34. int lldebug;
  35. int last_linenr;
  36. char *last_file = "";
  37. #define LLDEBUG_ENTER(_ident) lldebug_enter(_ident)
  38. #define LLDEBUG_LEAVE(_ident,_succ) lldebug_leave(_ident,_succ)
  39. #define LLDEBUG_ALTERNATIVE(_ident,_alt) lldebug_alternative(_ident,_alt)
  40. #define LLDEBUG_ITERATION(_ident,_num) lldebug_iteration(_ident,_num)
  41. #define LLDEBUG_TOKEN(_exp,_pos) lldebug_token(_exp,_pos)
  42. #define LLDEBUG_ANYTOKEN(_pos) lldebug_anytoken(_pos)
  43. #define LLDEBUG_BACKTRACKING(_ident) lldebug_backtracking(_ident)
  44. void lldebug_init();
  45. void lldebug_enter(char *ident);
  46. void lldebug_leave(char *ident, int succ);
  47. void lldebug_alternative(char *ident, int alt);
  48. void lldebug_token(int expected, unsigned pos);
  49. void lldebug_anytoken(unsigned pos);
  50. void lldebug_backtracking(char *ident);
  51. void llprinttoken(LLTERM *token, char *identifier, FILE *f);
  52. #else
  53. #define LLDEBUG_ENTER(_ident)
  54. #define LLDEBUG_LEAVE(_ident,_succ)
  55. #define LLDEBUG_ALTERNATIVE(_ident,_alt)
  56. #define LLDEBUG_ITERATION(_ident,_num)
  57. #define LLDEBUG_TOKEN(_exp,_pos)
  58. #define LLDEBUG_ANYTOKEN(_pos)
  59. #define LLDEBUG_BACKTRACKING(_ident)
  60. #endif
  61. int ll_Main(LLSTATE *llin, LLSTATE *llout)
  62. {
  63. unsigned llstp = llcstp;
  64. LLSTATE llstate_0;
  65. LLDEBUG_ENTER("Main");
  66. llstate_0 = *llin;
  67. #undef failed
  68. #define failed failed1
  69. {LLSTATE llstate_1;
  70. if (!ll_ModuleDefinition(&llstate_0, &llstate_1)) goto failed1;
  71. {LLSTATE llstate_2;
  72. if (!ll_ModuleDefinition_ESeq(&llstate_1, &llstate_2)) goto failed1;
  73. *llout = llstate_2;
  74. }}
  75. LLDEBUG_LEAVE("Main", 1);
  76. return 1;
  77. failed1: LLDEBUG_LEAVE("Main", 0);
  78. return 0;
  79. }
  80. int ll_ModuleDefinition_ESeq(LLSTATE *llin, LLSTATE *llout)
  81. {
  82. unsigned llstp = llcstp;
  83. LLSTATE llstate_0;
  84. LLDEBUG_ENTER("ModuleDefinition_ESeq");
  85. llstate_0 = *llin;
  86. #undef failed
  87. #define failed failed1
  88. #undef failed
  89. #define failed failed2
  90. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  91. LLCHECKSTK;
  92. for (;;) {
  93. switch (llstk[llcstp++]) {
  94. case 1: case -1:
  95. LLDEBUG_ALTERNATIVE("ModuleDefinition_ESeq", 1);
  96. {LLSTATE llstate_1;
  97. if (!ll_ModuleDefinition(&llstate_0, &llstate_1)) goto failed2;
  98. {LLSTATE llstate_2;
  99. if (!ll_ModuleDefinition_ESeq(&llstate_1, &llstate_2)) goto failed2;
  100. *llout = llstate_2;
  101. break;
  102. }}
  103. case 2: case -2:
  104. LLDEBUG_ALTERNATIVE("ModuleDefinition_ESeq", 2);
  105. *llout = llstate_0;
  106. break;
  107. default:
  108. llstk[--llcstp] = 1;
  109. goto failed1;
  110. failed2:
  111. LLDEBUG_BACKTRACKING("ModuleDefinition_ESeq");
  112. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  113. llcpos = llpos1; llcstp = llstp1;
  114. continue;
  115. } break;
  116. }}
  117. LLDEBUG_LEAVE("ModuleDefinition_ESeq", 1);
  118. return 1;
  119. failed1: LLDEBUG_LEAVE("ModuleDefinition_ESeq", 0);
  120. return 0;
  121. }
  122. int ll_ModuleDefinition(LLSTATE *llin, LLSTATE *llout)
  123. {
  124. unsigned llstp = llcstp;
  125. LLSTATE llstate_0;
  126. LLDEBUG_ENTER("ModuleDefinition");
  127. llstate_0 = *llin;
  128. #undef failed
  129. #define failed failed1
  130. {LLSTATE llstate_1;XModuleIdentifier llatt_1;
  131. if (!ll_ModuleIdentifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  132. {LLSTATE llstate_2;
  133. if (!llterm(T_DEFINITIONS, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  134. {LLSTATE llstate_3;XTagType llatt_3;
  135. if (!ll_TagDefault(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  136. {LLSTATE llstate_4;XExtensionType llatt_4;
  137. if (!ll_ExtensionDefault(&llatt_4, &llstate_3, &llstate_4)) goto failed1;
  138. {LLSTATE llstate_5;
  139. if (!llterm(T_DEF, (LLSTYPE *)0, &llstate_4, &llstate_5)) goto failed1;
  140. {if (!AssignModuleIdentifier(&llstate_5.Assignments, llatt_1))
  141. LLFAILED((&llstate_1.pos, "Module `%s' twice defined", llatt_1->Identifier));
  142. llstate_5.MainModule = llatt_1;
  143. llstate_5.Module = llatt_1;
  144. llstate_5.TagDefault = llatt_3;
  145. llstate_5.ExtensionDefault = llatt_4;
  146. g_eDefTagType = llatt_3;
  147. {LLSTATE llstate_6;
  148. if (!llterm(T_BEGIN, (LLSTYPE *)0, &llstate_5, &llstate_6)) goto failed1;
  149. {LLSTATE llstate_7;
  150. if (!ll_ModuleBody(&llstate_6, &llstate_7)) goto failed1;
  151. {LLSTATE llstate_8;
  152. if (!llterm(T_END, (LLSTYPE *)0, &llstate_7, &llstate_8)) goto failed1;
  153. *llout = llstate_8;
  154. {LLCUTALL;
  155. }}}}}}}}}}
  156. LLDEBUG_LEAVE("ModuleDefinition", 1);
  157. return 1;
  158. failed1: LLDEBUG_LEAVE("ModuleDefinition", 0);
  159. return 0;
  160. }
  161. int ll_ModuleIdentifier(XModuleIdentifier *llret, LLSTATE *llin, LLSTATE *llout)
  162. {
  163. unsigned llstp = llcstp;
  164. LLSTATE llstate_0;
  165. LLDEBUG_ENTER("ModuleIdentifier");
  166. llstate_0 = *llin;
  167. #undef failed
  168. #define failed failed1
  169. {LLSTATE llstate_1;XModuleIdentifier llatt_1;
  170. if (!ll_modulereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  171. {LLSTATE llstate_2;XValue llatt_2;
  172. if (!ll_DefinitiveIdentifier(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  173. *llout = llstate_2;
  174. {if (llatt_2) {
  175. (*llret) = NewModuleIdentifier();
  176. (*llret)->Identifier = llatt_1->Identifier;
  177. (*llret)->ObjectIdentifier = llatt_2;
  178. } else {
  179. (*llret) = llatt_1;
  180. }
  181. }}}
  182. LLDEBUG_LEAVE("ModuleIdentifier", 1);
  183. return 1;
  184. failed1: LLDEBUG_LEAVE("ModuleIdentifier", 0);
  185. return 0;
  186. }
  187. int ll_DefinitiveIdentifier(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  188. {
  189. unsigned llstp = llcstp;
  190. LLSTATE llstate_0;
  191. LLDEBUG_ENTER("DefinitiveIdentifier");
  192. llstate_0 = *llin;
  193. #undef failed
  194. #define failed failed1
  195. #undef failed
  196. #define failed failed2
  197. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  198. LLCHECKSTK;
  199. for (;;) {
  200. switch (llstk[llcstp++]) {
  201. case 1: case -1:
  202. LLDEBUG_ALTERNATIVE("DefinitiveIdentifier", 1);
  203. {LLSTATE llstate_1;
  204. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  205. {LLSTATE llstate_2;XNamedObjIdValue llatt_2;
  206. if (!ll_DefinitiveObjIdComponentList(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  207. {LLSTATE llstate_3;
  208. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  209. *llout = llstate_3;
  210. {switch (GetAssignedObjectIdentifier(
  211. &(*llout).AssignedObjIds, NULL, llatt_2, &(*llret))) {
  212. case -1:
  213. LLFAILED((&llstate_2.pos, "Different numbers for equally named object identifier components"));
  214. /*NOTREACHED*/
  215. case 0:
  216. (*llret) = NULL;
  217. break;
  218. case 1:
  219. break;
  220. }
  221. break;
  222. }}}}
  223. case 2: case -2:
  224. LLDEBUG_ALTERNATIVE("DefinitiveIdentifier", 2);
  225. *llout = llstate_0;
  226. {(*llret) = NULL;
  227. break;
  228. }
  229. default:
  230. llstk[--llcstp] = 1;
  231. goto failed1;
  232. failed2:
  233. LLDEBUG_BACKTRACKING("DefinitiveIdentifier");
  234. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  235. llcpos = llpos1; llcstp = llstp1;
  236. continue;
  237. } break;
  238. }}
  239. LLDEBUG_LEAVE("DefinitiveIdentifier", 1);
  240. return 1;
  241. failed1: LLDEBUG_LEAVE("DefinitiveIdentifier", 0);
  242. return 0;
  243. }
  244. int ll_DefinitiveObjIdComponentList(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  245. {
  246. unsigned llstp = llcstp;
  247. LLSTATE llstate_0;
  248. LLDEBUG_ENTER("DefinitiveObjIdComponentList");
  249. llstate_0 = *llin;
  250. #undef failed
  251. #define failed failed1
  252. #undef failed
  253. #define failed failed2
  254. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  255. LLCHECKSTK;
  256. for (;;) {
  257. switch (llstk[llcstp++]) {
  258. case 1: case -1:
  259. LLDEBUG_ALTERNATIVE("DefinitiveObjIdComponentList", 1);
  260. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  261. if (!ll_DefinitiveObjIdComponent(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  262. {LLSTATE llstate_2;XNamedObjIdValue llatt_2;
  263. if (!ll_DefinitiveObjIdComponentList(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  264. *llout = llstate_2;
  265. {(*llret) = DupNamedObjIdValue(llatt_1);
  266. (*llret)->Next = llatt_2;
  267. break;
  268. }}}
  269. case 2: case -2:
  270. LLDEBUG_ALTERNATIVE("DefinitiveObjIdComponentList", 2);
  271. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  272. if (!ll_DefinitiveObjIdComponent(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  273. *llout = llstate_1;
  274. {(*llret) = llatt_1;
  275. break;
  276. }}
  277. default:
  278. llstk[--llcstp] = 1;
  279. goto failed1;
  280. failed2:
  281. LLDEBUG_BACKTRACKING("DefinitiveObjIdComponentList");
  282. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  283. llcpos = llpos1; llcstp = llstp1;
  284. continue;
  285. } break;
  286. }}
  287. LLDEBUG_LEAVE("DefinitiveObjIdComponentList", 1);
  288. return 1;
  289. failed1: LLDEBUG_LEAVE("DefinitiveObjIdComponentList", 0);
  290. return 0;
  291. }
  292. int ll_DefinitiveObjIdComponent(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  293. {
  294. unsigned llstp = llcstp;
  295. LLSTATE llstate_0;
  296. LLDEBUG_ENTER("DefinitiveObjIdComponent");
  297. llstate_0 = *llin;
  298. #undef failed
  299. #define failed failed1
  300. #undef failed
  301. #define failed failed2
  302. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  303. LLCHECKSTK;
  304. for (;;) {
  305. switch (llstk[llcstp++]) {
  306. case 1: case -1:
  307. LLDEBUG_ALTERNATIVE("DefinitiveObjIdComponent", 1);
  308. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  309. if (!ll_NameForm(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  310. *llout = llstate_1;
  311. {(*llret) = llatt_1;
  312. break;
  313. }}
  314. case 2: case -2:
  315. LLDEBUG_ALTERNATIVE("DefinitiveObjIdComponent", 2);
  316. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  317. if (!ll_DefinitiveNumberForm(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  318. *llout = llstate_1;
  319. {(*llret) = llatt_1;
  320. break;
  321. }}
  322. case 3: case -3:
  323. LLDEBUG_ALTERNATIVE("DefinitiveObjIdComponent", 3);
  324. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  325. if (!ll_DefinitiveNameAndNumberForm(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  326. *llout = llstate_1;
  327. {(*llret) = llatt_1;
  328. break;
  329. }}
  330. default:
  331. llstk[--llcstp] = 1;
  332. goto failed1;
  333. failed2:
  334. LLDEBUG_BACKTRACKING("DefinitiveObjIdComponent");
  335. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  336. llcpos = llpos1; llcstp = llstp1;
  337. continue;
  338. } break;
  339. }}
  340. LLDEBUG_LEAVE("DefinitiveObjIdComponent", 1);
  341. return 1;
  342. failed1: LLDEBUG_LEAVE("DefinitiveObjIdComponent", 0);
  343. return 0;
  344. }
  345. int ll_DefinitiveNumberForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  346. {
  347. unsigned llstp = llcstp;
  348. LLSTATE llstate_0;
  349. LLDEBUG_ENTER("DefinitiveNumberForm");
  350. llstate_0 = *llin;
  351. #undef failed
  352. #define failed failed1
  353. {LLSTATE llstate_1;XNumber llatt_1;
  354. if (!llterm(T_number, &lllval, &llstate_0, &llstate_1)) goto failed1;
  355. llatt_1 = lllval._XNumber;
  356. *llout = llstate_1;
  357. {(*llret) = NewNamedObjIdValue(eNamedObjIdValue_NumberForm);
  358. (*llret)->Number = intx2uint32(&llatt_1);
  359. }}
  360. LLDEBUG_LEAVE("DefinitiveNumberForm", 1);
  361. return 1;
  362. failed1: LLDEBUG_LEAVE("DefinitiveNumberForm", 0);
  363. return 0;
  364. }
  365. int ll_DefinitiveNameAndNumberForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  366. {
  367. unsigned llstp = llcstp;
  368. LLSTATE llstate_0;
  369. LLDEBUG_ENTER("DefinitiveNameAndNumberForm");
  370. llstate_0 = *llin;
  371. #undef failed
  372. #define failed failed1
  373. {LLSTATE llstate_1;XString llatt_1;
  374. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  375. {LLSTATE llstate_2;
  376. if (!llterm('(', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  377. {LLSTATE llstate_3;XNumber llatt_3;
  378. if (!llterm(T_number, &lllval, &llstate_2, &llstate_3)) goto failed1;
  379. llatt_3 = lllval._XNumber;
  380. {LLSTATE llstate_4;
  381. if (!llterm(')', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed1;
  382. *llout = llstate_4;
  383. {(*llret) = NewNamedObjIdValue(eNamedObjIdValue_NameAndNumberForm);
  384. (*llret)->Name = llatt_1;
  385. (*llret)->Number = intx2uint32(&llatt_3);
  386. }}}}}
  387. LLDEBUG_LEAVE("DefinitiveNameAndNumberForm", 1);
  388. return 1;
  389. failed1: LLDEBUG_LEAVE("DefinitiveNameAndNumberForm", 0);
  390. return 0;
  391. }
  392. int ll_TagDefault(XTagType *llret, LLSTATE *llin, LLSTATE *llout)
  393. {
  394. unsigned llstp = llcstp;
  395. LLSTATE llstate_0;
  396. LLDEBUG_ENTER("TagDefault");
  397. llstate_0 = *llin;
  398. #undef failed
  399. #define failed failed1
  400. #undef failed
  401. #define failed failed2
  402. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  403. LLCHECKSTK;
  404. for (;;) {
  405. switch (llstk[llcstp++]) {
  406. case 1: case -1:
  407. LLDEBUG_ALTERNATIVE("TagDefault", 1);
  408. {LLSTATE llstate_1;
  409. if (!llterm(T_EXPLICIT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  410. {LLSTATE llstate_2;
  411. if (!llterm(T_TAGS, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  412. *llout = llstate_2;
  413. {(*llret) = eTagType_Explicit;
  414. break;
  415. }}}
  416. case 2: case -2:
  417. LLDEBUG_ALTERNATIVE("TagDefault", 2);
  418. {LLSTATE llstate_1;
  419. if (!llterm(T_IMPLICIT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  420. {LLSTATE llstate_2;
  421. if (!llterm(T_TAGS, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  422. *llout = llstate_2;
  423. {(*llret) = eTagType_Implicit;
  424. break;
  425. }}}
  426. case 3: case -3:
  427. LLDEBUG_ALTERNATIVE("TagDefault", 3);
  428. {LLSTATE llstate_1;
  429. if (!llterm(T_AUTOMATIC, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  430. {LLSTATE llstate_2;
  431. if (!llterm(T_TAGS, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  432. *llout = llstate_2;
  433. {(*llret) = eTagType_Automatic;
  434. break;
  435. }}}
  436. case 4: case -4:
  437. LLDEBUG_ALTERNATIVE("TagDefault", 4);
  438. *llout = llstate_0;
  439. {(*llret) = eTagType_Explicit;
  440. break;
  441. }
  442. default:
  443. llstk[--llcstp] = 1;
  444. goto failed1;
  445. failed2:
  446. LLDEBUG_BACKTRACKING("TagDefault");
  447. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  448. llcpos = llpos1; llcstp = llstp1;
  449. continue;
  450. } break;
  451. }}
  452. LLDEBUG_LEAVE("TagDefault", 1);
  453. return 1;
  454. failed1: LLDEBUG_LEAVE("TagDefault", 0);
  455. return 0;
  456. }
  457. int ll_ExtensionDefault(XExtensionType *llret, LLSTATE *llin, LLSTATE *llout)
  458. {
  459. unsigned llstp = llcstp;
  460. LLSTATE llstate_0;
  461. LLDEBUG_ENTER("ExtensionDefault");
  462. llstate_0 = *llin;
  463. #undef failed
  464. #define failed failed1
  465. #undef failed
  466. #define failed failed2
  467. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  468. LLCHECKSTK;
  469. for (;;) {
  470. switch (llstk[llcstp++]) {
  471. case 1: case -1:
  472. LLDEBUG_ALTERNATIVE("ExtensionDefault", 1);
  473. {LLSTATE llstate_1;
  474. if (!llterm(T_EXTENSIBILITY, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  475. {LLSTATE llstate_2;
  476. if (!llterm(T_IMPLIED, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  477. *llout = llstate_2;
  478. {(*llret) = eExtensionType_Automatic;
  479. break;
  480. }}}
  481. case 2: case -2:
  482. LLDEBUG_ALTERNATIVE("ExtensionDefault", 2);
  483. *llout = llstate_0;
  484. {(*llret) = eExtensionType_None;
  485. break;
  486. }
  487. default:
  488. llstk[--llcstp] = 1;
  489. goto failed1;
  490. failed2:
  491. LLDEBUG_BACKTRACKING("ExtensionDefault");
  492. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  493. llcpos = llpos1; llcstp = llstp1;
  494. continue;
  495. } break;
  496. }}
  497. LLDEBUG_LEAVE("ExtensionDefault", 1);
  498. return 1;
  499. failed1: LLDEBUG_LEAVE("ExtensionDefault", 0);
  500. return 0;
  501. }
  502. int ll_ModuleBody(LLSTATE *llin, LLSTATE *llout)
  503. {
  504. unsigned llstp = llcstp;
  505. LLSTATE llstate_0;
  506. LLDEBUG_ENTER("ModuleBody");
  507. llstate_0 = *llin;
  508. #undef failed
  509. #define failed failed1
  510. #undef failed
  511. #define failed failed2
  512. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  513. LLCHECKSTK;
  514. for (;;) {
  515. switch (llstk[llcstp++]) {
  516. case 1: case -1:
  517. LLDEBUG_ALTERNATIVE("ModuleBody", 1);
  518. {LLSTATE llstate_1;XStrings llatt_1;
  519. if (!ll_Exports(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  520. {LLSTATE llstate_2;XStringModules llatt_2;
  521. if (!ll_Imports(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  522. {llstate_2.Imported = llatt_2;
  523. {LLSTATE llstate_3;
  524. if (!ll_AssignmentList(&llstate_2, &llstate_3)) goto failed2;
  525. *llout = llstate_3;
  526. {String_t *s;
  527. StringModule_t *sm;
  528. Assignment_t *a, **aa, *oldass;
  529. UndefinedSymbol_t *u;
  530. if (llatt_2 != IMPORT_ALL) {
  531. for (sm = llatt_2; sm; sm = sm->Next) {
  532. if (!FindExportedAssignment((*llout).Assignments,
  533. eAssignment_Undefined, sm->String, sm->Module)) {
  534. if (FindAssignment((*llout).Assignments,
  535. eAssignment_Undefined, sm->String,
  536. sm->Module)) {
  537. u = NewUndefinedSymbol(
  538. eUndefinedSymbol_SymbolNotExported,
  539. eAssignment_Undefined);
  540. } else {
  541. u = NewUndefinedSymbol(
  542. eUndefinedSymbol_SymbolNotDefined,
  543. eAssignment_Undefined);
  544. }
  545. u->U.Symbol.Identifier = sm->String;
  546. u->U.Symbol.Module = sm->Module;
  547. u->Next = (*llout).Undefined;
  548. (*llout).Undefined = u;
  549. continue;
  550. }
  551. if (!FindAssignmentInCurrentPass((*llout).Assignments,
  552. sm->String, (*llout).Module)) {
  553. a = NewAssignment(eAssignment_Reference);
  554. a->Identifier = sm->String;
  555. a->Module = (*llout).Module;
  556. a->U.Reference.Identifier = sm->String;
  557. a->U.Reference.Module = sm->Module;
  558. a->Next = (*llout).Assignments;
  559. (*llout).Assignments = a;
  560. }
  561. }
  562. }
  563. if (llatt_1 != EXPORT_ALL) {
  564. for (s = llatt_1; s; s = s->Next) {
  565. if (!FindAssignment((*llout).Assignments, eAssignment_Undefined,
  566. s->String, (*llout).Module))
  567. LLFAILED((&llstate_1.pos, "Exported symbol `%s' is undefined",
  568. s->String));
  569. }
  570. }
  571. oldass = (*llout).Assignments;
  572. for (a = (*llout).Assignments, aa = &(*llout).Assignments; a;
  573. a = a->Next, aa = &(*aa)->Next) {
  574. if (a->Type == eAssignment_NextPass)
  575. break;
  576. *aa = DupAssignment(a);
  577. if (!FindAssignmentInCurrentPass(a->Next,
  578. a->Identifier, a->Module) &&
  579. FindAssignmentInCurrentPass(oldass,
  580. a->Identifier, a->Module) == a &&
  581. !CmpModuleIdentifier(oldass, a->Module, (*llout).Module) &&
  582. (llatt_1 == EXPORT_ALL || FindString(llatt_1, a->Identifier)))
  583. (*aa)->Flags |= eAssignmentFlags_Exported;
  584. }
  585. *aa = a;
  586. break;
  587. }}}}}
  588. case 2: case -2:
  589. LLDEBUG_ALTERNATIVE("ModuleBody", 2);
  590. *llout = llstate_0;
  591. break;
  592. default:
  593. llstk[--llcstp] = 1;
  594. goto failed1;
  595. failed2:
  596. LLDEBUG_BACKTRACKING("ModuleBody");
  597. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  598. llcpos = llpos1; llcstp = llstp1;
  599. continue;
  600. } break;
  601. }}
  602. LLDEBUG_LEAVE("ModuleBody", 1);
  603. return 1;
  604. failed1: LLDEBUG_LEAVE("ModuleBody", 0);
  605. return 0;
  606. }
  607. int ll_Exports(XStrings *llret, LLSTATE *llin, LLSTATE *llout)
  608. {
  609. unsigned llstp = llcstp;
  610. LLSTATE llstate_0;
  611. LLDEBUG_ENTER("Exports");
  612. llstate_0 = *llin;
  613. #undef failed
  614. #define failed failed1
  615. #undef failed
  616. #define failed failed2
  617. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  618. LLCHECKSTK;
  619. for (;;) {
  620. switch (llstk[llcstp++]) {
  621. case 1: case -1:
  622. LLDEBUG_ALTERNATIVE("Exports", 1);
  623. {LLSTATE llstate_1;
  624. if (!llterm(T_EXPORTS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  625. {LLSTATE llstate_2;XStrings llatt_2;
  626. if (!ll_SymbolsExported(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  627. {LLSTATE llstate_3;
  628. if (!llterm(';', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  629. *llout = llstate_3;
  630. {String_t *s, *t;
  631. for (s = llatt_2; s && s->Next; s = s->Next) {
  632. for (t = s->Next; t; t = t->Next) {
  633. if (!strcmp(s->String, t->String))
  634. LLFAILED((&llstate_2.pos, "Symbol `%s' has been exported twice",
  635. s->String));
  636. }
  637. }
  638. (*llret) = llatt_2;
  639. break;
  640. }}}}
  641. case 2: case -2:
  642. LLDEBUG_ALTERNATIVE("Exports", 2);
  643. *llout = llstate_0;
  644. {(*llret) = EXPORT_ALL;
  645. break;
  646. }
  647. default:
  648. llstk[--llcstp] = 1;
  649. goto failed1;
  650. failed2:
  651. LLDEBUG_BACKTRACKING("Exports");
  652. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  653. llcpos = llpos1; llcstp = llstp1;
  654. continue;
  655. } break;
  656. }}
  657. LLDEBUG_LEAVE("Exports", 1);
  658. return 1;
  659. failed1: LLDEBUG_LEAVE("Exports", 0);
  660. return 0;
  661. }
  662. int ll_SymbolsExported(XStrings *llret, LLSTATE *llin, LLSTATE *llout)
  663. {
  664. unsigned llstp = llcstp;
  665. LLSTATE llstate_0;
  666. LLDEBUG_ENTER("SymbolsExported");
  667. llstate_0 = *llin;
  668. #undef failed
  669. #define failed failed1
  670. #undef failed
  671. #define failed failed2
  672. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  673. LLCHECKSTK;
  674. for (;;) {
  675. switch (llstk[llcstp++]) {
  676. case 1: case -1:
  677. LLDEBUG_ALTERNATIVE("SymbolsExported", 1);
  678. {LLSTATE llstate_1;XStrings llatt_1;
  679. if (!ll_SymbolList(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  680. *llout = llstate_1;
  681. {(*llret) = llatt_1;
  682. break;
  683. }}
  684. case 2: case -2:
  685. LLDEBUG_ALTERNATIVE("SymbolsExported", 2);
  686. *llout = llstate_0;
  687. {(*llret) = NULL;
  688. break;
  689. }
  690. default:
  691. llstk[--llcstp] = 1;
  692. goto failed1;
  693. failed2:
  694. LLDEBUG_BACKTRACKING("SymbolsExported");
  695. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  696. llcpos = llpos1; llcstp = llstp1;
  697. continue;
  698. } break;
  699. }}
  700. LLDEBUG_LEAVE("SymbolsExported", 1);
  701. return 1;
  702. failed1: LLDEBUG_LEAVE("SymbolsExported", 0);
  703. return 0;
  704. }
  705. int ll_Imports(XStringModules *llret, LLSTATE *llin, LLSTATE *llout)
  706. {
  707. unsigned llstp = llcstp;
  708. LLSTATE llstate_0;
  709. LLDEBUG_ENTER("Imports");
  710. llstate_0 = *llin;
  711. #undef failed
  712. #define failed failed1
  713. #undef failed
  714. #define failed failed2
  715. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  716. LLCHECKSTK;
  717. for (;;) {
  718. switch (llstk[llcstp++]) {
  719. case 1: case -1:
  720. LLDEBUG_ALTERNATIVE("Imports", 1);
  721. {LLSTATE llstate_1;
  722. if (!llterm(T_IMPORTS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  723. {LLSTATE llstate_2;XStringModules llatt_2;
  724. if (!ll_SymbolsImported(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  725. {LLSTATE llstate_3;
  726. if (!llterm(';', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  727. *llout = llstate_3;
  728. {(*llret) = llatt_2;
  729. break;
  730. }}}}
  731. case 2: case -2:
  732. LLDEBUG_ALTERNATIVE("Imports", 2);
  733. *llout = llstate_0;
  734. {(*llret) = IMPORT_ALL;
  735. break;
  736. }
  737. default:
  738. llstk[--llcstp] = 1;
  739. goto failed1;
  740. failed2:
  741. LLDEBUG_BACKTRACKING("Imports");
  742. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  743. llcpos = llpos1; llcstp = llstp1;
  744. continue;
  745. } break;
  746. }}
  747. LLDEBUG_LEAVE("Imports", 1);
  748. return 1;
  749. failed1: LLDEBUG_LEAVE("Imports", 0);
  750. return 0;
  751. }
  752. int ll_SymbolsImported(XStringModules *llret, LLSTATE *llin, LLSTATE *llout)
  753. {
  754. unsigned llstp = llcstp;
  755. LLSTATE llstate_0;
  756. LLDEBUG_ENTER("SymbolsImported");
  757. llstate_0 = *llin;
  758. #undef failed
  759. #define failed failed1
  760. {LLSTATE llstate_1;XStringModules llatt_1;
  761. if (!ll_SymbolsFromModule_ESeq(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  762. *llout = llstate_1;
  763. {(*llret) = llatt_1;
  764. }}
  765. LLDEBUG_LEAVE("SymbolsImported", 1);
  766. return 1;
  767. failed1: LLDEBUG_LEAVE("SymbolsImported", 0);
  768. return 0;
  769. }
  770. int ll_SymbolsFromModule_ESeq(XStringModules *llret, LLSTATE *llin, LLSTATE *llout)
  771. {
  772. unsigned llstp = llcstp;
  773. LLSTATE llstate_0;
  774. LLDEBUG_ENTER("SymbolsFromModule_ESeq");
  775. llstate_0 = *llin;
  776. #undef failed
  777. #define failed failed1
  778. #undef failed
  779. #define failed failed2
  780. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  781. LLCHECKSTK;
  782. for (;;) {
  783. switch (llstk[llcstp++]) {
  784. case 1: case -1:
  785. LLDEBUG_ALTERNATIVE("SymbolsFromModule_ESeq", 1);
  786. {LLSTATE llstate_1;XStringModules llatt_1;
  787. if (!ll_SymbolsFromModule(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  788. {LLSTATE llstate_2;XStringModules llatt_2;
  789. if (!ll_SymbolsFromModule_ESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  790. *llout = llstate_2;
  791. {StringModule_t *s, **ss;
  792. for (s = llatt_1, ss = &(*llret); s; s = s->Next) {
  793. *ss = DupStringModule(s);
  794. ss = &(*ss)->Next;
  795. }
  796. *ss = llatt_2;
  797. break;
  798. }}}
  799. case 2: case -2:
  800. LLDEBUG_ALTERNATIVE("SymbolsFromModule_ESeq", 2);
  801. *llout = llstate_0;
  802. {(*llret) = NULL;
  803. break;
  804. }
  805. default:
  806. llstk[--llcstp] = 1;
  807. goto failed1;
  808. failed2:
  809. LLDEBUG_BACKTRACKING("SymbolsFromModule_ESeq");
  810. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  811. llcpos = llpos1; llcstp = llstp1;
  812. continue;
  813. } break;
  814. }}
  815. LLDEBUG_LEAVE("SymbolsFromModule_ESeq", 1);
  816. return 1;
  817. failed1: LLDEBUG_LEAVE("SymbolsFromModule_ESeq", 0);
  818. return 0;
  819. }
  820. int ll_SymbolsFromModule(XStringModules *llret, LLSTATE *llin, LLSTATE *llout)
  821. {
  822. unsigned llstp = llcstp;
  823. LLSTATE llstate_0;
  824. LLDEBUG_ENTER("SymbolsFromModule");
  825. llstate_0 = *llin;
  826. #undef failed
  827. #define failed failed1
  828. {LLSTATE llstate_1;XStrings llatt_1;
  829. if (!ll_SymbolList(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  830. {LLSTATE llstate_2;
  831. if (!llterm(T_FROM, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  832. {LLSTATE llstate_3;XModuleIdentifier llatt_3;
  833. if (!ll_GlobalModuleReference(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  834. *llout = llstate_3;
  835. {String_t *s, *t;
  836. StringModule_t **ss;
  837. for (s = llatt_1; s && s->Next; s = s->Next) {
  838. for (t = s->Next; t; t = t->Next) {
  839. if (!strcmp(s->String, t->String))
  840. LLFAILED((&llstate_2.pos, "Symbol `%s' has been imported twice",
  841. s->String));
  842. }
  843. }
  844. for (s = llatt_1, ss = &(*llret); s; s = s->Next) {
  845. *ss = NewStringModule();
  846. (*ss)->String = s->String;
  847. (*ss)->Module = llatt_3;
  848. ss = &(*ss)->Next;
  849. }
  850. *ss = NULL;
  851. }}}}
  852. LLDEBUG_LEAVE("SymbolsFromModule", 1);
  853. return 1;
  854. failed1: LLDEBUG_LEAVE("SymbolsFromModule", 0);
  855. return 0;
  856. }
  857. int ll_GlobalModuleReference(XModuleIdentifier *llret, LLSTATE *llin, LLSTATE *llout)
  858. {
  859. unsigned llstp = llcstp;
  860. LLSTATE llstate_0;
  861. LLDEBUG_ENTER("GlobalModuleReference");
  862. llstate_0 = *llin;
  863. #undef failed
  864. #define failed failed1
  865. {LLSTATE llstate_1;XModuleIdentifier llatt_1;
  866. if (!ll_modulereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  867. {LLSTATE llstate_2;XValue llatt_2;
  868. if (!ll_AssignedIdentifier(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  869. *llout = llstate_2;
  870. {(*llret) = NewModuleIdentifier();
  871. (*llret)->Identifier = llatt_1->Identifier;
  872. (*llret)->ObjectIdentifier = llatt_2;
  873. }}}
  874. LLDEBUG_LEAVE("GlobalModuleReference", 1);
  875. return 1;
  876. failed1: LLDEBUG_LEAVE("GlobalModuleReference", 0);
  877. return 0;
  878. }
  879. int ll_AssignedIdentifier(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  880. {
  881. unsigned llstp = llcstp;
  882. LLSTATE llstate_0;
  883. LLDEBUG_ENTER("AssignedIdentifier");
  884. llstate_0 = *llin;
  885. #undef failed
  886. #define failed failed1
  887. #undef failed
  888. #define failed failed2
  889. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  890. LLCHECKSTK;
  891. for (;;) {
  892. switch (llstk[llcstp++]) {
  893. case 1: case -1:
  894. LLDEBUG_ALTERNATIVE("AssignedIdentifier", 1);
  895. {LLSTATE llstate_1;XValue llatt_1;
  896. if (!ll_ObjectIdentifierValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  897. *llout = llstate_1;
  898. {(*llret) = llatt_1;
  899. break;
  900. }}
  901. case 2: case -2:
  902. LLDEBUG_ALTERNATIVE("AssignedIdentifier", 2);
  903. {LLSTATE llstate_1;XValue llatt_1;
  904. if (!ll_DefinedValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  905. *llout = llstate_1;
  906. {(*llret) = llatt_1;
  907. break;
  908. }}
  909. case 3: case -3:
  910. LLDEBUG_ALTERNATIVE("AssignedIdentifier", 3);
  911. *llout = llstate_0;
  912. {(*llret) = NULL;
  913. break;
  914. }
  915. default:
  916. llstk[--llcstp] = 1;
  917. goto failed1;
  918. failed2:
  919. LLDEBUG_BACKTRACKING("AssignedIdentifier");
  920. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  921. llcpos = llpos1; llcstp = llstp1;
  922. continue;
  923. } break;
  924. }}
  925. LLDEBUG_LEAVE("AssignedIdentifier", 1);
  926. return 1;
  927. failed1: LLDEBUG_LEAVE("AssignedIdentifier", 0);
  928. return 0;
  929. }
  930. int ll_SymbolList(XStrings *llret, LLSTATE *llin, LLSTATE *llout)
  931. {
  932. unsigned llstp = llcstp;
  933. LLSTATE llstate_0;
  934. LLDEBUG_ENTER("SymbolList");
  935. llstate_0 = *llin;
  936. #undef failed
  937. #define failed failed1
  938. #undef failed
  939. #define failed failed2
  940. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  941. LLCHECKSTK;
  942. for (;;) {
  943. switch (llstk[llcstp++]) {
  944. case 1: case -1:
  945. LLDEBUG_ALTERNATIVE("SymbolList", 1);
  946. {LLSTATE llstate_1;XString llatt_1;
  947. if (!ll_Symbol(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  948. {LLSTATE llstate_2;
  949. if (!llterm(',', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  950. {LLSTATE llstate_3;XStrings llatt_3;
  951. if (!ll_SymbolList(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  952. *llout = llstate_3;
  953. {(*llret) = NewString();
  954. (*llret)->String = llatt_1;
  955. (*llret)->Next = llatt_3;
  956. break;
  957. }}}}
  958. case 2: case -2:
  959. LLDEBUG_ALTERNATIVE("SymbolList", 2);
  960. {LLSTATE llstate_1;XString llatt_1;
  961. if (!ll_Symbol(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  962. *llout = llstate_1;
  963. {(*llret) = NewString();
  964. (*llret)->String = llatt_1;
  965. break;
  966. }}
  967. default:
  968. llstk[--llcstp] = 1;
  969. goto failed1;
  970. failed2:
  971. LLDEBUG_BACKTRACKING("SymbolList");
  972. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  973. llcpos = llpos1; llcstp = llstp1;
  974. continue;
  975. } break;
  976. }}
  977. LLDEBUG_LEAVE("SymbolList", 1);
  978. return 1;
  979. failed1: LLDEBUG_LEAVE("SymbolList", 0);
  980. return 0;
  981. }
  982. int ll_Symbol(XString *llret, LLSTATE *llin, LLSTATE *llout)
  983. {
  984. unsigned llstp = llcstp;
  985. LLSTATE llstate_0;
  986. LLDEBUG_ENTER("Symbol");
  987. llstate_0 = *llin;
  988. #undef failed
  989. #define failed failed1
  990. #undef failed
  991. #define failed failed2
  992. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  993. LLCHECKSTK;
  994. for (;;) {
  995. switch (llstk[llcstp++]) {
  996. case 1: case -1:
  997. LLDEBUG_ALTERNATIVE("Symbol", 1);
  998. {LLSTATE llstate_1;XString llatt_1;
  999. if (!ll_Reference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  1000. *llout = llstate_1;
  1001. {(*llret) = llatt_1;
  1002. break;
  1003. }}
  1004. case 2: case -2:
  1005. LLDEBUG_ALTERNATIVE("Symbol", 2);
  1006. {LLSTATE llstate_1;
  1007. if (!ll_ParameterizedReference(&llstate_0, &llstate_1)) goto failed2;
  1008. *llout = llstate_1;
  1009. {MyAbort();
  1010. break;
  1011. }}
  1012. default:
  1013. llstk[--llcstp] = 1;
  1014. goto failed1;
  1015. failed2:
  1016. LLDEBUG_BACKTRACKING("Symbol");
  1017. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  1018. llcpos = llpos1; llcstp = llstp1;
  1019. continue;
  1020. } break;
  1021. }}
  1022. LLDEBUG_LEAVE("Symbol", 1);
  1023. return 1;
  1024. failed1: LLDEBUG_LEAVE("Symbol", 0);
  1025. return 0;
  1026. }
  1027. int ll_Reference(XString *llret, LLSTATE *llin, LLSTATE *llout)
  1028. {
  1029. unsigned llstp = llcstp;
  1030. LLSTATE llstate_0;
  1031. LLDEBUG_ENTER("Reference");
  1032. llstate_0 = *llin;
  1033. #undef failed
  1034. #define failed failed1
  1035. #undef failed
  1036. #define failed failed2
  1037. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  1038. LLCHECKSTK;
  1039. for (;;) {
  1040. switch (llstk[llcstp++]) {
  1041. case 1: case -1:
  1042. LLDEBUG_ALTERNATIVE("Reference", 1);
  1043. {LLSTATE llstate_1;XString llatt_1;
  1044. if (!ll_ucsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  1045. *llout = llstate_1;
  1046. {(*llret) = llatt_1;
  1047. break;
  1048. }}
  1049. case 2: case -2:
  1050. LLDEBUG_ALTERNATIVE("Reference", 2);
  1051. {LLSTATE llstate_1;XString llatt_1;
  1052. if (!llterm(T_lcsymbol, &lllval, &llstate_0, &llstate_1)) goto failed2;
  1053. llatt_1 = lllval._XString;
  1054. *llout = llstate_1;
  1055. {(*llret) = llatt_1;
  1056. break;
  1057. }}
  1058. default:
  1059. llstk[--llcstp] = 1;
  1060. goto failed1;
  1061. failed2:
  1062. LLDEBUG_BACKTRACKING("Reference");
  1063. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  1064. llcpos = llpos1; llcstp = llstp1;
  1065. continue;
  1066. } break;
  1067. }}
  1068. LLDEBUG_LEAVE("Reference", 1);
  1069. return 1;
  1070. failed1: LLDEBUG_LEAVE("Reference", 0);
  1071. return 0;
  1072. }
  1073. int ll_AssignmentList(LLSTATE *llin, LLSTATE *llout)
  1074. {
  1075. unsigned llstp = llcstp;
  1076. LLSTATE llstate_0;
  1077. LLDEBUG_ENTER("AssignmentList");
  1078. llstate_0 = *llin;
  1079. #undef failed
  1080. #define failed failed1
  1081. {LLSTATE llstate_1;
  1082. if (!ll_Assignment(&llstate_0, &llstate_1)) goto failed1;
  1083. {LLSTATE llstate_2;
  1084. if (!ll_Assignment_ESeq(&llstate_1, &llstate_2)) goto failed1;
  1085. *llout = llstate_2;
  1086. }}
  1087. LLDEBUG_LEAVE("AssignmentList", 1);
  1088. return 1;
  1089. failed1: LLDEBUG_LEAVE("AssignmentList", 0);
  1090. return 0;
  1091. }
  1092. int ll_Assignment_ESeq(LLSTATE *llin, LLSTATE *llout)
  1093. {
  1094. unsigned llstp = llcstp;
  1095. LLSTATE llstate_0;
  1096. LLDEBUG_ENTER("Assignment_ESeq");
  1097. llstate_0 = *llin;
  1098. #undef failed
  1099. #define failed failed1
  1100. #undef failed
  1101. #define failed failed2
  1102. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  1103. LLCHECKSTK;
  1104. for (;;) {
  1105. switch (llstk[llcstp++]) {
  1106. case 1: case -1:
  1107. LLDEBUG_ALTERNATIVE("Assignment_ESeq", 1);
  1108. {LLSTATE llstate_1;
  1109. if (!ll_Assignment(&llstate_0, &llstate_1)) goto failed2;
  1110. {LLSTATE llstate_2;
  1111. if (!ll_Assignment_ESeq(&llstate_1, &llstate_2)) goto failed2;
  1112. *llout = llstate_2;
  1113. break;
  1114. }}
  1115. case 2: case -2:
  1116. LLDEBUG_ALTERNATIVE("Assignment_ESeq", 2);
  1117. *llout = llstate_0;
  1118. break;
  1119. default:
  1120. llstk[--llcstp] = 1;
  1121. goto failed1;
  1122. failed2:
  1123. LLDEBUG_BACKTRACKING("Assignment_ESeq");
  1124. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  1125. llcpos = llpos1; llcstp = llstp1;
  1126. continue;
  1127. } break;
  1128. }}
  1129. LLDEBUG_LEAVE("Assignment_ESeq", 1);
  1130. return 1;
  1131. failed1: LLDEBUG_LEAVE("Assignment_ESeq", 0);
  1132. return 0;
  1133. }
  1134. int ll_Assignment(LLSTATE *llin, LLSTATE *llout)
  1135. {
  1136. unsigned llstp = llcstp;
  1137. LLSTATE llstate_0;
  1138. LLDEBUG_ENTER("Assignment");
  1139. llstate_0 = *llin;
  1140. #undef failed
  1141. #define failed failed1
  1142. #undef failed
  1143. #define failed failed2
  1144. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  1145. LLCHECKSTK;
  1146. for (;;) {
  1147. switch (llstk[llcstp++]) {
  1148. case 1: case -1:
  1149. LLDEBUG_ALTERNATIVE("Assignment", 1);
  1150. {LLSTATE llstate_1;
  1151. if (!ll_TypeAssignment(&llstate_0, &llstate_1)) goto failed2;
  1152. *llout = llstate_1;
  1153. {LLCUTALL;
  1154. break;
  1155. }}
  1156. case 2: case -2:
  1157. LLDEBUG_ALTERNATIVE("Assignment", 2);
  1158. {LLSTATE llstate_1;
  1159. if (!ll_ValueAssignment(&llstate_0, &llstate_1)) goto failed2;
  1160. *llout = llstate_1;
  1161. {LLCUTALL;
  1162. break;
  1163. }}
  1164. case 3: case -3:
  1165. LLDEBUG_ALTERNATIVE("Assignment", 3);
  1166. {LLSTATE llstate_1;
  1167. if (!ll_ValueSetTypeAssignment(&llstate_0, &llstate_1)) goto failed2;
  1168. *llout = llstate_1;
  1169. {LLCUTALL;
  1170. break;
  1171. }}
  1172. case 4: case -4:
  1173. LLDEBUG_ALTERNATIVE("Assignment", 4);
  1174. {LLSTATE llstate_1;
  1175. if (!ll_ObjectClassAssignment(&llstate_0, &llstate_1)) goto failed2;
  1176. *llout = llstate_1;
  1177. {LLCUTALL;
  1178. break;
  1179. }}
  1180. case 5: case -5:
  1181. LLDEBUG_ALTERNATIVE("Assignment", 5);
  1182. {LLSTATE llstate_1;
  1183. if (!ll_ObjectAssignment(&llstate_0, &llstate_1)) goto failed2;
  1184. *llout = llstate_1;
  1185. {LLCUTALL;
  1186. break;
  1187. }}
  1188. case 6: case -6:
  1189. LLDEBUG_ALTERNATIVE("Assignment", 6);
  1190. {LLSTATE llstate_1;
  1191. if (!ll_ObjectSetAssignment(&llstate_0, &llstate_1)) goto failed2;
  1192. *llout = llstate_1;
  1193. {LLCUTALL;
  1194. break;
  1195. }}
  1196. case 7: case -7:
  1197. LLDEBUG_ALTERNATIVE("Assignment", 7);
  1198. {LLSTATE llstate_1;
  1199. if (!ll_ParameterizedAssignment(&llstate_0, &llstate_1)) goto failed2;
  1200. *llout = llstate_1;
  1201. {LLCUTALL;
  1202. break;
  1203. }}
  1204. case 8: case -8:
  1205. LLDEBUG_ALTERNATIVE("Assignment", 8);
  1206. {LLSTATE llstate_1;
  1207. if (!ll_MacroDefinition(&llstate_0, &llstate_1)) goto failed2;
  1208. *llout = llstate_1;
  1209. {LLCUTALL;
  1210. break;
  1211. }}
  1212. default:
  1213. llstk[--llcstp] = 1;
  1214. goto failed1;
  1215. failed2:
  1216. LLDEBUG_BACKTRACKING("Assignment");
  1217. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  1218. llcpos = llpos1; llcstp = llstp1;
  1219. continue;
  1220. } break;
  1221. }}
  1222. LLDEBUG_LEAVE("Assignment", 1);
  1223. return 1;
  1224. failed1: LLDEBUG_LEAVE("Assignment", 0);
  1225. return 0;
  1226. }
  1227. int ll_typereference(XType *llret, LLSTATE *llin, LLSTATE *llout)
  1228. {
  1229. unsigned llstp = llcstp;
  1230. LLSTATE llstate_0;
  1231. LLDEBUG_ENTER("typereference");
  1232. llstate_0 = *llin;
  1233. #undef failed
  1234. #define failed failed1
  1235. {LLSTATE llstate_1;XString llatt_1;
  1236. if (!ll_ucsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1237. *llout = llstate_1;
  1238. {Assignment_t *ref;
  1239. UndefinedSymbol_t *u;
  1240. ref = FindAssignment((*llout).Assignments,
  1241. eAssignment_Undefined, llatt_1, (*llout).Module);
  1242. if (!ref) {
  1243. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1244. eAssignment_Type);
  1245. u->U.Symbol.Module = (*llout).Module;
  1246. u->U.Symbol.Identifier = llatt_1;
  1247. u->Next = (*llout).Undefined;
  1248. (*llout).Undefined = u;
  1249. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1250. eAssignment_Type)
  1251. LLFAILED((&llstate_1.pos, "Symbol `%s' is not a typereference", llatt_1));
  1252. (*llret) = NewType(eType_Reference);
  1253. if (ref && ref->U.Type.Type)
  1254. {
  1255. int fPublic = ref->U.Type.Type->PrivateDirectives.fPublic;
  1256. ref->U.Type.Type->PrivateDirectives.fPublic = 0;
  1257. PropagateReferenceTypePrivateDirectives((*llret), &(ref->U.Type.Type->PrivateDirectives));
  1258. ref->U.Type.Type->PrivateDirectives.fPublic = fPublic;
  1259. }
  1260. (*llret)->U.Reference.Identifier = llatt_1;
  1261. (*llret)->U.Reference.Module = (*llout).Module;
  1262. }}
  1263. LLDEBUG_LEAVE("typereference", 1);
  1264. return 1;
  1265. failed1: LLDEBUG_LEAVE("typereference", 0);
  1266. return 0;
  1267. }
  1268. int ll_Externaltypereference(XType *llret, LLSTATE *llin, LLSTATE *llout)
  1269. {
  1270. unsigned llstp = llcstp;
  1271. LLSTATE llstate_0;
  1272. LLDEBUG_ENTER("Externaltypereference");
  1273. llstate_0 = *llin;
  1274. #undef failed
  1275. #define failed failed1
  1276. {LLSTATE llstate_1;XModuleIdentifier llatt_1;
  1277. if (!ll_modulereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1278. {LLSTATE llstate_2;
  1279. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  1280. {LLSTATE llstate_3;XString llatt_3;
  1281. if (!ll_ucsymbol(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  1282. *llout = llstate_3;
  1283. {Assignment_t *ref;
  1284. UndefinedSymbol_t *u;
  1285. if ((*llout).Imported != IMPORT_ALL &&
  1286. !FindStringModule((*llout).Assignments, (*llout).Imported, llatt_3, llatt_1))
  1287. LLFAILED((&llstate_1.pos, "Symbol `%s.%s' has not been imported",
  1288. llatt_1->Identifier, llatt_3));
  1289. ref = FindExportedAssignment((*llout).Assignments,
  1290. eAssignment_Type, llatt_3, llatt_1);
  1291. if (!ref) {
  1292. if (FindAssignment((*llout).Assignments,
  1293. eAssignment_Type, llatt_3, llatt_1)) {
  1294. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotExported,
  1295. eAssignment_Type);
  1296. } else {
  1297. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1298. eAssignment_Type);
  1299. }
  1300. u->U.Symbol.Module = llatt_1;
  1301. u->U.Symbol.Identifier = llatt_3;
  1302. u->Next = (*llout).Undefined;
  1303. (*llout).Undefined = u;
  1304. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1305. eAssignment_Type)
  1306. LLFAILED((&llstate_1.pos, "Symbol `%s' is not a typereference", llatt_1));
  1307. (*llret) = NewType(eType_Reference);
  1308. (*llret)->U.Reference.Identifier = llatt_3;
  1309. (*llret)->U.Reference.Module = llatt_1;
  1310. }}}}
  1311. LLDEBUG_LEAVE("Externaltypereference", 1);
  1312. return 1;
  1313. failed1: LLDEBUG_LEAVE("Externaltypereference", 0);
  1314. return 0;
  1315. }
  1316. int ll_valuereference(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  1317. {
  1318. unsigned llstp = llcstp;
  1319. LLSTATE llstate_0;
  1320. LLDEBUG_ENTER("valuereference");
  1321. llstate_0 = *llin;
  1322. #undef failed
  1323. #define failed failed1
  1324. {LLSTATE llstate_1;XString llatt_1;
  1325. if (!llterm(T_lcsymbol, &lllval, &llstate_0, &llstate_1)) goto failed1;
  1326. llatt_1 = lllval._XString;
  1327. *llout = llstate_1;
  1328. {Assignment_t *ref;
  1329. UndefinedSymbol_t *u;
  1330. ref = FindAssignment((*llout).Assignments,
  1331. eAssignment_Undefined, llatt_1, (*llout).Module);
  1332. if (!ref) {
  1333. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1334. eAssignment_Value);
  1335. u->U.Symbol.Module = (*llout).Module;
  1336. u->U.Symbol.Identifier = llatt_1;
  1337. u->Next = (*llout).Undefined;
  1338. (*llout).Undefined = u;
  1339. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1340. eAssignment_Value)
  1341. LLFAILED((&llstate_1.pos, "Symbol `%s' is not a valuereference", llatt_1));
  1342. (*llret) = NewValue(NULL, NULL);
  1343. (*llret)->U.Reference.Identifier = llatt_1;
  1344. (*llret)->U.Reference.Module = (*llout).Module;
  1345. }}
  1346. LLDEBUG_LEAVE("valuereference", 1);
  1347. return 1;
  1348. failed1: LLDEBUG_LEAVE("valuereference", 0);
  1349. return 0;
  1350. }
  1351. int ll_Externalvaluereference(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  1352. {
  1353. unsigned llstp = llcstp;
  1354. LLSTATE llstate_0;
  1355. LLDEBUG_ENTER("Externalvaluereference");
  1356. llstate_0 = *llin;
  1357. #undef failed
  1358. #define failed failed1
  1359. {LLSTATE llstate_1;XModuleIdentifier llatt_1;
  1360. if (!ll_modulereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1361. {LLSTATE llstate_2;
  1362. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  1363. {LLSTATE llstate_3;XString llatt_3;
  1364. if (!llterm(T_lcsymbol, &lllval, &llstate_2, &llstate_3)) goto failed1;
  1365. llatt_3 = lllval._XString;
  1366. *llout = llstate_3;
  1367. {Assignment_t *ref;
  1368. UndefinedSymbol_t *u;
  1369. if ((*llout).Imported != IMPORT_ALL &&
  1370. !FindStringModule((*llout).Assignments, (*llout).Imported, llatt_3, llatt_1))
  1371. LLFAILED((&llstate_1.pos, "Symbol `%s.%s' has not been imported",
  1372. llatt_1->Identifier, llatt_3));
  1373. ref = FindExportedAssignment((*llout).Assignments,
  1374. eAssignment_Value, llatt_3, llatt_1);
  1375. if (!ref) {
  1376. if (FindAssignment((*llout).Assignments,
  1377. eAssignment_Value, llatt_3, llatt_1)) {
  1378. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotExported,
  1379. eAssignment_Value);
  1380. } else {
  1381. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1382. eAssignment_Value);
  1383. }
  1384. u->U.Symbol.Module = llatt_1;
  1385. u->U.Symbol.Identifier = llatt_3;
  1386. u->Next = (*llout).Undefined;
  1387. (*llout).Undefined = u;
  1388. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1389. eAssignment_Value)
  1390. LLFAILED((&llstate_1.pos, "Symbol `%s' is not a valuereference", llatt_1));
  1391. (*llret) = NewValue(NULL, NULL);
  1392. (*llret)->U.Reference.Identifier = llatt_3;
  1393. (*llret)->U.Reference.Module = llatt_1;
  1394. }}}}
  1395. LLDEBUG_LEAVE("Externalvaluereference", 1);
  1396. return 1;
  1397. failed1: LLDEBUG_LEAVE("Externalvaluereference", 0);
  1398. return 0;
  1399. }
  1400. int ll_objectclassreference(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout)
  1401. {
  1402. unsigned llstp = llcstp;
  1403. LLSTATE llstate_0;
  1404. LLDEBUG_ENTER("objectclassreference");
  1405. llstate_0 = *llin;
  1406. #undef failed
  1407. #define failed failed1
  1408. {LLSTATE llstate_1;XString llatt_1;
  1409. if (!ll_ocsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1410. *llout = llstate_1;
  1411. {Assignment_t *ref;
  1412. UndefinedSymbol_t *u;
  1413. ref = FindAssignment((*llout).Assignments,
  1414. eAssignment_Undefined, llatt_1, (*llout).Module);
  1415. if (!ref) {
  1416. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1417. eAssignment_ObjectClass);
  1418. u->U.Symbol.Module = (*llout).Module;
  1419. u->U.Symbol.Identifier = llatt_1;
  1420. u->Next = (*llout).Undefined;
  1421. (*llout).Undefined = u;
  1422. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1423. eAssignment_ObjectClass)
  1424. LLFAILED((&llstate_1.pos, "Symbol `%s' is not an objectclassreference", llatt_1));
  1425. (*llret) = NewObjectClass(eObjectClass_Reference);
  1426. (*llret)->U.Reference.Identifier = llatt_1;
  1427. (*llret)->U.Reference.Module = (*llout).Module;
  1428. }}
  1429. LLDEBUG_LEAVE("objectclassreference", 1);
  1430. return 1;
  1431. failed1: LLDEBUG_LEAVE("objectclassreference", 0);
  1432. return 0;
  1433. }
  1434. int ll_ExternalObjectClassReference(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout)
  1435. {
  1436. unsigned llstp = llcstp;
  1437. LLSTATE llstate_0;
  1438. LLDEBUG_ENTER("ExternalObjectClassReference");
  1439. llstate_0 = *llin;
  1440. #undef failed
  1441. #define failed failed1
  1442. {LLSTATE llstate_1;XModuleIdentifier llatt_1;
  1443. if (!ll_modulereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1444. {LLSTATE llstate_2;
  1445. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  1446. {LLSTATE llstate_3;XString llatt_3;
  1447. if (!ll_ocsymbol(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  1448. *llout = llstate_3;
  1449. {Assignment_t *ref;
  1450. UndefinedSymbol_t *u;
  1451. if ((*llout).Imported != IMPORT_ALL &&
  1452. !FindStringModule((*llout).Assignments, (*llout).Imported, llatt_3, llatt_1))
  1453. LLFAILED((&llstate_1.pos, "Symbol `%s.%s' has not been imported",
  1454. llatt_1->Identifier, llatt_3));
  1455. ref = FindExportedAssignment((*llout).Assignments,
  1456. eAssignment_ObjectClass, llatt_3, llatt_1);
  1457. if (!ref) {
  1458. if (FindAssignment((*llout).Assignments,
  1459. eAssignment_ObjectClass, llatt_3, llatt_1)) {
  1460. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotExported,
  1461. eAssignment_ObjectClass);
  1462. } else {
  1463. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1464. eAssignment_ObjectClass);
  1465. }
  1466. u->U.Symbol.Module = llatt_1;
  1467. u->U.Symbol.Identifier = llatt_3;
  1468. u->Next = (*llout).Undefined;
  1469. (*llout).Undefined = u;
  1470. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1471. eAssignment_ObjectClass)
  1472. LLFAILED((&llstate_1.pos, "Symbol `%s' is not an objectclassreference", llatt_1));
  1473. (*llret) = NewObjectClass(eObjectClass_Reference);
  1474. (*llret)->U.Reference.Identifier = llatt_3;
  1475. (*llret)->U.Reference.Module = llatt_1;
  1476. }}}}
  1477. LLDEBUG_LEAVE("ExternalObjectClassReference", 1);
  1478. return 1;
  1479. failed1: LLDEBUG_LEAVE("ExternalObjectClassReference", 0);
  1480. return 0;
  1481. }
  1482. int ll_objectreference(XObject *llret, LLSTATE *llin, LLSTATE *llout)
  1483. {
  1484. unsigned llstp = llcstp;
  1485. LLSTATE llstate_0;
  1486. LLDEBUG_ENTER("objectreference");
  1487. llstate_0 = *llin;
  1488. #undef failed
  1489. #define failed failed1
  1490. {LLSTATE llstate_1;XString llatt_1;
  1491. if (!llterm(T_lcsymbol, &lllval, &llstate_0, &llstate_1)) goto failed1;
  1492. llatt_1 = lllval._XString;
  1493. *llout = llstate_1;
  1494. {Assignment_t *ref;
  1495. UndefinedSymbol_t *u;
  1496. ref = FindAssignment((*llout).Assignments,
  1497. eAssignment_Undefined, llatt_1, (*llout).Module);
  1498. if (!ref) {
  1499. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1500. eAssignment_Object);
  1501. u->U.Symbol.Module = (*llout).Module;
  1502. u->U.Symbol.Identifier = llatt_1;
  1503. u->Next = (*llout).Undefined;
  1504. (*llout).Undefined = u;
  1505. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1506. eAssignment_Object)
  1507. LLFAILED((&llstate_1.pos, "Symbol `%s' is not an objectreference", llatt_1));
  1508. (*llret) = NewObject(eObject_Reference);
  1509. (*llret)->U.Reference.Identifier = llatt_1;
  1510. (*llret)->U.Reference.Module = (*llout).Module;
  1511. }}
  1512. LLDEBUG_LEAVE("objectreference", 1);
  1513. return 1;
  1514. failed1: LLDEBUG_LEAVE("objectreference", 0);
  1515. return 0;
  1516. }
  1517. int ll_ExternalObjectReference(XObject *llret, LLSTATE *llin, LLSTATE *llout)
  1518. {
  1519. unsigned llstp = llcstp;
  1520. LLSTATE llstate_0;
  1521. LLDEBUG_ENTER("ExternalObjectReference");
  1522. llstate_0 = *llin;
  1523. #undef failed
  1524. #define failed failed1
  1525. {LLSTATE llstate_1;XModuleIdentifier llatt_1;
  1526. if (!ll_modulereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1527. {LLSTATE llstate_2;
  1528. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  1529. {LLSTATE llstate_3;XString llatt_3;
  1530. if (!llterm(T_lcsymbol, &lllval, &llstate_2, &llstate_3)) goto failed1;
  1531. llatt_3 = lllval._XString;
  1532. *llout = llstate_3;
  1533. {Assignment_t *ref;
  1534. UndefinedSymbol_t *u;
  1535. if ((*llout).Imported != IMPORT_ALL &&
  1536. !FindStringModule((*llout).Assignments, (*llout).Imported, llatt_3, llatt_1))
  1537. LLFAILED((&llstate_1.pos, "Symbol `%s.%s' has not been imported",
  1538. llatt_1->Identifier, llatt_3));
  1539. ref = FindExportedAssignment((*llout).Assignments,
  1540. eAssignment_Object, llatt_3, llatt_1);
  1541. if (!ref) {
  1542. if (FindAssignment((*llout).Assignments,
  1543. eAssignment_Object, llatt_3, llatt_1)) {
  1544. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotExported,
  1545. eAssignment_Object);
  1546. } else {
  1547. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1548. eAssignment_Object);
  1549. }
  1550. u->U.Symbol.Module = llatt_1;
  1551. u->U.Symbol.Identifier = llatt_3;
  1552. u->Next = (*llout).Undefined;
  1553. (*llout).Undefined = u;
  1554. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1555. eAssignment_Object)
  1556. LLFAILED((&llstate_1.pos, "Symbol `%s' is not an objectreference", llatt_1));
  1557. (*llret) = NewObject(eObject_Reference);
  1558. (*llret)->U.Reference.Identifier = llatt_3;
  1559. (*llret)->U.Reference.Module = llatt_1;
  1560. }}}}
  1561. LLDEBUG_LEAVE("ExternalObjectReference", 1);
  1562. return 1;
  1563. failed1: LLDEBUG_LEAVE("ExternalObjectReference", 0);
  1564. return 0;
  1565. }
  1566. int ll_objectsetreference(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout)
  1567. {
  1568. unsigned llstp = llcstp;
  1569. LLSTATE llstate_0;
  1570. LLDEBUG_ENTER("objectsetreference");
  1571. llstate_0 = *llin;
  1572. #undef failed
  1573. #define failed failed1
  1574. {LLSTATE llstate_1;XString llatt_1;
  1575. if (!ll_ucsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1576. *llout = llstate_1;
  1577. {Assignment_t *ref;
  1578. UndefinedSymbol_t *u;
  1579. ref = FindAssignment((*llout).Assignments,
  1580. eAssignment_Undefined, llatt_1, (*llout).Module);
  1581. if (!ref) {
  1582. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1583. eAssignment_ObjectSet);
  1584. u->U.Symbol.Module = (*llout).Module;
  1585. u->U.Symbol.Identifier = llatt_1;
  1586. u->Next = (*llout).Undefined;
  1587. (*llout).Undefined = u;
  1588. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1589. eAssignment_ObjectSet)
  1590. LLFAILED((&llstate_1.pos, "Symbol `%s' is not an objectsetreference", llatt_1));
  1591. (*llret) = NewObjectSet(eObjectSet_Reference);
  1592. (*llret)->U.Reference.Identifier = llatt_1;
  1593. (*llret)->U.Reference.Module = (*llout).Module;
  1594. }}
  1595. LLDEBUG_LEAVE("objectsetreference", 1);
  1596. return 1;
  1597. failed1: LLDEBUG_LEAVE("objectsetreference", 0);
  1598. return 0;
  1599. }
  1600. int ll_ExternalObjectSetReference(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout)
  1601. {
  1602. unsigned llstp = llcstp;
  1603. LLSTATE llstate_0;
  1604. LLDEBUG_ENTER("ExternalObjectSetReference");
  1605. llstate_0 = *llin;
  1606. #undef failed
  1607. #define failed failed1
  1608. {LLSTATE llstate_1;XModuleIdentifier llatt_1;
  1609. if (!ll_modulereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1610. {LLSTATE llstate_2;
  1611. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  1612. {LLSTATE llstate_3;XString llatt_3;
  1613. if (!ll_ucsymbol(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  1614. *llout = llstate_3;
  1615. {Assignment_t *ref;
  1616. UndefinedSymbol_t *u;
  1617. if ((*llout).Imported != IMPORT_ALL &&
  1618. !FindStringModule((*llout).Assignments, (*llout).Imported, llatt_3, llatt_1))
  1619. LLFAILED((&llstate_1.pos, "Symbol `%s.%s' has not been imported",
  1620. llatt_1->Identifier, llatt_3));
  1621. ref = FindExportedAssignment((*llout).Assignments,
  1622. eAssignment_ObjectSet, llatt_3, llatt_1);
  1623. if (!ref) {
  1624. if (FindAssignment((*llout).Assignments,
  1625. eAssignment_ObjectSet, llatt_3, llatt_1)) {
  1626. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotExported,
  1627. eAssignment_ObjectSet);
  1628. } else {
  1629. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1630. eAssignment_ObjectSet);
  1631. }
  1632. u->U.Symbol.Module = llatt_1;
  1633. u->U.Symbol.Identifier = llatt_3;
  1634. u->Next = (*llout).Undefined;
  1635. (*llout).Undefined = u;
  1636. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1637. eAssignment_ObjectSet)
  1638. LLFAILED((&llstate_1.pos, "Symbol `%s' is not an objectsetreference", llatt_1));
  1639. (*llret) = NewObjectSet(eObjectSet_Reference);
  1640. (*llret)->U.Reference.Identifier = llatt_3;
  1641. (*llret)->U.Reference.Module = llatt_1;
  1642. }}}}
  1643. LLDEBUG_LEAVE("ExternalObjectSetReference", 1);
  1644. return 1;
  1645. failed1: LLDEBUG_LEAVE("ExternalObjectSetReference", 0);
  1646. return 0;
  1647. }
  1648. int ll_macroreference(XMacro *llret, LLSTATE *llin, LLSTATE *llout)
  1649. {
  1650. unsigned llstp = llcstp;
  1651. LLSTATE llstate_0;
  1652. LLDEBUG_ENTER("macroreference");
  1653. llstate_0 = *llin;
  1654. #undef failed
  1655. #define failed failed1
  1656. {LLSTATE llstate_1;XString llatt_1;
  1657. if (!ll_ocsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1658. *llout = llstate_1;
  1659. {Assignment_t *ref;
  1660. UndefinedSymbol_t *u;
  1661. ref = FindAssignment((*llout).Assignments,
  1662. eAssignment_Undefined, llatt_1, (*llout).Module);
  1663. if (!ref) {
  1664. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1665. eAssignment_Macro);
  1666. u->U.Symbol.Module = (*llout).Module;
  1667. u->U.Symbol.Identifier = llatt_1;
  1668. u->Next = (*llout).Undefined;
  1669. (*llout).Undefined = u;
  1670. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1671. eAssignment_Macro)
  1672. LLFAILED((&llstate_1.pos, "Symbol `%s' is not an macroreference", llatt_1));
  1673. (*llret) = NewMacro(eMacro_Reference);
  1674. (*llret)->U.Reference.Identifier = llatt_1;
  1675. (*llret)->U.Reference.Module = (*llout).Module;
  1676. }}
  1677. LLDEBUG_LEAVE("macroreference", 1);
  1678. return 1;
  1679. failed1: LLDEBUG_LEAVE("macroreference", 0);
  1680. return 0;
  1681. }
  1682. int ll_Externalmacroreference(XMacro *llret, LLSTATE *llin, LLSTATE *llout)
  1683. {
  1684. unsigned llstp = llcstp;
  1685. LLSTATE llstate_0;
  1686. LLDEBUG_ENTER("Externalmacroreference");
  1687. llstate_0 = *llin;
  1688. #undef failed
  1689. #define failed failed1
  1690. {LLSTATE llstate_1;XModuleIdentifier llatt_1;
  1691. if (!ll_modulereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1692. {LLSTATE llstate_2;
  1693. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  1694. {LLSTATE llstate_3;XString llatt_3;
  1695. if (!ll_ucsymbol(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  1696. *llout = llstate_3;
  1697. {Assignment_t *ref;
  1698. UndefinedSymbol_t *u;
  1699. if ((*llout).Imported != IMPORT_ALL &&
  1700. !FindStringModule((*llout).Assignments, (*llout).Imported, llatt_3, llatt_1))
  1701. LLFAILED((&llstate_1.pos, "Symbol `%s.%s' has not been imported",
  1702. llatt_1->Identifier, llatt_3));
  1703. ref = FindExportedAssignment((*llout).Assignments,
  1704. eAssignment_Macro, llatt_3, llatt_1);
  1705. if (!ref) {
  1706. if (FindAssignment((*llout).Assignments,
  1707. eAssignment_Macro, llatt_3, llatt_1)) {
  1708. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotExported,
  1709. eAssignment_Macro);
  1710. } else {
  1711. u = NewUndefinedSymbol(eUndefinedSymbol_SymbolNotDefined,
  1712. eAssignment_Macro);
  1713. }
  1714. u->U.Symbol.Module = llatt_1;
  1715. u->U.Symbol.Identifier = llatt_3;
  1716. u->Next = (*llout).Undefined;
  1717. (*llout).Undefined = u;
  1718. } else if (GetAssignmentType((*llout).Assignments, ref) !=
  1719. eAssignment_Macro)
  1720. LLFAILED((&llstate_1.pos, "Symbol `%s' is not an macroreference", llatt_1));
  1721. (*llret) = NewMacro(eMacro_Reference);
  1722. (*llret)->U.Reference.Identifier = llatt_3;
  1723. (*llret)->U.Reference.Module = llatt_1;
  1724. }}}}
  1725. LLDEBUG_LEAVE("Externalmacroreference", 1);
  1726. return 1;
  1727. failed1: LLDEBUG_LEAVE("Externalmacroreference", 0);
  1728. return 0;
  1729. }
  1730. int ll_localtypereference(XString *llret, LLSTATE *llin, LLSTATE *llout)
  1731. {
  1732. unsigned llstp = llcstp;
  1733. LLSTATE llstate_0;
  1734. LLDEBUG_ENTER("localtypereference");
  1735. llstate_0 = *llin;
  1736. #undef failed
  1737. #define failed failed1
  1738. {LLSTATE llstate_1;XString llatt_1;
  1739. if (!ll_ucsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1740. *llout = llstate_1;
  1741. {(*llret) = llatt_1;
  1742. }}
  1743. LLDEBUG_LEAVE("localtypereference", 1);
  1744. return 1;
  1745. failed1: LLDEBUG_LEAVE("localtypereference", 0);
  1746. return 0;
  1747. }
  1748. int ll_localvaluereference(XString *llret, LLSTATE *llin, LLSTATE *llout)
  1749. {
  1750. unsigned llstp = llcstp;
  1751. LLSTATE llstate_0;
  1752. LLDEBUG_ENTER("localvaluereference");
  1753. llstate_0 = *llin;
  1754. #undef failed
  1755. #define failed failed1
  1756. {LLSTATE llstate_1;XString llatt_1;
  1757. if (!ll_ucsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1758. *llout = llstate_1;
  1759. {(*llret) = llatt_1;
  1760. }}
  1761. LLDEBUG_LEAVE("localvaluereference", 1);
  1762. return 1;
  1763. failed1: LLDEBUG_LEAVE("localvaluereference", 0);
  1764. return 0;
  1765. }
  1766. int ll_productionreference(XString *llret, LLSTATE *llin, LLSTATE *llout)
  1767. {
  1768. unsigned llstp = llcstp;
  1769. LLSTATE llstate_0;
  1770. LLDEBUG_ENTER("productionreference");
  1771. llstate_0 = *llin;
  1772. #undef failed
  1773. #define failed failed1
  1774. {LLSTATE llstate_1;XString llatt_1;
  1775. if (!ll_ucsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1776. *llout = llstate_1;
  1777. {(*llret) = llatt_1;
  1778. }}
  1779. LLDEBUG_LEAVE("productionreference", 1);
  1780. return 1;
  1781. failed1: LLDEBUG_LEAVE("productionreference", 0);
  1782. return 0;
  1783. }
  1784. int ll_modulereference(XModuleIdentifier *llret, LLSTATE *llin, LLSTATE *llout)
  1785. {
  1786. unsigned llstp = llcstp;
  1787. LLSTATE llstate_0;
  1788. LLDEBUG_ENTER("modulereference");
  1789. llstate_0 = *llin;
  1790. #undef failed
  1791. #define failed failed1
  1792. {LLSTATE llstate_1;XString llatt_1;
  1793. if (!ll_ucsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  1794. *llout = llstate_1;
  1795. {(*llret) = NewModuleIdentifier();
  1796. (*llret)->Identifier = llatt_1;
  1797. }}
  1798. LLDEBUG_LEAVE("modulereference", 1);
  1799. return 1;
  1800. failed1: LLDEBUG_LEAVE("modulereference", 0);
  1801. return 0;
  1802. }
  1803. int ll_typefieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  1804. {
  1805. unsigned llstp = llcstp;
  1806. LLSTATE llstate_0;
  1807. LLDEBUG_ENTER("typefieldreference");
  1808. llstate_0 = *llin;
  1809. #undef failed
  1810. #define failed failed1
  1811. {LLSTATE llstate_1;XString llatt_1;
  1812. if (!llterm(T_ampucsymbol, &lllval, &llstate_0, &llstate_1)) goto failed1;
  1813. llatt_1 = lllval._XString;
  1814. *llout = llstate_1;
  1815. {FieldSpec_t *fs;
  1816. FieldSpecs_e fe;
  1817. ObjectClass_t *oc;
  1818. UndefinedSymbol_t *u;
  1819. oc = GetObjectClass((*llout).Assignments, llarg_oc);
  1820. fs = oc ? FindFieldSpec(oc->U.ObjectClass.FieldSpec, llatt_1) : NULL;
  1821. fe = GetFieldSpecType((*llout).Assignments, fs);
  1822. if (fe == eFieldSpec_Undefined) {
  1823. if (llarg_oc) {
  1824. u = NewUndefinedField(eUndefinedSymbol_FieldNotDefined,
  1825. llarg_oc, eSetting_Type);
  1826. u->U.Field.Module = (*llout).Module;
  1827. u->U.Field.Identifier = llatt_1;
  1828. u->Next = (*llout).Undefined;
  1829. (*llout).Undefined = u;
  1830. }
  1831. } else if (fe != eFieldSpec_Type)
  1832. LLFAILED((&llstate_1.pos, "%s is not a typefieldreference", llatt_1));
  1833. (*llret) = llatt_1;
  1834. }}
  1835. LLDEBUG_LEAVE("typefieldreference", 1);
  1836. return 1;
  1837. failed1: LLDEBUG_LEAVE("typefieldreference", 0);
  1838. return 0;
  1839. }
  1840. int ll_valuefieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  1841. {
  1842. unsigned llstp = llcstp;
  1843. LLSTATE llstate_0;
  1844. LLDEBUG_ENTER("valuefieldreference");
  1845. llstate_0 = *llin;
  1846. #undef failed
  1847. #define failed failed1
  1848. {LLSTATE llstate_1;XString llatt_1;
  1849. if (!llterm(T_amplcsymbol, &lllval, &llstate_0, &llstate_1)) goto failed1;
  1850. llatt_1 = lllval._XString;
  1851. *llout = llstate_1;
  1852. {FieldSpec_t *fs;
  1853. FieldSpecs_e fe;
  1854. ObjectClass_t *oc;
  1855. UndefinedSymbol_t *u;
  1856. oc = GetObjectClass((*llout).Assignments, llarg_oc);
  1857. fs = oc ? FindFieldSpec(oc->U.ObjectClass.FieldSpec, llatt_1) : NULL;
  1858. fe = GetFieldSpecType((*llout).Assignments, fs);
  1859. if (fe == eFieldSpec_Undefined) {
  1860. if (llarg_oc) {
  1861. u = NewUndefinedField(eUndefinedSymbol_FieldNotDefined,
  1862. llarg_oc, eSetting_Value);
  1863. u->U.Field.Module = (*llout).Module;
  1864. u->U.Field.Identifier = llatt_1;
  1865. u->Next = (*llout).Undefined;
  1866. (*llout).Undefined = u;
  1867. }
  1868. } else if (fe != eFieldSpec_FixedTypeValue &&
  1869. fe != eFieldSpec_VariableTypeValue)
  1870. LLFAILED((&llstate_1.pos, "%s is not a valuefieldreference", llatt_1));
  1871. (*llret) = llatt_1;
  1872. }}
  1873. LLDEBUG_LEAVE("valuefieldreference", 1);
  1874. return 1;
  1875. failed1: LLDEBUG_LEAVE("valuefieldreference", 0);
  1876. return 0;
  1877. }
  1878. int ll_valuesetfieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  1879. {
  1880. unsigned llstp = llcstp;
  1881. LLSTATE llstate_0;
  1882. LLDEBUG_ENTER("valuesetfieldreference");
  1883. llstate_0 = *llin;
  1884. #undef failed
  1885. #define failed failed1
  1886. {LLSTATE llstate_1;XString llatt_1;
  1887. if (!llterm(T_ampucsymbol, &lllval, &llstate_0, &llstate_1)) goto failed1;
  1888. llatt_1 = lllval._XString;
  1889. *llout = llstate_1;
  1890. {FieldSpec_t *fs;
  1891. FieldSpecs_e fe;
  1892. ObjectClass_t *oc;
  1893. UndefinedSymbol_t *u;
  1894. oc = GetObjectClass((*llout).Assignments, llarg_oc);
  1895. fs = oc ? FindFieldSpec(oc->U.ObjectClass.FieldSpec, llatt_1) : NULL;
  1896. fe = GetFieldSpecType((*llout).Assignments, fs);
  1897. if (fe == eFieldSpec_Undefined) {
  1898. if (llarg_oc) {
  1899. u = NewUndefinedField(eUndefinedSymbol_FieldNotDefined,
  1900. llarg_oc, eSetting_ValueSet);
  1901. u->U.Field.Module = (*llout).Module;
  1902. u->U.Field.Identifier = llatt_1;
  1903. u->Next = (*llout).Undefined;
  1904. (*llout).Undefined = u;
  1905. }
  1906. } else if (fe != eFieldSpec_FixedTypeValueSet &&
  1907. fe != eFieldSpec_VariableTypeValueSet)
  1908. LLFAILED((&llstate_1.pos, "%s is not a valuesetfieldreference", llatt_1));
  1909. (*llret) = llatt_1;
  1910. }}
  1911. LLDEBUG_LEAVE("valuesetfieldreference", 1);
  1912. return 1;
  1913. failed1: LLDEBUG_LEAVE("valuesetfieldreference", 0);
  1914. return 0;
  1915. }
  1916. int ll_objectfieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  1917. {
  1918. unsigned llstp = llcstp;
  1919. LLSTATE llstate_0;
  1920. LLDEBUG_ENTER("objectfieldreference");
  1921. llstate_0 = *llin;
  1922. #undef failed
  1923. #define failed failed1
  1924. {LLSTATE llstate_1;XString llatt_1;
  1925. if (!llterm(T_amplcsymbol, &lllval, &llstate_0, &llstate_1)) goto failed1;
  1926. llatt_1 = lllval._XString;
  1927. *llout = llstate_1;
  1928. {FieldSpec_t *fs;
  1929. FieldSpecs_e fe;
  1930. ObjectClass_t *oc;
  1931. UndefinedSymbol_t *u;
  1932. oc = GetObjectClass((*llout).Assignments, llarg_oc);
  1933. fs = oc ? FindFieldSpec(oc->U.ObjectClass.FieldSpec, llatt_1) : NULL;
  1934. fe = GetFieldSpecType((*llout).Assignments, fs);
  1935. if (fe == eFieldSpec_Undefined) {
  1936. if (llarg_oc) {
  1937. u = NewUndefinedField(eUndefinedSymbol_FieldNotDefined,
  1938. llarg_oc, eSetting_Object);
  1939. u->U.Field.Module = (*llout).Module;
  1940. u->U.Field.Identifier = llatt_1;
  1941. u->Next = (*llout).Undefined;
  1942. (*llout).Undefined = u;
  1943. }
  1944. } else if (fe != eFieldSpec_Object)
  1945. LLFAILED((&llstate_1.pos, "%s is not a objectfieldreference", llatt_1));
  1946. (*llret) = llatt_1;
  1947. }}
  1948. LLDEBUG_LEAVE("objectfieldreference", 1);
  1949. return 1;
  1950. failed1: LLDEBUG_LEAVE("objectfieldreference", 0);
  1951. return 0;
  1952. }
  1953. int ll_objectsetfieldreference(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  1954. {
  1955. unsigned llstp = llcstp;
  1956. LLSTATE llstate_0;
  1957. LLDEBUG_ENTER("objectsetfieldreference");
  1958. llstate_0 = *llin;
  1959. #undef failed
  1960. #define failed failed1
  1961. {LLSTATE llstate_1;XString llatt_1;
  1962. if (!llterm(T_ampucsymbol, &lllval, &llstate_0, &llstate_1)) goto failed1;
  1963. llatt_1 = lllval._XString;
  1964. *llout = llstate_1;
  1965. {FieldSpec_t *fs;
  1966. FieldSpecs_e fe;
  1967. ObjectClass_t *oc;
  1968. UndefinedSymbol_t *u;
  1969. oc = GetObjectClass((*llout).Assignments, llarg_oc);
  1970. fs = oc ? FindFieldSpec(oc->U.ObjectClass.FieldSpec, llatt_1) : NULL;
  1971. fe = GetFieldSpecType((*llout).Assignments, fs);
  1972. if (fe == eFieldSpec_Undefined) {
  1973. if (llarg_oc) {
  1974. u = NewUndefinedField(eUndefinedSymbol_FieldNotDefined,
  1975. llarg_oc, eSetting_ObjectSet);
  1976. u->U.Field.Module = (*llout).Module;
  1977. u->U.Field.Identifier = llatt_1;
  1978. u->Next = (*llout).Undefined;
  1979. (*llout).Undefined = u;
  1980. }
  1981. } else if (fe != eFieldSpec_ObjectSet)
  1982. LLFAILED((&llstate_1.pos, "%s is not a objectsetfieldreference", llatt_1));
  1983. (*llret) = llatt_1;
  1984. }}
  1985. LLDEBUG_LEAVE("objectsetfieldreference", 1);
  1986. return 1;
  1987. failed1: LLDEBUG_LEAVE("objectsetfieldreference", 0);
  1988. return 0;
  1989. }
  1990. int ll_word(XString *llret, LLSTATE *llin, LLSTATE *llout)
  1991. {
  1992. unsigned llstp = llcstp;
  1993. LLSTATE llstate_0;
  1994. LLDEBUG_ENTER("word");
  1995. llstate_0 = *llin;
  1996. #undef failed
  1997. #define failed failed1
  1998. #undef failed
  1999. #define failed failed2
  2000. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  2001. LLCHECKSTK;
  2002. for (;;) {
  2003. switch (llstk[llcstp++]) {
  2004. case 1: case -1:
  2005. LLDEBUG_ALTERNATIVE("word", 1);
  2006. {LLSTATE llstate_1;XString llatt_1;
  2007. if (!ll_ucsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  2008. *llout = llstate_1;
  2009. {(*llret) = llatt_1;
  2010. break;
  2011. }}
  2012. case 2: case -2:
  2013. LLDEBUG_ALTERNATIVE("word", 2);
  2014. {LLSTATE llstate_1;
  2015. if (!llterm(T_ABSENT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2016. *llout = llstate_1;
  2017. {(*llret) = "ABSENT";
  2018. break;
  2019. }}
  2020. case 3: case -3:
  2021. LLDEBUG_ALTERNATIVE("word", 3);
  2022. {LLSTATE llstate_1;
  2023. if (!llterm(T_ABSTRACT_SYNTAX, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2024. *llout = llstate_1;
  2025. {(*llret) = "ABSTRACT-SYNTAX";
  2026. break;
  2027. }}
  2028. case 4: case -4:
  2029. LLDEBUG_ALTERNATIVE("word", 4);
  2030. {LLSTATE llstate_1;
  2031. if (!llterm(T_ALL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2032. *llout = llstate_1;
  2033. {(*llret) = "ALL";
  2034. break;
  2035. }}
  2036. case 5: case -5:
  2037. LLDEBUG_ALTERNATIVE("word", 5);
  2038. {LLSTATE llstate_1;
  2039. if (!llterm(T_ANY, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2040. *llout = llstate_1;
  2041. {(*llret) = "ANY";
  2042. break;
  2043. }}
  2044. case 6: case -6:
  2045. LLDEBUG_ALTERNATIVE("word", 6);
  2046. {LLSTATE llstate_1;
  2047. if (!llterm(T_APPLICATION, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2048. *llout = llstate_1;
  2049. {(*llret) = "APPLICATION";
  2050. break;
  2051. }}
  2052. case 7: case -7:
  2053. LLDEBUG_ALTERNATIVE("word", 7);
  2054. {LLSTATE llstate_1;
  2055. if (!llterm(T_AUTOMATIC, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2056. *llout = llstate_1;
  2057. {(*llret) = "AUTOMATIC";
  2058. break;
  2059. }}
  2060. case 8: case -8:
  2061. LLDEBUG_ALTERNATIVE("word", 8);
  2062. {LLSTATE llstate_1;
  2063. if (!llterm(T_BEGIN, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2064. *llout = llstate_1;
  2065. {(*llret) = "BEGIN";
  2066. break;
  2067. }}
  2068. case 9: case -9:
  2069. LLDEBUG_ALTERNATIVE("word", 9);
  2070. {LLSTATE llstate_1;
  2071. if (!llterm(T_BMPString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2072. *llout = llstate_1;
  2073. {(*llret) = "BMPString";
  2074. break;
  2075. }}
  2076. case 10: case -10:
  2077. LLDEBUG_ALTERNATIVE("word", 10);
  2078. {LLSTATE llstate_1;
  2079. if (!llterm(T_BY, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2080. *llout = llstate_1;
  2081. {(*llret) = "BY";
  2082. break;
  2083. }}
  2084. case 11: case -11:
  2085. LLDEBUG_ALTERNATIVE("word", 11);
  2086. {LLSTATE llstate_1;
  2087. if (!llterm(T_CLASS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2088. *llout = llstate_1;
  2089. {(*llret) = "CLASS";
  2090. break;
  2091. }}
  2092. case 12: case -12:
  2093. LLDEBUG_ALTERNATIVE("word", 12);
  2094. {LLSTATE llstate_1;
  2095. if (!llterm(T_COMPONENT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2096. *llout = llstate_1;
  2097. {(*llret) = "COMPONENT";
  2098. break;
  2099. }}
  2100. case 13: case -13:
  2101. LLDEBUG_ALTERNATIVE("word", 13);
  2102. {LLSTATE llstate_1;
  2103. if (!llterm(T_COMPONENTS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2104. *llout = llstate_1;
  2105. {(*llret) = "COMPONENTS";
  2106. break;
  2107. }}
  2108. case 14: case -14:
  2109. LLDEBUG_ALTERNATIVE("word", 14);
  2110. {LLSTATE llstate_1;
  2111. if (!llterm(T_CONSTRAINED, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2112. *llout = llstate_1;
  2113. {(*llret) = "CONSTRAINED";
  2114. break;
  2115. }}
  2116. case 15: case -15:
  2117. LLDEBUG_ALTERNATIVE("word", 15);
  2118. {LLSTATE llstate_1;
  2119. if (!llterm(T_DEFAULT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2120. *llout = llstate_1;
  2121. {(*llret) = "DEFAULT";
  2122. break;
  2123. }}
  2124. case 16: case -16:
  2125. LLDEBUG_ALTERNATIVE("word", 16);
  2126. {LLSTATE llstate_1;
  2127. if (!llterm(T_DEFINED, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2128. *llout = llstate_1;
  2129. {(*llret) = "DEFINED";
  2130. break;
  2131. }}
  2132. case 17: case -17:
  2133. LLDEBUG_ALTERNATIVE("word", 17);
  2134. {LLSTATE llstate_1;
  2135. if (!llterm(T_DEFINITIONS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2136. *llout = llstate_1;
  2137. {(*llret) = "DEFINITIONS";
  2138. break;
  2139. }}
  2140. case 18: case -18:
  2141. LLDEBUG_ALTERNATIVE("word", 18);
  2142. {LLSTATE llstate_1;
  2143. if (!llterm(T_empty, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2144. *llout = llstate_1;
  2145. {(*llret) = "empty";
  2146. break;
  2147. }}
  2148. case 19: case -19:
  2149. LLDEBUG_ALTERNATIVE("word", 19);
  2150. {LLSTATE llstate_1;
  2151. if (!llterm(T_EXCEPT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2152. *llout = llstate_1;
  2153. {(*llret) = "EXCEPT";
  2154. break;
  2155. }}
  2156. case 20: case -20:
  2157. LLDEBUG_ALTERNATIVE("word", 20);
  2158. {LLSTATE llstate_1;
  2159. if (!llterm(T_EXPLICIT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2160. *llout = llstate_1;
  2161. {(*llret) = "EXPLICIT";
  2162. break;
  2163. }}
  2164. case 21: case -21:
  2165. LLDEBUG_ALTERNATIVE("word", 21);
  2166. {LLSTATE llstate_1;
  2167. if (!llterm(T_EXPORTS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2168. *llout = llstate_1;
  2169. {(*llret) = "EXPORTS";
  2170. break;
  2171. }}
  2172. case 22: case -22:
  2173. LLDEBUG_ALTERNATIVE("word", 22);
  2174. {LLSTATE llstate_1;
  2175. if (!llterm(T_EXTENSIBILITY, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2176. *llout = llstate_1;
  2177. {(*llret) = "EXTENSIBILITY";
  2178. break;
  2179. }}
  2180. case 23: case -23:
  2181. LLDEBUG_ALTERNATIVE("word", 23);
  2182. {LLSTATE llstate_1;
  2183. if (!llterm(T_FROM, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2184. *llout = llstate_1;
  2185. {(*llret) = "FROM";
  2186. break;
  2187. }}
  2188. case 24: case -24:
  2189. LLDEBUG_ALTERNATIVE("word", 24);
  2190. {LLSTATE llstate_1;
  2191. if (!llterm(T_GeneralizedTime, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2192. *llout = llstate_1;
  2193. {(*llret) = "GeneralizedTime";
  2194. break;
  2195. }}
  2196. case 25: case -25:
  2197. LLDEBUG_ALTERNATIVE("word", 25);
  2198. {LLSTATE llstate_1;
  2199. if (!llterm(T_GeneralString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2200. *llout = llstate_1;
  2201. {(*llret) = "GeneralString";
  2202. break;
  2203. }}
  2204. case 26: case -26:
  2205. LLDEBUG_ALTERNATIVE("word", 26);
  2206. {LLSTATE llstate_1;
  2207. if (!llterm(T_GraphicString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2208. *llout = llstate_1;
  2209. {(*llret) = "GraphicString";
  2210. break;
  2211. }}
  2212. case 27: case -27:
  2213. LLDEBUG_ALTERNATIVE("word", 27);
  2214. {LLSTATE llstate_1;
  2215. if (!llterm(T_IA5String, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2216. *llout = llstate_1;
  2217. {(*llret) = "IA5String";
  2218. break;
  2219. }}
  2220. case 28: case -28:
  2221. LLDEBUG_ALTERNATIVE("word", 28);
  2222. {LLSTATE llstate_1;
  2223. if (!llterm(T_IDENTIFIER, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2224. *llout = llstate_1;
  2225. {(*llret) = "IDENTIFIER";
  2226. break;
  2227. }}
  2228. case 29: case -29:
  2229. LLDEBUG_ALTERNATIVE("word", 29);
  2230. {LLSTATE llstate_1;
  2231. if (!llterm(T_identifier, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2232. *llout = llstate_1;
  2233. {(*llret) = "identifier";
  2234. break;
  2235. }}
  2236. case 30: case -30:
  2237. LLDEBUG_ALTERNATIVE("word", 30);
  2238. {LLSTATE llstate_1;
  2239. if (!llterm(T_IMPLICIT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2240. *llout = llstate_1;
  2241. {(*llret) = "IMPLICIT";
  2242. break;
  2243. }}
  2244. case 31: case -31:
  2245. LLDEBUG_ALTERNATIVE("word", 31);
  2246. {LLSTATE llstate_1;
  2247. if (!llterm(T_IMPLIED, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2248. *llout = llstate_1;
  2249. {(*llret) = "IMPLIED";
  2250. break;
  2251. }}
  2252. case 32: case -32:
  2253. LLDEBUG_ALTERNATIVE("word", 32);
  2254. {LLSTATE llstate_1;
  2255. if (!llterm(T_IMPORTS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2256. *llout = llstate_1;
  2257. {(*llret) = "IMPORTS";
  2258. break;
  2259. }}
  2260. case 33: case -33:
  2261. LLDEBUG_ALTERNATIVE("word", 33);
  2262. {LLSTATE llstate_1;
  2263. if (!llterm(T_INCLUDES, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2264. *llout = llstate_1;
  2265. {(*llret) = "INCLUDES";
  2266. break;
  2267. }}
  2268. case 34: case -34:
  2269. LLDEBUG_ALTERNATIVE("word", 34);
  2270. {LLSTATE llstate_1;
  2271. if (!llterm(T_ISO646String, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2272. *llout = llstate_1;
  2273. {(*llret) = "ISO646String";
  2274. break;
  2275. }}
  2276. case 35: case -35:
  2277. LLDEBUG_ALTERNATIVE("word", 35);
  2278. {LLSTATE llstate_1;
  2279. if (!llterm(T_MACRO, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2280. *llout = llstate_1;
  2281. {(*llret) = "MACRO";
  2282. break;
  2283. }}
  2284. case 36: case -36:
  2285. LLDEBUG_ALTERNATIVE("word", 36);
  2286. {LLSTATE llstate_1;
  2287. if (!llterm(T_MAX, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2288. *llout = llstate_1;
  2289. {(*llret) = "MAX";
  2290. break;
  2291. }}
  2292. case 37: case -37:
  2293. LLDEBUG_ALTERNATIVE("word", 37);
  2294. {LLSTATE llstate_1;
  2295. if (!llterm(T_MIN, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2296. *llout = llstate_1;
  2297. {(*llret) = "MIN";
  2298. break;
  2299. }}
  2300. case 38: case -38:
  2301. LLDEBUG_ALTERNATIVE("word", 38);
  2302. {LLSTATE llstate_1;
  2303. if (!llterm(T_NOTATION, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2304. *llout = llstate_1;
  2305. {(*llret) = "NOTATION";
  2306. break;
  2307. }}
  2308. case 39: case -39:
  2309. LLDEBUG_ALTERNATIVE("word", 39);
  2310. {LLSTATE llstate_1;
  2311. if (!llterm(T_Number, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2312. *llout = llstate_1;
  2313. {(*llret) = "number";
  2314. break;
  2315. }}
  2316. case 40: case -40:
  2317. LLDEBUG_ALTERNATIVE("word", 40);
  2318. {LLSTATE llstate_1;
  2319. if (!llterm(T_NumericString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2320. *llout = llstate_1;
  2321. {(*llret) = "NumericString";
  2322. break;
  2323. }}
  2324. case 41: case -41:
  2325. LLDEBUG_ALTERNATIVE("word", 41);
  2326. {LLSTATE llstate_1;
  2327. if (!llterm(T_ObjectDescriptor, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2328. *llout = llstate_1;
  2329. {(*llret) = "ObjectDescriptor";
  2330. break;
  2331. }}
  2332. case 42: case -42:
  2333. LLDEBUG_ALTERNATIVE("word", 42);
  2334. {LLSTATE llstate_1;
  2335. if (!llterm(T_OF, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2336. *llout = llstate_1;
  2337. {(*llret) = "OF";
  2338. break;
  2339. }}
  2340. case 43: case -43:
  2341. LLDEBUG_ALTERNATIVE("word", 43);
  2342. {LLSTATE llstate_1;
  2343. if (!llterm(T_OPTIONAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2344. *llout = llstate_1;
  2345. {(*llret) = "OPTIONAL";
  2346. break;
  2347. }}
  2348. case 44: case -44:
  2349. LLDEBUG_ALTERNATIVE("word", 44);
  2350. {LLSTATE llstate_1;
  2351. if (!llterm(T_PDV, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2352. *llout = llstate_1;
  2353. {(*llret) = "PDV";
  2354. break;
  2355. }}
  2356. case 45: case -45:
  2357. LLDEBUG_ALTERNATIVE("word", 45);
  2358. {LLSTATE llstate_1;
  2359. if (!llterm(T_PRESENT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2360. *llout = llstate_1;
  2361. {(*llret) = "PRESENT";
  2362. break;
  2363. }}
  2364. case 46: case -46:
  2365. LLDEBUG_ALTERNATIVE("word", 46);
  2366. {LLSTATE llstate_1;
  2367. if (!llterm(T_PrintableString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2368. *llout = llstate_1;
  2369. {(*llret) = "PrintableString";
  2370. break;
  2371. }}
  2372. case 47: case -47:
  2373. LLDEBUG_ALTERNATIVE("word", 47);
  2374. {LLSTATE llstate_1;
  2375. if (!llterm(T_PRIVATE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2376. *llout = llstate_1;
  2377. {(*llret) = "PRIVATE";
  2378. break;
  2379. }}
  2380. case 48: case -48:
  2381. LLDEBUG_ALTERNATIVE("word", 48);
  2382. {LLSTATE llstate_1;
  2383. if (!llterm(T_SIZE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2384. *llout = llstate_1;
  2385. {(*llret) = "SIZE";
  2386. break;
  2387. }}
  2388. case 49: case -49:
  2389. LLDEBUG_ALTERNATIVE("word", 49);
  2390. {LLSTATE llstate_1;
  2391. if (!llterm(T_STRING, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2392. *llout = llstate_1;
  2393. {(*llret) = "STRING";
  2394. break;
  2395. }}
  2396. case 50: case -50:
  2397. LLDEBUG_ALTERNATIVE("word", 50);
  2398. {LLSTATE llstate_1;
  2399. if (!llterm(T_string, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2400. *llout = llstate_1;
  2401. {(*llret) = "string";
  2402. break;
  2403. }}
  2404. case 51: case -51:
  2405. LLDEBUG_ALTERNATIVE("word", 51);
  2406. {LLSTATE llstate_1;
  2407. if (!llterm(T_SYNTAX, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2408. *llout = llstate_1;
  2409. {(*llret) = "SYNTAX";
  2410. break;
  2411. }}
  2412. case 52: case -52:
  2413. LLDEBUG_ALTERNATIVE("word", 52);
  2414. {LLSTATE llstate_1;
  2415. if (!llterm(T_T61String, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2416. *llout = llstate_1;
  2417. {(*llret) = "T61String";
  2418. break;
  2419. }}
  2420. case 53: case -53:
  2421. LLDEBUG_ALTERNATIVE("word", 53);
  2422. {LLSTATE llstate_1;
  2423. if (!llterm(T_TAGS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2424. *llout = llstate_1;
  2425. {(*llret) = "TAGS";
  2426. break;
  2427. }}
  2428. case 54: case -54:
  2429. LLDEBUG_ALTERNATIVE("word", 54);
  2430. {LLSTATE llstate_1;
  2431. if (!llterm(T_TeletexString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2432. *llout = llstate_1;
  2433. {(*llret) = "TeletexString";
  2434. break;
  2435. }}
  2436. case 55: case -55:
  2437. LLDEBUG_ALTERNATIVE("word", 55);
  2438. {LLSTATE llstate_1;
  2439. if (!llterm(T_TYPE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2440. *llout = llstate_1;
  2441. {(*llret) = "TYPE";
  2442. break;
  2443. }}
  2444. case 56: case -56:
  2445. LLDEBUG_ALTERNATIVE("word", 56);
  2446. {LLSTATE llstate_1;
  2447. if (!llterm(T_type, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2448. *llout = llstate_1;
  2449. {(*llret) = "type";
  2450. break;
  2451. }}
  2452. case 57: case -57:
  2453. LLDEBUG_ALTERNATIVE("word", 57);
  2454. {LLSTATE llstate_1;
  2455. if (!llterm(T_TYPE_IDENTIFIER, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2456. *llout = llstate_1;
  2457. {(*llret) = "TYPE-IDENTIFIER";
  2458. break;
  2459. }}
  2460. case 58: case -58:
  2461. LLDEBUG_ALTERNATIVE("word", 58);
  2462. {LLSTATE llstate_1;
  2463. if (!llterm(T_UNIQUE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2464. *llout = llstate_1;
  2465. {(*llret) = "UNIQUE";
  2466. break;
  2467. }}
  2468. case 59: case -59:
  2469. LLDEBUG_ALTERNATIVE("word", 59);
  2470. {LLSTATE llstate_1;
  2471. if (!llterm(T_UNIVERSAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2472. *llout = llstate_1;
  2473. {(*llret) = "UNIVERSAL";
  2474. break;
  2475. }}
  2476. case 60: case -60:
  2477. LLDEBUG_ALTERNATIVE("word", 60);
  2478. {LLSTATE llstate_1;
  2479. if (!llterm(T_UniversalString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2480. *llout = llstate_1;
  2481. {(*llret) = "UniversalString";
  2482. break;
  2483. }}
  2484. case 61: case -61:
  2485. LLDEBUG_ALTERNATIVE("word", 61);
  2486. {LLSTATE llstate_1;
  2487. if (!llterm(T_UTCTime, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2488. *llout = llstate_1;
  2489. {(*llret) = "UTCTime";
  2490. break;
  2491. }}
  2492. case 62: case -62:
  2493. LLDEBUG_ALTERNATIVE("word", 62);
  2494. {LLSTATE llstate_1;
  2495. if (!llterm(T_UTF8String, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2496. *llout = llstate_1;
  2497. {(*llret) = "UTF8String";
  2498. break;
  2499. }}
  2500. case 63: case -63:
  2501. LLDEBUG_ALTERNATIVE("word", 63);
  2502. {LLSTATE llstate_1;
  2503. if (!llterm(T_VALUE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2504. *llout = llstate_1;
  2505. {(*llret) = "VALUE";
  2506. break;
  2507. }}
  2508. case 64: case -64:
  2509. LLDEBUG_ALTERNATIVE("word", 64);
  2510. {LLSTATE llstate_1;
  2511. if (!llterm(T_value, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2512. *llout = llstate_1;
  2513. {(*llret) = "value";
  2514. break;
  2515. }}
  2516. case 65: case -65:
  2517. LLDEBUG_ALTERNATIVE("word", 65);
  2518. {LLSTATE llstate_1;
  2519. if (!llterm(T_VideotexString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2520. *llout = llstate_1;
  2521. {(*llret) = "VideotexString";
  2522. break;
  2523. }}
  2524. case 66: case -66:
  2525. LLDEBUG_ALTERNATIVE("word", 66);
  2526. {LLSTATE llstate_1;
  2527. if (!llterm(T_VisibleString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2528. *llout = llstate_1;
  2529. {(*llret) = "VisibleString";
  2530. break;
  2531. }}
  2532. case 67: case -67:
  2533. LLDEBUG_ALTERNATIVE("word", 67);
  2534. {LLSTATE llstate_1;
  2535. if (!llterm(T_WITH, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2536. *llout = llstate_1;
  2537. {(*llret) = "WITH";
  2538. break;
  2539. }}
  2540. default:
  2541. llstk[--llcstp] = 1;
  2542. goto failed1;
  2543. failed2:
  2544. LLDEBUG_BACKTRACKING("word");
  2545. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  2546. llcpos = llpos1; llcstp = llstp1;
  2547. continue;
  2548. } break;
  2549. }}
  2550. LLDEBUG_LEAVE("word", 1);
  2551. return 1;
  2552. failed1: LLDEBUG_LEAVE("word", 0);
  2553. return 0;
  2554. }
  2555. int ll_identifier(XString *llret, LLSTATE *llin, LLSTATE *llout)
  2556. {
  2557. unsigned llstp = llcstp;
  2558. LLSTATE llstate_0;
  2559. LLDEBUG_ENTER("identifier");
  2560. llstate_0 = *llin;
  2561. #undef failed
  2562. #define failed failed1
  2563. #undef failed
  2564. #define failed failed2
  2565. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  2566. LLCHECKSTK;
  2567. for (;;) {
  2568. switch (llstk[llcstp++]) {
  2569. case 1: case -1:
  2570. LLDEBUG_ALTERNATIVE("identifier", 1);
  2571. {LLSTATE llstate_1;XString llatt_1;
  2572. if (!llterm(T_lcsymbol, &lllval, &llstate_0, &llstate_1)) goto failed2;
  2573. llatt_1 = lllval._XString;
  2574. *llout = llstate_1;
  2575. {(*llret) = llatt_1;
  2576. break;
  2577. }}
  2578. case 2: case -2:
  2579. LLDEBUG_ALTERNATIVE("identifier", 2);
  2580. {LLSTATE llstate_1;
  2581. if (!llterm(T_empty, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2582. *llout = llstate_1;
  2583. {(*llret) = "empty";
  2584. break;
  2585. }}
  2586. case 3: case -3:
  2587. LLDEBUG_ALTERNATIVE("identifier", 3);
  2588. {LLSTATE llstate_1;
  2589. if (!llterm(T_identifier, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2590. *llout = llstate_1;
  2591. {(*llret) = "identifier";
  2592. break;
  2593. }}
  2594. case 4: case -4:
  2595. LLDEBUG_ALTERNATIVE("identifier", 4);
  2596. {LLSTATE llstate_1;
  2597. if (!llterm(T_Number, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2598. *llout = llstate_1;
  2599. {(*llret) = "number";
  2600. break;
  2601. }}
  2602. case 5: case -5:
  2603. LLDEBUG_ALTERNATIVE("identifier", 5);
  2604. {LLSTATE llstate_1;
  2605. if (!llterm(T_string, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2606. *llout = llstate_1;
  2607. {(*llret) = "string";
  2608. break;
  2609. }}
  2610. case 6: case -6:
  2611. LLDEBUG_ALTERNATIVE("identifier", 6);
  2612. {LLSTATE llstate_1;
  2613. if (!llterm(T_type, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2614. *llout = llstate_1;
  2615. {(*llret) = "type";
  2616. break;
  2617. }}
  2618. case 7: case -7:
  2619. LLDEBUG_ALTERNATIVE("identifier", 7);
  2620. {LLSTATE llstate_1;
  2621. if (!llterm(T_value, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2622. *llout = llstate_1;
  2623. {(*llret) = "value";
  2624. break;
  2625. }}
  2626. default:
  2627. llstk[--llcstp] = 1;
  2628. goto failed1;
  2629. failed2:
  2630. LLDEBUG_BACKTRACKING("identifier");
  2631. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  2632. llcpos = llpos1; llcstp = llstp1;
  2633. continue;
  2634. } break;
  2635. }}
  2636. LLDEBUG_LEAVE("identifier", 1);
  2637. return 1;
  2638. failed1: LLDEBUG_LEAVE("identifier", 0);
  2639. return 0;
  2640. }
  2641. int ll_ucsymbol(XString *llret, LLSTATE *llin, LLSTATE *llout)
  2642. {
  2643. unsigned llstp = llcstp;
  2644. LLSTATE llstate_0;
  2645. LLDEBUG_ENTER("ucsymbol");
  2646. llstate_0 = *llin;
  2647. #undef failed
  2648. #define failed failed1
  2649. #undef failed
  2650. #define failed failed2
  2651. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  2652. LLCHECKSTK;
  2653. for (;;) {
  2654. switch (llstk[llcstp++]) {
  2655. case 1: case -1:
  2656. LLDEBUG_ALTERNATIVE("ucsymbol", 1);
  2657. {LLSTATE llstate_1;XString llatt_1;
  2658. if (!ll_ocsymbol(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  2659. *llout = llstate_1;
  2660. {(*llret) = llatt_1;
  2661. break;
  2662. }}
  2663. case 2: case -2:
  2664. LLDEBUG_ALTERNATIVE("ucsymbol", 2);
  2665. {LLSTATE llstate_1;XString llatt_1;
  2666. if (!llterm(T_uppercase_symbol, &lllval, &llstate_0, &llstate_1)) goto failed2;
  2667. llatt_1 = lllval._XString;
  2668. *llout = llstate_1;
  2669. {(*llret) = llatt_1;
  2670. break;
  2671. }}
  2672. default:
  2673. llstk[--llcstp] = 1;
  2674. goto failed1;
  2675. failed2:
  2676. LLDEBUG_BACKTRACKING("ucsymbol");
  2677. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  2678. llcpos = llpos1; llcstp = llstp1;
  2679. continue;
  2680. } break;
  2681. }}
  2682. LLDEBUG_LEAVE("ucsymbol", 1);
  2683. return 1;
  2684. failed1: LLDEBUG_LEAVE("ucsymbol", 0);
  2685. return 0;
  2686. }
  2687. int ll_ocsymbol(XString *llret, LLSTATE *llin, LLSTATE *llout)
  2688. {
  2689. unsigned llstp = llcstp;
  2690. LLSTATE llstate_0;
  2691. LLDEBUG_ENTER("ocsymbol");
  2692. llstate_0 = *llin;
  2693. #undef failed
  2694. #define failed failed1
  2695. #undef failed
  2696. #define failed failed2
  2697. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  2698. LLCHECKSTK;
  2699. for (;;) {
  2700. switch (llstk[llcstp++]) {
  2701. case 1: case -1:
  2702. LLDEBUG_ALTERNATIVE("ocsymbol", 1);
  2703. {LLSTATE llstate_1;XString llatt_1;
  2704. if (!llterm(T_only_uppercase_symbol, &lllval, &llstate_0, &llstate_1)) goto failed2;
  2705. llatt_1 = lllval._XString;
  2706. *llout = llstate_1;
  2707. {(*llret) = llatt_1;
  2708. break;
  2709. }}
  2710. case 2: case -2:
  2711. LLDEBUG_ALTERNATIVE("ocsymbol", 2);
  2712. {LLSTATE llstate_1;XString llatt_1;
  2713. if (!llterm(T_only_uppercase_digits_symbol, &lllval, &llstate_0, &llstate_1)) goto failed2;
  2714. llatt_1 = lllval._XString;
  2715. *llout = llstate_1;
  2716. {(*llret) = llatt_1;
  2717. break;
  2718. }}
  2719. case 3: case -3:
  2720. LLDEBUG_ALTERNATIVE("ocsymbol", 3);
  2721. {LLSTATE llstate_1;
  2722. if (!llterm(T_MACRO, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2723. *llout = llstate_1;
  2724. {(*llret) = "MACRO";
  2725. break;
  2726. }}
  2727. case 4: case -4:
  2728. LLDEBUG_ALTERNATIVE("ocsymbol", 4);
  2729. {LLSTATE llstate_1;
  2730. if (!llterm(T_NOTATION, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2731. *llout = llstate_1;
  2732. {(*llret) = "NOTATION";
  2733. break;
  2734. }}
  2735. case 5: case -5:
  2736. LLDEBUG_ALTERNATIVE("ocsymbol", 5);
  2737. {LLSTATE llstate_1;
  2738. if (!llterm(T_TYPE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2739. *llout = llstate_1;
  2740. {(*llret) = "TYPE";
  2741. break;
  2742. }}
  2743. case 6: case -6:
  2744. LLDEBUG_ALTERNATIVE("ocsymbol", 6);
  2745. {LLSTATE llstate_1;
  2746. if (!llterm(T_VALUE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  2747. *llout = llstate_1;
  2748. {(*llret) = "VALUE";
  2749. break;
  2750. }}
  2751. default:
  2752. llstk[--llcstp] = 1;
  2753. goto failed1;
  2754. failed2:
  2755. LLDEBUG_BACKTRACKING("ocsymbol");
  2756. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  2757. llcpos = llpos1; llcstp = llstp1;
  2758. continue;
  2759. } break;
  2760. }}
  2761. LLDEBUG_LEAVE("ocsymbol", 1);
  2762. return 1;
  2763. failed1: LLDEBUG_LEAVE("ocsymbol", 0);
  2764. return 0;
  2765. }
  2766. int ll_astring(XString *llret, LLSTATE *llin, LLSTATE *llout)
  2767. {
  2768. unsigned llstp = llcstp;
  2769. LLSTATE llstate_0;
  2770. LLDEBUG_ENTER("astring");
  2771. llstate_0 = *llin;
  2772. #undef failed
  2773. #define failed failed1
  2774. {LLSTATE llstate_1;XString32 llatt_1;
  2775. if (!llterm(T_cstring, &lllval, &llstate_0, &llstate_1)) goto failed1;
  2776. llatt_1 = lllval._XString32;
  2777. *llout = llstate_1;
  2778. {uint32_t i, len;
  2779. len = str32len(llatt_1);
  2780. (*llret) = (char *)malloc(len + 1);
  2781. for (i = 0; i <= len; i++)
  2782. (*llret)[i] = (char)(llatt_1[i]);
  2783. }}
  2784. LLDEBUG_LEAVE("astring", 1);
  2785. return 1;
  2786. failed1: LLDEBUG_LEAVE("astring", 0);
  2787. return 0;
  2788. }
  2789. int ll_DefinedType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  2790. {
  2791. unsigned llstp = llcstp;
  2792. LLSTATE llstate_0;
  2793. LLDEBUG_ENTER("DefinedType");
  2794. llstate_0 = *llin;
  2795. #undef failed
  2796. #define failed failed1
  2797. #undef failed
  2798. #define failed failed2
  2799. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  2800. LLCHECKSTK;
  2801. for (;;) {
  2802. switch (llstk[llcstp++]) {
  2803. case 1: case -1:
  2804. LLDEBUG_ALTERNATIVE("DefinedType", 1);
  2805. {LLSTATE llstate_1;XType llatt_1;
  2806. if (!ll_Externaltypereference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  2807. *llout = llstate_1;
  2808. {(*llret) = llatt_1;
  2809. break;
  2810. }}
  2811. case 2: case -2:
  2812. LLDEBUG_ALTERNATIVE("DefinedType", 2);
  2813. {LLSTATE llstate_1;XType llatt_1;
  2814. if (!ll_typereference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  2815. *llout = llstate_1;
  2816. {(*llret) = llatt_1;
  2817. break;
  2818. }}
  2819. case 3: case -3:
  2820. LLDEBUG_ALTERNATIVE("DefinedType", 3);
  2821. {LLSTATE llstate_1;
  2822. if (!ll_ParameterizedType(&llstate_0, &llstate_1)) goto failed2;
  2823. *llout = llstate_1;
  2824. {MyAbort();
  2825. break;
  2826. }}
  2827. case 4: case -4:
  2828. LLDEBUG_ALTERNATIVE("DefinedType", 4);
  2829. {LLSTATE llstate_1;
  2830. if (!ll_ParameterizedValueSetType(&llstate_0, &llstate_1)) goto failed2;
  2831. *llout = llstate_1;
  2832. {MyAbort();
  2833. break;
  2834. }}
  2835. default:
  2836. llstk[--llcstp] = 1;
  2837. goto failed1;
  2838. failed2:
  2839. LLDEBUG_BACKTRACKING("DefinedType");
  2840. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  2841. llcpos = llpos1; llcstp = llstp1;
  2842. continue;
  2843. } break;
  2844. }}
  2845. LLDEBUG_LEAVE("DefinedType", 1);
  2846. return 1;
  2847. failed1: LLDEBUG_LEAVE("DefinedType", 0);
  2848. return 0;
  2849. }
  2850. int ll_TypeAssignment(LLSTATE *llin, LLSTATE *llout)
  2851. {
  2852. unsigned llstp = llcstp;
  2853. LLSTATE llstate_0;
  2854. LLDEBUG_ENTER("TypeAssignment");
  2855. llstate_0 = *llin;
  2856. #undef failed
  2857. #define failed failed1
  2858. {LLSTATE llstate_1;XType llatt_1;
  2859. if (!ll_typereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  2860. {LLSTATE llstate_2;
  2861. if (!llterm(T_DEF, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  2862. {LLSTATE llstate_3;XType llatt_3;
  2863. if (!ll_Type(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  2864. {LLSTATE llstate_4;XPrivateDirectives llatt_4;
  2865. if (!ll_PrivateDirectives(&llatt_4, &llstate_3, &llstate_4)) goto failed1;
  2866. *llout = llstate_4;
  2867. {PropagatePrivateDirectives(llatt_3, llatt_4);
  2868. if (!AssignType(&(*llout).Assignments, llatt_1, llatt_3))
  2869. LLFAILED((&llstate_1.pos, "Type `%s' twice defined",
  2870. llatt_1->U.Reference.Identifier));
  2871. ((*llout).Assignments)->eDefTagType = g_eDefTagType;
  2872. }}}}}
  2873. LLDEBUG_LEAVE("TypeAssignment", 1);
  2874. return 1;
  2875. failed1: LLDEBUG_LEAVE("TypeAssignment", 0);
  2876. return 0;
  2877. }
  2878. int ll_ValueSetTypeAssignment(LLSTATE *llin, LLSTATE *llout)
  2879. {
  2880. unsigned llstp = llcstp;
  2881. LLSTATE llstate_0;
  2882. LLDEBUG_ENTER("ValueSetTypeAssignment");
  2883. llstate_0 = *llin;
  2884. #undef failed
  2885. #define failed failed1
  2886. {LLSTATE llstate_1;XType llatt_1;
  2887. if (!ll_typereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  2888. {LLSTATE llstate_2;XType llatt_2;
  2889. if (!ll_Type(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  2890. {LLSTATE llstate_3;
  2891. if (!llterm(T_DEF, (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  2892. {LLSTATE llstate_4;XValueSet llatt_4;
  2893. if (!ll_ValueSet(&llatt_4, &llstate_3, &llstate_4, llatt_2)) goto failed1;
  2894. *llout = llstate_4;
  2895. {Type_t *type;
  2896. type = GetTypeOfValueSet((*llout).Assignments, llatt_4);
  2897. if (!AssignType(&(*llout).Assignments, llatt_1, type))
  2898. LLFAILED((&llstate_1.pos, "Type `%s' twice defined",
  2899. llatt_1->U.Reference.Identifier));
  2900. }}}}}
  2901. LLDEBUG_LEAVE("ValueSetTypeAssignment", 1);
  2902. return 1;
  2903. failed1: LLDEBUG_LEAVE("ValueSetTypeAssignment", 0);
  2904. return 0;
  2905. }
  2906. int ll_ValueSet(XValueSet *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  2907. {
  2908. unsigned llstp = llcstp;
  2909. LLSTATE llstate_0;
  2910. LLDEBUG_ENTER("ValueSet");
  2911. llstate_0 = *llin;
  2912. #undef failed
  2913. #define failed failed1
  2914. {LLSTATE llstate_1;
  2915. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  2916. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  2917. if (!ll_ElementSetSpec(&llatt_2, &llstate_1, &llstate_2, llarg_type, NULL, 0)) goto failed1;
  2918. {LLSTATE llstate_3;
  2919. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  2920. *llout = llstate_3;
  2921. {(*llret) = NewValueSet();
  2922. (*llret)->Elements = llatt_2;
  2923. (*llret)->Type = llarg_type;
  2924. }}}}
  2925. LLDEBUG_LEAVE("ValueSet", 1);
  2926. return 1;
  2927. failed1: LLDEBUG_LEAVE("ValueSet", 0);
  2928. return 0;
  2929. }
  2930. int ll_Type(XType *llret, LLSTATE *llin, LLSTATE *llout)
  2931. {
  2932. unsigned llstp = llcstp;
  2933. LLSTATE llstate_0;
  2934. LLDEBUG_ENTER("Type");
  2935. llstate_0 = *llin;
  2936. #undef failed
  2937. #define failed failed1
  2938. {LLSTATE llstate_1;XDirectives llatt_1;
  2939. if (!ll_LocalTypeDirectiveESeq(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  2940. {LLSTATE llstate_2;XType llatt_2;
  2941. if (!ll_UndirectivedType(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  2942. {LLSTATE llstate_3;XDirectives llatt_3;
  2943. if (!ll_LocalTypeDirectiveESeq(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  2944. *llout = llstate_3;
  2945. {Directive_t **dd, *d;
  2946. if (llatt_1 || llatt_3) {
  2947. (*llret) = DupType(llatt_2);
  2948. dd = &(*llret)->Directives;
  2949. for (d = llatt_1; d; d = d->Next) {
  2950. *dd = DupDirective(d);
  2951. dd = &(*dd)->Next;
  2952. }
  2953. for (d = llatt_3; d; d = d->Next) {
  2954. *dd = DupDirective(d);
  2955. dd = &(*dd)->Next;
  2956. }
  2957. *dd = llatt_2->Directives;
  2958. } else {
  2959. (*llret) = llatt_2;
  2960. }
  2961. }}}}
  2962. LLDEBUG_LEAVE("Type", 1);
  2963. return 1;
  2964. failed1: LLDEBUG_LEAVE("Type", 0);
  2965. return 0;
  2966. }
  2967. int ll_UndirectivedType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  2968. {
  2969. unsigned llstp = llcstp;
  2970. LLSTATE llstate_0;
  2971. LLDEBUG_ENTER("UndirectivedType");
  2972. llstate_0 = *llin;
  2973. #undef failed
  2974. #define failed failed1
  2975. #undef failed
  2976. #define failed failed2
  2977. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  2978. LLCHECKSTK;
  2979. for (;;) {
  2980. switch (llstk[llcstp++]) {
  2981. case 1: case -1:
  2982. LLDEBUG_ALTERNATIVE("UndirectivedType", 1);
  2983. {LLSTATE llstate_1;XType llatt_1;
  2984. if (!ll_UntaggedType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  2985. *llout = llstate_1;
  2986. {(*llret) = llatt_1;
  2987. break;
  2988. }}
  2989. case 2: case -2:
  2990. LLDEBUG_ALTERNATIVE("UndirectivedType", 2);
  2991. {LLSTATE llstate_1;XType llatt_1;
  2992. if (!ll_TaggedType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  2993. *llout = llstate_1;
  2994. {(*llret) = llatt_1;
  2995. break;
  2996. }}
  2997. default:
  2998. llstk[--llcstp] = 1;
  2999. goto failed1;
  3000. failed2:
  3001. LLDEBUG_BACKTRACKING("UndirectivedType");
  3002. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3003. llcpos = llpos1; llcstp = llstp1;
  3004. continue;
  3005. } break;
  3006. }}
  3007. LLDEBUG_LEAVE("UndirectivedType", 1);
  3008. return 1;
  3009. failed1: LLDEBUG_LEAVE("UndirectivedType", 0);
  3010. return 0;
  3011. }
  3012. int ll_UntaggedType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  3013. {
  3014. unsigned llstp = llcstp;
  3015. LLSTATE llstate_0;
  3016. LLDEBUG_ENTER("UntaggedType");
  3017. llstate_0 = *llin;
  3018. #undef failed
  3019. #define failed failed1
  3020. #undef failed
  3021. #define failed failed2
  3022. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3023. LLCHECKSTK;
  3024. for (;;) {
  3025. switch (llstk[llcstp++]) {
  3026. case 1: case -1:
  3027. LLDEBUG_ALTERNATIVE("UntaggedType", 1);
  3028. {LLSTATE llstate_1;XType llatt_1;
  3029. if (!ll_ConstrainableType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3030. *llout = llstate_1;
  3031. {(*llret) = llatt_1;
  3032. break;
  3033. }}
  3034. case 2: case -2:
  3035. LLDEBUG_ALTERNATIVE("UntaggedType", 2);
  3036. {LLSTATE llstate_1;XType llatt_1;
  3037. if (!ll_SequenceOfType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3038. *llout = llstate_1;
  3039. {(*llret) = llatt_1;
  3040. break;
  3041. }}
  3042. case 3: case -3:
  3043. LLDEBUG_ALTERNATIVE("UntaggedType", 3);
  3044. {LLSTATE llstate_1;XType llatt_1;
  3045. if (!ll_SetOfType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3046. *llout = llstate_1;
  3047. {(*llret) = llatt_1;
  3048. break;
  3049. }}
  3050. case 4: case -4:
  3051. LLDEBUG_ALTERNATIVE("UntaggedType", 4);
  3052. {LLSTATE llstate_1;XType llatt_1;
  3053. if (!ll_TypeWithConstraint(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3054. *llout = llstate_1;
  3055. {(*llret) = llatt_1;
  3056. break;
  3057. }}
  3058. default:
  3059. llstk[--llcstp] = 1;
  3060. goto failed1;
  3061. failed2:
  3062. LLDEBUG_BACKTRACKING("UntaggedType");
  3063. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3064. llcpos = llpos1; llcstp = llstp1;
  3065. continue;
  3066. } break;
  3067. }}
  3068. LLDEBUG_LEAVE("UntaggedType", 1);
  3069. return 1;
  3070. failed1: LLDEBUG_LEAVE("UntaggedType", 0);
  3071. return 0;
  3072. }
  3073. int ll_ConstrainableType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  3074. {
  3075. unsigned llstp = llcstp;
  3076. LLSTATE llstate_0;
  3077. LLDEBUG_ENTER("ConstrainableType");
  3078. llstate_0 = *llin;
  3079. #undef failed
  3080. #define failed failed1
  3081. #undef failed
  3082. #define failed failed2
  3083. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3084. LLCHECKSTK;
  3085. for (;;) {
  3086. switch (llstk[llcstp++]) {
  3087. case 1: case -1:
  3088. LLDEBUG_ALTERNATIVE("ConstrainableType", 1);
  3089. {LLSTATE llstate_1;XType llatt_1;
  3090. if (!ll_BuiltinType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3091. {LLSTATE llstate_2;XDirectives llatt_2;
  3092. if (!ll_LocalTypeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  3093. {LLSTATE llstate_3;XPrivateDirectives llatt_3;
  3094. if (!ll_PrivateDirectives(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  3095. {LLSTATE llstate_4;XConstraints llatt_4;
  3096. if (!ll_Constraint_ESeq(&llatt_4, &llstate_3, &llstate_4, llatt_1)) goto failed2;
  3097. {LLSTATE llstate_5;XDirectives llatt_5;
  3098. if (!ll_LocalTypeDirectiveESeq(&llatt_5, &llstate_4, &llstate_5)) goto failed2;
  3099. {LLSTATE llstate_6;XPrivateDirectives llatt_6;
  3100. if (!ll_PrivateDirectives(&llatt_6, &llstate_5, &llstate_6)) goto failed2;
  3101. *llout = llstate_6;
  3102. {Directive_t *d, **dd;
  3103. if (llatt_2 || llatt_4 || llatt_5) {
  3104. (*llret) = DupType(llatt_1);
  3105. IntersectConstraints(&(*llret)->Constraints,
  3106. llatt_1->Constraints, llatt_4);
  3107. dd = &(*llret)->Directives;
  3108. for (d = llatt_2; d; d = d->Next) {
  3109. *dd = DupDirective(d);
  3110. dd = &(*dd)->Next;
  3111. }
  3112. for (d = llatt_5; d; d = d->Next) {
  3113. *dd = DupDirective(d);
  3114. dd = &(*dd)->Next;
  3115. }
  3116. *dd = NULL;
  3117. } else {
  3118. (*llret) = (llatt_3 || llatt_6) ? DupType(llatt_1) : llatt_1;
  3119. }
  3120. PropagatePrivateDirectives((*llret), llatt_3);
  3121. PropagatePrivateDirectives((*llret), llatt_6);
  3122. break;
  3123. }}}}}}}
  3124. case 2: case -2:
  3125. LLDEBUG_ALTERNATIVE("ConstrainableType", 2);
  3126. {LLSTATE llstate_1;XType llatt_1;
  3127. if (!ll_ReferencedType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3128. {LLSTATE llstate_2;XDirectives llatt_2;
  3129. if (!ll_LocalTypeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  3130. {LLSTATE llstate_3;XPrivateDirectives llatt_3;
  3131. if (!ll_PrivateDirectives(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  3132. {LLSTATE llstate_4;XConstraints llatt_4;
  3133. if (!ll_Constraint_ESeq(&llatt_4, &llstate_3, &llstate_4, llatt_1)) goto failed2;
  3134. {LLSTATE llstate_5;XDirectives llatt_5;
  3135. if (!ll_LocalTypeDirectiveESeq(&llatt_5, &llstate_4, &llstate_5)) goto failed2;
  3136. {LLSTATE llstate_6;XPrivateDirectives llatt_6;
  3137. if (!ll_PrivateDirectives(&llatt_6, &llstate_5, &llstate_6)) goto failed2;
  3138. *llout = llstate_6;
  3139. {Directive_t *d, **dd;
  3140. if (llatt_2 || llatt_4 || llatt_5) {
  3141. (*llret) = DupType(llatt_1);
  3142. IntersectConstraints(&(*llret)->Constraints,
  3143. llatt_1->Constraints, llatt_4);
  3144. dd = &(*llret)->Directives;
  3145. for (d = llatt_2; d; d = d->Next) {
  3146. *dd = DupDirective(d);
  3147. dd = &(*dd)->Next;
  3148. }
  3149. for (d = llatt_5; d; d = d->Next) {
  3150. *dd = DupDirective(d);
  3151. dd = &(*dd)->Next;
  3152. }
  3153. *dd = NULL;
  3154. } else {
  3155. (*llret) = (llatt_3 || llatt_6) ? DupType(llatt_1) : llatt_1;
  3156. }
  3157. PropagatePrivateDirectives((*llret), llatt_3);
  3158. PropagatePrivateDirectives((*llret), llatt_6);
  3159. break;
  3160. }}}}}}}
  3161. default:
  3162. llstk[--llcstp] = 1;
  3163. goto failed1;
  3164. failed2:
  3165. LLDEBUG_BACKTRACKING("ConstrainableType");
  3166. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3167. llcpos = llpos1; llcstp = llstp1;
  3168. continue;
  3169. } break;
  3170. }}
  3171. LLDEBUG_LEAVE("ConstrainableType", 1);
  3172. return 1;
  3173. failed1: LLDEBUG_LEAVE("ConstrainableType", 0);
  3174. return 0;
  3175. }
  3176. int ll_Constraint_ESeq(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  3177. {
  3178. unsigned llstp = llcstp;
  3179. LLSTATE llstate_0;
  3180. LLDEBUG_ENTER("Constraint_ESeq");
  3181. llstate_0 = *llin;
  3182. #undef failed
  3183. #define failed failed1
  3184. #undef failed
  3185. #define failed failed2
  3186. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3187. LLCHECKSTK;
  3188. for (;;) {
  3189. switch (llstk[llcstp++]) {
  3190. case 1: case -1:
  3191. LLDEBUG_ALTERNATIVE("Constraint_ESeq", 1);
  3192. {LLSTATE llstate_1;XConstraints llatt_1;
  3193. if (!ll_Constraint(&llatt_1, &llstate_0, &llstate_1, llarg_type, 0)) goto failed2;
  3194. {LLSTATE llstate_2;XConstraints llatt_2;
  3195. if (!ll_Constraint_ESeq(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed2;
  3196. *llout = llstate_2;
  3197. {if (llatt_2) {
  3198. IntersectConstraints(&(*llret), llatt_1, llatt_2);
  3199. } else {
  3200. (*llret) = llatt_1;
  3201. }
  3202. break;
  3203. }}}
  3204. case 2: case -2:
  3205. LLDEBUG_ALTERNATIVE("Constraint_ESeq", 2);
  3206. *llout = llstate_0;
  3207. {(*llret) = NULL;
  3208. break;
  3209. }
  3210. default:
  3211. llstk[--llcstp] = 1;
  3212. goto failed1;
  3213. failed2:
  3214. LLDEBUG_BACKTRACKING("Constraint_ESeq");
  3215. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3216. llcpos = llpos1; llcstp = llstp1;
  3217. continue;
  3218. } break;
  3219. }}
  3220. LLDEBUG_LEAVE("Constraint_ESeq", 1);
  3221. return 1;
  3222. failed1: LLDEBUG_LEAVE("Constraint_ESeq", 0);
  3223. return 0;
  3224. }
  3225. int ll_BuiltinType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  3226. {
  3227. unsigned llstp = llcstp;
  3228. LLSTATE llstate_0;
  3229. LLDEBUG_ENTER("BuiltinType");
  3230. llstate_0 = *llin;
  3231. #undef failed
  3232. #define failed failed1
  3233. #undef failed
  3234. #define failed failed2
  3235. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3236. LLCHECKSTK;
  3237. for (;;) {
  3238. switch (llstk[llcstp++]) {
  3239. case 1: case -1:
  3240. LLDEBUG_ALTERNATIVE("BuiltinType", 1);
  3241. {LLSTATE llstate_1;XType llatt_1;
  3242. if (!ll_BitStringType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3243. *llout = llstate_1;
  3244. {(*llret) = llatt_1;
  3245. break;
  3246. }}
  3247. case 2: case -2:
  3248. LLDEBUG_ALTERNATIVE("BuiltinType", 2);
  3249. {LLSTATE llstate_1;XType llatt_1;
  3250. if (!ll_BooleanType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3251. *llout = llstate_1;
  3252. {(*llret) = llatt_1;
  3253. break;
  3254. }}
  3255. case 3: case -3:
  3256. LLDEBUG_ALTERNATIVE("BuiltinType", 3);
  3257. {LLSTATE llstate_1;XType llatt_1;
  3258. if (!ll_CharacterStringType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3259. *llout = llstate_1;
  3260. {(*llret) = llatt_1;
  3261. break;
  3262. }}
  3263. case 4: case -4:
  3264. LLDEBUG_ALTERNATIVE("BuiltinType", 4);
  3265. {LLSTATE llstate_1;XType llatt_1;
  3266. if (!ll_ChoiceType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3267. *llout = llstate_1;
  3268. {(*llret) = llatt_1;
  3269. break;
  3270. }}
  3271. case 5: case -5:
  3272. LLDEBUG_ALTERNATIVE("BuiltinType", 5);
  3273. {LLSTATE llstate_1;XType llatt_1;
  3274. if (!ll_EmbeddedPDVType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3275. *llout = llstate_1;
  3276. {(*llret) = llatt_1;
  3277. break;
  3278. }}
  3279. case 6: case -6:
  3280. LLDEBUG_ALTERNATIVE("BuiltinType", 6);
  3281. {LLSTATE llstate_1;XType llatt_1;
  3282. if (!ll_EnumeratedType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3283. *llout = llstate_1;
  3284. {(*llret) = llatt_1;
  3285. break;
  3286. }}
  3287. case 7: case -7:
  3288. LLDEBUG_ALTERNATIVE("BuiltinType", 7);
  3289. {LLSTATE llstate_1;XType llatt_1;
  3290. if (!ll_ExternalType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3291. *llout = llstate_1;
  3292. {(*llret) = llatt_1;
  3293. break;
  3294. }}
  3295. case 8: case -8:
  3296. LLDEBUG_ALTERNATIVE("BuiltinType", 8);
  3297. {LLSTATE llstate_1;XType llatt_1;
  3298. if (!ll_InstanceOfType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3299. *llout = llstate_1;
  3300. {(*llret) = llatt_1;
  3301. break;
  3302. }}
  3303. case 9: case -9:
  3304. LLDEBUG_ALTERNATIVE("BuiltinType", 9);
  3305. {LLSTATE llstate_1;XType llatt_1;
  3306. if (!ll_IntegerType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3307. *llout = llstate_1;
  3308. {(*llret) = llatt_1;
  3309. break;
  3310. }}
  3311. case 10: case -10:
  3312. LLDEBUG_ALTERNATIVE("BuiltinType", 10);
  3313. {LLSTATE llstate_1;XType llatt_1;
  3314. if (!ll_NullType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3315. *llout = llstate_1;
  3316. {(*llret) = llatt_1;
  3317. break;
  3318. }}
  3319. case 11: case -11:
  3320. LLDEBUG_ALTERNATIVE("BuiltinType", 11);
  3321. {LLSTATE llstate_1;XType llatt_1;
  3322. if (!ll_ObjectClassFieldType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3323. *llout = llstate_1;
  3324. {(*llret) = llatt_1;
  3325. break;
  3326. }}
  3327. case 12: case -12:
  3328. LLDEBUG_ALTERNATIVE("BuiltinType", 12);
  3329. {LLSTATE llstate_1;XType llatt_1;
  3330. if (!ll_ObjectIdentifierType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3331. *llout = llstate_1;
  3332. {(*llret) = llatt_1;
  3333. break;
  3334. }}
  3335. case 13: case -13:
  3336. LLDEBUG_ALTERNATIVE("BuiltinType", 13);
  3337. {LLSTATE llstate_1;XType llatt_1;
  3338. if (!ll_OctetStringType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3339. *llout = llstate_1;
  3340. {(*llret) = llatt_1;
  3341. break;
  3342. }}
  3343. case 14: case -14:
  3344. LLDEBUG_ALTERNATIVE("BuiltinType", 14);
  3345. {LLSTATE llstate_1;XType llatt_1;
  3346. if (!ll_UTF8StringType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3347. *llout = llstate_1;
  3348. {(*llret) = llatt_1;
  3349. break;
  3350. }}
  3351. case 15: case -15:
  3352. LLDEBUG_ALTERNATIVE("BuiltinType", 15);
  3353. {LLSTATE llstate_1;XType llatt_1;
  3354. if (!ll_RealType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3355. *llout = llstate_1;
  3356. {(*llret) = llatt_1;
  3357. break;
  3358. }}
  3359. case 16: case -16:
  3360. LLDEBUG_ALTERNATIVE("BuiltinType", 16);
  3361. {LLSTATE llstate_1;XType llatt_1;
  3362. if (!ll_SequenceType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3363. *llout = llstate_1;
  3364. {(*llret) = llatt_1;
  3365. break;
  3366. }}
  3367. case 17: case -17:
  3368. LLDEBUG_ALTERNATIVE("BuiltinType", 17);
  3369. {LLSTATE llstate_1;XType llatt_1;
  3370. if (!ll_SetType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3371. *llout = llstate_1;
  3372. {(*llret) = llatt_1;
  3373. break;
  3374. }}
  3375. case 18: case -18:
  3376. LLDEBUG_ALTERNATIVE("BuiltinType", 18);
  3377. {LLSTATE llstate_1;XType llatt_1;
  3378. if (!ll_AnyType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3379. *llout = llstate_1;
  3380. {(*llret) = llatt_1;
  3381. break;
  3382. }}
  3383. case 19: case -19:
  3384. LLDEBUG_ALTERNATIVE("BuiltinType", 19);
  3385. {LLSTATE llstate_1;XType llatt_1;
  3386. if (!ll_MacroDefinedType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3387. *llout = llstate_1;
  3388. {(*llret) = llatt_1;
  3389. break;
  3390. }}
  3391. default:
  3392. llstk[--llcstp] = 1;
  3393. goto failed1;
  3394. failed2:
  3395. LLDEBUG_BACKTRACKING("BuiltinType");
  3396. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3397. llcpos = llpos1; llcstp = llstp1;
  3398. continue;
  3399. } break;
  3400. }}
  3401. LLDEBUG_LEAVE("BuiltinType", 1);
  3402. return 1;
  3403. failed1: LLDEBUG_LEAVE("BuiltinType", 0);
  3404. return 0;
  3405. }
  3406. int ll_ReferencedType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  3407. {
  3408. unsigned llstp = llcstp;
  3409. LLSTATE llstate_0;
  3410. LLDEBUG_ENTER("ReferencedType");
  3411. llstate_0 = *llin;
  3412. #undef failed
  3413. #define failed failed1
  3414. #undef failed
  3415. #define failed failed2
  3416. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3417. LLCHECKSTK;
  3418. for (;;) {
  3419. switch (llstk[llcstp++]) {
  3420. case 1: case -1:
  3421. LLDEBUG_ALTERNATIVE("ReferencedType", 1);
  3422. {LLSTATE llstate_1;XType llatt_1;
  3423. if (!ll_DefinedType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3424. *llout = llstate_1;
  3425. {(*llret) = llatt_1;
  3426. break;
  3427. }}
  3428. case 2: case -2:
  3429. LLDEBUG_ALTERNATIVE("ReferencedType", 2);
  3430. {LLSTATE llstate_1;XType llatt_1;
  3431. if (!ll_UsefulType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3432. *llout = llstate_1;
  3433. {(*llret) = llatt_1;
  3434. break;
  3435. }}
  3436. case 3: case -3:
  3437. LLDEBUG_ALTERNATIVE("ReferencedType", 3);
  3438. {LLSTATE llstate_1;XType llatt_1;
  3439. if (!ll_SelectionType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3440. *llout = llstate_1;
  3441. {(*llret) = llatt_1;
  3442. break;
  3443. }}
  3444. case 4: case -4:
  3445. LLDEBUG_ALTERNATIVE("ReferencedType", 4);
  3446. {LLSTATE llstate_1;XType llatt_1;
  3447. if (!ll_TypeFromObject(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3448. *llout = llstate_1;
  3449. {(*llret) = llatt_1;
  3450. break;
  3451. }}
  3452. case 5: case -5:
  3453. LLDEBUG_ALTERNATIVE("ReferencedType", 5);
  3454. {LLSTATE llstate_1;XValueSet llatt_1;
  3455. if (!ll_ValueSetFromObjects(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3456. *llout = llstate_1;
  3457. {(*llret) = GetTypeOfValueSet((*llout).Assignments, llatt_1);
  3458. break;
  3459. }}
  3460. default:
  3461. llstk[--llcstp] = 1;
  3462. goto failed1;
  3463. failed2:
  3464. LLDEBUG_BACKTRACKING("ReferencedType");
  3465. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3466. llcpos = llpos1; llcstp = llstp1;
  3467. continue;
  3468. } break;
  3469. }}
  3470. LLDEBUG_LEAVE("ReferencedType", 1);
  3471. return 1;
  3472. failed1: LLDEBUG_LEAVE("ReferencedType", 0);
  3473. return 0;
  3474. }
  3475. int ll_NamedType(XNamedType *llret, LLSTATE *llin, LLSTATE *llout)
  3476. {
  3477. unsigned llstp = llcstp;
  3478. LLSTATE llstate_0;
  3479. LLDEBUG_ENTER("NamedType");
  3480. llstate_0 = *llin;
  3481. #undef failed
  3482. #define failed failed1
  3483. #undef failed
  3484. #define failed failed2
  3485. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3486. LLCHECKSTK;
  3487. for (;;) {
  3488. switch (llstk[llcstp++]) {
  3489. case 1: case -1:
  3490. LLDEBUG_ALTERNATIVE("NamedType", 1);
  3491. {LLSTATE llstate_1;XString llatt_1;
  3492. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3493. {LLSTATE llstate_2;XType llatt_2;
  3494. if (!ll_Type(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  3495. *llout = llstate_2;
  3496. {(*llret) = NewNamedType(llatt_2->PrivateDirectives.pszFieldName ? llatt_2->PrivateDirectives.pszFieldName : llatt_1, llatt_2);
  3497. llatt_2->PrivateDirectives.pszFieldName = NULL;
  3498. break;
  3499. }}}
  3500. case 2: case -2:
  3501. LLDEBUG_ALTERNATIVE("NamedType", 2);
  3502. {LLSTATE llstate_1;XString llatt_1;
  3503. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3504. {LLSTATE llstate_2;
  3505. if (!llterm('<', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  3506. {LLSTATE llstate_3;XType llatt_3;
  3507. if (!ll_Type(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  3508. *llout = llstate_3;
  3509. {Type_t *type;
  3510. type = NewType(eType_Selection);
  3511. type->U.Selection.Type = llatt_3;
  3512. type->U.Selection.Identifier = llatt_1;
  3513. (*llret) = NewNamedType(llatt_3->PrivateDirectives.pszFieldName ? llatt_3->PrivateDirectives.pszFieldName : llatt_1, type);
  3514. llatt_3->PrivateDirectives.pszFieldName = NULL;
  3515. break;
  3516. }}}}
  3517. default:
  3518. llstk[--llcstp] = 1;
  3519. goto failed1;
  3520. failed2:
  3521. LLDEBUG_BACKTRACKING("NamedType");
  3522. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3523. llcpos = llpos1; llcstp = llstp1;
  3524. continue;
  3525. } break;
  3526. }}
  3527. LLDEBUG_LEAVE("NamedType", 1);
  3528. return 1;
  3529. failed1: LLDEBUG_LEAVE("NamedType", 0);
  3530. return 0;
  3531. }
  3532. int ll_BooleanType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  3533. {
  3534. unsigned llstp = llcstp;
  3535. LLSTATE llstate_0;
  3536. LLDEBUG_ENTER("BooleanType");
  3537. llstate_0 = *llin;
  3538. #undef failed
  3539. #define failed failed1
  3540. {LLSTATE llstate_1;
  3541. if (!llterm(T_BOOLEAN, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  3542. *llout = llstate_1;
  3543. {(*llret) = Builtin_Type_Boolean;
  3544. }}
  3545. LLDEBUG_LEAVE("BooleanType", 1);
  3546. return 1;
  3547. failed1: LLDEBUG_LEAVE("BooleanType", 0);
  3548. return 0;
  3549. }
  3550. int ll_IntegerType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  3551. {
  3552. unsigned llstp = llcstp;
  3553. LLSTATE llstate_0;
  3554. LLDEBUG_ENTER("IntegerType");
  3555. llstate_0 = *llin;
  3556. #undef failed
  3557. #define failed failed1
  3558. #undef failed
  3559. #define failed failed2
  3560. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3561. LLCHECKSTK;
  3562. for (;;) {
  3563. switch (llstk[llcstp++]) {
  3564. case 1: case -1:
  3565. LLDEBUG_ALTERNATIVE("IntegerType", 1);
  3566. {LLSTATE llstate_1;
  3567. if (!llterm(T_INTEGER, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  3568. {LLSTATE llstate_2;
  3569. if (!llterm('{', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  3570. {LLSTATE llstate_3;XNamedNumbers llatt_3;
  3571. if (!ll_NamedNumberList(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  3572. {LLSTATE llstate_4;
  3573. if (!llterm('}', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed2;
  3574. *llout = llstate_4;
  3575. {NamedNumber_t *n, *m;
  3576. for (n = llatt_3; n && n->Next; n = n->Next) {
  3577. for (m = n->Next; m; m = m->Next) {
  3578. if (n->Type == eNamedNumber_Normal &&
  3579. m->Type == eNamedNumber_Normal) {
  3580. if (!strcmp(n->U.Normal.Identifier,
  3581. m->U.Normal.Identifier))
  3582. LLFAILED((&llstate_3.pos,
  3583. "identifier `%s' has been assigned twice",
  3584. n->U.Normal.Identifier));
  3585. if (GetValue((*llout).Assignments, n->U.Normal.Value) &&
  3586. GetValue((*llout).Assignments, m->U.Normal.Value) &&
  3587. GetTypeType((*llout).Assignments,
  3588. GetValue((*llout).Assignments, n->U.Normal.Value)->Type)
  3589. == eType_Integer &&
  3590. GetTypeType((*llout).Assignments,
  3591. GetValue((*llout).Assignments, m->U.Normal.Value)->Type)
  3592. == eType_Integer &&
  3593. !intx_cmp(&GetValue((*llout).Assignments,
  3594. n->U.Normal.Value)->U.Integer.Value,
  3595. &GetValue((*llout).Assignments,
  3596. m->U.Normal.Value)->U.Integer.Value))
  3597. LLFAILED((&llstate_3.pos,
  3598. "value `%d' has been assigned twice",
  3599. intx2int32(&GetValue((*llout).Assignments,
  3600. n->U.Normal.Value)->U.Integer.Value)));
  3601. }
  3602. }
  3603. }
  3604. (*llret) = NewType(eType_Integer);
  3605. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  3606. (*llret)->U.Integer.NamedNumbers = llatt_3;
  3607. break;
  3608. }}}}}
  3609. case 2: case -2:
  3610. LLDEBUG_ALTERNATIVE("IntegerType", 2);
  3611. {LLSTATE llstate_1;
  3612. if (!llterm(T_INTEGER, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  3613. *llout = llstate_1;
  3614. {(*llret) = NewType(eType_Integer);
  3615. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  3616. break;
  3617. }}
  3618. default:
  3619. llstk[--llcstp] = 1;
  3620. goto failed1;
  3621. failed2:
  3622. LLDEBUG_BACKTRACKING("IntegerType");
  3623. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3624. llcpos = llpos1; llcstp = llstp1;
  3625. continue;
  3626. } break;
  3627. }}
  3628. LLDEBUG_LEAVE("IntegerType", 1);
  3629. return 1;
  3630. failed1: LLDEBUG_LEAVE("IntegerType", 0);
  3631. return 0;
  3632. }
  3633. int ll_NamedNumberList(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout)
  3634. {
  3635. unsigned llstp = llcstp;
  3636. LLSTATE llstate_0;
  3637. LLDEBUG_ENTER("NamedNumberList");
  3638. llstate_0 = *llin;
  3639. #undef failed
  3640. #define failed failed1
  3641. #undef failed
  3642. #define failed failed2
  3643. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3644. LLCHECKSTK;
  3645. for (;;) {
  3646. switch (llstk[llcstp++]) {
  3647. case 1: case -1:
  3648. LLDEBUG_ALTERNATIVE("NamedNumberList", 1);
  3649. {LLSTATE llstate_1;XNamedNumbers llatt_1;
  3650. if (!ll_NamedNumber(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3651. {LLSTATE llstate_2;
  3652. if (!llterm(',', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  3653. {LLSTATE llstate_3;XNamedNumbers llatt_3;
  3654. if (!ll_NamedNumberList(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  3655. *llout = llstate_3;
  3656. {(*llret) = DupNamedNumber(llatt_1);
  3657. (*llret)->Next = llatt_3;
  3658. break;
  3659. }}}}
  3660. case 2: case -2:
  3661. LLDEBUG_ALTERNATIVE("NamedNumberList", 2);
  3662. {LLSTATE llstate_1;XNamedNumbers llatt_1;
  3663. if (!ll_NamedNumber(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3664. *llout = llstate_1;
  3665. {(*llret) = llatt_1;
  3666. break;
  3667. }}
  3668. default:
  3669. llstk[--llcstp] = 1;
  3670. goto failed1;
  3671. failed2:
  3672. LLDEBUG_BACKTRACKING("NamedNumberList");
  3673. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3674. llcpos = llpos1; llcstp = llstp1;
  3675. continue;
  3676. } break;
  3677. }}
  3678. LLDEBUG_LEAVE("NamedNumberList", 1);
  3679. return 1;
  3680. failed1: LLDEBUG_LEAVE("NamedNumberList", 0);
  3681. return 0;
  3682. }
  3683. int ll_NamedNumber(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout)
  3684. {
  3685. unsigned llstp = llcstp;
  3686. LLSTATE llstate_0;
  3687. LLDEBUG_ENTER("NamedNumber");
  3688. llstate_0 = *llin;
  3689. #undef failed
  3690. #define failed failed1
  3691. #undef failed
  3692. #define failed failed2
  3693. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3694. LLCHECKSTK;
  3695. for (;;) {
  3696. switch (llstk[llcstp++]) {
  3697. case 1: case -1:
  3698. LLDEBUG_ALTERNATIVE("NamedNumber", 1);
  3699. {LLSTATE llstate_1;XString llatt_1;
  3700. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3701. {LLSTATE llstate_2;
  3702. if (!llterm('(', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  3703. {LLSTATE llstate_3;XValue llatt_3;
  3704. if (!ll_SignedNumber(&llatt_3, &llstate_2, &llstate_3, Builtin_Type_Integer)) goto failed2;
  3705. {LLSTATE llstate_4;
  3706. if (!llterm(')', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed2;
  3707. *llout = llstate_4;
  3708. {(*llret) = NewNamedNumber(eNamedNumber_Normal);
  3709. (*llret)->U.Normal.Identifier = llatt_1;
  3710. (*llret)->U.Normal.Value = llatt_3;
  3711. break;
  3712. }}}}}
  3713. case 2: case -2:
  3714. LLDEBUG_ALTERNATIVE("NamedNumber", 2);
  3715. {LLSTATE llstate_1;XString llatt_1;
  3716. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3717. {LLSTATE llstate_2;
  3718. if (!llterm('(', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  3719. {LLSTATE llstate_3;XValue llatt_3;
  3720. if (!ll_DefinedValue(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  3721. {LLSTATE llstate_4;
  3722. if (!llterm(')', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed2;
  3723. *llout = llstate_4;
  3724. {Value_t *v;
  3725. v = GetValue((*llout).Assignments, llatt_3);
  3726. if (v) {
  3727. if (GetTypeType((*llout).Assignments, v->Type) != eType_Undefined &&
  3728. GetTypeType((*llout).Assignments, v->Type) != eType_Integer)
  3729. LLFAILED((&llstate_3.pos, "Bad type of value"));
  3730. if (GetTypeType((*llout).Assignments, v->Type) != eType_Integer &&
  3731. intx_cmp(&v->U.Integer.Value, &intx_0) < 0)
  3732. LLFAILED((&llstate_3.pos, "Bad value"));
  3733. }
  3734. (*llret) = NewNamedNumber(eNamedNumber_Normal);
  3735. (*llret)->U.Normal.Identifier = llatt_1;
  3736. (*llret)->U.Normal.Value = llatt_3;
  3737. break;
  3738. }}}}}
  3739. default:
  3740. llstk[--llcstp] = 1;
  3741. goto failed1;
  3742. failed2:
  3743. LLDEBUG_BACKTRACKING("NamedNumber");
  3744. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3745. llcpos = llpos1; llcstp = llstp1;
  3746. continue;
  3747. } break;
  3748. }}
  3749. LLDEBUG_LEAVE("NamedNumber", 1);
  3750. return 1;
  3751. failed1: LLDEBUG_LEAVE("NamedNumber", 0);
  3752. return 0;
  3753. }
  3754. int ll_EnumeratedType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  3755. {
  3756. unsigned llstp = llcstp;
  3757. LLSTATE llstate_0;
  3758. LLDEBUG_ENTER("EnumeratedType");
  3759. llstate_0 = *llin;
  3760. #undef failed
  3761. #define failed failed1
  3762. {LLSTATE llstate_1;
  3763. if (!llterm(T_ENUMERATED, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  3764. {LLSTATE llstate_2;
  3765. if (!llterm('{', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  3766. {LLSTATE llstate_3;XNamedNumbers llatt_3;
  3767. if (!ll_Enumerations(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  3768. {LLSTATE llstate_4;
  3769. if (!llterm('}', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed1;
  3770. *llout = llstate_4;
  3771. {NamedNumber_t **nn, *n, *m;
  3772. intx_t *ix;
  3773. uint32_t num = 0;
  3774. (*llret) = NewType(eType_Enumerated);
  3775. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  3776. for (n = llatt_3; n; n = n->Next)
  3777. if (n->Type == eNamedNumber_Normal)
  3778. KeepEnumNames(n->U.Normal.Identifier); // global conflict check
  3779. for (n = llatt_3; n && n->Next; n = n->Next) {
  3780. if (n->Type != eNamedNumber_Normal)
  3781. continue;
  3782. for (m = n->Next; m; m = m->Next) {
  3783. if (m->Type != eNamedNumber_Normal)
  3784. continue;
  3785. if (!strcmp(n->U.Normal.Identifier,
  3786. m->U.Normal.Identifier))
  3787. LLFAILED((&llstate_3.pos,
  3788. "identifier `%s' has been assigned twice",
  3789. n->U.Normal.Identifier));
  3790. if (GetValue((*llout).Assignments, n->U.Normal.Value) &&
  3791. GetValue((*llout).Assignments, m->U.Normal.Value) &&
  3792. GetTypeType((*llout).Assignments,
  3793. GetValue((*llout).Assignments, n->U.Normal.Value)->Type)
  3794. == eType_Integer &&
  3795. GetTypeType((*llout).Assignments,
  3796. GetValue((*llout).Assignments, m->U.Normal.Value)->Type)
  3797. == eType_Integer &&
  3798. !intx_cmp(&GetValue((*llout).Assignments,
  3799. n->U.Normal.Value)->U.Integer.Value,
  3800. &GetValue((*llout).Assignments,
  3801. m->U.Normal.Value)->U.Integer.Value))
  3802. LLFAILED((&llstate_3.pos,
  3803. "value `%d' has been assigned twice",
  3804. intx2int32(&GetValue((*llout).Assignments,
  3805. n->U.Normal.Value)->U.Integer.Value)));
  3806. }
  3807. }
  3808. nn = &(*llret)->U.Enumerated.NamedNumbers;
  3809. for (n = llatt_3; n; n = n->Next) {
  3810. *nn = DupNamedNumber(n);
  3811. switch (n->Type) {
  3812. case eNamedNumber_Normal:
  3813. if (n->U.Normal.Value)
  3814. break;
  3815. for (;; num++) {
  3816. for (m = llatt_3; m; m = m->Next) {
  3817. switch (m->Type) {
  3818. case eNamedNumber_Normal:
  3819. if (!m->U.Normal.Value)
  3820. continue;
  3821. ix = &GetValue((*llout).Assignments,
  3822. m->U.Normal.Value)->U.Integer.Value;
  3823. if (!intxisuint32(ix) ||
  3824. intx2uint32(ix) != num)
  3825. continue;
  3826. break;
  3827. default:
  3828. continue;
  3829. }
  3830. break;
  3831. }
  3832. if (!m)
  3833. break;
  3834. }
  3835. (*nn)->U.Normal.Value = NewValue(NULL,
  3836. Builtin_Type_Integer);
  3837. intx_setuint32(
  3838. &(*nn)->U.Normal.Value->U.Integer.Value,
  3839. num++);
  3840. break;
  3841. case eNamedNumber_ExtensionMarker:
  3842. break;
  3843. }
  3844. nn = &(*nn)->Next;
  3845. }
  3846. *nn = NULL;
  3847. }}}}}
  3848. LLDEBUG_LEAVE("EnumeratedType", 1);
  3849. return 1;
  3850. failed1: LLDEBUG_LEAVE("EnumeratedType", 0);
  3851. return 0;
  3852. }
  3853. int ll_Enumerations(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout)
  3854. {
  3855. unsigned llstp = llcstp;
  3856. LLSTATE llstate_0;
  3857. LLDEBUG_ENTER("Enumerations");
  3858. llstate_0 = *llin;
  3859. #undef failed
  3860. #define failed failed1
  3861. {LLSTATE llstate_1;XNamedNumbers llatt_1;
  3862. if (!ll_Enumeration(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  3863. {LLSTATE llstate_2;XNamedNumbers llatt_2;
  3864. if (!ll_EnumerationExtension(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  3865. *llout = llstate_2;
  3866. {NamedNumber_t **nn, *n;
  3867. nn = &(*llret);
  3868. for (n = llatt_1; n; n = n->Next) {
  3869. *nn = DupNamedNumber(n);
  3870. nn = &(*nn)->Next;
  3871. }
  3872. *nn = llatt_2;
  3873. }}}
  3874. LLDEBUG_LEAVE("Enumerations", 1);
  3875. return 1;
  3876. failed1: LLDEBUG_LEAVE("Enumerations", 0);
  3877. return 0;
  3878. }
  3879. int ll_EnumerationExtension(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout)
  3880. {
  3881. unsigned llstp = llcstp;
  3882. LLSTATE llstate_0;
  3883. LLDEBUG_ENTER("EnumerationExtension");
  3884. llstate_0 = *llin;
  3885. #undef failed
  3886. #define failed failed1
  3887. #undef failed
  3888. #define failed failed2
  3889. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3890. LLCHECKSTK;
  3891. for (;;) {
  3892. switch (llstk[llcstp++]) {
  3893. case 1: case -1:
  3894. LLDEBUG_ALTERNATIVE("EnumerationExtension", 1);
  3895. {LLSTATE llstate_1;
  3896. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  3897. {LLSTATE llstate_2;
  3898. if (!llterm(T_TDOT, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  3899. {LLSTATE llstate_3;
  3900. if (!llterm(',', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  3901. {LLSTATE llstate_4;XNamedNumbers llatt_4;
  3902. if (!ll_Enumeration(&llatt_4, &llstate_3, &llstate_4)) goto failed2;
  3903. *llout = llstate_4;
  3904. {(*llret) = NewNamedNumber(eNamedNumber_ExtensionMarker);
  3905. (*llret)->Next = llatt_4;
  3906. break;
  3907. }}}}}
  3908. case 2: case -2:
  3909. LLDEBUG_ALTERNATIVE("EnumerationExtension", 2);
  3910. {LLSTATE llstate_1;
  3911. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  3912. {LLSTATE llstate_2;
  3913. if (!llterm(T_TDOT, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  3914. *llout = llstate_2;
  3915. {(*llret) = NewNamedNumber(eNamedNumber_ExtensionMarker);
  3916. break;
  3917. }}}
  3918. case 3: case -3:
  3919. LLDEBUG_ALTERNATIVE("EnumerationExtension", 3);
  3920. *llout = llstate_0;
  3921. {(*llret) = NULL;
  3922. break;
  3923. }
  3924. default:
  3925. llstk[--llcstp] = 1;
  3926. goto failed1;
  3927. failed2:
  3928. LLDEBUG_BACKTRACKING("EnumerationExtension");
  3929. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3930. llcpos = llpos1; llcstp = llstp1;
  3931. continue;
  3932. } break;
  3933. }}
  3934. LLDEBUG_LEAVE("EnumerationExtension", 1);
  3935. return 1;
  3936. failed1: LLDEBUG_LEAVE("EnumerationExtension", 0);
  3937. return 0;
  3938. }
  3939. int ll_Enumeration(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout)
  3940. {
  3941. unsigned llstp = llcstp;
  3942. LLSTATE llstate_0;
  3943. LLDEBUG_ENTER("Enumeration");
  3944. llstate_0 = *llin;
  3945. #undef failed
  3946. #define failed failed1
  3947. #undef failed
  3948. #define failed failed2
  3949. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  3950. LLCHECKSTK;
  3951. for (;;) {
  3952. switch (llstk[llcstp++]) {
  3953. case 1: case -1:
  3954. LLDEBUG_ALTERNATIVE("Enumeration", 1);
  3955. {LLSTATE llstate_1;XNamedNumbers llatt_1;
  3956. if (!ll_EnumerationItem(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3957. {LLSTATE llstate_2;
  3958. if (!llterm(',', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  3959. {LLSTATE llstate_3;XNamedNumbers llatt_3;
  3960. if (!ll_Enumeration(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  3961. *llout = llstate_3;
  3962. {(*llret) = DupNamedNumber(llatt_1);
  3963. (*llret)->Next = llatt_3;
  3964. break;
  3965. }}}}
  3966. case 2: case -2:
  3967. LLDEBUG_ALTERNATIVE("Enumeration", 2);
  3968. {LLSTATE llstate_1;XNamedNumbers llatt_1;
  3969. if (!ll_EnumerationItem(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  3970. *llout = llstate_1;
  3971. {(*llret) = llatt_1;
  3972. break;
  3973. }}
  3974. default:
  3975. llstk[--llcstp] = 1;
  3976. goto failed1;
  3977. failed2:
  3978. LLDEBUG_BACKTRACKING("Enumeration");
  3979. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  3980. llcpos = llpos1; llcstp = llstp1;
  3981. continue;
  3982. } break;
  3983. }}
  3984. LLDEBUG_LEAVE("Enumeration", 1);
  3985. return 1;
  3986. failed1: LLDEBUG_LEAVE("Enumeration", 0);
  3987. return 0;
  3988. }
  3989. int ll_EnumerationItem(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout)
  3990. {
  3991. unsigned llstp = llcstp;
  3992. LLSTATE llstate_0;
  3993. LLDEBUG_ENTER("EnumerationItem");
  3994. llstate_0 = *llin;
  3995. #undef failed
  3996. #define failed failed1
  3997. #undef failed
  3998. #define failed failed2
  3999. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4000. LLCHECKSTK;
  4001. for (;;) {
  4002. switch (llstk[llcstp++]) {
  4003. case 1: case -1:
  4004. LLDEBUG_ALTERNATIVE("EnumerationItem", 1);
  4005. {LLSTATE llstate_1;XString llatt_1;
  4006. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  4007. *llout = llstate_1;
  4008. {(*llret) = NewNamedNumber(eNamedNumber_Normal);
  4009. (*llret)->U.Normal.Identifier = llatt_1;
  4010. break;
  4011. }}
  4012. case 2: case -2:
  4013. LLDEBUG_ALTERNATIVE("EnumerationItem", 2);
  4014. {LLSTATE llstate_1;XNamedNumbers llatt_1;
  4015. if (!ll_NamedNumber(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  4016. *llout = llstate_1;
  4017. {(*llret) = llatt_1;
  4018. break;
  4019. }}
  4020. default:
  4021. llstk[--llcstp] = 1;
  4022. goto failed1;
  4023. failed2:
  4024. LLDEBUG_BACKTRACKING("EnumerationItem");
  4025. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4026. llcpos = llpos1; llcstp = llstp1;
  4027. continue;
  4028. } break;
  4029. }}
  4030. LLDEBUG_LEAVE("EnumerationItem", 1);
  4031. return 1;
  4032. failed1: LLDEBUG_LEAVE("EnumerationItem", 0);
  4033. return 0;
  4034. }
  4035. int ll_RealType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4036. {
  4037. unsigned llstp = llcstp;
  4038. LLSTATE llstate_0;
  4039. LLDEBUG_ENTER("RealType");
  4040. llstate_0 = *llin;
  4041. #undef failed
  4042. #define failed failed1
  4043. {LLSTATE llstate_1;
  4044. if (!llterm(T_REAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  4045. *llout = llstate_1;
  4046. {(*llret) = Builtin_Type_Real;
  4047. }}
  4048. LLDEBUG_LEAVE("RealType", 1);
  4049. return 1;
  4050. failed1: LLDEBUG_LEAVE("RealType", 0);
  4051. return 0;
  4052. }
  4053. int ll_BitStringType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4054. {
  4055. unsigned llstp = llcstp;
  4056. LLSTATE llstate_0;
  4057. LLDEBUG_ENTER("BitStringType");
  4058. llstate_0 = *llin;
  4059. #undef failed
  4060. #define failed failed1
  4061. #undef failed
  4062. #define failed failed2
  4063. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4064. LLCHECKSTK;
  4065. for (;;) {
  4066. switch (llstk[llcstp++]) {
  4067. case 1: case -1:
  4068. LLDEBUG_ALTERNATIVE("BitStringType", 1);
  4069. {LLSTATE llstate_1;
  4070. if (!llterm(T_BIT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4071. {LLSTATE llstate_2;
  4072. if (!llterm(T_STRING, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4073. {LLSTATE llstate_3;
  4074. if (!llterm('{', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  4075. {LLSTATE llstate_4;XNamedNumbers llatt_4;
  4076. if (!ll_NamedBitList(&llatt_4, &llstate_3, &llstate_4)) goto failed2;
  4077. {LLSTATE llstate_5;
  4078. if (!llterm('}', (LLSTYPE *)0, &llstate_4, &llstate_5)) goto failed2;
  4079. *llout = llstate_5;
  4080. {NamedNumber_t *n, *m;
  4081. (*llret) = NewType(eType_BitString);
  4082. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  4083. (*llret)->U.BitString.NamedNumbers = llatt_4;
  4084. for (n = llatt_4; n; n = n->Next)
  4085. KeepEnumNames(n->U.Normal.Identifier); // global conflict check
  4086. for (n = llatt_4; n && n->Next; n = n->Next) {
  4087. for (m = n->Next; m; m = m->Next) {
  4088. if (!strcmp(n->U.Normal.Identifier,
  4089. m->U.Normal.Identifier))
  4090. LLFAILED((&llstate_4.pos,
  4091. "identifier `%s' has been assigned twice",
  4092. n->U.Normal.Identifier));
  4093. if (GetValue((*llout).Assignments, n->U.Normal.Value) &&
  4094. GetValue((*llout).Assignments, m->U.Normal.Value) &&
  4095. GetTypeType((*llout).Assignments,
  4096. GetValue((*llout).Assignments, n->U.Normal.Value)->Type)
  4097. == eType_Integer &&
  4098. GetTypeType((*llout).Assignments,
  4099. GetValue((*llout).Assignments, m->U.Normal.Value)->Type)
  4100. == eType_Integer &&
  4101. !intx_cmp(&GetValue((*llout).Assignments,
  4102. n->U.Normal.Value)->U.Integer.Value,
  4103. &GetValue((*llout).Assignments,
  4104. m->U.Normal.Value)->U.Integer.Value))
  4105. LLFAILED((&llstate_4.pos,
  4106. "value `%u' has been assigned twice",
  4107. intx2uint32(&GetValue((*llout).Assignments,
  4108. n->U.Normal.Value)->U.Integer.Value)));
  4109. }
  4110. }
  4111. break;
  4112. }}}}}}
  4113. case 2: case -2:
  4114. LLDEBUG_ALTERNATIVE("BitStringType", 2);
  4115. {LLSTATE llstate_1;
  4116. if (!llterm(T_BIT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4117. {LLSTATE llstate_2;
  4118. if (!llterm(T_STRING, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4119. *llout = llstate_2;
  4120. {(*llret) = NewType(eType_BitString);
  4121. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  4122. break;
  4123. }}}
  4124. default:
  4125. llstk[--llcstp] = 1;
  4126. goto failed1;
  4127. failed2:
  4128. LLDEBUG_BACKTRACKING("BitStringType");
  4129. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4130. llcpos = llpos1; llcstp = llstp1;
  4131. continue;
  4132. } break;
  4133. }}
  4134. LLDEBUG_LEAVE("BitStringType", 1);
  4135. return 1;
  4136. failed1: LLDEBUG_LEAVE("BitStringType", 0);
  4137. return 0;
  4138. }
  4139. int ll_NamedBitList(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout)
  4140. {
  4141. unsigned llstp = llcstp;
  4142. LLSTATE llstate_0;
  4143. LLDEBUG_ENTER("NamedBitList");
  4144. llstate_0 = *llin;
  4145. #undef failed
  4146. #define failed failed1
  4147. #undef failed
  4148. #define failed failed2
  4149. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4150. LLCHECKSTK;
  4151. for (;;) {
  4152. switch (llstk[llcstp++]) {
  4153. case 1: case -1:
  4154. LLDEBUG_ALTERNATIVE("NamedBitList", 1);
  4155. {LLSTATE llstate_1;XNamedNumbers llatt_1;
  4156. if (!ll_NamedBit(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  4157. {LLSTATE llstate_2;
  4158. if (!llterm(',', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4159. {LLSTATE llstate_3;XNamedNumbers llatt_3;
  4160. if (!ll_NamedBitList(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  4161. *llout = llstate_3;
  4162. {(*llret) = DupNamedNumber(llatt_1);
  4163. (*llret)->Next = llatt_3;
  4164. break;
  4165. }}}}
  4166. case 2: case -2:
  4167. LLDEBUG_ALTERNATIVE("NamedBitList", 2);
  4168. {LLSTATE llstate_1;XNamedNumbers llatt_1;
  4169. if (!ll_NamedBit(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  4170. *llout = llstate_1;
  4171. {(*llret) = llatt_1;
  4172. break;
  4173. }}
  4174. default:
  4175. llstk[--llcstp] = 1;
  4176. goto failed1;
  4177. failed2:
  4178. LLDEBUG_BACKTRACKING("NamedBitList");
  4179. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4180. llcpos = llpos1; llcstp = llstp1;
  4181. continue;
  4182. } break;
  4183. }}
  4184. LLDEBUG_LEAVE("NamedBitList", 1);
  4185. return 1;
  4186. failed1: LLDEBUG_LEAVE("NamedBitList", 0);
  4187. return 0;
  4188. }
  4189. int ll_NamedBit(XNamedNumbers *llret, LLSTATE *llin, LLSTATE *llout)
  4190. {
  4191. unsigned llstp = llcstp;
  4192. LLSTATE llstate_0;
  4193. LLDEBUG_ENTER("NamedBit");
  4194. llstate_0 = *llin;
  4195. #undef failed
  4196. #define failed failed1
  4197. #undef failed
  4198. #define failed failed2
  4199. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4200. LLCHECKSTK;
  4201. for (;;) {
  4202. switch (llstk[llcstp++]) {
  4203. case 1: case -1:
  4204. LLDEBUG_ALTERNATIVE("NamedBit", 1);
  4205. {LLSTATE llstate_1;XString llatt_1;
  4206. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  4207. {LLSTATE llstate_2;
  4208. if (!llterm('(', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4209. {LLSTATE llstate_3;XNumber llatt_3;
  4210. if (!llterm(T_number, &lllval, &llstate_2, &llstate_3)) goto failed2;
  4211. llatt_3 = lllval._XNumber;
  4212. {LLSTATE llstate_4;
  4213. if (!llterm(')', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed2;
  4214. *llout = llstate_4;
  4215. {(*llret) = NewNamedNumber(eNamedNumber_Normal);
  4216. (*llret)->U.Normal.Identifier = llatt_1;
  4217. (*llret)->U.Normal.Value = NewValue(NULL, Builtin_Type_Integer);
  4218. (*llret)->U.Normal.Value->U.Integer.Value = llatt_3;
  4219. break;
  4220. }}}}}
  4221. case 2: case -2:
  4222. LLDEBUG_ALTERNATIVE("NamedBit", 2);
  4223. {LLSTATE llstate_1;XString llatt_1;
  4224. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  4225. {LLSTATE llstate_2;
  4226. if (!llterm('(', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4227. {LLSTATE llstate_3;XValue llatt_3;
  4228. if (!ll_DefinedValue(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  4229. {LLSTATE llstate_4;
  4230. if (!llterm(')', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed2;
  4231. *llout = llstate_4;
  4232. {Value_t *v;
  4233. v = GetValue((*llout).Assignments, llatt_3);
  4234. if (v) {
  4235. if (GetTypeType((*llout).Assignments, v->Type) != eType_Undefined &&
  4236. GetTypeType((*llout).Assignments, v->Type) != eType_Integer)
  4237. LLFAILED((&llstate_3.pos, "Bad type of value"));
  4238. if (GetTypeType((*llout).Assignments, v->Type) == eType_Integer &&
  4239. intx_cmp(&v->U.Integer.Value, &intx_0) < 0)
  4240. LLFAILED((&llstate_3.pos, "Bad value"));
  4241. }
  4242. (*llret) = NewNamedNumber(eNamedNumber_Normal);
  4243. (*llret)->U.Normal.Identifier = llatt_1;
  4244. (*llret)->U.Normal.Value = llatt_3;
  4245. break;
  4246. }}}}}
  4247. default:
  4248. llstk[--llcstp] = 1;
  4249. goto failed1;
  4250. failed2:
  4251. LLDEBUG_BACKTRACKING("NamedBit");
  4252. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4253. llcpos = llpos1; llcstp = llstp1;
  4254. continue;
  4255. } break;
  4256. }}
  4257. LLDEBUG_LEAVE("NamedBit", 1);
  4258. return 1;
  4259. failed1: LLDEBUG_LEAVE("NamedBit", 0);
  4260. return 0;
  4261. }
  4262. int ll_OctetStringType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4263. {
  4264. unsigned llstp = llcstp;
  4265. LLSTATE llstate_0;
  4266. LLDEBUG_ENTER("OctetStringType");
  4267. llstate_0 = *llin;
  4268. #undef failed
  4269. #define failed failed1
  4270. {LLSTATE llstate_1;
  4271. if (!llterm(T_OCTET, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  4272. {LLSTATE llstate_2;
  4273. if (!llterm(T_STRING, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  4274. *llout = llstate_2;
  4275. {(*llret) = Builtin_Type_OctetString;
  4276. }}}
  4277. LLDEBUG_LEAVE("OctetStringType", 1);
  4278. return 1;
  4279. failed1: LLDEBUG_LEAVE("OctetStringType", 0);
  4280. return 0;
  4281. }
  4282. int ll_UTF8StringType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4283. {
  4284. unsigned llstp = llcstp;
  4285. LLSTATE llstate_0;
  4286. LLDEBUG_ENTER("UTF8StringType");
  4287. llstate_0 = *llin;
  4288. #undef failed
  4289. #define failed failed1
  4290. {LLSTATE llstate_1;
  4291. if (!llterm(T_UTF8String, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  4292. *llout = llstate_1;
  4293. {(*llret) = Builtin_Type_UTF8String;
  4294. }}
  4295. LLDEBUG_LEAVE("UTF8StringType", 1);
  4296. return 1;
  4297. failed1: LLDEBUG_LEAVE("UTF8StringType", 0);
  4298. return 0;
  4299. }
  4300. int ll_NullType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4301. {
  4302. unsigned llstp = llcstp;
  4303. LLSTATE llstate_0;
  4304. LLDEBUG_ENTER("NullType");
  4305. llstate_0 = *llin;
  4306. #undef failed
  4307. #define failed failed1
  4308. {LLSTATE llstate_1;
  4309. if (!llterm(T_NULL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  4310. *llout = llstate_1;
  4311. {(*llret) = Builtin_Type_Null;
  4312. }}
  4313. LLDEBUG_LEAVE("NullType", 1);
  4314. return 1;
  4315. failed1: LLDEBUG_LEAVE("NullType", 0);
  4316. return 0;
  4317. }
  4318. int ll_SequenceType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4319. {
  4320. unsigned llstp = llcstp;
  4321. LLSTATE llstate_0;
  4322. LLDEBUG_ENTER("SequenceType");
  4323. llstate_0 = *llin;
  4324. #undef failed
  4325. #define failed failed1
  4326. #undef failed
  4327. #define failed failed2
  4328. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4329. LLCHECKSTK;
  4330. for (;;) {
  4331. switch (llstk[llcstp++]) {
  4332. case 1: case -1:
  4333. LLDEBUG_ALTERNATIVE("SequenceType", 1);
  4334. {LLSTATE llstate_1;
  4335. if (!llterm(T_SEQUENCE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4336. {LLSTATE llstate_2;
  4337. if (!llterm('{', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4338. {LLSTATE llstate_3;XComponents llatt_3;
  4339. if (!ll_ExtendedComponentTypeList(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  4340. {LLSTATE llstate_4;
  4341. if (!llterm('}', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed2;
  4342. *llout = llstate_4;
  4343. {Component_t *c, *d; int fExtended = 0;
  4344. for (c = llatt_3; c; c = c->Next)
  4345. if (c->Type == eComponent_Optional || c->Type == eComponent_Default || fExtended)
  4346. KeepOptNames(c->U.NOD.NamedType->Identifier); // global conflict check
  4347. else
  4348. if (c->Type == eComponent_ExtensionMarker)
  4349. fExtended = 1;
  4350. for (c = llatt_3; c && c->Next; c = c->Next) {
  4351. if (c->Type != eComponent_Normal &&
  4352. c->Type != eComponent_Optional &&
  4353. c->Type != eComponent_Default)
  4354. continue;
  4355. for (d = c->Next; d; d = d->Next) {
  4356. if (d->Type != eComponent_Normal &&
  4357. d->Type != eComponent_Optional &&
  4358. d->Type != eComponent_Default)
  4359. continue;
  4360. if (!strcmp(c->U.NOD.NamedType->Identifier,
  4361. d->U.NOD.NamedType->Identifier))
  4362. LLFAILED((&llstate_3.pos, "Component `%s' has been used twice",
  4363. c->U.NOD.NamedType->Identifier));
  4364. }
  4365. }
  4366. (*llret) = NewType(eType_Sequence);
  4367. (*llret)->TagDefault = (*llout).TagDefault;
  4368. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  4369. (*llret)->U.Sequence.Components = llatt_3;
  4370. break;
  4371. }}}}}
  4372. case 2: case -2:
  4373. LLDEBUG_ALTERNATIVE("SequenceType", 2);
  4374. {LLSTATE llstate_1;
  4375. if (!llterm(T_SEQUENCE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4376. {LLSTATE llstate_2;
  4377. if (!llterm('{', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4378. {LLSTATE llstate_3;
  4379. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  4380. *llout = llstate_3;
  4381. {(*llret) = NewType(eType_Sequence);
  4382. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  4383. break;
  4384. }}}}
  4385. default:
  4386. llstk[--llcstp] = 1;
  4387. goto failed1;
  4388. failed2:
  4389. LLDEBUG_BACKTRACKING("SequenceType");
  4390. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4391. llcpos = llpos1; llcstp = llstp1;
  4392. continue;
  4393. } break;
  4394. }}
  4395. LLDEBUG_LEAVE("SequenceType", 1);
  4396. return 1;
  4397. failed1: LLDEBUG_LEAVE("SequenceType", 0);
  4398. return 0;
  4399. }
  4400. int ll_ExtensionAndException(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  4401. {
  4402. unsigned llstp = llcstp;
  4403. LLSTATE llstate_0;
  4404. LLDEBUG_ENTER("ExtensionAndException");
  4405. llstate_0 = *llin;
  4406. #undef failed
  4407. #define failed failed1
  4408. #undef failed
  4409. #define failed failed2
  4410. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4411. LLCHECKSTK;
  4412. for (;;) {
  4413. switch (llstk[llcstp++]) {
  4414. case 1: case -1:
  4415. LLDEBUG_ALTERNATIVE("ExtensionAndException", 1);
  4416. {LLSTATE llstate_1;
  4417. if (!llterm(T_TDOT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4418. {LLSTATE llstate_2;
  4419. if (!ll_ExceptionSpec(&llstate_1, &llstate_2)) goto failed2;
  4420. *llout = llstate_2;
  4421. {(*llret) = NewComponent(eComponent_ExtensionMarker);
  4422. /*(*llret)->U.ExtensionMarker.ExceptionSpec = llatt_2;*/
  4423. break;
  4424. }}}
  4425. case 2: case -2:
  4426. LLDEBUG_ALTERNATIVE("ExtensionAndException", 2);
  4427. {LLSTATE llstate_1;
  4428. if (!llterm(T_TDOT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4429. *llout = llstate_1;
  4430. {(*llret) = NewComponent(eComponent_ExtensionMarker);
  4431. break;
  4432. }}
  4433. default:
  4434. llstk[--llcstp] = 1;
  4435. goto failed1;
  4436. failed2:
  4437. LLDEBUG_BACKTRACKING("ExtensionAndException");
  4438. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4439. llcpos = llpos1; llcstp = llstp1;
  4440. continue;
  4441. } break;
  4442. }}
  4443. LLDEBUG_LEAVE("ExtensionAndException", 1);
  4444. return 1;
  4445. failed1: LLDEBUG_LEAVE("ExtensionAndException", 0);
  4446. return 0;
  4447. }
  4448. int ll_ExtendedComponentTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  4449. {
  4450. unsigned llstp = llcstp;
  4451. LLSTATE llstate_0;
  4452. LLDEBUG_ENTER("ExtendedComponentTypeList");
  4453. llstate_0 = *llin;
  4454. #undef failed
  4455. #define failed failed1
  4456. #undef failed
  4457. #define failed failed2
  4458. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4459. LLCHECKSTK;
  4460. for (;;) {
  4461. switch (llstk[llcstp++]) {
  4462. case 1: case -1:
  4463. LLDEBUG_ALTERNATIVE("ExtendedComponentTypeList", 1);
  4464. {LLSTATE llstate_1;XComponents llatt_1;
  4465. if (!ll_ComponentTypeList(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  4466. {LLSTATE llstate_2;XComponents llatt_2;
  4467. if (!ll_ComponentTypeListExtension(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  4468. *llout = llstate_2;
  4469. {Component_t **cc, *c;
  4470. if (llatt_2) {
  4471. cc = &(*llret);
  4472. for (c = llatt_1; c; c = c->Next) {
  4473. *cc = DupComponent(c);
  4474. cc = &(*cc)->Next;
  4475. }
  4476. *cc = llatt_2;
  4477. } else {
  4478. (*llret) = llatt_1;
  4479. }
  4480. break;
  4481. }}}
  4482. case 2: case -2:
  4483. LLDEBUG_ALTERNATIVE("ExtendedComponentTypeList", 2);
  4484. {LLSTATE llstate_1;XComponents llatt_1;
  4485. if (!ll_ExtensionAndException(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  4486. {LLSTATE llstate_2;XComponents llatt_2;
  4487. if (!ll_AdditionalComponentTypeList(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  4488. *llout = llstate_2;
  4489. {Component_t **cc, *c;
  4490. if (llatt_2) {
  4491. cc = &(*llret);
  4492. for (c = llatt_1; c; c = c->Next) {
  4493. *cc = DupComponent(c);
  4494. cc = &(*cc)->Next;
  4495. }
  4496. *cc = llatt_2;
  4497. } else {
  4498. (*llret) = llatt_1;
  4499. }
  4500. break;
  4501. }}}
  4502. default:
  4503. llstk[--llcstp] = 1;
  4504. goto failed1;
  4505. failed2:
  4506. LLDEBUG_BACKTRACKING("ExtendedComponentTypeList");
  4507. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4508. llcpos = llpos1; llcstp = llstp1;
  4509. continue;
  4510. } break;
  4511. }}
  4512. LLDEBUG_LEAVE("ExtendedComponentTypeList", 1);
  4513. return 1;
  4514. failed1: LLDEBUG_LEAVE("ExtendedComponentTypeList", 0);
  4515. return 0;
  4516. }
  4517. int ll_ComponentTypeListExtension(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  4518. {
  4519. unsigned llstp = llcstp;
  4520. LLSTATE llstate_0;
  4521. LLDEBUG_ENTER("ComponentTypeListExtension");
  4522. llstate_0 = *llin;
  4523. #undef failed
  4524. #define failed failed1
  4525. #undef failed
  4526. #define failed failed2
  4527. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4528. LLCHECKSTK;
  4529. for (;;) {
  4530. switch (llstk[llcstp++]) {
  4531. case 1: case -1:
  4532. LLDEBUG_ALTERNATIVE("ComponentTypeListExtension", 1);
  4533. {LLSTATE llstate_1;
  4534. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4535. {LLSTATE llstate_2;XComponents llatt_2;
  4536. if (!ll_ExtensionAndException(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  4537. {LLSTATE llstate_3;XComponents llatt_3;
  4538. if (!ll_AdditionalComponentTypeList(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  4539. *llout = llstate_3;
  4540. {Component_t **cc, *c;
  4541. if (llatt_3) {
  4542. cc = &(*llret);
  4543. for (c = llatt_2; c; c = c->Next) {
  4544. *cc = DupComponent(c);
  4545. cc = &(*cc)->Next;
  4546. }
  4547. *cc = llatt_3;
  4548. } else {
  4549. (*llret) = llatt_2;
  4550. }
  4551. break;
  4552. }}}}
  4553. case 2: case -2:
  4554. LLDEBUG_ALTERNATIVE("ComponentTypeListExtension", 2);
  4555. *llout = llstate_0;
  4556. {(*llret) = NULL;
  4557. break;
  4558. }
  4559. default:
  4560. llstk[--llcstp] = 1;
  4561. goto failed1;
  4562. failed2:
  4563. LLDEBUG_BACKTRACKING("ComponentTypeListExtension");
  4564. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4565. llcpos = llpos1; llcstp = llstp1;
  4566. continue;
  4567. } break;
  4568. }}
  4569. LLDEBUG_LEAVE("ComponentTypeListExtension", 1);
  4570. return 1;
  4571. failed1: LLDEBUG_LEAVE("ComponentTypeListExtension", 0);
  4572. return 0;
  4573. }
  4574. int ll_AdditionalComponentTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  4575. {
  4576. unsigned llstp = llcstp;
  4577. LLSTATE llstate_0;
  4578. LLDEBUG_ENTER("AdditionalComponentTypeList");
  4579. llstate_0 = *llin;
  4580. #undef failed
  4581. #define failed failed1
  4582. #undef failed
  4583. #define failed failed2
  4584. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4585. LLCHECKSTK;
  4586. for (;;) {
  4587. switch (llstk[llcstp++]) {
  4588. case 1: case -1:
  4589. LLDEBUG_ALTERNATIVE("AdditionalComponentTypeList", 1);
  4590. {LLSTATE llstate_1;
  4591. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4592. {LLSTATE llstate_2;XComponents llatt_2;
  4593. if (!ll_ComponentTypeList(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  4594. *llout = llstate_2;
  4595. {(*llret) = llatt_2;
  4596. break;
  4597. }}}
  4598. case 2: case -2:
  4599. LLDEBUG_ALTERNATIVE("AdditionalComponentTypeList", 2);
  4600. *llout = llstate_0;
  4601. {(*llret) = NULL;
  4602. break;
  4603. }
  4604. default:
  4605. llstk[--llcstp] = 1;
  4606. goto failed1;
  4607. failed2:
  4608. LLDEBUG_BACKTRACKING("AdditionalComponentTypeList");
  4609. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4610. llcpos = llpos1; llcstp = llstp1;
  4611. continue;
  4612. } break;
  4613. }}
  4614. LLDEBUG_LEAVE("AdditionalComponentTypeList", 1);
  4615. return 1;
  4616. failed1: LLDEBUG_LEAVE("AdditionalComponentTypeList", 0);
  4617. return 0;
  4618. }
  4619. int ll_ComponentTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  4620. {
  4621. unsigned llstp = llcstp;
  4622. LLSTATE llstate_0;
  4623. LLDEBUG_ENTER("ComponentTypeList");
  4624. llstate_0 = *llin;
  4625. #undef failed
  4626. #define failed failed1
  4627. {LLSTATE llstate_1;XComponents llatt_1;
  4628. if (!ll_ComponentType(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  4629. {LLSTATE llstate_2;XComponents llatt_2;
  4630. if (!ll_AdditionalComponentTypeList(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  4631. *llout = llstate_2;
  4632. {if (llatt_2) {
  4633. (*llret) = DupComponent(llatt_1);
  4634. (*llret)->Next = llatt_2;
  4635. } else {
  4636. (*llret) = llatt_1;
  4637. }
  4638. }}}
  4639. LLDEBUG_LEAVE("ComponentTypeList", 1);
  4640. return 1;
  4641. failed1: LLDEBUG_LEAVE("ComponentTypeList", 0);
  4642. return 0;
  4643. }
  4644. int ll_ComponentType(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  4645. {
  4646. unsigned llstp = llcstp;
  4647. LLSTATE llstate_0;
  4648. LLDEBUG_ENTER("ComponentType");
  4649. llstate_0 = *llin;
  4650. #undef failed
  4651. #define failed failed1
  4652. #undef failed
  4653. #define failed failed2
  4654. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4655. LLCHECKSTK;
  4656. for (;;) {
  4657. switch (llstk[llcstp++]) {
  4658. case 1: case -1:
  4659. LLDEBUG_ALTERNATIVE("ComponentType", 1);
  4660. {LLSTATE llstate_1;XNamedType llatt_1;
  4661. if (!ll_NamedType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  4662. {LLSTATE llstate_2;XComponents llatt_2;
  4663. if (!ll_ComponentTypePostfix(&llatt_2, &llstate_1, &llstate_2, llatt_1->Type)) goto failed2;
  4664. *llout = llstate_2;
  4665. {(*llret) = DupComponent(llatt_2);
  4666. (*llret)->U.NOD.NamedType = llatt_1;
  4667. break;
  4668. }}}
  4669. case 2: case -2:
  4670. LLDEBUG_ALTERNATIVE("ComponentType", 2);
  4671. {LLSTATE llstate_1;
  4672. if (!llterm(T_COMPONENTS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4673. {LLSTATE llstate_2;
  4674. if (!llterm(T_OF, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4675. {LLSTATE llstate_3;XType llatt_3;
  4676. if (!ll_Type(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  4677. *llout = llstate_3;
  4678. {(*llret) = NewComponent(eComponent_ComponentsOf);
  4679. (*llret)->U.ComponentsOf.Type = llatt_3;
  4680. break;
  4681. }}}}
  4682. default:
  4683. llstk[--llcstp] = 1;
  4684. goto failed1;
  4685. failed2:
  4686. LLDEBUG_BACKTRACKING("ComponentType");
  4687. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4688. llcpos = llpos1; llcstp = llstp1;
  4689. continue;
  4690. } break;
  4691. }}
  4692. LLDEBUG_LEAVE("ComponentType", 1);
  4693. return 1;
  4694. failed1: LLDEBUG_LEAVE("ComponentType", 0);
  4695. return 0;
  4696. }
  4697. int ll_ComponentTypePostfix(XComponents *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  4698. {
  4699. unsigned llstp = llcstp;
  4700. LLSTATE llstate_0;
  4701. LLDEBUG_ENTER("ComponentTypePostfix");
  4702. llstate_0 = *llin;
  4703. #undef failed
  4704. #define failed failed1
  4705. #undef failed
  4706. #define failed failed2
  4707. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4708. LLCHECKSTK;
  4709. for (;;) {
  4710. switch (llstk[llcstp++]) {
  4711. case 1: case -1:
  4712. LLDEBUG_ALTERNATIVE("ComponentTypePostfix", 1);
  4713. {LLSTATE llstate_1;
  4714. if (!llterm(T_OPTIONAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4715. *llout = llstate_1;
  4716. {(*llret) = NewComponent(eComponent_Optional);
  4717. break;
  4718. }}
  4719. case 2: case -2:
  4720. LLDEBUG_ALTERNATIVE("ComponentTypePostfix", 2);
  4721. {LLSTATE llstate_1;
  4722. if (!llterm(T_DEFAULT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4723. {LLSTATE llstate_2;XValue llatt_2;
  4724. if (!ll_Value(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed2;
  4725. *llout = llstate_2;
  4726. {(*llret) = NewComponent(eComponent_Default);
  4727. (*llret)->U.Default.Value = llatt_2;
  4728. break;
  4729. }}}
  4730. case 3: case -3:
  4731. LLDEBUG_ALTERNATIVE("ComponentTypePostfix", 3);
  4732. *llout = llstate_0;
  4733. {(*llret) = NewComponent(eComponent_Normal);
  4734. break;
  4735. }
  4736. default:
  4737. llstk[--llcstp] = 1;
  4738. goto failed1;
  4739. failed2:
  4740. LLDEBUG_BACKTRACKING("ComponentTypePostfix");
  4741. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4742. llcpos = llpos1; llcstp = llstp1;
  4743. continue;
  4744. } break;
  4745. }}
  4746. LLDEBUG_LEAVE("ComponentTypePostfix", 1);
  4747. return 1;
  4748. failed1: LLDEBUG_LEAVE("ComponentTypePostfix", 0);
  4749. return 0;
  4750. }
  4751. int ll_SequenceOfType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4752. {
  4753. unsigned llstp = llcstp;
  4754. LLSTATE llstate_0;
  4755. LLDEBUG_ENTER("SequenceOfType");
  4756. llstate_0 = *llin;
  4757. #undef failed
  4758. #define failed failed1
  4759. {LLSTATE llstate_1;
  4760. if (!llterm(T_SEQUENCE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  4761. {LLSTATE llstate_2;XDirectives llatt_2;
  4762. if (!ll_LocalSizeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  4763. {LLSTATE llstate_3;XPrivateDirectives llatt_3;
  4764. if (!ll_PrivateDirectives(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  4765. {LLSTATE llstate_4;
  4766. if (!llterm(T_OF, (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed1;
  4767. {LLSTATE llstate_5;XType llatt_5;
  4768. if (!ll_Type(&llatt_5, &llstate_4, &llstate_5)) goto failed1;
  4769. *llout = llstate_5;
  4770. {(*llret) = NewType(eType_SequenceOf);
  4771. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  4772. (*llret)->U.SequenceOf.Type = llatt_5;
  4773. (*llret)->U.SequenceOf.Directives = llatt_2;
  4774. if (llatt_3)
  4775. {
  4776. PropagatePrivateDirectives((*llret), llatt_3);
  4777. }
  4778. if ((*llret)->PrivateDirectives.pszTypeName &&
  4779. strncmp("PSetOf", (*llret)->PrivateDirectives.pszTypeName, 6) == 0)
  4780. {
  4781. (*llret)->PrivateDirectives.pszTypeName++;
  4782. }
  4783. }}}}}}
  4784. LLDEBUG_LEAVE("SequenceOfType", 1);
  4785. return 1;
  4786. failed1: LLDEBUG_LEAVE("SequenceOfType", 0);
  4787. return 0;
  4788. }
  4789. int ll_SetType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4790. {
  4791. unsigned llstp = llcstp;
  4792. LLSTATE llstate_0;
  4793. LLDEBUG_ENTER("SetType");
  4794. llstate_0 = *llin;
  4795. #undef failed
  4796. #define failed failed1
  4797. #undef failed
  4798. #define failed failed2
  4799. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4800. LLCHECKSTK;
  4801. for (;;) {
  4802. switch (llstk[llcstp++]) {
  4803. case 1: case -1:
  4804. LLDEBUG_ALTERNATIVE("SetType", 1);
  4805. {LLSTATE llstate_1;
  4806. if (!llterm(T_SET, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4807. {LLSTATE llstate_2;
  4808. if (!llterm('{', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4809. {LLSTATE llstate_3;XComponents llatt_3;
  4810. if (!ll_ExtendedComponentTypeList(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  4811. {LLSTATE llstate_4;
  4812. if (!llterm('}', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed2;
  4813. *llout = llstate_4;
  4814. {Component_t *c, *d;
  4815. for (c = llatt_3; c && c->Next; c = c->Next) {
  4816. if (c->Type != eComponent_Normal &&
  4817. c->Type != eComponent_Optional &&
  4818. c->Type != eComponent_Default)
  4819. continue;
  4820. for (d = c->Next; d; d = d->Next) {
  4821. if (d->Type != eComponent_Normal &&
  4822. d->Type != eComponent_Optional &&
  4823. d->Type != eComponent_Default)
  4824. continue;
  4825. if (!strcmp(c->U.NOD.NamedType->Identifier,
  4826. d->U.NOD.NamedType->Identifier))
  4827. LLFAILED((&llstate_3.pos, "Component `%s' has been used twice",
  4828. c->U.NOD.NamedType->Identifier));
  4829. }
  4830. }
  4831. (*llret) = NewType(eType_Set);
  4832. (*llret)->TagDefault = (*llout).TagDefault;
  4833. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  4834. (*llret)->U.Set.Components = llatt_3;
  4835. break;
  4836. }}}}}
  4837. case 2: case -2:
  4838. LLDEBUG_ALTERNATIVE("SetType", 2);
  4839. {LLSTATE llstate_1;
  4840. if (!llterm(T_SET, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  4841. {LLSTATE llstate_2;
  4842. if (!llterm('{', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  4843. {LLSTATE llstate_3;
  4844. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  4845. *llout = llstate_3;
  4846. {(*llret) = NewType(eType_Set);
  4847. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  4848. break;
  4849. }}}}
  4850. default:
  4851. llstk[--llcstp] = 1;
  4852. goto failed1;
  4853. failed2:
  4854. LLDEBUG_BACKTRACKING("SetType");
  4855. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  4856. llcpos = llpos1; llcstp = llstp1;
  4857. continue;
  4858. } break;
  4859. }}
  4860. LLDEBUG_LEAVE("SetType", 1);
  4861. return 1;
  4862. failed1: LLDEBUG_LEAVE("SetType", 0);
  4863. return 0;
  4864. }
  4865. int ll_SetOfType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4866. {
  4867. unsigned llstp = llcstp;
  4868. LLSTATE llstate_0;
  4869. LLDEBUG_ENTER("SetOfType");
  4870. llstate_0 = *llin;
  4871. #undef failed
  4872. #define failed failed1
  4873. {LLSTATE llstate_1;
  4874. if (!llterm(T_SET, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  4875. {LLSTATE llstate_2;XDirectives llatt_2;
  4876. if (!ll_LocalSizeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  4877. {LLSTATE llstate_3;XPrivateDirectives llatt_3;
  4878. if (!ll_PrivateDirectives(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  4879. {LLSTATE llstate_4;
  4880. if (!llterm(T_OF, (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed1;
  4881. {LLSTATE llstate_5;XType llatt_5;
  4882. if (!ll_Type(&llatt_5, &llstate_4, &llstate_5)) goto failed1;
  4883. *llout = llstate_5;
  4884. {(*llret) = NewType(eType_SetOf);
  4885. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  4886. (*llret)->U.SetOf.Type = llatt_5;
  4887. (*llret)->U.SetOf.Directives = llatt_2;
  4888. if (llatt_3)
  4889. {
  4890. PropagatePrivateDirectives((*llret), llatt_3);
  4891. }
  4892. if ((*llret)->PrivateDirectives.pszTypeName &&
  4893. strncmp("PSetOf", (*llret)->PrivateDirectives.pszTypeName, 6) == 0)
  4894. {
  4895. (*llret)->PrivateDirectives.pszTypeName++;
  4896. }
  4897. }}}}}}
  4898. LLDEBUG_LEAVE("SetOfType", 1);
  4899. return 1;
  4900. failed1: LLDEBUG_LEAVE("SetOfType", 0);
  4901. return 0;
  4902. }
  4903. int ll_ChoiceType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  4904. {
  4905. unsigned llstp = llcstp;
  4906. LLSTATE llstate_0;
  4907. LLDEBUG_ENTER("ChoiceType");
  4908. llstate_0 = *llin;
  4909. #undef failed
  4910. #define failed failed1
  4911. {LLSTATE llstate_1;
  4912. if (!llterm(T_CHOICE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  4913. {LLSTATE llstate_2;
  4914. if (!llterm('{', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  4915. {LLSTATE llstate_3;XComponents llatt_3;
  4916. if (!ll_ExtendedAlternativeTypeList(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  4917. {LLSTATE llstate_4;
  4918. if (!llterm('}', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed1;
  4919. *llout = llstate_4;
  4920. {Component_t *c, *d;
  4921. for (c = llatt_3; c; c = c->Next)
  4922. if (c->Type == eComponent_Normal ||
  4923. c->Type == eComponent_Optional ||
  4924. c->Type == eComponent_Default)
  4925. KeepChoiceNames(c->U.NOD.NamedType->Identifier); // global conflict check
  4926. for (c = llatt_3; c && c->Next; c = c->Next) {
  4927. if (c->Type != eComponent_Normal &&
  4928. c->Type != eComponent_Optional &&
  4929. c->Type != eComponent_Default)
  4930. continue;
  4931. for (d = c->Next; d; d = d->Next) {
  4932. if (d->Type != eComponent_Normal &&
  4933. d->Type != eComponent_Optional &&
  4934. d->Type != eComponent_Default)
  4935. continue;
  4936. if (!strcmp(c->U.NOD.NamedType->Identifier,
  4937. d->U.NOD.NamedType->Identifier))
  4938. LLFAILED((&llstate_3.pos, "Component `%s' has been used twice",
  4939. c->U.NOD.NamedType->Identifier));
  4940. }
  4941. }
  4942. (*llret) = NewType(eType_Choice);
  4943. (*llret)->TagDefault = (*llout).TagDefault;
  4944. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  4945. (*llret)->U.Choice.Components = llatt_3;
  4946. }}}}}
  4947. LLDEBUG_LEAVE("ChoiceType", 1);
  4948. return 1;
  4949. failed1: LLDEBUG_LEAVE("ChoiceType", 0);
  4950. return 0;
  4951. }
  4952. int ll_ExtendedAlternativeTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  4953. {
  4954. unsigned llstp = llcstp;
  4955. LLSTATE llstate_0;
  4956. LLDEBUG_ENTER("ExtendedAlternativeTypeList");
  4957. llstate_0 = *llin;
  4958. #undef failed
  4959. #define failed failed1
  4960. {LLSTATE llstate_1;XComponents llatt_1;
  4961. if (!ll_AlternativeTypeList(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  4962. {LLSTATE llstate_2;XComponents llatt_2;
  4963. if (!ll_AlternativeTypeListExtension(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  4964. *llout = llstate_2;
  4965. {Component_t **cc, *c;
  4966. if (llatt_2) {
  4967. cc = &(*llret);
  4968. for (c = llatt_1; c; c = c->Next) {
  4969. *cc = DupComponent(c);
  4970. cc = &(*cc)->Next;
  4971. }
  4972. *cc = llatt_2;
  4973. } else {
  4974. (*llret) = llatt_1;
  4975. }
  4976. }}}
  4977. LLDEBUG_LEAVE("ExtendedAlternativeTypeList", 1);
  4978. return 1;
  4979. failed1: LLDEBUG_LEAVE("ExtendedAlternativeTypeList", 0);
  4980. return 0;
  4981. }
  4982. int ll_AlternativeTypeListExtension(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  4983. {
  4984. unsigned llstp = llcstp;
  4985. LLSTATE llstate_0;
  4986. LLDEBUG_ENTER("AlternativeTypeListExtension");
  4987. llstate_0 = *llin;
  4988. #undef failed
  4989. #define failed failed1
  4990. #undef failed
  4991. #define failed failed2
  4992. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  4993. LLCHECKSTK;
  4994. for (;;) {
  4995. switch (llstk[llcstp++]) {
  4996. case 1: case -1:
  4997. LLDEBUG_ALTERNATIVE("AlternativeTypeListExtension", 1);
  4998. {LLSTATE llstate_1;
  4999. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5000. {LLSTATE llstate_2;XComponents llatt_2;
  5001. if (!ll_ExtensionAndException(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  5002. {LLSTATE llstate_3;XComponents llatt_3;
  5003. if (!ll_AdditionalAlternativeTypeList(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  5004. *llout = llstate_3;
  5005. {Component_t **cc, *c;
  5006. if (llatt_3) {
  5007. cc = &(*llret);
  5008. for (c = llatt_2; c; c = c->Next) {
  5009. *cc = DupComponent(c);
  5010. cc = &(*cc)->Next;
  5011. }
  5012. *cc = llatt_3;
  5013. } else {
  5014. (*llret) = llatt_2;
  5015. }
  5016. break;
  5017. }}}}
  5018. case 2: case -2:
  5019. LLDEBUG_ALTERNATIVE("AlternativeTypeListExtension", 2);
  5020. *llout = llstate_0;
  5021. {(*llret) = NULL;
  5022. break;
  5023. }
  5024. default:
  5025. llstk[--llcstp] = 1;
  5026. goto failed1;
  5027. failed2:
  5028. LLDEBUG_BACKTRACKING("AlternativeTypeListExtension");
  5029. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5030. llcpos = llpos1; llcstp = llstp1;
  5031. continue;
  5032. } break;
  5033. }}
  5034. LLDEBUG_LEAVE("AlternativeTypeListExtension", 1);
  5035. return 1;
  5036. failed1: LLDEBUG_LEAVE("AlternativeTypeListExtension", 0);
  5037. return 0;
  5038. }
  5039. int ll_AdditionalAlternativeTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  5040. {
  5041. unsigned llstp = llcstp;
  5042. LLSTATE llstate_0;
  5043. LLDEBUG_ENTER("AdditionalAlternativeTypeList");
  5044. llstate_0 = *llin;
  5045. #undef failed
  5046. #define failed failed1
  5047. #undef failed
  5048. #define failed failed2
  5049. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5050. LLCHECKSTK;
  5051. for (;;) {
  5052. switch (llstk[llcstp++]) {
  5053. case 1: case -1:
  5054. LLDEBUG_ALTERNATIVE("AdditionalAlternativeTypeList", 1);
  5055. {LLSTATE llstate_1;
  5056. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5057. {LLSTATE llstate_2;XComponents llatt_2;
  5058. if (!ll_AlternativeTypeList(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  5059. *llout = llstate_2;
  5060. {(*llret) = llatt_2;
  5061. break;
  5062. }}}
  5063. case 2: case -2:
  5064. LLDEBUG_ALTERNATIVE("AdditionalAlternativeTypeList", 2);
  5065. *llout = llstate_0;
  5066. {(*llret) = NULL;
  5067. break;
  5068. }
  5069. default:
  5070. llstk[--llcstp] = 1;
  5071. goto failed1;
  5072. failed2:
  5073. LLDEBUG_BACKTRACKING("AdditionalAlternativeTypeList");
  5074. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5075. llcpos = llpos1; llcstp = llstp1;
  5076. continue;
  5077. } break;
  5078. }}
  5079. LLDEBUG_LEAVE("AdditionalAlternativeTypeList", 1);
  5080. return 1;
  5081. failed1: LLDEBUG_LEAVE("AdditionalAlternativeTypeList", 0);
  5082. return 0;
  5083. }
  5084. int ll_AlternativeTypeList(XComponents *llret, LLSTATE *llin, LLSTATE *llout)
  5085. {
  5086. unsigned llstp = llcstp;
  5087. LLSTATE llstate_0;
  5088. LLDEBUG_ENTER("AlternativeTypeList");
  5089. llstate_0 = *llin;
  5090. #undef failed
  5091. #define failed failed1
  5092. {LLSTATE llstate_1;XNamedType llatt_1;
  5093. if (!ll_NamedType(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  5094. {LLSTATE llstate_2;XComponents llatt_2;
  5095. if (!ll_AdditionalAlternativeTypeList(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  5096. *llout = llstate_2;
  5097. {(*llret) = NewComponent(eComponent_Normal);
  5098. (*llret)->U.Normal.NamedType = llatt_1;
  5099. (*llret)->Next = llatt_2;
  5100. }}}
  5101. LLDEBUG_LEAVE("AlternativeTypeList", 1);
  5102. return 1;
  5103. failed1: LLDEBUG_LEAVE("AlternativeTypeList", 0);
  5104. return 0;
  5105. }
  5106. int ll_AnyType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5107. {
  5108. unsigned llstp = llcstp;
  5109. LLSTATE llstate_0;
  5110. LLDEBUG_ENTER("AnyType");
  5111. llstate_0 = *llin;
  5112. #undef failed
  5113. #define failed failed1
  5114. #undef failed
  5115. #define failed failed2
  5116. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5117. LLCHECKSTK;
  5118. for (;;) {
  5119. switch (llstk[llcstp++]) {
  5120. case 1: case -1:
  5121. LLDEBUG_ALTERNATIVE("AnyType", 1);
  5122. {LLSTATE llstate_1;
  5123. if (!llterm(T_ANY, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5124. *llout = llstate_1;
  5125. {(*llret) = Builtin_Type_Open;
  5126. break;
  5127. }}
  5128. case 2: case -2:
  5129. LLDEBUG_ALTERNATIVE("AnyType", 2);
  5130. {LLSTATE llstate_1;
  5131. if (!llterm(T_ANY, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5132. {LLSTATE llstate_2;
  5133. if (!llterm(T_DEFINED, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  5134. {LLSTATE llstate_3;
  5135. if (!llterm(T_BY, (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  5136. {LLSTATE llstate_4;XString llatt_4;
  5137. if (!ll_identifier(&llatt_4, &llstate_3, &llstate_4)) goto failed2;
  5138. *llout = llstate_4;
  5139. {(*llret) = Builtin_Type_Open;
  5140. break;
  5141. }}}}}
  5142. default:
  5143. llstk[--llcstp] = 1;
  5144. goto failed1;
  5145. failed2:
  5146. LLDEBUG_BACKTRACKING("AnyType");
  5147. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5148. llcpos = llpos1; llcstp = llstp1;
  5149. continue;
  5150. } break;
  5151. }}
  5152. LLDEBUG_LEAVE("AnyType", 1);
  5153. return 1;
  5154. failed1: LLDEBUG_LEAVE("AnyType", 0);
  5155. return 0;
  5156. }
  5157. int ll_SelectionType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5158. {
  5159. unsigned llstp = llcstp;
  5160. LLSTATE llstate_0;
  5161. LLDEBUG_ENTER("SelectionType");
  5162. llstate_0 = *llin;
  5163. #undef failed
  5164. #define failed failed1
  5165. {LLSTATE llstate_1;XString llatt_1;
  5166. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  5167. {LLSTATE llstate_2;
  5168. if (!llterm('<', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  5169. {LLSTATE llstate_3;XType llatt_3;
  5170. if (!ll_Type(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  5171. *llout = llstate_3;
  5172. {(*llret) = NewType(eType_Selection);
  5173. (*llret)->U.Selection.Identifier = llatt_1;
  5174. (*llret)->U.Selection.Type = llatt_3;
  5175. }}}}
  5176. LLDEBUG_LEAVE("SelectionType", 1);
  5177. return 1;
  5178. failed1: LLDEBUG_LEAVE("SelectionType", 0);
  5179. return 0;
  5180. }
  5181. int ll_TaggedType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5182. {
  5183. unsigned llstp = llcstp;
  5184. LLSTATE llstate_0;
  5185. LLDEBUG_ENTER("TaggedType");
  5186. llstate_0 = *llin;
  5187. #undef failed
  5188. #define failed failed1
  5189. {LLSTATE llstate_1;XTags llatt_1;
  5190. if (!ll_Tag(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  5191. {LLSTATE llstate_2;XTagType llatt_2;
  5192. if (!ll_TagType(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  5193. {LLSTATE llstate_3;XType llatt_3;
  5194. if (!ll_Type(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  5195. *llout = llstate_3;
  5196. {Tag_t *t;
  5197. Type_e eType = GetTypeType((*llout).Assignments, llatt_3);
  5198. if (eType == eType_Choice || eType == eType_Open)
  5199. {
  5200. if (llatt_2 == eTagType_Unknown &&
  5201. ((*llout).TagDefault == eTagType_Implicit || (*llout).TagDefault == eTagType_Automatic))
  5202. {
  5203. llatt_2 = eTagType_Explicit;
  5204. }
  5205. else
  5206. if (llatt_2 == eTagType_Implicit)
  5207. {
  5208. for (t = llatt_3->Tags; t; t = t->Next) {
  5209. if (t->Type == eTagType_Explicit)
  5210. break;
  5211. }
  5212. if (!t)
  5213. LLFAILED((&llstate_3.pos, "Bad tag type for choice/open type"));
  5214. }
  5215. }
  5216. (*llret) = DupType(llatt_3);
  5217. (*llret)->Tags = DupTag(llatt_1);
  5218. (*llret)->Tags->Type = llatt_2;
  5219. (*llret)->Tags->Next = llatt_3->Tags;
  5220. }}}}
  5221. LLDEBUG_LEAVE("TaggedType", 1);
  5222. return 1;
  5223. failed1: LLDEBUG_LEAVE("TaggedType", 0);
  5224. return 0;
  5225. }
  5226. int ll_TagType(XTagType *llret, LLSTATE *llin, LLSTATE *llout)
  5227. {
  5228. unsigned llstp = llcstp;
  5229. LLSTATE llstate_0;
  5230. LLDEBUG_ENTER("TagType");
  5231. llstate_0 = *llin;
  5232. #undef failed
  5233. #define failed failed1
  5234. #undef failed
  5235. #define failed failed2
  5236. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5237. LLCHECKSTK;
  5238. for (;;) {
  5239. switch (llstk[llcstp++]) {
  5240. case 1: case -1:
  5241. LLDEBUG_ALTERNATIVE("TagType", 1);
  5242. *llout = llstate_0;
  5243. {(*llret) = eTagType_Unknown;
  5244. break;
  5245. }
  5246. case 2: case -2:
  5247. LLDEBUG_ALTERNATIVE("TagType", 2);
  5248. {LLSTATE llstate_1;
  5249. if (!llterm(T_IMPLICIT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5250. *llout = llstate_1;
  5251. {(*llret) = eTagType_Implicit;
  5252. break;
  5253. }}
  5254. case 3: case -3:
  5255. LLDEBUG_ALTERNATIVE("TagType", 3);
  5256. {LLSTATE llstate_1;
  5257. if (!llterm(T_EXPLICIT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5258. *llout = llstate_1;
  5259. {(*llret) = eTagType_Explicit;
  5260. break;
  5261. }}
  5262. default:
  5263. llstk[--llcstp] = 1;
  5264. goto failed1;
  5265. failed2:
  5266. LLDEBUG_BACKTRACKING("TagType");
  5267. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5268. llcpos = llpos1; llcstp = llstp1;
  5269. continue;
  5270. } break;
  5271. }}
  5272. LLDEBUG_LEAVE("TagType", 1);
  5273. return 1;
  5274. failed1: LLDEBUG_LEAVE("TagType", 0);
  5275. return 0;
  5276. }
  5277. int ll_Tag(XTags *llret, LLSTATE *llin, LLSTATE *llout)
  5278. {
  5279. unsigned llstp = llcstp;
  5280. LLSTATE llstate_0;
  5281. LLDEBUG_ENTER("Tag");
  5282. llstate_0 = *llin;
  5283. #undef failed
  5284. #define failed failed1
  5285. {LLSTATE llstate_1;
  5286. if (!llterm('[', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  5287. {LLSTATE llstate_2;XTagClass llatt_2;
  5288. if (!ll_Class(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  5289. {LLSTATE llstate_3;XValue llatt_3;
  5290. if (!ll_ClassNumber(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  5291. {LLSTATE llstate_4;
  5292. if (!llterm(']', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed1;
  5293. *llout = llstate_4;
  5294. {(*llret) = NewTag(eTagType_Unknown);
  5295. (*llret)->Class = llatt_2;
  5296. (*llret)->Tag = llatt_3;
  5297. }}}}}
  5298. LLDEBUG_LEAVE("Tag", 1);
  5299. return 1;
  5300. failed1: LLDEBUG_LEAVE("Tag", 0);
  5301. return 0;
  5302. }
  5303. int ll_ClassNumber(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  5304. {
  5305. unsigned llstp = llcstp;
  5306. LLSTATE llstate_0;
  5307. LLDEBUG_ENTER("ClassNumber");
  5308. llstate_0 = *llin;
  5309. #undef failed
  5310. #define failed failed1
  5311. #undef failed
  5312. #define failed failed2
  5313. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5314. LLCHECKSTK;
  5315. for (;;) {
  5316. switch (llstk[llcstp++]) {
  5317. case 1: case -1:
  5318. LLDEBUG_ALTERNATIVE("ClassNumber", 1);
  5319. {LLSTATE llstate_1;XNumber llatt_1;
  5320. if (!llterm(T_number, &lllval, &llstate_0, &llstate_1)) goto failed2;
  5321. llatt_1 = lllval._XNumber;
  5322. *llout = llstate_1;
  5323. {if (intx_cmp(&llatt_1, &intx_1G) >= 0)
  5324. LLFAILED((&llstate_1.pos, "Bad tag value"));
  5325. (*llret) = NewValue(NULL, Builtin_Type_Integer);
  5326. (*llret)->U.Integer.Value = llatt_1;
  5327. break;
  5328. }}
  5329. case 2: case -2:
  5330. LLDEBUG_ALTERNATIVE("ClassNumber", 2);
  5331. {LLSTATE llstate_1;XValue llatt_1;
  5332. if (!ll_DefinedValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  5333. *llout = llstate_1;
  5334. {Value_t *v;
  5335. v = GetValue((*llout).Assignments, llatt_1);
  5336. if (v &&
  5337. GetTypeType((*llout).Assignments, v->Type) != eType_Integer &&
  5338. GetTypeType((*llout).Assignments, v->Type) != eType_Undefined)
  5339. LLFAILED((&llstate_1.pos, "Bad type of tag value"));
  5340. if (v &&
  5341. GetTypeType((*llout).Assignments, v->Type) == eType_Integer &&
  5342. (intx_cmp(&v->U.Integer.Value, &intx_0) < 0 ||
  5343. intx_cmp(&v->U.Integer.Value, &intx_1G) >= 0))
  5344. LLFAILED((&llstate_1.pos, "Bad tag value"));
  5345. (*llret) = llatt_1;
  5346. break;
  5347. }}
  5348. default:
  5349. llstk[--llcstp] = 1;
  5350. goto failed1;
  5351. failed2:
  5352. LLDEBUG_BACKTRACKING("ClassNumber");
  5353. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5354. llcpos = llpos1; llcstp = llstp1;
  5355. continue;
  5356. } break;
  5357. }}
  5358. LLDEBUG_LEAVE("ClassNumber", 1);
  5359. return 1;
  5360. failed1: LLDEBUG_LEAVE("ClassNumber", 0);
  5361. return 0;
  5362. }
  5363. int ll_Class(XTagClass *llret, LLSTATE *llin, LLSTATE *llout)
  5364. {
  5365. unsigned llstp = llcstp;
  5366. LLSTATE llstate_0;
  5367. LLDEBUG_ENTER("Class");
  5368. llstate_0 = *llin;
  5369. #undef failed
  5370. #define failed failed1
  5371. #undef failed
  5372. #define failed failed2
  5373. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5374. LLCHECKSTK;
  5375. for (;;) {
  5376. switch (llstk[llcstp++]) {
  5377. case 1: case -1:
  5378. LLDEBUG_ALTERNATIVE("Class", 1);
  5379. {LLSTATE llstate_1;
  5380. if (!llterm(T_UNIVERSAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5381. *llout = llstate_1;
  5382. {(*llret) = eTagClass_Universal;
  5383. break;
  5384. }}
  5385. case 2: case -2:
  5386. LLDEBUG_ALTERNATIVE("Class", 2);
  5387. {LLSTATE llstate_1;
  5388. if (!llterm(T_APPLICATION, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5389. *llout = llstate_1;
  5390. {(*llret) = eTagClass_Application;
  5391. break;
  5392. }}
  5393. case 3: case -3:
  5394. LLDEBUG_ALTERNATIVE("Class", 3);
  5395. {LLSTATE llstate_1;
  5396. if (!llterm(T_PRIVATE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5397. *llout = llstate_1;
  5398. {(*llret) = eTagClass_Private;
  5399. break;
  5400. }}
  5401. case 4: case -4:
  5402. LLDEBUG_ALTERNATIVE("Class", 4);
  5403. *llout = llstate_0;
  5404. {(*llret) = eTagClass_Unknown;
  5405. break;
  5406. }
  5407. default:
  5408. llstk[--llcstp] = 1;
  5409. goto failed1;
  5410. failed2:
  5411. LLDEBUG_BACKTRACKING("Class");
  5412. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5413. llcpos = llpos1; llcstp = llstp1;
  5414. continue;
  5415. } break;
  5416. }}
  5417. LLDEBUG_LEAVE("Class", 1);
  5418. return 1;
  5419. failed1: LLDEBUG_LEAVE("Class", 0);
  5420. return 0;
  5421. }
  5422. int ll_ObjectIdentifierType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5423. {
  5424. unsigned llstp = llcstp;
  5425. LLSTATE llstate_0;
  5426. LLDEBUG_ENTER("ObjectIdentifierType");
  5427. llstate_0 = *llin;
  5428. #undef failed
  5429. #define failed failed1
  5430. {LLSTATE llstate_1;
  5431. if (!llterm(T_OBJECT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  5432. {LLSTATE llstate_2;
  5433. if (!llterm(T_IDENTIFIER, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  5434. *llout = llstate_2;
  5435. {(*llret) = Builtin_Type_ObjectIdentifier;
  5436. }}}
  5437. LLDEBUG_LEAVE("ObjectIdentifierType", 1);
  5438. return 1;
  5439. failed1: LLDEBUG_LEAVE("ObjectIdentifierType", 0);
  5440. return 0;
  5441. }
  5442. int ll_EmbeddedPDVType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5443. {
  5444. unsigned llstp = llcstp;
  5445. LLSTATE llstate_0;
  5446. LLDEBUG_ENTER("EmbeddedPDVType");
  5447. llstate_0 = *llin;
  5448. #undef failed
  5449. #define failed failed1
  5450. {LLSTATE llstate_1;
  5451. if (!llterm(T_EMBEDDED, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  5452. {LLSTATE llstate_2;
  5453. if (!llterm(T_PDV, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  5454. *llout = llstate_2;
  5455. {(*llret) = Builtin_Type_EmbeddedPdv;
  5456. }}}
  5457. LLDEBUG_LEAVE("EmbeddedPDVType", 1);
  5458. return 1;
  5459. failed1: LLDEBUG_LEAVE("EmbeddedPDVType", 0);
  5460. return 0;
  5461. }
  5462. int ll_ExternalType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5463. {
  5464. unsigned llstp = llcstp;
  5465. LLSTATE llstate_0;
  5466. LLDEBUG_ENTER("ExternalType");
  5467. llstate_0 = *llin;
  5468. #undef failed
  5469. #define failed failed1
  5470. {LLSTATE llstate_1;
  5471. if (!llterm(T_EXTERNAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  5472. *llout = llstate_1;
  5473. {(*llret) = Builtin_Type_External;
  5474. }}
  5475. LLDEBUG_LEAVE("ExternalType", 1);
  5476. return 1;
  5477. failed1: LLDEBUG_LEAVE("ExternalType", 0);
  5478. return 0;
  5479. }
  5480. int ll_CharacterStringType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5481. {
  5482. unsigned llstp = llcstp;
  5483. LLSTATE llstate_0;
  5484. LLDEBUG_ENTER("CharacterStringType");
  5485. llstate_0 = *llin;
  5486. #undef failed
  5487. #define failed failed1
  5488. #undef failed
  5489. #define failed failed2
  5490. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5491. LLCHECKSTK;
  5492. for (;;) {
  5493. switch (llstk[llcstp++]) {
  5494. case 1: case -1:
  5495. LLDEBUG_ALTERNATIVE("CharacterStringType", 1);
  5496. {LLSTATE llstate_1;XType llatt_1;
  5497. if (!ll_RestrictedCharacterStringType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  5498. *llout = llstate_1;
  5499. {(*llret) = llatt_1;
  5500. break;
  5501. }}
  5502. case 2: case -2:
  5503. LLDEBUG_ALTERNATIVE("CharacterStringType", 2);
  5504. {LLSTATE llstate_1;XType llatt_1;
  5505. if (!ll_UnrestrictedCharacterStringType(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  5506. *llout = llstate_1;
  5507. {(*llret) = llatt_1;
  5508. break;
  5509. }}
  5510. default:
  5511. llstk[--llcstp] = 1;
  5512. goto failed1;
  5513. failed2:
  5514. LLDEBUG_BACKTRACKING("CharacterStringType");
  5515. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5516. llcpos = llpos1; llcstp = llstp1;
  5517. continue;
  5518. } break;
  5519. }}
  5520. LLDEBUG_LEAVE("CharacterStringType", 1);
  5521. return 1;
  5522. failed1: LLDEBUG_LEAVE("CharacterStringType", 0);
  5523. return 0;
  5524. }
  5525. int ll_RestrictedCharacterStringType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5526. {
  5527. unsigned llstp = llcstp;
  5528. LLSTATE llstate_0;
  5529. LLDEBUG_ENTER("RestrictedCharacterStringType");
  5530. llstate_0 = *llin;
  5531. #undef failed
  5532. #define failed failed1
  5533. #undef failed
  5534. #define failed failed2
  5535. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5536. LLCHECKSTK;
  5537. for (;;) {
  5538. switch (llstk[llcstp++]) {
  5539. case 1: case -1:
  5540. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 1);
  5541. {LLSTATE llstate_1;
  5542. if (!llterm(T_BMPString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5543. *llout = llstate_1;
  5544. {(*llret) = Builtin_Type_BMPString;
  5545. break;
  5546. }}
  5547. case 2: case -2:
  5548. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 2);
  5549. {LLSTATE llstate_1;
  5550. if (!llterm(T_GeneralString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5551. *llout = llstate_1;
  5552. {(*llret) = Builtin_Type_GeneralString;
  5553. break;
  5554. }}
  5555. case 3: case -3:
  5556. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 3);
  5557. {LLSTATE llstate_1;
  5558. if (!llterm(T_GraphicString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5559. *llout = llstate_1;
  5560. {(*llret) = Builtin_Type_GraphicString;
  5561. break;
  5562. }}
  5563. case 4: case -4:
  5564. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 4);
  5565. {LLSTATE llstate_1;
  5566. if (!llterm(T_IA5String, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5567. *llout = llstate_1;
  5568. {(*llret) = Builtin_Type_IA5String;
  5569. break;
  5570. }}
  5571. case 5: case -5:
  5572. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 5);
  5573. {LLSTATE llstate_1;
  5574. if (!llterm(T_ISO646String, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5575. *llout = llstate_1;
  5576. {(*llret) = Builtin_Type_ISO646String;
  5577. break;
  5578. }}
  5579. case 6: case -6:
  5580. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 6);
  5581. {LLSTATE llstate_1;
  5582. if (!llterm(T_NumericString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5583. *llout = llstate_1;
  5584. {(*llret) = Builtin_Type_NumericString;
  5585. break;
  5586. }}
  5587. case 7: case -7:
  5588. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 7);
  5589. {LLSTATE llstate_1;
  5590. if (!llterm(T_PrintableString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5591. *llout = llstate_1;
  5592. {(*llret) = Builtin_Type_PrintableString;
  5593. break;
  5594. }}
  5595. case 8: case -8:
  5596. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 8);
  5597. {LLSTATE llstate_1;
  5598. if (!llterm(T_TeletexString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5599. *llout = llstate_1;
  5600. {(*llret) = Builtin_Type_TeletexString;
  5601. break;
  5602. }}
  5603. case 9: case -9:
  5604. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 9);
  5605. {LLSTATE llstate_1;
  5606. if (!llterm(T_T61String, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5607. *llout = llstate_1;
  5608. {(*llret) = Builtin_Type_T61String;
  5609. break;
  5610. }}
  5611. case 10: case -10:
  5612. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 10);
  5613. {LLSTATE llstate_1;
  5614. if (!llterm(T_UniversalString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5615. *llout = llstate_1;
  5616. {(*llret) = Builtin_Type_UniversalString;
  5617. break;
  5618. }}
  5619. case 11: case -11:
  5620. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 11);
  5621. {LLSTATE llstate_1;
  5622. if (!llterm(T_VideotexString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5623. *llout = llstate_1;
  5624. {(*llret) = Builtin_Type_VideotexString;
  5625. break;
  5626. }}
  5627. case 12: case -12:
  5628. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringType", 12);
  5629. {LLSTATE llstate_1;
  5630. if (!llterm(T_VisibleString, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5631. *llout = llstate_1;
  5632. {(*llret) = Builtin_Type_VisibleString;
  5633. break;
  5634. }}
  5635. default:
  5636. llstk[--llcstp] = 1;
  5637. goto failed1;
  5638. failed2:
  5639. LLDEBUG_BACKTRACKING("RestrictedCharacterStringType");
  5640. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5641. llcpos = llpos1; llcstp = llstp1;
  5642. continue;
  5643. } break;
  5644. }}
  5645. LLDEBUG_LEAVE("RestrictedCharacterStringType", 1);
  5646. return 1;
  5647. failed1: LLDEBUG_LEAVE("RestrictedCharacterStringType", 0);
  5648. return 0;
  5649. }
  5650. int ll_UnrestrictedCharacterStringType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5651. {
  5652. unsigned llstp = llcstp;
  5653. LLSTATE llstate_0;
  5654. LLDEBUG_ENTER("UnrestrictedCharacterStringType");
  5655. llstate_0 = *llin;
  5656. #undef failed
  5657. #define failed failed1
  5658. {LLSTATE llstate_1;
  5659. if (!llterm(T_CHARACTER, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  5660. {LLSTATE llstate_2;
  5661. if (!llterm(T_STRING, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  5662. *llout = llstate_2;
  5663. {(*llret) = Builtin_Type_CharacterString;
  5664. }}}
  5665. LLDEBUG_LEAVE("UnrestrictedCharacterStringType", 1);
  5666. return 1;
  5667. failed1: LLDEBUG_LEAVE("UnrestrictedCharacterStringType", 0);
  5668. return 0;
  5669. }
  5670. int ll_UsefulType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5671. {
  5672. unsigned llstp = llcstp;
  5673. LLSTATE llstate_0;
  5674. LLDEBUG_ENTER("UsefulType");
  5675. llstate_0 = *llin;
  5676. #undef failed
  5677. #define failed failed1
  5678. #undef failed
  5679. #define failed failed2
  5680. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5681. LLCHECKSTK;
  5682. for (;;) {
  5683. switch (llstk[llcstp++]) {
  5684. case 1: case -1:
  5685. LLDEBUG_ALTERNATIVE("UsefulType", 1);
  5686. {LLSTATE llstate_1;
  5687. if (!llterm(T_GeneralizedTime, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5688. *llout = llstate_1;
  5689. {(*llret) = Builtin_Type_GeneralizedTime;
  5690. break;
  5691. }}
  5692. case 2: case -2:
  5693. LLDEBUG_ALTERNATIVE("UsefulType", 2);
  5694. {LLSTATE llstate_1;
  5695. if (!llterm(T_UTCTime, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5696. *llout = llstate_1;
  5697. {(*llret) = Builtin_Type_UTCTime;
  5698. break;
  5699. }}
  5700. case 3: case -3:
  5701. LLDEBUG_ALTERNATIVE("UsefulType", 3);
  5702. {LLSTATE llstate_1;
  5703. if (!llterm(T_ObjectDescriptor, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5704. *llout = llstate_1;
  5705. {(*llret) = Builtin_Type_ObjectDescriptor;
  5706. break;
  5707. }}
  5708. default:
  5709. llstk[--llcstp] = 1;
  5710. goto failed1;
  5711. failed2:
  5712. LLDEBUG_BACKTRACKING("UsefulType");
  5713. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5714. llcpos = llpos1; llcstp = llstp1;
  5715. continue;
  5716. } break;
  5717. }}
  5718. LLDEBUG_LEAVE("UsefulType", 1);
  5719. return 1;
  5720. failed1: LLDEBUG_LEAVE("UsefulType", 0);
  5721. return 0;
  5722. }
  5723. int ll_TypeWithConstraint(XType *llret, LLSTATE *llin, LLSTATE *llout)
  5724. {
  5725. unsigned llstp = llcstp;
  5726. LLSTATE llstate_0;
  5727. LLDEBUG_ENTER("TypeWithConstraint");
  5728. llstate_0 = *llin;
  5729. #undef failed
  5730. #define failed failed1
  5731. #undef failed
  5732. #define failed failed2
  5733. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5734. LLCHECKSTK;
  5735. for (;;) {
  5736. switch (llstk[llcstp++]) {
  5737. case 1: case -1:
  5738. LLDEBUG_ALTERNATIVE("TypeWithConstraint", 1);
  5739. {LLSTATE llstate_1;
  5740. if (!llterm(T_SET, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5741. {LLSTATE llstate_2;XDirectives llatt_2;
  5742. if (!ll_LocalSizeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  5743. {LLSTATE llstate_3;XPrivateDirectives llatt_3;
  5744. if (!ll_PrivateDirectives(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  5745. {LLSTATE llstate_4;XConstraints llatt_4;
  5746. if (!ll_Constraint(&llatt_4, &llstate_3, &llstate_4, NULL, 0)) goto failed2;
  5747. {LLSTATE llstate_5;XDirectives llatt_5;
  5748. if (!ll_LocalSizeDirectiveESeq(&llatt_5, &llstate_4, &llstate_5)) goto failed2;
  5749. {LLSTATE llstate_6;
  5750. if (!llterm(T_OF, (LLSTYPE *)0, &llstate_5, &llstate_6)) goto failed2;
  5751. {LLSTATE llstate_7;XType llatt_7;
  5752. if (!ll_Type(&llatt_7, &llstate_6, &llstate_7)) goto failed2;
  5753. *llout = llstate_7;
  5754. {Directive_t **dd, *d;
  5755. (*llret) = NewType(eType_SetOf);
  5756. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  5757. (*llret)->Constraints = llatt_4;
  5758. (*llret)->U.SetOf.Type = llatt_7;
  5759. if (llatt_3)
  5760. {
  5761. PropagatePrivateDirectives((*llret), llatt_3);
  5762. }
  5763. dd = &(*llret)->U.SetOf.Directives;
  5764. for (d = llatt_2; d; d = d->Next) {
  5765. *dd = DupDirective(d);
  5766. dd = &(*dd)->Next;
  5767. }
  5768. for (d = llatt_5; d; d = d->Next) {
  5769. *dd = DupDirective(d);
  5770. dd = &(*dd)->Next;
  5771. }
  5772. *dd = NULL;
  5773. if ((*llret)->PrivateDirectives.pszTypeName &&
  5774. strncmp("PSetOf", (*llret)->PrivateDirectives.pszTypeName, 6) == 0)
  5775. {
  5776. (*llret)->PrivateDirectives.pszTypeName++;
  5777. }
  5778. break;
  5779. }}}}}}}}
  5780. case 2: case -2:
  5781. LLDEBUG_ALTERNATIVE("TypeWithConstraint", 2);
  5782. {LLSTATE llstate_1;
  5783. if (!llterm(T_SET, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5784. {LLSTATE llstate_2;XDirectives llatt_2;
  5785. if (!ll_LocalSizeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  5786. {LLSTATE llstate_3;XPrivateDirectives llatt_3;
  5787. if (!ll_PrivateDirectives(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  5788. {LLSTATE llstate_4;XSubtypeElement llatt_4;
  5789. if (!ll_SizeConstraint(&llatt_4, &llstate_3, &llstate_4)) goto failed2;
  5790. {LLSTATE llstate_5;XDirectives llatt_5;
  5791. if (!ll_LocalSizeDirectiveESeq(&llatt_5, &llstate_4, &llstate_5)) goto failed2;
  5792. {LLSTATE llstate_6;XPrivateDirectives llatt_6;
  5793. if (!ll_PrivateDirectives(&llatt_6, &llstate_5, &llstate_6)) goto failed2;
  5794. {LLSTATE llstate_7;
  5795. if (!llterm(T_OF, (LLSTYPE *)0, &llstate_6, &llstate_7)) goto failed2;
  5796. {LLSTATE llstate_8;XType llatt_8;
  5797. if (!ll_Type(&llatt_8, &llstate_7, &llstate_8)) goto failed2;
  5798. *llout = llstate_8;
  5799. {Directive_t **dd, *d;
  5800. (*llret) = NewType(eType_SetOf);
  5801. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  5802. (*llret)->Constraints = NewConstraint();
  5803. (*llret)->Constraints->Type = eExtension_Unextended;
  5804. (*llret)->Constraints->Root = NewElementSetSpec(
  5805. eElementSetSpec_SubtypeElement);
  5806. (*llret)->Constraints->Root->U.SubtypeElement.SubtypeElement = llatt_4;
  5807. (*llret)->U.SetOf.Type = llatt_8;
  5808. if (llatt_3)
  5809. {
  5810. PropagatePrivateDirectives((*llret), llatt_3);
  5811. }
  5812. if (llatt_6)
  5813. {
  5814. PropagatePrivateDirectives((*llret), llatt_6);
  5815. }
  5816. dd = &(*llret)->U.SetOf.Directives;
  5817. for (d = llatt_2; d; d = d->Next) {
  5818. *dd = DupDirective(d);
  5819. dd = &(*dd)->Next;
  5820. }
  5821. for (d = llatt_5; d; d = d->Next) {
  5822. *dd = DupDirective(d);
  5823. dd = &(*dd)->Next;
  5824. }
  5825. *dd = NULL;
  5826. if ((*llret)->PrivateDirectives.pszTypeName &&
  5827. strncmp("PSetOf", (*llret)->PrivateDirectives.pszTypeName, 6) == 0)
  5828. {
  5829. (*llret)->PrivateDirectives.pszTypeName++;
  5830. }
  5831. break;
  5832. }}}}}}}}}
  5833. case 3: case -3:
  5834. LLDEBUG_ALTERNATIVE("TypeWithConstraint", 3);
  5835. {LLSTATE llstate_1;
  5836. if (!llterm(T_SEQUENCE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5837. {LLSTATE llstate_2;XDirectives llatt_2;
  5838. if (!ll_LocalSizeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  5839. {LLSTATE llstate_3;XPrivateDirectives llatt_3;
  5840. if (!ll_PrivateDirectives(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  5841. {LLSTATE llstate_4;XConstraints llatt_4;
  5842. if (!ll_Constraint(&llatt_4, &llstate_3, &llstate_4, NULL, 0)) goto failed2;
  5843. {LLSTATE llstate_5;XDirectives llatt_5;
  5844. if (!ll_LocalSizeDirectiveESeq(&llatt_5, &llstate_4, &llstate_5)) goto failed2;
  5845. {LLSTATE llstate_6;
  5846. if (!llterm(T_OF, (LLSTYPE *)0, &llstate_5, &llstate_6)) goto failed2;
  5847. {LLSTATE llstate_7;XType llatt_7;
  5848. if (!ll_Type(&llatt_7, &llstate_6, &llstate_7)) goto failed2;
  5849. *llout = llstate_7;
  5850. {Directive_t **dd, *d;
  5851. (*llret) = NewType(eType_SequenceOf);
  5852. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  5853. (*llret)->Constraints = llatt_4;
  5854. (*llret)->U.SequenceOf.Type = llatt_7;
  5855. if (llatt_3)
  5856. {
  5857. PropagatePrivateDirectives((*llret), llatt_3);
  5858. }
  5859. dd = &(*llret)->U.SequenceOf.Directives;
  5860. for (d = llatt_2; d; d = d->Next) {
  5861. *dd = DupDirective(d);
  5862. dd = &(*dd)->Next;
  5863. }
  5864. for (d = llatt_5; d; d = d->Next) {
  5865. *dd = DupDirective(d);
  5866. dd = &(*dd)->Next;
  5867. }
  5868. *dd = NULL;
  5869. if ((*llret)->PrivateDirectives.pszTypeName &&
  5870. strncmp("PSetOf", (*llret)->PrivateDirectives.pszTypeName, 6) == 0)
  5871. {
  5872. (*llret)->PrivateDirectives.pszTypeName++;
  5873. }
  5874. break;
  5875. }}}}}}}}
  5876. case 4: case -4:
  5877. LLDEBUG_ALTERNATIVE("TypeWithConstraint", 4);
  5878. {LLSTATE llstate_1;
  5879. if (!llterm(T_SEQUENCE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  5880. {LLSTATE llstate_2;XDirectives llatt_2;
  5881. if (!ll_LocalSizeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  5882. {LLSTATE llstate_3;XPrivateDirectives llatt_3;
  5883. if (!ll_PrivateDirectives(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  5884. {LLSTATE llstate_4;XSubtypeElement llatt_4;
  5885. if (!ll_SizeConstraint(&llatt_4, &llstate_3, &llstate_4)) goto failed2;
  5886. {LLSTATE llstate_5;XDirectives llatt_5;
  5887. if (!ll_LocalSizeDirectiveESeq(&llatt_5, &llstate_4, &llstate_5)) goto failed2;
  5888. {LLSTATE llstate_6;XPrivateDirectives llatt_6;
  5889. if (!ll_PrivateDirectives(&llatt_6, &llstate_5, &llstate_6)) goto failed2;
  5890. {LLSTATE llstate_7;
  5891. if (!llterm(T_OF, (LLSTYPE *)0, &llstate_6, &llstate_7)) goto failed2;
  5892. {LLSTATE llstate_8;XType llatt_8;
  5893. if (!ll_Type(&llatt_8, &llstate_7, &llstate_8)) goto failed2;
  5894. *llout = llstate_8;
  5895. {Directive_t **dd, *d;
  5896. (*llret) = NewType(eType_SequenceOf);
  5897. (*llret)->ExtensionDefault = (*llout).ExtensionDefault;
  5898. (*llret)->Constraints = NewConstraint();
  5899. (*llret)->Constraints->Type = eExtension_Unextended;
  5900. (*llret)->Constraints->Root = NewElementSetSpec(
  5901. eElementSetSpec_SubtypeElement);
  5902. (*llret)->Constraints->Root->U.SubtypeElement.SubtypeElement = llatt_4;
  5903. (*llret)->U.SequenceOf.Type = llatt_8;
  5904. if (llatt_3)
  5905. {
  5906. PropagatePrivateDirectives((*llret), llatt_3);
  5907. }
  5908. if (llatt_6)
  5909. {
  5910. PropagatePrivateDirectives((*llret), llatt_6);
  5911. }
  5912. dd = &(*llret)->U.SequenceOf.Directives;
  5913. for (d = llatt_2; d; d = d->Next) {
  5914. *dd = DupDirective(d);
  5915. dd = &(*dd)->Next;
  5916. }
  5917. for (d = llatt_5; d; d = d->Next) {
  5918. *dd = DupDirective(d);
  5919. dd = &(*dd)->Next;
  5920. }
  5921. *dd = NULL;
  5922. if ((*llret)->PrivateDirectives.pszTypeName &&
  5923. strncmp("PSetOf", (*llret)->PrivateDirectives.pszTypeName, 6) == 0)
  5924. {
  5925. (*llret)->PrivateDirectives.pszTypeName++;
  5926. }
  5927. break;
  5928. }}}}}}}}}
  5929. default:
  5930. llstk[--llcstp] = 1;
  5931. goto failed1;
  5932. failed2:
  5933. LLDEBUG_BACKTRACKING("TypeWithConstraint");
  5934. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5935. llcpos = llpos1; llcstp = llstp1;
  5936. continue;
  5937. } break;
  5938. }}
  5939. LLDEBUG_LEAVE("TypeWithConstraint", 1);
  5940. return 1;
  5941. failed1: LLDEBUG_LEAVE("TypeWithConstraint", 0);
  5942. return 0;
  5943. }
  5944. int ll_DefinedValue(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  5945. {
  5946. unsigned llstp = llcstp;
  5947. LLSTATE llstate_0;
  5948. LLDEBUG_ENTER("DefinedValue");
  5949. llstate_0 = *llin;
  5950. #undef failed
  5951. #define failed failed1
  5952. #undef failed
  5953. #define failed failed2
  5954. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  5955. LLCHECKSTK;
  5956. for (;;) {
  5957. switch (llstk[llcstp++]) {
  5958. case 1: case -1:
  5959. LLDEBUG_ALTERNATIVE("DefinedValue", 1);
  5960. {LLSTATE llstate_1;XValue llatt_1;
  5961. if (!ll_Externalvaluereference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  5962. *llout = llstate_1;
  5963. {(*llret) = llatt_1;
  5964. break;
  5965. }}
  5966. case 2: case -2:
  5967. LLDEBUG_ALTERNATIVE("DefinedValue", 2);
  5968. {LLSTATE llstate_1;XValue llatt_1;
  5969. if (!ll_valuereference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  5970. *llout = llstate_1;
  5971. {(*llret) = llatt_1;
  5972. break;
  5973. }}
  5974. case 3: case -3:
  5975. LLDEBUG_ALTERNATIVE("DefinedValue", 3);
  5976. {LLSTATE llstate_1;
  5977. if (!ll_ParameterizedValue(&llstate_0, &llstate_1)) goto failed2;
  5978. *llout = llstate_1;
  5979. {MyAbort();
  5980. break;
  5981. }}
  5982. default:
  5983. llstk[--llcstp] = 1;
  5984. goto failed1;
  5985. failed2:
  5986. LLDEBUG_BACKTRACKING("DefinedValue");
  5987. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  5988. llcpos = llpos1; llcstp = llstp1;
  5989. continue;
  5990. } break;
  5991. }}
  5992. LLDEBUG_LEAVE("DefinedValue", 1);
  5993. return 1;
  5994. failed1: LLDEBUG_LEAVE("DefinedValue", 0);
  5995. return 0;
  5996. }
  5997. int ll_ValueAssignment(LLSTATE *llin, LLSTATE *llout)
  5998. {
  5999. unsigned llstp = llcstp;
  6000. LLSTATE llstate_0;
  6001. LLDEBUG_ENTER("ValueAssignment");
  6002. llstate_0 = *llin;
  6003. #undef failed
  6004. #define failed failed1
  6005. {LLSTATE llstate_1;XValue llatt_1;
  6006. if (!ll_valuereference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  6007. {LLSTATE llstate_2;XType llatt_2;
  6008. if (!ll_Type(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  6009. {LLSTATE llstate_3;
  6010. if (!llterm(T_DEF, (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  6011. {LLSTATE llstate_4;XValue llatt_4;
  6012. if (!ll_Value(&llatt_4, &llstate_3, &llstate_4, llatt_2)) goto failed1;
  6013. *llout = llstate_4;
  6014. {if (!AssignValue(&(*llout).Assignments, llatt_1, llatt_4))
  6015. LLFAILED((&llstate_1.pos, "Value `%s' twice defined",
  6016. llatt_1->U.Reference.Identifier));
  6017. }}}}}
  6018. LLDEBUG_LEAVE("ValueAssignment", 1);
  6019. return 1;
  6020. failed1: LLDEBUG_LEAVE("ValueAssignment", 0);
  6021. return 0;
  6022. }
  6023. int ll_Value(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6024. {
  6025. unsigned llstp = llcstp;
  6026. LLSTATE llstate_0;
  6027. LLDEBUG_ENTER("Value");
  6028. llstate_0 = *llin;
  6029. #undef failed
  6030. #define failed failed1
  6031. #undef failed
  6032. #define failed failed2
  6033. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6034. LLCHECKSTK;
  6035. for (;;) {
  6036. switch (llstk[llcstp++]) {
  6037. case 1: case -1:
  6038. LLDEBUG_ALTERNATIVE("Value", 1);
  6039. {LLSTATE llstate_1;XValue llatt_1;
  6040. if (!ll_BuiltinValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6041. *llout = llstate_1;
  6042. {(*llret) = llatt_1;
  6043. break;
  6044. }}
  6045. case 2: case -2:
  6046. LLDEBUG_ALTERNATIVE("Value", 2);
  6047. {LLSTATE llstate_1;XValue llatt_1;
  6048. if (!ll_ReferencedValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  6049. *llout = llstate_1;
  6050. {(*llret) = llatt_1;
  6051. break;
  6052. }}
  6053. case 3: case -3:
  6054. LLDEBUG_ALTERNATIVE("Value", 3);
  6055. {LLSTATE llstate_1;XValue llatt_1;
  6056. if (!ll_ObjectClassFieldValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6057. *llout = llstate_1;
  6058. {(*llret) = llatt_1;
  6059. break;
  6060. }}
  6061. default:
  6062. llstk[--llcstp] = 1;
  6063. goto failed1;
  6064. failed2:
  6065. LLDEBUG_BACKTRACKING("Value");
  6066. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6067. llcpos = llpos1; llcstp = llstp1;
  6068. continue;
  6069. } break;
  6070. }}
  6071. LLDEBUG_LEAVE("Value", 1);
  6072. return 1;
  6073. failed1: LLDEBUG_LEAVE("Value", 0);
  6074. return 0;
  6075. }
  6076. int ll_BuiltinValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6077. {
  6078. unsigned llstp = llcstp;
  6079. LLSTATE llstate_0;
  6080. LLDEBUG_ENTER("BuiltinValue");
  6081. llstate_0 = *llin;
  6082. #undef failed
  6083. #define failed failed1
  6084. #undef failed
  6085. #define failed failed2
  6086. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6087. LLCHECKSTK;
  6088. for (;;) {
  6089. switch (llstk[llcstp++]) {
  6090. case 1: case -1:
  6091. LLDEBUG_ALTERNATIVE("BuiltinValue", 1);
  6092. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6093. GetTypeType((*llin).Assignments, llarg_type) != eType_BitString)
  6094. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6095. {LLSTATE llstate_1;XValue llatt_1;
  6096. if (!ll_BitStringValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6097. *llout = llstate_1;
  6098. {(*llret) = llatt_1;
  6099. break;
  6100. }}}
  6101. case 2: case -2:
  6102. LLDEBUG_ALTERNATIVE("BuiltinValue", 2);
  6103. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6104. GetTypeType((*llin).Assignments, llarg_type) != eType_Boolean)
  6105. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6106. {LLSTATE llstate_1;XValue llatt_1;
  6107. if (!ll_BooleanValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6108. *llout = llstate_1;
  6109. {(*llret) = llatt_1;
  6110. break;
  6111. }}}
  6112. case 3: case -3:
  6113. LLDEBUG_ALTERNATIVE("BuiltinValue", 3);
  6114. {LLSTATE llstate_1;XValue llatt_1;
  6115. if (!ll_CharacterStringValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6116. *llout = llstate_1;
  6117. {(*llret) = llatt_1;
  6118. break;
  6119. }}
  6120. case 4: case -4:
  6121. LLDEBUG_ALTERNATIVE("BuiltinValue", 4);
  6122. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6123. GetTypeType((*llin).Assignments, llarg_type) != eType_Choice)
  6124. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6125. {LLSTATE llstate_1;XValue llatt_1;
  6126. if (!ll_ChoiceValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6127. *llout = llstate_1;
  6128. {(*llret) = llatt_1;
  6129. break;
  6130. }}}
  6131. case 5: case -5:
  6132. LLDEBUG_ALTERNATIVE("BuiltinValue", 5);
  6133. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6134. GetTypeType((*llin).Assignments, llarg_type) != eType_EmbeddedPdv)
  6135. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6136. {LLSTATE llstate_1;XValue llatt_1;
  6137. if (!ll_EmbeddedPDVValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6138. *llout = llstate_1;
  6139. {(*llret) = llatt_1;
  6140. break;
  6141. }}}
  6142. case 6: case -6:
  6143. LLDEBUG_ALTERNATIVE("BuiltinValue", 6);
  6144. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6145. GetTypeType((*llin).Assignments, llarg_type) != eType_Enumerated)
  6146. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6147. {LLSTATE llstate_1;XValue llatt_1;
  6148. if (!ll_EnumeratedValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6149. *llout = llstate_1;
  6150. {(*llret) = llatt_1;
  6151. break;
  6152. }}}
  6153. case 7: case -7:
  6154. LLDEBUG_ALTERNATIVE("BuiltinValue", 7);
  6155. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6156. GetTypeType((*llin).Assignments, llarg_type) != eType_External)
  6157. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6158. {LLSTATE llstate_1;XValue llatt_1;
  6159. if (!ll_ExternalValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6160. *llout = llstate_1;
  6161. {(*llret) = llatt_1;
  6162. break;
  6163. }}}
  6164. case 8: case -8:
  6165. LLDEBUG_ALTERNATIVE("BuiltinValue", 8);
  6166. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6167. GetTypeType((*llin).Assignments, llarg_type) != eType_InstanceOf)
  6168. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6169. {LLSTATE llstate_1;XValue llatt_1;
  6170. if (!ll_InstanceOfValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6171. *llout = llstate_1;
  6172. {(*llret) = llatt_1;
  6173. break;
  6174. }}}
  6175. case 9: case -9:
  6176. LLDEBUG_ALTERNATIVE("BuiltinValue", 9);
  6177. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6178. GetTypeType((*llin).Assignments, llarg_type) != eType_Integer)
  6179. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6180. {LLSTATE llstate_1;XValue llatt_1;
  6181. if (!ll_IntegerValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6182. *llout = llstate_1;
  6183. {(*llret) = llatt_1;
  6184. break;
  6185. }}}
  6186. case 10: case -10:
  6187. LLDEBUG_ALTERNATIVE("BuiltinValue", 10);
  6188. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6189. GetTypeType((*llin).Assignments, llarg_type) != eType_Null)
  6190. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6191. {LLSTATE llstate_1;XValue llatt_1;
  6192. if (!ll_NullValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6193. *llout = llstate_1;
  6194. {(*llret) = llatt_1;
  6195. break;
  6196. }}}
  6197. case 11: case -11:
  6198. LLDEBUG_ALTERNATIVE("BuiltinValue", 11);
  6199. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6200. GetTypeType((*llin).Assignments, llarg_type) != eType_ObjectIdentifier)
  6201. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6202. {LLSTATE llstate_1;XValue llatt_1;
  6203. if (!ll_ObjectIdentifierValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  6204. *llout = llstate_1;
  6205. {(*llret) = llatt_1;
  6206. if (llatt_1->Type != NULL)
  6207. {
  6208. PropagatePrivateDirectives(llatt_1->Type, &(llarg_type->PrivateDirectives));
  6209. }
  6210. break;
  6211. }}}
  6212. case 12: case -12:
  6213. LLDEBUG_ALTERNATIVE("BuiltinValue", 12);
  6214. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6215. GetTypeType((*llin).Assignments, llarg_type) != eType_OctetString)
  6216. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6217. {LLSTATE llstate_1;XValue llatt_1;
  6218. if (!ll_OctetStringValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6219. *llout = llstate_1;
  6220. {(*llret) = llatt_1;
  6221. break;
  6222. }}}
  6223. case 13: case -13:
  6224. LLDEBUG_ALTERNATIVE("BuiltinValue", 13);
  6225. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6226. GetTypeType((*llin).Assignments, llarg_type) != eType_Real)
  6227. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6228. {LLSTATE llstate_1;XValue llatt_1;
  6229. if (!ll_RealValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6230. *llout = llstate_1;
  6231. {(*llret) = llatt_1;
  6232. break;
  6233. }}}
  6234. case 14: case -14:
  6235. LLDEBUG_ALTERNATIVE("BuiltinValue", 14);
  6236. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6237. GetTypeType((*llin).Assignments, llarg_type) !=
  6238. eType_GeneralizedTime)
  6239. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6240. {LLSTATE llstate_1;XValue llatt_1;
  6241. if (!ll_GeneralizedTimeValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6242. *llout = llstate_1;
  6243. {(*llret) = llatt_1;
  6244. break;
  6245. }}}
  6246. case 15: case -15:
  6247. LLDEBUG_ALTERNATIVE("BuiltinValue", 15);
  6248. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6249. GetTypeType((*llin).Assignments, llarg_type) != eType_UTCTime)
  6250. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6251. {LLSTATE llstate_1;XValue llatt_1;
  6252. if (!ll_UTCTimeValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6253. *llout = llstate_1;
  6254. {(*llret) = llatt_1;
  6255. break;
  6256. }}}
  6257. case 16: case -16:
  6258. LLDEBUG_ALTERNATIVE("BuiltinValue", 16);
  6259. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6260. GetTypeType((*llin).Assignments, llarg_type) != eType_ObjectDescriptor)
  6261. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6262. {LLSTATE llstate_1;XValue llatt_1;
  6263. if (!ll_ObjectDescriptorValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6264. *llout = llstate_1;
  6265. {(*llret) = llatt_1;
  6266. break;
  6267. }}}
  6268. case 17: case -17:
  6269. LLDEBUG_ALTERNATIVE("BuiltinValue", 17);
  6270. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6271. GetTypeType((*llin).Assignments, llarg_type) != eType_Sequence)
  6272. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6273. {LLSTATE llstate_1;XValue llatt_1;
  6274. if (!ll_SequenceValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6275. *llout = llstate_1;
  6276. {(*llret) = llatt_1;
  6277. break;
  6278. }}}
  6279. case 18: case -18:
  6280. LLDEBUG_ALTERNATIVE("BuiltinValue", 18);
  6281. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6282. GetTypeType((*llin).Assignments, llarg_type) != eType_SequenceOf)
  6283. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6284. {LLSTATE llstate_1;XValue llatt_1;
  6285. if (!ll_SequenceOfValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6286. *llout = llstate_1;
  6287. {(*llret) = llatt_1;
  6288. break;
  6289. }}}
  6290. case 19: case -19:
  6291. LLDEBUG_ALTERNATIVE("BuiltinValue", 19);
  6292. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6293. GetTypeType((*llin).Assignments, llarg_type) != eType_Set)
  6294. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6295. {LLSTATE llstate_1;XValue llatt_1;
  6296. if (!ll_SetValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6297. *llout = llstate_1;
  6298. {(*llret) = llatt_1;
  6299. break;
  6300. }}}
  6301. case 20: case -20:
  6302. LLDEBUG_ALTERNATIVE("BuiltinValue", 20);
  6303. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6304. GetTypeType((*llin).Assignments, llarg_type) != eType_SetOf)
  6305. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6306. {LLSTATE llstate_1;XValue llatt_1;
  6307. if (!ll_SetOfValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6308. *llout = llstate_1;
  6309. {(*llret) = llatt_1;
  6310. break;
  6311. }}}
  6312. case 21: case -21:
  6313. LLDEBUG_ALTERNATIVE("BuiltinValue", 21);
  6314. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6315. GetTypeType((*llin).Assignments, llarg_type) != eType_Open)
  6316. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6317. {LLSTATE llstate_1;XValue llatt_1;
  6318. if (!ll_AnyValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6319. *llout = llstate_1;
  6320. {(*llret) = llatt_1;
  6321. break;
  6322. }}}
  6323. case 22: case -22:
  6324. LLDEBUG_ALTERNATIVE("BuiltinValue", 22);
  6325. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  6326. GetTypeType((*llin).Assignments, llarg_type) != eType_Macro)
  6327. LLFAILED((&llstate_0.pos, "Bad type of value"));
  6328. {LLSTATE llstate_1;XValue llatt_1;
  6329. if (!ll_MacroDefinedValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6330. *llout = llstate_1;
  6331. {(*llret) = llatt_1;
  6332. break;
  6333. }}}
  6334. default:
  6335. llstk[--llcstp] = 1;
  6336. goto failed1;
  6337. failed2:
  6338. LLDEBUG_BACKTRACKING("BuiltinValue");
  6339. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6340. llcpos = llpos1; llcstp = llstp1;
  6341. continue;
  6342. } break;
  6343. }}
  6344. LLDEBUG_LEAVE("BuiltinValue", 1);
  6345. return 1;
  6346. failed1: LLDEBUG_LEAVE("BuiltinValue", 0);
  6347. return 0;
  6348. }
  6349. int ll_ReferencedValue(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  6350. {
  6351. unsigned llstp = llcstp;
  6352. LLSTATE llstate_0;
  6353. LLDEBUG_ENTER("ReferencedValue");
  6354. llstate_0 = *llin;
  6355. #undef failed
  6356. #define failed failed1
  6357. #undef failed
  6358. #define failed failed2
  6359. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6360. LLCHECKSTK;
  6361. for (;;) {
  6362. switch (llstk[llcstp++]) {
  6363. case 1: case -1:
  6364. LLDEBUG_ALTERNATIVE("ReferencedValue", 1);
  6365. {LLSTATE llstate_1;XValue llatt_1;
  6366. if (!ll_DefinedValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  6367. *llout = llstate_1;
  6368. {(*llret) = llatt_1;
  6369. break;
  6370. }}
  6371. case 2: case -2:
  6372. LLDEBUG_ALTERNATIVE("ReferencedValue", 2);
  6373. {LLSTATE llstate_1;XValue llatt_1;
  6374. if (!ll_ValueFromObject(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  6375. *llout = llstate_1;
  6376. {(*llret) = llatt_1;
  6377. break;
  6378. }}
  6379. default:
  6380. llstk[--llcstp] = 1;
  6381. goto failed1;
  6382. failed2:
  6383. LLDEBUG_BACKTRACKING("ReferencedValue");
  6384. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6385. llcpos = llpos1; llcstp = llstp1;
  6386. continue;
  6387. } break;
  6388. }}
  6389. LLDEBUG_LEAVE("ReferencedValue", 1);
  6390. return 1;
  6391. failed1: LLDEBUG_LEAVE("ReferencedValue", 0);
  6392. return 0;
  6393. }
  6394. int ll_NamedValue(XNamedValues *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components)
  6395. {
  6396. unsigned llstp = llcstp;
  6397. LLSTATE llstate_0;
  6398. LLDEBUG_ENTER("NamedValue");
  6399. llstate_0 = *llin;
  6400. #undef failed
  6401. #define failed failed1
  6402. {LLSTATE llstate_1;XString llatt_1;
  6403. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  6404. {Component_t *component;
  6405. Type_t *type;
  6406. component = FindComponent((*llin).Assignments, llarg_components, llatt_1);
  6407. if (component)
  6408. type = component->U.NOD.NamedType->Type;
  6409. else
  6410. type = NULL;
  6411. {LLSTATE llstate_2;XValue llatt_2;
  6412. if (!ll_Value(&llatt_2, &llstate_1, &llstate_2, type)) goto failed1;
  6413. *llout = llstate_2;
  6414. {(*llret) = NewNamedValue(llatt_1, llatt_2);
  6415. }}}}
  6416. LLDEBUG_LEAVE("NamedValue", 1);
  6417. return 1;
  6418. failed1: LLDEBUG_LEAVE("NamedValue", 0);
  6419. return 0;
  6420. }
  6421. int ll_BooleanValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6422. {
  6423. unsigned llstp = llcstp;
  6424. LLSTATE llstate_0;
  6425. LLDEBUG_ENTER("BooleanValue");
  6426. llstate_0 = *llin;
  6427. #undef failed
  6428. #define failed failed1
  6429. #undef failed
  6430. #define failed failed2
  6431. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6432. LLCHECKSTK;
  6433. for (;;) {
  6434. switch (llstk[llcstp++]) {
  6435. case 1: case -1:
  6436. LLDEBUG_ALTERNATIVE("BooleanValue", 1);
  6437. {LLSTATE llstate_1;
  6438. if (!llterm(T_TRUE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  6439. *llout = llstate_1;
  6440. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  6441. (*llret)->U.Boolean.Value = 1;
  6442. break;
  6443. }}
  6444. case 2: case -2:
  6445. LLDEBUG_ALTERNATIVE("BooleanValue", 2);
  6446. {LLSTATE llstate_1;
  6447. if (!llterm(T_FALSE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  6448. *llout = llstate_1;
  6449. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  6450. (*llret)->U.Boolean.Value = 0;
  6451. break;
  6452. }}
  6453. default:
  6454. llstk[--llcstp] = 1;
  6455. goto failed1;
  6456. failed2:
  6457. LLDEBUG_BACKTRACKING("BooleanValue");
  6458. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6459. llcpos = llpos1; llcstp = llstp1;
  6460. continue;
  6461. } break;
  6462. }}
  6463. LLDEBUG_LEAVE("BooleanValue", 1);
  6464. return 1;
  6465. failed1: LLDEBUG_LEAVE("BooleanValue", 0);
  6466. return 0;
  6467. }
  6468. int ll_SignedNumber(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6469. {
  6470. unsigned llstp = llcstp;
  6471. LLSTATE llstate_0;
  6472. LLDEBUG_ENTER("SignedNumber");
  6473. llstate_0 = *llin;
  6474. #undef failed
  6475. #define failed failed1
  6476. #undef failed
  6477. #define failed failed2
  6478. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6479. LLCHECKSTK;
  6480. for (;;) {
  6481. switch (llstk[llcstp++]) {
  6482. case 1: case -1:
  6483. LLDEBUG_ALTERNATIVE("SignedNumber", 1);
  6484. {LLSTATE llstate_1;XNumber llatt_1;
  6485. if (!llterm(T_number, &lllval, &llstate_0, &llstate_1)) goto failed2;
  6486. llatt_1 = lllval._XNumber;
  6487. *llout = llstate_1;
  6488. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  6489. (*llret)->U.Integer.Value = llatt_1;
  6490. break;
  6491. }}
  6492. case 2: case -2:
  6493. LLDEBUG_ALTERNATIVE("SignedNumber", 2);
  6494. {LLSTATE llstate_1;
  6495. if (!llterm('-', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  6496. {LLSTATE llstate_2;XNumber llatt_2;
  6497. if (!llterm(T_number, &lllval, &llstate_1, &llstate_2)) goto failed2;
  6498. llatt_2 = lllval._XNumber;
  6499. *llout = llstate_2;
  6500. {if (!intx_cmp(&llatt_2, &intx_0))
  6501. LLFAILED((&llstate_2.pos, "Bad negative value"));
  6502. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6503. intx_neg(&(*llret)->U.Integer.Value, &llatt_2);
  6504. break;
  6505. }}}
  6506. default:
  6507. llstk[--llcstp] = 1;
  6508. goto failed1;
  6509. failed2:
  6510. LLDEBUG_BACKTRACKING("SignedNumber");
  6511. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6512. llcpos = llpos1; llcstp = llstp1;
  6513. continue;
  6514. } break;
  6515. }}
  6516. LLDEBUG_LEAVE("SignedNumber", 1);
  6517. return 1;
  6518. failed1: LLDEBUG_LEAVE("SignedNumber", 0);
  6519. return 0;
  6520. }
  6521. int ll_IntegerValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6522. {
  6523. unsigned llstp = llcstp;
  6524. LLSTATE llstate_0;
  6525. LLDEBUG_ENTER("IntegerValue");
  6526. llstate_0 = *llin;
  6527. #undef failed
  6528. #define failed failed1
  6529. #undef failed
  6530. #define failed failed2
  6531. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6532. LLCHECKSTK;
  6533. for (;;) {
  6534. switch (llstk[llcstp++]) {
  6535. case 1: case -1:
  6536. LLDEBUG_ALTERNATIVE("IntegerValue", 1);
  6537. {LLSTATE llstate_1;XValue llatt_1;
  6538. if (!ll_SignedNumber(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6539. *llout = llstate_1;
  6540. {(*llret) = llatt_1;
  6541. break;
  6542. }}
  6543. case 2: case -2:
  6544. LLDEBUG_ALTERNATIVE("IntegerValue", 2);
  6545. {LLSTATE llstate_1;XString llatt_1;
  6546. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  6547. *llout = llstate_1;
  6548. {NamedNumber_t *n;
  6549. Type_t *type;
  6550. type = GetType((*llout).Assignments, llarg_type);
  6551. if (type) {
  6552. n = FindNamedNumber(type->U.Integer.NamedNumbers, llatt_1);
  6553. if (!n)
  6554. LLFAILED((&llstate_1.pos, "Undefined integer value"));
  6555. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6556. intx_dup(&(*llret)->U.Integer.Value,
  6557. &n->U.Normal.Value->U.Integer.Value);
  6558. } else {
  6559. (*llret) = NULL;
  6560. }
  6561. break;
  6562. }}
  6563. default:
  6564. llstk[--llcstp] = 1;
  6565. goto failed1;
  6566. failed2:
  6567. LLDEBUG_BACKTRACKING("IntegerValue");
  6568. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6569. llcpos = llpos1; llcstp = llstp1;
  6570. continue;
  6571. } break;
  6572. }}
  6573. LLDEBUG_LEAVE("IntegerValue", 1);
  6574. return 1;
  6575. failed1: LLDEBUG_LEAVE("IntegerValue", 0);
  6576. return 0;
  6577. }
  6578. int ll_EnumeratedValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6579. {
  6580. unsigned llstp = llcstp;
  6581. LLSTATE llstate_0;
  6582. LLDEBUG_ENTER("EnumeratedValue");
  6583. llstate_0 = *llin;
  6584. #undef failed
  6585. #define failed failed1
  6586. {LLSTATE llstate_1;XString llatt_1;
  6587. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  6588. *llout = llstate_1;
  6589. {NamedNumber_t *n;
  6590. Type_t *type;
  6591. type = GetType((*llout).Assignments, llarg_type);
  6592. if (type) {
  6593. n = FindNamedNumber(type->U.Enumerated.NamedNumbers, llatt_1);
  6594. if (!n)
  6595. LLFAILED((&llstate_1.pos, "Undefined enumeration value"));
  6596. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6597. (*llret)->U.Enumerated.Value =
  6598. intx2uint32(&n->U.Normal.Value->U.Integer.Value);
  6599. } else {
  6600. (*llret) = NULL;
  6601. }
  6602. }}
  6603. LLDEBUG_LEAVE("EnumeratedValue", 1);
  6604. return 1;
  6605. failed1: LLDEBUG_LEAVE("EnumeratedValue", 0);
  6606. return 0;
  6607. }
  6608. int ll_RealValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6609. {
  6610. unsigned llstp = llcstp;
  6611. LLSTATE llstate_0;
  6612. LLDEBUG_ENTER("RealValue");
  6613. llstate_0 = *llin;
  6614. #undef failed
  6615. #define failed failed1
  6616. #undef failed
  6617. #define failed failed2
  6618. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6619. LLCHECKSTK;
  6620. for (;;) {
  6621. switch (llstk[llcstp++]) {
  6622. case 1: case -1:
  6623. LLDEBUG_ALTERNATIVE("RealValue", 1);
  6624. {LLSTATE llstate_1;XValue llatt_1;
  6625. if (!ll_NumericRealValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6626. *llout = llstate_1;
  6627. {(*llret) = llatt_1;
  6628. break;
  6629. }}
  6630. case 2: case -2:
  6631. LLDEBUG_ALTERNATIVE("RealValue", 2);
  6632. {LLSTATE llstate_1;XValue llatt_1;
  6633. if (!ll_SpecialRealValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6634. *llout = llstate_1;
  6635. {(*llret) = llatt_1;
  6636. break;
  6637. }}
  6638. default:
  6639. llstk[--llcstp] = 1;
  6640. goto failed1;
  6641. failed2:
  6642. LLDEBUG_BACKTRACKING("RealValue");
  6643. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6644. llcpos = llpos1; llcstp = llstp1;
  6645. continue;
  6646. } break;
  6647. }}
  6648. LLDEBUG_LEAVE("RealValue", 1);
  6649. return 1;
  6650. failed1: LLDEBUG_LEAVE("RealValue", 0);
  6651. return 0;
  6652. }
  6653. int ll_NumericRealValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6654. {
  6655. unsigned llstp = llcstp;
  6656. LLSTATE llstate_0;
  6657. LLDEBUG_ENTER("NumericRealValue");
  6658. llstate_0 = *llin;
  6659. #undef failed
  6660. #define failed failed1
  6661. #undef failed
  6662. #define failed failed2
  6663. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6664. LLCHECKSTK;
  6665. for (;;) {
  6666. switch (llstk[llcstp++]) {
  6667. case 1: case -1:
  6668. LLDEBUG_ALTERNATIVE("NumericRealValue", 1);
  6669. {LLSTATE llstate_1;XNumber llatt_1;
  6670. if (!llterm(T_number, &lllval, &llstate_0, &llstate_1)) goto failed2;
  6671. llatt_1 = lllval._XNumber;
  6672. *llout = llstate_1;
  6673. {if (intx_cmp(&llatt_1, &intx_0))
  6674. LLFAILED((&llstate_1.pos, "Bad real value"));
  6675. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6676. break;
  6677. }}
  6678. case 2: case -2:
  6679. LLDEBUG_ALTERNATIVE("NumericRealValue", 2);
  6680. {LLSTATE llstate_1;XValue llatt_1;
  6681. if (!ll_SequenceValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6682. *llout = llstate_1;
  6683. {NamedValue_t *mant, *expo, *base;
  6684. mant = FindNamedValue(llatt_1->U.Sequence.NamedValues, "mantissa");
  6685. expo = FindNamedValue(llatt_1->U.Sequence.NamedValues, "exponent");
  6686. base = FindNamedValue(llatt_1->U.Sequence.NamedValues, "base");
  6687. if (!mant || !expo || !base) {
  6688. (*llret) = NULL;
  6689. } else {
  6690. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6691. intx_dup(&(*llret)->U.Real.Value.mantissa,
  6692. &mant->Value->U.Integer.Value);
  6693. intx_dup(&(*llret)->U.Real.Value.exponent,
  6694. &expo->Value->U.Integer.Value);
  6695. (*llret)->U.Real.Value.base =
  6696. intx2uint32(&base->Value->U.Integer.Value);
  6697. }
  6698. break;
  6699. }}
  6700. default:
  6701. llstk[--llcstp] = 1;
  6702. goto failed1;
  6703. failed2:
  6704. LLDEBUG_BACKTRACKING("NumericRealValue");
  6705. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6706. llcpos = llpos1; llcstp = llstp1;
  6707. continue;
  6708. } break;
  6709. }}
  6710. LLDEBUG_LEAVE("NumericRealValue", 1);
  6711. return 1;
  6712. failed1: LLDEBUG_LEAVE("NumericRealValue", 0);
  6713. return 0;
  6714. }
  6715. int ll_SpecialRealValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6716. {
  6717. unsigned llstp = llcstp;
  6718. LLSTATE llstate_0;
  6719. LLDEBUG_ENTER("SpecialRealValue");
  6720. llstate_0 = *llin;
  6721. #undef failed
  6722. #define failed failed1
  6723. #undef failed
  6724. #define failed failed2
  6725. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6726. LLCHECKSTK;
  6727. for (;;) {
  6728. switch (llstk[llcstp++]) {
  6729. case 1: case -1:
  6730. LLDEBUG_ALTERNATIVE("SpecialRealValue", 1);
  6731. {LLSTATE llstate_1;
  6732. if (!llterm(T_PLUS_INFINITY, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  6733. *llout = llstate_1;
  6734. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  6735. (*llret)->U.Real.Value.type = eReal_PlusInfinity;
  6736. break;
  6737. }}
  6738. case 2: case -2:
  6739. LLDEBUG_ALTERNATIVE("SpecialRealValue", 2);
  6740. {LLSTATE llstate_1;
  6741. if (!llterm(T_MINUS_INFINITY, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  6742. *llout = llstate_1;
  6743. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  6744. (*llret)->U.Real.Value.type = eReal_MinusInfinity;
  6745. break;
  6746. }}
  6747. default:
  6748. llstk[--llcstp] = 1;
  6749. goto failed1;
  6750. failed2:
  6751. LLDEBUG_BACKTRACKING("SpecialRealValue");
  6752. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6753. llcpos = llpos1; llcstp = llstp1;
  6754. continue;
  6755. } break;
  6756. }}
  6757. LLDEBUG_LEAVE("SpecialRealValue", 1);
  6758. return 1;
  6759. failed1: LLDEBUG_LEAVE("SpecialRealValue", 0);
  6760. return 0;
  6761. }
  6762. int ll_BitStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6763. {
  6764. unsigned llstp = llcstp;
  6765. LLSTATE llstate_0;
  6766. LLDEBUG_ENTER("BitStringValue");
  6767. llstate_0 = *llin;
  6768. #undef failed
  6769. #define failed failed1
  6770. #undef failed
  6771. #define failed failed2
  6772. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6773. LLCHECKSTK;
  6774. for (;;) {
  6775. switch (llstk[llcstp++]) {
  6776. case 1: case -1:
  6777. LLDEBUG_ALTERNATIVE("BitStringValue", 1);
  6778. {LLSTATE llstate_1;XString llatt_1;
  6779. if (!llterm(T_bstring, &lllval, &llstate_0, &llstate_1)) goto failed2;
  6780. llatt_1 = lllval._XString;
  6781. *llout = llstate_1;
  6782. {int i, len;
  6783. if (GetTypeType((*llout).Assignments, llarg_type) == eType_BitString) {
  6784. len = strlen(llatt_1);
  6785. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6786. (*llret)->U.BitString.Value.length = len;
  6787. (*llret)->U.BitString.Value.value =
  6788. (octet_t *)malloc((len + 7) / 8);
  6789. memset((*llret)->U.BitString.Value.value, 0, (len + 7) / 8);
  6790. for (i = 0; i < len; i++) {
  6791. if (llatt_1[i] == '1')
  6792. ASN1BITSET((*llret)->U.BitString.Value.value, i);
  6793. }
  6794. } else {
  6795. (*llret) = NULL;
  6796. }
  6797. break;
  6798. }}
  6799. case 2: case -2:
  6800. LLDEBUG_ALTERNATIVE("BitStringValue", 2);
  6801. {LLSTATE llstate_1;XString llatt_1;
  6802. if (!llterm(T_hstring, &lllval, &llstate_0, &llstate_1)) goto failed2;
  6803. llatt_1 = lllval._XString;
  6804. *llout = llstate_1;
  6805. {int i, len, c;
  6806. if (GetTypeType((*llout).Assignments, llarg_type) == eType_BitString) {
  6807. len = strlen(llatt_1);
  6808. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6809. (*llret)->U.BitString.Value.length = len * 4;
  6810. (*llret)->U.BitString.Value.value =
  6811. (octet_t *)malloc((len + 1) / 2);
  6812. memset((*llret)->U.BitString.Value.value, 0, (len + 1) / 2);
  6813. for (i = 0; i < len; i++) {
  6814. c = isdigit(llatt_1[i]) ? llatt_1[i] - '0' : llatt_1[i] - 'A' + 10;
  6815. (*llret)->U.BitString.Value.value[i / 2] |=
  6816. (i & 1) ? c : (c << 4);
  6817. }
  6818. } else {
  6819. (*llret) = NULL;
  6820. }
  6821. break;
  6822. }}
  6823. case 3: case -3:
  6824. LLDEBUG_ALTERNATIVE("BitStringValue", 3);
  6825. {LLSTATE llstate_1;
  6826. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  6827. {LLSTATE llstate_2;XValue llatt_2;
  6828. if (!ll_IdentifierList(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed2;
  6829. {LLSTATE llstate_3;
  6830. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  6831. *llout = llstate_3;
  6832. {(*llret) = llatt_2;
  6833. break;
  6834. }}}}
  6835. case 4: case -4:
  6836. LLDEBUG_ALTERNATIVE("BitStringValue", 4);
  6837. {LLSTATE llstate_1;
  6838. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  6839. {LLSTATE llstate_2;
  6840. if (!llterm('}', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  6841. *llout = llstate_2;
  6842. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  6843. break;
  6844. }}}
  6845. default:
  6846. llstk[--llcstp] = 1;
  6847. goto failed1;
  6848. failed2:
  6849. LLDEBUG_BACKTRACKING("BitStringValue");
  6850. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6851. llcpos = llpos1; llcstp = llstp1;
  6852. continue;
  6853. } break;
  6854. }}
  6855. LLDEBUG_LEAVE("BitStringValue", 1);
  6856. return 1;
  6857. failed1: LLDEBUG_LEAVE("BitStringValue", 0);
  6858. return 0;
  6859. }
  6860. int ll_IdentifierList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6861. {
  6862. unsigned llstp = llcstp;
  6863. LLSTATE llstate_0;
  6864. LLDEBUG_ENTER("IdentifierList");
  6865. llstate_0 = *llin;
  6866. #undef failed
  6867. #define failed failed1
  6868. {LLSTATE llstate_1;XValue llatt_1;
  6869. if (!ll_IdentifierList_Elem(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  6870. {LLSTATE llstate_2;XValue llatt_2;
  6871. if (!ll_Identifier_EList(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed1;
  6872. *llout = llstate_2;
  6873. {uint32_t bit, len;
  6874. bitstring_t *src, *dst;
  6875. if (llatt_1 && llatt_2) {
  6876. bit = intx2uint32(&llatt_1->U.Integer.Value);
  6877. src = &llatt_2->U.BitString.Value;
  6878. len = bit + 1;
  6879. if (len < src->length)
  6880. len = src->length;
  6881. (*llret) = DupValue(llatt_2);
  6882. dst = &(*llret)->U.BitString.Value;
  6883. dst->length = len;
  6884. dst->value = (octet_t *)malloc((len + 7) / 8);
  6885. memcpy(dst->value, src->value, (src->length + 7) / 8);
  6886. memset(dst->value + (src->length + 7) / 8, 0,
  6887. (len + 7) / 8 - (src->length + 7) / 8);
  6888. ASN1BITSET(dst->value, bit);
  6889. } else if (llatt_1) {
  6890. bit = intx2uint32(&llatt_1->U.Integer.Value);
  6891. len = bit + 1;
  6892. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6893. dst = &(*llret)->U.BitString.Value;
  6894. dst->length = len;
  6895. dst->value = (octet_t *)malloc((len + 7) / 8);
  6896. memset(dst->value, 0, (len + 7) / 8);
  6897. ASN1BITSET(dst->value, bit);
  6898. } else {
  6899. (*llret) = NULL;
  6900. }
  6901. }}}
  6902. LLDEBUG_LEAVE("IdentifierList", 1);
  6903. return 1;
  6904. failed1: LLDEBUG_LEAVE("IdentifierList", 0);
  6905. return 0;
  6906. }
  6907. int ll_Identifier_EList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6908. {
  6909. unsigned llstp = llcstp;
  6910. LLSTATE llstate_0;
  6911. LLDEBUG_ENTER("Identifier_EList");
  6912. llstate_0 = *llin;
  6913. #undef failed
  6914. #define failed failed1
  6915. #undef failed
  6916. #define failed failed2
  6917. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  6918. LLCHECKSTK;
  6919. for (;;) {
  6920. switch (llstk[llcstp++]) {
  6921. case 1: case -1:
  6922. LLDEBUG_ALTERNATIVE("Identifier_EList", 1);
  6923. {LLSTATE llstate_1;XValue llatt_1;
  6924. if (!ll_IdentifierList_Elem(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  6925. {LLSTATE llstate_2;XValue llatt_2;
  6926. if (!ll_Identifier_EList(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed2;
  6927. *llout = llstate_2;
  6928. {uint32_t bit, len;
  6929. bitstring_t *src, *dst;
  6930. if (llatt_1 && llatt_2) {
  6931. bit = intx2uint32(&llatt_1->U.Integer.Value);
  6932. src = &llatt_2->U.BitString.Value;
  6933. len = bit + 1;
  6934. if (len < src->length)
  6935. len = src->length;
  6936. (*llret) = DupValue(llatt_2);
  6937. dst = &(*llret)->U.BitString.Value;
  6938. dst->length = len;
  6939. dst->value = (octet_t *)malloc((len + 7) / 8);
  6940. memcpy(dst->value, src->value, (src->length + 7) / 8);
  6941. memset(dst->value + (src->length + 7) / 8, 0,
  6942. (len + 7) / 8 - (src->length + 7) / 8);
  6943. ASN1BITSET(dst->value, bit);
  6944. } else if (llatt_1) {
  6945. bit = intx2uint32(&llatt_1->U.Integer.Value);
  6946. len = bit + 1;
  6947. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6948. dst = &(*llret)->U.BitString.Value;
  6949. dst->length = len;
  6950. dst->value = (octet_t *)malloc((len + 7) / 8);
  6951. memset(dst->value, 0, (len + 7) / 8);
  6952. ASN1BITSET(dst->value, bit);
  6953. } else {
  6954. (*llret) = NULL;
  6955. }
  6956. break;
  6957. }}}
  6958. case 2: case -2:
  6959. LLDEBUG_ALTERNATIVE("Identifier_EList", 2);
  6960. *llout = llstate_0;
  6961. {if (llarg_type) {
  6962. (*llret) = NewValue((*llout).Assignments, llarg_type);
  6963. } else {
  6964. (*llret) = NULL;
  6965. }
  6966. break;
  6967. }
  6968. default:
  6969. llstk[--llcstp] = 1;
  6970. goto failed1;
  6971. failed2:
  6972. LLDEBUG_BACKTRACKING("Identifier_EList");
  6973. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  6974. llcpos = llpos1; llcstp = llstp1;
  6975. continue;
  6976. } break;
  6977. }}
  6978. LLDEBUG_LEAVE("Identifier_EList", 1);
  6979. return 1;
  6980. failed1: LLDEBUG_LEAVE("Identifier_EList", 0);
  6981. return 0;
  6982. }
  6983. int ll_IdentifierList_Elem(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  6984. {
  6985. unsigned llstp = llcstp;
  6986. LLSTATE llstate_0;
  6987. LLDEBUG_ENTER("IdentifierList_Elem");
  6988. llstate_0 = *llin;
  6989. #undef failed
  6990. #define failed failed1
  6991. {LLSTATE llstate_1;XString llatt_1;
  6992. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  6993. *llout = llstate_1;
  6994. {Value_t *v;
  6995. NamedNumber_t *n;
  6996. Type_t *type;
  6997. type = GetType((*llout).Assignments, llarg_type);
  6998. if (type) {
  6999. n = FindNamedNumber(type->U.BitString.NamedNumbers, llatt_1);
  7000. if (!n)
  7001. LLFAILED((&llstate_1.pos, "Bad bit string value"));
  7002. v = GetValue((*llout).Assignments, n->U.Normal.Value);
  7003. if (v) {
  7004. if (GetTypeType((*llout).Assignments, v->Type) != eType_Integer)
  7005. MyAbort();
  7006. (*llret) = v;
  7007. } else {
  7008. (*llret) = NULL;
  7009. }
  7010. } else {
  7011. (*llret) = NULL;
  7012. }
  7013. }}
  7014. LLDEBUG_LEAVE("IdentifierList_Elem", 1);
  7015. return 1;
  7016. failed1: LLDEBUG_LEAVE("IdentifierList_Elem", 0);
  7017. return 0;
  7018. }
  7019. int ll_OctetStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7020. {
  7021. unsigned llstp = llcstp;
  7022. LLSTATE llstate_0;
  7023. LLDEBUG_ENTER("OctetStringValue");
  7024. llstate_0 = *llin;
  7025. #undef failed
  7026. #define failed failed1
  7027. #undef failed
  7028. #define failed failed2
  7029. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7030. LLCHECKSTK;
  7031. for (;;) {
  7032. switch (llstk[llcstp++]) {
  7033. case 1: case -1:
  7034. LLDEBUG_ALTERNATIVE("OctetStringValue", 1);
  7035. {LLSTATE llstate_1;XString llatt_1;
  7036. if (!llterm(T_bstring, &lllval, &llstate_0, &llstate_1)) goto failed2;
  7037. llatt_1 = lllval._XString;
  7038. *llout = llstate_1;
  7039. {int len, i;
  7040. if (GetTypeType((*llout).Assignments, llarg_type) == eType_OctetString) {
  7041. len = strlen(llatt_1);
  7042. (*llret) = NewValue((*llout).Assignments, llarg_type);
  7043. (*llret)->U.OctetString.Value.length = (len + 7) / 8;
  7044. (*llret)->U.OctetString.Value.value =
  7045. (octet_t *)malloc((len + 7) / 8);
  7046. memset((*llret)->U.OctetString.Value.value, 0, (len + 7) / 8);
  7047. for (i = 0; i < len; i++) {
  7048. if (llatt_1[i] == '1')
  7049. ASN1BITSET((*llret)->U.OctetString.Value.value, i);
  7050. }
  7051. } else {
  7052. (*llret) = NULL;
  7053. }
  7054. break;
  7055. }}
  7056. case 2: case -2:
  7057. LLDEBUG_ALTERNATIVE("OctetStringValue", 2);
  7058. {LLSTATE llstate_1;XString llatt_1;
  7059. if (!llterm(T_hstring, &lllval, &llstate_0, &llstate_1)) goto failed2;
  7060. llatt_1 = lllval._XString;
  7061. *llout = llstate_1;
  7062. {int i, len, c;
  7063. if (GetTypeType((*llout).Assignments, llarg_type) == eType_OctetString) {
  7064. len = strlen(llatt_1);
  7065. (*llret) = NewValue((*llout).Assignments, llarg_type);
  7066. (*llret)->U.OctetString.Value.length = (len + 1) / 2;
  7067. (*llret)->U.OctetString.Value.value =
  7068. (octet_t *)malloc((len + 1) / 2);
  7069. memset((*llret)->U.OctetString.Value.value, 0, (len + 1) / 2);
  7070. for (i = 0; i < len; i++) {
  7071. c = isdigit(llatt_1[i]) ? llatt_1[i] - '0' : llatt_1[i] - 'A' + 10;
  7072. (*llret)->U.OctetString.Value.value[i / 2] |=
  7073. (i & 1) ? c : (c << 4);
  7074. }
  7075. } else {
  7076. (*llret) = NULL;
  7077. }
  7078. break;
  7079. }}
  7080. default:
  7081. llstk[--llcstp] = 1;
  7082. goto failed1;
  7083. failed2:
  7084. LLDEBUG_BACKTRACKING("OctetStringValue");
  7085. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7086. llcpos = llpos1; llcstp = llstp1;
  7087. continue;
  7088. } break;
  7089. }}
  7090. LLDEBUG_LEAVE("OctetStringValue", 1);
  7091. return 1;
  7092. failed1: LLDEBUG_LEAVE("OctetStringValue", 0);
  7093. return 0;
  7094. }
  7095. int ll_NullValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7096. {
  7097. unsigned llstp = llcstp;
  7098. LLSTATE llstate_0;
  7099. LLDEBUG_ENTER("NullValue");
  7100. llstate_0 = *llin;
  7101. #undef failed
  7102. #define failed failed1
  7103. {LLSTATE llstate_1;
  7104. if (!llterm(T_NULL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  7105. *llout = llstate_1;
  7106. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7107. }}
  7108. LLDEBUG_LEAVE("NullValue", 1);
  7109. return 1;
  7110. failed1: LLDEBUG_LEAVE("NullValue", 0);
  7111. return 0;
  7112. }
  7113. int ll_GeneralizedTimeValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7114. {
  7115. unsigned llstp = llcstp;
  7116. LLSTATE llstate_0;
  7117. LLDEBUG_ENTER("GeneralizedTimeValue");
  7118. llstate_0 = *llin;
  7119. #undef failed
  7120. #define failed failed1
  7121. {LLSTATE llstate_1;XValue llatt_1;
  7122. if (!ll_RestrictedCharacterStringValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  7123. *llout = llstate_1;
  7124. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7125. if (!String2GeneralizedTime(&(*llret)->U.GeneralizedTime.Value,
  7126. &llatt_1->U.RestrictedString.Value))
  7127. LLFAILED((&llstate_1.pos, "Bad time value"));
  7128. }}
  7129. LLDEBUG_LEAVE("GeneralizedTimeValue", 1);
  7130. return 1;
  7131. failed1: LLDEBUG_LEAVE("GeneralizedTimeValue", 0);
  7132. return 0;
  7133. }
  7134. int ll_UTCTimeValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7135. {
  7136. unsigned llstp = llcstp;
  7137. LLSTATE llstate_0;
  7138. LLDEBUG_ENTER("UTCTimeValue");
  7139. llstate_0 = *llin;
  7140. #undef failed
  7141. #define failed failed1
  7142. {LLSTATE llstate_1;XValue llatt_1;
  7143. if (!ll_RestrictedCharacterStringValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  7144. *llout = llstate_1;
  7145. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7146. if (!String2UTCTime(&(*llret)->U.UTCTime.Value,
  7147. &llatt_1->U.RestrictedString.Value))
  7148. LLFAILED((&llstate_1.pos, "Bad time value"));
  7149. }}
  7150. LLDEBUG_LEAVE("UTCTimeValue", 1);
  7151. return 1;
  7152. failed1: LLDEBUG_LEAVE("UTCTimeValue", 0);
  7153. return 0;
  7154. }
  7155. int ll_ObjectDescriptorValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7156. {
  7157. unsigned llstp = llcstp;
  7158. LLSTATE llstate_0;
  7159. LLDEBUG_ENTER("ObjectDescriptorValue");
  7160. llstate_0 = *llin;
  7161. #undef failed
  7162. #define failed failed1
  7163. {LLSTATE llstate_1;XValue llatt_1;
  7164. if (!ll_RestrictedCharacterStringValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  7165. *llout = llstate_1;
  7166. {(*llret) = llatt_1;
  7167. }}
  7168. LLDEBUG_LEAVE("ObjectDescriptorValue", 1);
  7169. return 1;
  7170. failed1: LLDEBUG_LEAVE("ObjectDescriptorValue", 0);
  7171. return 0;
  7172. }
  7173. int ll_SequenceValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7174. {
  7175. unsigned llstp = llcstp;
  7176. LLSTATE llstate_0;
  7177. LLDEBUG_ENTER("SequenceValue");
  7178. llstate_0 = *llin;
  7179. #undef failed
  7180. #define failed failed1
  7181. #undef failed
  7182. #define failed failed2
  7183. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7184. LLCHECKSTK;
  7185. for (;;) {
  7186. switch (llstk[llcstp++]) {
  7187. case 1: case -1:
  7188. LLDEBUG_ALTERNATIVE("SequenceValue", 1);
  7189. {LLSTATE llstate_1;
  7190. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7191. {Component_t *components;
  7192. Type_t *type;
  7193. type = GetType(llstate_1.Assignments, llarg_type);
  7194. components = type ? type->U.SSC.Components : NULL;
  7195. {LLSTATE llstate_2;XNamedValues llatt_2;
  7196. if (!ll_ComponentValueList(&llatt_2, &llstate_1, &llstate_2, components)) goto failed2;
  7197. {LLSTATE llstate_3;
  7198. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  7199. *llout = llstate_3;
  7200. {Component_t *c;
  7201. NamedValue_t *v;
  7202. if (type) {
  7203. for (c = components, v = llatt_2; c; c = c->Next) {
  7204. switch (c->Type) {
  7205. case eComponent_Normal:
  7206. if (!v)
  7207. LLFAILED((&llstate_2.pos,
  7208. "Value for component `%s' is missing",
  7209. c->U.NOD.NamedType->Identifier));
  7210. if (strcmp(v->Identifier,
  7211. c->U.NOD.NamedType->Identifier))
  7212. LLFAILED((&llstate_2.pos, "Value for component `%s' expected",
  7213. c->U.NOD.NamedType->Identifier));
  7214. v = v->Next;
  7215. break;
  7216. case eComponent_Optional:
  7217. case eComponent_Default:
  7218. if (v && !strcmp(v->Identifier,
  7219. c->U.NOD.NamedType->Identifier))
  7220. v = v->Next;
  7221. break;
  7222. }
  7223. }
  7224. if (v)
  7225. LLFAILED((&llstate_2.pos, "Component `%s' is unexpected",
  7226. v->Identifier));
  7227. }
  7228. (*llret) = NewValue((*llout).Assignments, llarg_type);
  7229. (*llret)->U.SSC.NamedValues = llatt_2;
  7230. break;
  7231. }}}}}
  7232. case 2: case -2:
  7233. LLDEBUG_ALTERNATIVE("SequenceValue", 2);
  7234. {LLSTATE llstate_1;
  7235. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7236. {LLSTATE llstate_2;
  7237. if (!llterm('}', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  7238. *llout = llstate_2;
  7239. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7240. break;
  7241. }}}
  7242. default:
  7243. llstk[--llcstp] = 1;
  7244. goto failed1;
  7245. failed2:
  7246. LLDEBUG_BACKTRACKING("SequenceValue");
  7247. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7248. llcpos = llpos1; llcstp = llstp1;
  7249. continue;
  7250. } break;
  7251. }}
  7252. LLDEBUG_LEAVE("SequenceValue", 1);
  7253. return 1;
  7254. failed1: LLDEBUG_LEAVE("SequenceValue", 0);
  7255. return 0;
  7256. }
  7257. int ll_ComponentValueList(XNamedValues *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components)
  7258. {
  7259. unsigned llstp = llcstp;
  7260. LLSTATE llstate_0;
  7261. LLDEBUG_ENTER("ComponentValueList");
  7262. llstate_0 = *llin;
  7263. #undef failed
  7264. #define failed failed1
  7265. {LLSTATE llstate_1;XNamedValues llatt_1;
  7266. if (!ll_NamedValue(&llatt_1, &llstate_0, &llstate_1, llarg_components)) goto failed1;
  7267. {LLSTATE llstate_2;XNamedValues llatt_2;
  7268. if (!ll_ComponentValueCList(&llatt_2, &llstate_1, &llstate_2, llarg_components)) goto failed1;
  7269. *llout = llstate_2;
  7270. {if (llatt_2) {
  7271. (*llret) = DupNamedValue(llatt_1);
  7272. (*llret)->Next = llatt_2;
  7273. } else {
  7274. (*llret) = llatt_1;
  7275. }
  7276. }}}
  7277. LLDEBUG_LEAVE("ComponentValueList", 1);
  7278. return 1;
  7279. failed1: LLDEBUG_LEAVE("ComponentValueList", 0);
  7280. return 0;
  7281. }
  7282. int ll_ComponentValueCList(XNamedValues *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components)
  7283. {
  7284. unsigned llstp = llcstp;
  7285. LLSTATE llstate_0;
  7286. LLDEBUG_ENTER("ComponentValueCList");
  7287. llstate_0 = *llin;
  7288. #undef failed
  7289. #define failed failed1
  7290. #undef failed
  7291. #define failed failed2
  7292. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7293. LLCHECKSTK;
  7294. for (;;) {
  7295. switch (llstk[llcstp++]) {
  7296. case 1: case -1:
  7297. LLDEBUG_ALTERNATIVE("ComponentValueCList", 1);
  7298. {LLSTATE llstate_1;
  7299. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7300. {LLSTATE llstate_2;XNamedValues llatt_2;
  7301. if (!ll_ComponentValueList(&llatt_2, &llstate_1, &llstate_2, llarg_components)) goto failed2;
  7302. *llout = llstate_2;
  7303. {(*llret) = llatt_2;
  7304. break;
  7305. }}}
  7306. case 2: case -2:
  7307. LLDEBUG_ALTERNATIVE("ComponentValueCList", 2);
  7308. *llout = llstate_0;
  7309. {(*llret) = NULL;
  7310. break;
  7311. }
  7312. default:
  7313. llstk[--llcstp] = 1;
  7314. goto failed1;
  7315. failed2:
  7316. LLDEBUG_BACKTRACKING("ComponentValueCList");
  7317. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7318. llcpos = llpos1; llcstp = llstp1;
  7319. continue;
  7320. } break;
  7321. }}
  7322. LLDEBUG_LEAVE("ComponentValueCList", 1);
  7323. return 1;
  7324. failed1: LLDEBUG_LEAVE("ComponentValueCList", 0);
  7325. return 0;
  7326. }
  7327. int ll_SequenceOfValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7328. {
  7329. unsigned llstp = llcstp;
  7330. LLSTATE llstate_0;
  7331. LLDEBUG_ENTER("SequenceOfValue");
  7332. llstate_0 = *llin;
  7333. #undef failed
  7334. #define failed failed1
  7335. #undef failed
  7336. #define failed failed2
  7337. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7338. LLCHECKSTK;
  7339. for (;;) {
  7340. switch (llstk[llcstp++]) {
  7341. case 1: case -1:
  7342. LLDEBUG_ALTERNATIVE("SequenceOfValue", 1);
  7343. {LLSTATE llstate_1;
  7344. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7345. {Type_t *type, *subtype;
  7346. type = GetType(llstate_1.Assignments, llarg_type);
  7347. subtype = (type ? type->U.SS.Type : NULL);
  7348. {LLSTATE llstate_2;XValue llatt_2;
  7349. if (!ll_ValueList(&llatt_2, &llstate_1, &llstate_2, subtype)) goto failed2;
  7350. {LLSTATE llstate_3;
  7351. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  7352. *llout = llstate_3;
  7353. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7354. (*llret)->U.SequenceOf.Values = llatt_2;
  7355. break;
  7356. }}}}}
  7357. case 2: case -2:
  7358. LLDEBUG_ALTERNATIVE("SequenceOfValue", 2);
  7359. {LLSTATE llstate_1;
  7360. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7361. {LLSTATE llstate_2;
  7362. if (!llterm('}', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  7363. *llout = llstate_2;
  7364. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7365. break;
  7366. }}}
  7367. default:
  7368. llstk[--llcstp] = 1;
  7369. goto failed1;
  7370. failed2:
  7371. LLDEBUG_BACKTRACKING("SequenceOfValue");
  7372. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7373. llcpos = llpos1; llcstp = llstp1;
  7374. continue;
  7375. } break;
  7376. }}
  7377. LLDEBUG_LEAVE("SequenceOfValue", 1);
  7378. return 1;
  7379. failed1: LLDEBUG_LEAVE("SequenceOfValue", 0);
  7380. return 0;
  7381. }
  7382. int ll_ValueList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7383. {
  7384. unsigned llstp = llcstp;
  7385. LLSTATE llstate_0;
  7386. LLDEBUG_ENTER("ValueList");
  7387. llstate_0 = *llin;
  7388. #undef failed
  7389. #define failed failed1
  7390. {LLSTATE llstate_1;XValue llatt_1;
  7391. if (!ll_Value(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  7392. {LLSTATE llstate_2;XValue llatt_2;
  7393. if (!ll_ValueCList(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed1;
  7394. *llout = llstate_2;
  7395. {(*llret) = DupValue(llatt_1);
  7396. (*llret)->Next = llatt_2;
  7397. }}}
  7398. LLDEBUG_LEAVE("ValueList", 1);
  7399. return 1;
  7400. failed1: LLDEBUG_LEAVE("ValueList", 0);
  7401. return 0;
  7402. }
  7403. int ll_ValueCList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7404. {
  7405. unsigned llstp = llcstp;
  7406. LLSTATE llstate_0;
  7407. LLDEBUG_ENTER("ValueCList");
  7408. llstate_0 = *llin;
  7409. #undef failed
  7410. #define failed failed1
  7411. #undef failed
  7412. #define failed failed2
  7413. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7414. LLCHECKSTK;
  7415. for (;;) {
  7416. switch (llstk[llcstp++]) {
  7417. case 1: case -1:
  7418. LLDEBUG_ALTERNATIVE("ValueCList", 1);
  7419. {LLSTATE llstate_1;
  7420. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7421. {LLSTATE llstate_2;XValue llatt_2;
  7422. if (!ll_ValueList(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed2;
  7423. *llout = llstate_2;
  7424. {(*llret) = llatt_2;
  7425. break;
  7426. }}}
  7427. case 2: case -2:
  7428. LLDEBUG_ALTERNATIVE("ValueCList", 2);
  7429. *llout = llstate_0;
  7430. {(*llret) = NULL;
  7431. break;
  7432. }
  7433. default:
  7434. llstk[--llcstp] = 1;
  7435. goto failed1;
  7436. failed2:
  7437. LLDEBUG_BACKTRACKING("ValueCList");
  7438. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7439. llcpos = llpos1; llcstp = llstp1;
  7440. continue;
  7441. } break;
  7442. }}
  7443. LLDEBUG_LEAVE("ValueCList", 1);
  7444. return 1;
  7445. failed1: LLDEBUG_LEAVE("ValueCList", 0);
  7446. return 0;
  7447. }
  7448. int ll_SetValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7449. {
  7450. unsigned llstp = llcstp;
  7451. LLSTATE llstate_0;
  7452. LLDEBUG_ENTER("SetValue");
  7453. llstate_0 = *llin;
  7454. #undef failed
  7455. #define failed failed1
  7456. #undef failed
  7457. #define failed failed2
  7458. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7459. LLCHECKSTK;
  7460. for (;;) {
  7461. switch (llstk[llcstp++]) {
  7462. case 1: case -1:
  7463. LLDEBUG_ALTERNATIVE("SetValue", 1);
  7464. {LLSTATE llstate_1;
  7465. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7466. {Component_t *components;
  7467. Type_t *type;
  7468. type = GetType(llstate_1.Assignments, llarg_type);
  7469. components = type ? type->U.SSC.Components : NULL;
  7470. {LLSTATE llstate_2;XNamedValues llatt_2;
  7471. if (!ll_ComponentValueList(&llatt_2, &llstate_1, &llstate_2, components)) goto failed2;
  7472. {LLSTATE llstate_3;
  7473. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  7474. *llout = llstate_3;
  7475. {Component_t *c;
  7476. NamedValue_t *v;
  7477. if (type) {
  7478. for (c = components; c; c = c->Next) {
  7479. switch (c->Type) {
  7480. case eComponent_Normal:
  7481. v = FindNamedValue(llatt_2, c->U.NOD.NamedType->Identifier);
  7482. if (!v)
  7483. LLFAILED((&llstate_2.pos,
  7484. "Value for component `%s' is missing",
  7485. c->U.NOD.NamedType->Identifier));
  7486. break;
  7487. }
  7488. }
  7489. for (v = llatt_2; v; v = v->Next) {
  7490. if (!FindComponent((*llout).Assignments, components,
  7491. v->Identifier) ||
  7492. FindNamedValue(v->Next, v->Identifier))
  7493. LLFAILED((&llstate_2.pos, "Component `%s' is unexpected",
  7494. v->Identifier));
  7495. }
  7496. }
  7497. (*llret) = NewValue((*llout).Assignments, llarg_type);
  7498. (*llret)->U.Set.NamedValues = llatt_2;
  7499. break;
  7500. }}}}}
  7501. case 2: case -2:
  7502. LLDEBUG_ALTERNATIVE("SetValue", 2);
  7503. {LLSTATE llstate_1;
  7504. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7505. {LLSTATE llstate_2;
  7506. if (!llterm('}', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  7507. *llout = llstate_2;
  7508. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7509. break;
  7510. }}}
  7511. default:
  7512. llstk[--llcstp] = 1;
  7513. goto failed1;
  7514. failed2:
  7515. LLDEBUG_BACKTRACKING("SetValue");
  7516. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7517. llcpos = llpos1; llcstp = llstp1;
  7518. continue;
  7519. } break;
  7520. }}
  7521. LLDEBUG_LEAVE("SetValue", 1);
  7522. return 1;
  7523. failed1: LLDEBUG_LEAVE("SetValue", 0);
  7524. return 0;
  7525. }
  7526. int ll_SetOfValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7527. {
  7528. unsigned llstp = llcstp;
  7529. LLSTATE llstate_0;
  7530. LLDEBUG_ENTER("SetOfValue");
  7531. llstate_0 = *llin;
  7532. #undef failed
  7533. #define failed failed1
  7534. #undef failed
  7535. #define failed failed2
  7536. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7537. LLCHECKSTK;
  7538. for (;;) {
  7539. switch (llstk[llcstp++]) {
  7540. case 1: case -1:
  7541. LLDEBUG_ALTERNATIVE("SetOfValue", 1);
  7542. {LLSTATE llstate_1;
  7543. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7544. {Type_t *type, *subtype;
  7545. type = GetType(llstate_1.Assignments, llarg_type);
  7546. subtype = (type ? type->U.SS.Type : NULL);
  7547. {LLSTATE llstate_2;XValue llatt_2;
  7548. if (!ll_ValueList(&llatt_2, &llstate_1, &llstate_2, subtype)) goto failed2;
  7549. {LLSTATE llstate_3;
  7550. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  7551. *llout = llstate_3;
  7552. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7553. (*llret)->U.SetOf.Values = llatt_2;
  7554. break;
  7555. }}}}}
  7556. case 2: case -2:
  7557. LLDEBUG_ALTERNATIVE("SetOfValue", 2);
  7558. {LLSTATE llstate_1;
  7559. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7560. {LLSTATE llstate_2;
  7561. if (!llterm('}', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  7562. *llout = llstate_2;
  7563. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7564. break;
  7565. }}}
  7566. default:
  7567. llstk[--llcstp] = 1;
  7568. goto failed1;
  7569. failed2:
  7570. LLDEBUG_BACKTRACKING("SetOfValue");
  7571. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7572. llcpos = llpos1; llcstp = llstp1;
  7573. continue;
  7574. } break;
  7575. }}
  7576. LLDEBUG_LEAVE("SetOfValue", 1);
  7577. return 1;
  7578. failed1: LLDEBUG_LEAVE("SetOfValue", 0);
  7579. return 0;
  7580. }
  7581. int ll_ChoiceValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7582. {
  7583. unsigned llstp = llcstp;
  7584. LLSTATE llstate_0;
  7585. LLDEBUG_ENTER("ChoiceValue");
  7586. llstate_0 = *llin;
  7587. #undef failed
  7588. #define failed failed1
  7589. {LLSTATE llstate_1;XString llatt_1;
  7590. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  7591. {LLSTATE llstate_2;
  7592. if (!llterm(':', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  7593. {Component_t *component;
  7594. Type_t *type, *subtype;
  7595. type = GetType(llstate_2.Assignments, llarg_type);
  7596. if (type) {
  7597. component = FindComponent(llstate_2.Assignments,
  7598. type->U.Choice.Components, llatt_1);
  7599. if (!component)
  7600. LLFAILED((&llstate_1.pos, "Bad alternative `%s'", llatt_1));
  7601. subtype = component->U.NOD.NamedType->Type;
  7602. } else {
  7603. subtype = NULL;
  7604. }
  7605. {LLSTATE llstate_3;XValue llatt_3;
  7606. if (!ll_Value(&llatt_3, &llstate_2, &llstate_3, subtype)) goto failed1;
  7607. *llout = llstate_3;
  7608. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  7609. (*llret)->U.SSC.NamedValues = NewNamedValue(llatt_1, llatt_3);
  7610. }}}}}
  7611. LLDEBUG_LEAVE("ChoiceValue", 1);
  7612. return 1;
  7613. failed1: LLDEBUG_LEAVE("ChoiceValue", 0);
  7614. return 0;
  7615. }
  7616. int ll_ObjectIdentifierValue(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  7617. {
  7618. unsigned llstp = llcstp;
  7619. LLSTATE llstate_0;
  7620. LLDEBUG_ENTER("ObjectIdentifierValue");
  7621. llstate_0 = *llin;
  7622. #undef failed
  7623. #define failed failed1
  7624. #undef failed
  7625. #define failed failed2
  7626. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7627. LLCHECKSTK;
  7628. for (;;) {
  7629. switch (llstk[llcstp++]) {
  7630. case 1: case -1:
  7631. LLDEBUG_ALTERNATIVE("ObjectIdentifierValue", 1);
  7632. {LLSTATE llstate_1;
  7633. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7634. {LLSTATE llstate_2;XNamedObjIdValue llatt_2;
  7635. if (!ll_ObjIdComponentList(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  7636. {LLSTATE llstate_3;
  7637. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  7638. *llout = llstate_3;
  7639. {switch (GetAssignedObjectIdentifier(
  7640. &(*llout).AssignedObjIds, NULL, llatt_2, &(*llret))) {
  7641. case -1:
  7642. LLFAILED((&llstate_2.pos, "Different numbers for equally named object identifier components"));
  7643. /*NOTREACHED*/
  7644. case 0:
  7645. if (pass <= 2)
  7646. (*llret) = NULL;
  7647. else
  7648. LLFAILED((&llstate_2.pos, "Unknown object identifier component"));
  7649. break;
  7650. case 1:
  7651. break;
  7652. }
  7653. break;
  7654. }}}}
  7655. case 2: case -2:
  7656. LLDEBUG_ALTERNATIVE("ObjectIdentifierValue", 2);
  7657. {LLSTATE llstate_1;
  7658. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  7659. {LLSTATE llstate_2;XValue llatt_2;
  7660. if (!ll_DefinedValue(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  7661. {LLSTATE llstate_3;XNamedObjIdValue llatt_3;
  7662. if (!ll_ObjIdComponentList(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  7663. {LLSTATE llstate_4;
  7664. if (!llterm('}', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed2;
  7665. *llout = llstate_4;
  7666. {Value_t *v;
  7667. v = GetValue((*llout).Assignments, llatt_2);
  7668. if (v) {
  7669. if (GetTypeType((*llout).Assignments, v->Type) !=
  7670. eType_ObjectIdentifier &&
  7671. GetTypeType((*llout).Assignments, v->Type) !=
  7672. eType_Undefined)
  7673. LLFAILED((&llstate_2.pos, "Bad type of value in object identifier"));
  7674. if (GetTypeType((*llout).Assignments, v->Type) ==
  7675. eType_ObjectIdentifier) {
  7676. switch (GetAssignedObjectIdentifier(
  7677. &(*llout).AssignedObjIds, v, llatt_3, &(*llret))) {
  7678. case -1:
  7679. LLFAILED((&llstate_3.pos, "Different numbers for equally named object identifier components"));
  7680. /*NOTREACHED*/
  7681. case 0:
  7682. if (pass <= 2)
  7683. (*llret) = NULL;
  7684. else
  7685. LLFAILED((&llstate_2.pos, "Unknown object identifier component"));
  7686. break;
  7687. case 1:
  7688. break;
  7689. }
  7690. }
  7691. } else {
  7692. (*llret) = NULL;
  7693. }
  7694. break;
  7695. }}}}}
  7696. default:
  7697. llstk[--llcstp] = 1;
  7698. goto failed1;
  7699. failed2:
  7700. LLDEBUG_BACKTRACKING("ObjectIdentifierValue");
  7701. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7702. llcpos = llpos1; llcstp = llstp1;
  7703. continue;
  7704. } break;
  7705. }}
  7706. LLDEBUG_LEAVE("ObjectIdentifierValue", 1);
  7707. return 1;
  7708. failed1: LLDEBUG_LEAVE("ObjectIdentifierValue", 0);
  7709. return 0;
  7710. }
  7711. int ll_ObjIdComponentList(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  7712. {
  7713. unsigned llstp = llcstp;
  7714. LLSTATE llstate_0;
  7715. LLDEBUG_ENTER("ObjIdComponentList");
  7716. llstate_0 = *llin;
  7717. #undef failed
  7718. #define failed failed1
  7719. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  7720. if (!ll_ObjIdComponent(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  7721. {LLSTATE llstate_2;XNamedObjIdValue llatt_2;
  7722. if (!ll_ObjIdComponent_ESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  7723. *llout = llstate_2;
  7724. {if (llatt_1) {
  7725. (*llret) = DupNamedObjIdValue(llatt_1);
  7726. (*llret)->Next = llatt_2;
  7727. } else {
  7728. (*llret) = NULL;
  7729. }
  7730. }}}
  7731. LLDEBUG_LEAVE("ObjIdComponentList", 1);
  7732. return 1;
  7733. failed1: LLDEBUG_LEAVE("ObjIdComponentList", 0);
  7734. return 0;
  7735. }
  7736. int ll_ObjIdComponent_ESeq(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  7737. {
  7738. unsigned llstp = llcstp;
  7739. LLSTATE llstate_0;
  7740. LLDEBUG_ENTER("ObjIdComponent_ESeq");
  7741. llstate_0 = *llin;
  7742. #undef failed
  7743. #define failed failed1
  7744. #undef failed
  7745. #define failed failed2
  7746. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7747. LLCHECKSTK;
  7748. for (;;) {
  7749. switch (llstk[llcstp++]) {
  7750. case 1: case -1:
  7751. LLDEBUG_ALTERNATIVE("ObjIdComponent_ESeq", 1);
  7752. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  7753. if (!ll_ObjIdComponent(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  7754. {LLSTATE llstate_2;XNamedObjIdValue llatt_2;
  7755. if (!ll_ObjIdComponent_ESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  7756. *llout = llstate_2;
  7757. {if (llatt_1) {
  7758. (*llret) = DupNamedObjIdValue(llatt_1);
  7759. (*llret)->Next = llatt_2;
  7760. } else {
  7761. (*llret) = NULL;
  7762. }
  7763. break;
  7764. }}}
  7765. case 2: case -2:
  7766. LLDEBUG_ALTERNATIVE("ObjIdComponent_ESeq", 2);
  7767. *llout = llstate_0;
  7768. {(*llret) = NULL;
  7769. break;
  7770. }
  7771. default:
  7772. llstk[--llcstp] = 1;
  7773. goto failed1;
  7774. failed2:
  7775. LLDEBUG_BACKTRACKING("ObjIdComponent_ESeq");
  7776. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7777. llcpos = llpos1; llcstp = llstp1;
  7778. continue;
  7779. } break;
  7780. }}
  7781. LLDEBUG_LEAVE("ObjIdComponent_ESeq", 1);
  7782. return 1;
  7783. failed1: LLDEBUG_LEAVE("ObjIdComponent_ESeq", 0);
  7784. return 0;
  7785. }
  7786. int ll_ObjIdComponent(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  7787. {
  7788. unsigned llstp = llcstp;
  7789. LLSTATE llstate_0;
  7790. LLDEBUG_ENTER("ObjIdComponent");
  7791. llstate_0 = *llin;
  7792. #undef failed
  7793. #define failed failed1
  7794. #undef failed
  7795. #define failed failed2
  7796. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7797. LLCHECKSTK;
  7798. for (;;) {
  7799. switch (llstk[llcstp++]) {
  7800. case 1: case -1:
  7801. LLDEBUG_ALTERNATIVE("ObjIdComponent", 1);
  7802. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  7803. if (!ll_NameForm(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  7804. *llout = llstate_1;
  7805. {(*llret) = llatt_1;
  7806. break;
  7807. }}
  7808. case 2: case -2:
  7809. LLDEBUG_ALTERNATIVE("ObjIdComponent", 2);
  7810. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  7811. if (!ll_NumberForm(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  7812. *llout = llstate_1;
  7813. {(*llret) = llatt_1;
  7814. break;
  7815. }}
  7816. case 3: case -3:
  7817. LLDEBUG_ALTERNATIVE("ObjIdComponent", 3);
  7818. {LLSTATE llstate_1;XNamedObjIdValue llatt_1;
  7819. if (!ll_NameAndNumberForm(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  7820. *llout = llstate_1;
  7821. {(*llret) = llatt_1;
  7822. break;
  7823. }}
  7824. default:
  7825. llstk[--llcstp] = 1;
  7826. goto failed1;
  7827. failed2:
  7828. LLDEBUG_BACKTRACKING("ObjIdComponent");
  7829. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7830. llcpos = llpos1; llcstp = llstp1;
  7831. continue;
  7832. } break;
  7833. }}
  7834. LLDEBUG_LEAVE("ObjIdComponent", 1);
  7835. return 1;
  7836. failed1: LLDEBUG_LEAVE("ObjIdComponent", 0);
  7837. return 0;
  7838. }
  7839. int ll_NameForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  7840. {
  7841. unsigned llstp = llcstp;
  7842. LLSTATE llstate_0;
  7843. LLDEBUG_ENTER("NameForm");
  7844. llstate_0 = *llin;
  7845. #undef failed
  7846. #define failed failed1
  7847. {LLSTATE llstate_1;XString llatt_1;
  7848. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  7849. *llout = llstate_1;
  7850. {(*llret) = NewNamedObjIdValue(eNamedObjIdValue_NameForm);
  7851. (*llret)->Name = llatt_1;
  7852. }}
  7853. LLDEBUG_LEAVE("NameForm", 1);
  7854. return 1;
  7855. failed1: LLDEBUG_LEAVE("NameForm", 0);
  7856. return 0;
  7857. }
  7858. int ll_NumberForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  7859. {
  7860. unsigned llstp = llcstp;
  7861. LLSTATE llstate_0;
  7862. LLDEBUG_ENTER("NumberForm");
  7863. llstate_0 = *llin;
  7864. #undef failed
  7865. #define failed failed1
  7866. #undef failed
  7867. #define failed failed2
  7868. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7869. LLCHECKSTK;
  7870. for (;;) {
  7871. switch (llstk[llcstp++]) {
  7872. case 1: case -1:
  7873. LLDEBUG_ALTERNATIVE("NumberForm", 1);
  7874. {LLSTATE llstate_1;XNumber llatt_1;
  7875. if (!llterm(T_number, &lllval, &llstate_0, &llstate_1)) goto failed2;
  7876. llatt_1 = lllval._XNumber;
  7877. *llout = llstate_1;
  7878. {(*llret) = NewNamedObjIdValue(eNamedObjIdValue_NumberForm);
  7879. (*llret)->Number = intx2uint32(&llatt_1);
  7880. break;
  7881. }}
  7882. case 2: case -2:
  7883. LLDEBUG_ALTERNATIVE("NumberForm", 2);
  7884. {LLSTATE llstate_1;XValue llatt_1;
  7885. if (!ll_DefinedValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  7886. *llout = llstate_1;
  7887. {Value_t *v;
  7888. v = GetValue((*llout).Assignments, llatt_1);
  7889. if (v &&
  7890. GetTypeType((*llout).Assignments, v->Type) != eType_Integer &&
  7891. GetTypeType((*llout).Assignments, v->Type) != eType_Undefined)
  7892. LLFAILED((&llstate_1.pos, "Bad type in object identifier"));
  7893. if (v &&
  7894. GetTypeType((*llout).Assignments, v->Type) == eType_Integer &&
  7895. intx_cmp(&v->U.Integer.Value, &intx_0) < 0)
  7896. LLFAILED((&llstate_1.pos, "Bad value in object identifier"));
  7897. if (v &&
  7898. GetTypeType((*llout).Assignments, v->Type) == eType_Integer) {
  7899. (*llret) = NewNamedObjIdValue(eNamedObjIdValue_NumberForm);
  7900. (*llret)->Number = intx2uint32(&v->U.Integer.Value);
  7901. } else {
  7902. (*llret) = NULL;
  7903. }
  7904. break;
  7905. }}
  7906. default:
  7907. llstk[--llcstp] = 1;
  7908. goto failed1;
  7909. failed2:
  7910. LLDEBUG_BACKTRACKING("NumberForm");
  7911. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  7912. llcpos = llpos1; llcstp = llstp1;
  7913. continue;
  7914. } break;
  7915. }}
  7916. LLDEBUG_LEAVE("NumberForm", 1);
  7917. return 1;
  7918. failed1: LLDEBUG_LEAVE("NumberForm", 0);
  7919. return 0;
  7920. }
  7921. int ll_NameAndNumberForm(XNamedObjIdValue *llret, LLSTATE *llin, LLSTATE *llout)
  7922. {
  7923. unsigned llstp = llcstp;
  7924. LLSTATE llstate_0;
  7925. LLDEBUG_ENTER("NameAndNumberForm");
  7926. llstate_0 = *llin;
  7927. #undef failed
  7928. #define failed failed1
  7929. {LLSTATE llstate_1;XString llatt_1;
  7930. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  7931. {LLSTATE llstate_2;
  7932. if (!llterm('(', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  7933. {LLSTATE llstate_3;XNamedObjIdValue llatt_3;
  7934. if (!ll_NumberForm(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  7935. {LLSTATE llstate_4;
  7936. if (!llterm(')', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed1;
  7937. *llout = llstate_4;
  7938. {if (llatt_3) {
  7939. (*llret) = NewNamedObjIdValue(eNamedObjIdValue_NameAndNumberForm);
  7940. (*llret)->Name = llatt_1;
  7941. (*llret)->Number = llatt_3->Number;
  7942. } else {
  7943. (*llret) = NULL;
  7944. }
  7945. }}}}}
  7946. LLDEBUG_LEAVE("NameAndNumberForm", 1);
  7947. return 1;
  7948. failed1: LLDEBUG_LEAVE("NameAndNumberForm", 0);
  7949. return 0;
  7950. }
  7951. int ll_EmbeddedPDVValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7952. {
  7953. unsigned llstp = llcstp;
  7954. LLSTATE llstate_0;
  7955. LLDEBUG_ENTER("EmbeddedPDVValue");
  7956. llstate_0 = *llin;
  7957. #undef failed
  7958. #define failed failed1
  7959. {LLSTATE llstate_1;XValue llatt_1;
  7960. if (!ll_SequenceValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  7961. *llout = llstate_1;
  7962. {(*llret) = llatt_1;
  7963. }}
  7964. LLDEBUG_LEAVE("EmbeddedPDVValue", 1);
  7965. return 1;
  7966. failed1: LLDEBUG_LEAVE("EmbeddedPDVValue", 0);
  7967. return 0;
  7968. }
  7969. int ll_ExternalValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7970. {
  7971. unsigned llstp = llcstp;
  7972. LLSTATE llstate_0;
  7973. LLDEBUG_ENTER("ExternalValue");
  7974. llstate_0 = *llin;
  7975. #undef failed
  7976. #define failed failed1
  7977. {LLSTATE llstate_1;XValue llatt_1;
  7978. if (!ll_SequenceValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  7979. *llout = llstate_1;
  7980. {(*llret) = llatt_1;
  7981. }}
  7982. LLDEBUG_LEAVE("ExternalValue", 1);
  7983. return 1;
  7984. failed1: LLDEBUG_LEAVE("ExternalValue", 0);
  7985. return 0;
  7986. }
  7987. int ll_CharacterStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  7988. {
  7989. unsigned llstp = llcstp;
  7990. LLSTATE llstate_0;
  7991. LLDEBUG_ENTER("CharacterStringValue");
  7992. llstate_0 = *llin;
  7993. #undef failed
  7994. #define failed failed1
  7995. #undef failed
  7996. #define failed failed2
  7997. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  7998. LLCHECKSTK;
  7999. for (;;) {
  8000. switch (llstk[llcstp++]) {
  8001. case 1: case -1:
  8002. LLDEBUG_ALTERNATIVE("CharacterStringValue", 1);
  8003. {Type_e type;
  8004. type = GetTypeType((*llin).Assignments, llarg_type);
  8005. if (type != eType_Undefined && !IsRestrictedString(type))
  8006. LLFAILED((&llstate_0.pos, "Bad type of value"));
  8007. {LLSTATE llstate_1;XValue llatt_1;
  8008. if (!ll_RestrictedCharacterStringValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  8009. *llout = llstate_1;
  8010. {(*llret) = llatt_1;
  8011. break;
  8012. }}}
  8013. case 2: case -2:
  8014. LLDEBUG_ALTERNATIVE("CharacterStringValue", 2);
  8015. {if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  8016. GetTypeType((*llin).Assignments, llarg_type) != eType_CharacterString)
  8017. LLFAILED((&llstate_0.pos, "Bad type of value"));
  8018. {LLSTATE llstate_1;XValue llatt_1;
  8019. if (!ll_UnrestrictedCharacterStringValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  8020. *llout = llstate_1;
  8021. {(*llret) = llatt_1;
  8022. break;
  8023. }}}
  8024. default:
  8025. llstk[--llcstp] = 1;
  8026. goto failed1;
  8027. failed2:
  8028. LLDEBUG_BACKTRACKING("CharacterStringValue");
  8029. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8030. llcpos = llpos1; llcstp = llstp1;
  8031. continue;
  8032. } break;
  8033. }}
  8034. LLDEBUG_LEAVE("CharacterStringValue", 1);
  8035. return 1;
  8036. failed1: LLDEBUG_LEAVE("CharacterStringValue", 0);
  8037. return 0;
  8038. }
  8039. int ll_RestrictedCharacterStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  8040. {
  8041. unsigned llstp = llcstp;
  8042. LLSTATE llstate_0;
  8043. LLDEBUG_ENTER("RestrictedCharacterStringValue");
  8044. llstate_0 = *llin;
  8045. #undef failed
  8046. #define failed failed1
  8047. #undef failed
  8048. #define failed failed2
  8049. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8050. LLCHECKSTK;
  8051. for (;;) {
  8052. switch (llstk[llcstp++]) {
  8053. case 1: case -1:
  8054. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringValue", 1);
  8055. {LLSTATE llstate_1;XString32 llatt_1;
  8056. if (!llterm(T_cstring, &lllval, &llstate_0, &llstate_1)) goto failed2;
  8057. llatt_1 = lllval._XString32;
  8058. *llout = llstate_1;
  8059. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  8060. (*llret)->U.RestrictedString.Value.length = str32len(llatt_1);
  8061. (*llret)->U.RestrictedString.Value.value = llatt_1;
  8062. break;
  8063. }}
  8064. case 2: case -2:
  8065. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringValue", 2);
  8066. {LLSTATE llstate_1;XValue llatt_1;
  8067. if (!ll_CharacterStringList(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  8068. *llout = llstate_1;
  8069. {(*llret) = llatt_1;
  8070. break;
  8071. }}
  8072. case 3: case -3:
  8073. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringValue", 3);
  8074. {LLSTATE llstate_1;XQuadruple llatt_1;
  8075. if (!ll_Quadruple(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  8076. *llout = llstate_1;
  8077. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  8078. (*llret)->U.RestrictedString.Value.length = 1;
  8079. (*llret)->U.RestrictedString.Value.value =
  8080. (char32_t *)malloc(sizeof(char32_t));
  8081. (*llret)->U.RestrictedString.Value.value[0] =
  8082. 256 * (256 * (256 * llatt_1.Group + llatt_1.Plane) + llatt_1.Row) + llatt_1.Cell;
  8083. break;
  8084. }}
  8085. case 4: case -4:
  8086. LLDEBUG_ALTERNATIVE("RestrictedCharacterStringValue", 4);
  8087. {LLSTATE llstate_1;XTuple llatt_1;
  8088. if (!ll_Tuple(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  8089. *llout = llstate_1;
  8090. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  8091. (*llret)->U.RestrictedString.Value.length = 1;
  8092. (*llret)->U.RestrictedString.Value.value =
  8093. (char32_t *)malloc(sizeof(char32_t));
  8094. *(*llret)->U.RestrictedString.Value.value =
  8095. llatt_1.Column * 16 + llatt_1.Row;
  8096. break;
  8097. }}
  8098. default:
  8099. llstk[--llcstp] = 1;
  8100. goto failed1;
  8101. failed2:
  8102. LLDEBUG_BACKTRACKING("RestrictedCharacterStringValue");
  8103. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8104. llcpos = llpos1; llcstp = llstp1;
  8105. continue;
  8106. } break;
  8107. }}
  8108. LLDEBUG_LEAVE("RestrictedCharacterStringValue", 1);
  8109. return 1;
  8110. failed1: LLDEBUG_LEAVE("RestrictedCharacterStringValue", 0);
  8111. return 0;
  8112. }
  8113. int ll_UnrestrictedCharacterStringValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  8114. {
  8115. unsigned llstp = llcstp;
  8116. LLSTATE llstate_0;
  8117. LLDEBUG_ENTER("UnrestrictedCharacterStringValue");
  8118. llstate_0 = *llin;
  8119. #undef failed
  8120. #define failed failed1
  8121. {LLSTATE llstate_1;XValue llatt_1;
  8122. if (!ll_SequenceValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  8123. *llout = llstate_1;
  8124. {(*llret) = llatt_1;
  8125. }}
  8126. LLDEBUG_LEAVE("UnrestrictedCharacterStringValue", 1);
  8127. return 1;
  8128. failed1: LLDEBUG_LEAVE("UnrestrictedCharacterStringValue", 0);
  8129. return 0;
  8130. }
  8131. int ll_CharacterStringList(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  8132. {
  8133. unsigned llstp = llcstp;
  8134. LLSTATE llstate_0;
  8135. LLDEBUG_ENTER("CharacterStringList");
  8136. llstate_0 = *llin;
  8137. #undef failed
  8138. #define failed failed1
  8139. {LLSTATE llstate_1;
  8140. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  8141. {LLSTATE llstate_2;XValue llatt_2;
  8142. if (!ll_CharSyms(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed1;
  8143. {LLSTATE llstate_3;
  8144. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  8145. *llout = llstate_3;
  8146. {(*llret) = llatt_2;
  8147. }}}}
  8148. LLDEBUG_LEAVE("CharacterStringList", 1);
  8149. return 1;
  8150. failed1: LLDEBUG_LEAVE("CharacterStringList", 0);
  8151. return 0;
  8152. }
  8153. int ll_CharSyms(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  8154. {
  8155. unsigned llstp = llcstp;
  8156. LLSTATE llstate_0;
  8157. LLDEBUG_ENTER("CharSyms");
  8158. llstate_0 = *llin;
  8159. #undef failed
  8160. #define failed failed1
  8161. #undef failed
  8162. #define failed failed2
  8163. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8164. LLCHECKSTK;
  8165. for (;;) {
  8166. switch (llstk[llcstp++]) {
  8167. case 1: case -1:
  8168. LLDEBUG_ALTERNATIVE("CharSyms", 1);
  8169. {LLSTATE llstate_1;XValue llatt_1;
  8170. if (!ll_CharDefn(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  8171. *llout = llstate_1;
  8172. {(*llret) = llatt_1;
  8173. break;
  8174. }}
  8175. case 2: case -2:
  8176. LLDEBUG_ALTERNATIVE("CharSyms", 2);
  8177. {LLSTATE llstate_1;XValue llatt_1;
  8178. if (!ll_CharDefn(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  8179. {LLSTATE llstate_2;
  8180. if (!llterm(',', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  8181. {LLSTATE llstate_3;XValue llatt_3;
  8182. if (!ll_CharSyms(&llatt_3, &llstate_2, &llstate_3, llarg_type)) goto failed2;
  8183. *llout = llstate_3;
  8184. {if (!llatt_1 || !llatt_3) {
  8185. (*llret) = NULL;
  8186. } else {
  8187. (*llret) = NewValue((*llout).Assignments, llarg_type);
  8188. (*llret)->U.RestrictedString.Value.length =
  8189. llatt_1->U.RestrictedString.Value.length +
  8190. llatt_3->U.RestrictedString.Value.length;
  8191. (*llret)->U.RestrictedString.Value.value =
  8192. (char32_t *)malloc(
  8193. (*llret)->U.RestrictedString.Value.length *
  8194. sizeof(char32_t));
  8195. memcpy((*llret)->U.RestrictedString.Value.value,
  8196. llatt_1->U.RestrictedString.Value.value,
  8197. llatt_1->U.RestrictedString.Value.length *
  8198. sizeof(char32_t));
  8199. memcpy((*llret)->U.RestrictedString.Value.value +
  8200. llatt_1->U.RestrictedString.Value.length,
  8201. llatt_3->U.RestrictedString.Value.value,
  8202. llatt_3->U.RestrictedString.Value.length *
  8203. sizeof(char32_t));
  8204. }
  8205. break;
  8206. }}}}
  8207. default:
  8208. llstk[--llcstp] = 1;
  8209. goto failed1;
  8210. failed2:
  8211. LLDEBUG_BACKTRACKING("CharSyms");
  8212. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8213. llcpos = llpos1; llcstp = llstp1;
  8214. continue;
  8215. } break;
  8216. }}
  8217. LLDEBUG_LEAVE("CharSyms", 1);
  8218. return 1;
  8219. failed1: LLDEBUG_LEAVE("CharSyms", 0);
  8220. return 0;
  8221. }
  8222. int ll_CharDefn(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  8223. {
  8224. unsigned llstp = llcstp;
  8225. LLSTATE llstate_0;
  8226. LLDEBUG_ENTER("CharDefn");
  8227. llstate_0 = *llin;
  8228. #undef failed
  8229. #define failed failed1
  8230. #undef failed
  8231. #define failed failed2
  8232. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8233. LLCHECKSTK;
  8234. for (;;) {
  8235. switch (llstk[llcstp++]) {
  8236. case 1: case -1:
  8237. LLDEBUG_ALTERNATIVE("CharDefn", 1);
  8238. {LLSTATE llstate_1;XString32 llatt_1;
  8239. if (!llterm(T_cstring, &lllval, &llstate_0, &llstate_1)) goto failed2;
  8240. llatt_1 = lllval._XString32;
  8241. *llout = llstate_1;
  8242. {(*llret) = NewValue((*llout).Assignments, llarg_type);
  8243. (*llret)->U.RestrictedString.Value.length = str32len(llatt_1);
  8244. (*llret)->U.RestrictedString.Value.value = llatt_1;
  8245. break;
  8246. }}
  8247. case 2: case -2:
  8248. LLDEBUG_ALTERNATIVE("CharDefn", 2);
  8249. {LLSTATE llstate_1;XValue llatt_1;
  8250. if (!ll_DefinedValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  8251. *llout = llstate_1;
  8252. {(*llret) = llatt_1;
  8253. break;
  8254. }}
  8255. default:
  8256. llstk[--llcstp] = 1;
  8257. goto failed1;
  8258. failed2:
  8259. LLDEBUG_BACKTRACKING("CharDefn");
  8260. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8261. llcpos = llpos1; llcstp = llstp1;
  8262. continue;
  8263. } break;
  8264. }}
  8265. LLDEBUG_LEAVE("CharDefn", 1);
  8266. return 1;
  8267. failed1: LLDEBUG_LEAVE("CharDefn", 0);
  8268. return 0;
  8269. }
  8270. int ll_Quadruple(XQuadruple *llret, LLSTATE *llin, LLSTATE *llout)
  8271. {
  8272. unsigned llstp = llcstp;
  8273. LLSTATE llstate_0;
  8274. LLDEBUG_ENTER("Quadruple");
  8275. llstate_0 = *llin;
  8276. #undef failed
  8277. #define failed failed1
  8278. {LLSTATE llstate_1;
  8279. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  8280. {LLSTATE llstate_2;XNumber llatt_2;
  8281. if (!llterm(T_number, &lllval, &llstate_1, &llstate_2)) goto failed1;
  8282. llatt_2 = lllval._XNumber;
  8283. {LLSTATE llstate_3;
  8284. if (!llterm(',', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  8285. {LLSTATE llstate_4;XNumber llatt_4;
  8286. if (!llterm(T_number, &lllval, &llstate_3, &llstate_4)) goto failed1;
  8287. llatt_4 = lllval._XNumber;
  8288. {LLSTATE llstate_5;
  8289. if (!llterm(',', (LLSTYPE *)0, &llstate_4, &llstate_5)) goto failed1;
  8290. {LLSTATE llstate_6;XNumber llatt_6;
  8291. if (!llterm(T_number, &lllval, &llstate_5, &llstate_6)) goto failed1;
  8292. llatt_6 = lllval._XNumber;
  8293. {LLSTATE llstate_7;
  8294. if (!llterm(',', (LLSTYPE *)0, &llstate_6, &llstate_7)) goto failed1;
  8295. {LLSTATE llstate_8;XNumber llatt_8;
  8296. if (!llterm(T_number, &lllval, &llstate_7, &llstate_8)) goto failed1;
  8297. llatt_8 = lllval._XNumber;
  8298. {LLSTATE llstate_9;
  8299. if (!llterm('}', (LLSTYPE *)0, &llstate_8, &llstate_9)) goto failed1;
  8300. *llout = llstate_9;
  8301. {(*llret).Group = intx2uint32(&llatt_2);
  8302. (*llret).Plane = intx2uint32(&llatt_4);
  8303. (*llret).Row = intx2uint32(&llatt_6);
  8304. (*llret).Cell = intx2uint32(&llatt_8);
  8305. }}}}}}}}}}
  8306. LLDEBUG_LEAVE("Quadruple", 1);
  8307. return 1;
  8308. failed1: LLDEBUG_LEAVE("Quadruple", 0);
  8309. return 0;
  8310. }
  8311. int ll_Tuple(XTuple *llret, LLSTATE *llin, LLSTATE *llout)
  8312. {
  8313. unsigned llstp = llcstp;
  8314. LLSTATE llstate_0;
  8315. LLDEBUG_ENTER("Tuple");
  8316. llstate_0 = *llin;
  8317. #undef failed
  8318. #define failed failed1
  8319. {LLSTATE llstate_1;
  8320. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  8321. {LLSTATE llstate_2;XNumber llatt_2;
  8322. if (!llterm(T_number, &lllval, &llstate_1, &llstate_2)) goto failed1;
  8323. llatt_2 = lllval._XNumber;
  8324. {LLSTATE llstate_3;
  8325. if (!llterm(',', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  8326. {LLSTATE llstate_4;XNumber llatt_4;
  8327. if (!llterm(T_number, &lllval, &llstate_3, &llstate_4)) goto failed1;
  8328. llatt_4 = lllval._XNumber;
  8329. {LLSTATE llstate_5;
  8330. if (!llterm('}', (LLSTYPE *)0, &llstate_4, &llstate_5)) goto failed1;
  8331. *llout = llstate_5;
  8332. {(*llret).Column = intx2uint32(&llatt_2);
  8333. (*llret).Row = intx2uint32(&llatt_4);
  8334. }}}}}}
  8335. LLDEBUG_LEAVE("Tuple", 1);
  8336. return 1;
  8337. failed1: LLDEBUG_LEAVE("Tuple", 0);
  8338. return 0;
  8339. }
  8340. int ll_AnyValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  8341. {
  8342. unsigned llstp = llcstp;
  8343. LLSTATE llstate_0;
  8344. LLDEBUG_ENTER("AnyValue");
  8345. llstate_0 = *llin;
  8346. #undef failed
  8347. #define failed failed1
  8348. {LLSTATE llstate_1;XType llatt_1;
  8349. if (!ll_Type(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  8350. {LLSTATE llstate_2;
  8351. if (!llterm(':', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  8352. {LLSTATE llstate_3;XValue llatt_3;
  8353. if (!ll_Value(&llatt_3, &llstate_2, &llstate_3, llatt_1)) goto failed1;
  8354. *llout = llstate_3;
  8355. {(*llret) = llatt_3;
  8356. }}}}
  8357. LLDEBUG_LEAVE("AnyValue", 1);
  8358. return 1;
  8359. failed1: LLDEBUG_LEAVE("AnyValue", 0);
  8360. return 0;
  8361. }
  8362. int ll_Constraint(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha)
  8363. {
  8364. unsigned llstp = llcstp;
  8365. LLSTATE llstate_0;
  8366. LLDEBUG_ENTER("Constraint");
  8367. llstate_0 = *llin;
  8368. #undef failed
  8369. #define failed failed1
  8370. {LLSTATE llstate_1;
  8371. if (!llterm('(', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  8372. {LLSTATE llstate_2;XConstraints llatt_2;
  8373. if (!ll_ConstraintSpec(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_permalpha)) goto failed1;
  8374. {LLSTATE llstate_3;
  8375. if (!ll_ExceptionSpec(&llstate_2, &llstate_3)) goto failed1;
  8376. {LLSTATE llstate_4;
  8377. if (!llterm(')', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed1;
  8378. *llout = llstate_4;
  8379. {(*llret) = llatt_2; /*XXX ExceptionSpec */
  8380. }}}}}
  8381. LLDEBUG_LEAVE("Constraint", 1);
  8382. return 1;
  8383. failed1: LLDEBUG_LEAVE("Constraint", 0);
  8384. return 0;
  8385. }
  8386. int ll_ConstraintSpec(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha)
  8387. {
  8388. unsigned llstp = llcstp;
  8389. LLSTATE llstate_0;
  8390. LLDEBUG_ENTER("ConstraintSpec");
  8391. llstate_0 = *llin;
  8392. #undef failed
  8393. #define failed failed1
  8394. #undef failed
  8395. #define failed failed2
  8396. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8397. LLCHECKSTK;
  8398. for (;;) {
  8399. switch (llstk[llcstp++]) {
  8400. case 1: case -1:
  8401. LLDEBUG_ALTERNATIVE("ConstraintSpec", 1);
  8402. {LLSTATE llstate_1;XConstraints llatt_1;
  8403. if (!ll_SubtypeConstraint(&llatt_1, &llstate_0, &llstate_1, llarg_type, llarg_permalpha)) goto failed2;
  8404. *llout = llstate_1;
  8405. {(*llret) = llatt_1;
  8406. break;
  8407. }}
  8408. case 2: case -2:
  8409. LLDEBUG_ALTERNATIVE("ConstraintSpec", 2);
  8410. {LLSTATE llstate_1;
  8411. if (!ll_GeneralConstraint(&llstate_0, &llstate_1)) goto failed2;
  8412. *llout = llstate_1;
  8413. {(*llret) = NULL; /*XXX*/
  8414. break;
  8415. }}
  8416. default:
  8417. llstk[--llcstp] = 1;
  8418. goto failed1;
  8419. failed2:
  8420. LLDEBUG_BACKTRACKING("ConstraintSpec");
  8421. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8422. llcpos = llpos1; llcstp = llstp1;
  8423. continue;
  8424. } break;
  8425. }}
  8426. LLDEBUG_LEAVE("ConstraintSpec", 1);
  8427. return 1;
  8428. failed1: LLDEBUG_LEAVE("ConstraintSpec", 0);
  8429. return 0;
  8430. }
  8431. int ll_SubtypeConstraint(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha)
  8432. {
  8433. unsigned llstp = llcstp;
  8434. LLSTATE llstate_0;
  8435. LLDEBUG_ENTER("SubtypeConstraint");
  8436. llstate_0 = *llin;
  8437. #undef failed
  8438. #define failed failed1
  8439. {LLSTATE llstate_1;XConstraints llatt_1;
  8440. if (!ll_ElementSetSpecs(&llatt_1, &llstate_0, &llstate_1, llarg_type, llarg_permalpha)) goto failed1;
  8441. *llout = llstate_1;
  8442. {(*llret) = llatt_1;
  8443. }}
  8444. LLDEBUG_LEAVE("SubtypeConstraint", 1);
  8445. return 1;
  8446. failed1: LLDEBUG_LEAVE("SubtypeConstraint", 0);
  8447. return 0;
  8448. }
  8449. int ll_ExceptionSpec(LLSTATE *llin, LLSTATE *llout)
  8450. {
  8451. unsigned llstp = llcstp;
  8452. LLSTATE llstate_0;
  8453. LLDEBUG_ENTER("ExceptionSpec");
  8454. llstate_0 = *llin;
  8455. #undef failed
  8456. #define failed failed1
  8457. #undef failed
  8458. #define failed failed2
  8459. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8460. LLCHECKSTK;
  8461. for (;;) {
  8462. switch (llstk[llcstp++]) {
  8463. case 1: case -1:
  8464. LLDEBUG_ALTERNATIVE("ExceptionSpec", 1);
  8465. {LLSTATE llstate_1;
  8466. if (!llterm('!', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  8467. {LLSTATE llstate_2;
  8468. if (!ll_ExceptionIdentification(&llstate_1, &llstate_2)) goto failed2;
  8469. *llout = llstate_2;
  8470. break;
  8471. }}
  8472. case 2: case -2:
  8473. LLDEBUG_ALTERNATIVE("ExceptionSpec", 2);
  8474. *llout = llstate_0;
  8475. break;
  8476. default:
  8477. llstk[--llcstp] = 1;
  8478. goto failed1;
  8479. failed2:
  8480. LLDEBUG_BACKTRACKING("ExceptionSpec");
  8481. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8482. llcpos = llpos1; llcstp = llstp1;
  8483. continue;
  8484. } break;
  8485. }}
  8486. LLDEBUG_LEAVE("ExceptionSpec", 1);
  8487. return 1;
  8488. failed1: LLDEBUG_LEAVE("ExceptionSpec", 0);
  8489. return 0;
  8490. }
  8491. int ll_ExceptionIdentification(LLSTATE *llin, LLSTATE *llout)
  8492. {
  8493. unsigned llstp = llcstp;
  8494. LLSTATE llstate_0;
  8495. LLDEBUG_ENTER("ExceptionIdentification");
  8496. llstate_0 = *llin;
  8497. #undef failed
  8498. #define failed failed1
  8499. #undef failed
  8500. #define failed failed2
  8501. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8502. LLCHECKSTK;
  8503. for (;;) {
  8504. switch (llstk[llcstp++]) {
  8505. case 1: case -1:
  8506. LLDEBUG_ALTERNATIVE("ExceptionIdentification", 1);
  8507. {LLSTATE llstate_1;XValue llatt_1;
  8508. if (!ll_SignedNumber(&llatt_1, &llstate_0, &llstate_1, Builtin_Type_Integer)) goto failed2;
  8509. *llout = llstate_1;
  8510. break;
  8511. }
  8512. case 2: case -2:
  8513. LLDEBUG_ALTERNATIVE("ExceptionIdentification", 2);
  8514. {LLSTATE llstate_1;XValue llatt_1;
  8515. if (!ll_DefinedValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  8516. *llout = llstate_1;
  8517. break;
  8518. }
  8519. case 3: case -3:
  8520. LLDEBUG_ALTERNATIVE("ExceptionIdentification", 3);
  8521. {LLSTATE llstate_1;XType llatt_1;
  8522. if (!ll_Type(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  8523. {LLSTATE llstate_2;
  8524. if (!llterm(':', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  8525. {LLSTATE llstate_3;XValue llatt_3;
  8526. if (!ll_Value(&llatt_3, &llstate_2, &llstate_3, llatt_1)) goto failed2;
  8527. *llout = llstate_3;
  8528. break;
  8529. }}}
  8530. default:
  8531. llstk[--llcstp] = 1;
  8532. goto failed1;
  8533. failed2:
  8534. LLDEBUG_BACKTRACKING("ExceptionIdentification");
  8535. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8536. llcpos = llpos1; llcstp = llstp1;
  8537. continue;
  8538. } break;
  8539. }}
  8540. LLDEBUG_LEAVE("ExceptionIdentification", 1);
  8541. return 1;
  8542. failed1: LLDEBUG_LEAVE("ExceptionIdentification", 0);
  8543. return 0;
  8544. }
  8545. int ll_ElementSetSpecs(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha)
  8546. {
  8547. unsigned llstp = llcstp;
  8548. LLSTATE llstate_0;
  8549. LLDEBUG_ENTER("ElementSetSpecs");
  8550. llstate_0 = *llin;
  8551. #undef failed
  8552. #define failed failed1
  8553. #undef failed
  8554. #define failed failed2
  8555. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8556. LLCHECKSTK;
  8557. for (;;) {
  8558. switch (llstk[llcstp++]) {
  8559. case 1: case -1:
  8560. LLDEBUG_ALTERNATIVE("ElementSetSpecs", 1);
  8561. {LLSTATE llstate_1;XElementSetSpec llatt_1;
  8562. if (!ll_ElementSetSpec(&llatt_1, &llstate_0, &llstate_1, llarg_type, NULL, llarg_permalpha)) goto failed2;
  8563. {LLSTATE llstate_2;XConstraints llatt_2;
  8564. if (!ll_ElementSetSpecExtension(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_permalpha)) goto failed2;
  8565. *llout = llstate_2;
  8566. {if (llatt_2) {
  8567. (*llret) = DupConstraint(llatt_2);
  8568. } else {
  8569. (*llret) = NewConstraint();
  8570. }
  8571. (*llret)->Root = llatt_1;
  8572. break;
  8573. }}}
  8574. case 2: case -2:
  8575. LLDEBUG_ALTERNATIVE("ElementSetSpecs", 2);
  8576. {LLSTATE llstate_1;
  8577. if (!llterm(T_TDOT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  8578. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  8579. if (!ll_AdditionalElementSetSpec(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_permalpha)) goto failed2;
  8580. *llout = llstate_2;
  8581. {(*llret) = NewConstraint();
  8582. (*llret)->Type = llatt_2 ? eExtension_Extended : eExtension_Extendable;
  8583. (*llret)->Additional = llatt_2;
  8584. break;
  8585. }}}
  8586. default:
  8587. llstk[--llcstp] = 1;
  8588. goto failed1;
  8589. failed2:
  8590. LLDEBUG_BACKTRACKING("ElementSetSpecs");
  8591. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8592. llcpos = llpos1; llcstp = llstp1;
  8593. continue;
  8594. } break;
  8595. }}
  8596. LLDEBUG_LEAVE("ElementSetSpecs", 1);
  8597. return 1;
  8598. failed1: LLDEBUG_LEAVE("ElementSetSpecs", 0);
  8599. return 0;
  8600. }
  8601. int ll_ElementSetSpecExtension(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha)
  8602. {
  8603. unsigned llstp = llcstp;
  8604. LLSTATE llstate_0;
  8605. LLDEBUG_ENTER("ElementSetSpecExtension");
  8606. llstate_0 = *llin;
  8607. #undef failed
  8608. #define failed failed1
  8609. #undef failed
  8610. #define failed failed2
  8611. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8612. LLCHECKSTK;
  8613. for (;;) {
  8614. switch (llstk[llcstp++]) {
  8615. case 1: case -1:
  8616. LLDEBUG_ALTERNATIVE("ElementSetSpecExtension", 1);
  8617. {LLSTATE llstate_1;
  8618. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  8619. {LLSTATE llstate_2;
  8620. if (!llterm(T_TDOT, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  8621. {LLSTATE llstate_3;XElementSetSpec llatt_3;
  8622. if (!ll_AdditionalElementSetSpec(&llatt_3, &llstate_2, &llstate_3, llarg_type, llarg_permalpha)) goto failed2;
  8623. *llout = llstate_3;
  8624. {(*llret) = NewConstraint();
  8625. (*llret)->Type = llatt_3 ? eExtension_Extended : eExtension_Extendable;
  8626. (*llret)->Additional = llatt_3;
  8627. break;
  8628. }}}}
  8629. case 2: case -2:
  8630. LLDEBUG_ALTERNATIVE("ElementSetSpecExtension", 2);
  8631. *llout = llstate_0;
  8632. {(*llret) = NULL;
  8633. break;
  8634. }
  8635. default:
  8636. llstk[--llcstp] = 1;
  8637. goto failed1;
  8638. failed2:
  8639. LLDEBUG_BACKTRACKING("ElementSetSpecExtension");
  8640. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8641. llcpos = llpos1; llcstp = llstp1;
  8642. continue;
  8643. } break;
  8644. }}
  8645. LLDEBUG_LEAVE("ElementSetSpecExtension", 1);
  8646. return 1;
  8647. failed1: LLDEBUG_LEAVE("ElementSetSpecExtension", 0);
  8648. return 0;
  8649. }
  8650. int ll_AdditionalElementSetSpec(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha)
  8651. {
  8652. unsigned llstp = llcstp;
  8653. LLSTATE llstate_0;
  8654. LLDEBUG_ENTER("AdditionalElementSetSpec");
  8655. llstate_0 = *llin;
  8656. #undef failed
  8657. #define failed failed1
  8658. #undef failed
  8659. #define failed failed2
  8660. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8661. LLCHECKSTK;
  8662. for (;;) {
  8663. switch (llstk[llcstp++]) {
  8664. case 1: case -1:
  8665. LLDEBUG_ALTERNATIVE("AdditionalElementSetSpec", 1);
  8666. {LLSTATE llstate_1;
  8667. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  8668. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  8669. if (!ll_ElementSetSpec(&llatt_2, &llstate_1, &llstate_2, llarg_type, NULL, llarg_permalpha)) goto failed2;
  8670. *llout = llstate_2;
  8671. {(*llret) = llatt_2;
  8672. break;
  8673. }}}
  8674. case 2: case -2:
  8675. LLDEBUG_ALTERNATIVE("AdditionalElementSetSpec", 2);
  8676. *llout = llstate_0;
  8677. {(*llret) = NULL;
  8678. break;
  8679. }
  8680. default:
  8681. llstk[--llcstp] = 1;
  8682. goto failed1;
  8683. failed2:
  8684. LLDEBUG_BACKTRACKING("AdditionalElementSetSpec");
  8685. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8686. llcpos = llpos1; llcstp = llstp1;
  8687. continue;
  8688. } break;
  8689. }}
  8690. LLDEBUG_LEAVE("AdditionalElementSetSpec", 1);
  8691. return 1;
  8692. failed1: LLDEBUG_LEAVE("AdditionalElementSetSpec", 0);
  8693. return 0;
  8694. }
  8695. int ll_ElementSetSpec(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha)
  8696. {
  8697. unsigned llstp = llcstp;
  8698. LLSTATE llstate_0;
  8699. LLDEBUG_ENTER("ElementSetSpec");
  8700. llstate_0 = *llin;
  8701. #undef failed
  8702. #define failed failed1
  8703. #undef failed
  8704. #define failed failed2
  8705. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8706. LLCHECKSTK;
  8707. for (;;) {
  8708. switch (llstk[llcstp++]) {
  8709. case 1: case -1:
  8710. LLDEBUG_ALTERNATIVE("ElementSetSpec", 1);
  8711. {LLSTATE llstate_1;XElementSetSpec llatt_1;
  8712. if (!ll_Unions(&llatt_1, &llstate_0, &llstate_1, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed2;
  8713. *llout = llstate_1;
  8714. {(*llret) = llatt_1;
  8715. break;
  8716. }}
  8717. case 2: case -2:
  8718. LLDEBUG_ALTERNATIVE("ElementSetSpec", 2);
  8719. {LLSTATE llstate_1;
  8720. if (!llterm(T_ALL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  8721. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  8722. if (!ll_Exclusions(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed2;
  8723. *llout = llstate_2;
  8724. {(*llret) = NewElementSetSpec(eElementSetSpec_AllExcept);
  8725. (*llret)->U.AllExcept.Elements = llatt_2;
  8726. break;
  8727. }}}
  8728. default:
  8729. llstk[--llcstp] = 1;
  8730. goto failed1;
  8731. failed2:
  8732. LLDEBUG_BACKTRACKING("ElementSetSpec");
  8733. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8734. llcpos = llpos1; llcstp = llstp1;
  8735. continue;
  8736. } break;
  8737. }}
  8738. LLDEBUG_LEAVE("ElementSetSpec", 1);
  8739. return 1;
  8740. failed1: LLDEBUG_LEAVE("ElementSetSpec", 0);
  8741. return 0;
  8742. }
  8743. int ll_Unions(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha)
  8744. {
  8745. unsigned llstp = llcstp;
  8746. LLSTATE llstate_0;
  8747. LLDEBUG_ENTER("Unions");
  8748. llstate_0 = *llin;
  8749. #undef failed
  8750. #define failed failed1
  8751. {LLSTATE llstate_1;XElementSetSpec llatt_1;
  8752. if (!ll_Intersections(&llatt_1, &llstate_0, &llstate_1, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed1;
  8753. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  8754. if (!ll_UnionList(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed1;
  8755. *llout = llstate_2;
  8756. {if (llatt_2) {
  8757. (*llret) = NewElementSetSpec(eElementSetSpec_Union);
  8758. (*llret)->U.Union.Elements1 = llatt_1;
  8759. (*llret)->U.Union.Elements2 = llatt_2;
  8760. } else {
  8761. (*llret) = llatt_1;
  8762. }
  8763. }}}
  8764. LLDEBUG_LEAVE("Unions", 1);
  8765. return 1;
  8766. failed1: LLDEBUG_LEAVE("Unions", 0);
  8767. return 0;
  8768. }
  8769. int ll_UnionList(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha)
  8770. {
  8771. unsigned llstp = llcstp;
  8772. LLSTATE llstate_0;
  8773. LLDEBUG_ENTER("UnionList");
  8774. llstate_0 = *llin;
  8775. #undef failed
  8776. #define failed failed1
  8777. #undef failed
  8778. #define failed failed2
  8779. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8780. LLCHECKSTK;
  8781. for (;;) {
  8782. switch (llstk[llcstp++]) {
  8783. case 1: case -1:
  8784. LLDEBUG_ALTERNATIVE("UnionList", 1);
  8785. {LLSTATE llstate_1;
  8786. if (!ll_UnionMark(&llstate_0, &llstate_1)) goto failed2;
  8787. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  8788. if (!ll_Unions(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed2;
  8789. *llout = llstate_2;
  8790. {(*llret) = llatt_2;
  8791. break;
  8792. }}}
  8793. case 2: case -2:
  8794. LLDEBUG_ALTERNATIVE("UnionList", 2);
  8795. *llout = llstate_0;
  8796. {(*llret) = NULL;
  8797. break;
  8798. }
  8799. default:
  8800. llstk[--llcstp] = 1;
  8801. goto failed1;
  8802. failed2:
  8803. LLDEBUG_BACKTRACKING("UnionList");
  8804. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8805. llcpos = llpos1; llcstp = llstp1;
  8806. continue;
  8807. } break;
  8808. }}
  8809. LLDEBUG_LEAVE("UnionList", 1);
  8810. return 1;
  8811. failed1: LLDEBUG_LEAVE("UnionList", 0);
  8812. return 0;
  8813. }
  8814. int ll_Intersections(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha)
  8815. {
  8816. unsigned llstp = llcstp;
  8817. LLSTATE llstate_0;
  8818. LLDEBUG_ENTER("Intersections");
  8819. llstate_0 = *llin;
  8820. #undef failed
  8821. #define failed failed1
  8822. {LLSTATE llstate_1;XElementSetSpec llatt_1;
  8823. if (!ll_IntersectionElements(&llatt_1, &llstate_0, &llstate_1, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed1;
  8824. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  8825. if (!ll_IntersectionList(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed1;
  8826. *llout = llstate_2;
  8827. {if (llatt_2) {
  8828. (*llret) = NewElementSetSpec(eElementSetSpec_Intersection);
  8829. (*llret)->U.Intersection.Elements1 = llatt_1;
  8830. (*llret)->U.Intersection.Elements2 = llatt_2;
  8831. } else {
  8832. (*llret) = llatt_1;
  8833. }
  8834. }}}
  8835. LLDEBUG_LEAVE("Intersections", 1);
  8836. return 1;
  8837. failed1: LLDEBUG_LEAVE("Intersections", 0);
  8838. return 0;
  8839. }
  8840. int ll_IntersectionList(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha)
  8841. {
  8842. unsigned llstp = llcstp;
  8843. LLSTATE llstate_0;
  8844. LLDEBUG_ENTER("IntersectionList");
  8845. llstate_0 = *llin;
  8846. #undef failed
  8847. #define failed failed1
  8848. #undef failed
  8849. #define failed failed2
  8850. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8851. LLCHECKSTK;
  8852. for (;;) {
  8853. switch (llstk[llcstp++]) {
  8854. case 1: case -1:
  8855. LLDEBUG_ALTERNATIVE("IntersectionList", 1);
  8856. {LLSTATE llstate_1;
  8857. if (!ll_IntersectionMark(&llstate_0, &llstate_1)) goto failed2;
  8858. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  8859. if (!ll_Intersections(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed2;
  8860. *llout = llstate_2;
  8861. {(*llret) = llatt_2;
  8862. break;
  8863. }}}
  8864. case 2: case -2:
  8865. LLDEBUG_ALTERNATIVE("IntersectionList", 2);
  8866. *llout = llstate_0;
  8867. {(*llret) = NULL;
  8868. break;
  8869. }
  8870. default:
  8871. llstk[--llcstp] = 1;
  8872. goto failed1;
  8873. failed2:
  8874. LLDEBUG_BACKTRACKING("IntersectionList");
  8875. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8876. llcpos = llpos1; llcstp = llstp1;
  8877. continue;
  8878. } break;
  8879. }}
  8880. LLDEBUG_LEAVE("IntersectionList", 1);
  8881. return 1;
  8882. failed1: LLDEBUG_LEAVE("IntersectionList", 0);
  8883. return 0;
  8884. }
  8885. int ll_IntersectionElements(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha)
  8886. {
  8887. unsigned llstp = llcstp;
  8888. LLSTATE llstate_0;
  8889. LLDEBUG_ENTER("IntersectionElements");
  8890. llstate_0 = *llin;
  8891. #undef failed
  8892. #define failed failed1
  8893. {LLSTATE llstate_1;XElementSetSpec llatt_1;
  8894. if (!ll_Elements(&llatt_1, &llstate_0, &llstate_1, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed1;
  8895. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  8896. if (!ll_Exclusions_Opt(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed1;
  8897. *llout = llstate_2;
  8898. {if (llatt_2) {
  8899. (*llret) = NewElementSetSpec(eElementSetSpec_Exclusion);
  8900. (*llret)->U.Exclusion.Elements1 = llatt_1;
  8901. (*llret)->U.Exclusion.Elements2 = llatt_2;
  8902. } else {
  8903. (*llret) = llatt_1;
  8904. }
  8905. }}}
  8906. LLDEBUG_LEAVE("IntersectionElements", 1);
  8907. return 1;
  8908. failed1: LLDEBUG_LEAVE("IntersectionElements", 0);
  8909. return 0;
  8910. }
  8911. int ll_Exclusions_Opt(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha)
  8912. {
  8913. unsigned llstp = llcstp;
  8914. LLSTATE llstate_0;
  8915. LLDEBUG_ENTER("Exclusions_Opt");
  8916. llstate_0 = *llin;
  8917. #undef failed
  8918. #define failed failed1
  8919. #undef failed
  8920. #define failed failed2
  8921. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8922. LLCHECKSTK;
  8923. for (;;) {
  8924. switch (llstk[llcstp++]) {
  8925. case 1: case -1:
  8926. LLDEBUG_ALTERNATIVE("Exclusions_Opt", 1);
  8927. {LLSTATE llstate_1;XElementSetSpec llatt_1;
  8928. if (!ll_Exclusions(&llatt_1, &llstate_0, &llstate_1, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed2;
  8929. *llout = llstate_1;
  8930. {(*llret) = llatt_1;
  8931. break;
  8932. }}
  8933. case 2: case -2:
  8934. LLDEBUG_ALTERNATIVE("Exclusions_Opt", 2);
  8935. *llout = llstate_0;
  8936. {(*llret) = NULL;
  8937. break;
  8938. }
  8939. default:
  8940. llstk[--llcstp] = 1;
  8941. goto failed1;
  8942. failed2:
  8943. LLDEBUG_BACKTRACKING("Exclusions_Opt");
  8944. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  8945. llcpos = llpos1; llcstp = llstp1;
  8946. continue;
  8947. } break;
  8948. }}
  8949. LLDEBUG_LEAVE("Exclusions_Opt", 1);
  8950. return 1;
  8951. failed1: LLDEBUG_LEAVE("Exclusions_Opt", 0);
  8952. return 0;
  8953. }
  8954. int ll_Exclusions(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha)
  8955. {
  8956. unsigned llstp = llcstp;
  8957. LLSTATE llstate_0;
  8958. LLDEBUG_ENTER("Exclusions");
  8959. llstate_0 = *llin;
  8960. #undef failed
  8961. #define failed failed1
  8962. {LLSTATE llstate_1;
  8963. if (!llterm(T_EXCEPT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  8964. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  8965. if (!ll_Elements(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed1;
  8966. *llout = llstate_2;
  8967. {(*llret) = llatt_2;
  8968. }}}
  8969. LLDEBUG_LEAVE("Exclusions", 1);
  8970. return 1;
  8971. failed1: LLDEBUG_LEAVE("Exclusions", 0);
  8972. return 0;
  8973. }
  8974. int ll_UnionMark(LLSTATE *llin, LLSTATE *llout)
  8975. {
  8976. unsigned llstp = llcstp;
  8977. LLSTATE llstate_0;
  8978. LLDEBUG_ENTER("UnionMark");
  8979. llstate_0 = *llin;
  8980. #undef failed
  8981. #define failed failed1
  8982. #undef failed
  8983. #define failed failed2
  8984. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  8985. LLCHECKSTK;
  8986. for (;;) {
  8987. switch (llstk[llcstp++]) {
  8988. case 1: case -1:
  8989. LLDEBUG_ALTERNATIVE("UnionMark", 1);
  8990. {LLSTATE llstate_1;
  8991. if (!llterm('|', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  8992. *llout = llstate_1;
  8993. break;
  8994. }
  8995. case 2: case -2:
  8996. LLDEBUG_ALTERNATIVE("UnionMark", 2);
  8997. {LLSTATE llstate_1;
  8998. if (!llterm(T_UNION, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  8999. *llout = llstate_1;
  9000. break;
  9001. }
  9002. default:
  9003. llstk[--llcstp] = 1;
  9004. goto failed1;
  9005. failed2:
  9006. LLDEBUG_BACKTRACKING("UnionMark");
  9007. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9008. llcpos = llpos1; llcstp = llstp1;
  9009. continue;
  9010. } break;
  9011. }}
  9012. LLDEBUG_LEAVE("UnionMark", 1);
  9013. return 1;
  9014. failed1: LLDEBUG_LEAVE("UnionMark", 0);
  9015. return 0;
  9016. }
  9017. int ll_IntersectionMark(LLSTATE *llin, LLSTATE *llout)
  9018. {
  9019. unsigned llstp = llcstp;
  9020. LLSTATE llstate_0;
  9021. LLDEBUG_ENTER("IntersectionMark");
  9022. llstate_0 = *llin;
  9023. #undef failed
  9024. #define failed failed1
  9025. #undef failed
  9026. #define failed failed2
  9027. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9028. LLCHECKSTK;
  9029. for (;;) {
  9030. switch (llstk[llcstp++]) {
  9031. case 1: case -1:
  9032. LLDEBUG_ALTERNATIVE("IntersectionMark", 1);
  9033. {LLSTATE llstate_1;
  9034. if (!llterm('^', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9035. *llout = llstate_1;
  9036. break;
  9037. }
  9038. case 2: case -2:
  9039. LLDEBUG_ALTERNATIVE("IntersectionMark", 2);
  9040. {LLSTATE llstate_1;
  9041. if (!llterm(T_INTERSECTION, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9042. *llout = llstate_1;
  9043. break;
  9044. }
  9045. default:
  9046. llstk[--llcstp] = 1;
  9047. goto failed1;
  9048. failed2:
  9049. LLDEBUG_BACKTRACKING("IntersectionMark");
  9050. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9051. llcpos = llpos1; llcstp = llstp1;
  9052. continue;
  9053. } break;
  9054. }}
  9055. LLDEBUG_LEAVE("IntersectionMark", 1);
  9056. return 1;
  9057. failed1: LLDEBUG_LEAVE("IntersectionMark", 0);
  9058. return 0;
  9059. }
  9060. int ll_Elements(XElementSetSpec *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XObjectClass llarg_objectclass, XBoolean llarg_permalpha)
  9061. {
  9062. unsigned llstp = llcstp;
  9063. LLSTATE llstate_0;
  9064. LLDEBUG_ENTER("Elements");
  9065. llstate_0 = *llin;
  9066. #undef failed
  9067. #define failed failed1
  9068. #undef failed
  9069. #define failed failed2
  9070. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9071. LLCHECKSTK;
  9072. for (;;) {
  9073. switch (llstk[llcstp++]) {
  9074. case 1: case -1:
  9075. LLDEBUG_ALTERNATIVE("Elements", 1);
  9076. {if (llarg_objectclass)
  9077. LLFAILED((&llstate_0.pos, "Bad object set"));
  9078. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9079. if (!ll_SubtypeElements(&llatt_1, &llstate_0, &llstate_1, llarg_type, llarg_permalpha)) goto failed2;
  9080. *llout = llstate_1;
  9081. {(*llret) = NewElementSetSpec(eElementSetSpec_SubtypeElement);
  9082. (*llret)->U.SubtypeElement.SubtypeElement = llatt_1;
  9083. break;
  9084. }}}
  9085. case 2: case -2:
  9086. LLDEBUG_ALTERNATIVE("Elements", 2);
  9087. {if (llarg_type)
  9088. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9089. {LLSTATE llstate_1;XObjectSetElement llatt_1;
  9090. if (!ll_ObjectSetElements(&llatt_1, &llstate_0, &llstate_1, llarg_objectclass)) goto failed2;
  9091. *llout = llstate_1;
  9092. {(*llret) = NewElementSetSpec(eElementSetSpec_ObjectSetElement);
  9093. (*llret)->U.ObjectSetElement.ObjectSetElement = llatt_1;
  9094. break;
  9095. }}}
  9096. case 3: case -3:
  9097. LLDEBUG_ALTERNATIVE("Elements", 3);
  9098. {LLSTATE llstate_1;
  9099. if (!llterm('(', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9100. {LLSTATE llstate_2;XElementSetSpec llatt_2;
  9101. if (!ll_ElementSetSpec(&llatt_2, &llstate_1, &llstate_2, llarg_type, llarg_objectclass, llarg_permalpha)) goto failed2;
  9102. {LLSTATE llstate_3;
  9103. if (!llterm(')', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed2;
  9104. *llout = llstate_3;
  9105. {(*llret) = llatt_2;
  9106. break;
  9107. }}}}
  9108. default:
  9109. llstk[--llcstp] = 1;
  9110. goto failed1;
  9111. failed2:
  9112. LLDEBUG_BACKTRACKING("Elements");
  9113. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9114. llcpos = llpos1; llcstp = llstp1;
  9115. continue;
  9116. } break;
  9117. }}
  9118. LLDEBUG_LEAVE("Elements", 1);
  9119. return 1;
  9120. failed1: LLDEBUG_LEAVE("Elements", 0);
  9121. return 0;
  9122. }
  9123. int ll_SubtypeElements(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type, XBoolean llarg_permalpha)
  9124. {
  9125. unsigned llstp = llcstp;
  9126. LLSTATE llstate_0;
  9127. LLDEBUG_ENTER("SubtypeElements");
  9128. llstate_0 = *llin;
  9129. #undef failed
  9130. #define failed failed1
  9131. #undef failed
  9132. #define failed failed2
  9133. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9134. LLCHECKSTK;
  9135. for (;;) {
  9136. switch (llstk[llcstp++]) {
  9137. case 1: case -1:
  9138. LLDEBUG_ALTERNATIVE("SubtypeElements", 1);
  9139. {Type_e type;
  9140. type = GetTypeType((*llin).Assignments, llarg_type);
  9141. if (type == eType_Open)
  9142. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9143. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9144. if (!ll_SingleValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9145. *llout = llstate_1;
  9146. {(*llret) = llatt_1;
  9147. break;
  9148. }}}
  9149. case 2: case -2:
  9150. LLDEBUG_ALTERNATIVE("SubtypeElements", 2);
  9151. {Type_e type;
  9152. type = GetTypeType((*llin).Assignments, llarg_type);
  9153. if (type == eType_EmbeddedPdv ||
  9154. type == eType_External ||
  9155. type == eType_Open ||
  9156. type == eType_CharacterString)
  9157. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9158. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9159. if (!ll_ContainedSubtype(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9160. *llout = llstate_1;
  9161. {(*llret) = llatt_1;
  9162. break;
  9163. }}}
  9164. case 3: case -3:
  9165. LLDEBUG_ALTERNATIVE("SubtypeElements", 3);
  9166. {Type_e type;
  9167. type = GetTypeType((*llin).Assignments, llarg_type);
  9168. if (llarg_permalpha ?
  9169. (type != eType_Undefined &&
  9170. type != eType_BMPString &&
  9171. type != eType_IA5String &&
  9172. type != eType_NumericString &&
  9173. type != eType_PrintableString &&
  9174. type != eType_VisibleString &&
  9175. type != eType_UniversalString) :
  9176. (type != eType_Undefined &&
  9177. type != eType_Integer &&
  9178. type != eType_Real))
  9179. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9180. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9181. if (!ll_ValueRange(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9182. *llout = llstate_1;
  9183. {(*llret) = llatt_1;
  9184. break;
  9185. }}}
  9186. case 4: case -4:
  9187. LLDEBUG_ALTERNATIVE("SubtypeElements", 4);
  9188. {Type_e type;
  9189. type = GetTypeType((*llin).Assignments, llarg_type);
  9190. if (type != eType_Undefined &&
  9191. !IsRestrictedString(type) ||
  9192. llarg_permalpha)
  9193. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9194. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9195. if (!ll_PermittedAlphabet(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9196. *llout = llstate_1;
  9197. {(*llret) = llatt_1;
  9198. break;
  9199. }}}
  9200. case 5: case -5:
  9201. LLDEBUG_ALTERNATIVE("SubtypeElements", 5);
  9202. {Type_e type;
  9203. type = GetTypeType((*llin).Assignments, llarg_type);
  9204. if (type != eType_Undefined &&
  9205. type != eType_BitString &&
  9206. type != eType_OctetString &&
  9207. type != eType_UTF8String &&
  9208. type != eType_SequenceOf &&
  9209. type != eType_SetOf &&
  9210. type != eType_CharacterString &&
  9211. !IsRestrictedString(type) ||
  9212. llarg_permalpha)
  9213. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9214. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9215. if (!ll_SizeConstraint(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  9216. *llout = llstate_1;
  9217. {(*llret) = llatt_1;
  9218. break;
  9219. }}}
  9220. case 6: case -6:
  9221. LLDEBUG_ALTERNATIVE("SubtypeElements", 6);
  9222. {Type_e type;
  9223. type = GetTypeType((*llin).Assignments, llarg_type);
  9224. if (type != eType_Undefined &&
  9225. type != eType_Open ||
  9226. llarg_permalpha)
  9227. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9228. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9229. if (!ll_TypeConstraint(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  9230. *llout = llstate_1;
  9231. {(*llret) = llatt_1;
  9232. break;
  9233. }}}
  9234. case 7: case -7:
  9235. LLDEBUG_ALTERNATIVE("SubtypeElements", 7);
  9236. {Type_e type;
  9237. type = GetTypeType((*llin).Assignments, llarg_type);
  9238. if (type != eType_Undefined &&
  9239. type != eType_Choice &&
  9240. type != eType_EmbeddedPdv &&
  9241. type != eType_External &&
  9242. type != eType_InstanceOf &&
  9243. type != eType_Real &&
  9244. type != eType_Sequence &&
  9245. type != eType_SequenceOf &&
  9246. type != eType_Set &&
  9247. type != eType_SetOf &&
  9248. type != eType_CharacterString ||
  9249. llarg_permalpha)
  9250. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9251. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9252. if (!ll_InnerTypeConstraints(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9253. *llout = llstate_1;
  9254. {(*llret) = llatt_1;
  9255. break;
  9256. }}}
  9257. default:
  9258. llstk[--llcstp] = 1;
  9259. goto failed1;
  9260. failed2:
  9261. LLDEBUG_BACKTRACKING("SubtypeElements");
  9262. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9263. llcpos = llpos1; llcstp = llstp1;
  9264. continue;
  9265. } break;
  9266. }}
  9267. LLDEBUG_LEAVE("SubtypeElements", 1);
  9268. return 1;
  9269. failed1: LLDEBUG_LEAVE("SubtypeElements", 0);
  9270. return 0;
  9271. }
  9272. int ll_SingleValue(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9273. {
  9274. unsigned llstp = llcstp;
  9275. LLSTATE llstate_0;
  9276. LLDEBUG_ENTER("SingleValue");
  9277. llstate_0 = *llin;
  9278. #undef failed
  9279. #define failed failed1
  9280. {LLSTATE llstate_1;XValue llatt_1;
  9281. if (!ll_Value(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  9282. *llout = llstate_1;
  9283. {(*llret) = NewSubtypeElement(eSubtypeElement_SingleValue);
  9284. (*llret)->U.SingleValue.Value = llatt_1;
  9285. }}
  9286. LLDEBUG_LEAVE("SingleValue", 1);
  9287. return 1;
  9288. failed1: LLDEBUG_LEAVE("SingleValue", 0);
  9289. return 0;
  9290. }
  9291. int ll_ContainedSubtype(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9292. {
  9293. unsigned llstp = llcstp;
  9294. LLSTATE llstate_0;
  9295. LLDEBUG_ENTER("ContainedSubtype");
  9296. llstate_0 = *llin;
  9297. #undef failed
  9298. #define failed failed1
  9299. {LLSTATE llstate_1;XBoolean llatt_1;
  9300. if (!ll_Includes(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  9301. {LLSTATE llstate_2;XType llatt_2;
  9302. if (!ll_Type(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  9303. *llout = llstate_2;
  9304. {if (GetTypeType((*llout).Assignments, llatt_2) == eType_Null && !llatt_1)
  9305. LLFAILED((&llstate_1.pos, "Bad constraint"));
  9306. if (GetTypeType((*llout).Assignments, llarg_type) != eType_Undefined &&
  9307. GetTypeType((*llout).Assignments, llatt_2) != eType_Undefined &&
  9308. GetTypeType((*llout).Assignments, llarg_type) !=
  9309. GetTypeType((*llout).Assignments, llatt_2) &&
  9310. GetTypeType((*llout).Assignments, llarg_type) != eType_Open &&
  9311. GetTypeType((*llout).Assignments, llatt_2) != eType_Open &&
  9312. (!IsRestrictedString(GetTypeType((*llout).Assignments, llarg_type)) ||
  9313. !IsRestrictedString(GetTypeType((*llout).Assignments, llatt_2))))
  9314. LLFAILED((&llstate_2.pos, "Bad type of contained-subtype-constraint"));
  9315. (*llret) = NewSubtypeElement(eSubtypeElement_ContainedSubtype);
  9316. (*llret)->U.ContainedSubtype.Type = llatt_2;
  9317. }}}
  9318. LLDEBUG_LEAVE("ContainedSubtype", 1);
  9319. return 1;
  9320. failed1: LLDEBUG_LEAVE("ContainedSubtype", 0);
  9321. return 0;
  9322. }
  9323. int ll_Includes(XBoolean *llret, LLSTATE *llin, LLSTATE *llout)
  9324. {
  9325. unsigned llstp = llcstp;
  9326. LLSTATE llstate_0;
  9327. LLDEBUG_ENTER("Includes");
  9328. llstate_0 = *llin;
  9329. #undef failed
  9330. #define failed failed1
  9331. #undef failed
  9332. #define failed failed2
  9333. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9334. LLCHECKSTK;
  9335. for (;;) {
  9336. switch (llstk[llcstp++]) {
  9337. case 1: case -1:
  9338. LLDEBUG_ALTERNATIVE("Includes", 1);
  9339. {LLSTATE llstate_1;
  9340. if (!llterm(T_INCLUDES, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9341. *llout = llstate_1;
  9342. {(*llret) = 1;
  9343. break;
  9344. }}
  9345. case 2: case -2:
  9346. LLDEBUG_ALTERNATIVE("Includes", 2);
  9347. *llout = llstate_0;
  9348. {(*llret) = 0;
  9349. break;
  9350. }
  9351. default:
  9352. llstk[--llcstp] = 1;
  9353. goto failed1;
  9354. failed2:
  9355. LLDEBUG_BACKTRACKING("Includes");
  9356. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9357. llcpos = llpos1; llcstp = llstp1;
  9358. continue;
  9359. } break;
  9360. }}
  9361. LLDEBUG_LEAVE("Includes", 1);
  9362. return 1;
  9363. failed1: LLDEBUG_LEAVE("Includes", 0);
  9364. return 0;
  9365. }
  9366. int ll_ValueRange(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9367. {
  9368. unsigned llstp = llcstp;
  9369. LLSTATE llstate_0;
  9370. LLDEBUG_ENTER("ValueRange");
  9371. llstate_0 = *llin;
  9372. #undef failed
  9373. #define failed failed1
  9374. {LLSTATE llstate_1;XEndPoint llatt_1;
  9375. if (!ll_LowerEndpoint(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  9376. {LLSTATE llstate_2;
  9377. if (!llterm(T_DDOT, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  9378. {LLSTATE llstate_3;XEndPoint llatt_3;
  9379. if (!ll_UpperEndpoint(&llatt_3, &llstate_2, &llstate_3, llarg_type)) goto failed1;
  9380. *llout = llstate_3;
  9381. {if (!llarg_type) {
  9382. (*llret) = NULL;
  9383. } else {
  9384. (*llret) = NewSubtypeElement(eSubtypeElement_ValueRange);
  9385. (*llret)->U.ValueRange.Lower = llatt_1;
  9386. (*llret)->U.ValueRange.Upper = llatt_3;
  9387. }
  9388. }}}}
  9389. LLDEBUG_LEAVE("ValueRange", 1);
  9390. return 1;
  9391. failed1: LLDEBUG_LEAVE("ValueRange", 0);
  9392. return 0;
  9393. }
  9394. int ll_LowerEndpoint(XEndPoint *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9395. {
  9396. unsigned llstp = llcstp;
  9397. LLSTATE llstate_0;
  9398. LLDEBUG_ENTER("LowerEndpoint");
  9399. llstate_0 = *llin;
  9400. #undef failed
  9401. #define failed failed1
  9402. #undef failed
  9403. #define failed failed2
  9404. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9405. LLCHECKSTK;
  9406. for (;;) {
  9407. switch (llstk[llcstp++]) {
  9408. case 1: case -1:
  9409. LLDEBUG_ALTERNATIVE("LowerEndpoint", 1);
  9410. {LLSTATE llstate_1;XEndPoint llatt_1;
  9411. if (!ll_LowerEndValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9412. {LLSTATE llstate_2;
  9413. if (!llterm('<', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  9414. *llout = llstate_2;
  9415. {(*llret) = llatt_1;
  9416. (*llret).Flags |= eEndPoint_Open;
  9417. break;
  9418. }}}
  9419. case 2: case -2:
  9420. LLDEBUG_ALTERNATIVE("LowerEndpoint", 2);
  9421. {LLSTATE llstate_1;XEndPoint llatt_1;
  9422. if (!ll_LowerEndValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9423. *llout = llstate_1;
  9424. {(*llret) = llatt_1;
  9425. break;
  9426. }}
  9427. default:
  9428. llstk[--llcstp] = 1;
  9429. goto failed1;
  9430. failed2:
  9431. LLDEBUG_BACKTRACKING("LowerEndpoint");
  9432. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9433. llcpos = llpos1; llcstp = llstp1;
  9434. continue;
  9435. } break;
  9436. }}
  9437. LLDEBUG_LEAVE("LowerEndpoint", 1);
  9438. return 1;
  9439. failed1: LLDEBUG_LEAVE("LowerEndpoint", 0);
  9440. return 0;
  9441. }
  9442. int ll_UpperEndpoint(XEndPoint *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9443. {
  9444. unsigned llstp = llcstp;
  9445. LLSTATE llstate_0;
  9446. LLDEBUG_ENTER("UpperEndpoint");
  9447. llstate_0 = *llin;
  9448. #undef failed
  9449. #define failed failed1
  9450. #undef failed
  9451. #define failed failed2
  9452. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9453. LLCHECKSTK;
  9454. for (;;) {
  9455. switch (llstk[llcstp++]) {
  9456. case 1: case -1:
  9457. LLDEBUG_ALTERNATIVE("UpperEndpoint", 1);
  9458. {LLSTATE llstate_1;
  9459. if (!llterm('<', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9460. {LLSTATE llstate_2;XEndPoint llatt_2;
  9461. if (!ll_UpperEndValue(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed2;
  9462. *llout = llstate_2;
  9463. {(*llret) = llatt_2;
  9464. (*llret).Flags |= eEndPoint_Open;
  9465. break;
  9466. }}}
  9467. case 2: case -2:
  9468. LLDEBUG_ALTERNATIVE("UpperEndpoint", 2);
  9469. {LLSTATE llstate_1;XEndPoint llatt_1;
  9470. if (!ll_UpperEndValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9471. *llout = llstate_1;
  9472. {(*llret) = llatt_1;
  9473. break;
  9474. }}
  9475. default:
  9476. llstk[--llcstp] = 1;
  9477. goto failed1;
  9478. failed2:
  9479. LLDEBUG_BACKTRACKING("UpperEndpoint");
  9480. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9481. llcpos = llpos1; llcstp = llstp1;
  9482. continue;
  9483. } break;
  9484. }}
  9485. LLDEBUG_LEAVE("UpperEndpoint", 1);
  9486. return 1;
  9487. failed1: LLDEBUG_LEAVE("UpperEndpoint", 0);
  9488. return 0;
  9489. }
  9490. int ll_LowerEndValue(XEndPoint *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9491. {
  9492. unsigned llstp = llcstp;
  9493. LLSTATE llstate_0;
  9494. LLDEBUG_ENTER("LowerEndValue");
  9495. llstate_0 = *llin;
  9496. #undef failed
  9497. #define failed failed1
  9498. #undef failed
  9499. #define failed failed2
  9500. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9501. LLCHECKSTK;
  9502. for (;;) {
  9503. switch (llstk[llcstp++]) {
  9504. case 1: case -1:
  9505. LLDEBUG_ALTERNATIVE("LowerEndValue", 1);
  9506. {LLSTATE llstate_1;XValue llatt_1;
  9507. if (!ll_Value(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9508. *llout = llstate_1;
  9509. {(*llret).Value = llatt_1;
  9510. (*llret).Flags = 0;
  9511. break;
  9512. }}
  9513. case 2: case -2:
  9514. LLDEBUG_ALTERNATIVE("LowerEndValue", 2);
  9515. {LLSTATE llstate_1;
  9516. if (!llterm(T_MIN, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9517. *llout = llstate_1;
  9518. {(*llret).Value = NULL;
  9519. (*llret).Flags = eEndPoint_Min;
  9520. break;
  9521. }}
  9522. default:
  9523. llstk[--llcstp] = 1;
  9524. goto failed1;
  9525. failed2:
  9526. LLDEBUG_BACKTRACKING("LowerEndValue");
  9527. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9528. llcpos = llpos1; llcstp = llstp1;
  9529. continue;
  9530. } break;
  9531. }}
  9532. LLDEBUG_LEAVE("LowerEndValue", 1);
  9533. return 1;
  9534. failed1: LLDEBUG_LEAVE("LowerEndValue", 0);
  9535. return 0;
  9536. }
  9537. int ll_UpperEndValue(XEndPoint *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9538. {
  9539. unsigned llstp = llcstp;
  9540. LLSTATE llstate_0;
  9541. LLDEBUG_ENTER("UpperEndValue");
  9542. llstate_0 = *llin;
  9543. #undef failed
  9544. #define failed failed1
  9545. #undef failed
  9546. #define failed failed2
  9547. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9548. LLCHECKSTK;
  9549. for (;;) {
  9550. switch (llstk[llcstp++]) {
  9551. case 1: case -1:
  9552. LLDEBUG_ALTERNATIVE("UpperEndValue", 1);
  9553. {LLSTATE llstate_1;XValue llatt_1;
  9554. if (!ll_Value(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  9555. *llout = llstate_1;
  9556. {(*llret).Value = llatt_1;
  9557. (*llret).Flags = 0;
  9558. break;
  9559. }}
  9560. case 2: case -2:
  9561. LLDEBUG_ALTERNATIVE("UpperEndValue", 2);
  9562. {LLSTATE llstate_1;
  9563. if (!llterm(T_MAX, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9564. *llout = llstate_1;
  9565. {(*llret).Value = NULL;
  9566. (*llret).Flags = eEndPoint_Max;
  9567. break;
  9568. }}
  9569. default:
  9570. llstk[--llcstp] = 1;
  9571. goto failed1;
  9572. failed2:
  9573. LLDEBUG_BACKTRACKING("UpperEndValue");
  9574. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9575. llcpos = llpos1; llcstp = llstp1;
  9576. continue;
  9577. } break;
  9578. }}
  9579. LLDEBUG_LEAVE("UpperEndValue", 1);
  9580. return 1;
  9581. failed1: LLDEBUG_LEAVE("UpperEndValue", 0);
  9582. return 0;
  9583. }
  9584. int ll_SizeConstraint(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout)
  9585. {
  9586. unsigned llstp = llcstp;
  9587. LLSTATE llstate_0;
  9588. LLDEBUG_ENTER("SizeConstraint");
  9589. llstate_0 = *llin;
  9590. #undef failed
  9591. #define failed failed1
  9592. {LLSTATE llstate_1;
  9593. if (!llterm(T_SIZE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  9594. {LLSTATE llstate_2;XConstraints llatt_2;
  9595. if (!ll_Constraint(&llatt_2, &llstate_1, &llstate_2, Builtin_Type_PositiveInteger, 0)) goto failed1;
  9596. *llout = llstate_2;
  9597. {(*llret) = NewSubtypeElement(eSubtypeElement_Size);
  9598. (*llret)->U.Size.Constraints = llatt_2;
  9599. }}}
  9600. LLDEBUG_LEAVE("SizeConstraint", 1);
  9601. return 1;
  9602. failed1: LLDEBUG_LEAVE("SizeConstraint", 0);
  9603. return 0;
  9604. }
  9605. int ll_TypeConstraint(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout)
  9606. {
  9607. unsigned llstp = llcstp;
  9608. LLSTATE llstate_0;
  9609. LLDEBUG_ENTER("TypeConstraint");
  9610. llstate_0 = *llin;
  9611. #undef failed
  9612. #define failed failed1
  9613. {LLSTATE llstate_1;XType llatt_1;
  9614. if (!ll_Type(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  9615. *llout = llstate_1;
  9616. {(*llret) = NewSubtypeElement(eSubtypeElement_Type);
  9617. (*llret)->U.Type.Type = llatt_1;
  9618. }}
  9619. LLDEBUG_LEAVE("TypeConstraint", 1);
  9620. return 1;
  9621. failed1: LLDEBUG_LEAVE("TypeConstraint", 0);
  9622. return 0;
  9623. }
  9624. int ll_PermittedAlphabet(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9625. {
  9626. unsigned llstp = llcstp;
  9627. LLSTATE llstate_0;
  9628. LLDEBUG_ENTER("PermittedAlphabet");
  9629. llstate_0 = *llin;
  9630. #undef failed
  9631. #define failed failed1
  9632. {LLSTATE llstate_1;
  9633. if (!llterm(T_FROM, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  9634. {LLSTATE llstate_2;XConstraints llatt_2;
  9635. if (!ll_Constraint(&llatt_2, &llstate_1, &llstate_2, llarg_type, 1)) goto failed1;
  9636. *llout = llstate_2;
  9637. {(*llret) = NewSubtypeElement(eSubtypeElement_PermittedAlphabet);
  9638. (*llret)->U.PermittedAlphabet.Constraints = llatt_2;
  9639. }}}
  9640. LLDEBUG_LEAVE("PermittedAlphabet", 1);
  9641. return 1;
  9642. failed1: LLDEBUG_LEAVE("PermittedAlphabet", 0);
  9643. return 0;
  9644. }
  9645. int ll_InnerTypeConstraints(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9646. {
  9647. unsigned llstp = llcstp;
  9648. LLSTATE llstate_0;
  9649. LLDEBUG_ENTER("InnerTypeConstraints");
  9650. llstate_0 = *llin;
  9651. #undef failed
  9652. #define failed failed1
  9653. #undef failed
  9654. #define failed failed2
  9655. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9656. LLCHECKSTK;
  9657. for (;;) {
  9658. switch (llstk[llcstp++]) {
  9659. case 1: case -1:
  9660. LLDEBUG_ALTERNATIVE("InnerTypeConstraints", 1);
  9661. {Type_t *subtype;
  9662. if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  9663. GetTypeType((*llin).Assignments, llarg_type) != eType_SequenceOf &&
  9664. GetTypeType((*llin).Assignments, llarg_type) != eType_SetOf)
  9665. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9666. if (GetTypeType((*llin).Assignments, llarg_type) == eType_Undefined)
  9667. subtype = NULL;
  9668. else
  9669. subtype = GetType((*llin).Assignments, llarg_type)->U.SS.Type;
  9670. {LLSTATE llstate_1;
  9671. if (!llterm(T_WITH, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9672. {LLSTATE llstate_2;
  9673. if (!llterm(T_COMPONENT, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  9674. {LLSTATE llstate_3;XSubtypeElement llatt_3;
  9675. if (!ll_SingleTypeConstraint(&llatt_3, &llstate_2, &llstate_3, subtype)) goto failed2;
  9676. *llout = llstate_3;
  9677. {(*llret) = llatt_3;
  9678. break;
  9679. }}}}}
  9680. case 2: case -2:
  9681. LLDEBUG_ALTERNATIVE("InnerTypeConstraints", 2);
  9682. {Component_t *components;
  9683. if (GetTypeType((*llin).Assignments, llarg_type) != eType_Undefined &&
  9684. GetTypeType((*llin).Assignments, llarg_type) != eType_Sequence &&
  9685. GetTypeType((*llin).Assignments, llarg_type) != eType_Set &&
  9686. GetTypeType((*llin).Assignments, llarg_type) != eType_Choice &&
  9687. GetTypeType((*llin).Assignments, llarg_type) != eType_Real &&
  9688. GetTypeType((*llin).Assignments, llarg_type) != eType_External &&
  9689. GetTypeType((*llin).Assignments, llarg_type) != eType_EmbeddedPdv &&
  9690. GetTypeType((*llin).Assignments, llarg_type) != eType_CharacterString)
  9691. LLFAILED((&llstate_0.pos, "Bad constraint"));
  9692. if (GetTypeType((*llin).Assignments, llarg_type) == eType_Undefined)
  9693. components = NULL;
  9694. else
  9695. components = GetType((*llin).Assignments, llarg_type)->U.SSC.Components;
  9696. {LLSTATE llstate_1;
  9697. if (!llterm(T_WITH, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9698. {LLSTATE llstate_2;
  9699. if (!llterm(T_COMPONENTS, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  9700. {LLSTATE llstate_3;XSubtypeElement llatt_3;
  9701. if (!ll_MultipleTypeConstraints(&llatt_3, &llstate_2, &llstate_3, components)) goto failed2;
  9702. *llout = llstate_3;
  9703. {(*llret) = llatt_3;
  9704. break;
  9705. }}}}}
  9706. default:
  9707. llstk[--llcstp] = 1;
  9708. goto failed1;
  9709. failed2:
  9710. LLDEBUG_BACKTRACKING("InnerTypeConstraints");
  9711. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9712. llcpos = llpos1; llcstp = llstp1;
  9713. continue;
  9714. } break;
  9715. }}
  9716. LLDEBUG_LEAVE("InnerTypeConstraints", 1);
  9717. return 1;
  9718. failed1: LLDEBUG_LEAVE("InnerTypeConstraints", 0);
  9719. return 0;
  9720. }
  9721. int ll_SingleTypeConstraint(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9722. {
  9723. unsigned llstp = llcstp;
  9724. LLSTATE llstate_0;
  9725. LLDEBUG_ENTER("SingleTypeConstraint");
  9726. llstate_0 = *llin;
  9727. #undef failed
  9728. #define failed failed1
  9729. {LLSTATE llstate_1;XConstraints llatt_1;
  9730. if (!ll_Constraint(&llatt_1, &llstate_0, &llstate_1, llarg_type, 0)) goto failed1;
  9731. *llout = llstate_1;
  9732. {(*llret) = NewSubtypeElement(eSubtypeElement_SingleType);
  9733. (*llret)->U.SingleType.Constraints = llatt_1;
  9734. }}
  9735. LLDEBUG_LEAVE("SingleTypeConstraint", 1);
  9736. return 1;
  9737. failed1: LLDEBUG_LEAVE("SingleTypeConstraint", 0);
  9738. return 0;
  9739. }
  9740. int ll_MultipleTypeConstraints(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components)
  9741. {
  9742. unsigned llstp = llcstp;
  9743. LLSTATE llstate_0;
  9744. LLDEBUG_ENTER("MultipleTypeConstraints");
  9745. llstate_0 = *llin;
  9746. #undef failed
  9747. #define failed failed1
  9748. #undef failed
  9749. #define failed failed2
  9750. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9751. LLCHECKSTK;
  9752. for (;;) {
  9753. switch (llstk[llcstp++]) {
  9754. case 1: case -1:
  9755. LLDEBUG_ALTERNATIVE("MultipleTypeConstraints", 1);
  9756. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9757. if (!ll_FullSpecification(&llatt_1, &llstate_0, &llstate_1, llarg_components)) goto failed2;
  9758. *llout = llstate_1;
  9759. {(*llret) = llatt_1;
  9760. break;
  9761. }}
  9762. case 2: case -2:
  9763. LLDEBUG_ALTERNATIVE("MultipleTypeConstraints", 2);
  9764. {LLSTATE llstate_1;XSubtypeElement llatt_1;
  9765. if (!ll_PartialSpecification(&llatt_1, &llstate_0, &llstate_1, llarg_components)) goto failed2;
  9766. *llout = llstate_1;
  9767. {(*llret) = llatt_1;
  9768. break;
  9769. }}
  9770. default:
  9771. llstk[--llcstp] = 1;
  9772. goto failed1;
  9773. failed2:
  9774. LLDEBUG_BACKTRACKING("MultipleTypeConstraints");
  9775. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9776. llcpos = llpos1; llcstp = llstp1;
  9777. continue;
  9778. } break;
  9779. }}
  9780. LLDEBUG_LEAVE("MultipleTypeConstraints", 1);
  9781. return 1;
  9782. failed1: LLDEBUG_LEAVE("MultipleTypeConstraints", 0);
  9783. return 0;
  9784. }
  9785. int ll_FullSpecification(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components)
  9786. {
  9787. unsigned llstp = llcstp;
  9788. LLSTATE llstate_0;
  9789. LLDEBUG_ENTER("FullSpecification");
  9790. llstate_0 = *llin;
  9791. #undef failed
  9792. #define failed failed1
  9793. {LLSTATE llstate_1;
  9794. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  9795. {LLSTATE llstate_2;XNamedConstraints llatt_2;
  9796. if (!ll_TypeConstraints(&llatt_2, &llstate_1, &llstate_2, llarg_components)) goto failed1;
  9797. {LLSTATE llstate_3;
  9798. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  9799. *llout = llstate_3;
  9800. {(*llret) = NewSubtypeElement(eSubtypeElement_FullSpecification);
  9801. (*llret)->U.FullSpecification.NamedConstraints = llatt_2;
  9802. }}}}
  9803. LLDEBUG_LEAVE("FullSpecification", 1);
  9804. return 1;
  9805. failed1: LLDEBUG_LEAVE("FullSpecification", 0);
  9806. return 0;
  9807. }
  9808. int ll_PartialSpecification(XSubtypeElement *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components)
  9809. {
  9810. unsigned llstp = llcstp;
  9811. LLSTATE llstate_0;
  9812. LLDEBUG_ENTER("PartialSpecification");
  9813. llstate_0 = *llin;
  9814. #undef failed
  9815. #define failed failed1
  9816. {LLSTATE llstate_1;
  9817. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  9818. {LLSTATE llstate_2;
  9819. if (!llterm(T_TDOT, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  9820. {LLSTATE llstate_3;
  9821. if (!llterm(',', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  9822. {LLSTATE llstate_4;XNamedConstraints llatt_4;
  9823. if (!ll_TypeConstraints(&llatt_4, &llstate_3, &llstate_4, llarg_components)) goto failed1;
  9824. {LLSTATE llstate_5;
  9825. if (!llterm('}', (LLSTYPE *)0, &llstate_4, &llstate_5)) goto failed1;
  9826. *llout = llstate_5;
  9827. {(*llret) = NewSubtypeElement(eSubtypeElement_PartialSpecification);
  9828. (*llret)->U.PartialSpecification.NamedConstraints = llatt_4;
  9829. }}}}}}
  9830. LLDEBUG_LEAVE("PartialSpecification", 1);
  9831. return 1;
  9832. failed1: LLDEBUG_LEAVE("PartialSpecification", 0);
  9833. return 0;
  9834. }
  9835. int ll_TypeConstraints(XNamedConstraints *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components)
  9836. {
  9837. unsigned llstp = llcstp;
  9838. LLSTATE llstate_0;
  9839. LLDEBUG_ENTER("TypeConstraints");
  9840. llstate_0 = *llin;
  9841. #undef failed
  9842. #define failed failed1
  9843. #undef failed
  9844. #define failed failed2
  9845. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9846. LLCHECKSTK;
  9847. for (;;) {
  9848. switch (llstk[llcstp++]) {
  9849. case 1: case -1:
  9850. LLDEBUG_ALTERNATIVE("TypeConstraints", 1);
  9851. {LLSTATE llstate_1;XNamedConstraints llatt_1;
  9852. if (!ll_NamedConstraint(&llatt_1, &llstate_0, &llstate_1, llarg_components)) goto failed2;
  9853. *llout = llstate_1;
  9854. {(*llret) = llatt_1;
  9855. break;
  9856. }}
  9857. case 2: case -2:
  9858. LLDEBUG_ALTERNATIVE("TypeConstraints", 2);
  9859. {LLSTATE llstate_1;XNamedConstraints llatt_1;
  9860. if (!ll_NamedConstraint(&llatt_1, &llstate_0, &llstate_1, llarg_components)) goto failed2;
  9861. {LLSTATE llstate_2;
  9862. if (!llterm(',', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  9863. {LLSTATE llstate_3;XNamedConstraints llatt_3;
  9864. if (!ll_TypeConstraints(&llatt_3, &llstate_2, &llstate_3, llarg_components)) goto failed2;
  9865. *llout = llstate_3;
  9866. {(*llret) = llatt_1;
  9867. (*llret)->Next = llatt_3;
  9868. break;
  9869. }}}}
  9870. default:
  9871. llstk[--llcstp] = 1;
  9872. goto failed1;
  9873. failed2:
  9874. LLDEBUG_BACKTRACKING("TypeConstraints");
  9875. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9876. llcpos = llpos1; llcstp = llstp1;
  9877. continue;
  9878. } break;
  9879. }}
  9880. LLDEBUG_LEAVE("TypeConstraints", 1);
  9881. return 1;
  9882. failed1: LLDEBUG_LEAVE("TypeConstraints", 0);
  9883. return 0;
  9884. }
  9885. int ll_NamedConstraint(XNamedConstraints *llret, LLSTATE *llin, LLSTATE *llout, XComponents llarg_components)
  9886. {
  9887. unsigned llstp = llcstp;
  9888. LLSTATE llstate_0;
  9889. LLDEBUG_ENTER("NamedConstraint");
  9890. llstate_0 = *llin;
  9891. #undef failed
  9892. #define failed failed1
  9893. {LLSTATE llstate_1;XString llatt_1;
  9894. if (!ll_identifier(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  9895. {Component_t *component;
  9896. Type_t *type;
  9897. component = FindComponent(llstate_1.Assignments, llarg_components, llatt_1);
  9898. type = component ? component->U.NOD.NamedType->Type : NULL;
  9899. {LLSTATE llstate_2;XNamedConstraints llatt_2;
  9900. if (!ll_ComponentConstraint(&llatt_2, &llstate_1, &llstate_2, type)) goto failed1;
  9901. *llout = llstate_2;
  9902. {(*llret) = llatt_2;
  9903. (*llret)->Identifier = llatt_1;
  9904. }}}}
  9905. LLDEBUG_LEAVE("NamedConstraint", 1);
  9906. return 1;
  9907. failed1: LLDEBUG_LEAVE("NamedConstraint", 0);
  9908. return 0;
  9909. }
  9910. int ll_ComponentConstraint(XNamedConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9911. {
  9912. unsigned llstp = llcstp;
  9913. LLSTATE llstate_0;
  9914. LLDEBUG_ENTER("ComponentConstraint");
  9915. llstate_0 = *llin;
  9916. #undef failed
  9917. #define failed failed1
  9918. {LLSTATE llstate_1;XConstraints llatt_1;
  9919. if (!ll_ValueConstraint(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  9920. {LLSTATE llstate_2;XPresence llatt_2;
  9921. if (!ll_PresenceConstraint(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  9922. *llout = llstate_2;
  9923. {(*llret) = NewNamedConstraint();
  9924. (*llret)->Constraint = llatt_1;
  9925. (*llret)->Presence = llatt_2;
  9926. }}}
  9927. LLDEBUG_LEAVE("ComponentConstraint", 1);
  9928. return 1;
  9929. failed1: LLDEBUG_LEAVE("ComponentConstraint", 0);
  9930. return 0;
  9931. }
  9932. int ll_ValueConstraint(XConstraints *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  9933. {
  9934. unsigned llstp = llcstp;
  9935. LLSTATE llstate_0;
  9936. LLDEBUG_ENTER("ValueConstraint");
  9937. llstate_0 = *llin;
  9938. #undef failed
  9939. #define failed failed1
  9940. #undef failed
  9941. #define failed failed2
  9942. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9943. LLCHECKSTK;
  9944. for (;;) {
  9945. switch (llstk[llcstp++]) {
  9946. case 1: case -1:
  9947. LLDEBUG_ALTERNATIVE("ValueConstraint", 1);
  9948. {LLSTATE llstate_1;XConstraints llatt_1;
  9949. if (!ll_Constraint(&llatt_1, &llstate_0, &llstate_1, llarg_type, 0)) goto failed2;
  9950. *llout = llstate_1;
  9951. {(*llret) = llatt_1;
  9952. break;
  9953. }}
  9954. case 2: case -2:
  9955. LLDEBUG_ALTERNATIVE("ValueConstraint", 2);
  9956. *llout = llstate_0;
  9957. {(*llret) = NULL;
  9958. break;
  9959. }
  9960. default:
  9961. llstk[--llcstp] = 1;
  9962. goto failed1;
  9963. failed2:
  9964. LLDEBUG_BACKTRACKING("ValueConstraint");
  9965. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  9966. llcpos = llpos1; llcstp = llstp1;
  9967. continue;
  9968. } break;
  9969. }}
  9970. LLDEBUG_LEAVE("ValueConstraint", 1);
  9971. return 1;
  9972. failed1: LLDEBUG_LEAVE("ValueConstraint", 0);
  9973. return 0;
  9974. }
  9975. int ll_PresenceConstraint(XPresence *llret, LLSTATE *llin, LLSTATE *llout)
  9976. {
  9977. unsigned llstp = llcstp;
  9978. LLSTATE llstate_0;
  9979. LLDEBUG_ENTER("PresenceConstraint");
  9980. llstate_0 = *llin;
  9981. #undef failed
  9982. #define failed failed1
  9983. #undef failed
  9984. #define failed failed2
  9985. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  9986. LLCHECKSTK;
  9987. for (;;) {
  9988. switch (llstk[llcstp++]) {
  9989. case 1: case -1:
  9990. LLDEBUG_ALTERNATIVE("PresenceConstraint", 1);
  9991. {LLSTATE llstate_1;
  9992. if (!llterm(T_PRESENT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  9993. *llout = llstate_1;
  9994. {(*llret) = ePresence_Present;
  9995. break;
  9996. }}
  9997. case 2: case -2:
  9998. LLDEBUG_ALTERNATIVE("PresenceConstraint", 2);
  9999. {LLSTATE llstate_1;
  10000. if (!llterm(T_ABSENT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10001. *llout = llstate_1;
  10002. {(*llret) = ePresence_Absent;
  10003. break;
  10004. }}
  10005. case 3: case -3:
  10006. LLDEBUG_ALTERNATIVE("PresenceConstraint", 3);
  10007. {LLSTATE llstate_1;
  10008. if (!llterm(T_OPTIONAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10009. *llout = llstate_1;
  10010. {(*llret) = ePresence_Optional;
  10011. break;
  10012. }}
  10013. case 4: case -4:
  10014. LLDEBUG_ALTERNATIVE("PresenceConstraint", 4);
  10015. *llout = llstate_0;
  10016. {(*llret) = ePresence_Normal;
  10017. break;
  10018. }
  10019. default:
  10020. llstk[--llcstp] = 1;
  10021. goto failed1;
  10022. failed2:
  10023. LLDEBUG_BACKTRACKING("PresenceConstraint");
  10024. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10025. llcpos = llpos1; llcstp = llstp1;
  10026. continue;
  10027. } break;
  10028. }}
  10029. LLDEBUG_LEAVE("PresenceConstraint", 1);
  10030. return 1;
  10031. failed1: LLDEBUG_LEAVE("PresenceConstraint", 0);
  10032. return 0;
  10033. }
  10034. int ll_GeneralConstraint(LLSTATE *llin, LLSTATE *llout)
  10035. {
  10036. unsigned llstp = llcstp;
  10037. LLSTATE llstate_0;
  10038. LLDEBUG_ENTER("GeneralConstraint");
  10039. llstate_0 = *llin;
  10040. #undef failed
  10041. #define failed failed1
  10042. {LLSTATE llstate_1;
  10043. if (!llterm(T_CON_XXX1, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  10044. *llout = llstate_1;
  10045. {MyAbort();
  10046. }}
  10047. LLDEBUG_LEAVE("GeneralConstraint", 1);
  10048. return 1;
  10049. failed1: LLDEBUG_LEAVE("GeneralConstraint", 0);
  10050. return 0;
  10051. }
  10052. int ll_LocalTypeDirectiveSeq(XDirectives *llret, LLSTATE *llin, LLSTATE *llout)
  10053. {
  10054. unsigned llstp = llcstp;
  10055. LLSTATE llstate_0;
  10056. LLDEBUG_ENTER("LocalTypeDirectiveSeq");
  10057. llstate_0 = *llin;
  10058. #undef failed
  10059. #define failed failed1
  10060. {LLSTATE llstate_1;XDirectives llatt_1;
  10061. if (!ll_LocalTypeDirective(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  10062. {LLSTATE llstate_2;XDirectives llatt_2;
  10063. if (!ll_LocalTypeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  10064. *llout = llstate_2;
  10065. {if (llatt_2) {
  10066. (*llret) = DupDirective(llatt_1);
  10067. (*llret)->Next = llatt_2;
  10068. } else {
  10069. (*llret) = llatt_1;
  10070. }
  10071. }}}
  10072. LLDEBUG_LEAVE("LocalTypeDirectiveSeq", 1);
  10073. return 1;
  10074. failed1: LLDEBUG_LEAVE("LocalTypeDirectiveSeq", 0);
  10075. return 0;
  10076. }
  10077. int ll_LocalTypeDirectiveESeq(XDirectives *llret, LLSTATE *llin, LLSTATE *llout)
  10078. {
  10079. unsigned llstp = llcstp;
  10080. LLSTATE llstate_0;
  10081. LLDEBUG_ENTER("LocalTypeDirectiveESeq");
  10082. llstate_0 = *llin;
  10083. #undef failed
  10084. #define failed failed1
  10085. #undef failed
  10086. #define failed failed2
  10087. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10088. LLCHECKSTK;
  10089. for (;;) {
  10090. switch (llstk[llcstp++]) {
  10091. case 1: case -1:
  10092. LLDEBUG_ALTERNATIVE("LocalTypeDirectiveESeq", 1);
  10093. {LLSTATE llstate_1;XDirectives llatt_1;
  10094. if (!ll_LocalTypeDirective(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  10095. {LLSTATE llstate_2;XDirectives llatt_2;
  10096. if (!ll_LocalTypeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  10097. *llout = llstate_2;
  10098. {if (llatt_2) {
  10099. (*llret) = DupDirective(llatt_1);
  10100. (*llret)->Next = llatt_2;
  10101. } else {
  10102. (*llret) = llatt_1;
  10103. }
  10104. break;
  10105. }}}
  10106. case 2: case -2:
  10107. LLDEBUG_ALTERNATIVE("LocalTypeDirectiveESeq", 2);
  10108. *llout = llstate_0;
  10109. {(*llret) = NULL;
  10110. break;
  10111. }
  10112. default:
  10113. llstk[--llcstp] = 1;
  10114. goto failed1;
  10115. failed2:
  10116. LLDEBUG_BACKTRACKING("LocalTypeDirectiveESeq");
  10117. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10118. llcpos = llpos1; llcstp = llstp1;
  10119. continue;
  10120. } break;
  10121. }}
  10122. LLDEBUG_LEAVE("LocalTypeDirectiveESeq", 1);
  10123. return 1;
  10124. failed1: LLDEBUG_LEAVE("LocalTypeDirectiveESeq", 0);
  10125. return 0;
  10126. }
  10127. int ll_LocalTypeDirective(XDirectives *llret, LLSTATE *llin, LLSTATE *llout)
  10128. {
  10129. unsigned llstp = llcstp;
  10130. LLSTATE llstate_0;
  10131. LLDEBUG_ENTER("LocalTypeDirective");
  10132. llstate_0 = *llin;
  10133. #undef failed
  10134. #define failed failed1
  10135. #undef failed
  10136. #define failed failed2
  10137. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10138. LLCHECKSTK;
  10139. for (;;) {
  10140. switch (llstk[llcstp++]) {
  10141. case 1: case -1:
  10142. LLDEBUG_ALTERNATIVE("LocalTypeDirective", 1);
  10143. {LLSTATE llstate_1;
  10144. if (!llterm(T_ZERO_TERMINATED, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10145. *llout = llstate_1;
  10146. {(*llret) = NewDirective(eDirective_ZeroTerminated);
  10147. break;
  10148. }}
  10149. case 2: case -2:
  10150. LLDEBUG_ALTERNATIVE("LocalTypeDirective", 2);
  10151. {LLSTATE llstate_1;
  10152. if (!llterm(T_POINTER, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10153. *llout = llstate_1;
  10154. {(*llret) = NewDirective(eDirective_Pointer);
  10155. break;
  10156. }}
  10157. case 3: case -3:
  10158. LLDEBUG_ALTERNATIVE("LocalTypeDirective", 3);
  10159. {LLSTATE llstate_1;
  10160. if (!llterm(T_NO_POINTER, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10161. *llout = llstate_1;
  10162. {(*llret) = NewDirective(eDirective_NoPointer);
  10163. break;
  10164. }}
  10165. default:
  10166. llstk[--llcstp] = 1;
  10167. goto failed1;
  10168. failed2:
  10169. LLDEBUG_BACKTRACKING("LocalTypeDirective");
  10170. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10171. llcpos = llpos1; llcstp = llstp1;
  10172. continue;
  10173. } break;
  10174. }}
  10175. LLDEBUG_LEAVE("LocalTypeDirective", 1);
  10176. return 1;
  10177. failed1: LLDEBUG_LEAVE("LocalTypeDirective", 0);
  10178. return 0;
  10179. }
  10180. int ll_LocalSizeDirectiveSeq(XDirectives *llret, LLSTATE *llin, LLSTATE *llout)
  10181. {
  10182. unsigned llstp = llcstp;
  10183. LLSTATE llstate_0;
  10184. LLDEBUG_ENTER("LocalSizeDirectiveSeq");
  10185. llstate_0 = *llin;
  10186. #undef failed
  10187. #define failed failed1
  10188. {LLSTATE llstate_1;XDirectives llatt_1;
  10189. if (!ll_LocalSizeDirective(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  10190. {LLSTATE llstate_2;XDirectives llatt_2;
  10191. if (!ll_LocalSizeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  10192. *llout = llstate_2;
  10193. {if (llatt_2) {
  10194. (*llret) = DupDirective(llatt_1);
  10195. (*llret)->Next = llatt_2;
  10196. } else {
  10197. (*llret) = llatt_1;
  10198. }
  10199. }}}
  10200. LLDEBUG_LEAVE("LocalSizeDirectiveSeq", 1);
  10201. return 1;
  10202. failed1: LLDEBUG_LEAVE("LocalSizeDirectiveSeq", 0);
  10203. return 0;
  10204. }
  10205. int ll_LocalSizeDirectiveESeq(XDirectives *llret, LLSTATE *llin, LLSTATE *llout)
  10206. {
  10207. unsigned llstp = llcstp;
  10208. LLSTATE llstate_0;
  10209. LLDEBUG_ENTER("LocalSizeDirectiveESeq");
  10210. llstate_0 = *llin;
  10211. #undef failed
  10212. #define failed failed1
  10213. #undef failed
  10214. #define failed failed2
  10215. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10216. LLCHECKSTK;
  10217. for (;;) {
  10218. switch (llstk[llcstp++]) {
  10219. case 1: case -1:
  10220. LLDEBUG_ALTERNATIVE("LocalSizeDirectiveESeq", 1);
  10221. {LLSTATE llstate_1;XDirectives llatt_1;
  10222. if (!ll_LocalSizeDirective(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  10223. {LLSTATE llstate_2;XDirectives llatt_2;
  10224. if (!ll_LocalSizeDirectiveESeq(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  10225. *llout = llstate_2;
  10226. {if (llatt_2) {
  10227. (*llret) = DupDirective(llatt_1);
  10228. (*llret)->Next = llatt_2;
  10229. } else {
  10230. (*llret) = llatt_1;
  10231. }
  10232. break;
  10233. }}}
  10234. case 2: case -2:
  10235. LLDEBUG_ALTERNATIVE("LocalSizeDirectiveESeq", 2);
  10236. *llout = llstate_0;
  10237. {(*llret) = NULL;
  10238. break;
  10239. }
  10240. default:
  10241. llstk[--llcstp] = 1;
  10242. goto failed1;
  10243. failed2:
  10244. LLDEBUG_BACKTRACKING("LocalSizeDirectiveESeq");
  10245. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10246. llcpos = llpos1; llcstp = llstp1;
  10247. continue;
  10248. } break;
  10249. }}
  10250. LLDEBUG_LEAVE("LocalSizeDirectiveESeq", 1);
  10251. return 1;
  10252. failed1: LLDEBUG_LEAVE("LocalSizeDirectiveESeq", 0);
  10253. return 0;
  10254. }
  10255. int ll_LocalSizeDirective(XDirectives *llret, LLSTATE *llin, LLSTATE *llout)
  10256. {
  10257. unsigned llstp = llcstp;
  10258. LLSTATE llstate_0;
  10259. LLDEBUG_ENTER("LocalSizeDirective");
  10260. llstate_0 = *llin;
  10261. #undef failed
  10262. #define failed failed1
  10263. #undef failed
  10264. #define failed failed2
  10265. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10266. LLCHECKSTK;
  10267. for (;;) {
  10268. switch (llstk[llcstp++]) {
  10269. case 1: case -1:
  10270. LLDEBUG_ALTERNATIVE("LocalSizeDirective", 1);
  10271. {LLSTATE llstate_1;
  10272. if (!llterm(T_FIXED_ARRAY, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10273. *llout = llstate_1;
  10274. {(*llret) = NewDirective(eDirective_FixedArray);
  10275. break;
  10276. }}
  10277. case 2: case -2:
  10278. LLDEBUG_ALTERNATIVE("LocalSizeDirective", 2);
  10279. {LLSTATE llstate_1;
  10280. if (!llterm(T_DOUBLY_LINKED_LIST, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10281. *llout = llstate_1;
  10282. {(*llret) = NewDirective(eDirective_DoublyLinkedList);
  10283. break;
  10284. }}
  10285. case 3: case -3:
  10286. LLDEBUG_ALTERNATIVE("LocalSizeDirective", 3);
  10287. {LLSTATE llstate_1;
  10288. if (!llterm(T_SINGLY_LINKED_LIST, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10289. *llout = llstate_1;
  10290. {(*llret) = NewDirective(eDirective_SinglyLinkedList);
  10291. break;
  10292. }}
  10293. case 4: case -4:
  10294. LLDEBUG_ALTERNATIVE("LocalSizeDirective", 4);
  10295. {LLSTATE llstate_1;
  10296. if (!llterm(T_LENGTH_POINTER, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10297. *llout = llstate_1;
  10298. {(*llret) = NewDirective(eDirective_LengthPointer);
  10299. break;
  10300. }}
  10301. default:
  10302. llstk[--llcstp] = 1;
  10303. goto failed1;
  10304. failed2:
  10305. LLDEBUG_BACKTRACKING("LocalSizeDirective");
  10306. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10307. llcpos = llpos1; llcstp = llstp1;
  10308. continue;
  10309. } break;
  10310. }}
  10311. LLDEBUG_LEAVE("LocalSizeDirective", 1);
  10312. return 1;
  10313. failed1: LLDEBUG_LEAVE("LocalSizeDirective", 0);
  10314. return 0;
  10315. }
  10316. int ll_PrivateDir_Type(XString *llret, LLSTATE *llin, LLSTATE *llout)
  10317. {
  10318. unsigned llstp = llcstp;
  10319. LLSTATE llstate_0;
  10320. LLDEBUG_ENTER("PrivateDir_Type");
  10321. llstate_0 = *llin;
  10322. #undef failed
  10323. #define failed failed1
  10324. #undef failed
  10325. #define failed failed2
  10326. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10327. LLCHECKSTK;
  10328. for (;;) {
  10329. switch (llstk[llcstp++]) {
  10330. case 1: case -1:
  10331. LLDEBUG_ALTERNATIVE("PrivateDir_Type", 1);
  10332. {LLSTATE llstate_1;
  10333. if (!llterm(T_PrivateDir_TypeName, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10334. {LLSTATE llstate_2;XString llatt_2;
  10335. if (!llterm(T_lcsymbol, &lllval, &llstate_1, &llstate_2)) goto failed2;
  10336. llatt_2 = lllval._XString;
  10337. *llout = llstate_2;
  10338. {(*llret) = llatt_2;
  10339. break;
  10340. }}}
  10341. case 2: case -2:
  10342. LLDEBUG_ALTERNATIVE("PrivateDir_Type", 2);
  10343. *llout = llstate_0;
  10344. {(*llret) = NULL;
  10345. break;
  10346. }
  10347. default:
  10348. llstk[--llcstp] = 1;
  10349. goto failed1;
  10350. failed2:
  10351. LLDEBUG_BACKTRACKING("PrivateDir_Type");
  10352. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10353. llcpos = llpos1; llcstp = llstp1;
  10354. continue;
  10355. } break;
  10356. }}
  10357. LLDEBUG_LEAVE("PrivateDir_Type", 1);
  10358. return 1;
  10359. failed1: LLDEBUG_LEAVE("PrivateDir_Type", 0);
  10360. return 0;
  10361. }
  10362. int ll_PrivateDir_Field(XString *llret, LLSTATE *llin, LLSTATE *llout)
  10363. {
  10364. unsigned llstp = llcstp;
  10365. LLSTATE llstate_0;
  10366. LLDEBUG_ENTER("PrivateDir_Field");
  10367. llstate_0 = *llin;
  10368. #undef failed
  10369. #define failed failed1
  10370. #undef failed
  10371. #define failed failed2
  10372. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10373. LLCHECKSTK;
  10374. for (;;) {
  10375. switch (llstk[llcstp++]) {
  10376. case 1: case -1:
  10377. LLDEBUG_ALTERNATIVE("PrivateDir_Field", 1);
  10378. {LLSTATE llstate_1;
  10379. if (!llterm(T_PrivateDir_FieldName, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10380. {LLSTATE llstate_2;XString llatt_2;
  10381. if (!llterm(T_lcsymbol, &lllval, &llstate_1, &llstate_2)) goto failed2;
  10382. llatt_2 = lllval._XString;
  10383. *llout = llstate_2;
  10384. {(*llret) = llatt_2;
  10385. break;
  10386. }}}
  10387. case 2: case -2:
  10388. LLDEBUG_ALTERNATIVE("PrivateDir_Field", 2);
  10389. *llout = llstate_0;
  10390. {(*llret) = NULL;
  10391. break;
  10392. }
  10393. default:
  10394. llstk[--llcstp] = 1;
  10395. goto failed1;
  10396. failed2:
  10397. LLDEBUG_BACKTRACKING("PrivateDir_Field");
  10398. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10399. llcpos = llpos1; llcstp = llstp1;
  10400. continue;
  10401. } break;
  10402. }}
  10403. LLDEBUG_LEAVE("PrivateDir_Field", 1);
  10404. return 1;
  10405. failed1: LLDEBUG_LEAVE("PrivateDir_Field", 0);
  10406. return 0;
  10407. }
  10408. int ll_PrivateDir_Value(XString *llret, LLSTATE *llin, LLSTATE *llout)
  10409. {
  10410. unsigned llstp = llcstp;
  10411. LLSTATE llstate_0;
  10412. LLDEBUG_ENTER("PrivateDir_Value");
  10413. llstate_0 = *llin;
  10414. #undef failed
  10415. #define failed failed1
  10416. #undef failed
  10417. #define failed failed2
  10418. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10419. LLCHECKSTK;
  10420. for (;;) {
  10421. switch (llstk[llcstp++]) {
  10422. case 1: case -1:
  10423. LLDEBUG_ALTERNATIVE("PrivateDir_Value", 1);
  10424. {LLSTATE llstate_1;
  10425. if (!llterm(T_PrivateDir_ValueName, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10426. {LLSTATE llstate_2;XString llatt_2;
  10427. if (!llterm(T_lcsymbol, &lllval, &llstate_1, &llstate_2)) goto failed2;
  10428. llatt_2 = lllval._XString;
  10429. *llout = llstate_2;
  10430. {(*llret) = llatt_2;
  10431. break;
  10432. }}}
  10433. case 2: case -2:
  10434. LLDEBUG_ALTERNATIVE("PrivateDir_Value", 2);
  10435. *llout = llstate_0;
  10436. {(*llret) = NULL;
  10437. break;
  10438. }
  10439. default:
  10440. llstk[--llcstp] = 1;
  10441. goto failed1;
  10442. failed2:
  10443. LLDEBUG_BACKTRACKING("PrivateDir_Value");
  10444. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10445. llcpos = llpos1; llcstp = llstp1;
  10446. continue;
  10447. } break;
  10448. }}
  10449. LLDEBUG_LEAVE("PrivateDir_Value", 1);
  10450. return 1;
  10451. failed1: LLDEBUG_LEAVE("PrivateDir_Value", 0);
  10452. return 0;
  10453. }
  10454. int ll_PrivateDir_Public(int *llret, LLSTATE *llin, LLSTATE *llout)
  10455. {
  10456. unsigned llstp = llcstp;
  10457. LLSTATE llstate_0;
  10458. LLDEBUG_ENTER("PrivateDir_Public");
  10459. llstate_0 = *llin;
  10460. #undef failed
  10461. #define failed failed1
  10462. #undef failed
  10463. #define failed failed2
  10464. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10465. LLCHECKSTK;
  10466. for (;;) {
  10467. switch (llstk[llcstp++]) {
  10468. case 1: case -1:
  10469. LLDEBUG_ALTERNATIVE("PrivateDir_Public", 1);
  10470. {LLSTATE llstate_1;
  10471. if (!llterm(T_PrivateDir_Public, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10472. *llout = llstate_1;
  10473. {(*llret) = 1;
  10474. break;
  10475. }}
  10476. case 2: case -2:
  10477. LLDEBUG_ALTERNATIVE("PrivateDir_Public", 2);
  10478. *llout = llstate_0;
  10479. {(*llret) = 0;
  10480. break;
  10481. }
  10482. default:
  10483. llstk[--llcstp] = 1;
  10484. goto failed1;
  10485. failed2:
  10486. LLDEBUG_BACKTRACKING("PrivateDir_Public");
  10487. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10488. llcpos = llpos1; llcstp = llstp1;
  10489. continue;
  10490. } break;
  10491. }}
  10492. LLDEBUG_LEAVE("PrivateDir_Public", 1);
  10493. return 1;
  10494. failed1: LLDEBUG_LEAVE("PrivateDir_Public", 0);
  10495. return 0;
  10496. }
  10497. int ll_PrivateDir_Intx(int *llret, LLSTATE *llin, LLSTATE *llout)
  10498. {
  10499. unsigned llstp = llcstp;
  10500. LLSTATE llstate_0;
  10501. LLDEBUG_ENTER("PrivateDir_Intx");
  10502. llstate_0 = *llin;
  10503. #undef failed
  10504. #define failed failed1
  10505. #undef failed
  10506. #define failed failed2
  10507. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10508. LLCHECKSTK;
  10509. for (;;) {
  10510. switch (llstk[llcstp++]) {
  10511. case 1: case -1:
  10512. LLDEBUG_ALTERNATIVE("PrivateDir_Intx", 1);
  10513. {LLSTATE llstate_1;
  10514. if (!llterm(T_PrivateDir_Intx, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10515. *llout = llstate_1;
  10516. {(*llret) = 1;
  10517. break;
  10518. }}
  10519. case 2: case -2:
  10520. LLDEBUG_ALTERNATIVE("PrivateDir_Intx", 2);
  10521. *llout = llstate_0;
  10522. {(*llret) = 0;
  10523. break;
  10524. }
  10525. default:
  10526. llstk[--llcstp] = 1;
  10527. goto failed1;
  10528. failed2:
  10529. LLDEBUG_BACKTRACKING("PrivateDir_Intx");
  10530. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10531. llcpos = llpos1; llcstp = llstp1;
  10532. continue;
  10533. } break;
  10534. }}
  10535. LLDEBUG_LEAVE("PrivateDir_Intx", 1);
  10536. return 1;
  10537. failed1: LLDEBUG_LEAVE("PrivateDir_Intx", 0);
  10538. return 0;
  10539. }
  10540. int ll_PrivateDir_LenPtr(int *llret, LLSTATE *llin, LLSTATE *llout)
  10541. {
  10542. unsigned llstp = llcstp;
  10543. LLSTATE llstate_0;
  10544. LLDEBUG_ENTER("PrivateDir_LenPtr");
  10545. llstate_0 = *llin;
  10546. #undef failed
  10547. #define failed failed1
  10548. #undef failed
  10549. #define failed failed2
  10550. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10551. LLCHECKSTK;
  10552. for (;;) {
  10553. switch (llstk[llcstp++]) {
  10554. case 1: case -1:
  10555. LLDEBUG_ALTERNATIVE("PrivateDir_LenPtr", 1);
  10556. {LLSTATE llstate_1;
  10557. if (!llterm(T_PrivateDir_LenPtr, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10558. *llout = llstate_1;
  10559. {(*llret) = 1;
  10560. break;
  10561. }}
  10562. case 2: case -2:
  10563. LLDEBUG_ALTERNATIVE("PrivateDir_LenPtr", 2);
  10564. *llout = llstate_0;
  10565. {(*llret) = 0;
  10566. break;
  10567. }
  10568. default:
  10569. llstk[--llcstp] = 1;
  10570. goto failed1;
  10571. failed2:
  10572. LLDEBUG_BACKTRACKING("PrivateDir_LenPtr");
  10573. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10574. llcpos = llpos1; llcstp = llstp1;
  10575. continue;
  10576. } break;
  10577. }}
  10578. LLDEBUG_LEAVE("PrivateDir_LenPtr", 1);
  10579. return 1;
  10580. failed1: LLDEBUG_LEAVE("PrivateDir_LenPtr", 0);
  10581. return 0;
  10582. }
  10583. int ll_PrivateDir_Pointer(int *llret, LLSTATE *llin, LLSTATE *llout)
  10584. {
  10585. unsigned llstp = llcstp;
  10586. LLSTATE llstate_0;
  10587. LLDEBUG_ENTER("PrivateDir_Pointer");
  10588. llstate_0 = *llin;
  10589. #undef failed
  10590. #define failed failed1
  10591. #undef failed
  10592. #define failed failed2
  10593. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10594. LLCHECKSTK;
  10595. for (;;) {
  10596. switch (llstk[llcstp++]) {
  10597. case 1: case -1:
  10598. LLDEBUG_ALTERNATIVE("PrivateDir_Pointer", 1);
  10599. {LLSTATE llstate_1;
  10600. if (!llterm(T_PrivateDir_Pointer, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10601. *llout = llstate_1;
  10602. {(*llret) = 1;
  10603. break;
  10604. }}
  10605. case 2: case -2:
  10606. LLDEBUG_ALTERNATIVE("PrivateDir_Pointer", 2);
  10607. *llout = llstate_0;
  10608. {(*llret) = 0;
  10609. break;
  10610. }
  10611. default:
  10612. llstk[--llcstp] = 1;
  10613. goto failed1;
  10614. failed2:
  10615. LLDEBUG_BACKTRACKING("PrivateDir_Pointer");
  10616. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10617. llcpos = llpos1; llcstp = llstp1;
  10618. continue;
  10619. } break;
  10620. }}
  10621. LLDEBUG_LEAVE("PrivateDir_Pointer", 1);
  10622. return 1;
  10623. failed1: LLDEBUG_LEAVE("PrivateDir_Pointer", 0);
  10624. return 0;
  10625. }
  10626. int ll_PrivateDir_Array(int *llret, LLSTATE *llin, LLSTATE *llout)
  10627. {
  10628. unsigned llstp = llcstp;
  10629. LLSTATE llstate_0;
  10630. LLDEBUG_ENTER("PrivateDir_Array");
  10631. llstate_0 = *llin;
  10632. #undef failed
  10633. #define failed failed1
  10634. #undef failed
  10635. #define failed failed2
  10636. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10637. LLCHECKSTK;
  10638. for (;;) {
  10639. switch (llstk[llcstp++]) {
  10640. case 1: case -1:
  10641. LLDEBUG_ALTERNATIVE("PrivateDir_Array", 1);
  10642. {LLSTATE llstate_1;
  10643. if (!llterm(T_PrivateDir_Array, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10644. *llout = llstate_1;
  10645. {(*llret) = 1;
  10646. break;
  10647. }}
  10648. case 2: case -2:
  10649. LLDEBUG_ALTERNATIVE("PrivateDir_Array", 2);
  10650. *llout = llstate_0;
  10651. {(*llret) = 0;
  10652. break;
  10653. }
  10654. default:
  10655. llstk[--llcstp] = 1;
  10656. goto failed1;
  10657. failed2:
  10658. LLDEBUG_BACKTRACKING("PrivateDir_Array");
  10659. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10660. llcpos = llpos1; llcstp = llstp1;
  10661. continue;
  10662. } break;
  10663. }}
  10664. LLDEBUG_LEAVE("PrivateDir_Array", 1);
  10665. return 1;
  10666. failed1: LLDEBUG_LEAVE("PrivateDir_Array", 0);
  10667. return 0;
  10668. }
  10669. int ll_PrivateDir_NoCode(int *llret, LLSTATE *llin, LLSTATE *llout)
  10670. {
  10671. unsigned llstp = llcstp;
  10672. LLSTATE llstate_0;
  10673. LLDEBUG_ENTER("PrivateDir_NoCode");
  10674. llstate_0 = *llin;
  10675. #undef failed
  10676. #define failed failed1
  10677. #undef failed
  10678. #define failed failed2
  10679. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10680. LLCHECKSTK;
  10681. for (;;) {
  10682. switch (llstk[llcstp++]) {
  10683. case 1: case -1:
  10684. LLDEBUG_ALTERNATIVE("PrivateDir_NoCode", 1);
  10685. {LLSTATE llstate_1;
  10686. if (!llterm(T_PrivateDir_NoCode, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10687. *llout = llstate_1;
  10688. {(*llret) = 1;
  10689. break;
  10690. }}
  10691. case 2: case -2:
  10692. LLDEBUG_ALTERNATIVE("PrivateDir_NoCode", 2);
  10693. *llout = llstate_0;
  10694. {(*llret) = 0;
  10695. break;
  10696. }
  10697. default:
  10698. llstk[--llcstp] = 1;
  10699. goto failed1;
  10700. failed2:
  10701. LLDEBUG_BACKTRACKING("PrivateDir_NoCode");
  10702. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10703. llcpos = llpos1; llcstp = llstp1;
  10704. continue;
  10705. } break;
  10706. }}
  10707. LLDEBUG_LEAVE("PrivateDir_NoCode", 1);
  10708. return 1;
  10709. failed1: LLDEBUG_LEAVE("PrivateDir_NoCode", 0);
  10710. return 0;
  10711. }
  10712. int ll_PrivateDir_NoMemCopy(int *llret, LLSTATE *llin, LLSTATE *llout)
  10713. {
  10714. unsigned llstp = llcstp;
  10715. LLSTATE llstate_0;
  10716. LLDEBUG_ENTER("PrivateDir_NoMemCopy");
  10717. llstate_0 = *llin;
  10718. #undef failed
  10719. #define failed failed1
  10720. #undef failed
  10721. #define failed failed2
  10722. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10723. LLCHECKSTK;
  10724. for (;;) {
  10725. switch (llstk[llcstp++]) {
  10726. case 1: case -1:
  10727. LLDEBUG_ALTERNATIVE("PrivateDir_NoMemCopy", 1);
  10728. {LLSTATE llstate_1;
  10729. if (!llterm(T_PrivateDir_NoMemCopy, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10730. *llout = llstate_1;
  10731. {(*llret) = 1;
  10732. break;
  10733. }}
  10734. case 2: case -2:
  10735. LLDEBUG_ALTERNATIVE("PrivateDir_NoMemCopy", 2);
  10736. *llout = llstate_0;
  10737. {(*llret) = 0;
  10738. break;
  10739. }
  10740. default:
  10741. llstk[--llcstp] = 1;
  10742. goto failed1;
  10743. failed2:
  10744. LLDEBUG_BACKTRACKING("PrivateDir_NoMemCopy");
  10745. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10746. llcpos = llpos1; llcstp = llstp1;
  10747. continue;
  10748. } break;
  10749. }}
  10750. LLDEBUG_LEAVE("PrivateDir_NoMemCopy", 1);
  10751. return 1;
  10752. failed1: LLDEBUG_LEAVE("PrivateDir_NoMemCopy", 0);
  10753. return 0;
  10754. }
  10755. int ll_PrivateDir_OidPacked(int *llret, LLSTATE *llin, LLSTATE *llout)
  10756. {
  10757. unsigned llstp = llcstp;
  10758. LLSTATE llstate_0;
  10759. LLDEBUG_ENTER("PrivateDir_OidPacked");
  10760. llstate_0 = *llin;
  10761. #undef failed
  10762. #define failed failed1
  10763. #undef failed
  10764. #define failed failed2
  10765. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10766. LLCHECKSTK;
  10767. for (;;) {
  10768. switch (llstk[llcstp++]) {
  10769. case 1: case -1:
  10770. LLDEBUG_ALTERNATIVE("PrivateDir_OidPacked", 1);
  10771. {LLSTATE llstate_1;
  10772. if (!llterm(T_PrivateDir_OidPacked, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10773. *llout = llstate_1;
  10774. {(*llret) = 1;
  10775. break;
  10776. }}
  10777. case 2: case -2:
  10778. LLDEBUG_ALTERNATIVE("PrivateDir_OidPacked", 2);
  10779. *llout = llstate_0;
  10780. {(*llret) = 0;
  10781. break;
  10782. }
  10783. default:
  10784. llstk[--llcstp] = 1;
  10785. goto failed1;
  10786. failed2:
  10787. LLDEBUG_BACKTRACKING("PrivateDir_OidPacked");
  10788. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10789. llcpos = llpos1; llcstp = llstp1;
  10790. continue;
  10791. } break;
  10792. }}
  10793. LLDEBUG_LEAVE("PrivateDir_OidPacked", 1);
  10794. return 1;
  10795. failed1: LLDEBUG_LEAVE("PrivateDir_OidPacked", 0);
  10796. return 0;
  10797. }
  10798. int ll_PrivateDir_OidArray(int *llret, LLSTATE *llin, LLSTATE *llout)
  10799. {
  10800. unsigned llstp = llcstp;
  10801. LLSTATE llstate_0;
  10802. LLDEBUG_ENTER("PrivateDir_OidArray");
  10803. llstate_0 = *llin;
  10804. #undef failed
  10805. #define failed failed1
  10806. #undef failed
  10807. #define failed failed2
  10808. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10809. LLCHECKSTK;
  10810. for (;;) {
  10811. switch (llstk[llcstp++]) {
  10812. case 1: case -1:
  10813. LLDEBUG_ALTERNATIVE("PrivateDir_OidArray", 1);
  10814. {LLSTATE llstate_1;
  10815. if (!llterm(T_PrivateDir_OidArray, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10816. *llout = llstate_1;
  10817. {(*llret) = 1;
  10818. break;
  10819. }}
  10820. case 2: case -2:
  10821. LLDEBUG_ALTERNATIVE("PrivateDir_OidArray", 2);
  10822. *llout = llstate_0;
  10823. {(*llret) = 0;
  10824. break;
  10825. }
  10826. default:
  10827. llstk[--llcstp] = 1;
  10828. goto failed1;
  10829. failed2:
  10830. LLDEBUG_BACKTRACKING("PrivateDir_OidArray");
  10831. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10832. llcpos = llpos1; llcstp = llstp1;
  10833. continue;
  10834. } break;
  10835. }}
  10836. LLDEBUG_LEAVE("PrivateDir_OidArray", 1);
  10837. return 1;
  10838. failed1: LLDEBUG_LEAVE("PrivateDir_OidArray", 0);
  10839. return 0;
  10840. }
  10841. int ll_PrivateDir_SLinked(int *llret, LLSTATE *llin, LLSTATE *llout)
  10842. {
  10843. unsigned llstp = llcstp;
  10844. LLSTATE llstate_0;
  10845. LLDEBUG_ENTER("PrivateDir_SLinked");
  10846. llstate_0 = *llin;
  10847. #undef failed
  10848. #define failed failed1
  10849. #undef failed
  10850. #define failed failed2
  10851. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10852. LLCHECKSTK;
  10853. for (;;) {
  10854. switch (llstk[llcstp++]) {
  10855. case 1: case -1:
  10856. LLDEBUG_ALTERNATIVE("PrivateDir_SLinked", 1);
  10857. {LLSTATE llstate_1;
  10858. if (!llterm(T_PrivateDir_SLinked, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10859. *llout = llstate_1;
  10860. {(*llret) = 1;
  10861. break;
  10862. }}
  10863. case 2: case -2:
  10864. LLDEBUG_ALTERNATIVE("PrivateDir_SLinked", 2);
  10865. *llout = llstate_0;
  10866. {(*llret) = 0;
  10867. break;
  10868. }
  10869. default:
  10870. llstk[--llcstp] = 1;
  10871. goto failed1;
  10872. failed2:
  10873. LLDEBUG_BACKTRACKING("PrivateDir_SLinked");
  10874. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10875. llcpos = llpos1; llcstp = llstp1;
  10876. continue;
  10877. } break;
  10878. }}
  10879. LLDEBUG_LEAVE("PrivateDir_SLinked", 1);
  10880. return 1;
  10881. failed1: LLDEBUG_LEAVE("PrivateDir_SLinked", 0);
  10882. return 0;
  10883. }
  10884. int ll_PrivateDir_DLinked(int *llret, LLSTATE *llin, LLSTATE *llout)
  10885. {
  10886. unsigned llstp = llcstp;
  10887. LLSTATE llstate_0;
  10888. LLDEBUG_ENTER("PrivateDir_DLinked");
  10889. llstate_0 = *llin;
  10890. #undef failed
  10891. #define failed failed1
  10892. #undef failed
  10893. #define failed failed2
  10894. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10895. LLCHECKSTK;
  10896. for (;;) {
  10897. switch (llstk[llcstp++]) {
  10898. case 1: case -1:
  10899. LLDEBUG_ALTERNATIVE("PrivateDir_DLinked", 1);
  10900. {LLSTATE llstate_1;
  10901. if (!llterm(T_PrivateDir_DLinked, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  10902. *llout = llstate_1;
  10903. {(*llret) = 1;
  10904. break;
  10905. }}
  10906. case 2: case -2:
  10907. LLDEBUG_ALTERNATIVE("PrivateDir_DLinked", 2);
  10908. *llout = llstate_0;
  10909. {(*llret) = 0;
  10910. break;
  10911. }
  10912. default:
  10913. llstk[--llcstp] = 1;
  10914. goto failed1;
  10915. failed2:
  10916. LLDEBUG_BACKTRACKING("PrivateDir_DLinked");
  10917. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  10918. llcpos = llpos1; llcstp = llstp1;
  10919. continue;
  10920. } break;
  10921. }}
  10922. LLDEBUG_LEAVE("PrivateDir_DLinked", 1);
  10923. return 1;
  10924. failed1: LLDEBUG_LEAVE("PrivateDir_DLinked", 0);
  10925. return 0;
  10926. }
  10927. int ll_PrivateDirectives(XPrivateDirectives *llret, LLSTATE *llin, LLSTATE *llout)
  10928. {
  10929. unsigned llstp = llcstp;
  10930. LLSTATE llstate_0;
  10931. LLDEBUG_ENTER("PrivateDirectives");
  10932. llstate_0 = *llin;
  10933. #undef failed
  10934. #define failed failed1
  10935. #undef failed
  10936. #define failed failed2
  10937. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  10938. LLCHECKSTK;
  10939. for (;;) {
  10940. switch (llstk[llcstp++]) {
  10941. case 1: case -1:
  10942. LLDEBUG_ALTERNATIVE("PrivateDirectives", 1);
  10943. {LLSTATE llstate_1;int llatt_1;
  10944. if (!ll_PrivateDir_Intx(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  10945. {LLSTATE llstate_2;int llatt_2;
  10946. if (!ll_PrivateDir_LenPtr(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  10947. {LLSTATE llstate_3;int llatt_3;
  10948. if (!ll_PrivateDir_Pointer(&llatt_3, &llstate_2, &llstate_3)) goto failed2;
  10949. {LLSTATE llstate_4;int llatt_4;
  10950. if (!ll_PrivateDir_Array(&llatt_4, &llstate_3, &llstate_4)) goto failed2;
  10951. {LLSTATE llstate_5;int llatt_5;
  10952. if (!ll_PrivateDir_NoCode(&llatt_5, &llstate_4, &llstate_5)) goto failed2;
  10953. {LLSTATE llstate_6;int llatt_6;
  10954. if (!ll_PrivateDir_NoMemCopy(&llatt_6, &llstate_5, &llstate_6)) goto failed2;
  10955. {LLSTATE llstate_7;int llatt_7;
  10956. if (!ll_PrivateDir_Public(&llatt_7, &llstate_6, &llstate_7)) goto failed2;
  10957. {LLSTATE llstate_8;int llatt_8;
  10958. if (!ll_PrivateDir_OidPacked(&llatt_8, &llstate_7, &llstate_8)) goto failed2;
  10959. {LLSTATE llstate_9;int llatt_9;
  10960. if (!ll_PrivateDir_OidArray(&llatt_9, &llstate_8, &llstate_9)) goto failed2;
  10961. {LLSTATE llstate_10;XString llatt_10;
  10962. if (!ll_PrivateDir_Type(&llatt_10, &llstate_9, &llstate_10)) goto failed2;
  10963. {LLSTATE llstate_11;XString llatt_11;
  10964. if (!ll_PrivateDir_Field(&llatt_11, &llstate_10, &llstate_11)) goto failed2;
  10965. {LLSTATE llstate_12;XString llatt_12;
  10966. if (!ll_PrivateDir_Value(&llatt_12, &llstate_11, &llstate_12)) goto failed2;
  10967. {LLSTATE llstate_13;int llatt_13;
  10968. if (!ll_PrivateDir_SLinked(&llatt_13, &llstate_12, &llstate_13)) goto failed2;
  10969. {LLSTATE llstate_14;int llatt_14;
  10970. if (!ll_PrivateDir_DLinked(&llatt_14, &llstate_13, &llstate_14)) goto failed2;
  10971. *llout = llstate_14;
  10972. {(*llret) = (PrivateDirectives_t *) malloc(sizeof(PrivateDirectives_t));
  10973. if ((*llret))
  10974. {
  10975. memset((*llret), 0, sizeof(PrivateDirectives_t));
  10976. (*llret)->fIntx = llatt_1;
  10977. (*llret)->fLenPtr = llatt_2;
  10978. (*llret)->fPointer = llatt_3;
  10979. (*llret)->fArray = llatt_4;
  10980. (*llret)->fNoCode = llatt_5;
  10981. (*llret)->fNoMemCopy = llatt_6;
  10982. (*llret)->fPublic = llatt_7;
  10983. (*llret)->fOidPacked = llatt_8;
  10984. (*llret)->fOidArray = llatt_9 | g_fOidArray;
  10985. (*llret)->pszTypeName = llatt_10;
  10986. (*llret)->pszFieldName = llatt_11;
  10987. (*llret)->pszValueName = llatt_12;
  10988. (*llret)->fSLinked = llatt_13;
  10989. (*llret)->fDLinked = llatt_14;
  10990. }
  10991. break;
  10992. }}}}}}}}}}}}}}}
  10993. case 2: case -2:
  10994. LLDEBUG_ALTERNATIVE("PrivateDirectives", 2);
  10995. *llout = llstate_0;
  10996. {(*llret) = NULL;
  10997. break;
  10998. }
  10999. default:
  11000. llstk[--llcstp] = 1;
  11001. goto failed1;
  11002. failed2:
  11003. LLDEBUG_BACKTRACKING("PrivateDirectives");
  11004. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11005. llcpos = llpos1; llcstp = llstp1;
  11006. continue;
  11007. } break;
  11008. }}
  11009. LLDEBUG_LEAVE("PrivateDirectives", 1);
  11010. return 1;
  11011. failed1: LLDEBUG_LEAVE("PrivateDirectives", 0);
  11012. return 0;
  11013. }
  11014. int ll_DefinedObjectClass(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout)
  11015. {
  11016. unsigned llstp = llcstp;
  11017. LLSTATE llstate_0;
  11018. LLDEBUG_ENTER("DefinedObjectClass");
  11019. llstate_0 = *llin;
  11020. #undef failed
  11021. #define failed failed1
  11022. #undef failed
  11023. #define failed failed2
  11024. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11025. LLCHECKSTK;
  11026. for (;;) {
  11027. switch (llstk[llcstp++]) {
  11028. case 1: case -1:
  11029. LLDEBUG_ALTERNATIVE("DefinedObjectClass", 1);
  11030. {LLSTATE llstate_1;XObjectClass llatt_1;
  11031. if (!ll_ExternalObjectClassReference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  11032. *llout = llstate_1;
  11033. {(*llret) = llatt_1;
  11034. break;
  11035. }}
  11036. case 2: case -2:
  11037. LLDEBUG_ALTERNATIVE("DefinedObjectClass", 2);
  11038. {LLSTATE llstate_1;XObjectClass llatt_1;
  11039. if (!ll_objectclassreference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  11040. *llout = llstate_1;
  11041. {(*llret) = llatt_1;
  11042. break;
  11043. }}
  11044. case 3: case -3:
  11045. LLDEBUG_ALTERNATIVE("DefinedObjectClass", 3);
  11046. {LLSTATE llstate_1;XObjectClass llatt_1;
  11047. if (!ll_Usefulobjectclassreference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  11048. *llout = llstate_1;
  11049. {(*llret) = llatt_1;
  11050. break;
  11051. }}
  11052. default:
  11053. llstk[--llcstp] = 1;
  11054. goto failed1;
  11055. failed2:
  11056. LLDEBUG_BACKTRACKING("DefinedObjectClass");
  11057. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11058. llcpos = llpos1; llcstp = llstp1;
  11059. continue;
  11060. } break;
  11061. }}
  11062. LLDEBUG_LEAVE("DefinedObjectClass", 1);
  11063. return 1;
  11064. failed1: LLDEBUG_LEAVE("DefinedObjectClass", 0);
  11065. return 0;
  11066. }
  11067. int ll_DefinedObject(XObject *llret, LLSTATE *llin, LLSTATE *llout)
  11068. {
  11069. unsigned llstp = llcstp;
  11070. LLSTATE llstate_0;
  11071. LLDEBUG_ENTER("DefinedObject");
  11072. llstate_0 = *llin;
  11073. #undef failed
  11074. #define failed failed1
  11075. #undef failed
  11076. #define failed failed2
  11077. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11078. LLCHECKSTK;
  11079. for (;;) {
  11080. switch (llstk[llcstp++]) {
  11081. case 1: case -1:
  11082. LLDEBUG_ALTERNATIVE("DefinedObject", 1);
  11083. {LLSTATE llstate_1;XObject llatt_1;
  11084. if (!ll_ExternalObjectReference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  11085. *llout = llstate_1;
  11086. {(*llret) = llatt_1;
  11087. break;
  11088. }}
  11089. case 2: case -2:
  11090. LLDEBUG_ALTERNATIVE("DefinedObject", 2);
  11091. {LLSTATE llstate_1;XObject llatt_1;
  11092. if (!ll_objectreference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  11093. *llout = llstate_1;
  11094. {(*llret) = llatt_1;
  11095. break;
  11096. }}
  11097. default:
  11098. llstk[--llcstp] = 1;
  11099. goto failed1;
  11100. failed2:
  11101. LLDEBUG_BACKTRACKING("DefinedObject");
  11102. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11103. llcpos = llpos1; llcstp = llstp1;
  11104. continue;
  11105. } break;
  11106. }}
  11107. LLDEBUG_LEAVE("DefinedObject", 1);
  11108. return 1;
  11109. failed1: LLDEBUG_LEAVE("DefinedObject", 0);
  11110. return 0;
  11111. }
  11112. int ll_DefinedObjectSet(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout)
  11113. {
  11114. unsigned llstp = llcstp;
  11115. LLSTATE llstate_0;
  11116. LLDEBUG_ENTER("DefinedObjectSet");
  11117. llstate_0 = *llin;
  11118. #undef failed
  11119. #define failed failed1
  11120. #undef failed
  11121. #define failed failed2
  11122. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11123. LLCHECKSTK;
  11124. for (;;) {
  11125. switch (llstk[llcstp++]) {
  11126. case 1: case -1:
  11127. LLDEBUG_ALTERNATIVE("DefinedObjectSet", 1);
  11128. {LLSTATE llstate_1;XObjectSet llatt_1;
  11129. if (!ll_ExternalObjectSetReference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  11130. *llout = llstate_1;
  11131. {(*llret) = llatt_1;
  11132. break;
  11133. }}
  11134. case 2: case -2:
  11135. LLDEBUG_ALTERNATIVE("DefinedObjectSet", 2);
  11136. {LLSTATE llstate_1;XObjectSet llatt_1;
  11137. if (!ll_objectsetreference(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  11138. *llout = llstate_1;
  11139. {(*llret) = llatt_1;
  11140. break;
  11141. }}
  11142. default:
  11143. llstk[--llcstp] = 1;
  11144. goto failed1;
  11145. failed2:
  11146. LLDEBUG_BACKTRACKING("DefinedObjectSet");
  11147. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11148. llcpos = llpos1; llcstp = llstp1;
  11149. continue;
  11150. } break;
  11151. }}
  11152. LLDEBUG_LEAVE("DefinedObjectSet", 1);
  11153. return 1;
  11154. failed1: LLDEBUG_LEAVE("DefinedObjectSet", 0);
  11155. return 0;
  11156. }
  11157. int ll_Usefulobjectclassreference(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout)
  11158. {
  11159. unsigned llstp = llcstp;
  11160. LLSTATE llstate_0;
  11161. LLDEBUG_ENTER("Usefulobjectclassreference");
  11162. llstate_0 = *llin;
  11163. #undef failed
  11164. #define failed failed1
  11165. #undef failed
  11166. #define failed failed2
  11167. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11168. LLCHECKSTK;
  11169. for (;;) {
  11170. switch (llstk[llcstp++]) {
  11171. case 1: case -1:
  11172. LLDEBUG_ALTERNATIVE("Usefulobjectclassreference", 1);
  11173. {LLSTATE llstate_1;
  11174. if (!llterm(T_TYPE_IDENTIFIER, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11175. *llout = llstate_1;
  11176. {(*llret) = Builtin_ObjectClass_TypeIdentifier;
  11177. break;
  11178. }}
  11179. case 2: case -2:
  11180. LLDEBUG_ALTERNATIVE("Usefulobjectclassreference", 2);
  11181. {LLSTATE llstate_1;
  11182. if (!llterm(T_ABSTRACT_SYNTAX, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11183. *llout = llstate_1;
  11184. {(*llret) = Builtin_ObjectClass_AbstractSyntax;
  11185. break;
  11186. }}
  11187. default:
  11188. llstk[--llcstp] = 1;
  11189. goto failed1;
  11190. failed2:
  11191. LLDEBUG_BACKTRACKING("Usefulobjectclassreference");
  11192. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11193. llcpos = llpos1; llcstp = llstp1;
  11194. continue;
  11195. } break;
  11196. }}
  11197. LLDEBUG_LEAVE("Usefulobjectclassreference", 1);
  11198. return 1;
  11199. failed1: LLDEBUG_LEAVE("Usefulobjectclassreference", 0);
  11200. return 0;
  11201. }
  11202. int ll_ObjectClassAssignment(LLSTATE *llin, LLSTATE *llout)
  11203. {
  11204. unsigned llstp = llcstp;
  11205. LLSTATE llstate_0;
  11206. LLDEBUG_ENTER("ObjectClassAssignment");
  11207. llstate_0 = *llin;
  11208. #undef failed
  11209. #define failed failed1
  11210. {LLSTATE llstate_1;XObjectClass llatt_1;
  11211. if (!ll_objectclassreference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  11212. {LLSTATE llstate_2;
  11213. if (!llterm(T_DEF, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  11214. {LLSTATE llstate_3;XObjectClass llatt_3;
  11215. if (!ll_ObjectClass(&llatt_3, &llstate_2, &llstate_3, llatt_1)) goto failed1;
  11216. *llout = llstate_3;
  11217. {if (!AssignObjectClass(&(*llout).Assignments, llatt_1, llatt_3))
  11218. LLFAILED((&llstate_1.pos, "Type `%s' twice defined",
  11219. llatt_1->U.Reference.Identifier));
  11220. }}}}
  11221. LLDEBUG_LEAVE("ObjectClassAssignment", 1);
  11222. return 1;
  11223. failed1: LLDEBUG_LEAVE("ObjectClassAssignment", 0);
  11224. return 0;
  11225. }
  11226. int ll_ObjectClass(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11227. {
  11228. unsigned llstp = llcstp;
  11229. LLSTATE llstate_0;
  11230. LLDEBUG_ENTER("ObjectClass");
  11231. llstate_0 = *llin;
  11232. #undef failed
  11233. #define failed failed1
  11234. #undef failed
  11235. #define failed failed2
  11236. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11237. LLCHECKSTK;
  11238. for (;;) {
  11239. switch (llstk[llcstp++]) {
  11240. case 1: case -1:
  11241. LLDEBUG_ALTERNATIVE("ObjectClass", 1);
  11242. {LLSTATE llstate_1;XObjectClass llatt_1;
  11243. if (!ll_DefinedObjectClass(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  11244. *llout = llstate_1;
  11245. {(*llret) = llatt_1;
  11246. break;
  11247. }}
  11248. case 2: case -2:
  11249. LLDEBUG_ALTERNATIVE("ObjectClass", 2);
  11250. {LLSTATE llstate_1;XObjectClass llatt_1;
  11251. if (!ll_ObjectClassDefn(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  11252. *llout = llstate_1;
  11253. {(*llret) = llatt_1;
  11254. break;
  11255. }}
  11256. case 3: case -3:
  11257. LLDEBUG_ALTERNATIVE("ObjectClass", 3);
  11258. {LLSTATE llstate_1;
  11259. if (!ll_ParameterizedObjectClass(&llstate_0, &llstate_1)) goto failed2;
  11260. *llout = llstate_1;
  11261. {MyAbort();
  11262. break;
  11263. }}
  11264. default:
  11265. llstk[--llcstp] = 1;
  11266. goto failed1;
  11267. failed2:
  11268. LLDEBUG_BACKTRACKING("ObjectClass");
  11269. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11270. llcpos = llpos1; llcstp = llstp1;
  11271. continue;
  11272. } break;
  11273. }}
  11274. LLDEBUG_LEAVE("ObjectClass", 1);
  11275. return 1;
  11276. failed1: LLDEBUG_LEAVE("ObjectClass", 0);
  11277. return 0;
  11278. }
  11279. int ll_ObjectClassDefn(XObjectClass *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11280. {
  11281. unsigned llstp = llcstp;
  11282. LLSTATE llstate_0;
  11283. LLDEBUG_ENTER("ObjectClassDefn");
  11284. llstate_0 = *llin;
  11285. #undef failed
  11286. #define failed failed1
  11287. {LLSTATE llstate_1;
  11288. if (!llterm(T_CLASS, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  11289. {LLSTATE llstate_2;
  11290. if (!llterm('{', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  11291. {LLSTATE llstate_3;XFieldSpecs llatt_3;
  11292. if (!ll_FieldSpec_List(&llatt_3, &llstate_2, &llstate_3, llarg_oc)) goto failed1;
  11293. {LLSTATE llstate_4;
  11294. if (!llterm('}', (LLSTYPE *)0, &llstate_3, &llstate_4)) goto failed1;
  11295. {LLSTATE llstate_5;XSyntaxSpecs llatt_5;
  11296. if (!ll_WithSyntaxSpec_opt(&llatt_5, &llstate_4, &llstate_5, llarg_oc)) goto failed1;
  11297. *llout = llstate_5;
  11298. {ObjectClass_t *oc;
  11299. oc = NewObjectClass(eObjectClass_ObjectClass);
  11300. oc->U.ObjectClass.FieldSpec = llatt_3;
  11301. oc->U.ObjectClass.SyntaxSpec = llatt_5;
  11302. (*llret) = oc;
  11303. }}}}}}
  11304. LLDEBUG_LEAVE("ObjectClassDefn", 1);
  11305. return 1;
  11306. failed1: LLDEBUG_LEAVE("ObjectClassDefn", 0);
  11307. return 0;
  11308. }
  11309. int ll_FieldSpec_List(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11310. {
  11311. unsigned llstp = llcstp;
  11312. LLSTATE llstate_0;
  11313. LLDEBUG_ENTER("FieldSpec_List");
  11314. llstate_0 = *llin;
  11315. #undef failed
  11316. #define failed failed1
  11317. {LLSTATE llstate_1;XFieldSpecs llatt_1;
  11318. if (!ll_FieldSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  11319. {LLSTATE llstate_2;XFieldSpecs llatt_2;
  11320. if (!ll_FieldSpec_EList(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed1;
  11321. *llout = llstate_2;
  11322. {if (llatt_1) {
  11323. if (llatt_2) {
  11324. (*llret) = DupFieldSpec(llatt_1);
  11325. (*llret)->Next = llatt_2;
  11326. } else {
  11327. (*llret) = llatt_1;
  11328. }
  11329. } else {
  11330. (*llret) = llatt_2;
  11331. }
  11332. }}}
  11333. LLDEBUG_LEAVE("FieldSpec_List", 1);
  11334. return 1;
  11335. failed1: LLDEBUG_LEAVE("FieldSpec_List", 0);
  11336. return 0;
  11337. }
  11338. int ll_FieldSpec_EList(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11339. {
  11340. unsigned llstp = llcstp;
  11341. LLSTATE llstate_0;
  11342. LLDEBUG_ENTER("FieldSpec_EList");
  11343. llstate_0 = *llin;
  11344. #undef failed
  11345. #define failed failed1
  11346. #undef failed
  11347. #define failed failed2
  11348. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11349. LLCHECKSTK;
  11350. for (;;) {
  11351. switch (llstk[llcstp++]) {
  11352. case 1: case -1:
  11353. LLDEBUG_ALTERNATIVE("FieldSpec_EList", 1);
  11354. {LLSTATE llstate_1;
  11355. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11356. {LLSTATE llstate_2;XFieldSpecs llatt_2;
  11357. if (!ll_FieldSpec(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed2;
  11358. {LLSTATE llstate_3;XFieldSpecs llatt_3;
  11359. if (!ll_FieldSpec_EList(&llatt_3, &llstate_2, &llstate_3, llarg_oc)) goto failed2;
  11360. *llout = llstate_3;
  11361. {if (llatt_2) {
  11362. if (llatt_3) {
  11363. (*llret) = DupFieldSpec(llatt_2);
  11364. (*llret)->Next = llatt_3;
  11365. } else {
  11366. (*llret) = llatt_2;
  11367. }
  11368. } else {
  11369. (*llret) = llatt_3;
  11370. }
  11371. break;
  11372. }}}}
  11373. case 2: case -2:
  11374. LLDEBUG_ALTERNATIVE("FieldSpec_EList", 2);
  11375. *llout = llstate_0;
  11376. {(*llret) = NULL;
  11377. break;
  11378. }
  11379. default:
  11380. llstk[--llcstp] = 1;
  11381. goto failed1;
  11382. failed2:
  11383. LLDEBUG_BACKTRACKING("FieldSpec_EList");
  11384. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11385. llcpos = llpos1; llcstp = llstp1;
  11386. continue;
  11387. } break;
  11388. }}
  11389. LLDEBUG_LEAVE("FieldSpec_EList", 1);
  11390. return 1;
  11391. failed1: LLDEBUG_LEAVE("FieldSpec_EList", 0);
  11392. return 0;
  11393. }
  11394. int ll_WithSyntaxSpec_opt(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11395. {
  11396. unsigned llstp = llcstp;
  11397. LLSTATE llstate_0;
  11398. LLDEBUG_ENTER("WithSyntaxSpec_opt");
  11399. llstate_0 = *llin;
  11400. #undef failed
  11401. #define failed failed1
  11402. #undef failed
  11403. #define failed failed2
  11404. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11405. LLCHECKSTK;
  11406. for (;;) {
  11407. switch (llstk[llcstp++]) {
  11408. case 1: case -1:
  11409. LLDEBUG_ALTERNATIVE("WithSyntaxSpec_opt", 1);
  11410. {LLSTATE llstate_1;
  11411. if (!llterm(T_WITH, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11412. {LLSTATE llstate_2;
  11413. if (!llterm(T_SYNTAX, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  11414. {LLSTATE llstate_3;XSyntaxSpecs llatt_3;
  11415. if (!ll_SyntaxList(&llatt_3, &llstate_2, &llstate_3, llarg_oc)) goto failed2;
  11416. *llout = llstate_3;
  11417. {(*llret) = llatt_3;
  11418. break;
  11419. }}}}
  11420. case 2: case -2:
  11421. LLDEBUG_ALTERNATIVE("WithSyntaxSpec_opt", 2);
  11422. *llout = llstate_0;
  11423. {(*llret) = NULL;
  11424. break;
  11425. }
  11426. default:
  11427. llstk[--llcstp] = 1;
  11428. goto failed1;
  11429. failed2:
  11430. LLDEBUG_BACKTRACKING("WithSyntaxSpec_opt");
  11431. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11432. llcpos = llpos1; llcstp = llstp1;
  11433. continue;
  11434. } break;
  11435. }}
  11436. LLDEBUG_LEAVE("WithSyntaxSpec_opt", 1);
  11437. return 1;
  11438. failed1: LLDEBUG_LEAVE("WithSyntaxSpec_opt", 0);
  11439. return 0;
  11440. }
  11441. int ll_FieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11442. {
  11443. unsigned llstp = llcstp;
  11444. LLSTATE llstate_0;
  11445. LLDEBUG_ENTER("FieldSpec");
  11446. llstate_0 = *llin;
  11447. #undef failed
  11448. #define failed failed1
  11449. #undef failed
  11450. #define failed failed2
  11451. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11452. LLCHECKSTK;
  11453. for (;;) {
  11454. switch (llstk[llcstp++]) {
  11455. case 1: case -1:
  11456. LLDEBUG_ALTERNATIVE("FieldSpec", 1);
  11457. {LLSTATE llstate_1;XFieldSpecs llatt_1;
  11458. if (!ll_TypeFieldSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  11459. *llout = llstate_1;
  11460. {(*llret) = llatt_1;
  11461. break;
  11462. }}
  11463. case 2: case -2:
  11464. LLDEBUG_ALTERNATIVE("FieldSpec", 2);
  11465. {LLSTATE llstate_1;XFieldSpecs llatt_1;
  11466. if (!ll_FixedTypeValueFieldSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  11467. *llout = llstate_1;
  11468. {(*llret) = llatt_1;
  11469. break;
  11470. }}
  11471. case 3: case -3:
  11472. LLDEBUG_ALTERNATIVE("FieldSpec", 3);
  11473. {LLSTATE llstate_1;XFieldSpecs llatt_1;
  11474. if (!ll_VariableTypeValueFieldSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  11475. *llout = llstate_1;
  11476. {(*llret) = llatt_1;
  11477. break;
  11478. }}
  11479. case 4: case -4:
  11480. LLDEBUG_ALTERNATIVE("FieldSpec", 4);
  11481. {LLSTATE llstate_1;XFieldSpecs llatt_1;
  11482. if (!ll_FixedTypeValueSetFieldSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  11483. *llout = llstate_1;
  11484. {(*llret) = llatt_1;
  11485. break;
  11486. }}
  11487. case 5: case -5:
  11488. LLDEBUG_ALTERNATIVE("FieldSpec", 5);
  11489. {LLSTATE llstate_1;XFieldSpecs llatt_1;
  11490. if (!ll_VariableTypeValueSetFieldSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  11491. *llout = llstate_1;
  11492. {(*llret) = llatt_1;
  11493. break;
  11494. }}
  11495. case 6: case -6:
  11496. LLDEBUG_ALTERNATIVE("FieldSpec", 6);
  11497. {LLSTATE llstate_1;XFieldSpecs llatt_1;
  11498. if (!ll_ObjectFieldSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  11499. *llout = llstate_1;
  11500. {(*llret) = llatt_1;
  11501. break;
  11502. }}
  11503. case 7: case -7:
  11504. LLDEBUG_ALTERNATIVE("FieldSpec", 7);
  11505. {LLSTATE llstate_1;XFieldSpecs llatt_1;
  11506. if (!ll_ObjectSetFieldSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  11507. *llout = llstate_1;
  11508. {(*llret) = llatt_1;
  11509. break;
  11510. }}
  11511. default:
  11512. llstk[--llcstp] = 1;
  11513. goto failed1;
  11514. failed2:
  11515. LLDEBUG_BACKTRACKING("FieldSpec");
  11516. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11517. llcpos = llpos1; llcstp = llstp1;
  11518. continue;
  11519. } break;
  11520. }}
  11521. LLDEBUG_LEAVE("FieldSpec", 1);
  11522. return 1;
  11523. failed1: LLDEBUG_LEAVE("FieldSpec", 0);
  11524. return 0;
  11525. }
  11526. int ll_TypeFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11527. {
  11528. unsigned llstp = llcstp;
  11529. LLSTATE llstate_0;
  11530. LLDEBUG_ENTER("TypeFieldSpec");
  11531. llstate_0 = *llin;
  11532. #undef failed
  11533. #define failed failed1
  11534. {LLSTATE llstate_1;XString llatt_1;
  11535. if (!ll_typefieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  11536. {LLSTATE llstate_2;XOptionality llatt_2;
  11537. if (!ll_TypeOptionalitySpec_opt(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  11538. *llout = llstate_2;
  11539. {(*llret) = NewFieldSpec(eFieldSpec_Type);
  11540. (*llret)->Identifier = llatt_1;
  11541. (*llret)->U.Type.Optionality = llatt_2;
  11542. }}}
  11543. LLDEBUG_LEAVE("TypeFieldSpec", 1);
  11544. return 1;
  11545. failed1: LLDEBUG_LEAVE("TypeFieldSpec", 0);
  11546. return 0;
  11547. }
  11548. int ll_TypeOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout)
  11549. {
  11550. unsigned llstp = llcstp;
  11551. LLSTATE llstate_0;
  11552. LLDEBUG_ENTER("TypeOptionalitySpec_opt");
  11553. llstate_0 = *llin;
  11554. #undef failed
  11555. #define failed failed1
  11556. #undef failed
  11557. #define failed failed2
  11558. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11559. LLCHECKSTK;
  11560. for (;;) {
  11561. switch (llstk[llcstp++]) {
  11562. case 1: case -1:
  11563. LLDEBUG_ALTERNATIVE("TypeOptionalitySpec_opt", 1);
  11564. {LLSTATE llstate_1;
  11565. if (!llterm(T_OPTIONAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11566. *llout = llstate_1;
  11567. {(*llret) = NewOptionality(eOptionality_Optional);
  11568. break;
  11569. }}
  11570. case 2: case -2:
  11571. LLDEBUG_ALTERNATIVE("TypeOptionalitySpec_opt", 2);
  11572. {LLSTATE llstate_1;
  11573. if (!llterm(T_DEFAULT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11574. {LLSTATE llstate_2;XType llatt_2;
  11575. if (!ll_Type(&llatt_2, &llstate_1, &llstate_2)) goto failed2;
  11576. *llout = llstate_2;
  11577. {(*llret) = NewOptionality(eOptionality_Default_Type);
  11578. (*llret)->U.Type = llatt_2;
  11579. break;
  11580. }}}
  11581. case 3: case -3:
  11582. LLDEBUG_ALTERNATIVE("TypeOptionalitySpec_opt", 3);
  11583. *llout = llstate_0;
  11584. {(*llret) = NewOptionality(eOptionality_Normal);
  11585. break;
  11586. }
  11587. default:
  11588. llstk[--llcstp] = 1;
  11589. goto failed1;
  11590. failed2:
  11591. LLDEBUG_BACKTRACKING("TypeOptionalitySpec_opt");
  11592. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11593. llcpos = llpos1; llcstp = llstp1;
  11594. continue;
  11595. } break;
  11596. }}
  11597. LLDEBUG_LEAVE("TypeOptionalitySpec_opt", 1);
  11598. return 1;
  11599. failed1: LLDEBUG_LEAVE("TypeOptionalitySpec_opt", 0);
  11600. return 0;
  11601. }
  11602. int ll_FixedTypeValueFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11603. {
  11604. unsigned llstp = llcstp;
  11605. LLSTATE llstate_0;
  11606. LLDEBUG_ENTER("FixedTypeValueFieldSpec");
  11607. llstate_0 = *llin;
  11608. #undef failed
  11609. #define failed failed1
  11610. {LLSTATE llstate_1;XString llatt_1;
  11611. if (!ll_valuefieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  11612. {LLSTATE llstate_2;XType llatt_2;
  11613. if (!ll_Type(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  11614. {LLSTATE llstate_3;XBoolean llatt_3;
  11615. if (!ll_UNIQUE_opt(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  11616. {LLSTATE llstate_4;XOptionality llatt_4;
  11617. if (!ll_ValueOptionalitySpec_opt(&llatt_4, &llstate_3, &llstate_4, llatt_2)) goto failed1;
  11618. *llout = llstate_4;
  11619. {if (GetType((*llout).Assignments, llatt_2)) {
  11620. (*llret) = NewFieldSpec(eFieldSpec_FixedTypeValue);
  11621. (*llret)->Identifier = llatt_1;
  11622. (*llret)->U.FixedTypeValue.Type = llatt_2;
  11623. (*llret)->U.FixedTypeValue.Unique = llatt_3;
  11624. (*llret)->U.FixedTypeValue.Optionality = llatt_4;
  11625. } else {
  11626. (*llret) = NULL;
  11627. }
  11628. }}}}}
  11629. LLDEBUG_LEAVE("FixedTypeValueFieldSpec", 1);
  11630. return 1;
  11631. failed1: LLDEBUG_LEAVE("FixedTypeValueFieldSpec", 0);
  11632. return 0;
  11633. }
  11634. int ll_UNIQUE_opt(XBoolean *llret, LLSTATE *llin, LLSTATE *llout)
  11635. {
  11636. unsigned llstp = llcstp;
  11637. LLSTATE llstate_0;
  11638. LLDEBUG_ENTER("UNIQUE_opt");
  11639. llstate_0 = *llin;
  11640. #undef failed
  11641. #define failed failed1
  11642. #undef failed
  11643. #define failed failed2
  11644. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11645. LLCHECKSTK;
  11646. for (;;) {
  11647. switch (llstk[llcstp++]) {
  11648. case 1: case -1:
  11649. LLDEBUG_ALTERNATIVE("UNIQUE_opt", 1);
  11650. {LLSTATE llstate_1;
  11651. if (!llterm(T_UNIQUE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11652. *llout = llstate_1;
  11653. {(*llret) = 1;
  11654. break;
  11655. }}
  11656. case 2: case -2:
  11657. LLDEBUG_ALTERNATIVE("UNIQUE_opt", 2);
  11658. *llout = llstate_0;
  11659. {(*llret) = 0;
  11660. break;
  11661. }
  11662. default:
  11663. llstk[--llcstp] = 1;
  11664. goto failed1;
  11665. failed2:
  11666. LLDEBUG_BACKTRACKING("UNIQUE_opt");
  11667. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11668. llcpos = llpos1; llcstp = llstp1;
  11669. continue;
  11670. } break;
  11671. }}
  11672. LLDEBUG_LEAVE("UNIQUE_opt", 1);
  11673. return 1;
  11674. failed1: LLDEBUG_LEAVE("UNIQUE_opt", 0);
  11675. return 0;
  11676. }
  11677. int ll_ValueOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  11678. {
  11679. unsigned llstp = llcstp;
  11680. LLSTATE llstate_0;
  11681. LLDEBUG_ENTER("ValueOptionalitySpec_opt");
  11682. llstate_0 = *llin;
  11683. #undef failed
  11684. #define failed failed1
  11685. #undef failed
  11686. #define failed failed2
  11687. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11688. LLCHECKSTK;
  11689. for (;;) {
  11690. switch (llstk[llcstp++]) {
  11691. case 1: case -1:
  11692. LLDEBUG_ALTERNATIVE("ValueOptionalitySpec_opt", 1);
  11693. {LLSTATE llstate_1;
  11694. if (!llterm(T_OPTIONAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11695. *llout = llstate_1;
  11696. {(*llret) = NewOptionality(eOptionality_Optional);
  11697. break;
  11698. }}
  11699. case 2: case -2:
  11700. LLDEBUG_ALTERNATIVE("ValueOptionalitySpec_opt", 2);
  11701. {LLSTATE llstate_1;
  11702. if (!llterm(T_DEFAULT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11703. {LLSTATE llstate_2;XValue llatt_2;
  11704. if (!ll_Value(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed2;
  11705. *llout = llstate_2;
  11706. {(*llret) = NewOptionality(eOptionality_Default_Value);
  11707. (*llret)->U.Value = llatt_2;
  11708. break;
  11709. }}}
  11710. case 3: case -3:
  11711. LLDEBUG_ALTERNATIVE("ValueOptionalitySpec_opt", 3);
  11712. *llout = llstate_0;
  11713. {(*llret) = NewOptionality(eOptionality_Normal);
  11714. break;
  11715. }
  11716. default:
  11717. llstk[--llcstp] = 1;
  11718. goto failed1;
  11719. failed2:
  11720. LLDEBUG_BACKTRACKING("ValueOptionalitySpec_opt");
  11721. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11722. llcpos = llpos1; llcstp = llstp1;
  11723. continue;
  11724. } break;
  11725. }}
  11726. LLDEBUG_LEAVE("ValueOptionalitySpec_opt", 1);
  11727. return 1;
  11728. failed1: LLDEBUG_LEAVE("ValueOptionalitySpec_opt", 0);
  11729. return 0;
  11730. }
  11731. int ll_VariableTypeValueFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11732. {
  11733. unsigned llstp = llcstp;
  11734. LLSTATE llstate_0;
  11735. LLDEBUG_ENTER("VariableTypeValueFieldSpec");
  11736. llstate_0 = *llin;
  11737. #undef failed
  11738. #define failed failed1
  11739. {LLSTATE llstate_1;XString llatt_1;
  11740. if (!ll_valuefieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  11741. {LLSTATE llstate_2;XStrings llatt_2;
  11742. if (!ll_FieldName(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed1;
  11743. {Type_t *deftype;
  11744. FieldSpec_t *fs, *deffs;
  11745. fs = GetFieldSpecFromObjectClass(llstate_2.Assignments, llarg_oc, llatt_2);
  11746. deffs = GetFieldSpec(llstate_2.Assignments, fs);
  11747. if (deffs &&
  11748. deffs->Type == eFieldSpec_Type &&
  11749. deffs->U.Type.Optionality->Type == eOptionality_Default_Type)
  11750. deftype = deffs->U.Type.Optionality->U.Type;
  11751. else
  11752. deftype = NULL;
  11753. {LLSTATE llstate_3;XOptionality llatt_3;
  11754. if (!ll_ValueOptionalitySpec_opt(&llatt_3, &llstate_2, &llstate_3, deftype)) goto failed1;
  11755. *llout = llstate_3;
  11756. {(*llret) = NewFieldSpec(eFieldSpec_VariableTypeValue);
  11757. (*llret)->Identifier = llatt_1;
  11758. (*llret)->U.VariableTypeValue.Fields = llatt_2;
  11759. (*llret)->U.VariableTypeValue.Optionality = llatt_3;
  11760. }}}}}
  11761. LLDEBUG_LEAVE("VariableTypeValueFieldSpec", 1);
  11762. return 1;
  11763. failed1: LLDEBUG_LEAVE("VariableTypeValueFieldSpec", 0);
  11764. return 0;
  11765. }
  11766. int ll_FixedTypeValueSetFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11767. {
  11768. unsigned llstp = llcstp;
  11769. LLSTATE llstate_0;
  11770. LLDEBUG_ENTER("FixedTypeValueSetFieldSpec");
  11771. llstate_0 = *llin;
  11772. #undef failed
  11773. #define failed failed1
  11774. {LLSTATE llstate_1;XString llatt_1;
  11775. if (!ll_valuesetfieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  11776. {LLSTATE llstate_2;XType llatt_2;
  11777. if (!ll_Type(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  11778. {LLSTATE llstate_3;XOptionality llatt_3;
  11779. if (!ll_ValueSetOptionalitySpec_opt(&llatt_3, &llstate_2, &llstate_3, llatt_2)) goto failed1;
  11780. *llout = llstate_3;
  11781. {if (GetType((*llout).Assignments, llatt_2)) {
  11782. (*llret) = NewFieldSpec(eFieldSpec_FixedTypeValueSet);
  11783. (*llret)->Identifier = llatt_1;
  11784. (*llret)->U.FixedTypeValueSet.Type = llatt_2;
  11785. (*llret)->U.FixedTypeValueSet.Optionality = llatt_3;
  11786. } else {
  11787. (*llret) = NULL;
  11788. }
  11789. }}}}
  11790. LLDEBUG_LEAVE("FixedTypeValueSetFieldSpec", 1);
  11791. return 1;
  11792. failed1: LLDEBUG_LEAVE("FixedTypeValueSetFieldSpec", 0);
  11793. return 0;
  11794. }
  11795. int ll_ValueSetOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  11796. {
  11797. unsigned llstp = llcstp;
  11798. LLSTATE llstate_0;
  11799. LLDEBUG_ENTER("ValueSetOptionalitySpec_opt");
  11800. llstate_0 = *llin;
  11801. #undef failed
  11802. #define failed failed1
  11803. #undef failed
  11804. #define failed failed2
  11805. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11806. LLCHECKSTK;
  11807. for (;;) {
  11808. switch (llstk[llcstp++]) {
  11809. case 1: case -1:
  11810. LLDEBUG_ALTERNATIVE("ValueSetOptionalitySpec_opt", 1);
  11811. {LLSTATE llstate_1;
  11812. if (!llterm(T_OPTIONAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11813. *llout = llstate_1;
  11814. {(*llret) = NewOptionality(eOptionality_Optional);
  11815. break;
  11816. }}
  11817. case 2: case -2:
  11818. LLDEBUG_ALTERNATIVE("ValueSetOptionalitySpec_opt", 2);
  11819. {LLSTATE llstate_1;
  11820. if (!llterm(T_DEFAULT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11821. {LLSTATE llstate_2;XValueSet llatt_2;
  11822. if (!ll_ValueSet(&llatt_2, &llstate_1, &llstate_2, llarg_type)) goto failed2;
  11823. *llout = llstate_2;
  11824. {(*llret) = NewOptionality(eOptionality_Default_ValueSet);
  11825. (*llret)->U.ValueSet = llatt_2;
  11826. break;
  11827. }}}
  11828. case 3: case -3:
  11829. LLDEBUG_ALTERNATIVE("ValueSetOptionalitySpec_opt", 3);
  11830. *llout = llstate_0;
  11831. {(*llret) = NewOptionality(eOptionality_Normal);
  11832. break;
  11833. }
  11834. default:
  11835. llstk[--llcstp] = 1;
  11836. goto failed1;
  11837. failed2:
  11838. LLDEBUG_BACKTRACKING("ValueSetOptionalitySpec_opt");
  11839. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11840. llcpos = llpos1; llcstp = llstp1;
  11841. continue;
  11842. } break;
  11843. }}
  11844. LLDEBUG_LEAVE("ValueSetOptionalitySpec_opt", 1);
  11845. return 1;
  11846. failed1: LLDEBUG_LEAVE("ValueSetOptionalitySpec_opt", 0);
  11847. return 0;
  11848. }
  11849. int ll_VariableTypeValueSetFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11850. {
  11851. unsigned llstp = llcstp;
  11852. LLSTATE llstate_0;
  11853. LLDEBUG_ENTER("VariableTypeValueSetFieldSpec");
  11854. llstate_0 = *llin;
  11855. #undef failed
  11856. #define failed failed1
  11857. {LLSTATE llstate_1;XString llatt_1;
  11858. if (!ll_valuesetfieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  11859. {LLSTATE llstate_2;XStrings llatt_2;
  11860. if (!ll_FieldName(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed1;
  11861. {Type_t *deftype;
  11862. FieldSpec_t *fs, *deffs;
  11863. fs = GetFieldSpecFromObjectClass(llstate_2.Assignments, llarg_oc, llatt_2);
  11864. deffs = GetFieldSpec(llstate_2.Assignments, fs);
  11865. if (deffs &&
  11866. deffs->Type == eFieldSpec_Type &&
  11867. deffs->U.Type.Optionality->Type == eOptionality_Default_Type)
  11868. deftype = deffs->U.Type.Optionality->U.Type;
  11869. else
  11870. deftype = NULL;
  11871. {LLSTATE llstate_3;XOptionality llatt_3;
  11872. if (!ll_ValueSetOptionalitySpec_opt(&llatt_3, &llstate_2, &llstate_3, deftype)) goto failed1;
  11873. *llout = llstate_3;
  11874. {(*llret) = NewFieldSpec(eFieldSpec_VariableTypeValueSet);
  11875. (*llret)->Identifier = llatt_1;
  11876. (*llret)->U.VariableTypeValueSet.Fields = llatt_2;
  11877. (*llret)->U.VariableTypeValueSet.Optionality = llatt_3;
  11878. }}}}}
  11879. LLDEBUG_LEAVE("VariableTypeValueSetFieldSpec", 1);
  11880. return 1;
  11881. failed1: LLDEBUG_LEAVE("VariableTypeValueSetFieldSpec", 0);
  11882. return 0;
  11883. }
  11884. int ll_ObjectFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11885. {
  11886. unsigned llstp = llcstp;
  11887. LLSTATE llstate_0;
  11888. LLDEBUG_ENTER("ObjectFieldSpec");
  11889. llstate_0 = *llin;
  11890. #undef failed
  11891. #define failed failed1
  11892. {LLSTATE llstate_1;XString llatt_1;
  11893. if (!ll_objectfieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  11894. {LLSTATE llstate_2;XObjectClass llatt_2;
  11895. if (!ll_DefinedObjectClass(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  11896. {LLSTATE llstate_3;XOptionality llatt_3;
  11897. if (!ll_ObjectOptionalitySpec_opt(&llatt_3, &llstate_2, &llstate_3, llatt_2)) goto failed1;
  11898. *llout = llstate_3;
  11899. {if (GetObjectClass((*llout).Assignments, llatt_2)) {
  11900. (*llret) = NewFieldSpec(eFieldSpec_Object);
  11901. (*llret)->Identifier = llatt_1;
  11902. (*llret)->U.Object.ObjectClass = llatt_2;
  11903. (*llret)->U.Object.Optionality = llatt_3;
  11904. } else {
  11905. (*llret) = NULL;
  11906. }
  11907. }}}}
  11908. LLDEBUG_LEAVE("ObjectFieldSpec", 1);
  11909. return 1;
  11910. failed1: LLDEBUG_LEAVE("ObjectFieldSpec", 0);
  11911. return 0;
  11912. }
  11913. int ll_ObjectOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11914. {
  11915. unsigned llstp = llcstp;
  11916. LLSTATE llstate_0;
  11917. LLDEBUG_ENTER("ObjectOptionalitySpec_opt");
  11918. llstate_0 = *llin;
  11919. #undef failed
  11920. #define failed failed1
  11921. #undef failed
  11922. #define failed failed2
  11923. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  11924. LLCHECKSTK;
  11925. for (;;) {
  11926. switch (llstk[llcstp++]) {
  11927. case 1: case -1:
  11928. LLDEBUG_ALTERNATIVE("ObjectOptionalitySpec_opt", 1);
  11929. {LLSTATE llstate_1;
  11930. if (!llterm(T_OPTIONAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11931. *llout = llstate_1;
  11932. {(*llret) = NewOptionality(eOptionality_Optional);
  11933. break;
  11934. }}
  11935. case 2: case -2:
  11936. LLDEBUG_ALTERNATIVE("ObjectOptionalitySpec_opt", 2);
  11937. {LLSTATE llstate_1;
  11938. if (!llterm(T_DEFAULT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  11939. {LLSTATE llstate_2;XObject llatt_2;
  11940. if (!ll_Object(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed2;
  11941. *llout = llstate_2;
  11942. {(*llret) = NewOptionality(eOptionality_Default_Object);
  11943. (*llret)->U.Object = llatt_2;
  11944. break;
  11945. }}}
  11946. case 3: case -3:
  11947. LLDEBUG_ALTERNATIVE("ObjectOptionalitySpec_opt", 3);
  11948. *llout = llstate_0;
  11949. {(*llret) = NewOptionality(eOptionality_Normal);
  11950. break;
  11951. }
  11952. default:
  11953. llstk[--llcstp] = 1;
  11954. goto failed1;
  11955. failed2:
  11956. LLDEBUG_BACKTRACKING("ObjectOptionalitySpec_opt");
  11957. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  11958. llcpos = llpos1; llcstp = llstp1;
  11959. continue;
  11960. } break;
  11961. }}
  11962. LLDEBUG_LEAVE("ObjectOptionalitySpec_opt", 1);
  11963. return 1;
  11964. failed1: LLDEBUG_LEAVE("ObjectOptionalitySpec_opt", 0);
  11965. return 0;
  11966. }
  11967. int ll_ObjectSetFieldSpec(XFieldSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11968. {
  11969. unsigned llstp = llcstp;
  11970. LLSTATE llstate_0;
  11971. LLDEBUG_ENTER("ObjectSetFieldSpec");
  11972. llstate_0 = *llin;
  11973. #undef failed
  11974. #define failed failed1
  11975. {LLSTATE llstate_1;XString llatt_1;
  11976. if (!ll_objectsetfieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  11977. {LLSTATE llstate_2;XObjectClass llatt_2;
  11978. if (!ll_DefinedObjectClass(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  11979. {LLSTATE llstate_3;XOptionality llatt_3;
  11980. if (!ll_ObjectSetOptionalitySpec_opt(&llatt_3, &llstate_2, &llstate_3, llatt_2)) goto failed1;
  11981. *llout = llstate_3;
  11982. {if (GetObjectClass((*llout).Assignments, llatt_2)) {
  11983. (*llret) = NewFieldSpec(eFieldSpec_ObjectSet);
  11984. (*llret)->Identifier = llatt_1;
  11985. (*llret)->U.ObjectSet.ObjectClass = llatt_2;
  11986. (*llret)->U.ObjectSet.Optionality = llatt_3;
  11987. } else {
  11988. (*llret) = NULL;
  11989. }
  11990. }}}}
  11991. LLDEBUG_LEAVE("ObjectSetFieldSpec", 1);
  11992. return 1;
  11993. failed1: LLDEBUG_LEAVE("ObjectSetFieldSpec", 0);
  11994. return 0;
  11995. }
  11996. int ll_ObjectSetOptionalitySpec_opt(XOptionality *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  11997. {
  11998. unsigned llstp = llcstp;
  11999. LLSTATE llstate_0;
  12000. LLDEBUG_ENTER("ObjectSetOptionalitySpec_opt");
  12001. llstate_0 = *llin;
  12002. #undef failed
  12003. #define failed failed1
  12004. #undef failed
  12005. #define failed failed2
  12006. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12007. LLCHECKSTK;
  12008. for (;;) {
  12009. switch (llstk[llcstp++]) {
  12010. case 1: case -1:
  12011. LLDEBUG_ALTERNATIVE("ObjectSetOptionalitySpec_opt", 1);
  12012. {LLSTATE llstate_1;
  12013. if (!llterm(T_OPTIONAL, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  12014. *llout = llstate_1;
  12015. {(*llret) = NewOptionality(eOptionality_Optional);
  12016. break;
  12017. }}
  12018. case 2: case -2:
  12019. LLDEBUG_ALTERNATIVE("ObjectSetOptionalitySpec_opt", 2);
  12020. {LLSTATE llstate_1;
  12021. if (!llterm(T_DEFAULT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  12022. {LLSTATE llstate_2;XObjectSet llatt_2;
  12023. if (!ll_ObjectSet(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed2;
  12024. *llout = llstate_2;
  12025. {(*llret) = NewOptionality(eOptionality_Default_ObjectSet);
  12026. (*llret)->U.ObjectSet = llatt_2;
  12027. break;
  12028. }}}
  12029. case 3: case -3:
  12030. LLDEBUG_ALTERNATIVE("ObjectSetOptionalitySpec_opt", 3);
  12031. *llout = llstate_0;
  12032. {(*llret) = NewOptionality(eOptionality_Normal);
  12033. break;
  12034. }
  12035. default:
  12036. llstk[--llcstp] = 1;
  12037. goto failed1;
  12038. failed2:
  12039. LLDEBUG_BACKTRACKING("ObjectSetOptionalitySpec_opt");
  12040. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12041. llcpos = llpos1; llcstp = llstp1;
  12042. continue;
  12043. } break;
  12044. }}
  12045. LLDEBUG_LEAVE("ObjectSetOptionalitySpec_opt", 1);
  12046. return 1;
  12047. failed1: LLDEBUG_LEAVE("ObjectSetOptionalitySpec_opt", 0);
  12048. return 0;
  12049. }
  12050. int ll_PrimitiveFieldName(XString *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12051. {
  12052. unsigned llstp = llcstp;
  12053. LLSTATE llstate_0;
  12054. LLDEBUG_ENTER("PrimitiveFieldName");
  12055. llstate_0 = *llin;
  12056. #undef failed
  12057. #define failed failed1
  12058. #undef failed
  12059. #define failed failed2
  12060. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12061. LLCHECKSTK;
  12062. for (;;) {
  12063. switch (llstk[llcstp++]) {
  12064. case 1: case -1:
  12065. LLDEBUG_ALTERNATIVE("PrimitiveFieldName", 1);
  12066. {LLSTATE llstate_1;XString llatt_1;
  12067. if (!ll_typefieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12068. *llout = llstate_1;
  12069. {(*llret) = llatt_1;
  12070. break;
  12071. }}
  12072. case 2: case -2:
  12073. LLDEBUG_ALTERNATIVE("PrimitiveFieldName", 2);
  12074. {LLSTATE llstate_1;XString llatt_1;
  12075. if (!ll_valuefieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12076. *llout = llstate_1;
  12077. {(*llret) = llatt_1;
  12078. break;
  12079. }}
  12080. case 3: case -3:
  12081. LLDEBUG_ALTERNATIVE("PrimitiveFieldName", 3);
  12082. {LLSTATE llstate_1;XString llatt_1;
  12083. if (!ll_valuesetfieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12084. *llout = llstate_1;
  12085. {(*llret) = llatt_1;
  12086. break;
  12087. }}
  12088. case 4: case -4:
  12089. LLDEBUG_ALTERNATIVE("PrimitiveFieldName", 4);
  12090. {LLSTATE llstate_1;XString llatt_1;
  12091. if (!ll_objectfieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12092. *llout = llstate_1;
  12093. {(*llret) = llatt_1;
  12094. break;
  12095. }}
  12096. case 5: case -5:
  12097. LLDEBUG_ALTERNATIVE("PrimitiveFieldName", 5);
  12098. {LLSTATE llstate_1;XString llatt_1;
  12099. if (!ll_objectsetfieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12100. *llout = llstate_1;
  12101. {(*llret) = llatt_1;
  12102. break;
  12103. }}
  12104. default:
  12105. llstk[--llcstp] = 1;
  12106. goto failed1;
  12107. failed2:
  12108. LLDEBUG_BACKTRACKING("PrimitiveFieldName");
  12109. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12110. llcpos = llpos1; llcstp = llstp1;
  12111. continue;
  12112. } break;
  12113. }}
  12114. LLDEBUG_LEAVE("PrimitiveFieldName", 1);
  12115. return 1;
  12116. failed1: LLDEBUG_LEAVE("PrimitiveFieldName", 0);
  12117. return 0;
  12118. }
  12119. int ll_FieldName(XStrings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12120. {
  12121. unsigned llstp = llcstp;
  12122. LLSTATE llstate_0;
  12123. LLDEBUG_ENTER("FieldName");
  12124. llstate_0 = *llin;
  12125. #undef failed
  12126. #define failed failed1
  12127. #undef failed
  12128. #define failed failed2
  12129. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12130. LLCHECKSTK;
  12131. for (;;) {
  12132. switch (llstk[llcstp++]) {
  12133. case 1: case -1:
  12134. LLDEBUG_ALTERNATIVE("FieldName", 1);
  12135. {LLSTATE llstate_1;XString llatt_1;
  12136. if (!ll_objectfieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12137. {LLSTATE llstate_2;
  12138. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  12139. {FieldSpec_t *fs;
  12140. ObjectClass_t *oc;
  12141. fs = GetObjectClassField(llstate_2.Assignments, llarg_oc, llatt_1);
  12142. if (fs)
  12143. oc = fs->U.Object.ObjectClass;
  12144. else
  12145. oc = NULL;
  12146. {LLSTATE llstate_3;XStrings llatt_3;
  12147. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, oc)) goto failed2;
  12148. *llout = llstate_3;
  12149. {(*llret) = NewString();
  12150. (*llret)->String = llatt_1;
  12151. (*llret)->Next = llatt_3;
  12152. break;
  12153. }}}}}
  12154. case 2: case -2:
  12155. LLDEBUG_ALTERNATIVE("FieldName", 2);
  12156. {LLSTATE llstate_1;XString llatt_1;
  12157. if (!ll_objectsetfieldreference(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12158. {LLSTATE llstate_2;
  12159. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  12160. {FieldSpec_t *fs;
  12161. ObjectClass_t *oc;
  12162. fs = GetObjectClassField(llstate_2.Assignments, llarg_oc, llatt_1);
  12163. if (fs)
  12164. oc = fs->U.ObjectSet.ObjectClass;
  12165. else
  12166. oc = NULL;
  12167. {LLSTATE llstate_3;XStrings llatt_3;
  12168. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, oc)) goto failed2;
  12169. *llout = llstate_3;
  12170. {(*llret) = NewString();
  12171. (*llret)->String = llatt_1;
  12172. (*llret)->Next = llatt_3;
  12173. break;
  12174. }}}}}
  12175. case 3: case -3:
  12176. LLDEBUG_ALTERNATIVE("FieldName", 3);
  12177. {LLSTATE llstate_1;XString llatt_1;
  12178. if (!ll_PrimitiveFieldName(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12179. *llout = llstate_1;
  12180. {(*llret) = NewString();
  12181. (*llret)->String = llatt_1;
  12182. break;
  12183. }}
  12184. default:
  12185. llstk[--llcstp] = 1;
  12186. goto failed1;
  12187. failed2:
  12188. LLDEBUG_BACKTRACKING("FieldName");
  12189. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12190. llcpos = llpos1; llcstp = llstp1;
  12191. continue;
  12192. } break;
  12193. }}
  12194. LLDEBUG_LEAVE("FieldName", 1);
  12195. return 1;
  12196. failed1: LLDEBUG_LEAVE("FieldName", 0);
  12197. return 0;
  12198. }
  12199. int ll_SyntaxList(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12200. {
  12201. unsigned llstp = llcstp;
  12202. LLSTATE llstate_0;
  12203. LLDEBUG_ENTER("SyntaxList");
  12204. llstate_0 = *llin;
  12205. #undef failed
  12206. #define failed failed1
  12207. {LLSTATE llstate_1;
  12208. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  12209. {LLSTATE llstate_2;XSyntaxSpecs llatt_2;
  12210. if (!ll_TokenOrGroupSpec_Seq(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed1;
  12211. {LLSTATE llstate_3;
  12212. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  12213. *llout = llstate_3;
  12214. {(*llret) = llatt_2;
  12215. }}}}
  12216. LLDEBUG_LEAVE("SyntaxList", 1);
  12217. return 1;
  12218. failed1: LLDEBUG_LEAVE("SyntaxList", 0);
  12219. return 0;
  12220. }
  12221. int ll_TokenOrGroupSpec_Seq(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12222. {
  12223. unsigned llstp = llcstp;
  12224. LLSTATE llstate_0;
  12225. LLDEBUG_ENTER("TokenOrGroupSpec_Seq");
  12226. llstate_0 = *llin;
  12227. #undef failed
  12228. #define failed failed1
  12229. {LLSTATE llstate_1;XSyntaxSpecs llatt_1;
  12230. if (!ll_TokenOrGroupSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  12231. {LLSTATE llstate_2;XSyntaxSpecs llatt_2;
  12232. if (!ll_TokenOrGroupSpec_ESeq(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed1;
  12233. *llout = llstate_2;
  12234. {(*llret) = DupSyntaxSpec(llatt_1);
  12235. (*llret)->Next = llatt_2;
  12236. }}}
  12237. LLDEBUG_LEAVE("TokenOrGroupSpec_Seq", 1);
  12238. return 1;
  12239. failed1: LLDEBUG_LEAVE("TokenOrGroupSpec_Seq", 0);
  12240. return 0;
  12241. }
  12242. int ll_TokenOrGroupSpec_ESeq(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12243. {
  12244. unsigned llstp = llcstp;
  12245. LLSTATE llstate_0;
  12246. LLDEBUG_ENTER("TokenOrGroupSpec_ESeq");
  12247. llstate_0 = *llin;
  12248. #undef failed
  12249. #define failed failed1
  12250. #undef failed
  12251. #define failed failed2
  12252. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12253. LLCHECKSTK;
  12254. for (;;) {
  12255. switch (llstk[llcstp++]) {
  12256. case 1: case -1:
  12257. LLDEBUG_ALTERNATIVE("TokenOrGroupSpec_ESeq", 1);
  12258. {LLSTATE llstate_1;XSyntaxSpecs llatt_1;
  12259. if (!ll_TokenOrGroupSpec(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12260. {LLSTATE llstate_2;XSyntaxSpecs llatt_2;
  12261. if (!ll_TokenOrGroupSpec_ESeq(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed2;
  12262. *llout = llstate_2;
  12263. {(*llret) = DupSyntaxSpec(llatt_1);
  12264. (*llret)->Next = llatt_2;
  12265. break;
  12266. }}}
  12267. case 2: case -2:
  12268. LLDEBUG_ALTERNATIVE("TokenOrGroupSpec_ESeq", 2);
  12269. *llout = llstate_0;
  12270. {(*llret) = NULL;
  12271. break;
  12272. }
  12273. default:
  12274. llstk[--llcstp] = 1;
  12275. goto failed1;
  12276. failed2:
  12277. LLDEBUG_BACKTRACKING("TokenOrGroupSpec_ESeq");
  12278. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12279. llcpos = llpos1; llcstp = llstp1;
  12280. continue;
  12281. } break;
  12282. }}
  12283. LLDEBUG_LEAVE("TokenOrGroupSpec_ESeq", 1);
  12284. return 1;
  12285. failed1: LLDEBUG_LEAVE("TokenOrGroupSpec_ESeq", 0);
  12286. return 0;
  12287. }
  12288. int ll_TokenOrGroupSpec(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12289. {
  12290. unsigned llstp = llcstp;
  12291. LLSTATE llstate_0;
  12292. LLDEBUG_ENTER("TokenOrGroupSpec");
  12293. llstate_0 = *llin;
  12294. #undef failed
  12295. #define failed failed1
  12296. #undef failed
  12297. #define failed failed2
  12298. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12299. LLCHECKSTK;
  12300. for (;;) {
  12301. switch (llstk[llcstp++]) {
  12302. case 1: case -1:
  12303. LLDEBUG_ALTERNATIVE("TokenOrGroupSpec", 1);
  12304. {LLSTATE llstate_1;XSyntaxSpecs llatt_1;
  12305. if (!ll_RequiredToken(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12306. *llout = llstate_1;
  12307. {(*llret) = llatt_1;
  12308. break;
  12309. }}
  12310. case 2: case -2:
  12311. LLDEBUG_ALTERNATIVE("TokenOrGroupSpec", 2);
  12312. {LLSTATE llstate_1;XSyntaxSpecs llatt_1;
  12313. if (!ll_OptionalGroup(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12314. *llout = llstate_1;
  12315. {(*llret) = llatt_1;
  12316. break;
  12317. }}
  12318. default:
  12319. llstk[--llcstp] = 1;
  12320. goto failed1;
  12321. failed2:
  12322. LLDEBUG_BACKTRACKING("TokenOrGroupSpec");
  12323. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12324. llcpos = llpos1; llcstp = llstp1;
  12325. continue;
  12326. } break;
  12327. }}
  12328. LLDEBUG_LEAVE("TokenOrGroupSpec", 1);
  12329. return 1;
  12330. failed1: LLDEBUG_LEAVE("TokenOrGroupSpec", 0);
  12331. return 0;
  12332. }
  12333. int ll_OptionalGroup(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12334. {
  12335. unsigned llstp = llcstp;
  12336. LLSTATE llstate_0;
  12337. LLDEBUG_ENTER("OptionalGroup");
  12338. llstate_0 = *llin;
  12339. #undef failed
  12340. #define failed failed1
  12341. {LLSTATE llstate_1;
  12342. if (!llterm('[', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  12343. {LLSTATE llstate_2;XSyntaxSpecs llatt_2;
  12344. if (!ll_TokenOrGroupSpec_Seq(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed1;
  12345. {LLSTATE llstate_3;
  12346. if (!llterm(']', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  12347. *llout = llstate_3;
  12348. {(*llret) = NewSyntaxSpec(eSyntaxSpec_Optional);
  12349. (*llret)->U.Optional.SyntaxSpec = llatt_2;
  12350. }}}}
  12351. LLDEBUG_LEAVE("OptionalGroup", 1);
  12352. return 1;
  12353. failed1: LLDEBUG_LEAVE("OptionalGroup", 0);
  12354. return 0;
  12355. }
  12356. int ll_RequiredToken(XSyntaxSpecs *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12357. {
  12358. unsigned llstp = llcstp;
  12359. LLSTATE llstate_0;
  12360. LLDEBUG_ENTER("RequiredToken");
  12361. llstate_0 = *llin;
  12362. #undef failed
  12363. #define failed failed1
  12364. #undef failed
  12365. #define failed failed2
  12366. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12367. LLCHECKSTK;
  12368. for (;;) {
  12369. switch (llstk[llcstp++]) {
  12370. case 1: case -1:
  12371. LLDEBUG_ALTERNATIVE("RequiredToken", 1);
  12372. {LLSTATE llstate_1;XString llatt_1;
  12373. if (!ll_Literal(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  12374. *llout = llstate_1;
  12375. {(*llret) = NewSyntaxSpec(eSyntaxSpec_Literal);
  12376. (*llret)->U.Literal.Literal = llatt_1;
  12377. break;
  12378. }}
  12379. case 2: case -2:
  12380. LLDEBUG_ALTERNATIVE("RequiredToken", 2);
  12381. {LLSTATE llstate_1;XString llatt_1;
  12382. if (!ll_PrimitiveFieldName(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12383. *llout = llstate_1;
  12384. {(*llret) = NewSyntaxSpec(eSyntaxSpec_Field);
  12385. (*llret)->U.Field.Field = llatt_1;
  12386. break;
  12387. }}
  12388. default:
  12389. llstk[--llcstp] = 1;
  12390. goto failed1;
  12391. failed2:
  12392. LLDEBUG_BACKTRACKING("RequiredToken");
  12393. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12394. llcpos = llpos1; llcstp = llstp1;
  12395. continue;
  12396. } break;
  12397. }}
  12398. LLDEBUG_LEAVE("RequiredToken", 1);
  12399. return 1;
  12400. failed1: LLDEBUG_LEAVE("RequiredToken", 0);
  12401. return 0;
  12402. }
  12403. int ll_Literal(XString *llret, LLSTATE *llin, LLSTATE *llout)
  12404. {
  12405. unsigned llstp = llcstp;
  12406. LLSTATE llstate_0;
  12407. LLDEBUG_ENTER("Literal");
  12408. llstate_0 = *llin;
  12409. #undef failed
  12410. #define failed failed1
  12411. #undef failed
  12412. #define failed failed2
  12413. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12414. LLCHECKSTK;
  12415. for (;;) {
  12416. switch (llstk[llcstp++]) {
  12417. case 1: case -1:
  12418. LLDEBUG_ALTERNATIVE("Literal", 1);
  12419. {LLSTATE llstate_1;XString llatt_1;
  12420. if (!ll_word(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  12421. *llout = llstate_1;
  12422. {(*llret) = llatt_1;
  12423. break;
  12424. }}
  12425. case 2: case -2:
  12426. LLDEBUG_ALTERNATIVE("Literal", 2);
  12427. {LLSTATE llstate_1;
  12428. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  12429. *llout = llstate_1;
  12430. {(*llret) = ",";
  12431. break;
  12432. }}
  12433. default:
  12434. llstk[--llcstp] = 1;
  12435. goto failed1;
  12436. failed2:
  12437. LLDEBUG_BACKTRACKING("Literal");
  12438. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12439. llcpos = llpos1; llcstp = llstp1;
  12440. continue;
  12441. } break;
  12442. }}
  12443. LLDEBUG_LEAVE("Literal", 1);
  12444. return 1;
  12445. failed1: LLDEBUG_LEAVE("Literal", 0);
  12446. return 0;
  12447. }
  12448. int ll_ObjectAssignment(LLSTATE *llin, LLSTATE *llout)
  12449. {
  12450. unsigned llstp = llcstp;
  12451. LLSTATE llstate_0;
  12452. LLDEBUG_ENTER("ObjectAssignment");
  12453. llstate_0 = *llin;
  12454. #undef failed
  12455. #define failed failed1
  12456. {LLSTATE llstate_1;XObject llatt_1;
  12457. if (!ll_objectreference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  12458. {LLSTATE llstate_2;XObjectClass llatt_2;
  12459. if (!ll_DefinedObjectClass(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  12460. {LLSTATE llstate_3;
  12461. if (!llterm(T_DEF, (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  12462. {LLSTATE llstate_4;XObject llatt_4;
  12463. if (!ll_Object(&llatt_4, &llstate_3, &llstate_4, llatt_2)) goto failed1;
  12464. *llout = llstate_4;
  12465. {AssignObject(&(*llout).Assignments, llatt_1, llatt_4);
  12466. }}}}}
  12467. LLDEBUG_LEAVE("ObjectAssignment", 1);
  12468. return 1;
  12469. failed1: LLDEBUG_LEAVE("ObjectAssignment", 0);
  12470. return 0;
  12471. }
  12472. int ll_Object(XObject *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12473. {
  12474. unsigned llstp = llcstp;
  12475. LLSTATE llstate_0;
  12476. LLDEBUG_ENTER("Object");
  12477. llstate_0 = *llin;
  12478. #undef failed
  12479. #define failed failed1
  12480. #undef failed
  12481. #define failed failed2
  12482. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12483. LLCHECKSTK;
  12484. for (;;) {
  12485. switch (llstk[llcstp++]) {
  12486. case 1: case -1:
  12487. LLDEBUG_ALTERNATIVE("Object", 1);
  12488. {LLSTATE llstate_1;XObject llatt_1;
  12489. if (!ll_ObjectDefn(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12490. *llout = llstate_1;
  12491. {(*llret) = llatt_1;
  12492. break;
  12493. }}
  12494. case 2: case -2:
  12495. LLDEBUG_ALTERNATIVE("Object", 2);
  12496. {LLSTATE llstate_1;XObject llatt_1;
  12497. if (!ll_ObjectFromObject(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  12498. *llout = llstate_1;
  12499. {(*llret) = llatt_1;
  12500. break;
  12501. }}
  12502. case 3: case -3:
  12503. LLDEBUG_ALTERNATIVE("Object", 3);
  12504. {LLSTATE llstate_1;XObject llatt_1;
  12505. if (!ll_DefinedObject(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  12506. *llout = llstate_1;
  12507. {(*llret) = llatt_1;
  12508. break;
  12509. }}
  12510. case 4: case -4:
  12511. LLDEBUG_ALTERNATIVE("Object", 4);
  12512. {LLSTATE llstate_1;
  12513. if (!ll_ParameterizedObject(&llstate_0, &llstate_1)) goto failed2;
  12514. *llout = llstate_1;
  12515. {MyAbort();
  12516. break;
  12517. }}
  12518. default:
  12519. llstk[--llcstp] = 1;
  12520. goto failed1;
  12521. failed2:
  12522. LLDEBUG_BACKTRACKING("Object");
  12523. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12524. llcpos = llpos1; llcstp = llstp1;
  12525. continue;
  12526. } break;
  12527. }}
  12528. LLDEBUG_LEAVE("Object", 1);
  12529. return 1;
  12530. failed1: LLDEBUG_LEAVE("Object", 0);
  12531. return 0;
  12532. }
  12533. int ll_ObjectDefn(XObject *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12534. {
  12535. unsigned llstp = llcstp;
  12536. LLSTATE llstate_0;
  12537. LLDEBUG_ENTER("ObjectDefn");
  12538. llstate_0 = *llin;
  12539. #undef failed
  12540. #define failed failed1
  12541. #undef failed
  12542. #define failed failed2
  12543. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12544. LLCHECKSTK;
  12545. for (;;) {
  12546. switch (llstk[llcstp++]) {
  12547. case 1: case -1:
  12548. LLDEBUG_ALTERNATIVE("ObjectDefn", 1);
  12549. {LLSTATE llstate_1;XObject llatt_1;
  12550. if (!ll_DefaultSyntax(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12551. *llout = llstate_1;
  12552. {(*llret) = llatt_1;
  12553. break;
  12554. }}
  12555. case 2: case -2:
  12556. LLDEBUG_ALTERNATIVE("ObjectDefn", 2);
  12557. {LLSTATE llstate_1;XObject llatt_1;
  12558. if (!ll_DefinedSyntax(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  12559. *llout = llstate_1;
  12560. {(*llret) = llatt_1;
  12561. break;
  12562. }}
  12563. default:
  12564. llstk[--llcstp] = 1;
  12565. goto failed1;
  12566. failed2:
  12567. LLDEBUG_BACKTRACKING("ObjectDefn");
  12568. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12569. llcpos = llpos1; llcstp = llstp1;
  12570. continue;
  12571. } break;
  12572. }}
  12573. LLDEBUG_LEAVE("ObjectDefn", 1);
  12574. return 1;
  12575. failed1: LLDEBUG_LEAVE("ObjectDefn", 0);
  12576. return 0;
  12577. }
  12578. int ll_DefaultSyntax(XObject *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12579. {
  12580. unsigned llstp = llcstp;
  12581. LLSTATE llstate_0;
  12582. LLDEBUG_ENTER("DefaultSyntax");
  12583. llstate_0 = *llin;
  12584. #undef failed
  12585. #define failed failed1
  12586. {LLSTATE llstate_1;
  12587. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  12588. {LLSTATE llstate_2;XSettings llatt_2;
  12589. if (!ll_FieldSetting_EList(&llatt_2, &llstate_1, &llstate_2, llarg_oc, NULL)) goto failed1;
  12590. {LLSTATE llstate_3;
  12591. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  12592. *llout = llstate_3;
  12593. {(*llret) = NewObject(eObject_Object);
  12594. (*llret)->U.Object.ObjectClass = llarg_oc;
  12595. (*llret)->U.Object.Settings = llatt_2;
  12596. }}}}
  12597. LLDEBUG_LEAVE("DefaultSyntax", 1);
  12598. return 1;
  12599. failed1: LLDEBUG_LEAVE("DefaultSyntax", 0);
  12600. return 0;
  12601. }
  12602. int ll_FieldSetting_EList(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se)
  12603. {
  12604. unsigned llstp = llcstp;
  12605. LLSTATE llstate_0;
  12606. LLDEBUG_ENTER("FieldSetting_EList");
  12607. llstate_0 = *llin;
  12608. #undef failed
  12609. #define failed failed1
  12610. #undef failed
  12611. #define failed failed2
  12612. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12613. LLCHECKSTK;
  12614. for (;;) {
  12615. switch (llstk[llcstp++]) {
  12616. case 1: case -1:
  12617. LLDEBUG_ALTERNATIVE("FieldSetting_EList", 1);
  12618. {LLSTATE llstate_1;XSettings llatt_1;
  12619. if (!ll_FieldSetting(&llatt_1, &llstate_0, &llstate_1, llarg_oc, llarg_se)) goto failed2;
  12620. {Setting_t *s, **ss, *se;
  12621. for (s = llatt_1, ss = &se; s; s = s->Next, ss = &(*ss)->Next)
  12622. *ss = DupSetting(s);
  12623. *ss = llarg_se;
  12624. {LLSTATE llstate_2;XSettings llatt_2;
  12625. if (!ll_FieldSetting_EListC(&llatt_2, &llstate_1, &llstate_2, llarg_oc, se)) goto failed2;
  12626. *llout = llstate_2;
  12627. {for (s = llatt_1, ss = &(*llret); s; s = s->Next, ss = &(*ss)->Next)
  12628. *ss = DupSetting(s);
  12629. *ss = llatt_2;
  12630. break;
  12631. }}}}
  12632. case 2: case -2:
  12633. LLDEBUG_ALTERNATIVE("FieldSetting_EList", 2);
  12634. *llout = llstate_0;
  12635. {(*llret) = NULL;
  12636. break;
  12637. }
  12638. default:
  12639. llstk[--llcstp] = 1;
  12640. goto failed1;
  12641. failed2:
  12642. LLDEBUG_BACKTRACKING("FieldSetting_EList");
  12643. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12644. llcpos = llpos1; llcstp = llstp1;
  12645. continue;
  12646. } break;
  12647. }}
  12648. LLDEBUG_LEAVE("FieldSetting_EList", 1);
  12649. return 1;
  12650. failed1: LLDEBUG_LEAVE("FieldSetting_EList", 0);
  12651. return 0;
  12652. }
  12653. int ll_FieldSetting_EListC(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se)
  12654. {
  12655. unsigned llstp = llcstp;
  12656. LLSTATE llstate_0;
  12657. LLDEBUG_ENTER("FieldSetting_EListC");
  12658. llstate_0 = *llin;
  12659. #undef failed
  12660. #define failed failed1
  12661. #undef failed
  12662. #define failed failed2
  12663. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12664. LLCHECKSTK;
  12665. for (;;) {
  12666. switch (llstk[llcstp++]) {
  12667. case 1: case -1:
  12668. LLDEBUG_ALTERNATIVE("FieldSetting_EListC", 1);
  12669. {LLSTATE llstate_1;
  12670. if (!llterm(',', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  12671. {LLSTATE llstate_2;XSettings llatt_2;
  12672. if (!ll_FieldSetting(&llatt_2, &llstate_1, &llstate_2, llarg_oc, llarg_se)) goto failed2;
  12673. {Setting_t *s, **ss, *se;
  12674. for (s = llatt_2, ss = &se; s; s = s->Next, ss = &(*ss)->Next)
  12675. *ss = DupSetting(s);
  12676. *ss = llarg_se;
  12677. {LLSTATE llstate_3;XSettings llatt_3;
  12678. if (!ll_FieldSetting_EListC(&llatt_3, &llstate_2, &llstate_3, llarg_oc, se)) goto failed2;
  12679. *llout = llstate_3;
  12680. {for (s = llatt_2, ss = &(*llret); s; s = s->Next, ss = &(*ss)->Next)
  12681. *ss = DupSetting(s);
  12682. *ss = llatt_3;
  12683. break;
  12684. }}}}}
  12685. case 2: case -2:
  12686. LLDEBUG_ALTERNATIVE("FieldSetting_EListC", 2);
  12687. *llout = llstate_0;
  12688. {(*llret) = NULL;
  12689. break;
  12690. }
  12691. default:
  12692. llstk[--llcstp] = 1;
  12693. goto failed1;
  12694. failed2:
  12695. LLDEBUG_BACKTRACKING("FieldSetting_EListC");
  12696. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12697. llcpos = llpos1; llcstp = llstp1;
  12698. continue;
  12699. } break;
  12700. }}
  12701. LLDEBUG_LEAVE("FieldSetting_EListC", 1);
  12702. return 1;
  12703. failed1: LLDEBUG_LEAVE("FieldSetting_EListC", 0);
  12704. return 0;
  12705. }
  12706. int ll_FieldSetting(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se)
  12707. {
  12708. unsigned llstp = llcstp;
  12709. LLSTATE llstate_0;
  12710. LLDEBUG_ENTER("FieldSetting");
  12711. llstate_0 = *llin;
  12712. #undef failed
  12713. #define failed failed1
  12714. {LLSTATE llstate_1;XString llatt_1;
  12715. if (!ll_PrimitiveFieldName(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed1;
  12716. {LLSTATE llstate_2;XSettings llatt_2;
  12717. if (!ll_Setting(&llatt_2, &llstate_1, &llstate_2, llarg_oc, llarg_se, llatt_1)) goto failed1;
  12718. *llout = llstate_2;
  12719. {(*llret) = llatt_2;
  12720. }}}
  12721. LLDEBUG_LEAVE("FieldSetting", 1);
  12722. return 1;
  12723. failed1: LLDEBUG_LEAVE("FieldSetting", 0);
  12724. return 0;
  12725. }
  12726. int ll_DefinedSyntax(XObject *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  12727. {
  12728. unsigned llstp = llcstp;
  12729. LLSTATE llstate_0;
  12730. LLDEBUG_ENTER("DefinedSyntax");
  12731. llstate_0 = *llin;
  12732. #undef failed
  12733. #define failed failed1
  12734. {ObjectClass_t *oc;
  12735. SyntaxSpec_t *sy;
  12736. oc = GetObjectClass((*llin).Assignments, llarg_oc);
  12737. if (oc && !oc->U.ObjectClass.SyntaxSpec)
  12738. LLFAILED((&llstate_0.pos, "Bad settings"));
  12739. sy = oc ? oc->U.ObjectClass.SyntaxSpec : UndefSyntaxSpecs;
  12740. {LLSTATE llstate_1;
  12741. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  12742. {LLSTATE llstate_2;XSettings llatt_2;
  12743. if (!ll_DefinedSyntaxToken_ESeq(&llatt_2, &llstate_1, &llstate_2, llarg_oc, NULL, sy)) goto failed1;
  12744. {LLSTATE llstate_3;
  12745. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  12746. *llout = llstate_3;
  12747. {(*llret) = NewObject(eObject_Object);
  12748. (*llret)->U.Object.ObjectClass = llarg_oc;
  12749. (*llret)->U.Object.Settings = llatt_2;
  12750. }}}}}
  12751. LLDEBUG_LEAVE("DefinedSyntax", 1);
  12752. return 1;
  12753. failed1: LLDEBUG_LEAVE("DefinedSyntax", 0);
  12754. return 0;
  12755. }
  12756. int ll_DefinedSyntaxToken_ESeq(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se, XSyntaxSpecs llarg_sy)
  12757. {
  12758. unsigned llstp = llcstp;
  12759. LLSTATE llstate_0;
  12760. LLDEBUG_ENTER("DefinedSyntaxToken_ESeq");
  12761. llstate_0 = *llin;
  12762. #undef failed
  12763. #define failed failed1
  12764. #undef failed
  12765. #define failed failed2
  12766. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12767. LLCHECKSTK;
  12768. for (;;) {
  12769. switch (llstk[llcstp++]) {
  12770. case 1: case -1:
  12771. LLDEBUG_ALTERNATIVE("DefinedSyntaxToken_ESeq", 1);
  12772. {if (!llarg_sy)
  12773. LLFAILED((&llstate_0.pos, "Bad settings"));
  12774. {LLSTATE llstate_1;XSettings llatt_1;
  12775. if (!ll_DefinedSyntaxToken(&llatt_1, &llstate_0, &llstate_1, llarg_oc, llarg_se, llarg_sy)) goto failed2;
  12776. {Setting_t *s, **ss, *se;
  12777. for (s = llatt_1, ss = &se; s; s = s->Next, ss = &(*ss)->Next)
  12778. *ss = DupSetting(s);
  12779. *ss = llarg_se;
  12780. {LLSTATE llstate_2;XSettings llatt_2;
  12781. if (!ll_DefinedSyntaxToken_ESeq(&llatt_2, &llstate_1, &llstate_2, llarg_oc, se, DEFINED(llarg_sy) ? llarg_sy->Next : llarg_sy)) goto failed2;
  12782. *llout = llstate_2;
  12783. {for (s = llatt_1, ss = &(*llret); s; s = s->Next, ss = &(*ss)->Next)
  12784. *ss = DupSetting(s);
  12785. *ss = llatt_2;
  12786. break;
  12787. }}}}}
  12788. case 2: case -2:
  12789. LLDEBUG_ALTERNATIVE("DefinedSyntaxToken_ESeq", 2);
  12790. *llout = llstate_0;
  12791. {if (DEFINED(llarg_sy))
  12792. LLFAILED((&llstate_0.pos, "Bad settings"));
  12793. (*llret) = NULL;
  12794. break;
  12795. }
  12796. default:
  12797. llstk[--llcstp] = 1;
  12798. goto failed1;
  12799. failed2:
  12800. LLDEBUG_BACKTRACKING("DefinedSyntaxToken_ESeq");
  12801. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12802. llcpos = llpos1; llcstp = llstp1;
  12803. continue;
  12804. } break;
  12805. }}
  12806. LLDEBUG_LEAVE("DefinedSyntaxToken_ESeq", 1);
  12807. return 1;
  12808. failed1: LLDEBUG_LEAVE("DefinedSyntaxToken_ESeq", 0);
  12809. return 0;
  12810. }
  12811. int ll_DefinedSyntaxToken(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se, XSyntaxSpecs llarg_sy)
  12812. {
  12813. unsigned llstp = llcstp;
  12814. LLSTATE llstate_0;
  12815. LLDEBUG_ENTER("DefinedSyntaxToken");
  12816. llstate_0 = *llin;
  12817. #undef failed
  12818. #define failed failed1
  12819. #undef failed
  12820. #define failed failed2
  12821. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12822. LLCHECKSTK;
  12823. for (;;) {
  12824. switch (llstk[llcstp++]) {
  12825. case 1: case -1:
  12826. LLDEBUG_ALTERNATIVE("DefinedSyntaxToken", 1);
  12827. {if (!DEFINED(llarg_sy) || llarg_sy->Type != eSyntaxSpec_Optional)
  12828. LLFAILED((&llstate_0.pos, "Bad settings"));
  12829. {LLSTATE llstate_1;XSettings llatt_1;
  12830. if (!ll_DefinedSyntaxToken_ESeq(&llatt_1, &llstate_0, &llstate_1, llarg_oc, llarg_se, llarg_sy->U.Optional.SyntaxSpec)) goto failed2;
  12831. *llout = llstate_1;
  12832. {(*llret) = llatt_1;
  12833. break;
  12834. }}}
  12835. case 2: case -2:
  12836. LLDEBUG_ALTERNATIVE("DefinedSyntaxToken", 2);
  12837. *llout = llstate_0;
  12838. {if (!DEFINED(llarg_sy) || llarg_sy->Type != eSyntaxSpec_Optional)
  12839. LLFAILED((&llstate_0.pos, "Bad settings"));
  12840. {(*llret) = NULL;
  12841. break;
  12842. }}
  12843. case 3: case -3:
  12844. LLDEBUG_ALTERNATIVE("DefinedSyntaxToken", 3);
  12845. {if (DEFINED(llarg_sy) && llarg_sy->Type == eSyntaxSpec_Optional)
  12846. LLFAILED((&llstate_0.pos, "Bad settings"));
  12847. {LLSTATE llstate_1;XSettings llatt_1;
  12848. if (!ll_DefinedSyntaxToken_Elem(&llatt_1, &llstate_0, &llstate_1, llarg_oc, llarg_se, llarg_sy)) goto failed2;
  12849. *llout = llstate_1;
  12850. {(*llret) = llatt_1;
  12851. break;
  12852. }}}
  12853. default:
  12854. llstk[--llcstp] = 1;
  12855. goto failed1;
  12856. failed2:
  12857. LLDEBUG_BACKTRACKING("DefinedSyntaxToken");
  12858. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12859. llcpos = llpos1; llcstp = llstp1;
  12860. continue;
  12861. } break;
  12862. }}
  12863. LLDEBUG_LEAVE("DefinedSyntaxToken", 1);
  12864. return 1;
  12865. failed1: LLDEBUG_LEAVE("DefinedSyntaxToken", 0);
  12866. return 0;
  12867. }
  12868. int ll_DefinedSyntaxToken_Elem(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se, XSyntaxSpecs llarg_sy)
  12869. {
  12870. unsigned llstp = llcstp;
  12871. LLSTATE llstate_0;
  12872. LLDEBUG_ENTER("DefinedSyntaxToken_Elem");
  12873. llstate_0 = *llin;
  12874. #undef failed
  12875. #define failed failed1
  12876. #undef failed
  12877. #define failed failed2
  12878. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12879. LLCHECKSTK;
  12880. for (;;) {
  12881. switch (llstk[llcstp++]) {
  12882. case 1: case -1:
  12883. LLDEBUG_ALTERNATIVE("DefinedSyntaxToken_Elem", 1);
  12884. {if (!llarg_sy || (DEFINED(llarg_sy) && llarg_sy->Type != eSyntaxSpec_Literal))
  12885. LLFAILED((&llstate_0.pos, "Bad settings"));
  12886. {LLSTATE llstate_1;XString llatt_1;
  12887. if (!ll_Literal(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  12888. *llout = llstate_1;
  12889. {if (DEFINED(llarg_sy) && strcmp(llarg_sy->U.Literal.Literal, llatt_1))
  12890. LLFAILED((&llstate_0.pos, "Bad settings"));
  12891. (*llret) = NULL;
  12892. break;
  12893. }}}
  12894. case 2: case -2:
  12895. LLDEBUG_ALTERNATIVE("DefinedSyntaxToken_Elem", 2);
  12896. {if (!llarg_sy || (DEFINED(llarg_sy) && llarg_sy->Type != eSyntaxSpec_Field))
  12897. LLFAILED((&llstate_0.pos, "Bad settings"));
  12898. {LLSTATE llstate_1;XSettings llatt_1;
  12899. if (!ll_Setting(&llatt_1, &llstate_0, &llstate_1, llarg_oc, llarg_se, DEFINED(llarg_sy) ? llarg_sy->U.Field.Field : NULL)) goto failed2;
  12900. *llout = llstate_1;
  12901. {(*llret) = llatt_1;
  12902. break;
  12903. }}}
  12904. default:
  12905. llstk[--llcstp] = 1;
  12906. goto failed1;
  12907. failed2:
  12908. LLDEBUG_BACKTRACKING("DefinedSyntaxToken_Elem");
  12909. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  12910. llcpos = llpos1; llcstp = llstp1;
  12911. continue;
  12912. } break;
  12913. }}
  12914. LLDEBUG_LEAVE("DefinedSyntaxToken_Elem", 1);
  12915. return 1;
  12916. failed1: LLDEBUG_LEAVE("DefinedSyntaxToken_Elem", 0);
  12917. return 0;
  12918. }
  12919. int ll_Setting(XSettings *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc, XSettings llarg_se, XString llarg_f)
  12920. {
  12921. unsigned llstp = llcstp;
  12922. LLSTATE llstate_0;
  12923. LLDEBUG_ENTER("Setting");
  12924. llstate_0 = *llin;
  12925. #undef failed
  12926. #define failed failed1
  12927. #undef failed
  12928. #define failed failed2
  12929. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  12930. LLCHECKSTK;
  12931. for (;;) {
  12932. switch (llstk[llcstp++]) {
  12933. case 1: case -1:
  12934. LLDEBUG_ALTERNATIVE("Setting", 1);
  12935. {FieldSpec_t *fs;
  12936. FieldSpecs_e fe;
  12937. fs = GetObjectClassField((*llin).Assignments, llarg_oc, llarg_f);
  12938. fe = GetFieldSpecType((*llin).Assignments, fs);
  12939. if (fe != eFieldSpec_Undefined &&
  12940. fe != eFieldSpec_Type)
  12941. LLFAILED((&llstate_0.pos, "Bad setting"));
  12942. {LLSTATE llstate_1;XType llatt_1;
  12943. if (!ll_Type(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  12944. *llout = llstate_1;
  12945. {(*llret) = NewSetting(eSetting_Type);
  12946. (*llret)->Identifier = llarg_f;
  12947. (*llret)->U.Type.Type = llatt_1;
  12948. break;
  12949. }}}
  12950. case 2: case -2:
  12951. LLDEBUG_ALTERNATIVE("Setting", 2);
  12952. {Type_t *type;
  12953. FieldSpec_t *fs;
  12954. FieldSpecs_e fe;
  12955. Setting_t *se;
  12956. fs = GetObjectClassField((*llin).Assignments, llarg_oc, llarg_f);
  12957. fe = GetFieldSpecType((*llin).Assignments, fs);
  12958. if (fe != eFieldSpec_Undefined &&
  12959. fe != eFieldSpec_FixedTypeValue &&
  12960. fe != eFieldSpec_VariableTypeValue)
  12961. LLFAILED((&llstate_0.pos, "Bad setting"));
  12962. if (fe == eFieldSpec_FixedTypeValue) {
  12963. type = fs->U.FixedTypeValue.Type;
  12964. } else if (fe == eFieldSpec_VariableTypeValue) {
  12965. se = GetSettingFromSettings((*llin).Assignments, llarg_se,
  12966. fs->U.VariableTypeValue.Fields);
  12967. if (GetSettingType(se) != eSetting_Type &&
  12968. GetSettingType(se) != eSetting_Undefined)
  12969. MyAbort();
  12970. if (GetSettingType(se) == eSetting_Type)
  12971. type = se->U.Type.Type;
  12972. else
  12973. type = NULL;
  12974. } else {
  12975. type = NULL;
  12976. }
  12977. {LLSTATE llstate_1;XValue llatt_1;
  12978. if (!ll_Value(&llatt_1, &llstate_0, &llstate_1, type)) goto failed2;
  12979. *llout = llstate_1;
  12980. {if (type) {
  12981. (*llret) = NewSetting(eSetting_Value);
  12982. (*llret)->Identifier = llarg_f;
  12983. (*llret)->U.Value.Value = llatt_1;
  12984. } else {
  12985. (*llret) = NULL;
  12986. }
  12987. break;
  12988. }}}
  12989. case 3: case -3:
  12990. LLDEBUG_ALTERNATIVE("Setting", 3);
  12991. {Type_t *type;
  12992. FieldSpec_t *fs;
  12993. FieldSpecs_e fe;
  12994. Setting_t *se;
  12995. fs = GetObjectClassField((*llin).Assignments, llarg_oc, llarg_f);
  12996. fe = GetFieldSpecType((*llin).Assignments, fs);
  12997. if (fe != eFieldSpec_Undefined &&
  12998. fe != eFieldSpec_FixedTypeValueSet &&
  12999. fe != eFieldSpec_VariableTypeValueSet)
  13000. LLFAILED((&llstate_0.pos, "Bad setting"));
  13001. if (fe == eFieldSpec_FixedTypeValueSet) {
  13002. type = fs->U.FixedTypeValueSet.Type;
  13003. } else if (fe == eFieldSpec_VariableTypeValueSet) {
  13004. se = GetSettingFromSettings((*llin).Assignments, llarg_se,
  13005. fs->U.VariableTypeValueSet.Fields);
  13006. if (GetSettingType(se) != eSetting_Type &&
  13007. GetSettingType(se) != eSetting_Undefined)
  13008. MyAbort();
  13009. if (GetSettingType(se) == eSetting_Type)
  13010. type = se->U.Type.Type;
  13011. else
  13012. type = NULL;
  13013. } else {
  13014. type = NULL;
  13015. }
  13016. {LLSTATE llstate_1;XValueSet llatt_1;
  13017. if (!ll_ValueSet(&llatt_1, &llstate_0, &llstate_1, type)) goto failed2;
  13018. *llout = llstate_1;
  13019. {if (type) {
  13020. (*llret) = NewSetting(eSetting_ValueSet);
  13021. (*llret)->Identifier = llarg_f;
  13022. (*llret)->U.ValueSet.ValueSet = llatt_1;
  13023. } else {
  13024. (*llret) = NULL;
  13025. }
  13026. break;
  13027. }}}
  13028. case 4: case -4:
  13029. LLDEBUG_ALTERNATIVE("Setting", 4);
  13030. {ObjectClass_t *oc;
  13031. FieldSpec_t *fs;
  13032. FieldSpecs_e fe;
  13033. fs = GetObjectClassField((*llin).Assignments, llarg_oc, llarg_f);
  13034. fe = GetFieldSpecType((*llin).Assignments, fs);
  13035. if (fe != eFieldSpec_Undefined &&
  13036. fe != eFieldSpec_Object)
  13037. LLFAILED((&llstate_0.pos, "Bad setting"));
  13038. if (fe == eFieldSpec_Object)
  13039. oc = fs->U.Object.ObjectClass;
  13040. else
  13041. oc = NULL;
  13042. {LLSTATE llstate_1;XObject llatt_1;
  13043. if (!ll_Object(&llatt_1, &llstate_0, &llstate_1, oc)) goto failed2;
  13044. *llout = llstate_1;
  13045. {(*llret) = NewSetting(eSetting_Object);
  13046. (*llret)->Identifier = llarg_f;
  13047. (*llret)->U.Object.Object = llatt_1;
  13048. break;
  13049. }}}
  13050. case 5: case -5:
  13051. LLDEBUG_ALTERNATIVE("Setting", 5);
  13052. {ObjectClass_t *oc;
  13053. FieldSpec_t *fs;
  13054. FieldSpecs_e fe;
  13055. fs = GetObjectClassField((*llin).Assignments, llarg_oc, llarg_f);
  13056. fe = GetFieldSpecType((*llin).Assignments, fs);
  13057. if (fe != eFieldSpec_Undefined &&
  13058. fe != eFieldSpec_ObjectSet)
  13059. LLFAILED((&llstate_0.pos, "Bad setting"));
  13060. if (fe == eFieldSpec_ObjectSet)
  13061. oc = fs->U.ObjectSet.ObjectClass;
  13062. else
  13063. oc = NULL;
  13064. {LLSTATE llstate_1;XObjectSet llatt_1;
  13065. if (!ll_ObjectSet(&llatt_1, &llstate_0, &llstate_1, oc)) goto failed2;
  13066. *llout = llstate_1;
  13067. {(*llret) = NewSetting(eSetting_ObjectSet);
  13068. (*llret)->Identifier = llarg_f;
  13069. (*llret)->U.ObjectSet.ObjectSet = llatt_1;
  13070. break;
  13071. }}}
  13072. default:
  13073. llstk[--llcstp] = 1;
  13074. goto failed1;
  13075. failed2:
  13076. LLDEBUG_BACKTRACKING("Setting");
  13077. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  13078. llcpos = llpos1; llcstp = llstp1;
  13079. continue;
  13080. } break;
  13081. }}
  13082. LLDEBUG_LEAVE("Setting", 1);
  13083. return 1;
  13084. failed1: LLDEBUG_LEAVE("Setting", 0);
  13085. return 0;
  13086. }
  13087. int ll_ObjectSetAssignment(LLSTATE *llin, LLSTATE *llout)
  13088. {
  13089. unsigned llstp = llcstp;
  13090. LLSTATE llstate_0;
  13091. LLDEBUG_ENTER("ObjectSetAssignment");
  13092. llstate_0 = *llin;
  13093. #undef failed
  13094. #define failed failed1
  13095. {LLSTATE llstate_1;XObjectSet llatt_1;
  13096. if (!ll_objectsetreference(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  13097. {LLSTATE llstate_2;XObjectClass llatt_2;
  13098. if (!ll_DefinedObjectClass(&llatt_2, &llstate_1, &llstate_2)) goto failed1;
  13099. {LLSTATE llstate_3;
  13100. if (!llterm(T_DEF, (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  13101. {LLSTATE llstate_4;XObjectSet llatt_4;
  13102. if (!ll_ObjectSet(&llatt_4, &llstate_3, &llstate_4, llatt_2)) goto failed1;
  13103. *llout = llstate_4;
  13104. {AssignObjectSet(&(*llout).Assignments, llatt_1, llatt_4);
  13105. }}}}}
  13106. LLDEBUG_LEAVE("ObjectSetAssignment", 1);
  13107. return 1;
  13108. failed1: LLDEBUG_LEAVE("ObjectSetAssignment", 0);
  13109. return 0;
  13110. }
  13111. int ll_ObjectSet(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  13112. {
  13113. unsigned llstp = llcstp;
  13114. LLSTATE llstate_0;
  13115. LLDEBUG_ENTER("ObjectSet");
  13116. llstate_0 = *llin;
  13117. #undef failed
  13118. #define failed failed1
  13119. {LLSTATE llstate_1;
  13120. if (!llterm('{', (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13121. {LLSTATE llstate_2;XObjectSet llatt_2;
  13122. if (!ll_ObjectSetSpec(&llatt_2, &llstate_1, &llstate_2, llarg_oc)) goto failed1;
  13123. {LLSTATE llstate_3;
  13124. if (!llterm('}', (LLSTYPE *)0, &llstate_2, &llstate_3)) goto failed1;
  13125. *llout = llstate_3;
  13126. {(*llret) = llatt_2;
  13127. }}}}
  13128. LLDEBUG_LEAVE("ObjectSet", 1);
  13129. return 1;
  13130. failed1: LLDEBUG_LEAVE("ObjectSet", 0);
  13131. return 0;
  13132. }
  13133. int ll_ObjectSetSpec(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  13134. {
  13135. unsigned llstp = llcstp;
  13136. LLSTATE llstate_0;
  13137. LLDEBUG_ENTER("ObjectSetSpec");
  13138. llstate_0 = *llin;
  13139. #undef failed
  13140. #define failed failed1
  13141. #undef failed
  13142. #define failed failed2
  13143. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  13144. LLCHECKSTK;
  13145. for (;;) {
  13146. switch (llstk[llcstp++]) {
  13147. case 1: case -1:
  13148. LLDEBUG_ALTERNATIVE("ObjectSetSpec", 1);
  13149. {LLSTATE llstate_1;XElementSetSpec llatt_1;
  13150. if (!ll_ElementSetSpec(&llatt_1, &llstate_0, &llstate_1, NULL, llarg_oc, 0)) goto failed2;
  13151. *llout = llstate_1;
  13152. {(*llret) = NewObjectSet(eObjectSet_ObjectSet);
  13153. (*llret)->U.ObjectSet.ObjectClass = llarg_oc;
  13154. (*llret)->U.ObjectSet.Elements = llatt_1;
  13155. break;
  13156. }}
  13157. case 2: case -2:
  13158. LLDEBUG_ALTERNATIVE("ObjectSetSpec", 2);
  13159. {LLSTATE llstate_1;
  13160. if (!llterm(T_TDOT, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed2;
  13161. *llout = llstate_1;
  13162. {(*llret) = NewObjectSet(eObjectSet_ExtensionMarker);
  13163. (*llret)->U.ExtensionMarker.ObjectClass = llarg_oc;
  13164. break;
  13165. }}
  13166. default:
  13167. llstk[--llcstp] = 1;
  13168. goto failed1;
  13169. failed2:
  13170. LLDEBUG_BACKTRACKING("ObjectSetSpec");
  13171. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  13172. llcpos = llpos1; llcstp = llstp1;
  13173. continue;
  13174. } break;
  13175. }}
  13176. LLDEBUG_LEAVE("ObjectSetSpec", 1);
  13177. return 1;
  13178. failed1: LLDEBUG_LEAVE("ObjectSetSpec", 0);
  13179. return 0;
  13180. }
  13181. int ll_ObjectSetElements(XObjectSetElement *llret, LLSTATE *llin, LLSTATE *llout, XObjectClass llarg_oc)
  13182. {
  13183. unsigned llstp = llcstp;
  13184. LLSTATE llstate_0;
  13185. LLDEBUG_ENTER("ObjectSetElements");
  13186. llstate_0 = *llin;
  13187. #undef failed
  13188. #define failed failed1
  13189. #undef failed
  13190. #define failed failed2
  13191. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  13192. LLCHECKSTK;
  13193. for (;;) {
  13194. switch (llstk[llcstp++]) {
  13195. case 1: case -1:
  13196. LLDEBUG_ALTERNATIVE("ObjectSetElements", 1);
  13197. {LLSTATE llstate_1;XObjectSet llatt_1;
  13198. if (!ll_ObjectSetFromObjects(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13199. *llout = llstate_1;
  13200. {(*llret) = NewObjectSetElement(eObjectSetElement_ObjectSet);
  13201. (*llret)->U.ObjectSet.ObjectSet = llatt_1;
  13202. break;
  13203. }}
  13204. case 2: case -2:
  13205. LLDEBUG_ALTERNATIVE("ObjectSetElements", 2);
  13206. {LLSTATE llstate_1;XObject llatt_1;
  13207. if (!ll_Object(&llatt_1, &llstate_0, &llstate_1, llarg_oc)) goto failed2;
  13208. *llout = llstate_1;
  13209. {(*llret) = NewObjectSetElement(eObjectSetElement_Object);
  13210. (*llret)->U.Object.Object = llatt_1;
  13211. break;
  13212. }}
  13213. case 3: case -3:
  13214. LLDEBUG_ALTERNATIVE("ObjectSetElements", 3);
  13215. {LLSTATE llstate_1;XObjectSet llatt_1;
  13216. if (!ll_DefinedObjectSet(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13217. *llout = llstate_1;
  13218. {(*llret) = NewObjectSetElement(eObjectSetElement_ObjectSet);
  13219. (*llret)->U.ObjectSet.ObjectSet = llatt_1;
  13220. break;
  13221. }}
  13222. case 4: case -4:
  13223. LLDEBUG_ALTERNATIVE("ObjectSetElements", 4);
  13224. {LLSTATE llstate_1;
  13225. if (!ll_ParameterizedObjectSet(&llstate_0, &llstate_1)) goto failed2;
  13226. *llout = llstate_1;
  13227. {MyAbort();
  13228. break;
  13229. }}
  13230. default:
  13231. llstk[--llcstp] = 1;
  13232. goto failed1;
  13233. failed2:
  13234. LLDEBUG_BACKTRACKING("ObjectSetElements");
  13235. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  13236. llcpos = llpos1; llcstp = llstp1;
  13237. continue;
  13238. } break;
  13239. }}
  13240. LLDEBUG_LEAVE("ObjectSetElements", 1);
  13241. return 1;
  13242. failed1: LLDEBUG_LEAVE("ObjectSetElements", 0);
  13243. return 0;
  13244. }
  13245. int ll_ObjectClassFieldType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  13246. {
  13247. unsigned llstp = llcstp;
  13248. LLSTATE llstate_0;
  13249. LLDEBUG_ENTER("ObjectClassFieldType");
  13250. llstate_0 = *llin;
  13251. #undef failed
  13252. #define failed failed1
  13253. {LLSTATE llstate_1;XObjectClass llatt_1;
  13254. if (!ll_DefinedObjectClass(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  13255. {LLSTATE llstate_2;
  13256. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  13257. {LLSTATE llstate_3;XStrings llatt_3;
  13258. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, llatt_1)) goto failed1;
  13259. *llout = llstate_3;
  13260. {FieldSpec_t *fs;
  13261. fs = GetFieldSpecFromObjectClass((*llout).Assignments, llatt_1, llatt_3);
  13262. if (!fs) {
  13263. (*llret) = NewType(eType_Undefined);
  13264. } else {
  13265. switch (fs->Type) {
  13266. case eFieldSpec_Type:
  13267. case eFieldSpec_VariableTypeValue:
  13268. case eFieldSpec_VariableTypeValueSet:
  13269. (*llret) = NewType(eType_Open);
  13270. break;
  13271. case eFieldSpec_FixedTypeValue:
  13272. (*llret) = fs->U.FixedTypeValue.Type;
  13273. break;
  13274. case eFieldSpec_FixedTypeValueSet:
  13275. (*llret) = fs->U.FixedTypeValueSet.Type;
  13276. break;
  13277. case eFieldSpec_Object:
  13278. LLFAILED((&llstate_1.pos, "Object field not permitted"));
  13279. /*NOTREACHED*/
  13280. case eFieldSpec_ObjectSet:
  13281. LLFAILED((&llstate_1.pos, "ObjectSet field not permitted"));
  13282. /*NOTREACHED*/
  13283. default:
  13284. MyAbort();
  13285. }
  13286. }
  13287. }}}}
  13288. LLDEBUG_LEAVE("ObjectClassFieldType", 1);
  13289. return 1;
  13290. failed1: LLDEBUG_LEAVE("ObjectClassFieldType", 0);
  13291. return 0;
  13292. }
  13293. int ll_ObjectClassFieldValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  13294. {
  13295. unsigned llstp = llcstp;
  13296. LLSTATE llstate_0;
  13297. LLDEBUG_ENTER("ObjectClassFieldValue");
  13298. llstate_0 = *llin;
  13299. #undef failed
  13300. #define failed failed1
  13301. #undef failed
  13302. #define failed failed2
  13303. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  13304. LLCHECKSTK;
  13305. for (;;) {
  13306. switch (llstk[llcstp++]) {
  13307. case 1: case -1:
  13308. LLDEBUG_ALTERNATIVE("ObjectClassFieldValue", 1);
  13309. {LLSTATE llstate_1;XValue llatt_1;
  13310. if (!ll_OpenTypeFieldVal(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13311. *llout = llstate_1;
  13312. {(*llret) = llatt_1;
  13313. break;
  13314. }}
  13315. case 2: case -2:
  13316. LLDEBUG_ALTERNATIVE("ObjectClassFieldValue", 2);
  13317. {LLSTATE llstate_1;XValue llatt_1;
  13318. if (!ll_FixedTypeFieldVal(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  13319. *llout = llstate_1;
  13320. {(*llret) = llatt_1;
  13321. break;
  13322. }}
  13323. default:
  13324. llstk[--llcstp] = 1;
  13325. goto failed1;
  13326. failed2:
  13327. LLDEBUG_BACKTRACKING("ObjectClassFieldValue");
  13328. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  13329. llcpos = llpos1; llcstp = llstp1;
  13330. continue;
  13331. } break;
  13332. }}
  13333. LLDEBUG_LEAVE("ObjectClassFieldValue", 1);
  13334. return 1;
  13335. failed1: LLDEBUG_LEAVE("ObjectClassFieldValue", 0);
  13336. return 0;
  13337. }
  13338. int ll_OpenTypeFieldVal(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  13339. {
  13340. unsigned llstp = llcstp;
  13341. LLSTATE llstate_0;
  13342. LLDEBUG_ENTER("OpenTypeFieldVal");
  13343. llstate_0 = *llin;
  13344. #undef failed
  13345. #define failed failed1
  13346. {LLSTATE llstate_1;XType llatt_1;
  13347. if (!ll_Type(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  13348. {LLSTATE llstate_2;
  13349. if (!llterm(':', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  13350. {LLSTATE llstate_3;XValue llatt_3;
  13351. if (!ll_Value(&llatt_3, &llstate_2, &llstate_3, llatt_1)) goto failed1;
  13352. *llout = llstate_3;
  13353. {(*llret) = llatt_3;
  13354. }}}}
  13355. LLDEBUG_LEAVE("OpenTypeFieldVal", 1);
  13356. return 1;
  13357. failed1: LLDEBUG_LEAVE("OpenTypeFieldVal", 0);
  13358. return 0;
  13359. }
  13360. int ll_FixedTypeFieldVal(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  13361. {
  13362. unsigned llstp = llcstp;
  13363. LLSTATE llstate_0;
  13364. LLDEBUG_ENTER("FixedTypeFieldVal");
  13365. llstate_0 = *llin;
  13366. #undef failed
  13367. #define failed failed1
  13368. #undef failed
  13369. #define failed failed2
  13370. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  13371. LLCHECKSTK;
  13372. for (;;) {
  13373. switch (llstk[llcstp++]) {
  13374. case 1: case -1:
  13375. LLDEBUG_ALTERNATIVE("FixedTypeFieldVal", 1);
  13376. {LLSTATE llstate_1;XValue llatt_1;
  13377. if (!ll_BuiltinValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed2;
  13378. *llout = llstate_1;
  13379. {(*llret) = llatt_1;
  13380. break;
  13381. }}
  13382. case 2: case -2:
  13383. LLDEBUG_ALTERNATIVE("FixedTypeFieldVal", 2);
  13384. {LLSTATE llstate_1;XValue llatt_1;
  13385. if (!ll_ReferencedValue(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13386. *llout = llstate_1;
  13387. {(*llret) = llatt_1;
  13388. break;
  13389. }}
  13390. default:
  13391. llstk[--llcstp] = 1;
  13392. goto failed1;
  13393. failed2:
  13394. LLDEBUG_BACKTRACKING("FixedTypeFieldVal");
  13395. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  13396. llcpos = llpos1; llcstp = llstp1;
  13397. continue;
  13398. } break;
  13399. }}
  13400. LLDEBUG_LEAVE("FixedTypeFieldVal", 1);
  13401. return 1;
  13402. failed1: LLDEBUG_LEAVE("FixedTypeFieldVal", 0);
  13403. return 0;
  13404. }
  13405. int ll_ValueFromObject(XValue *llret, LLSTATE *llin, LLSTATE *llout)
  13406. {
  13407. unsigned llstp = llcstp;
  13408. LLSTATE llstate_0;
  13409. LLDEBUG_ENTER("ValueFromObject");
  13410. llstate_0 = *llin;
  13411. #undef failed
  13412. #define failed failed1
  13413. {LLSTATE llstate_1;XObject llatt_1;
  13414. if (!ll_ReferencedObjects(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  13415. {LLSTATE llstate_2;
  13416. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  13417. {Object_t *o;
  13418. ObjectClass_t *oc;
  13419. o = GetObject(llstate_2.Assignments, llatt_1);
  13420. oc = o ? o->U.Object.ObjectClass : NULL;
  13421. {LLSTATE llstate_3;XStrings llatt_3;
  13422. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, oc)) goto failed1;
  13423. *llout = llstate_3;
  13424. {FieldSpec_t *fs;
  13425. FieldSpecs_e fe;
  13426. fs = GetFieldSpecFromObjectClass((*llout).Assignments, oc, llatt_3);
  13427. fe = GetFieldSpecType((*llout).Assignments, fs);
  13428. if (fe != eFieldSpec_Undefined &&
  13429. fe != eFieldSpec_FixedTypeValue &&
  13430. fe != eFieldSpec_VariableTypeValue)
  13431. LLFAILED((&llstate_2.pos, "Bad field type"));
  13432. if (fe != eFieldSpec_Undefined) {
  13433. (*llret) = GetValueFromObject((*llout).Assignments, llatt_1, llatt_3);
  13434. } else {
  13435. (*llret) = NULL;
  13436. }
  13437. }}}}}
  13438. LLDEBUG_LEAVE("ValueFromObject", 1);
  13439. return 1;
  13440. failed1: LLDEBUG_LEAVE("ValueFromObject", 0);
  13441. return 0;
  13442. }
  13443. int ll_ValueSetFromObjects(XValueSet *llret, LLSTATE *llin, LLSTATE *llout)
  13444. {
  13445. unsigned llstp = llcstp;
  13446. LLSTATE llstate_0;
  13447. LLDEBUG_ENTER("ValueSetFromObjects");
  13448. llstate_0 = *llin;
  13449. #undef failed
  13450. #define failed failed1
  13451. #undef failed
  13452. #define failed failed2
  13453. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  13454. LLCHECKSTK;
  13455. for (;;) {
  13456. switch (llstk[llcstp++]) {
  13457. case 1: case -1:
  13458. LLDEBUG_ALTERNATIVE("ValueSetFromObjects", 1);
  13459. {LLSTATE llstate_1;XObject llatt_1;
  13460. if (!ll_ReferencedObjects(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13461. {LLSTATE llstate_2;
  13462. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  13463. {Object_t *o;
  13464. ObjectClass_t *oc;
  13465. o = GetObject(llstate_2.Assignments, llatt_1);
  13466. oc = o ? o->U.Object.ObjectClass : NULL;
  13467. {LLSTATE llstate_3;XStrings llatt_3;
  13468. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, oc)) goto failed2;
  13469. *llout = llstate_3;
  13470. {FieldSpec_t *fs;
  13471. FieldSpecs_e fe;
  13472. fs = GetFieldSpecFromObjectClass((*llout).Assignments, oc, llatt_3);
  13473. fe = GetFieldSpecType((*llout).Assignments, fs);
  13474. if (fe != eFieldSpec_Undefined &&
  13475. fe != eFieldSpec_FixedTypeValueSet &&
  13476. fe != eFieldSpec_VariableTypeValueSet)
  13477. LLFAILED((&llstate_2.pos, "Bad field type"));
  13478. if (fe != eFieldSpec_Undefined) {
  13479. (*llret) = GetValueSetFromObject((*llout).Assignments, llatt_1, llatt_3);
  13480. } else {
  13481. (*llret) = NULL;
  13482. }
  13483. break;
  13484. }}}}}
  13485. case 2: case -2:
  13486. LLDEBUG_ALTERNATIVE("ValueSetFromObjects", 2);
  13487. {LLSTATE llstate_1;XObjectSet llatt_1;
  13488. if (!ll_ReferencedObjectSets(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13489. {LLSTATE llstate_2;
  13490. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  13491. {ObjectSet_t *os;
  13492. ObjectClass_t *oc;
  13493. os = GetObjectSet(llstate_2.Assignments, llatt_1);
  13494. oc = os && os->Type == eObjectSet_ObjectSet ?
  13495. os->U.ObjectSet.ObjectClass : NULL;
  13496. {LLSTATE llstate_3;XStrings llatt_3;
  13497. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, oc)) goto failed2;
  13498. *llout = llstate_3;
  13499. {FieldSpec_t *fs;
  13500. FieldSpecs_e fe;
  13501. fs = GetFieldSpecFromObjectClass((*llout).Assignments, oc, llatt_3);
  13502. fe = GetFieldSpecType((*llout).Assignments, fs);
  13503. if (fe != eFieldSpec_Undefined &&
  13504. fe != eFieldSpec_FixedTypeValue &&
  13505. fe != eFieldSpec_FixedTypeValueSet)
  13506. LLFAILED((&llstate_2.pos, "Bad field type"));
  13507. if (fe != eFieldSpec_Undefined) {
  13508. (*llret) = GetValueSetFromObjectSet((*llout).Assignments, llatt_1, llatt_3);
  13509. } else {
  13510. (*llret) = NULL;
  13511. }
  13512. break;
  13513. }}}}}
  13514. default:
  13515. llstk[--llcstp] = 1;
  13516. goto failed1;
  13517. failed2:
  13518. LLDEBUG_BACKTRACKING("ValueSetFromObjects");
  13519. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  13520. llcpos = llpos1; llcstp = llstp1;
  13521. continue;
  13522. } break;
  13523. }}
  13524. LLDEBUG_LEAVE("ValueSetFromObjects", 1);
  13525. return 1;
  13526. failed1: LLDEBUG_LEAVE("ValueSetFromObjects", 0);
  13527. return 0;
  13528. }
  13529. int ll_TypeFromObject(XType *llret, LLSTATE *llin, LLSTATE *llout)
  13530. {
  13531. unsigned llstp = llcstp;
  13532. LLSTATE llstate_0;
  13533. LLDEBUG_ENTER("TypeFromObject");
  13534. llstate_0 = *llin;
  13535. #undef failed
  13536. #define failed failed1
  13537. {LLSTATE llstate_1;XObject llatt_1;
  13538. if (!ll_ReferencedObjects(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  13539. {LLSTATE llstate_2;
  13540. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  13541. {Object_t *o;
  13542. ObjectClass_t *oc;
  13543. o = GetObject(llstate_2.Assignments, llatt_1);
  13544. oc = o ? o->U.Object.ObjectClass : NULL;
  13545. {LLSTATE llstate_3;XStrings llatt_3;
  13546. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, oc)) goto failed1;
  13547. *llout = llstate_3;
  13548. {FieldSpec_t *fs;
  13549. FieldSpecs_e fe;
  13550. fs = GetFieldSpecFromObjectClass((*llout).Assignments, oc, llatt_3);
  13551. fe = GetFieldSpecType((*llout).Assignments, fs);
  13552. if (fe != eFieldSpec_Undefined &&
  13553. fe != eFieldSpec_Type)
  13554. LLFAILED((&llstate_2.pos, "Bad field type"));
  13555. if (fe != eFieldSpec_Undefined)
  13556. (*llret) = GetTypeFromObject((*llout).Assignments, llatt_1, llatt_3);
  13557. else
  13558. (*llret) = NULL;
  13559. }}}}}
  13560. LLDEBUG_LEAVE("TypeFromObject", 1);
  13561. return 1;
  13562. failed1: LLDEBUG_LEAVE("TypeFromObject", 0);
  13563. return 0;
  13564. }
  13565. int ll_ObjectFromObject(XObject *llret, LLSTATE *llin, LLSTATE *llout)
  13566. {
  13567. unsigned llstp = llcstp;
  13568. LLSTATE llstate_0;
  13569. LLDEBUG_ENTER("ObjectFromObject");
  13570. llstate_0 = *llin;
  13571. #undef failed
  13572. #define failed failed1
  13573. {LLSTATE llstate_1;XObject llatt_1;
  13574. if (!ll_ReferencedObjects(&llatt_1, &llstate_0, &llstate_1)) goto failed1;
  13575. {LLSTATE llstate_2;
  13576. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  13577. {Object_t *o;
  13578. ObjectClass_t *oc;
  13579. o = GetObject(llstate_2.Assignments, llatt_1);
  13580. oc = o ? o->U.Object.ObjectClass : NULL;
  13581. {LLSTATE llstate_3;XStrings llatt_3;
  13582. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, oc)) goto failed1;
  13583. *llout = llstate_3;
  13584. {FieldSpec_t *fs;
  13585. FieldSpecs_e fe;
  13586. fs = GetFieldSpecFromObjectClass((*llout).Assignments, oc, llatt_3);
  13587. fe = GetFieldSpecType((*llout).Assignments, fs);
  13588. if (fe != eFieldSpec_Undefined &&
  13589. fe != eFieldSpec_Object)
  13590. LLFAILED((&llstate_2.pos, "Bad field type"));
  13591. if (fe != eFieldSpec_Undefined)
  13592. (*llret) = GetObjectFromObject((*llout).Assignments, llatt_1, llatt_3);
  13593. else
  13594. (*llret) = NULL;
  13595. }}}}}
  13596. LLDEBUG_LEAVE("ObjectFromObject", 1);
  13597. return 1;
  13598. failed1: LLDEBUG_LEAVE("ObjectFromObject", 0);
  13599. return 0;
  13600. }
  13601. int ll_ObjectSetFromObjects(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout)
  13602. {
  13603. unsigned llstp = llcstp;
  13604. LLSTATE llstate_0;
  13605. LLDEBUG_ENTER("ObjectSetFromObjects");
  13606. llstate_0 = *llin;
  13607. #undef failed
  13608. #define failed failed1
  13609. #undef failed
  13610. #define failed failed2
  13611. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  13612. LLCHECKSTK;
  13613. for (;;) {
  13614. switch (llstk[llcstp++]) {
  13615. case 1: case -1:
  13616. LLDEBUG_ALTERNATIVE("ObjectSetFromObjects", 1);
  13617. {LLSTATE llstate_1;XObject llatt_1;
  13618. if (!ll_ReferencedObjects(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13619. {LLSTATE llstate_2;
  13620. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  13621. {Object_t *o;
  13622. ObjectClass_t *oc;
  13623. o = GetObject(llstate_2.Assignments, llatt_1);
  13624. oc = o ? o->U.Object.ObjectClass : NULL;
  13625. {LLSTATE llstate_3;XStrings llatt_3;
  13626. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, oc)) goto failed2;
  13627. *llout = llstate_3;
  13628. {FieldSpec_t *fs;
  13629. FieldSpecs_e fe;
  13630. fs = GetFieldSpecFromObjectClass((*llout).Assignments, oc, llatt_3);
  13631. fe = GetFieldSpecType((*llout).Assignments, fs);
  13632. if (fe != eFieldSpec_Undefined &&
  13633. fe != eFieldSpec_ObjectSet)
  13634. LLFAILED((&llstate_2.pos, "Bad field type"));
  13635. if (fe != eFieldSpec_Undefined)
  13636. (*llret) = GetObjectSetFromObject((*llout).Assignments, llatt_1, llatt_3);
  13637. else
  13638. (*llret) = NULL;
  13639. break;
  13640. }}}}}
  13641. case 2: case -2:
  13642. LLDEBUG_ALTERNATIVE("ObjectSetFromObjects", 2);
  13643. {LLSTATE llstate_1;XObjectSet llatt_1;
  13644. if (!ll_ReferencedObjectSets(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13645. {LLSTATE llstate_2;
  13646. if (!llterm('.', (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed2;
  13647. {ObjectSet_t *os;
  13648. ObjectClass_t *oc;
  13649. os = GetObjectSet(llstate_2.Assignments, llatt_1);
  13650. oc = os ? os->U.OE.ObjectClass : NULL;
  13651. {LLSTATE llstate_3;XStrings llatt_3;
  13652. if (!ll_FieldName(&llatt_3, &llstate_2, &llstate_3, oc)) goto failed2;
  13653. *llout = llstate_3;
  13654. {FieldSpec_t *fs;
  13655. FieldSpecs_e fe;
  13656. fs = GetFieldSpecFromObjectClass((*llout).Assignments, oc, llatt_3);
  13657. fe = GetFieldSpecType((*llout).Assignments, fs);
  13658. if (fe != eFieldSpec_Undefined &&
  13659. fe != eFieldSpec_Object &&
  13660. fe != eFieldSpec_ObjectSet)
  13661. LLFAILED((&llstate_2.pos, "Bad field type"));
  13662. if (fe != eFieldSpec_Undefined)
  13663. (*llret) = GetObjectSetFromObjectSet((*llout).Assignments, llatt_1, llatt_3);
  13664. else
  13665. (*llret) = NULL;
  13666. break;
  13667. }}}}}
  13668. default:
  13669. llstk[--llcstp] = 1;
  13670. goto failed1;
  13671. failed2:
  13672. LLDEBUG_BACKTRACKING("ObjectSetFromObjects");
  13673. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  13674. llcpos = llpos1; llcstp = llstp1;
  13675. continue;
  13676. } break;
  13677. }}
  13678. LLDEBUG_LEAVE("ObjectSetFromObjects", 1);
  13679. return 1;
  13680. failed1: LLDEBUG_LEAVE("ObjectSetFromObjects", 0);
  13681. return 0;
  13682. }
  13683. int ll_ReferencedObjects(XObject *llret, LLSTATE *llin, LLSTATE *llout)
  13684. {
  13685. unsigned llstp = llcstp;
  13686. LLSTATE llstate_0;
  13687. LLDEBUG_ENTER("ReferencedObjects");
  13688. llstate_0 = *llin;
  13689. #undef failed
  13690. #define failed failed1
  13691. #undef failed
  13692. #define failed failed2
  13693. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  13694. LLCHECKSTK;
  13695. for (;;) {
  13696. switch (llstk[llcstp++]) {
  13697. case 1: case -1:
  13698. LLDEBUG_ALTERNATIVE("ReferencedObjects", 1);
  13699. {LLSTATE llstate_1;XObject llatt_1;
  13700. if (!ll_DefinedObject(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13701. *llout = llstate_1;
  13702. {(*llret) = llatt_1;
  13703. break;
  13704. }}
  13705. case 2: case -2:
  13706. LLDEBUG_ALTERNATIVE("ReferencedObjects", 2);
  13707. {LLSTATE llstate_1;
  13708. if (!ll_ParameterizedObject(&llstate_0, &llstate_1)) goto failed2;
  13709. *llout = llstate_1;
  13710. {MyAbort();
  13711. break;
  13712. }}
  13713. default:
  13714. llstk[--llcstp] = 1;
  13715. goto failed1;
  13716. failed2:
  13717. LLDEBUG_BACKTRACKING("ReferencedObjects");
  13718. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  13719. llcpos = llpos1; llcstp = llstp1;
  13720. continue;
  13721. } break;
  13722. }}
  13723. LLDEBUG_LEAVE("ReferencedObjects", 1);
  13724. return 1;
  13725. failed1: LLDEBUG_LEAVE("ReferencedObjects", 0);
  13726. return 0;
  13727. }
  13728. int ll_ReferencedObjectSets(XObjectSet *llret, LLSTATE *llin, LLSTATE *llout)
  13729. {
  13730. unsigned llstp = llcstp;
  13731. LLSTATE llstate_0;
  13732. LLDEBUG_ENTER("ReferencedObjectSets");
  13733. llstate_0 = *llin;
  13734. #undef failed
  13735. #define failed failed1
  13736. #undef failed
  13737. #define failed failed2
  13738. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  13739. LLCHECKSTK;
  13740. for (;;) {
  13741. switch (llstk[llcstp++]) {
  13742. case 1: case -1:
  13743. LLDEBUG_ALTERNATIVE("ReferencedObjectSets", 1);
  13744. {LLSTATE llstate_1;XObjectSet llatt_1;
  13745. if (!ll_DefinedObjectSet(&llatt_1, &llstate_0, &llstate_1)) goto failed2;
  13746. *llout = llstate_1;
  13747. {(*llret) = llatt_1;
  13748. break;
  13749. }}
  13750. case 2: case -2:
  13751. LLDEBUG_ALTERNATIVE("ReferencedObjectSets", 2);
  13752. {LLSTATE llstate_1;
  13753. if (!ll_ParameterizedObjectSet(&llstate_0, &llstate_1)) goto failed2;
  13754. *llout = llstate_1;
  13755. {MyAbort();
  13756. break;
  13757. }}
  13758. default:
  13759. llstk[--llcstp] = 1;
  13760. goto failed1;
  13761. failed2:
  13762. LLDEBUG_BACKTRACKING("ReferencedObjectSets");
  13763. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  13764. llcpos = llpos1; llcstp = llstp1;
  13765. continue;
  13766. } break;
  13767. }}
  13768. LLDEBUG_LEAVE("ReferencedObjectSets", 1);
  13769. return 1;
  13770. failed1: LLDEBUG_LEAVE("ReferencedObjectSets", 0);
  13771. return 0;
  13772. }
  13773. int ll_InstanceOfType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  13774. {
  13775. unsigned llstp = llcstp;
  13776. LLSTATE llstate_0;
  13777. LLDEBUG_ENTER("InstanceOfType");
  13778. llstate_0 = *llin;
  13779. #undef failed
  13780. #define failed failed1
  13781. {LLSTATE llstate_1;
  13782. if (!llterm(T_INSTANCE, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13783. {LLSTATE llstate_2;
  13784. if (!llterm(T_OF, (LLSTYPE *)0, &llstate_1, &llstate_2)) goto failed1;
  13785. {LLSTATE llstate_3;XObjectClass llatt_3;
  13786. if (!ll_DefinedObjectClass(&llatt_3, &llstate_2, &llstate_3)) goto failed1;
  13787. *llout = llstate_3;
  13788. {Component_t *co1, *co2;
  13789. Type_t *ty;
  13790. (*llret) = NewType(eType_InstanceOf);
  13791. (*llret)->U.Sequence.Components = co1 = NewComponent(eComponent_Normal);
  13792. co1->Next = co2 = NewComponent(eComponent_Normal);
  13793. ty = NewType(eType_FieldReference);
  13794. ty->U.FieldReference.Identifier = "&id";
  13795. ty->U.FieldReference.ObjectClass = llatt_3;
  13796. co1->U.Normal.NamedType = NewNamedType("type-id", ty);
  13797. ty = NewType(eType_FieldReference);
  13798. ty->Tags = NewTag(eTagType_Explicit);
  13799. ty->Tags->Tag = Builtin_Value_Integer_0;
  13800. ty->U.FieldReference.Identifier = "&Type";
  13801. ty->U.FieldReference.ObjectClass = llatt_3;
  13802. co2->U.Normal.NamedType = NewNamedType("value", ty);
  13803. }}}}
  13804. LLDEBUG_LEAVE("InstanceOfType", 1);
  13805. return 1;
  13806. failed1: LLDEBUG_LEAVE("InstanceOfType", 0);
  13807. return 0;
  13808. }
  13809. int ll_InstanceOfValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  13810. {
  13811. unsigned llstp = llcstp;
  13812. LLSTATE llstate_0;
  13813. LLDEBUG_ENTER("InstanceOfValue");
  13814. llstate_0 = *llin;
  13815. #undef failed
  13816. #define failed failed1
  13817. {LLSTATE llstate_1;XValue llatt_1;
  13818. if (!ll_SequenceValue(&llatt_1, &llstate_0, &llstate_1, llarg_type)) goto failed1;
  13819. *llout = llstate_1;
  13820. {(*llret) = llatt_1;
  13821. }}
  13822. LLDEBUG_LEAVE("InstanceOfValue", 1);
  13823. return 1;
  13824. failed1: LLDEBUG_LEAVE("InstanceOfValue", 0);
  13825. return 0;
  13826. }
  13827. int ll_MacroDefinition(LLSTATE *llin, LLSTATE *llout)
  13828. {
  13829. unsigned llstp = llcstp;
  13830. LLSTATE llstate_0;
  13831. LLDEBUG_ENTER("MacroDefinition");
  13832. llstate_0 = *llin;
  13833. #undef failed
  13834. #define failed failed1
  13835. {LLSTATE llstate_1;
  13836. if (!llterm(T_DUM_XXX1, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13837. *llout = llstate_1;
  13838. {MyAbort();
  13839. }}
  13840. LLDEBUG_LEAVE("MacroDefinition", 1);
  13841. return 1;
  13842. failed1: LLDEBUG_LEAVE("MacroDefinition", 0);
  13843. return 0;
  13844. }
  13845. int ll_MacroDefinedType(XType *llret, LLSTATE *llin, LLSTATE *llout)
  13846. {
  13847. unsigned llstp = llcstp;
  13848. LLSTATE llstate_0;
  13849. LLDEBUG_ENTER("MacroDefinedType");
  13850. llstate_0 = *llin;
  13851. #undef failed
  13852. #define failed failed1
  13853. {LLSTATE llstate_1;
  13854. if (!llterm(T_DUM_XXX2, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13855. *llout = llstate_1;
  13856. {MyAbort();
  13857. }}
  13858. LLDEBUG_LEAVE("MacroDefinedType", 1);
  13859. return 1;
  13860. failed1: LLDEBUG_LEAVE("MacroDefinedType", 0);
  13861. return 0;
  13862. }
  13863. int ll_MacroDefinedValue(XValue *llret, LLSTATE *llin, LLSTATE *llout, XType llarg_type)
  13864. {
  13865. unsigned llstp = llcstp;
  13866. LLSTATE llstate_0;
  13867. LLDEBUG_ENTER("MacroDefinedValue");
  13868. llstate_0 = *llin;
  13869. #undef failed
  13870. #define failed failed1
  13871. {LLSTATE llstate_1;
  13872. if (!llterm(T_DUM_XXX3, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13873. *llout = llstate_1;
  13874. {MyAbort();
  13875. }}
  13876. LLDEBUG_LEAVE("MacroDefinedValue", 1);
  13877. return 1;
  13878. failed1: LLDEBUG_LEAVE("MacroDefinedValue", 0);
  13879. return 0;
  13880. }
  13881. int ll_ParameterizedValueSetType(LLSTATE *llin, LLSTATE *llout)
  13882. {
  13883. unsigned llstp = llcstp;
  13884. LLSTATE llstate_0;
  13885. LLDEBUG_ENTER("ParameterizedValueSetType");
  13886. llstate_0 = *llin;
  13887. #undef failed
  13888. #define failed failed1
  13889. {LLSTATE llstate_1;
  13890. if (!llterm(T_DUM_XXX4, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13891. *llout = llstate_1;
  13892. {MyAbort();
  13893. }}
  13894. LLDEBUG_LEAVE("ParameterizedValueSetType", 1);
  13895. return 1;
  13896. failed1: LLDEBUG_LEAVE("ParameterizedValueSetType", 0);
  13897. return 0;
  13898. }
  13899. int ll_ParameterizedReference(LLSTATE *llin, LLSTATE *llout)
  13900. {
  13901. unsigned llstp = llcstp;
  13902. LLSTATE llstate_0;
  13903. LLDEBUG_ENTER("ParameterizedReference");
  13904. llstate_0 = *llin;
  13905. #undef failed
  13906. #define failed failed1
  13907. {LLSTATE llstate_1;
  13908. if (!llterm(T_DUM_XXX5, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13909. *llout = llstate_1;
  13910. {MyAbort();
  13911. }}
  13912. LLDEBUG_LEAVE("ParameterizedReference", 1);
  13913. return 1;
  13914. failed1: LLDEBUG_LEAVE("ParameterizedReference", 0);
  13915. return 0;
  13916. }
  13917. int ll_ParameterizedType(LLSTATE *llin, LLSTATE *llout)
  13918. {
  13919. unsigned llstp = llcstp;
  13920. LLSTATE llstate_0;
  13921. LLDEBUG_ENTER("ParameterizedType");
  13922. llstate_0 = *llin;
  13923. #undef failed
  13924. #define failed failed1
  13925. {LLSTATE llstate_1;
  13926. if (!llterm(T_DUM_XXX7, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13927. *llout = llstate_1;
  13928. {MyAbort();
  13929. }}
  13930. LLDEBUG_LEAVE("ParameterizedType", 1);
  13931. return 1;
  13932. failed1: LLDEBUG_LEAVE("ParameterizedType", 0);
  13933. return 0;
  13934. }
  13935. int ll_ParameterizedValue(LLSTATE *llin, LLSTATE *llout)
  13936. {
  13937. unsigned llstp = llcstp;
  13938. LLSTATE llstate_0;
  13939. LLDEBUG_ENTER("ParameterizedValue");
  13940. llstate_0 = *llin;
  13941. #undef failed
  13942. #define failed failed1
  13943. {LLSTATE llstate_1;
  13944. if (!llterm(T_DUM_XXX9, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13945. *llout = llstate_1;
  13946. {MyAbort();
  13947. }}
  13948. LLDEBUG_LEAVE("ParameterizedValue", 1);
  13949. return 1;
  13950. failed1: LLDEBUG_LEAVE("ParameterizedValue", 0);
  13951. return 0;
  13952. }
  13953. int ll_ParameterizedAssignment(LLSTATE *llin, LLSTATE *llout)
  13954. {
  13955. unsigned llstp = llcstp;
  13956. LLSTATE llstate_0;
  13957. LLDEBUG_ENTER("ParameterizedAssignment");
  13958. llstate_0 = *llin;
  13959. #undef failed
  13960. #define failed failed1
  13961. {LLSTATE llstate_1;
  13962. if (!llterm(T_DUM_XXX16, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13963. *llout = llstate_1;
  13964. {MyAbort();
  13965. }}
  13966. LLDEBUG_LEAVE("ParameterizedAssignment", 1);
  13967. return 1;
  13968. failed1: LLDEBUG_LEAVE("ParameterizedAssignment", 0);
  13969. return 0;
  13970. }
  13971. int ll_ParameterizedObjectClass(LLSTATE *llin, LLSTATE *llout)
  13972. {
  13973. unsigned llstp = llcstp;
  13974. LLSTATE llstate_0;
  13975. LLDEBUG_ENTER("ParameterizedObjectClass");
  13976. llstate_0 = *llin;
  13977. #undef failed
  13978. #define failed failed1
  13979. {LLSTATE llstate_1;
  13980. if (!llterm(T_DUM_XXX17, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13981. *llout = llstate_1;
  13982. {MyAbort();
  13983. }}
  13984. LLDEBUG_LEAVE("ParameterizedObjectClass", 1);
  13985. return 1;
  13986. failed1: LLDEBUG_LEAVE("ParameterizedObjectClass", 0);
  13987. return 0;
  13988. }
  13989. int ll_ParameterizedObject(LLSTATE *llin, LLSTATE *llout)
  13990. {
  13991. unsigned llstp = llcstp;
  13992. LLSTATE llstate_0;
  13993. LLDEBUG_ENTER("ParameterizedObject");
  13994. llstate_0 = *llin;
  13995. #undef failed
  13996. #define failed failed1
  13997. {LLSTATE llstate_1;
  13998. if (!llterm(T_DUM_XXX2, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  13999. *llout = llstate_1;
  14000. {MyAbort();
  14001. }}
  14002. LLDEBUG_LEAVE("ParameterizedObject", 1);
  14003. return 1;
  14004. failed1: LLDEBUG_LEAVE("ParameterizedObject", 0);
  14005. return 0;
  14006. }
  14007. int ll_ParameterizedObjectSet(LLSTATE *llin, LLSTATE *llout)
  14008. {
  14009. unsigned llstp = llcstp;
  14010. LLSTATE llstate_0;
  14011. LLDEBUG_ENTER("ParameterizedObjectSet");
  14012. llstate_0 = *llin;
  14013. #undef failed
  14014. #define failed failed1
  14015. {LLSTATE llstate_1;
  14016. if (!llterm(T_DUM_XXX12, (LLSTYPE *)0, &llstate_0, &llstate_1)) goto failed1;
  14017. *llout = llstate_1;
  14018. {MyAbort();
  14019. }}
  14020. LLDEBUG_LEAVE("ParameterizedObjectSet", 1);
  14021. return 1;
  14022. failed1: LLDEBUG_LEAVE("ParameterizedObjectSet", 0);
  14023. return 0;
  14024. }
  14025. int
  14026. llparser(LLTERM *tokens, unsigned ntokens, LLSTATE *llin, LLSTATE *llout)
  14027. {
  14028. unsigned i;
  14029. LLDEBUG_ENTER("llparser");
  14030. lltokens = tokens; llntokens = ntokens;
  14031. for (i = 0; i < llstksize; i++) llstk[i] = 1;
  14032. llcstp = 1; llcpos = 0; llepos = 0; *llerrormsg = 0;
  14033. #if LLDEBUG > 0
  14034. last_linenr = 0; last_file = "";
  14035. #endif
  14036. {unsigned llpos1 = llcpos, llstp1 = llcstp;
  14037. LLCHECKSTK;
  14038. for (;;) {
  14039. switch (llstk[llcstp++]) {
  14040. case 1: case -1:
  14041. if (!ll_Main(llin, llout)) goto failed2;
  14042. if (llcpos != llntokens) goto failed2;
  14043. break;
  14044. default:
  14045. llstk[--llcstp] = 1;
  14046. goto failed1;
  14047. failed2:
  14048. LLDEBUG_BACKTRACKING("llparser");
  14049. if (llstk[--llcstp] < 0) llstk[llcstp] = 0; else llstk[llcstp]++;
  14050. llcpos = llpos1; llcstp = llstp1;
  14051. continue;
  14052. } break;
  14053. }}
  14054. LLDEBUG_LEAVE("llparser", 1);
  14055. return 1;
  14056. failed1:
  14057. LLDEBUG_LEAVE("llparser", 0);
  14058. return 0;
  14059. }
  14060. int
  14061. llterm(int token, LLSTYPE *lval, LLSTATE *llin, LLSTATE *llout)
  14062. {
  14063. #if LLDEBUG > 0
  14064. if (lldebug > 0 && (lltokens[llcpos].pos.line > last_linenr || strcmp(lltokens[llcpos].pos.file, last_file))) {
  14065. fprintf(stderr, "File \"%s\", Line %5d \r",
  14066. lltokens[llcpos].pos.file, lltokens[llcpos].pos.line);
  14067. last_linenr = lltokens[llcpos].pos.line / 10 * 10 + 9;
  14068. last_file = lltokens[llcpos].pos.file;
  14069. }
  14070. #endif
  14071. if (llstk[llcstp] != 1 && llstk[llcstp] != -1) {
  14072. LLDEBUG_BACKTRACKING("llterm");
  14073. llstk[llcstp] = 1;
  14074. return 0;
  14075. }
  14076. LLDEBUG_TOKEN(token, llcpos);
  14077. if (llcpos < llntokens && lltokens[llcpos].token == token) {
  14078. if (lval)
  14079. *lval = lltokens[llcpos].lval;
  14080. *llout = *llin;
  14081. llout->pos = lltokens[llcpos].pos;
  14082. llcpos++;
  14083. LLCHECKSTK;
  14084. llcstp++;
  14085. return 1;
  14086. }
  14087. llfailed(&lltokens[llcpos].pos, NULL);
  14088. llstk[llcstp] = 1;
  14089. return 0;
  14090. }
  14091. int
  14092. llanyterm(LLSTYPE *lval, LLSTATE *llin, LLSTATE *llout)
  14093. {
  14094. #if LLDEBUG > 0
  14095. if (lldebug > 0 && (lltokens[llcpos].pos.line > last_linenr || strcmp(lltokens[llcpos].pos.file, last_file))) {
  14096. fprintf(stderr, "File \"%s\", Line %5d \r",
  14097. lltokens[llcpos].pos.file, lltokens[llcpos].pos.line);
  14098. last_linenr = lltokens[llcpos].pos.line / 10 * 10 + 9;
  14099. last_file = lltokens[llcpos].pos.file;
  14100. }
  14101. #endif
  14102. if (llstk[llcstp] != 1 && llstk[llcstp] != -1) {
  14103. LLDEBUG_BACKTRACKING("llanyterm");
  14104. llstk[llcstp] = 1;
  14105. return 0;
  14106. }
  14107. LLDEBUG_ANYTOKEN(llcpos);
  14108. if (llcpos < llntokens) {
  14109. if (lval)
  14110. *lval = lltokens[llcpos].lval;
  14111. *llout = *llin;
  14112. llout->pos = lltokens[llcpos].pos;
  14113. llcpos++;
  14114. LLCHECKSTK;
  14115. llcstp++;
  14116. return 1;
  14117. }
  14118. llfailed(&lltokens[llcpos].pos, NULL);
  14119. llstk[llcstp] = 1;
  14120. return 0;
  14121. }
  14122. void
  14123. llscanner(LLTERM **tokens, unsigned *ntokens)
  14124. {
  14125. unsigned i = 0;
  14126. #if LLDEBUG > 0
  14127. int line = -1;
  14128. #endif
  14129. *ntokens = 1024;
  14130. *tokens = (LLTERM *)malloc(*ntokens * sizeof(LLTERM));
  14131. while (llgettoken(&(*tokens)[i].token, &(*tokens)[i].lval, &(*tokens)[i].pos)) {
  14132. #if LLDEBUG > 0
  14133. if (lldebug > 0 && (*tokens)[i].pos.line > line) {
  14134. line = (*tokens)[i].pos.line / 10 * 10 + 9;
  14135. fprintf(stderr, "File \"%s\", Line %5d \r",
  14136. (*tokens)[i].pos.file, (*tokens)[i].pos.line);
  14137. }
  14138. #endif
  14139. if (++i >= *ntokens) {
  14140. *ntokens *= 2;
  14141. *tokens = (LLTERM *)realloc(*tokens, *ntokens * sizeof(LLTERM));
  14142. }
  14143. }
  14144. (*tokens)[i].token = 0;
  14145. *ntokens = i;
  14146. #if LLDEBUG > 0
  14147. lldebug_init();
  14148. #endif
  14149. llresizestk();
  14150. }
  14151. void
  14152. llfailed(LLPOS *pos, char *fmt, ...)
  14153. {
  14154. va_list args;
  14155. va_start(args, fmt);
  14156. if (llcpos > llepos || llcpos == llepos && !*llerrormsg) {
  14157. llepos = llcpos;
  14158. if (fmt)
  14159. vsprintf(llerrormsg, fmt, args);
  14160. else
  14161. *llerrormsg = 0;
  14162. llerrorpos = *pos;
  14163. }
  14164. va_end(args);
  14165. }
  14166. void
  14167. llprinterror(FILE *f)
  14168. {
  14169. #if LLDEBUG > 0
  14170. fputs(" \r", stderr);
  14171. #endif
  14172. if (*llerrormsg)
  14173. llerror(f, &llerrorpos, llerrormsg);
  14174. else
  14175. llerror(f, &llerrorpos, "Syntax error");
  14176. }
  14177. void
  14178. llerror(FILE *f, LLPOS *pos, char *fmt, ...)
  14179. {
  14180. va_list args;
  14181. va_start(args, fmt);
  14182. llverror(f, pos, fmt, args);
  14183. va_end(args);
  14184. }
  14185. void
  14186. llresizestk()
  14187. {
  14188. unsigned i;
  14189. if (llcstp + 1 >= llstksize) {
  14190. i = llstksize;
  14191. if (!llstksize)
  14192. llstk = (int *)malloc((llstksize = 4096) * sizeof(int));
  14193. else
  14194. llstk = (int *)realloc(llstk, (llstksize *= 2) * sizeof(int));
  14195. for (; i < llstksize; i++)
  14196. llstk[i] = 1;
  14197. }
  14198. }
  14199. #if LLDEBUG > 0
  14200. int lldepth;
  14201. char *lltokentab[] = {
  14202. "EOF","#1","#2","#3","#4","#5","#6","#7"
  14203. ,"#8","#9","#10","#11","#12","#13","#14","#15"
  14204. ,"#16","#17","#18","#19","#20","#21","#22","#23"
  14205. ,"#24","#25","#26","#27","#28","#29","#30","#31"
  14206. ,"' '","'!'","'\"'","'#'","'$'","'%'","'&'","'''"
  14207. ,"'('","')'","'*'","'+'","','","'-'","'.'","'/'"
  14208. ,"'0'","'1'","'2'","'3'","'4'","'5'","'6'","'7'"
  14209. ,"'8'","'9'","':'","';'","'<'","'='","'>'","'?'"
  14210. ,"'@'","'A'","'B'","'C'","'D'","'E'","'F'","'G'"
  14211. ,"'H'","'I'","'J'","'K'","'L'","'M'","'N'","'O'"
  14212. ,"'P'","'Q'","'R'","'S'","'T'","'U'","'V'","'W'"
  14213. ,"'X'","'Y'","'Z'","'['","'\\'","']'","'^'","'_'"
  14214. ,"'`'","'a'","'b'","'c'","'d'","'e'","'f'","'g'"
  14215. ,"'h'","'i'","'j'","'k'","'l'","'m'","'n'","'o'"
  14216. ,"'p'","'q'","'r'","'s'","'t'","'u'","'v'","'w'"
  14217. ,"'x'","'y'","'z'","'{'","'|'","'}'","'~'","#127"
  14218. ,"#128","#129","#130","#131","#132","#133","#134","#135"
  14219. ,"#136","#137","#138","#139","#140","#141","#142","#143"
  14220. ,"#144","#145","#146","#147","#148","#149","#150","#151"
  14221. ,"#152","#153","#154","#155","#156","#157","#158","#159"
  14222. ,"#160","#161","#162","#163","#164","#165","#166","#167"
  14223. ,"#168","#169","#170","#171","#172","#173","#174","#175"
  14224. ,"#176","#177","#178","#179","#180","#181","#182","#183"
  14225. ,"#184","#185","#186","#187","#188","#189","#190","#191"
  14226. ,"#192","#193","#194","#195","#196","#197","#198","#199"
  14227. ,"#200","#201","#202","#203","#204","#205","#206","#207"
  14228. ,"#208","#209","#210","#211","#212","#213","#214","#215"
  14229. ,"#216","#217","#218","#219","#220","#221","#222","#223"
  14230. ,"#224","#225","#226","#227","#228","#229","#230","#231"
  14231. ,"#232","#233","#234","#235","#236","#237","#238","#239"
  14232. ,"#240","#241","#242","#243","#244","#245","#246","#247"
  14233. ,"#248","#249","#250","#251","#252","#253","#254","#255"
  14234. ,"#256","\"::=\"","\"..\"","\"...\"","\"TYPE-IDENTIFIER\"","\"ABSTRACT-SYNTAX\"","\"--$zero-terminated--\"","\"--$pointer--\""
  14235. ,"\"--$no-pointer--\"","\"--$fixed-array--\"","\"--$singly-linked-list--\"","\"--$doubly-linked-list--\"","\"--$length-pointer--\"","\"number\"","number","bstring"
  14236. ,"hstring","cstring","only_uppercase_symbol","only_uppercase_digits_symbol","uppercase_symbol","lcsymbol","ampucsymbol","amplcsymbol"
  14237. ,"CON_XXX1","CON_XXX2","OBJ_XXX1","OBJ_XXX2","OBJ_XXX3","OBJ_XXX4","OBJ_XXX5","OBJ_XXX6"
  14238. ,"OBJ_XXX7","DUM_XXX1","DUM_XXX2","DUM_XXX3","DUM_XXX4","DUM_XXX5","DUM_XXX6","DUM_XXX7"
  14239. ,"DUM_XXX8","DUM_XXX9","DUM_XXX10","DUM_XXX11","DUM_XXX12","DUM_XXX13","DUM_XXX14","DUM_XXX15"
  14240. ,"DUM_XXX16","DUM_XXX17","DUM_XXX18","DUM_XXX19","DUM_XXX20","\"DEFINITIONS\"","\"BEGIN\"","\"END\""
  14241. ,"\"EXPLICIT\"","\"TAGS\"","\"IMPLICIT\"","\"AUTOMATIC\"","\"EXTENSIBILITY\"","\"IMPLIED\"","\"EXPORTS\"","\"IMPORTS\""
  14242. ,"\"FROM\"","\"ABSENT\"","\"ALL\"","\"ANY\"","\"APPLICATION\"","\"BMPString\"","\"BY\"","\"CLASS\""
  14243. ,"\"COMPONENT\"","\"COMPONENTS\"","\"CONSTRAINED\"","\"DEFAULT\"","\"DEFINED\"","\"empty\"","\"EXCEPT\"","\"GeneralizedTime\""
  14244. ,"\"GeneralString\"","\"GraphicString\"","\"IA5String\"","\"IDENTIFIER\"","\"identifier\"","\"INCLUDES\"","\"ISO646String\"","\"MACRO\""
  14245. ,"\"MAX\"","\"MIN\"","\"NOTATION\"","\"NumericString\"","\"ObjectDescriptor\"","\"OF\"","\"OPTIONAL\"","\"PDV\""
  14246. ,"\"PRESENT\"","\"PrintableString\"","\"PRIVATE\"","\"SIZE\"","\"STRING\"","\"string\"","\"SYNTAX\"","\"T61String\""
  14247. ,"\"TeletexString\"","\"TYPE\"","\"type\"","\"UNIQUE\"","\"UNIVERSAL\"","\"UniversalString\"","\"UTCTime\"","\"UTF8String\""
  14248. ,"\"VALUE\"","\"value\"","\"VideotexString\"","\"VisibleString\"","\"WITH\"","\"BOOLEAN\"","\"INTEGER\"","\"ENUMERATED\""
  14249. ,"\"REAL\"","\"BIT\"","\"OCTET\"","\"NULL\"","\"SEQUENCE\"","\"SET\"","\"CHOICE\"","\"OBJECT\""
  14250. ,"\"EMBEDDED\"","\"EXTERNAL\"","\"CHARACTER\"","\"TRUE\"","\"FALSE\"","\"PLUS_INFINITY\"","\"MINUS_INFINITY\"","\"UNION\""
  14251. ,"\"INTERSECTION\"","\"PrivateDir_TypeName\"","\"PrivateDir_FieldName\"","\"PrivateDir_ValueName\"","\"PrivateDir_Public\"","\"PrivateDir_Intx\"","\"PrivateDir_LenPtr\"","\"PrivateDir_Pointer\""
  14252. ,"\"PrivateDir_Array\"","\"PrivateDir_NoCode\"","\"PrivateDir_NoMemCopy\"","\"PrivateDir_OidPacked\"","\"PrivateDir_OidArray\"","\"PrivateDir_SLinked\"","\"PrivateDir_DLinked\"","\"INSTANCE\""
  14253. };
  14254. void
  14255. lldebug_init()
  14256. {
  14257. char *p;
  14258. p = getenv("LLDEBUG");
  14259. if (p)
  14260. lldebug = atoi(p);
  14261. }
  14262. void
  14263. lldebug_enter(char *ident)
  14264. {
  14265. int i;
  14266. if (lldebug < 2)
  14267. return;
  14268. for (i = 0; i < lldepth; i++)
  14269. fputs("| ", stdout);
  14270. printf("/--- trying rule %s\n", ident);
  14271. lldepth++;
  14272. }
  14273. void
  14274. lldebug_leave(char *ident, int succ)
  14275. {
  14276. int i;
  14277. if (lldebug < 2)
  14278. return;
  14279. lldepth--;
  14280. for (i = 0; i < lldepth; i++)
  14281. fputs("| ", stdout);
  14282. if (succ)
  14283. printf("\\--- succeeded to apply rule %s\n", ident);
  14284. else
  14285. printf("\\--- failed to apply rule %s\n", ident);
  14286. }
  14287. void
  14288. lldebug_alternative(char *ident, int alt)
  14289. {
  14290. int i;
  14291. if (lldebug < 2)
  14292. return;
  14293. for (i = 0; i < lldepth - 1; i++)
  14294. fputs("| ", stdout);
  14295. printf(">--- trying alternative %d for rule %s\n", alt, ident);
  14296. }
  14297. lldebug_iteration(char *ident, int num)
  14298. {
  14299. int i;
  14300. if (lldebug < 2)
  14301. return;
  14302. for (i = 0; i < lldepth - 1; i++)
  14303. fputs("| ", stdout);
  14304. printf(">--- trying iteration %d for rule %s\n", num, ident);
  14305. }
  14306. void
  14307. lldebug_token(int expected, unsigned pos)
  14308. {
  14309. int i;
  14310. if (lldebug < 2)
  14311. return;
  14312. for (i = 0; i < lldepth; i++)
  14313. fputs("| ", stdout);
  14314. if (pos < llntokens && expected == lltokens[pos].token)
  14315. printf(" found token ");
  14316. else
  14317. printf(" expected token %s, found token ", lltokentab[expected]);
  14318. if (pos >= llntokens)
  14319. printf("<EOF>");
  14320. else
  14321. llprinttoken(lltokens + pos, lltokentab[lltokens[pos].token], stdout);
  14322. putchar('\n');
  14323. }
  14324. void
  14325. lldebug_anytoken(unsigned pos)
  14326. {
  14327. int i;
  14328. if (lldebug < 2)
  14329. return;
  14330. for (i = 0; i < lldepth; i++)
  14331. fputs("| ", stdout);
  14332. printf(" found token ");
  14333. if (pos >= llntokens)
  14334. printf("<EOF>");
  14335. else
  14336. llprinttoken(lltokens + pos, lltokentab[lltokens[pos].token], stdout);
  14337. putchar('\n');
  14338. }
  14339. void
  14340. lldebug_backtracking(char *ident)
  14341. {
  14342. int i;
  14343. if (lldebug < 2)
  14344. return;
  14345. for (i = 0; i < lldepth; i++)
  14346. fputs("| ", stdout);
  14347. printf(" backtracking rule %s\n", ident);
  14348. }
  14349. #endif