clipsruby 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/ext/clipsruby/agenda.c +1373 -0
- data/ext/clipsruby/agenda.h +169 -0
- data/ext/clipsruby/analysis.c +1142 -0
- data/ext/clipsruby/analysis.h +61 -0
- data/ext/clipsruby/argacces.c +526 -0
- data/ext/clipsruby/argacces.h +77 -0
- data/ext/clipsruby/bload.c +884 -0
- data/ext/clipsruby/bload.h +94 -0
- data/ext/clipsruby/bmathfun.c +557 -0
- data/ext/clipsruby/bmathfun.h +66 -0
- data/ext/clipsruby/bsave.c +634 -0
- data/ext/clipsruby/bsave.h +130 -0
- data/ext/clipsruby/classcom.c +976 -0
- data/ext/clipsruby/classcom.h +115 -0
- data/ext/clipsruby/classexm.c +1376 -0
- data/ext/clipsruby/classexm.h +97 -0
- data/ext/clipsruby/classfun.c +1392 -0
- data/ext/clipsruby/classfun.h +164 -0
- data/ext/clipsruby/classinf.c +1245 -0
- data/ext/clipsruby/classinf.h +94 -0
- data/ext/clipsruby/classini.c +843 -0
- data/ext/clipsruby/classini.h +75 -0
- data/ext/clipsruby/classpsr.c +957 -0
- data/ext/clipsruby/classpsr.h +73 -0
- data/ext/clipsruby/clips.h +133 -0
- data/ext/clipsruby/clipsruby.c +619 -0
- data/ext/clipsruby/clsltpsr.c +931 -0
- data/ext/clipsruby/clsltpsr.h +72 -0
- data/ext/clipsruby/commline.c +1217 -0
- data/ext/clipsruby/commline.h +131 -0
- data/ext/clipsruby/conscomp.c +1593 -0
- data/ext/clipsruby/conscomp.h +150 -0
- data/ext/clipsruby/constant.h +264 -0
- data/ext/clipsruby/constrct.c +1090 -0
- data/ext/clipsruby/constrct.h +216 -0
- data/ext/clipsruby/constrnt.c +554 -0
- data/ext/clipsruby/constrnt.h +132 -0
- data/ext/clipsruby/crstrtgy.c +1088 -0
- data/ext/clipsruby/crstrtgy.h +85 -0
- data/ext/clipsruby/cstrcbin.c +185 -0
- data/ext/clipsruby/cstrcbin.h +61 -0
- data/ext/clipsruby/cstrccmp.h +43 -0
- data/ext/clipsruby/cstrccom.c +1791 -0
- data/ext/clipsruby/cstrccom.h +115 -0
- data/ext/clipsruby/cstrcpsr.c +835 -0
- data/ext/clipsruby/cstrcpsr.h +97 -0
- data/ext/clipsruby/cstrnbin.c +282 -0
- data/ext/clipsruby/cstrnbin.h +55 -0
- data/ext/clipsruby/cstrnchk.c +826 -0
- data/ext/clipsruby/cstrnchk.h +91 -0
- data/ext/clipsruby/cstrncmp.c +238 -0
- data/ext/clipsruby/cstrncmp.h +57 -0
- data/ext/clipsruby/cstrnops.c +1176 -0
- data/ext/clipsruby/cstrnops.h +47 -0
- data/ext/clipsruby/cstrnpsr.c +1394 -0
- data/ext/clipsruby/cstrnpsr.h +88 -0
- data/ext/clipsruby/cstrnutl.c +564 -0
- data/ext/clipsruby/cstrnutl.h +54 -0
- data/ext/clipsruby/default.c +454 -0
- data/ext/clipsruby/default.h +57 -0
- data/ext/clipsruby/defins.c +971 -0
- data/ext/clipsruby/defins.h +127 -0
- data/ext/clipsruby/developr.c +677 -0
- data/ext/clipsruby/developr.h +69 -0
- data/ext/clipsruby/dffctbin.c +477 -0
- data/ext/clipsruby/dffctbin.h +76 -0
- data/ext/clipsruby/dffctbsc.c +308 -0
- data/ext/clipsruby/dffctbsc.h +72 -0
- data/ext/clipsruby/dffctcmp.c +297 -0
- data/ext/clipsruby/dffctcmp.h +44 -0
- data/ext/clipsruby/dffctdef.c +364 -0
- data/ext/clipsruby/dffctdef.h +104 -0
- data/ext/clipsruby/dffctpsr.c +179 -0
- data/ext/clipsruby/dffctpsr.h +49 -0
- data/ext/clipsruby/dffnxbin.c +520 -0
- data/ext/clipsruby/dffnxbin.h +67 -0
- data/ext/clipsruby/dffnxcmp.c +378 -0
- data/ext/clipsruby/dffnxcmp.h +54 -0
- data/ext/clipsruby/dffnxexe.c +241 -0
- data/ext/clipsruby/dffnxexe.h +58 -0
- data/ext/clipsruby/dffnxfun.c +1192 -0
- data/ext/clipsruby/dffnxfun.h +155 -0
- data/ext/clipsruby/dffnxpsr.c +514 -0
- data/ext/clipsruby/dffnxpsr.h +57 -0
- data/ext/clipsruby/dfinsbin.c +509 -0
- data/ext/clipsruby/dfinsbin.h +66 -0
- data/ext/clipsruby/dfinscmp.c +345 -0
- data/ext/clipsruby/dfinscmp.h +48 -0
- data/ext/clipsruby/drive.c +1191 -0
- data/ext/clipsruby/drive.h +65 -0
- data/ext/clipsruby/emathfun.c +1213 -0
- data/ext/clipsruby/emathfun.h +99 -0
- data/ext/clipsruby/engine.c +1568 -0
- data/ext/clipsruby/engine.h +203 -0
- data/ext/clipsruby/entities.h +276 -0
- data/ext/clipsruby/envrnbld.c +514 -0
- data/ext/clipsruby/envrnbld.h +40 -0
- data/ext/clipsruby/envrnmnt.c +257 -0
- data/ext/clipsruby/envrnmnt.h +112 -0
- data/ext/clipsruby/evaluatn.c +1736 -0
- data/ext/clipsruby/evaluatn.h +211 -0
- data/ext/clipsruby/expressn.c +494 -0
- data/ext/clipsruby/expressn.h +154 -0
- data/ext/clipsruby/exprnbin.c +538 -0
- data/ext/clipsruby/exprnbin.h +60 -0
- data/ext/clipsruby/exprnops.c +564 -0
- data/ext/clipsruby/exprnops.h +67 -0
- data/ext/clipsruby/exprnpsr.c +1112 -0
- data/ext/clipsruby/exprnpsr.h +98 -0
- data/ext/clipsruby/extconf.rb +2 -0
- data/ext/clipsruby/extnfunc.c +1015 -0
- data/ext/clipsruby/extnfunc.h +157 -0
- data/ext/clipsruby/factbin.c +447 -0
- data/ext/clipsruby/factbin.h +56 -0
- data/ext/clipsruby/factbld.c +1035 -0
- data/ext/clipsruby/factbld.h +63 -0
- data/ext/clipsruby/factcmp.c +386 -0
- data/ext/clipsruby/factcmp.h +46 -0
- data/ext/clipsruby/factcom.c +759 -0
- data/ext/clipsruby/factcom.h +80 -0
- data/ext/clipsruby/factfile.c +1761 -0
- data/ext/clipsruby/factfile.h +54 -0
- data/ext/clipsruby/factfun.c +682 -0
- data/ext/clipsruby/factfun.h +77 -0
- data/ext/clipsruby/factgen.c +1305 -0
- data/ext/clipsruby/factgen.h +229 -0
- data/ext/clipsruby/facthsh.c +438 -0
- data/ext/clipsruby/facthsh.h +81 -0
- data/ext/clipsruby/factlhs.c +250 -0
- data/ext/clipsruby/factlhs.h +54 -0
- data/ext/clipsruby/factmch.c +905 -0
- data/ext/clipsruby/factmch.h +68 -0
- data/ext/clipsruby/factmngr.c +3373 -0
- data/ext/clipsruby/factmngr.h +325 -0
- data/ext/clipsruby/factprt.c +498 -0
- data/ext/clipsruby/factprt.h +60 -0
- data/ext/clipsruby/factqpsr.c +796 -0
- data/ext/clipsruby/factqpsr.h +61 -0
- data/ext/clipsruby/factqury.c +1267 -0
- data/ext/clipsruby/factqury.h +112 -0
- data/ext/clipsruby/factrete.c +978 -0
- data/ext/clipsruby/factrete.h +70 -0
- data/ext/clipsruby/factrhs.c +667 -0
- data/ext/clipsruby/factrhs.h +55 -0
- data/ext/clipsruby/filecom.c +353 -0
- data/ext/clipsruby/filecom.h +137 -0
- data/ext/clipsruby/filertr.c +481 -0
- data/ext/clipsruby/filertr.h +94 -0
- data/ext/clipsruby/fileutil.c +1020 -0
- data/ext/clipsruby/fileutil.h +50 -0
- data/ext/clipsruby/generate.c +1079 -0
- data/ext/clipsruby/generate.h +57 -0
- data/ext/clipsruby/genrcbin.c +902 -0
- data/ext/clipsruby/genrcbin.h +69 -0
- data/ext/clipsruby/genrccmp.c +640 -0
- data/ext/clipsruby/genrccmp.h +59 -0
- data/ext/clipsruby/genrccom.c +2017 -0
- data/ext/clipsruby/genrccom.h +119 -0
- data/ext/clipsruby/genrcexe.c +737 -0
- data/ext/clipsruby/genrcexe.h +73 -0
- data/ext/clipsruby/genrcfun.c +890 -0
- data/ext/clipsruby/genrcfun.h +185 -0
- data/ext/clipsruby/genrcpsr.c +1618 -0
- data/ext/clipsruby/genrcpsr.h +80 -0
- data/ext/clipsruby/globlbin.c +458 -0
- data/ext/clipsruby/globlbin.h +71 -0
- data/ext/clipsruby/globlbsc.c +361 -0
- data/ext/clipsruby/globlbsc.h +83 -0
- data/ext/clipsruby/globlcmp.c +330 -0
- data/ext/clipsruby/globlcmp.h +52 -0
- data/ext/clipsruby/globlcom.c +289 -0
- data/ext/clipsruby/globlcom.h +63 -0
- data/ext/clipsruby/globldef.c +1087 -0
- data/ext/clipsruby/globldef.h +151 -0
- data/ext/clipsruby/globlpsr.c +530 -0
- data/ext/clipsruby/globlpsr.h +59 -0
- data/ext/clipsruby/immthpsr.c +431 -0
- data/ext/clipsruby/immthpsr.h +55 -0
- data/ext/clipsruby/incrrset.c +530 -0
- data/ext/clipsruby/incrrset.h +73 -0
- data/ext/clipsruby/inherpsr.c +850 -0
- data/ext/clipsruby/inherpsr.h +52 -0
- data/ext/clipsruby/inscom.c +2076 -0
- data/ext/clipsruby/inscom.h +182 -0
- data/ext/clipsruby/insfile.c +1764 -0
- data/ext/clipsruby/insfile.h +96 -0
- data/ext/clipsruby/insfun.c +1451 -0
- data/ext/clipsruby/insfun.h +134 -0
- data/ext/clipsruby/insmngr.c +2550 -0
- data/ext/clipsruby/insmngr.h +125 -0
- data/ext/clipsruby/insmoddp.c +1041 -0
- data/ext/clipsruby/insmoddp.h +91 -0
- data/ext/clipsruby/insmult.c +804 -0
- data/ext/clipsruby/insmult.h +62 -0
- data/ext/clipsruby/inspsr.c +602 -0
- data/ext/clipsruby/inspsr.h +60 -0
- data/ext/clipsruby/insquery.c +1278 -0
- data/ext/clipsruby/insquery.h +115 -0
- data/ext/clipsruby/insqypsr.c +729 -0
- data/ext/clipsruby/insqypsr.h +63 -0
- data/ext/clipsruby/iofun.c +2045 -0
- data/ext/clipsruby/iofun.h +116 -0
- data/ext/clipsruby/lgcldpnd.c +644 -0
- data/ext/clipsruby/lgcldpnd.h +75 -0
- data/ext/clipsruby/main.c +112 -0
- data/ext/clipsruby/match.h +142 -0
- data/ext/clipsruby/memalloc.c +481 -0
- data/ext/clipsruby/memalloc.h +197 -0
- data/ext/clipsruby/miscfun.c +1801 -0
- data/ext/clipsruby/miscfun.h +132 -0
- data/ext/clipsruby/modulbin.c +607 -0
- data/ext/clipsruby/modulbin.h +84 -0
- data/ext/clipsruby/modulbsc.c +347 -0
- data/ext/clipsruby/modulbsc.h +67 -0
- data/ext/clipsruby/modulcmp.c +499 -0
- data/ext/clipsruby/modulcmp.h +54 -0
- data/ext/clipsruby/moduldef.c +817 -0
- data/ext/clipsruby/moduldef.h +271 -0
- data/ext/clipsruby/modulpsr.c +1150 -0
- data/ext/clipsruby/modulpsr.h +69 -0
- data/ext/clipsruby/modulutl.c +1036 -0
- data/ext/clipsruby/modulutl.h +84 -0
- data/ext/clipsruby/msgcom.c +1221 -0
- data/ext/clipsruby/msgcom.h +125 -0
- data/ext/clipsruby/msgfun.c +1076 -0
- data/ext/clipsruby/msgfun.h +118 -0
- data/ext/clipsruby/msgpass.c +1441 -0
- data/ext/clipsruby/msgpass.h +103 -0
- data/ext/clipsruby/msgpsr.c +698 -0
- data/ext/clipsruby/msgpsr.h +73 -0
- data/ext/clipsruby/multifld.c +1404 -0
- data/ext/clipsruby/multifld.h +130 -0
- data/ext/clipsruby/multifun.c +2182 -0
- data/ext/clipsruby/multifun.h +102 -0
- data/ext/clipsruby/network.h +142 -0
- data/ext/clipsruby/objbin.c +1522 -0
- data/ext/clipsruby/objbin.h +79 -0
- data/ext/clipsruby/objcmp.c +1507 -0
- data/ext/clipsruby/objcmp.h +71 -0
- data/ext/clipsruby/object.h +260 -0
- data/ext/clipsruby/objrtbin.c +701 -0
- data/ext/clipsruby/objrtbin.h +79 -0
- data/ext/clipsruby/objrtbld.c +2393 -0
- data/ext/clipsruby/objrtbld.h +66 -0
- data/ext/clipsruby/objrtcmp.c +734 -0
- data/ext/clipsruby/objrtcmp.h +66 -0
- data/ext/clipsruby/objrtfnx.c +1330 -0
- data/ext/clipsruby/objrtfnx.h +222 -0
- data/ext/clipsruby/objrtgen.c +736 -0
- data/ext/clipsruby/objrtgen.h +63 -0
- data/ext/clipsruby/objrtmch.c +1524 -0
- data/ext/clipsruby/objrtmch.h +160 -0
- data/ext/clipsruby/parsefun.c +415 -0
- data/ext/clipsruby/parsefun.h +67 -0
- data/ext/clipsruby/pattern.c +1265 -0
- data/ext/clipsruby/pattern.h +163 -0
- data/ext/clipsruby/pprint.c +328 -0
- data/ext/clipsruby/pprint.h +79 -0
- data/ext/clipsruby/prccode.c +1478 -0
- data/ext/clipsruby/prccode.h +145 -0
- data/ext/clipsruby/prcdrfun.c +640 -0
- data/ext/clipsruby/prcdrfun.h +95 -0
- data/ext/clipsruby/prcdrpsr.c +1068 -0
- data/ext/clipsruby/prcdrpsr.h +79 -0
- data/ext/clipsruby/prdctfun.c +869 -0
- data/ext/clipsruby/prdctfun.h +77 -0
- data/ext/clipsruby/prntutil.c +878 -0
- data/ext/clipsruby/prntutil.h +125 -0
- data/ext/clipsruby/proflfun.c +827 -0
- data/ext/clipsruby/proflfun.h +118 -0
- data/ext/clipsruby/reorder.c +2082 -0
- data/ext/clipsruby/reorder.h +172 -0
- data/ext/clipsruby/reteutil.c +1732 -0
- data/ext/clipsruby/reteutil.h +111 -0
- data/ext/clipsruby/retract.c +710 -0
- data/ext/clipsruby/retract.h +74 -0
- data/ext/clipsruby/router.c +737 -0
- data/ext/clipsruby/router.h +147 -0
- data/ext/clipsruby/rulebin.c +1136 -0
- data/ext/clipsruby/rulebin.h +153 -0
- data/ext/clipsruby/rulebld.c +1328 -0
- data/ext/clipsruby/rulebld.h +62 -0
- data/ext/clipsruby/rulebsc.c +517 -0
- data/ext/clipsruby/rulebsc.h +91 -0
- data/ext/clipsruby/rulecmp.c +733 -0
- data/ext/clipsruby/rulecmp.h +63 -0
- data/ext/clipsruby/rulecom.c +1583 -0
- data/ext/clipsruby/rulecom.h +116 -0
- data/ext/clipsruby/rulecstr.c +892 -0
- data/ext/clipsruby/rulecstr.h +53 -0
- data/ext/clipsruby/ruledef.c +559 -0
- data/ext/clipsruby/ruledef.h +179 -0
- data/ext/clipsruby/ruledlt.c +599 -0
- data/ext/clipsruby/ruledlt.h +58 -0
- data/ext/clipsruby/rulelhs.c +1216 -0
- data/ext/clipsruby/rulelhs.h +52 -0
- data/ext/clipsruby/rulepsr.c +1073 -0
- data/ext/clipsruby/rulepsr.h +61 -0
- data/ext/clipsruby/scanner.c +856 -0
- data/ext/clipsruby/scanner.h +112 -0
- data/ext/clipsruby/setup.h +488 -0
- data/ext/clipsruby/sortfun.c +433 -0
- data/ext/clipsruby/sortfun.h +55 -0
- data/ext/clipsruby/strngfun.c +1173 -0
- data/ext/clipsruby/strngfun.h +96 -0
- data/ext/clipsruby/strngrtr.c +523 -0
- data/ext/clipsruby/strngrtr.h +97 -0
- data/ext/clipsruby/symblbin.c +648 -0
- data/ext/clipsruby/symblbin.h +64 -0
- data/ext/clipsruby/symblcmp.c +893 -0
- data/ext/clipsruby/symblcmp.h +61 -0
- data/ext/clipsruby/symbol.c +1961 -0
- data/ext/clipsruby/symbol.h +243 -0
- data/ext/clipsruby/sysdep.c +894 -0
- data/ext/clipsruby/sysdep.h +164 -0
- data/ext/clipsruby/textpro.c +1388 -0
- data/ext/clipsruby/textpro.h +77 -0
- data/ext/clipsruby/tmpltbin.c +609 -0
- data/ext/clipsruby/tmpltbin.h +108 -0
- data/ext/clipsruby/tmpltbsc.c +327 -0
- data/ext/clipsruby/tmpltbsc.h +87 -0
- data/ext/clipsruby/tmpltcmp.c +450 -0
- data/ext/clipsruby/tmpltcmp.h +57 -0
- data/ext/clipsruby/tmpltdef.c +584 -0
- data/ext/clipsruby/tmpltdef.h +155 -0
- data/ext/clipsruby/tmpltfun.c +2477 -0
- data/ext/clipsruby/tmpltfun.h +122 -0
- data/ext/clipsruby/tmpltlhs.c +379 -0
- data/ext/clipsruby/tmpltlhs.h +50 -0
- data/ext/clipsruby/tmpltpsr.c +819 -0
- data/ext/clipsruby/tmpltpsr.h +59 -0
- data/ext/clipsruby/tmpltrhs.c +595 -0
- data/ext/clipsruby/tmpltrhs.h +55 -0
- data/ext/clipsruby/tmpltutl.c +637 -0
- data/ext/clipsruby/tmpltutl.h +82 -0
- data/ext/clipsruby/userdata.c +156 -0
- data/ext/clipsruby/userdata.h +72 -0
- data/ext/clipsruby/userfunctions.c +70 -0
- data/ext/clipsruby/usrsetup.h +7 -0
- data/ext/clipsruby/utility.c +1594 -0
- data/ext/clipsruby/utility.h +250 -0
- data/ext/clipsruby/watch.c +865 -0
- data/ext/clipsruby/watch.h +124 -0
- data/lib/clipsruby.rb +1 -0
- metadata +388 -0
@@ -0,0 +1,150 @@
|
|
1
|
+
/*******************************************************/
|
2
|
+
/* "C" Language Integrated Production System */
|
3
|
+
/* */
|
4
|
+
/* CLIPS Version 6.40 07/30/16 */
|
5
|
+
/* */
|
6
|
+
/* CONSTRUCT COMPILER HEADER FILE */
|
7
|
+
/*******************************************************/
|
8
|
+
|
9
|
+
/*************************************************************/
|
10
|
+
/* Purpose: */
|
11
|
+
/* */
|
12
|
+
/* Principal Programmer(s): */
|
13
|
+
/* Gary D. Riley */
|
14
|
+
/* */
|
15
|
+
/* Contributing Programmer(s): */
|
16
|
+
/* */
|
17
|
+
/* Revision History: */
|
18
|
+
/* */
|
19
|
+
/* 6.23: Modifications to use the system constant */
|
20
|
+
/* FILENAME_MAX to check file name lengths. */
|
21
|
+
/* DR0856 */
|
22
|
+
/* */
|
23
|
+
/* Corrected compilation errors for files */
|
24
|
+
/* generated by constructs-to-c. DR0861 */
|
25
|
+
/* */
|
26
|
+
/* 6.24: Used EnvClear rather than Clear in */
|
27
|
+
/* InitCImage initialization code. */
|
28
|
+
/* */
|
29
|
+
/* Added environment parameter to GenClose. */
|
30
|
+
/* Added environment parameter to GenOpen. */
|
31
|
+
/* */
|
32
|
+
/* Removed SHORT_LINK_NAMES code as this option */
|
33
|
+
/* is no longer supported. */
|
34
|
+
/* */
|
35
|
+
/* Support for run-time programs directly passing */
|
36
|
+
/* the hash tables for initialization. */
|
37
|
+
/* */
|
38
|
+
/* 6.30: Added path name argument to constructs-to-c. */
|
39
|
+
/* */
|
40
|
+
/* Changed integer type/precision. */
|
41
|
+
/* */
|
42
|
+
/* Removed conditional code for unsupported */
|
43
|
+
/* compilers/operating systems (IBM_MCW, MAC_MCW, */
|
44
|
+
/* IBM_TBC, IBM_MSC, IBM_ICB, IBM_ZTC, and */
|
45
|
+
/* IBM_SC). */
|
46
|
+
/* */
|
47
|
+
/* Use genstrcpy instead of strcpy. */
|
48
|
+
/* */
|
49
|
+
/* Added const qualifiers to remove C++ */
|
50
|
+
/* deprecation warnings. */
|
51
|
+
/* */
|
52
|
+
/* 6.40: Removed LOCALE definition. */
|
53
|
+
/* */
|
54
|
+
/* Pragma once and other inclusion changes. */
|
55
|
+
/* */
|
56
|
+
/* Added support for booleans with <stdbool.h>. */
|
57
|
+
/* */
|
58
|
+
/* Removed use of void pointers for specific */
|
59
|
+
/* data structures. */
|
60
|
+
/* */
|
61
|
+
/*************************************************************/
|
62
|
+
|
63
|
+
#ifndef _H_conscomp
|
64
|
+
|
65
|
+
#pragma once
|
66
|
+
|
67
|
+
#define _H_conscomp
|
68
|
+
|
69
|
+
#define ArbitraryPrefix(codeItem,i) (codeItem)->arrayNames[(i)]
|
70
|
+
|
71
|
+
#define ModulePrefix(codeItem) (codeItem)->arrayNames[0]
|
72
|
+
#define ConstructPrefix(codeItem) (codeItem)->arrayNames[1]
|
73
|
+
|
74
|
+
#include <stdio.h>
|
75
|
+
|
76
|
+
#include "constrct.h"
|
77
|
+
#include "extnfunc.h"
|
78
|
+
#include "symblcmp.h"
|
79
|
+
#include "moduldef.h"
|
80
|
+
|
81
|
+
#define CONSTRUCT_COMPILER_DATA 41
|
82
|
+
|
83
|
+
struct CodeGeneratorItem
|
84
|
+
{
|
85
|
+
const char *name;
|
86
|
+
void (*beforeFunction)(Environment *);
|
87
|
+
void (*initFunction)(Environment *,FILE *,unsigned,unsigned);
|
88
|
+
bool (*generateFunction)(Environment *,const char *,const char *,char *,
|
89
|
+
unsigned int,FILE *,unsigned int,unsigned int);
|
90
|
+
int priority;
|
91
|
+
char **arrayNames;
|
92
|
+
unsigned int arrayCount;
|
93
|
+
struct CodeGeneratorItem *next;
|
94
|
+
};
|
95
|
+
|
96
|
+
struct constructCompilerData
|
97
|
+
{
|
98
|
+
unsigned ImageID;
|
99
|
+
FILE *HeaderFP;
|
100
|
+
unsigned MaxIndices;
|
101
|
+
FILE *ExpressionFP;
|
102
|
+
FILE *FixupFP;
|
103
|
+
const char *FilePrefix;
|
104
|
+
const char *PathName;
|
105
|
+
char *FileNameBuffer;
|
106
|
+
bool ExpressionHeader;
|
107
|
+
unsigned long ExpressionCount;
|
108
|
+
unsigned ExpressionVersion;
|
109
|
+
unsigned CodeGeneratorCount;
|
110
|
+
struct CodeGeneratorItem *ListOfCodeGeneratorItems;
|
111
|
+
};
|
112
|
+
|
113
|
+
#define ConstructCompilerData(theEnv) ((struct constructCompilerData *) GetEnvironmentData(theEnv,CONSTRUCT_COMPILER_DATA))
|
114
|
+
|
115
|
+
struct CodeGeneratorFile
|
116
|
+
{
|
117
|
+
const char *filePrefix;
|
118
|
+
const char *pathName;
|
119
|
+
char *fileNameBuffer;
|
120
|
+
unsigned int id;
|
121
|
+
unsigned int version;
|
122
|
+
};
|
123
|
+
|
124
|
+
void InitializeConstructCompilerData(Environment *);
|
125
|
+
void ConstructsToCCommandDefinition(Environment *);
|
126
|
+
FILE *NewCFile(Environment *,const char *,const char *,char *,unsigned,unsigned,bool);
|
127
|
+
int ExpressionToCode(Environment *,FILE *,struct expr *);
|
128
|
+
void PrintFunctionReference(Environment *,FILE *,struct functionDefinition *);
|
129
|
+
struct CodeGeneratorItem *AddCodeGeneratorItem(Environment *,const char *,int,
|
130
|
+
void (*)(Environment *),
|
131
|
+
void (*)(Environment *,FILE *,unsigned,unsigned),
|
132
|
+
bool (*)(Environment *,const char *,const char *,char *,
|
133
|
+
unsigned int,FILE *,unsigned int,unsigned int),
|
134
|
+
unsigned);
|
135
|
+
FILE *CloseFileIfNeeded(Environment *,FILE *,unsigned int *,unsigned int *,unsigned int,
|
136
|
+
bool *,struct CodeGeneratorFile *);
|
137
|
+
FILE *OpenFileIfNeeded(Environment *,FILE *,const char *,const char *,char *,unsigned int,
|
138
|
+
unsigned int,unsigned int *,unsigned int,FILE *,const char *,char *,bool,struct CodeGeneratorFile *);
|
139
|
+
void MarkConstructBsaveIDs(Environment *,unsigned int);
|
140
|
+
void ConstructHeaderToCode(Environment *,FILE *,ConstructHeader *,unsigned int,
|
141
|
+
unsigned int,unsigned int,const char *,const char *);
|
142
|
+
void ConstructModuleToCode(Environment *,FILE *,Defmodule *,unsigned int,
|
143
|
+
unsigned int,unsigned int,const char *);
|
144
|
+
void PrintHashedExpressionReference(Environment *,FILE *,struct expr *,unsigned,unsigned);
|
145
|
+
|
146
|
+
#endif
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
@@ -0,0 +1,264 @@
|
|
1
|
+
/*******************************************************/
|
2
|
+
/* "C" Language Integrated Production System */
|
3
|
+
/* */
|
4
|
+
/* CLIPS Version 6.41 04/08/23 */
|
5
|
+
/* */
|
6
|
+
/* CONSTANTS HEADER FILE */
|
7
|
+
/*******************************************************/
|
8
|
+
|
9
|
+
/*************************************************************/
|
10
|
+
/* Purpose: */
|
11
|
+
/* */
|
12
|
+
/* Principal Programmer(s): */
|
13
|
+
/* Gary D. Riley */
|
14
|
+
/* */
|
15
|
+
/* Contributing Programmer(s): */
|
16
|
+
/* */
|
17
|
+
/* Revision History: */
|
18
|
+
/* */
|
19
|
+
/* 6.30: Moved default type constants (NO_DEFAULT, */
|
20
|
+
/* STATIC_DEFAULT, and DYNAMIC_DEFAULT) to */
|
21
|
+
/* constant.h */
|
22
|
+
/* */
|
23
|
+
/* Added DATA_OBJECT_ARRAY primitive type. */
|
24
|
+
/* */
|
25
|
+
/* Added NESTED_RHS constant. */
|
26
|
+
/* */
|
27
|
+
/* 6.40: Pragma once and other inclusion changes. */
|
28
|
+
/* */
|
29
|
+
/* Added support for booleans with <stdbool.h>. */
|
30
|
+
/* */
|
31
|
+
/* Removed use of void pointers for specific */
|
32
|
+
/* data structures. */
|
33
|
+
/* */
|
34
|
+
/* UDF redesign. */
|
35
|
+
/* */
|
36
|
+
/* Removed DATA_OBJECT_ARRAY primitive type. */
|
37
|
+
/* */
|
38
|
+
/*************************************************************/
|
39
|
+
|
40
|
+
#ifndef _H_constant
|
41
|
+
|
42
|
+
#pragma once
|
43
|
+
|
44
|
+
#define _H_constant
|
45
|
+
|
46
|
+
#include <stdbool.h>
|
47
|
+
#include <stdint.h>
|
48
|
+
#include <limits.h>
|
49
|
+
|
50
|
+
#define EXACTLY 0
|
51
|
+
#define AT_LEAST 1
|
52
|
+
#define NO_MORE_THAN 2
|
53
|
+
#define RANGE 3
|
54
|
+
|
55
|
+
#define UNBOUNDED USHRT_MAX
|
56
|
+
|
57
|
+
#define LHS 0
|
58
|
+
#define RHS 1
|
59
|
+
#define NESTED_RHS 2
|
60
|
+
#define NEGATIVE 0
|
61
|
+
#define POSITIVE 1
|
62
|
+
#define EOS '\0'
|
63
|
+
|
64
|
+
#define INSIDE 0
|
65
|
+
#define OUTSIDE 1
|
66
|
+
|
67
|
+
#define LESS_THAN 0
|
68
|
+
#define GREATER_THAN 1
|
69
|
+
#define EQUAL 2
|
70
|
+
|
71
|
+
typedef enum
|
72
|
+
{
|
73
|
+
LOCAL_SAVE,
|
74
|
+
VISIBLE_SAVE
|
75
|
+
} SaveScope;
|
76
|
+
|
77
|
+
typedef enum
|
78
|
+
{
|
79
|
+
NO_DEFAULT,
|
80
|
+
STATIC_DEFAULT,
|
81
|
+
DYNAMIC_DEFAULT
|
82
|
+
} DefaultType;
|
83
|
+
|
84
|
+
typedef enum
|
85
|
+
{
|
86
|
+
PSE_NO_ERROR = 0,
|
87
|
+
PSE_NULL_POINTER_ERROR,
|
88
|
+
PSE_INVALID_TARGET_ERROR,
|
89
|
+
PSE_SLOT_NOT_FOUND_ERROR,
|
90
|
+
PSE_TYPE_ERROR,
|
91
|
+
PSE_RANGE_ERROR,
|
92
|
+
PSE_ALLOWED_VALUES_ERROR,
|
93
|
+
PSE_CARDINALITY_ERROR,
|
94
|
+
PSE_ALLOWED_CLASSES_ERROR,
|
95
|
+
PSE_EVALUATION_ERROR,
|
96
|
+
PSE_RULE_NETWORK_ERROR
|
97
|
+
} PutSlotError;
|
98
|
+
|
99
|
+
typedef enum
|
100
|
+
{
|
101
|
+
GSE_NO_ERROR = 0,
|
102
|
+
GSE_NULL_POINTER_ERROR,
|
103
|
+
GSE_INVALID_TARGET_ERROR,
|
104
|
+
GSE_SLOT_NOT_FOUND_ERROR
|
105
|
+
} GetSlotError;
|
106
|
+
|
107
|
+
#ifndef APPLICATION_NAME
|
108
|
+
#define APPLICATION_NAME "CLIPS"
|
109
|
+
#endif
|
110
|
+
|
111
|
+
#ifndef COMMAND_PROMPT
|
112
|
+
#define COMMAND_PROMPT "CLIPS> "
|
113
|
+
#endif
|
114
|
+
|
115
|
+
#ifndef VERSION_STRING
|
116
|
+
#define VERSION_STRING "6.4.1"
|
117
|
+
#endif
|
118
|
+
|
119
|
+
#ifndef CREATION_DATE_STRING
|
120
|
+
#define CREATION_DATE_STRING "4/8/23"
|
121
|
+
#endif
|
122
|
+
|
123
|
+
#ifndef BANNER_STRING
|
124
|
+
#define BANNER_STRING " CLIPS (6.4.1 4/8/23)\n"
|
125
|
+
#endif
|
126
|
+
|
127
|
+
/*************************/
|
128
|
+
/* TOKEN AND TYPE VALUES */
|
129
|
+
/*************************/
|
130
|
+
|
131
|
+
#define OBJECT_TYPE_NAME "OBJECT"
|
132
|
+
#define USER_TYPE_NAME "USER"
|
133
|
+
#define PRIMITIVE_TYPE_NAME "PRIMITIVE"
|
134
|
+
#define NUMBER_TYPE_NAME "NUMBER"
|
135
|
+
#define INTEGER_TYPE_NAME "INTEGER"
|
136
|
+
#define FLOAT_TYPE_NAME "FLOAT"
|
137
|
+
#define SYMBOL_TYPE_NAME "SYMBOL"
|
138
|
+
#define STRING_TYPE_NAME "STRING"
|
139
|
+
#define MULTIFIELD_TYPE_NAME "MULTIFIELD"
|
140
|
+
#define LEXEME_TYPE_NAME "LEXEME"
|
141
|
+
#define ADDRESS_TYPE_NAME "ADDRESS"
|
142
|
+
#define EXTERNAL_ADDRESS_TYPE_NAME "EXTERNAL-ADDRESS"
|
143
|
+
#define FACT_ADDRESS_TYPE_NAME "FACT-ADDRESS"
|
144
|
+
#define INSTANCE_TYPE_NAME "INSTANCE"
|
145
|
+
#define INSTANCE_NAME_TYPE_NAME "INSTANCE-NAME"
|
146
|
+
#define INSTANCE_ADDRESS_TYPE_NAME "INSTANCE-ADDRESS"
|
147
|
+
|
148
|
+
/*************************************************************************/
|
149
|
+
/* The values of these constants should not be changed. They are set to */
|
150
|
+
/* start after the primitive type codes in CONSTANT.H. These codes are */
|
151
|
+
/* used to let the generic function bsave image be used whether COOL is */
|
152
|
+
/* present or not. */
|
153
|
+
/*************************************************************************/
|
154
|
+
|
155
|
+
#define OBJECT_TYPE_CODE 9
|
156
|
+
#define PRIMITIVE_TYPE_CODE 10
|
157
|
+
#define NUMBER_TYPE_CODE 11
|
158
|
+
#define LEXEME_TYPE_CODE 12
|
159
|
+
#define ADDRESS_TYPE_CODE 13
|
160
|
+
#define INSTANCE_TYPE_CODE 14
|
161
|
+
|
162
|
+
typedef enum
|
163
|
+
{
|
164
|
+
FLOAT_BIT = (1 << 0),
|
165
|
+
INTEGER_BIT = (1 << 1),
|
166
|
+
SYMBOL_BIT = (1 << 2),
|
167
|
+
STRING_BIT = (1 << 3),
|
168
|
+
MULTIFIELD_BIT = (1 << 4),
|
169
|
+
EXTERNAL_ADDRESS_BIT = (1 << 5),
|
170
|
+
FACT_ADDRESS_BIT = (1 << 6),
|
171
|
+
INSTANCE_ADDRESS_BIT = (1 << 7),
|
172
|
+
INSTANCE_NAME_BIT = (1 << 8),
|
173
|
+
VOID_BIT = (1 << 9),
|
174
|
+
BOOLEAN_BIT = (1 << 10),
|
175
|
+
} CLIPSType;
|
176
|
+
|
177
|
+
#define NUMBER_BITS (INTEGER_BIT | FLOAT_BIT)
|
178
|
+
#define LEXEME_BITS (SYMBOL_BIT | STRING_BIT | BOOLEAN_BIT)
|
179
|
+
#define ADDRESS_BITS (EXTERNAL_ADDRESS_BIT | FACT_ADDRESS_BIT | INSTANCE_ADDRESS_BIT)
|
180
|
+
#define INSTANCE_BITS (INSTANCE_ADDRESS_BIT | INSTANCE_NAME_BIT)
|
181
|
+
#define SINGLEFIELD_BITS (NUMBER_BITS | LEXEME_BITS | ADDRESS_BITS | INSTANCE_NAME_BIT)
|
182
|
+
#define ANY_TYPE_BITS (VOID_BIT | SINGLEFIELD_BITS | MULTIFIELD_BIT)
|
183
|
+
|
184
|
+
/****************************************************/
|
185
|
+
/* The first 9 primitive types need to retain their */
|
186
|
+
/* values!! Sorted arrays depend on their values!! */
|
187
|
+
/****************************************************/
|
188
|
+
|
189
|
+
#define FLOAT_TYPE 0
|
190
|
+
#define INTEGER_TYPE 1
|
191
|
+
#define SYMBOL_TYPE 2
|
192
|
+
#define STRING_TYPE 3
|
193
|
+
#define MULTIFIELD_TYPE 4
|
194
|
+
#define EXTERNAL_ADDRESS_TYPE 5
|
195
|
+
#define FACT_ADDRESS_TYPE 6
|
196
|
+
#define INSTANCE_ADDRESS_TYPE 7
|
197
|
+
#define INSTANCE_NAME_TYPE 8
|
198
|
+
|
199
|
+
#define VOID_TYPE 9
|
200
|
+
|
201
|
+
#define BITMAP_TYPE 11
|
202
|
+
|
203
|
+
#define FCALL 30
|
204
|
+
#define GCALL 31
|
205
|
+
#define PCALL 32
|
206
|
+
#define GBL_VARIABLE 33
|
207
|
+
#define MF_GBL_VARIABLE 34
|
208
|
+
|
209
|
+
#define SF_VARIABLE 35
|
210
|
+
#define MF_VARIABLE 36
|
211
|
+
#define BITMAPARRAY 39
|
212
|
+
|
213
|
+
#define FACT_PN_CMP1 50
|
214
|
+
#define FACT_JN_CMP1 51
|
215
|
+
#define FACT_JN_CMP2 52
|
216
|
+
#define FACT_SLOT_LENGTH 53
|
217
|
+
#define FACT_PN_VAR1 54
|
218
|
+
#define FACT_PN_VAR2 55
|
219
|
+
#define FACT_PN_VAR3 56
|
220
|
+
#define FACT_JN_VAR1 57
|
221
|
+
#define FACT_JN_VAR2 58
|
222
|
+
#define FACT_JN_VAR3 59
|
223
|
+
#define FACT_PN_CONSTANT1 60
|
224
|
+
#define FACT_PN_CONSTANT2 61
|
225
|
+
#define FACT_STORE_MULTIFIELD 62
|
226
|
+
#define DEFTEMPLATE_PTR 63
|
227
|
+
|
228
|
+
#define OBJ_GET_SLOT_PNVAR1 70
|
229
|
+
#define OBJ_GET_SLOT_PNVAR2 71
|
230
|
+
#define OBJ_GET_SLOT_JNVAR1 72
|
231
|
+
#define OBJ_GET_SLOT_JNVAR2 73
|
232
|
+
#define OBJ_SLOT_LENGTH 74
|
233
|
+
#define OBJ_PN_CONSTANT 75
|
234
|
+
#define OBJ_PN_CMP1 76
|
235
|
+
#define OBJ_JN_CMP1 77
|
236
|
+
#define OBJ_PN_CMP2 78
|
237
|
+
#define OBJ_JN_CMP2 79
|
238
|
+
#define OBJ_PN_CMP3 80
|
239
|
+
#define OBJ_JN_CMP3 81
|
240
|
+
#define DEFCLASS_PTR 82
|
241
|
+
#define HANDLER_GET 83
|
242
|
+
#define HANDLER_PUT 84
|
243
|
+
|
244
|
+
#define DEFGLOBAL_PTR 90
|
245
|
+
|
246
|
+
#define PROC_PARAM 95
|
247
|
+
#define PROC_WILD_PARAM 96
|
248
|
+
#define PROC_GET_BIND 97
|
249
|
+
#define PROC_BIND 98
|
250
|
+
|
251
|
+
#define UNKNOWN_VALUE 173
|
252
|
+
|
253
|
+
#define INTEGER_OR_FLOAT 180
|
254
|
+
#define SYMBOL_OR_STRING 181
|
255
|
+
#define INSTANCE_OR_INSTANCE_NAME 182
|
256
|
+
|
257
|
+
/*************************/
|
258
|
+
/* Macintosh Definitions */
|
259
|
+
/*************************/
|
260
|
+
|
261
|
+
#define CREATOR_STRING "CLIS"
|
262
|
+
#define CREATOR_CODE 'CLIS'
|
263
|
+
|
264
|
+
#endif
|