Compare commits
766
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65cec8d9df | ||
|
|
c4704f4b06 | ||
|
|
cad07e6e16 | ||
|
|
82f0ac4fbd | ||
|
|
28783de62b | ||
|
|
7dbda20be0 | ||
|
|
fdf271c888 | ||
|
|
8e9a68968c | ||
|
|
520e7a3789 | ||
|
|
4bab26918d | ||
|
|
efd353858e | ||
|
|
9b15e1c697 | ||
|
|
64873b4dd7 | ||
|
|
28c5d26429 | ||
|
|
43231cdbc9 | ||
|
|
7209a3e75d | ||
|
|
88e512c92c | ||
|
|
09deafbe23 | ||
|
|
830e29fb80 | ||
|
|
3c17e71b63 | ||
|
|
1d46986e80 | ||
|
|
ca1d62719a | ||
|
|
a6bea3572e | ||
|
|
ae933edba5 | ||
|
|
93c79df2df | ||
|
|
3e9fe17fcd | ||
|
|
874dca8499 | ||
|
|
c7bd9fa995 | ||
|
|
4446d02063 | ||
|
|
97c3d193a1 | ||
|
|
65e0f704fd | ||
|
|
d36c0dde5b | ||
|
|
8ed3d2fe33 | ||
|
|
61d34a352c | ||
|
|
6c9a2582c6 | ||
|
|
0fd354cb39 | ||
|
|
fd8b7e3a6b | ||
|
|
0be8f439ef | ||
|
|
8a8ea3e23a | ||
|
|
70b5d0d0af | ||
|
|
06ee050fb2 | ||
|
|
472bd4cb12 | ||
|
|
fed696dc63 | ||
|
|
35da61660b | ||
|
|
0ef7755151 | ||
|
|
7aa4309848 | ||
|
|
3c21bf00ac | ||
|
|
0f303d5c06 | ||
|
|
cfbd07306d | ||
|
|
cd8efa604f | ||
|
|
af637a28d8 | ||
|
|
0cefcae153 | ||
|
|
b42a909e65 | ||
|
|
dace0f70ef | ||
|
|
43329f557f | ||
|
|
3e8b836b3e | ||
|
|
ead7c6c8c3 | ||
|
|
fc3bcf0578 | ||
|
|
68cca0e222 | ||
|
|
bfe5219dc2 | ||
|
|
ae6f9d9310 | ||
|
|
f8b786ac40 | ||
|
|
53a2bcdd8b | ||
|
|
f11d325641 | ||
|
|
aa6cbe2d72 | ||
|
|
50e2cdb527 | ||
|
|
1f184eae8c | ||
|
|
90f3c5ce26 | ||
|
|
aa85c396bf | ||
|
|
f19cfecebe | ||
|
|
2a50010e6f | ||
|
|
bf14461dae | ||
|
|
ec12b1ce7c | ||
|
|
de375f8cea | ||
|
|
30534dbf0e | ||
|
|
5fddadb1e4 | ||
|
|
20c6d4c800 | ||
|
|
125820c84c | ||
|
|
6984cf6a46 | ||
|
|
322018c6db | ||
|
|
d5f60d72e0 | ||
|
|
aa5b0e3fa2 | ||
|
|
c81d05cff6 | ||
|
|
799a51f340 | ||
|
|
89b00f1596 | ||
|
|
ccb6728efa | ||
|
|
75af3df51c | ||
|
|
0f1196ef94 | ||
|
|
e4277656ef | ||
|
|
8dc5dceb59 | ||
|
|
093e59e5a7 | ||
|
|
177eef8acf | ||
|
|
211bc660da | ||
|
|
0b6853f5a7 | ||
|
|
b158a79f6c | ||
|
|
1f1965beae | ||
|
|
9f35265f75 | ||
|
|
345bcd8174 | ||
|
|
f05ce582ac | ||
|
|
5e1ad8f1c8 | ||
|
|
dcb156f1eb | ||
|
|
1bf945d60b | ||
|
|
380618fa7e | ||
|
|
55d36377c3 | ||
|
|
62be4c90c6 | ||
|
|
c2fddd8a7a | ||
|
|
8adb5e638d | ||
|
|
fceb57390c | ||
|
|
ae18190f69 | ||
|
|
8c9b3471fb | ||
|
|
22c437d45e | ||
|
|
5ea56aac02 | ||
|
|
14c5476537 | ||
|
|
f7e929fe6a | ||
|
|
736d637d63 | ||
|
|
6cf5d1e860 | ||
|
|
faadf26cdf | ||
|
|
e617808be1 | ||
|
|
97de8f9069 | ||
|
|
4f20f391c6 | ||
|
|
a1462e99b0 | ||
|
|
bbc20e3ba2 | ||
|
|
359f949ed6 | ||
|
|
d27564c5ed | ||
|
|
30683985ca | ||
|
|
fe796629a2 | ||
|
|
bfff9e6f86 | ||
|
|
b2287b3b53 | ||
|
|
beeb5614c1 | ||
|
|
ec35904342 | ||
|
|
9bba7d5157 | ||
|
|
4bf478b6e3 | ||
|
|
853aeb4e8b | ||
|
|
725ec378c7 | ||
|
|
5d8c597d8f | ||
|
|
a366339220 | ||
|
|
44fb19669b | ||
|
|
18a6528090 | ||
|
|
6368ed08f9 | ||
|
|
46717ab714 | ||
|
|
7a3d8f0ce5 | ||
|
|
670600e67b | ||
|
|
f8783577d5 | ||
|
|
713b3e67b6 | ||
|
|
93cb422595 | ||
|
|
74d9062ff1 | ||
|
|
9eb23dc2a9 | ||
|
|
2f378267dc | ||
|
|
1f4f78f905 | ||
|
|
0b69a9a5e5 | ||
|
|
30d570a3a0 | ||
|
|
18b4d8282a | ||
|
|
142edd5698 | ||
|
|
371d498c0a | ||
|
|
63fe2f69ee | ||
|
|
029eac6065 | ||
|
|
90de683f5a | ||
|
|
b9189212bd | ||
|
|
9e31f561c6 | ||
|
|
414b8705a2 | ||
|
|
3f8bde4319 | ||
|
|
548fd82ad7 | ||
|
|
2375f10331 | ||
|
|
73358caf4b | ||
|
|
9285090208 | ||
|
|
227dbb84ab | ||
|
|
f2ebe246fa | ||
|
|
69db0c0192 | ||
|
|
5e28f4417a | ||
|
|
61eec0dcc5 | ||
|
|
68d0e7bbb4 | ||
|
|
88e82d8faf | ||
|
|
d6d7aeec95 | ||
|
|
5edde001e5 | ||
|
|
d9d6406b0b | ||
|
|
2cd591be99 | ||
|
|
663414f90d | ||
|
|
b58e30c575 | ||
|
|
4a71f48bc8 | ||
|
|
db4f1a68d5 | ||
|
|
e76d92d082 | ||
|
|
f8bd03507d | ||
|
|
997618fe86 | ||
|
|
e5a55b4ab3 | ||
|
|
99e57aed21 | ||
|
|
f3b1065432 | ||
|
|
18f81e1898 | ||
|
|
a25ee56f6c | ||
|
|
4b58b2dc11 | ||
|
|
3c785b4451 | ||
|
|
7e192a40f3 | ||
|
|
3ed4ffd302 | ||
|
|
61e680ae72 | ||
|
|
9b68d893e7 | ||
|
|
a4d1e03f0d | ||
|
|
573c3ec1d5 | ||
|
|
c0b61b40cb | ||
|
|
ead7664070 | ||
|
|
a9a7e0af4a | ||
|
|
8bf6f74bb8 | ||
|
|
c9031fb76a | ||
|
|
b5c6bd327a | ||
|
|
4afeea4d39 | ||
|
|
5ab50bb68f | ||
|
|
dc38153539 | ||
|
|
254024b954 | ||
|
|
85b76db65a | ||
|
|
ac9fc03986 | ||
|
|
ce88e635f0 | ||
|
|
bab3886f54 | ||
|
|
e1162b63c4 | ||
|
|
e9c28ff7cb | ||
|
|
e934fa246c | ||
|
|
f773771f27 | ||
|
|
fd77902539 | ||
|
|
1732897cbc | ||
|
|
7e46389420 | ||
|
|
b06466ce4b | ||
|
|
284b1893de | ||
|
|
a0b0a10249 | ||
|
|
f93abd2991 | ||
|
|
64ac71cf96 | ||
|
|
e20def2ee1 | ||
|
|
367d0e867d | ||
|
|
41105500c9 | ||
|
|
132ad5ea1f | ||
|
|
11942a3c06 | ||
|
|
f076b04524 | ||
|
|
f3b6498da2 | ||
|
|
7fb53396ce | ||
|
|
575a2f93b3 | ||
|
|
85ea3ed2d4 | ||
|
|
0eb7aabbb3 | ||
|
|
226dfb4697 | ||
|
|
e5a534d5e5 | ||
|
|
6fe8648657 | ||
|
|
8a82142e1b | ||
|
|
20d72fb6d5 | ||
|
|
ab9bd3ae8d | ||
|
|
81a0362c30 | ||
|
|
84472921c1 | ||
|
|
1d01b831aa | ||
|
|
0d2e791e82 | ||
|
|
d39fbaf4d7 | ||
|
|
e422262877 | ||
|
|
71fe947ff5 | ||
|
|
beb2a595f1 | ||
|
|
0b6cd90dd9 | ||
|
|
3fd71cf457 | ||
|
|
0fbc3c0c84 | ||
|
|
a96336ab97 | ||
|
|
b24680d7e5 | ||
|
|
15afe96d67 | ||
|
|
a78ca01b54 | ||
|
|
8627627c5e | ||
|
|
9b091756b1 | ||
|
|
dfce2dcf07 | ||
|
|
5c7e63c75b | ||
|
|
0b456a833e | ||
|
|
a243b4d8c8 | ||
|
|
daec3e2640 | ||
|
|
06b13bb9af | ||
|
|
e38519a7f1 | ||
|
|
12def15dd2 | ||
|
|
a160cc9af6 | ||
|
|
1dfe76b3b4 | ||
|
|
c23ba65c41 | ||
|
|
274de2a91d | ||
|
|
1a757024c4 | ||
|
|
abae0a7c45 | ||
|
|
bfc11face5 | ||
|
|
677261d4fb | ||
|
|
4207a46f07 | ||
|
|
7316fe5070 | ||
|
|
4d32009592 | ||
|
|
0b6078b72b | ||
|
|
36e34862cc | ||
|
|
9dcb6aa640 | ||
|
|
bc5533bda8 | ||
|
|
4e88ad69eb | ||
|
|
b890c156f5 | ||
|
|
0ba7343004 | ||
|
|
f2247d222f | ||
|
|
5288026043 | ||
|
|
6e8cad223e | ||
|
|
018e7cfffc | ||
|
|
458b775f41 | ||
|
|
dc82923cf1 | ||
|
|
aa967b3316 | ||
|
|
17b41da525 | ||
|
|
135adc76c8 | ||
|
|
017faa942f | ||
|
|
46c37207da | ||
|
|
85f45f38e4 | ||
|
|
be378119f4 | ||
|
|
ecde882d5a | ||
|
|
3d90ffdf83 | ||
|
|
5dfca2ed78 | ||
|
|
fbf0272d3b | ||
|
|
c69f9ebab2 | ||
|
|
942fb89f68 | ||
|
|
893936b11f | ||
|
|
e4a8be26da | ||
|
|
c63b3cc9b8 | ||
|
|
2dace5da2e | ||
|
|
7568033499 | ||
|
|
65b6869b30 | ||
|
|
915e0de65f | ||
|
|
9c83ba32a9 | ||
|
|
13f36c11a8 | ||
|
|
6b26410d9d | ||
|
|
3e84677ac9 | ||
|
|
081cf35855 | ||
|
|
c1c3bc1077 | ||
|
|
6351ff38d9 | ||
|
|
a82f7497a6 | ||
|
|
2a3e2a9abf | ||
|
|
eaf9ffc3f3 | ||
|
|
b72f4d404a | ||
|
|
b31d8ef853 | ||
|
|
c865023114 | ||
|
|
25ca2a788d | ||
|
|
a80489dc96 | ||
|
|
35170b388e | ||
|
|
d2680940ad | ||
|
|
e24ac2acd3 | ||
|
|
903277f288 | ||
|
|
5b2782a34c | ||
|
|
97731f8611 | ||
|
|
272928d6e5 | ||
|
|
76944b3a90 | ||
|
|
8a270222c6 | ||
|
|
e8afb772f1 | ||
|
|
0eefd769e3 | ||
|
|
1c8225f79a | ||
|
|
2d8a7373fd | ||
|
|
2300021416 | ||
|
|
91a2dcacf3 | ||
|
|
618deae50e | ||
|
|
1aa78e7e48 | ||
|
|
4129d363b0 | ||
|
|
619c927ecb | ||
|
|
89684015ae | ||
|
|
8423811031 | ||
|
|
4f9ad1c75a | ||
|
|
0c34752882 | ||
|
|
0b3ab924f8 | ||
|
|
fae60fbe8c | ||
|
|
703654ae70 | ||
|
|
9fca25bed6 | ||
|
|
988d2614be | ||
|
|
1a8282d5dc | ||
|
|
235d38a80c | ||
|
|
cba6fec8d7 | ||
|
|
1d2e33e575 | ||
|
|
2829deb7cc | ||
|
|
c83f0792a1 | ||
|
|
482c7905f3 | ||
|
|
46b5e74596 | ||
|
|
ec0443a446 | ||
|
|
6708334b37 | ||
|
|
9025643a1b | ||
|
|
b996d835f5 | ||
|
|
48df74932a | ||
|
|
3b0f0b33ea | ||
|
|
167d1d7fab | ||
|
|
abb43fcb6f | ||
|
|
a2f2f41e66 | ||
|
|
e68afbad49 | ||
|
|
33ff7c57dc | ||
|
|
04a57d0f2a | ||
|
|
062b0e6ae3 | ||
|
|
5c6ffc7dca | ||
|
|
ea80885185 | ||
|
|
8964d2ed05 | ||
|
|
f25fb9d968 | ||
|
|
0336649b07 | ||
|
|
bdcd5166e1 | ||
|
|
dbbd0c63b6 | ||
|
|
cb771f628e | ||
|
|
2a17763354 | ||
|
|
7f19877b1a | ||
|
|
164355c640 | ||
|
|
2c7ed5c826 | ||
|
|
264db5d03c | ||
|
|
423d5e08f6 | ||
|
|
ba6d0a1c0c | ||
|
|
37cfaebb1f | ||
|
|
f233ae0059 | ||
|
|
7950f4db7e | ||
|
|
ec5171fe27 | ||
|
|
c962b1d391 | ||
|
|
dc32b24f3f | ||
|
|
57a3d9ca1a | ||
|
|
ef4d64a98e | ||
|
|
b3047b4b1f | ||
|
|
4bac203373 | ||
|
|
ad2e50b05d | ||
|
|
3e8c468f67 | ||
|
|
0ccca0afc2 | ||
|
|
7cbc9f84ce | ||
|
|
e266db9b3f | ||
|
|
77000dd445 | ||
|
|
1d784c8a90 | ||
|
|
5b68726a3c | ||
|
|
d7b3129834 | ||
|
|
6e3e58df00 | ||
|
|
80eabe9e80 | ||
|
|
5afcabf901 | ||
|
|
105cce4a9c | ||
|
|
cf11cad78a | ||
|
|
34c452e658 | ||
|
|
7627b46e44 | ||
|
|
10ba621ee1 | ||
|
|
5c63ccd6cf | ||
|
|
bc13835a01 | ||
|
|
44b056f9e2 | ||
|
|
061ec0dbc6 | ||
|
|
b600f05bd2 | ||
|
|
719f39f489 | ||
|
|
2c6d346584 | ||
|
|
abf41650ee | ||
|
|
b2a8343741 | ||
|
|
ee32a0f923 | ||
|
|
2a760a1e12 | ||
|
|
2014a75678 | ||
|
|
8cb5c79279 | ||
|
|
62202523b8 | ||
|
|
9ce384b600 | ||
|
|
5aacdb2206 | ||
|
|
6ec39b58aa | ||
|
|
c975ab2380 | ||
|
|
1054952e1e | ||
|
|
2216cf47d3 | ||
|
|
365b787fff | ||
|
|
4b4a4029ed | ||
|
|
c1892febc1 | ||
|
|
f0b2d97d00 | ||
|
|
1fa4927035 | ||
|
|
953021ec9d | ||
|
|
c8f14a0821 | ||
|
|
63049515d1 | ||
|
|
ca7487fa95 | ||
|
|
0f5179e74b | ||
|
|
bfbd8df61e | ||
|
|
dfe69a923d | ||
|
|
50452e8282 | ||
|
|
e74d4dc813 | ||
|
|
653625f56a | ||
|
|
5f702fb702 | ||
|
|
8273ce1866 | ||
|
|
efb82853b7 | ||
|
|
37901afbbb | ||
|
|
6bac26d3c7 | ||
|
|
ff3fd1f5e7 | ||
|
|
9313b8e6ee | ||
|
|
921de860b0 | ||
|
|
5df2f69930 | ||
|
|
31bf315543 | ||
|
|
87c66bb4dc | ||
|
|
c91109b7b4 | ||
|
|
febbb636fc | ||
|
|
7976c8bee5 | ||
|
|
0b42b2fe89 | ||
|
|
d36d12c6d3 | ||
|
|
86bbc327fa | ||
|
|
c8cfac3acc | ||
|
|
9efd75ebc1 | ||
|
|
98283dca34 | ||
|
|
65c703b811 | ||
|
|
2374029ae8 | ||
|
|
c6d841789e | ||
|
|
14689c6db6 | ||
|
|
01db3788a2 | ||
|
|
712d9657e8 | ||
|
|
168e7a93ed | ||
|
|
7ae34348be | ||
|
|
1e95f8f61e | ||
|
|
4df86e5fea | ||
|
|
78427423ab | ||
|
|
c2c0a6443b | ||
|
|
674fa941f6 | ||
|
|
9db1170803 | ||
|
|
7089bdbf5c | ||
|
|
409315841b | ||
|
|
4bde538c65 | ||
|
|
6955a03fca | ||
|
|
b31ffa3968 | ||
|
|
06bfc7d4d1 | ||
|
|
73b3c1b901 | ||
|
|
66deaafb30 | ||
|
|
9e1d078b46 | ||
|
|
31331651df | ||
|
|
6117e532f8 | ||
|
|
b9db4568fe | ||
|
|
ea24200c67 | ||
|
|
acdc338c9d | ||
|
|
9cf54cf374 | ||
|
|
ea339e2ffa | ||
|
|
14d7b32320 | ||
|
|
62ef3c6edd | ||
|
|
521a999af9 | ||
|
|
47d42ad558 | ||
|
|
f63835532b | ||
|
|
cd08570a3f | ||
|
|
4a01038cd0 | ||
|
|
3132089419 | ||
|
|
5c0bea384c | ||
|
|
d64bbc3611 | ||
|
|
236778a5fc | ||
|
|
d6bb20d81b | ||
|
|
6cb750a3eb | ||
|
|
118d8b295b | ||
|
|
64dd1d2a9a | ||
|
|
2ae605d5ae | ||
|
|
23a5a62397 | ||
|
|
aaa1ca04a6 | ||
|
|
d4f13e0179 | ||
|
|
800453e68a | ||
|
|
a74dc1d32c | ||
|
|
d9c89b9e94 | ||
|
|
fdcdd5a966 | ||
|
|
7222c91c01 | ||
|
|
51acb993da | ||
|
|
ebb7a920f2 | ||
|
|
f6078d8b5b | ||
|
|
4b3e433667 | ||
|
|
1fddd17a64 | ||
|
|
647ecbcf99 | ||
|
|
ef2c01d76c | ||
|
|
e17938afe8 | ||
|
|
d5f693a862 | ||
|
|
bd402b2567 | ||
|
|
ca560239ce | ||
|
|
b3b464632b | ||
|
|
0188910a3a | ||
|
|
35ead380af | ||
|
|
b1387b731e | ||
|
|
d1062cddfa | ||
|
|
6e636d1c20 | ||
|
|
f3cd328b24 | ||
|
|
7867505fdc | ||
|
|
57d3d2fe07 | ||
|
|
259750e31e | ||
|
|
9144443d69 | ||
|
|
6004ba458b | ||
|
|
2d060e7cc3 | ||
|
|
6419146cf1 | ||
|
|
ffd0da9ceb | ||
|
|
bf39d90382 | ||
|
|
5b14529f63 | ||
|
|
60141ce6f7 | ||
|
|
f72e01e610 | ||
|
|
7531579d39 | ||
|
|
2ff6f4b434 | ||
|
|
f357ef4c83 | ||
|
|
752f976475 | ||
|
|
03dbb8ee9f | ||
|
|
3e51af51b4 | ||
|
|
87e1f9948c | ||
|
|
b905bec990 | ||
|
|
63298df542 | ||
|
|
319a8ab59d | ||
|
|
607f732671 | ||
|
|
e649757417 | ||
|
|
4515ffca43 | ||
|
|
4e90ff65e8 | ||
|
|
e18b6d5c2a | ||
|
|
ecaa9ba13f | ||
|
|
53fac955ba | ||
|
|
aee532dd14 | ||
|
|
5840883239 | ||
|
|
df100f5764 | ||
|
|
b65af6f982 | ||
|
|
65d3937e72 | ||
|
|
d635ee5ca8 | ||
|
|
bd80de24bc | ||
|
|
44a6abb36e | ||
|
|
cabf5df7ac | ||
|
|
5fc6630b3f | ||
|
|
b7df5a0e6f | ||
|
|
9aa3b4201f | ||
|
|
6d57acff5b | ||
|
|
c3094242c8 | ||
|
|
1c048abd2e | ||
|
|
3e4af5a77e | ||
|
|
a285652f01 | ||
|
|
5abaebb04b | ||
|
|
35b76941bd | ||
|
|
7301b34c27 | ||
|
|
e4426e3a64 | ||
|
|
39d37e9b09 | ||
|
|
a7fc5d1e76 | ||
|
|
f6fde2f1e1 | ||
|
|
d43b52d61e | ||
|
|
9cded87862 | ||
|
|
8de8875cd8 | ||
|
|
7ff99c9564 | ||
|
|
3f0115631b | ||
|
|
bcd9a58abc | ||
|
|
4a0a27cc30 | ||
|
|
5c24152afe | ||
|
|
87fbca7359 | ||
|
|
2338dd11e1 | ||
|
|
f1ee9585d1 | ||
|
|
5d78a327db | ||
|
|
832a6e75b6 | ||
|
|
252f19754f | ||
|
|
1598dee630 | ||
|
|
15993bdd96 | ||
|
|
a8ffbc17d3 | ||
|
|
7f0a0f852f | ||
|
|
cd0d8b496b | ||
|
|
4d945de475 | ||
|
|
bbe607be60 | ||
|
|
38467bdca3 | ||
|
|
78d99f2f4e | ||
|
|
5c021b2b7f | ||
|
|
10fb7419b5 | ||
|
|
f4ac673b71 | ||
|
|
1696fea0c7 | ||
|
|
44e02c957a | ||
|
|
c0e74a9eef | ||
|
|
a7579f0bc9 | ||
|
|
317b40bff0 | ||
|
|
d4d42b7d1c | ||
|
|
492f455598 | ||
|
|
2ccc5ce360 | ||
|
|
05a74dedd8 | ||
|
|
5043c035a3 | ||
|
|
426e2b4ab3 | ||
|
|
2d651bfad4 | ||
|
|
c6f0c44a02 | ||
|
|
6533032fd9 | ||
|
|
26822ef959 | ||
|
|
86f884b399 | ||
|
|
4fd5dd9f74 | ||
|
|
8e08f71fe8 | ||
|
|
b320bfe3f7 | ||
|
|
34d917fb19 | ||
|
|
86bae779b0 | ||
|
|
b15ba38edf | ||
|
|
96bd4520b5 | ||
|
|
5dd996d38d | ||
|
|
5384fe0dbb | ||
|
|
2d4346dd5a | ||
|
|
ce6a37e49a | ||
|
|
0b2f9ee3fc | ||
|
|
a9120d79f7 | ||
|
|
e1fe3e0b9f | ||
|
|
d14e7670c2 | ||
|
|
37a95f5e63 | ||
|
|
207d6c26c2 | ||
|
|
7de64b6bc4 | ||
|
|
a4e96f62ff | ||
|
|
993c40f6ad | ||
|
|
a035292cf0 | ||
|
|
6ca7b04dfd | ||
|
|
427ecaf09f | ||
|
|
b7a8ac4cbb | ||
|
|
2e6ee6695a | ||
|
|
86bf2dff99 | ||
|
|
c4fde8c96f | ||
|
|
3088d3d63f | ||
|
|
99fbadcdfd | ||
|
|
685e95f618 | ||
|
|
b8d35ce517 | ||
|
|
d1f57453dd | ||
|
|
86302fb0f3 | ||
|
|
4efb670ddf | ||
|
|
5bdac5427b | ||
|
|
a01fa5708a | ||
|
|
ec4eed7367 | ||
|
|
c080fbc8dc | ||
|
|
599f51891d | ||
|
|
ce4227c6b5 | ||
|
|
0dd18d246a | ||
|
|
1cc0beec4b | ||
|
|
aa8842ea56 | ||
|
|
2cd5d494f9 | ||
|
|
6092c9b29f | ||
|
|
8f57958813 | ||
|
|
10ef152fc6 | ||
|
|
95d339e2c7 | ||
|
|
25521ee3af | ||
|
|
f7c56d3e5a | ||
|
|
b2b0039d2f | ||
|
|
91e9528afe | ||
|
|
52acad573b | ||
|
|
44ab3e3352 | ||
|
|
30b04d741f | ||
|
|
abf0541ae9 | ||
|
|
bb41fd4863 | ||
|
|
9c5e27590d | ||
|
|
0b16a413f7 | ||
|
|
0d533f55df | ||
|
|
c6cfc06f4f | ||
|
|
d4a21dd654 | ||
|
|
166db7d178 | ||
|
|
0bf73eece7 | ||
|
|
5a6b972e47 | ||
|
|
9e6b419a53 | ||
|
|
33b0629e1e | ||
|
|
05ade5ca60 | ||
|
|
0a46b861a5 | ||
|
|
2c8a05fa0a | ||
|
|
eb9193038c | ||
|
|
d691bdf4d2 | ||
|
|
c686fc163b | ||
|
|
587ce0f16b | ||
|
|
7ccf768adf | ||
|
|
14c854e0df | ||
|
|
9899ad937b | ||
|
|
171671db1f | ||
|
|
d4c7d1bf6f | ||
|
|
d10d955f74 | ||
|
|
626635b644 | ||
|
|
f64d8f75ca | ||
|
|
4c13ff422f | ||
|
|
caf887ed03 | ||
|
|
860d612086 | ||
|
|
2685dbcf31 | ||
|
|
1ec21780c6 | ||
|
|
58dd89044c | ||
|
|
995a8a7fe9 | ||
|
|
e7bbcc0909 | ||
|
|
bc298808dd | ||
|
|
0c0ff74429 | ||
|
|
f3c56ceafc | ||
|
|
ca1a34a698 | ||
|
|
ee86226f5e | ||
|
|
2fd8d1a0be | ||
|
|
98bc5049f7 | ||
|
|
5fa2ebb677 | ||
|
|
f4369ba902 | ||
|
|
e343668210 | ||
|
|
02ef60aee2 | ||
|
|
530c796284 | ||
|
|
f43a106ac3 | ||
|
|
46951e3b32 | ||
|
|
8f72192262 | ||
|
|
3ee5fc0ca8 | ||
|
|
d061b146d5 | ||
|
|
b3a284a59a | ||
|
|
4a4c39fae9 | ||
|
|
29a15c5db9 | ||
|
|
17c518cd12 | ||
|
|
49a6227103 | ||
|
|
a8a7a723c8 | ||
|
|
21e029c362 | ||
|
|
c0e6d32290 | ||
|
|
d68b60fb39 | ||
|
|
a379152c80 | ||
|
|
c56ee55128 | ||
|
|
9eba5b18dd | ||
|
|
701f90025c | ||
|
|
66d6406ed9 | ||
|
|
19e96fa6fa | ||
|
|
0754642e31 | ||
|
|
0c0714260a | ||
|
|
05333b3185 | ||
|
|
6772b3a64e | ||
|
|
31f0644b26 | ||
|
|
b9922e2e0a | ||
|
|
95597e8a71 | ||
|
|
a13481e543 |
@@ -0,0 +1,277 @@
|
||||
name: STEPCODE
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
name: Windows Latest MSVC
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Setup - Ninja
|
||||
uses: seanmiddleditch/gha-setup-ninja@master
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Add github workspace to path
|
||||
# https://github.community/t/deprecated-add-path/136621
|
||||
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
|
||||
- name: Add cl.exe to PATH
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DSC_ENABLE_TESTING=ON
|
||||
# We do the following in order to help ensure files are "flushed"
|
||||
# to disk before compilation is attempted
|
||||
# https://superuser.com/a/1553374/1286142
|
||||
powershell Write-VolumeCache C
|
||||
powershell Write-VolumeCache D
|
||||
|
||||
- name: Build
|
||||
run: cd build && ninja -j1 -v
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd build && ctest -j1 .
|
||||
|
||||
linux:
|
||||
name: Ubuntu Latest GCC
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Setup - Ninja
|
||||
uses: seanmiddleditch/gha-setup-ninja@master
|
||||
|
||||
# TODO - we will want this when the new parser work comes in,
|
||||
# as we won't need perplex and the system tools should suffice
|
||||
# to exercise the generator logic:
|
||||
#
|
||||
# - name: Setup - System
|
||||
# env:
|
||||
# DEBIAN_FRONTEND: noninteractive
|
||||
# run: |
|
||||
# sudo apt-get update
|
||||
# # Install dev tools
|
||||
# sudo apt-get install re2c lemon
|
||||
# sudo apt-get clean
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cmake -S . -G Ninja -B build -D ENABLE_ALL=ON -D CMAKE_BUILD_TYPE=Release -DSC_ENABLE_TESTING=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cmake --build build --config Release
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd build && ctest -j1 . -C Release
|
||||
|
||||
linux_clang:
|
||||
name: Ubuntu Latest Clang
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Setup - Ninja
|
||||
uses: seanmiddleditch/gha-setup-ninja@master
|
||||
|
||||
# TODO - we will want this when the new parser work comes in,
|
||||
# as we won't need perplex and the system tools should suffice
|
||||
# to exercise the generator logic:
|
||||
#
|
||||
# - name: Setup - System
|
||||
# env:
|
||||
# DEBIAN_FRONTEND: noninteractive
|
||||
# run: |
|
||||
# sudo apt-get update
|
||||
# # Install dev tools
|
||||
# sudo apt-get install re2c lemon
|
||||
# sudo apt-get clean
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
CC=clang CXX=clang++ cmake -S . -G Ninja -B build -D ENABLE_ALL=ON -D CMAKE_BUILD_TYPE=Release -DSC_ENABLE_TESTING=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
CC=clang CXX=clang++ cmake --build build --config Release
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd build && ctest -j1 . -C Release
|
||||
|
||||
|
||||
osx:
|
||||
name: macOS Latest Clang
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Setup - Ninja
|
||||
uses: seanmiddleditch/gha-setup-ninja@master
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
cmake -S . -G Ninja -B build -D CMAKE_BUILD_TYPE=Release -DSC_ENABLE_TESTING=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cd build && ninja -j1
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd build && ctest -j1 . -C Release
|
||||
|
||||
brlcad_linux:
|
||||
name: BRL-CAD Linux step-g Test
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Setup - Ninja
|
||||
uses: seanmiddleditch/gha-setup-ninja@master
|
||||
|
||||
- name: Setup - System
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
sudo apt-get update
|
||||
# Install dev tools
|
||||
sudo apt-get install re2c lemon
|
||||
sudo apt-get clean
|
||||
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone --depth 1 https://github.com/BRL-CAD/brlcad.git -b main
|
||||
cd brlcad/src/other/ext && rm -rf stepcode
|
||||
git clone --depth 1 https://github.com/stepcode/stepcode.git -b develop
|
||||
# Ordinarily BRL-CAD keeps track of what files are supposed to be
|
||||
# present in the repository. In this case we're not interested in
|
||||
# updating the list to the working stepcode filelist, so use an empty
|
||||
# list instead
|
||||
echo "set(stepcode_ignore_files)" > stepcode.dist
|
||||
cd ../../../../
|
||||
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cd brlcad
|
||||
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON
|
||||
cd ..
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cd brlcad
|
||||
cmake --build build --config Release --target step-g
|
||||
cd ..
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cd brlcad/build
|
||||
./bin/step-g ../db/nist/NIST_MBE_PMI_3.stp -o nist3.g
|
||||
cd ../..
|
||||
|
||||
|
||||
brlcad_windows:
|
||||
name: BRL-CAD Windows step-g Test
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Setup - Ninja
|
||||
uses: seanmiddleditch/gha-setup-ninja@master
|
||||
|
||||
- name: Add github workspace to path
|
||||
# https://github.community/t/deprecated-add-path/136621
|
||||
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
|
||||
- name: Add cl.exe to PATH
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone --depth 1 https://github.com/BRL-CAD/brlcad.git -b main
|
||||
cd brlcad/src/other/ext
|
||||
cmake -E rm -r stepcode
|
||||
git clone --depth 1 https://github.com/stepcode/stepcode.git -b develop
|
||||
# Ordinarily BRL-CAD keeps track of what files are supposed to be
|
||||
# present in the repository. In this case we're not interested in
|
||||
# updating the list to the working stepcode filelist, so use an empty
|
||||
# list instead
|
||||
echo "set(stepcode_ignore_files)" > stepcode.dist
|
||||
cd ../../../../
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cd brlcad && cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DSC_ENABLE_TESTING=ON
|
||||
cd ..
|
||||
# We do the following in order to help ensure files are "flushed"
|
||||
# to disk before compilation is attempted
|
||||
# https://superuser.com/a/1553374/1286142
|
||||
powershell Write-VolumeCache C
|
||||
powershell Write-VolumeCache D
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd brlcad/build
|
||||
ninja -j1 -v step-g
|
||||
cd ../..
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd brlcad/build
|
||||
./bin/step-g.exe ../db/nist/NIST_MBE_PMI_3.stp -o nist3.g
|
||||
cd ../..
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
# Common build directories used in the source tree
|
||||
/build
|
||||
/.build
|
||||
|
||||
# Temporary files
|
||||
*~
|
||||
\#*\#
|
||||
.\#*
|
||||
[._]*.s[a-v][a-z]
|
||||
[._]*.sw[a-p]
|
||||
[._]s[a-v][a-z]
|
||||
[._]sw[a-p]
|
||||
**/__pycache__/
|
||||
|
||||
# OS specific files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
|
||||
# Tool specific patterns
|
||||
*.kdev4
|
||||
.kdev_include_paths
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
language: cpp
|
||||
compiler:
|
||||
- clang
|
||||
script: mkdir build && cd build && cmake .. -DSC_ENABLE_TESTING=ON && make -j2 && make -j2 test
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
notifications:
|
||||
irc: "chat.freenode.net#stepcode"
|
||||
email: scl-dev@groups.google.com
|
||||
on_success: change
|
||||
on_failure: always
|
||||
@@ -5,21 +5,27 @@ http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/src/other/step/?vie
|
||||
In alphabetical order:
|
||||
Bertucat, Roch (rbertucat)
|
||||
Bowman, W. Keith (indianlarry)
|
||||
da Costa, Raphael Kubo (rakuco)
|
||||
DeGraw, Jason (jasondegraw)
|
||||
Easterbrook, Zach (lainiwakurax)
|
||||
Greenwald, Erik (erikg, erikgreenwald)
|
||||
Horler, Chris (cshorler)
|
||||
Lanning, Craig (craigl64)
|
||||
Loman, David (davidloman)
|
||||
McDonald, Rob (ramcdona)
|
||||
Mittal, Pulkit (hoiji09)
|
||||
Morrison, Christopher Sean (sean, morrison, brlcad)
|
||||
Paviot, Thomas (tpaviot)
|
||||
Pictor, Mark (mpictor)
|
||||
Reed, Nick (nickreed)
|
||||
Shah, Kesha (kesha)
|
||||
Shah, Kesha (kesha, keshashah)
|
||||
Sparks, Devon (devonsparks)
|
||||
Thomas, Dawn (homovulgaris, madant)
|
||||
Wouters, Dave (davyw)
|
||||
Yapp, Clifford (starseeker)
|
||||
|
||||
Special thanks:
|
||||
Hunten, Keith (Lockheed Martin)
|
||||
Lubbell, Joshua (NIST)
|
||||
Stirk, Charlie (CostVision)
|
||||
Thurman, Tom (TRThurman)
|
||||
|
||||
+145
-370
@@ -32,133 +32,48 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# *******************************************************************
|
||||
# *** SC's CMakeLists.txt ***
|
||||
# *** STEPcode's CMakeLists.txt ***
|
||||
# *******************************************************************
|
||||
|
||||
# This file contains the top level CMakeLists.txt logic for the
|
||||
# SC software package.
|
||||
# STEPcode software package.
|
||||
|
||||
PROJECT(SC)
|
||||
|
||||
# SC version
|
||||
SET(SC_VERSION_MAJOR 0)
|
||||
SET(SC_VERSION_MINOR 7-dev)
|
||||
SET(SC_VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR})
|
||||
|
||||
# SC ABI version. SC_ABI_SOVERSION should be incremented
|
||||
# for each release introducing API incompatibilities
|
||||
SET(SC_ABI_SOVERSION 2)
|
||||
SET(SC_ABI_VERSION ${SC_ABI_SOVERSION}.0.0)
|
||||
project(SC)
|
||||
|
||||
# Minimum required version of CMake
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
|
||||
IF(COMMAND CMAKE_POLICY)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
ENDIF(COMMAND CMAKE_POLICY)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
if (POLICY CMP0077)
|
||||
cmake_policy(SET CMP0077 OLD)
|
||||
endif (POLICY CMP0077)
|
||||
|
||||
IF( NOT DEFINED INCLUDE_INSTALL_DIR )
|
||||
SET( INCLUDE_INSTALL_DIR include )
|
||||
ENDIF( NOT DEFINED INCLUDE_INSTALL_DIR )
|
||||
# SC version
|
||||
set(SC_VERSION_MAJOR 0)
|
||||
set(SC_VERSION_MINOR 9)
|
||||
set(SC_VERSION_PATCH 1)
|
||||
set(SC_VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR}.${SC_VERSION_PATCH})
|
||||
|
||||
IF( NOT DEFINED LIB_INSTALL_DIR )
|
||||
SET( LIB_INSTALL_DIR lib )
|
||||
ENDIF( NOT DEFINED LIB_INSTALL_DIR )
|
||||
|
||||
IF( NOT DEFINED BIN_INSTALL_DIR )
|
||||
SET( BIN_INSTALL_DIR bin )
|
||||
ENDIF( NOT DEFINED BIN_INSTALL_DIR )
|
||||
|
||||
IF( NOT DEFINED SC_BUILD_TYPE )
|
||||
SET( SC_BUILD_TYPE "Debug" CACHE STRING "Build type" ) # By default set debug build
|
||||
ENDIF( NOT DEFINED SC_BUILD_TYPE )
|
||||
IF(NOT SC_IS_SUBBUILD)
|
||||
SET(CMAKE_BUILD_TYPE ${SC_BUILD_TYPE} CACHE INTERNAL "Build type, immutable" FORCE )
|
||||
ELSE(NOT SC_IS_SUBBUILD)
|
||||
SET(CMAKE_BUILD_TYPE ${SC_BUILD_TYPE} )
|
||||
ENDIF(NOT SC_IS_SUBBUILD)
|
||||
|
||||
# Define helper macro OPTION_WITH_DEFAULT
|
||||
MACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
|
||||
IF( NOT DEFINED ${OPTION_NAME} )
|
||||
SET( ${OPTION_NAME} ${OPTION_DEFAULT} )
|
||||
ENDIF( NOT DEFINED ${OPTION_NAME} )
|
||||
OPTION( ${OPTION_NAME} "${OPTION_STRING}" ${${OPTION_NAME}} )
|
||||
ENDMACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
|
||||
|
||||
# build shared libs by default
|
||||
OPTION_WITH_DEFAULT(SC_BUILD_SHARED_LIBS "Build shared libs" ON )
|
||||
|
||||
# don't build static libs by default
|
||||
OPTION_WITH_DEFAULT(SC_BUILD_STATIC_LIBS "Build static libs" OFF)
|
||||
|
||||
OPTION_WITH_DEFAULT(SC_PYTHON_GENERATOR "Compile exp2python" ON)
|
||||
OPTION_WITH_DEFAULT(SC_CPP_GENERATOR "Compile exp2cxx" ON)
|
||||
|
||||
OPTION_WITH_DEFAULT(SC_MEMMGR_ENABLE_CHECKS "Enable sc_memmgr's memory leak detection" OFF)
|
||||
OPTION_WITH_DEFAULT(SC_TRACE_FPRINTF "Enable extra comments in generated code so the code's source in exp2cxx may be located" OFF)
|
||||
|
||||
if(NOT DEFINED SC_SDAI_ADDITIONAL_EXES_SRCS )
|
||||
set( SC_SDAI_ADDITIONAL_EXES_SRCS "" CACHE STRING "Source files for additional executables to be linked with SDAI libs" )
|
||||
endif(NOT DEFINED SC_SDAI_ADDITIONAL_EXES_SRCS )
|
||||
|
||||
if( NOT DEFINED SC_BUILD_SCHEMAS )
|
||||
set( SCHEMAS_WARNING TRUE )
|
||||
#this makes SC_BUILD_SCHEMAS show up in cmake-gui
|
||||
SET(SC_BUILD_SCHEMAS "ALL" CACHE string "Semicolon-separated list of paths to EXPRESS schemas to be built" )
|
||||
endif( NOT DEFINED SC_BUILD_SCHEMAS )
|
||||
# Set language standards
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# CMake derives much of its functionality from modules, typically
|
||||
# stored in one directory - let CMake know where to find them.
|
||||
SET(SC_CMAKE_DIR "${SC_SOURCE_DIR}/cmake")
|
||||
if(NOT IS_SUBBUILD)
|
||||
SET(CMAKE_MODULE_PATH "${SC_CMAKE_DIR};${CMAKE_MODULE_PATH}")
|
||||
else(NOT IS_SUBBUILD)
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SC_CMAKE_DIR}")
|
||||
endif(NOT IS_SUBBUILD)
|
||||
|
||||
INCLUDE(${SC_CMAKE_DIR}/SC_Utils.cmake)
|
||||
|
||||
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
|
||||
# to "C" so things like date output are as expected
|
||||
SET(_orig_lc_all $ENV{LC_ALL})
|
||||
SET(_orig_lc_messages $ENV{LC_MESSAGES})
|
||||
SET(_orig_lang $ENV{LANG})
|
||||
IF(_orig_lc_all)
|
||||
SET(ENV{LC_ALL} C)
|
||||
ENDIF(_orig_lc_all)
|
||||
IF(_orig_lc_messages)
|
||||
SET(ENV{LC_MESSAGES} C)
|
||||
ENDIF(_orig_lc_messages)
|
||||
IF(_orig_lang)
|
||||
SET(ENV{LANG} C)
|
||||
ENDIF(_orig_lang)
|
||||
set(SC_CMAKE_DIR "${SC_SOURCE_DIR}/cmake")
|
||||
list(APPEND CMAKE_MODULE_PATH "${SC_CMAKE_DIR}")
|
||||
|
||||
# OpenBSD has its own naming conventions. Set a platform variable based on
|
||||
# the OS name so we can test for it succinctly.
|
||||
if ("${CMAKE_SYSTEM}" MATCHES ".*OpenBSD.*")
|
||||
set(OPENBSD ON)
|
||||
endif ("${CMAKE_SYSTEM}" MATCHES ".*OpenBSD.*")
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Coverage option
|
||||
OPTION_WITH_DEFAULT( SC_ENABLE_COVERAGE "Enable code coverage test" OFF )
|
||||
IF(SC_ENABLE_COVERAGE)
|
||||
SET(SC_ENABLE_TESTING ON CACHE BOOL "Testing enabled by coverage option" FORCE)
|
||||
# build static libs, better coverage report
|
||||
SET(SC_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE )
|
||||
SET(SC_BUILD_STATIC_LIBS ON CACHE BOOL "Build static libs" FORCE )
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage" CACHE STRING "Extra linker flags required by code coverage" FORCE)
|
||||
SET(SC_BUILD_TYPE "Debug" CACHE STRING "Build type required by testing framework" FORCE)
|
||||
SET( SC_PYTHON_GENERATOR OFF ) #won't build with static libs
|
||||
ENDIF(SC_ENABLE_COVERAGE)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Testing option
|
||||
OPTION_WITH_DEFAULT( SC_ENABLE_TESTING "Enable unittesting framework" OFF )
|
||||
IF(SC_ENABLE_TESTING)
|
||||
if( NOT DEFINED SC_BUILD_SCHEMAS )
|
||||
set( SC_BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
|
||||
endif()
|
||||
INCLUDE(CTest)
|
||||
ENABLE_TESTING()
|
||||
ENDIF(SC_ENABLE_TESTING)
|
||||
# Set up various relative path variables and build output directories
|
||||
include(Path_Setup)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# The following logic is what allows binaries to run successfully in
|
||||
@@ -168,291 +83,151 @@ ENDIF(SC_ENABLE_TESTING)
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
if(NOT DEFINED CMAKE_SKIP_BUILD_RPATH)
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
endif()
|
||||
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
if(NOT DEFINED CMAKE_BUILD_WITH_INSTALL_RPATH)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
endif()
|
||||
|
||||
# the RPATH/INSTALL_NAME_DIR to be used when installing
|
||||
if (NOT APPLE)
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
|
||||
if(NOT DEFINED CMAKE_INSTALL_RPATH)
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
|
||||
endif()
|
||||
endif(NOT APPLE)
|
||||
# On OSX, we need to set INSTALL_NAME_DIR instead of RPATH
|
||||
# http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_INSTALL_NAME_DIR
|
||||
set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
if(NOT DEFINED CMAKE_INSTALL_NAME_DIR)
|
||||
set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
endif()
|
||||
|
||||
# add the automatically determined parts of the RPATH which point to
|
||||
# directories outside the build tree to the install RPATH
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Output directories.
|
||||
# When this is a subbuild, assume that the parent project controls these
|
||||
IF( NOT SC_IS_SUBBUILD )
|
||||
IF(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SC_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ENDIF(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
IF(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SC_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
ENDIF(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
IF(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SC_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
ENDIF(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
|
||||
FOREACH(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
|
||||
STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
|
||||
IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SC_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SC_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SC_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
ENDFOREACH()
|
||||
ENDIF( NOT SC_IS_SUBBUILD )
|
||||
if(NOT DEFINED CMAKE_INSTALL_RPATH_USE_LINK_PATH)
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure install locations.
|
||||
#---------------------------------------------------------------------
|
||||
# Build options
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
option(BUILD_STATIC_LIBS "Build static libraries" OFF)
|
||||
|
||||
option(SC_PYTHON_GENERATOR "Compile exp2python" ON)
|
||||
option(SC_CPP_GENERATOR "Compile exp2cxx" ON)
|
||||
|
||||
option(SC_TRACE_FPRINTF "Enable extra comments in generated code so the code's source in exp2cxx may be located" OFF)
|
||||
|
||||
option(SC_ENABLE_COVERAGE "Enable code coverage test" OFF)
|
||||
if (SC_ENABLE_COVERAGE AND ${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage" CACHE STRING "Extra linker flags required by code coverage" FORCE)
|
||||
endif (SC_ENABLE_COVERAGE AND ${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
|
||||
|
||||
option(SC_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
|
||||
mark_as_advanced(SC_BUILD_EXPRESS_ONLY)
|
||||
|
||||
option(SC_ENABLE_TESTING "Enable unittesting framework" OFF)
|
||||
if(SC_ENABLE_TESTING)
|
||||
if(NOT "${SC_BUILD_EXPRESS_ONLY}" AND NOT DEFINED SC_BUILD_SCHEMAS)
|
||||
set(SC_BUILD_SCHEMAS "ALL") #test all schemas, unless otherwise specified
|
||||
endif()
|
||||
include(CTest)
|
||||
endif(SC_ENABLE_TESTING)
|
||||
|
||||
# SC_ADDEXEC and SC_ADDLIB macros, dllimport/export, etc
|
||||
include(SC_Targets)
|
||||
|
||||
# Macros related to paths
|
||||
include(SC_Paths)
|
||||
|
||||
# locale stuff
|
||||
include(SC_Locale)
|
||||
|
||||
# logic related to regenerating the lexer and parser source code
|
||||
include(SC_Regenerate)
|
||||
|
||||
# create config.h header
|
||||
include(SC_Config_Headers)
|
||||
|
||||
if(NOT DEFINED SC_SDAI_ADDITIONAL_EXES_SRCS)
|
||||
set(SC_SDAI_ADDITIONAL_EXES_SRCS "" CACHE STRING "Source files for additional executables to be linked with SDAI libs")
|
||||
endif(NOT DEFINED SC_SDAI_ADDITIONAL_EXES_SRCS)
|
||||
|
||||
if(NOT "${SC_BUILD_EXPRESS_ONLY}" AND NOT DEFINED SC_BUILD_SCHEMAS)
|
||||
list(APPEND CONFIG_END_MESSAGES
|
||||
"** Note: CMake variable SC_BUILD_SCHEMAS was not set - defaults to building ALL schemas")
|
||||
# this makes SC_BUILD_SCHEMAS show up in cmake-gui
|
||||
set(SC_BUILD_SCHEMAS "ALL" CACHE STRING "Semicolon-separated list of paths to EXPRESS schemas to be built")
|
||||
endif()
|
||||
|
||||
# The location in which to install SC. Need a good Debug location
|
||||
# for Windows. Only do this if CMAKE_INSTALL_PREFIX hasn't been set
|
||||
# already, to try and allow parent builds (if any) some control.
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
IF(NOT WIN32)
|
||||
IF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||
SET(SC_INSTALL_PREFIX "${SC_SOURCE_DIR}/../sc-install")
|
||||
ELSE()
|
||||
SET(SC_INSTALL_PREFIX "/usr/local")
|
||||
ENDIF()
|
||||
ENDIF(NOT WIN32)
|
||||
SET( SC_INSTALL_PREFIX ${SC_INSTALL_PREFIX} CACHE
|
||||
PATH "Install prefix prepended to target to create install location" )
|
||||
SET( CMAKE_INSTALL_PREFIX ${SC_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories if target destination is not absolute, immutable" FORCE )
|
||||
list(APPEND CONFIG_END_MESSAGES
|
||||
".. Don't worry about any messages above about missing headers or failed tests, as long as"
|
||||
" you see 'Configuring done' below. Headers and features vary by compiler."
|
||||
".. Generating step can take a while if you are building several schemas.")
|
||||
endif(NOT SC_IS_SUBBUILD)
|
||||
|
||||
OPTION(SC_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
|
||||
MARK_AS_ADVANCED(SC_BUILD_EXPRESS_ONLY)
|
||||
|
||||
# Take the sc config file template as the starting point for
|
||||
# sc_cf.h.in - scripts may need to append to the template, so
|
||||
# it is read into memory initially.
|
||||
SET(CONFIG_H_FILE ${SC_BINARY_DIR}/include/sc_cf.h.in)
|
||||
set_source_files_properties(${CONFIG_H_FILE} PROPERTIES GENERATED TRUE)
|
||||
set(CMAKE_CURRENT_PROJECT SC)
|
||||
define_property(GLOBAL PROPERTY SC_CONFIG_H_CONTENTS BRIEF_DOCS "config.h.in contents" FULL_DOCS "config.h.in contents for SC project")
|
||||
if(NOT COMMAND CONFIG_H_APPEND)
|
||||
macro(CONFIG_H_APPEND PROJECT_NAME NEW_CONTENTS)
|
||||
if(PROJECT_NAME)
|
||||
get_property(${PROJECT_NAME}_CONFIG_H_CONTENTS GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS)
|
||||
set(${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS "${${PROJECT_NAME}_CONFIG_H_CONTENTS}${NEW_CONTENTS}")
|
||||
set_property(GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS "${${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS}")
|
||||
endif(PROJECT_NAME)
|
||||
endmacro(CONFIG_H_APPEND NEW_CONTENTS)
|
||||
endif(NOT COMMAND CONFIG_H_APPEND)
|
||||
file(READ ${SC_SOURCE_DIR}/include/sc_cf_cmake.h.in CONFIG_H_FILE_CONTENTS)
|
||||
CONFIG_H_APPEND(SC "${CONFIG_H_FILE_CONTENTS}")
|
||||
|
||||
# The Express parser uses the tools Perplex, RE2C and Lemon to generate code
|
||||
# from higher level inputs. Depending on available tools and options, the
|
||||
# SC build can either re-generate code as part of the build, or use cached
|
||||
# files that are ready for compilation.
|
||||
#
|
||||
# SC_GENERATE_LEXER_PARSER is the "high level" control a user sets to determine
|
||||
# how the SC build will interact (or not) with these tools. AUTO (the
|
||||
# default) means it will search for the necessary tools, and use them only if
|
||||
# everything is found. If not, it will fall back to the cached versions. If
|
||||
# this option is set to ON and the necessary tools are not found, the
|
||||
# configure step will fail. If it is set to OFF, SC will not even try to use
|
||||
# the generators and will instead use the cached sources.
|
||||
if(NOT SC_GENERATE_LEXER_PARSER)
|
||||
set(SC_GENERATE_LEXER_PARSER "AUTO" CACHE STRING "Use Perplex, RE2C and Lemon to generate C source code.")
|
||||
else(NOT SC_GENERATE_LEXER_PARSER)
|
||||
string(TOUPPER "${SC_GENERATE_LEXER_PARSER}" SC_GENERATE_LEXER_PARSER)
|
||||
endif(NOT SC_GENERATE_LEXER_PARSER)
|
||||
set_property(CACHE SC_GENERATE_LEXER_PARSER PROPERTY STRINGS AUTO ON OFF)
|
||||
if (NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "AUTO" AND NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON" AND NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
|
||||
message(WARNING "Unknown value ${SC_GENERATE_LEXER_PARSER} supplied for BRLCAD_WORD_SIZE - defaulting to AUTO")
|
||||
message(WARNING "Valid options are AUTO, ON and OFF")
|
||||
set(SC_GENERATE_LEXER_PARSER "AUTO" CACHE STRING "Use Perplex, RE2C and Lemon to generate C source code.")
|
||||
endif (NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "AUTO" AND NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON" AND NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
|
||||
|
||||
# If the generators have not been turned off, we need to check for them
|
||||
if(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
|
||||
find_package(LEMON)
|
||||
find_package(RE2C)
|
||||
find_package(PERPLEX)
|
||||
if(LEMON_EXECUTABLE AND LEMON_TEMPLATE AND PERPLEX_EXECUTABLE AND PERPLEX_TEMPLATE AND RE2C_EXECUTABLE)
|
||||
# Templates may be anywhere - make sure we have a stable path if a relative
|
||||
# path was specified at CMake time
|
||||
get_filename_component(lemon_template_fpath "${LEMON_TEMPLATE}" ABSOLUTE)
|
||||
if(NOT "${lemon_template_fpath}" STREQUAL "${LEMON_TEMPLATE}")
|
||||
get_filename_component(LEMON_TEMPLATE "${CMAKE_BINARY_DIR}/${LEMON_TEMPLATE}" ABSOLUTE)
|
||||
endif(NOT "${lemon_template_fpath}" STREQUAL "${LEMON_TEMPLATE}")
|
||||
get_filename_component(perplex_template_fpath "${PERPLEX_TEMPLATE}" ABSOLUTE)
|
||||
if(NOT "${perplex_template_fpath}" STREQUAL "${PERPLEX_TEMPLATE}")
|
||||
get_filename_component(PERPLEX_TEMPLATE "${CMAKE_BINARY_DIR}/${PERPLEX_TEMPLATE}" ABSOLUTE)
|
||||
endif(NOT "${perplex_template_fpath}" STREQUAL "${PERPLEX_TEMPLATE}")
|
||||
|
||||
if(NOT COMMAND LEMON_TARGET)
|
||||
include(${SC_CMAKE_DIR}/LEMON_Util.cmake)
|
||||
endif(NOT COMMAND LEMON_TARGET)
|
||||
if(NOT COMMAND PERPLEX_TARGET)
|
||||
include(${SC_CMAKE_DIR}/PERPLEX_Util.cmake)
|
||||
endif(NOT COMMAND PERPLEX_TARGET)
|
||||
set(SC_GENERATE_LP_SOURCES 1)
|
||||
else(LEMON_EXECUTABLE AND LEMON_TEMPLATE AND PERPLEX_EXECUTABLE AND PERPLEX_TEMPLATE AND RE2C_EXECUTABLE)
|
||||
if("${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON")
|
||||
message(FATAL_ERROR "\nSC_GENERATE_LEXER_PARSER set to ON, but one or more components of the Perplex/RE2C/Lemon toolchain were not found.\n")
|
||||
else("${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON")
|
||||
set(SC_GENERATE_LP_SOURCES 0)
|
||||
endif("${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON")
|
||||
endif(LEMON_EXECUTABLE AND LEMON_TEMPLATE AND PERPLEX_EXECUTABLE AND PERPLEX_TEMPLATE AND RE2C_EXECUTABLE)
|
||||
else(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
|
||||
set(SC_GENERATE_LP_SOURCES 0)
|
||||
endif(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
|
||||
|
||||
INCLUDE(CheckLibraryExists)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
INCLUDE(CheckFunctionExists)
|
||||
INCLUDE(CheckTypeSize)
|
||||
INCLUDE(CMakePushCheckState)
|
||||
INCLUDE(CheckCXXSourceRuns)
|
||||
|
||||
CHECK_INCLUDE_FILE(ndir.h HAVE_NDIR_H)
|
||||
CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
|
||||
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
|
||||
CHECK_INCLUDE_FILE(sysent.h HAVE_SYSENT_H)
|
||||
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
|
||||
CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
|
||||
CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
|
||||
CHECK_INCLUDE_FILE(process.h HAVE_PROCESS_H)
|
||||
CHECK_INCLUDE_FILE(io.h HAVE_IO_H)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(abs HAVE_ABS)
|
||||
CHECK_FUNCTION_EXISTS(memcpy HAVE_MEMCPY)
|
||||
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
|
||||
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
|
||||
|
||||
CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
|
||||
|
||||
set( TEST_STD_THREAD "
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
void do_work() {
|
||||
std::cout << \"thread\" << std::endl;
|
||||
}
|
||||
int main() {
|
||||
std::thread t(do_work);
|
||||
t.join();
|
||||
}
|
||||
" )
|
||||
cmake_push_check_state()
|
||||
if( UNIX )
|
||||
set( CMAKE_REQUIRED_FLAGS "-pthread -std=c++0x" )
|
||||
else( UNIX )
|
||||
# vars probably need set for MSVC11, embarcadero, etc
|
||||
endif( UNIX )
|
||||
CHECK_CXX_SOURCE_RUNS( "${TEST_STD_THREAD}" HAVE_STD_THREAD ) #quotes are *required*!
|
||||
cmake_pop_check_state()
|
||||
|
||||
# Now that all the tests are done, configure the sc_cf.h file:
|
||||
get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY SC_CONFIG_H_CONTENTS)
|
||||
file(WRITE ${CONFIG_H_FILE} "${CONFIG_H_FILE_CONTENTS}")
|
||||
configure_file(${CONFIG_H_FILE} ${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_cf.h)
|
||||
|
||||
################ create sc_version_string.h, http://stackoverflow.com/questions/3780667
|
||||
# Using 'ver_string' instead of 'sc_version_string.h' is a trick to force the
|
||||
# command to always execute when the custom target is built. It works because
|
||||
# a file by that name never exists.
|
||||
configure_file(${SC_CMAKE_DIR}/sc_version_string.cmake ${SC_BINARY_DIR}/sc_version_string.cmake @ONLY)
|
||||
add_custom_target(version_string ALL DEPENDS ver_string )
|
||||
# creates sc_version_string.h using cmake script
|
||||
add_custom_command(OUTPUT ver_string ${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
|
||||
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${SC_SOURCE_DIR}
|
||||
-DBINARY_DIR=${SC_BINARY_DIR}
|
||||
-P ${SC_BINARY_DIR}/sc_version_string.cmake)
|
||||
# sc_version_string.h is a generated file
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
|
||||
PROPERTIES GENERATED TRUE
|
||||
HEADER_FILE_ONLY TRUE )
|
||||
################
|
||||
|
||||
if(MSVC)
|
||||
# add_definitions( -Wall )
|
||||
add_definitions( -D__MSVC__ -D__WIN32__ )
|
||||
# Disable warning for preferred usage of secure functions (example strcpy should be strcpy_s, ...)
|
||||
add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS )
|
||||
elseif(BORLAND)
|
||||
add_definitions( -D__BORLAND__ -D__WIN32__ )
|
||||
else()
|
||||
add_definitions( -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long )
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
|
||||
endif()
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||
add_definitions(-pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${SC_SOURCE_DIR}/include
|
||||
${SC_BINARY_DIR}/include
|
||||
)
|
||||
)
|
||||
|
||||
ADD_SUBDIRECTORY(src/base)
|
||||
ADD_SUBDIRECTORY(src/express)
|
||||
ADD_SUBDIRECTORY(src/exppp)
|
||||
ADD_SUBDIRECTORY(src/exp2cxx)
|
||||
ADD_SUBDIRECTORY(src/exp2python)
|
||||
ADD_SUBDIRECTORY(src/clstepcore)
|
||||
ADD_SUBDIRECTORY(src/cleditor)
|
||||
ADD_SUBDIRECTORY(src/cldai)
|
||||
ADD_SUBDIRECTORY(src/clutils)
|
||||
if( NOT WIN32 ) # don't build cllazyfile on windows until export/import macros are in place
|
||||
ADD_SUBDIRECTORY( src/cllazyfile )
|
||||
endif( NOT WIN32 )
|
||||
ADD_SUBDIRECTORY(include)
|
||||
ADD_SUBDIRECTORY(data)
|
||||
IF(SC_ENABLE_TESTING)
|
||||
ADD_SUBDIRECTORY( test )
|
||||
ENDIF(SC_ENABLE_TESTING)
|
||||
ADD_SUBDIRECTORY(doc)
|
||||
|
||||
if( SCHEMAS_WARNING )
|
||||
message( "** CMake variable SC_BUILD_SCHEMAS was not set. Defaults to building ALL schemas, which will take a")
|
||||
message(" while; see http://stepcode.org/mw/index.php?title=STEPcode_CMake_variables#SC_BUILD_SCHEMAS" )
|
||||
endif( SCHEMAS_WARNING )
|
||||
message( ".. Don't worry about any messages above about missing headers or failed tests, as long as\n you see '-- Configuring done' below. Headers and features vary by compiler." )
|
||||
|
||||
# this is for testing - 'make core' builds everything that isn't generated
|
||||
add_custom_target( core )
|
||||
add_dependencies( core stepdai check-express stepeditor exp2cxx )
|
||||
add_subdirectory(src/express)
|
||||
add_subdirectory(src/exppp)
|
||||
add_subdirectory(src/exp2cxx)
|
||||
add_subdirectory(src/exp2python)
|
||||
add_subdirectory(src/clstepcore)
|
||||
add_subdirectory(src/cleditor)
|
||||
add_subdirectory(src/cldai)
|
||||
add_subdirectory(src/clutils)
|
||||
add_subdirectory(src/cllazyfile)
|
||||
add_subdirectory(include)
|
||||
add_subdirectory(data)
|
||||
if(SC_ENABLE_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif(SC_ENABLE_TESTING)
|
||||
add_subdirectory(doc)
|
||||
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
###############################################################################
|
||||
# SC Packaging #
|
||||
# $make package #
|
||||
###############################################################################
|
||||
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEPcode")
|
||||
SET(CPACK_SET_DESTDIR "ON")
|
||||
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${SC_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${SC_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_NAME SC )
|
||||
|
||||
SET(CPACK_PACKAGE_CONTACT "SC Developers <scl-dev@googlegroups.com>")
|
||||
INCLUDE(CPack)
|
||||
|
||||
########################################################################################
|
||||
# Uninstall code #
|
||||
# From http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F #
|
||||
# ######################################################################################
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# SC Packaging
|
||||
# $make package
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEPcode")
|
||||
set(CPACK_SET_DESTDIR "ON")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${SC_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${SC_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_NAME SC)
|
||||
set(CPACK_PACKAGE_CONTACT "SC Developers <scl-dev@googlegroups.com>")
|
||||
include(CPack)
|
||||
endif(NOT SC_IS_SUBBUILD)
|
||||
|
||||
|
||||
# CONFIG_END_MESSAGES - list of messages to be printed after everything else is done.
|
||||
# THIS MUST BE LAST to ensure that they are visible to the user without scrolling.
|
||||
foreach(_msg ${CONFIG_END_MESSAGES})
|
||||
message(STATUS "${_msg}")
|
||||
endforeach(_msg ${CONFIG_END_MESSAGES})
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# How to contribute
|
||||
|
||||
We love contributions!
|
||||
|
||||
## Getting started
|
||||
|
||||
* Create a github account if you haven't already, and fork the project
|
||||
* Create a new branch, using a branch name that gives an idea of what the changes are about
|
||||
* One topic per commit; a number of small commits are better than one big one
|
||||
* Do not introduce whitespace changes! (**Windows users:** `git config --global core.autocrlf true`)
|
||||
* Encouraged but not enforced: each commit should stand alone, in the sense that the code should compile and run at that point.
|
||||
* One major topic per pull request. Commits that fix small things (typos, formatting) are perfectly acceptable in a PR fixing a bug or adding a feature.
|
||||
* Tests are good. Tests are required unless you're fixing something simple or that was obviously broken.
|
||||
* Do not change EXPRESS schema definition without reference to an upstream change.
|
||||
* Make your changes and push them to your GitHub repo
|
||||
* Once your branch is pushed, submit a pull request.
|
||||
- enable github option on each PR 'Allow edits from maintainers', refer to github help if necessary
|
||||
* We'll look at the PR and either merge (possibly after rebase) or add feedback.
|
||||
- If there isn't any activity within several days send a message to the mailing list - `scl-dev` AT `groups.google.com`.
|
||||
|
||||
## Coding Standards
|
||||
|
||||
SC's source has been reformatted with astyle. When making changes, try
|
||||
to match the current formatting. The main points are:
|
||||
|
||||
- compact (java-style) brackets:
|
||||
```C
|
||||
if( a == 3 ) {
|
||||
c = 5;
|
||||
function( a, b );
|
||||
} else {
|
||||
somefunc();
|
||||
}
|
||||
```
|
||||
- indents are 4 spaces
|
||||
- no tab characters
|
||||
- line endings are LF (linux), not CRLF (windows)
|
||||
- brackets around single-line conditionals
|
||||
- spaces inside parentheses and around operators
|
||||
- return type on the same line as the function name, unless that's
|
||||
too long
|
||||
- doxygen-style comments
|
||||
(see http://www.stack.nl/~dimitri/doxygen/docblocks.html)
|
||||
|
||||
If in doubt about a large patch, run astyle with the config file
|
||||
misc/astyle.cfg.
|
||||
Download astyle from http://sourceforge.net/projects/astyle/files/astyle/
|
||||
|
||||
@@ -1,108 +1,47 @@
|
||||
Modifications to the original NIST code are (C)opyright by their
|
||||
respective authors. Unless otherwise specified, they are copyright
|
||||
on the date those changes were committed to whichever repository
|
||||
they were committed to first (i.e. BRL-CAD on SourceForge.net,
|
||||
mpictor/StepClassLibrary or stepcode/stepcode on github).
|
||||
STEPcode is provided as a collective work under the 3-clause BSD
|
||||
license. As some portions are not subject to copyright in some
|
||||
jurisdictions, see INTENT.md for additional details regarding intent
|
||||
and history. See the AUTHORS file for a list of contributors and
|
||||
copyright holders.
|
||||
|
||||
Code generated by STEPcode containing substantial parts of STEPcode
|
||||
complex enough to have copyright protection are subject to the terms
|
||||
of this license.
|
||||
|
||||
STEPcode acknowledgement and/or attribution is appreciated regardless
|
||||
of license or copyright status.
|
||||
|
||||
Modifications which were first commited to the repository on github
|
||||
are licensed under the 3-clause BSD license below. Changes committed
|
||||
to BRL-CAD either contain license information mentioning BRL-CAD
|
||||
near the top of the file, or are licensed under the same terms that
|
||||
NIST used.
|
||||
|
||||
********************************************************************
|
||||
3-clause BSD license:
|
||||
3-Clause BSD License
|
||||
********************************************************************
|
||||
|
||||
Copyright (c) <date committed>, <copyright holder>
|
||||
Copyright (c) 2009-2019 STEPcode AUTHORS
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the <organization> nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
********************************************************************
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
********************************************************************
|
||||
ORIGINAL NIST TEXT FOLLOWS
|
||||
********************************************************************
|
||||
|
||||
This software was produced by the National Institute of Standards and
|
||||
Technology (NIST), an agency of the U.S. government, and by statute is
|
||||
not subject to copyright in the United States. Recipients of this
|
||||
software assume all responsibility associated with its operation,
|
||||
modification, maintenance, and subsequent redistribution.
|
||||
|
||||
Acknowledgements:
|
||||
The STEP Class Library (SCL) was developed by the Manufacturing
|
||||
Systems Integration Division at NIST to support testing of the
|
||||
Standard for the Exchange of Product Model Data (a.k.a STEP) and
|
||||
validation of STEP's emerging implementation specifications. Funding
|
||||
for the project has come from the Department of Commerce and the
|
||||
Department of Defense agencies including the Office of the Defense
|
||||
CALS (Continuous Acquisition and Life-Cycle Support) Executive and
|
||||
the Defense Advanced Research Projects Agency (DARPA). Recent
|
||||
enhancements were sponsored by the National Information Infrastructure
|
||||
Protocols Consortium and NIST's Systems Integration for Manufacturing
|
||||
Applications (SIMA) program.
|
||||
|
||||
|
||||
/* ********************************************************************
|
||||
* D I S C L A I M E R
|
||||
* (February 6, 1992)
|
||||
*
|
||||
* There is no warranty for the NIST PDES Toolkit.
|
||||
* If the NIST PDES Toolkit
|
||||
* is modified by someone else and passed on, NIST wants
|
||||
* the Toolkit's recipients to know that what they have is not what NIST
|
||||
* distributed.
|
||||
*
|
||||
* Policies
|
||||
*
|
||||
* 1. Anyone may copy and distribute verbatim copies of the NIST PDES Toolkit
|
||||
* source code as received in any medium.
|
||||
*
|
||||
* 2. Anyone may modify your copy or copies of the NIST PDES Toolkit source
|
||||
* code or any portion of it, and copy and distribute such modifications
|
||||
* provided that all modifications are clearly associated with the entity
|
||||
* that performs the modifications.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* ===========
|
||||
*
|
||||
* NIST PROVIDES ABSOLUTELY NO WARRANTY. THE NIST PDES TOOLKIT
|
||||
* IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
|
||||
* WITH YOU. SHOULD ANY PORTION OF THE NIST PDES TOOLKIT PROVE DEFECTIVE,
|
||||
* YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
*
|
||||
* IN NO EVENT WILL NIST BE LIABLE FOR DAMAGES,
|
||||
* INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL,
|
||||
* INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
|
||||
* INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
|
||||
* BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A
|
||||
* FAILURE OF THE PROGRAM TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY
|
||||
* NIST) THE PROGRAMS, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
|
||||
*/
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
@@ -8,3 +8,11 @@ set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "my.cdash.org")
|
||||
set(CTEST_DROP_LOCATION "/submit.php?project=StepClassLibrary")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
## Licensing Intent
|
||||
|
||||
The intent is that this software and documentation ("Project") should
|
||||
be treated as if it is licensed under the license(s) associated with
|
||||
the Project ("License") in the `COPYING` file. However, because some
|
||||
contributors work for the United States (U.S.) Federal Government, it
|
||||
is not that simple.
|
||||
|
||||
The portions of this Project written by United States (U.S.) federal
|
||||
government employees within the scope of their federal employment are
|
||||
ineligible for copyright protection in the U.S.; this is generally
|
||||
understood to mean that these portions of the Project are placed in
|
||||
the public domain.
|
||||
|
||||
In countries where copyright protection is available (which does not
|
||||
include the U.S.), contributions made by U.S. Federal government
|
||||
employees are released under the License. Merged contributions from
|
||||
private contributors are released under the License.
|
||||
|
||||
## Background History
|
||||
|
||||
STEPcode was originally developed as the STEP Class Libraries (SCL) by
|
||||
the U.S. National Institute of Standards and Technology (NIST). Prior
|
||||
to 2009, the U.S. Army Research Laboratory and members of the BRL-CAD
|
||||
open source community researched freely available open source options
|
||||
for ISO 10303 STEP support. Development had ceased, no open source
|
||||
community existed, the code was out of date in many regards, and
|
||||
additional work was needed to become production-ready, but SCL was
|
||||
found to be a usable reference implementation.
|
||||
|
||||
Consulting with NIST and others circa 2009, the BRL-CAD community
|
||||
began efforts to take over SCL development, modernization, and code
|
||||
enhancements. The BRL-CAD community purchased licenses for the ISO
|
||||
10303 standard and began working to bring SCL up-to-date with the
|
||||
latest specification. By 2011, significant progress had been made,
|
||||
the project had garnered attention from others, and STEPcode was
|
||||
establishd as an independent project.
|
||||
|
||||
## Original NIST License Text
|
||||
|
||||
This software was [originally] produced by the National Institute of
|
||||
Standards and Technology (NIST), an agency of the U.S. government, and
|
||||
by statute is not subject to copyright in the United
|
||||
States. Recipients of this software assume all responsibility
|
||||
associated with its operation, modification, maintenance, and
|
||||
subsequent redistribution.
|
||||
|
||||
Acknowledgements:
|
||||
The STEP Class Library (SCL) was developed by the Manufacturing
|
||||
Systems Integration Division at NIST to support testing of the
|
||||
Standard for the Exchange of Product Model Data (a.k.a STEP) and
|
||||
validation of STEP's emerging implementation specifications. Funding
|
||||
for the project has come from the Department of Commerce and the
|
||||
Department of Defense agencies including the Office of the Defense
|
||||
CALS (Continuous Acquisition and Life-Cycle Support) Executive and
|
||||
the Defense Advanced Research Projects Agency (DARPA). Recent
|
||||
enhancements [circa 1992] were sponsored by the National Information Infrastructure
|
||||
Protocols Consortium and NIST's Systems Integration for Manufacturing
|
||||
Applications (SIMA) program.
|
||||
|
||||
~~~~
|
||||
/* ********************************************************************
|
||||
* D I S C L A I M E R
|
||||
* (February 6, 1992)
|
||||
*
|
||||
* There is no warranty for the NIST PDES Toolkit.
|
||||
* If the NIST PDES Toolkit
|
||||
* is modified by someone else and passed on, NIST wants
|
||||
* the Toolkit's recipients to know that what they have is not what NIST
|
||||
* distributed.
|
||||
*
|
||||
* Policies
|
||||
*
|
||||
* 1. Anyone may copy and distribute verbatim copies of the NIST PDES Toolkit
|
||||
* source code as received in any medium.
|
||||
*
|
||||
* 2. Anyone may modify your copy or copies of the NIST PDES Toolkit source
|
||||
* code or any portion of it, and copy and distribute such modifications
|
||||
* provided that all modifications are clearly associated with the entity
|
||||
* that performs the modifications.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* ===========
|
||||
*
|
||||
* NIST PROVIDES ABSOLUTELY NO WARRANTY. THE NIST PDES TOOLKIT
|
||||
* IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
|
||||
* WITH YOU. SHOULD ANY PORTION OF THE NIST PDES TOOLKIT PROVE DEFECTIVE,
|
||||
* YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
*
|
||||
* IN NO EVENT WILL NIST BE LIABLE FOR DAMAGES,
|
||||
* INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL,
|
||||
* INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
|
||||
* INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
|
||||
* BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A
|
||||
* FAILURE OF THE PROGRAM TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY
|
||||
* NIST) THE PROGRAMS, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
|
||||
*/
|
||||
~~~~
|
||||
@@ -1,4 +1,29 @@
|
||||
STEPcode -- http://github.com/stepcode/stepcode -- http://stepcode.org
|
||||
************************************************************************
|
||||
STEPcode
|
||||
http://github.com/stepcode/stepcode
|
||||
************************************************************************
|
||||
|
||||
Release 0.8 (December, 2014)
|
||||
|
||||
New since v0.7:
|
||||
* handle diamond inheritance, derived Attributes
|
||||
* rename fedex_python, fedex_plus to exp2py, exp2cxx
|
||||
* many changes to the pretty printer, due to use in reformatting draft
|
||||
and IS schemas (Thanks Tom!)
|
||||
* parser was also changed due to errors caught while pretty printing
|
||||
- we can be much more confident that the parser is correct now
|
||||
* fix incorrect quoting of timestamp in p21 header
|
||||
* fix various copy constructors and ShallowCopy() members
|
||||
* split generated code into many small files
|
||||
- far easier to open generated code in editors
|
||||
- support more compilers
|
||||
- small files are combined (via #include statements) into a few
|
||||
large files for faster "unitary" builds, if the compiler can handle it
|
||||
- unitary builds are faster than the previous builds
|
||||
* most compiler warnings fixed
|
||||
* performance fixes and other changes from BRL-CAD
|
||||
* finally, all tests pass!
|
||||
|
||||
************************************************************************
|
||||
Release 0.7 (April, 2013)
|
||||
|
||||
@@ -154,7 +179,7 @@ There were also some issues with the configure script and some
|
||||
makefiles which are addressed, as well as a new macro that is at
|
||||
least required for gcc.
|
||||
|
||||
Remaing problem: The p21 file scanner of SCL currently
|
||||
Remaining problem: The p21 file scanner of SCL currently
|
||||
does not allow for comments within the parameter list of
|
||||
data records. Only comments outside of data records are
|
||||
accepted.
|
||||
@@ -230,7 +255,7 @@ the TD for label.
|
||||
|
||||
- Fixed the casting operator for the class representing EXPRESS
|
||||
enumeration types. It was returning the last element of the enum type
|
||||
as the the default when the enum was unset. This choice predated enums
|
||||
as the default when the enum was unset. This choice predated enums
|
||||
having an unset enum value. It now returns <enum_name>_unset as the
|
||||
default when the enum is unset.
|
||||
|
||||
@@ -772,7 +797,7 @@ When this case of multiple inheritance is encountered attributes are
|
||||
duplicated. This case of multiple inheritance may possibly be
|
||||
avoided by modifying the EXPRESS schema by breaking some links in the
|
||||
inheritance hierarchy. This will not have an adverse affect on the
|
||||
implemementation. The user may choose to use the current or previous
|
||||
implementation. The user may choose to use the current or previous
|
||||
method of handling multiple inheritance. The current method is the
|
||||
default behavior. The previous method is obtained by supplying the
|
||||
-s (or -S) option with the exp2cxx code generator or the mkProbe
|
||||
@@ -965,7 +990,7 @@ the attribute value field in the entity editor.
|
||||
If there wasn't a value in the attribute previously, then the field will
|
||||
contain just the type specifier, e.g., Str1() if Str1 is the type selected.
|
||||
|
||||
If a value exists in the field, it is modified to accomodate the new
|
||||
If a value exists in the field, it is modified to accommodate the new
|
||||
specifier. This means the following:
|
||||
o If the value in the field starts with a single-quote ('), it is
|
||||
assumed to be a string literal, and is completely wrapped in the new
|
||||
|
||||
+12
-8
@@ -1,5 +1,7 @@
|
||||

|
||||
|
||||
***********************************************************************
|
||||
STEPcode v0.7 -- stepcode.org, github.com/stepcode/stepcode
|
||||
STEPcode v0.8 -- github.com/stepcode/stepcode
|
||||
|
||||
* What is STEPcode? SC reads ISO10303-11 EXPRESS schemas and generates
|
||||
C++ source code that can read and write Part 21 files conforming
|
||||
@@ -32,12 +34,14 @@ SC's source has been reformatted with astyle. When making changes, try
|
||||
to match the current formatting. The main points are:
|
||||
|
||||
- compact (java-style) brackets:
|
||||
if( a == 3 ) {
|
||||
c = 5;
|
||||
function( a, b );
|
||||
} else {
|
||||
somefunc( );
|
||||
}
|
||||
```C
|
||||
if( a == 3 ) {
|
||||
c = 5;
|
||||
function( a, b );
|
||||
} else {
|
||||
somefunc( );
|
||||
}
|
||||
```
|
||||
- indents are 4 spaces
|
||||
- no tab characters
|
||||
- line endings are LF (linux), not CRLF (windows)
|
||||
@@ -54,4 +58,4 @@ Download astyle from http://sourceforge.net/projects/astyle/files/astyle/
|
||||
|
||||
***********************************************************************
|
||||
|
||||
For more info, see the wiki.
|
||||
For more info, see the wiki.
|
||||
@@ -1 +0,0 @@
|
||||
0.7
|
||||
@@ -1,6 +0,0 @@
|
||||
(from BRL-CAD)
|
||||
|
||||
* rewrite express parser to not require lex/yacc
|
||||
|
||||
* verify/fix step parser generation with newer AP schemas, seems to be
|
||||
outputting invalid syntax.
|
||||
@@ -1,84 +0,0 @@
|
||||
# - Check if the given C source code compiles and runs.
|
||||
# CHECK_C_SOURCE_RUNS(<code> <var>)
|
||||
# <code> - source code to try to compile
|
||||
# <var> - variable to store the result
|
||||
# (1 for success, empty for failure)
|
||||
# The following variables may be set before calling this macro to
|
||||
# modify the way the check is run:
|
||||
#
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distributed this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
MACRO(CHECK_C_FILE_RUNS SOURCE VAR)
|
||||
IF("${VAR}" MATCHES "^${VAR}$")
|
||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
ELSE(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
||||
IF(CMAKE_REQUIRED_INCLUDES)
|
||||
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||
ELSE(CMAKE_REQUIRED_INCLUDES)
|
||||
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||
ENDIF(CMAKE_REQUIRED_INCLUDES)
|
||||
|
||||
MESSAGE(STATUS "Performing Test ${VAR}")
|
||||
TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
|
||||
${CMAKE_BINARY_DIR}
|
||||
${SOURCE}
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${FILE_RUN_DEFINITIONS}
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
|
||||
"${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
|
||||
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||
COMPILE_OUTPUT_VARIABLE OUTPUT)
|
||||
# if it did not compile make the return value fail code of 1
|
||||
IF(NOT ${VAR}_COMPILED)
|
||||
SET(${VAR}_EXITCODE 1)
|
||||
ENDIF(NOT ${VAR}_COMPILED)
|
||||
# if the return value was 0 then it worked
|
||||
IF("${${VAR}_EXITCODE}" EQUAL 0)
|
||||
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||
MESSAGE(STATUS "Performing Test ${VAR} - Success")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Return value: ${${VAR}}\n"
|
||||
"Source file was:\n${SOURCE}\n")
|
||||
ELSE("${${VAR}_EXITCODE}" EQUAL 0)
|
||||
IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||
SET(${VAR} "${${VAR}_EXITCODE}")
|
||||
ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||
ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||
|
||||
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Return value: ${${VAR}_EXITCODE}\n"
|
||||
"Source file was:\n${SOURCE}\n")
|
||||
|
||||
ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
|
||||
ENDIF("${VAR}" MATCHES "^${VAR}$")
|
||||
ENDMACRO(CHECK_C_FILE_RUNS)
|
||||
|
||||
+134
-19
@@ -10,23 +10,23 @@
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2012 United States Government as represented by
|
||||
# Copyright (c) 2010-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
@@ -47,21 +47,136 @@
|
||||
find_program(LEMON_EXECUTABLE lemon DOC "path to the lemon executable")
|
||||
mark_as_advanced(LEMON_EXECUTABLE)
|
||||
|
||||
if(LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
|
||||
get_filename_component(lemon_path ${LEMON_EXECUTABLE} PATH)
|
||||
if(lemon_path)
|
||||
set(LEMON_TEMPLATE "")
|
||||
if(EXISTS ${lemon_path}/lempar.c)
|
||||
set(LEMON_TEMPLATE "${lemon_path}/lempar.c")
|
||||
endif(EXISTS ${lemon_path}/lempar.c)
|
||||
if(EXISTS /usr/share/lemon/lempar.c)
|
||||
set(LEMON_TEMPLATE "/usr/share/lemon/lempar.c")
|
||||
endif(EXISTS /usr/share/lemon/lempar.c)
|
||||
endif(lemon_path)
|
||||
endif(LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
|
||||
if (LEMON_EXECUTABLE)
|
||||
if(NOT LEMON_TEMPLATE)
|
||||
# look for the template, if we've not already been told where it is
|
||||
if (DATA_DIR AND EXISTS "${DATA_DIR}/lemon/lempar.c")
|
||||
find_file(LEMON_TEMPLATE lempar.c
|
||||
PATHS "${DATA_DIR}/lemon/lempar.c"
|
||||
NO_DEFAULT_PATH)
|
||||
endif ()
|
||||
|
||||
# If the above did not succeed, check standard locations
|
||||
get_filename_component(lemon_dir ${LEMON_EXECUTABLE} DIRECTORY)
|
||||
find_file(LEMON_TEMPLATE lempar.c
|
||||
PATHS "${lemon_dir}" "/usr/share/lemon"
|
||||
NO_DEFAULT_PATH)
|
||||
mark_as_advanced(LEMON_TEMPLATE)
|
||||
endif()
|
||||
|
||||
# We need a template to be able to use lemon correctly
|
||||
if(NOT LEMON_TEMPLATE)
|
||||
message(FATAL_ERROR "Failed to find lemon template file (lempar.c) - need to set LEMON_TEMPLATE")
|
||||
endif()
|
||||
|
||||
# Define the function
|
||||
# LEMON_TARGET(<Name> <LemonInput> <LemonSource> <LemonHeader>
|
||||
# [<ArgString>])
|
||||
# which will create a custom rule to generate a parser. <LemonInput> is
|
||||
# the path to a lemon file. <LemonSource> is the desired name for the
|
||||
# generated source file. <LemonHeader> is the desired name for the
|
||||
# generated header which contains the token list. Anything in the optional
|
||||
# <ArgString> parameter is appended to the lemon command line.
|
||||
#
|
||||
# ====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# LEMON_TARGET(MyParser parser.y parser.c parser.h)
|
||||
# add_executable(Foo main.cpp ${LEMON_MyParser_OUTPUTS})
|
||||
# ====================================================================
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
if(NOT COMMAND LEMON_TARGET)
|
||||
function(LEMON_TARGET Name LemonInput LemonOutput)
|
||||
set(LT_ARGS DEFINES_FILE COMPILE_FLAGS)
|
||||
cmake_parse_arguments(LEMON_TARGET_ARG "" "${LT_ARGS}" "" ${ARGN})
|
||||
|
||||
if(NOT "${LEMON_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "")
|
||||
set(LEMON_EXECUTABLE_opts "${LEMON_TARGET_ARG_COMPILE_FLAGS}")
|
||||
separate_arguments(LEMON_EXECUTABLE_opts)
|
||||
else()
|
||||
set(LEMON_EXECUTABLE_opts "")
|
||||
endif()
|
||||
|
||||
# check for LemonOutput
|
||||
get_filename_component(_basename ${LemonOutput} NAME_WE)
|
||||
get_filename_component(_out_src_file ${LemonOutput} NAME)
|
||||
get_filename_component(_out_dir ${LemonOutput} PATH)
|
||||
if(NOT "${_out_dir}" STREQUAL "")
|
||||
message(WARNING "Full path specified for LemonOutput - should be filename only")
|
||||
endif()
|
||||
|
||||
# set report file
|
||||
set(_out_rpt_file "${_basename}.out")
|
||||
|
||||
# check for DEFINES_FILE
|
||||
if ("${LEMON_TARGET_ARG_DEFINES_FILE}" STREQUAL "")
|
||||
set(_out_hdr_file "${_basename}.h")
|
||||
else()
|
||||
get_filename_component(_out_dir ${LEMON_TARGET_ARG_DEFINES_FILE} PATH)
|
||||
get_filename_component(_out_hdr_file ${LEMON_TARGET_ARG_DEFINES_FILE} NAME)
|
||||
if(NOT "${_out_dir}" STREQUAL "")
|
||||
message(WARNING "Full path specified for DEFINES_FILE - should be filename only")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# input file
|
||||
get_filename_component(_in_y_path ${LemonInput} ABSOLUTE)
|
||||
get_filename_component(_in_y_file ${LemonInput} NAME)
|
||||
|
||||
# Stage the source file in the binary directory for lemon. We need to make
|
||||
# sure it's fully copied, so use a sentinel guard
|
||||
add_custom_command(
|
||||
OUTPUT ${_in_y_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_in_y_path} ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_in_y_file}.sentinel
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${_in_y_file}.sentinel
|
||||
DEPENDS ${_in_y_file}
|
||||
)
|
||||
add_custom_target(${Name}_input_cpy DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_in_y_file}.sentinel)
|
||||
|
||||
# execute lemon
|
||||
add_custom_command(
|
||||
OUTPUT ${_out_src_file}
|
||||
COMMAND ${LEMON_EXECUTABLE} -T${LEMON_TEMPLATE} ${LEMON_EXECUTABLE_opts} ${_in_y_file}
|
||||
DEPENDS ${Name}_input_cpy
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "[LEMON][${Name}] Building parser with ${LEMON_EXECUTABLE}"
|
||||
)
|
||||
|
||||
# rename the header
|
||||
add_custom_command(
|
||||
OUTPUT ${_out_hdr_file}
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E rename ${_basename}.h ${_out_hdr_file}
|
||||
DEPENDS ${_out_src_file}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
# set the return values
|
||||
# TODO: for generated sources even headers should be target dependencies
|
||||
set(LEMON_${Name}_DEFINED TRUE PARENT_SCOPE)
|
||||
set(LEMON_${Name}_OUTPUT_HEADER "${CMAKE_CURRENT_BINARY_DIR}/${_out_hdr_file}" PARENT_SCOPE)
|
||||
set(LEMON_${Name}_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
|
||||
set(LEMON_${Name}_OUTPUTS "${_out_src_file}" PARENT_SCOPE)
|
||||
|
||||
# TODO - remove once perplex goes away...
|
||||
add_custom_target(${Name} DEPENDS ${_out_hdr_file})
|
||||
|
||||
# make sure we clean up generated output and copied input
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_out_src_file}")
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${_in_y_file}")
|
||||
|
||||
endfunction(LEMON_TARGET)
|
||||
endif(NOT COMMAND LEMON_TARGET)
|
||||
|
||||
endif(LEMON_EXECUTABLE)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
|
||||
mark_as_advanced(LEMON_TEMPLATE)
|
||||
find_package_handle_standard_args(LEMON REQUIRED_VARS LEMON_EXECUTABLE LEMON_TEMPLATE)
|
||||
|
||||
#============================================================
|
||||
# FindLEMON.cmake ends here
|
||||
|
||||
+194
-5
@@ -10,23 +10,23 @@
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2012 United States Government as represented by
|
||||
# Copyright (c) 2010-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
@@ -68,6 +68,195 @@ include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PERPLEX DEFAULT_MSG PERPLEX_EXECUTABLE PERPLEX_TEMPLATE)
|
||||
mark_as_advanced(PERPLEX_TEMPLATE)
|
||||
|
||||
# Defines two macros - PERPLEX_TARGET, which takes perplex inputs and
|
||||
# runs both perplex and re2c to generate C source code/headers, and
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY which is used to set up dependencies between
|
||||
# scanner and parser targets when necessary.
|
||||
#
|
||||
# #====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# find_package(RE2C)
|
||||
# find_package(PERPLEX)
|
||||
#
|
||||
# LEMON_TARGET(MyParser parser.y "${CMAKE_CURRENT_BINARY_DIR}/parser.cpp")
|
||||
# PERPLEX_TARGET(MyScanner scanner.re "${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp" "${CMAKE_CURRENT_BINARY_DIR}/scanner_header.hpp")
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY(MyScanner MyParser)
|
||||
#
|
||||
# include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
||||
# add_executable(Foo
|
||||
# Foo.cc
|
||||
# ${LEMON_MyParser_OUTPUTS}
|
||||
# ${PERPLEX_MyScanner_OUTPUTS}
|
||||
# )
|
||||
# ====================================================================
|
||||
#
|
||||
#=============================================================================
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
#============================================================
|
||||
# PERPLEX_TARGET (public macro)
|
||||
#============================================================
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
if(NOT COMMAND PERPLEX_TARGET)
|
||||
macro(PERPLEX_TARGET Name Input)
|
||||
get_filename_component(IN_FILE_WE ${Input} NAME_WE)
|
||||
set(PVAR_PREFIX ${Name}_${IN_FILE_WE})
|
||||
|
||||
if(${ARGC} GREATER 3)
|
||||
CMAKE_PARSE_ARGUMENTS(${PVAR_PREFIX} "" "TEMPLATE;OUT_SRC_FILE;OUT_HDR_FILE;WORKING_DIR" "" ${ARGN})
|
||||
endif(${ARGC} GREATER 3)
|
||||
|
||||
# Need a working directory
|
||||
if("${${PVAR_PREFIX}_WORKING_DIR}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}/${PVAR_PREFIX}")
|
||||
endif("${${PVAR_PREFIX}_WORKING_DIR}" STREQUAL "")
|
||||
file(MAKE_DIRECTORY ${${PVAR_PREFIX}_WORKING_DIR})
|
||||
|
||||
# Set up intermediate and final output names
|
||||
|
||||
# Output source file
|
||||
if ("${${PVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_OUT_SRC_FILE ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.c)
|
||||
else ("${${PVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
|
||||
get_filename_component(specified_out_dir ${${PVAR_PREFIX}_OUT_SRC_FILE} PATH)
|
||||
if(NOT "${specified_out_dir}" STREQUAL "")
|
||||
message(FATAL_ERROR "\nFull path specified for OUT_SRC_FILE - should be filename only.\n")
|
||||
endif(NOT "${specified_out_dir}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_OUT_SRC_FILE ${${PVAR_PREFIX}_WORKING_DIR}/${${PVAR_PREFIX}_OUT_SRC_FILE})
|
||||
endif ("${${PVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
|
||||
|
||||
# Output header file
|
||||
if ("${${PVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_OUT_HDR_FILE ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.h)
|
||||
else ("${${PVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
|
||||
get_filename_component(specified_out_dir ${${PVAR_PREFIX}_OUT_HDR_FILE} PATH)
|
||||
if(NOT "${specified_out_dir}" STREQUAL "")
|
||||
message(FATAL_ERROR "\nFull path specified for OUT_HDR_FILE - should be filename only.\n")
|
||||
endif(NOT "${specified_out_dir}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_OUT_HDR_FILE ${${PVAR_PREFIX}_WORKING_DIR}/${${PVAR_PREFIX}_OUT_HDR_FILE})
|
||||
endif ("${${PVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
|
||||
|
||||
# input file
|
||||
get_filename_component(in_full ${Input} ABSOLUTE)
|
||||
if("${in_full}" STREQUAL "${Input}")
|
||||
set(perplex_in_file ${Input})
|
||||
else("${in_full}" STREQUAL "${Input}")
|
||||
set(perplex_in_file "${CMAKE_CURRENT_SOURCE_DIR}/${Input}")
|
||||
endif("${in_full}" STREQUAL "${Input}")
|
||||
|
||||
# Intermediate file
|
||||
set(re2c_src "${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.re")
|
||||
|
||||
# Make sure we have a template
|
||||
if ("${${PVAR_PREFIX}_TEMPLATE}" STREQUAL "")
|
||||
if(PERPLEX_TEMPLATE)
|
||||
set(${PVAR_PREFIX}_TEMPLATE ${PERPLEX_TEMPLATE})
|
||||
else(PERPLEX_TEMPLATE)
|
||||
message(FATAL_ERROR "\nNo Perplex template file specified - please specify the file using the PERPLEX_TEMPLATE variable:\ncmake .. -DPERPLEX_TEMPLATE=/path/to/template_file.c\n")
|
||||
endif(PERPLEX_TEMPLATE)
|
||||
endif ("${${PVAR_PREFIX}_TEMPLATE}" STREQUAL "")
|
||||
|
||||
get_filename_component(IN_FILE ${Input} NAME)
|
||||
add_custom_command(
|
||||
OUTPUT ${re2c_src} ${${PVAR_PREFIX}_OUT_HDR_FILE} ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${perplex_in_file} ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE}
|
||||
COMMAND ${PERPLEX_EXECUTABLE} -c -o ${re2c_src} -i ${${PVAR_PREFIX}_OUT_HDR_FILE} -t ${${PVAR_PREFIX}_TEMPLATE} ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE}
|
||||
DEPENDS ${Input} ${${PVAR_PREFIX}_TEMPLATE} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${${PVAR_PREFIX}_WORKING_DIR}
|
||||
COMMENT "[PERPLEX][${Name}] Generating re2c input with ${PERPLEX_EXECUTABLE}"
|
||||
)
|
||||
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
add_custom_command(
|
||||
OUTPUT ${${PVAR_PREFIX}_OUT_SRC_FILE}
|
||||
COMMAND ${RE2C_EXECUTABLE} --no-debug-info --no-generation-date -c -o ${${PVAR_PREFIX}_OUT_SRC_FILE} ${re2c_src}
|
||||
DEPENDS ${Input} ${re2c_src} ${${PVAR_PREFIX}_OUT_HDR_FILE} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${${PVAR_PREFIX}_WORKING_DIR}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
)
|
||||
else(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
add_custom_command(
|
||||
OUTPUT ${${PVAR_PREFIX}_OUT_SRC_FILE}
|
||||
COMMAND ${RE2C_EXECUTABLE} --no-generation-date -c -o ${${PVAR_PREFIX}_OUT_SRC_FILE} ${re2c_src}
|
||||
DEPENDS ${Input} ${re2c_src} ${${PVAR_PREFIX}_OUT_HDR_FILE} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${${PVAR_PREFIX}_WORKING_DIR}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
)
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
set(PERPLEX_${Name}_DEFINED TRUE)
|
||||
set(PERPLEX_${Name}_SRC ${${PVAR_PREFIX}_OUT_SRC_FILE})
|
||||
set(PERPLEX_${Name}_HDR ${${PVAR_PREFIX}_OUT_HDR_FILE})
|
||||
set(PERPLEX_${Name}_INCLUDE_DIR ${${PVAR_PREFIX}_WORKING_DIR})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${${PVAR_PREFIX}_WORKING_DIR}/${Name}.sentinel
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${${PVAR_PREFIX}_WORKING_DIR}/${Name}.sentinel
|
||||
DEPENDS ${${PVAR_PREFIX}_OUT_SRC_FILE} ${${PVAR_PREFIX}_OUT_HDR_FILE}
|
||||
)
|
||||
add_custom_target(${Name} DEPENDS ${${PVAR_PREFIX}_WORKING_DIR}/${Name}.sentinel)
|
||||
|
||||
endmacro(PERPLEX_TARGET)
|
||||
endif(NOT COMMAND PERPLEX_TARGET)
|
||||
|
||||
#============================================================
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY (public macro)
|
||||
#============================================================
|
||||
if(NOT COMMAND ADD_PERPLEX_LEMON_DEPENDENCY)
|
||||
macro(ADD_PERPLEX_LEMON_DEPENDENCY PERPLEXTarget LemonTarget)
|
||||
|
||||
if(NOT PERPLEX_${PERPLEXTarget}_SRC)
|
||||
message(SEND_ERROR "PERPLEX target `${PERPLEXTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET ${LemonTarget})
|
||||
message(SEND_ERROR "Lemon target `${LemonTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${PERPLEX_${PERPLEXTarget}_SRC}
|
||||
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_OUTPUT_HEADER})
|
||||
endmacro(ADD_PERPLEX_LEMON_DEPENDENCY)
|
||||
endif(NOT COMMAND ADD_PERPLEX_LEMON_DEPENDENCY)
|
||||
|
||||
#============================================================
|
||||
# FindPERPLEX.cmake ends here
|
||||
|
||||
|
||||
+165
-1
@@ -6,5 +6,169 @@
|
||||
find_program(RE2C_EXECUTABLE re2c DOC "path to the re2c executable")
|
||||
mark_as_advanced(RE2C_EXECUTABLE)
|
||||
|
||||
if(RE2C_EXECUTABLE)
|
||||
|
||||
execute_process(COMMAND ${RE2C_EXECUTABLE} -v
|
||||
OUTPUT_VARIABLE RE2C_version_output
|
||||
ERROR_VARIABLE RE2C_version_error
|
||||
RESULT_VARIABLE RE2C_version_result
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(NOT ${RE2C_version_result} EQUAL 0)
|
||||
message(SEND_ERROR
|
||||
"Command \"${RE2C_EXECUTABLE} -v\" failed with output:\n${RE2C_version_output}\n${RE2C_version_error}")
|
||||
else()
|
||||
string(REGEX REPLACE "^re2c ([0-9]+[^ ]*)( .*)?$" "\\1" RE2C_VERSION "${RE2C_version_output}")
|
||||
endif()
|
||||
|
||||
# Provide a macro to generate custom build rules:
|
||||
|
||||
# RE2C_TARGET(Name RE2CInput RE2COutput [COMPILE_FLAGS <string>])
|
||||
# which creates a custom command to generate the <RE2COutput> file from
|
||||
# the <RE2CInput> file. If COMPILE_FLAGS option is specified, the next
|
||||
# parameter is added to the re2c command line. Name is an alias used to
|
||||
# get details of this custom command.
|
||||
|
||||
# This module also defines a macro:
|
||||
# ADD_RE2C_LEMON_DEPENDENCY(RE2CTarget LemonTarget)
|
||||
# which adds the required dependency between a scanner and a parser
|
||||
# where <RE2CTarget> and <LemonTarget> are the first parameters of
|
||||
# respectively RE2C_TARGET and LEMON_TARGET macros.
|
||||
#
|
||||
# ====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# find_package(RE2C)
|
||||
#
|
||||
# LEMON_TARGET(MyParser parser.y "${CMAKE_CURRENT_BINARY_DIR}/parser.cpp")
|
||||
# RE2C_TARGET(MyScanner scanner.re "${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp")
|
||||
# ADD_RE2C_LEMON_DEPENDENCY(MyScanner MyParser)
|
||||
#
|
||||
# include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
||||
# add_executable(Foo
|
||||
# Foo.cc
|
||||
# ${LEMON_MyParser_OUTPUTS}
|
||||
# ${RE2C_MyScanner_OUTPUTS}
|
||||
# )
|
||||
# ====================================================================
|
||||
#
|
||||
#=============================================================================
|
||||
# Copyright (c) 2010-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
#============================================================
|
||||
# RE2C_TARGET (public macro)
|
||||
#============================================================
|
||||
#
|
||||
if(NOT COMMAND RE2C_TARGET)
|
||||
function(RE2C_TARGET Name RE2CInput RE2COutput)
|
||||
set(_re2c_args COMPILE_FLAGS DEFINES_FILE)
|
||||
cmake_parse_arguments(RE2C_TARGET_ARG "" "${_re2c_args}" "" ${ARGN})
|
||||
|
||||
if(NOT "${RE2C_TARGET_ARG_UNPARSED_ARGUMENTS}" STREQUAL "")
|
||||
message(SEND_ERROR "RE2C_TARGET(<Name> <RE2CInput> <RE2COutput>
|
||||
[COMPILE_FLAGS <string>]
|
||||
[DEFINES_FILE <string>])")
|
||||
else()
|
||||
if(NOT "${RE2C_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "")
|
||||
set(RE2C_EXECUTABLE_opts "${RE2C_TARGET_ARG_COMPILE_FLAGS}")
|
||||
separate_arguments(RE2C_EXECUTABLE_opts)
|
||||
else()
|
||||
set(RE2C_EXECUTABLE_opts "")
|
||||
endif()
|
||||
|
||||
if(NOT "${RE2C_TARGET_ARG_DEFINES_FILE}" STREQUAL "")
|
||||
list(APPEND RE2C_EXECUTABLE_opts -t ${RE2C_TARGET_ARG_DEFINES_FILE})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${RE2COutput}
|
||||
COMMAND ${RE2C_EXECUTABLE}
|
||||
ARGS ${RE2C_EXECUTABLE_opts} -o ${RE2COutput} ${CMAKE_CURRENT_SOURCE_DIR}/${RE2CInput}
|
||||
DEPENDS ${RE2CInput}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
# TODO: check, for generated sources headers should be included in outputs
|
||||
set(RE2C_${Name}_DEFINED TRUE PARENT_SCOPE)
|
||||
set(RE2C_${Name}_OUTPUTS ${RE2COutput} PARENT_SCOPE)
|
||||
if("${RE2C_TARGET_ARG_DEFINES_FILE}" STREQUAL "")
|
||||
set(RE2C_${Name}_OUTPUT_HEADER "" PARENT_SCOPE)
|
||||
else()
|
||||
set(RE2C_${Name}_OUTPUT_HEADER "${RE2C_TARGET_ARG_DEFINES_FILE}" PARENT_SCOPE)
|
||||
endif()
|
||||
set(RE2C_${Name}_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
endfunction(RE2C_TARGET)
|
||||
endif(NOT COMMAND RE2C_TARGET)
|
||||
#============================================================
|
||||
|
||||
#============================================================
|
||||
# ADD_RE2C_LEMON_DEPENDENCY (public macro)
|
||||
#============================================================
|
||||
#
|
||||
if(NOT COMMAND ADD_RE2C_LEMON_DEPENDENCY)
|
||||
function(ADD_RE2C_LEMON_DEPENDENCY RE2CTarget LemonTarget)
|
||||
|
||||
if(NOT RE2C_${RE2CTarget}_OUTPUTS)
|
||||
message(SEND_ERROR "RE2C target `${RE2CTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
if(NOT LEMON_${LemonTarget}_OUTPUT_HEADER)
|
||||
message(SEND_ERROR "Lemon target `${LemonTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${RE2C_${RE2CTarget}_OUTPUTS}
|
||||
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_OUTPUT_HEADER})
|
||||
endfunction(ADD_RE2C_LEMON_DEPENDENCY)
|
||||
endif(NOT COMMAND ADD_RE2C_LEMON_DEPENDENCY)
|
||||
#============================================================
|
||||
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RE2C DEFAULT_MSG RE2C_EXECUTABLE)
|
||||
find_package_handle_standard_args(RE2C REQUIRED_VARS RE2C_EXECUTABLE
|
||||
VERSION_VAR RE2C_VERSION)
|
||||
|
||||
# RE2C_Util.cmake ends here
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
# Utility routines for managing generated files with CMake
|
||||
|
||||
macro(MD5 filename md5sum)
|
||||
file(READ "${filename}" RAW_MD5_FILE)
|
||||
string(REGEX REPLACE "\r" "" STRIPPED_MD5_FILE "${RAW_MD5_FILE}")
|
||||
string(MD5 ${md5sum} "${STRIPPED_MD5_FILE}")
|
||||
endmacro(MD5)
|
||||
|
||||
macro(FILEVAR filename var)
|
||||
string(REGEX REPLACE "[^a-zA-Z0-9]" "_" ${var} ${filename})
|
||||
endmacro(FILEVAR)
|
||||
|
||||
macro(VERIFY_FILES filelist warn resultvar)
|
||||
set(${resultvar} 1)
|
||||
foreach(fileitem ${filelist})
|
||||
# Deal with absolute and relative paths a bit differently
|
||||
get_filename_component(ITEM_ABS_PATH "${fileitem}" ABSOLUTE)
|
||||
if("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
set(filefullname "${fileitem}")
|
||||
else("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
set(filefullname "${CURRENT_SOURCE_DIR}/${fileitem}")
|
||||
endif("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
get_filename_component(filename "${fileitem}" NAME)
|
||||
# Got filename components sorted - proceed
|
||||
if(NOT EXISTS ${filefullname})
|
||||
message(FATAL_ERROR "Attempted to verify non-existant file ${filefullname}")
|
||||
endif(NOT EXISTS ${filefullname})
|
||||
FILEVAR(${filename} filevar)
|
||||
if(NOT baseline_${filevar}_md5)
|
||||
message(FATAL_ERROR "No baseline MD5 available for ${filename} - baseline_${filevar}_md5 is not defined")
|
||||
endif(NOT baseline_${filevar}_md5)
|
||||
MD5(${filefullname} ${filevar}_md5)
|
||||
if(NOT "${${filevar}_md5}" STREQUAL "${baseline_${filevar}_md5}")
|
||||
if("${warn}" STREQUAL "1")
|
||||
message("\n${filename} differs from baseline: baseline md5 hash is ${baseline_${filevar}_md5} and current hash is ${${filevar}_md5}\n")
|
||||
endif("${warn}" STREQUAL "1")
|
||||
set(${resultvar} 0)
|
||||
endif(NOT "${${filevar}_md5}" STREQUAL "${baseline_${filevar}_md5}")
|
||||
endforeach(fileitem ${filelist})
|
||||
endmacro(VERIFY_FILES filelist resultvar)
|
||||
|
||||
macro(WRITE_MD5_SUMS filelist outfile)
|
||||
foreach(fileitem ${filelist})
|
||||
# Deal with absolute and relative paths a bit differently
|
||||
get_filename_component(ITEM_ABS_PATH "${fileitem}" ABSOLUTE)
|
||||
if("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
set(filefullname "${fileitem}")
|
||||
else("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
set(filefullname "${CURRENT_SOURCE_DIR}/${fileitem}")
|
||||
endif("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
get_filename_component(filename "${fileitem}" NAME)
|
||||
# Got filename components sorted - proceed
|
||||
if(NOT EXISTS ${filefullname})
|
||||
message(FATAL_ERROR "Attempted to get MD5 sum of non-existant file ${filefullname}")
|
||||
endif(NOT EXISTS ${filefullname})
|
||||
FILEVAR(${filename} filevar)
|
||||
MD5(${filefullname} ${filevar}_md5)
|
||||
file(APPEND ${outfile} "set(baseline_${filevar}_md5 ${${filevar}_md5})\n")
|
||||
endforeach(fileitem ${filelist})
|
||||
endmacro(WRITE_MD5_SUMS)
|
||||
|
||||
|
||||
macro(GET_GENERATOR_EXEC_VERSIONS)
|
||||
# Read lemon version
|
||||
execute_process(COMMAND ${LEMON_EXECUTABLE} -x OUTPUT_VARIABLE lemon_version)
|
||||
string(REPLACE "Lemon version " "" lemon_version "${lemon_version}")
|
||||
string(STRIP "${lemon_version}" lemon_version)
|
||||
# Read re2c version
|
||||
execute_process(COMMAND ${RE2C_EXECUTABLE} -V OUTPUT_VARIABLE re2c_version)
|
||||
string(STRIP "${re2c_version}" re2c_version)
|
||||
# Read perplex version
|
||||
execute_process(COMMAND ${PERPLEX_EXECUTABLE} -v OUTPUT_VARIABLE perplex_version)
|
||||
string(STRIP "${perplex_version}" perplex_version)
|
||||
endmacro(GET_GENERATOR_EXEC_VERSIONS)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,146 +0,0 @@
|
||||
# Defines the macro
|
||||
# LEMON_TARGET(<Name> <LemonInput> <LemonSource> <LemonHeader>
|
||||
# [<ArgString>])
|
||||
# which will create a custom rule to generate a parser. <LemonInput> is
|
||||
# the path to a lemon file. <LemonSource> is the desired name for the
|
||||
# generated source file. <LemonHeader> is the desired name for the
|
||||
# generated header which contains the token list. Anything in the optional
|
||||
# <ArgString> parameter is appended to the lemon command line.
|
||||
#
|
||||
# ====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# LEMON_TARGET(MyParser parser.y parser.c parser.h)
|
||||
# add_executable(Foo main.cpp ${LEMON_MyParser_OUTPUTS})
|
||||
# ====================================================================
|
||||
#
|
||||
#=============================================================================
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2012 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
#============================================================
|
||||
# LEMON_TARGET (public macro)
|
||||
#============================================================
|
||||
#
|
||||
macro(LEMON_TARGET Name LemonInput LemonSource LemonHeader)
|
||||
if(NOT ${ARGC} EQUAL 4 AND NOT ${ARGC} EQUAL 5)
|
||||
message(SEND_ERROR "Usage")
|
||||
else()
|
||||
get_filename_component(LemonInputFull ${LemonInput} ABSOLUTE)
|
||||
get_filename_component(LemonSourceFull ${LemonSource} ABSOLUTE)
|
||||
get_filename_component(LemonHeaderFull ${LemonHeader} ABSOLUTE)
|
||||
|
||||
if(NOT ${LemonInput} STREQUAL ${LemonInputFull})
|
||||
set(LEMON_${Name}_INPUT "${CMAKE_CURRENT_BINARY_DIR}/${LemonInput}")
|
||||
else(NOT ${LemonInput} STREQUAL ${LemonInputFull})
|
||||
set(LEMON_${Name}_INPUT "${LemonInput}")
|
||||
endif(NOT ${LemonInput} STREQUAL ${LemonInputFull})
|
||||
|
||||
if(NOT ${LemonSource} STREQUAL ${LemonSourceFull})
|
||||
set(LEMON_${Name}_OUTPUT_SOURCE "${CMAKE_CURRENT_BINARY_DIR}/${LemonSource}")
|
||||
else(NOT ${LemonSource} STREQUAL ${LemonSourceFull})
|
||||
set(LEMON_${Name}_OUTPUT_SOURCE "${LemonSource}")
|
||||
endif(NOT ${LemonSource} STREQUAL ${LemonSourceFull})
|
||||
|
||||
if(NOT ${LemonHeader} STREQUAL ${LemonHeaderFull})
|
||||
set(LEMON_${Name}_OUTPUT_HEADER "${CMAKE_CURRENT_BINARY_DIR}/${LemonHeader}")
|
||||
else(NOT ${LemonHeader} STREQUAL ${LemonHeaderFull})
|
||||
set(LEMON_${Name}_OUTPUT_HEADER "${LemonHeader}")
|
||||
endif(NOT ${LemonHeader} STREQUAL ${LemonHeaderFull})
|
||||
|
||||
set(LEMON_${Name}_EXTRA_ARGS "${ARGV4}")
|
||||
|
||||
# get input name minus path
|
||||
get_filename_component(INPUT_NAME "${LemonInput}" NAME)
|
||||
set(LEMON_BIN_INPUT ${CMAKE_CURRENT_BINARY_DIR}/${INPUT_NAME})
|
||||
|
||||
# names of lemon output files will be based on the name of the input file
|
||||
string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1.c" LEMON_GEN_SOURCE "${INPUT_NAME}")
|
||||
string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1.h" LEMON_GEN_HEADER "${INPUT_NAME}")
|
||||
string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1.out" LEMON_GEN_OUT "${INPUT_NAME}")
|
||||
|
||||
# copy input to bin directory and run lemon
|
||||
add_custom_command(
|
||||
OUTPUT ${LEMON_GEN_OUT} ${LEMON_GEN_SOURCE} ${LEMON_GEN_HEADER}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${LemonInput} ${LEMON_BIN_INPUT}
|
||||
COMMAND ${LEMON_EXECUTABLE} ${INPUT_NAME} ${LEMON_${Name}_EXTRA_ARGS}
|
||||
DEPENDS ${LemonInput} ${LEMON_TEMPLATE} ${LEMON_EXECUTABLE_TARGET}
|
||||
COMMENT "[LEMON][${Name}] Building parser with ${LEMON_EXECUTABLE}"
|
||||
)
|
||||
|
||||
# rename generated outputs
|
||||
if(NOT "${LemonSource}" STREQUAL "${LEMON_GEN_SOURCE}")
|
||||
add_custom_command(
|
||||
OUTPUT ${LemonSource}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LEMON_GEN_SOURCE} ${LemonSource}
|
||||
DEPENDS ${LemonInput} ${LEMON_EXECUTABLE_TARGET} ${LEMON_GEN_SOURCE}
|
||||
)
|
||||
set(LEMON_${Name}_OUTPUTS ${LemonSource} ${LEMON_${Name}_OUTPUTS})
|
||||
endif(NOT "${LemonSource}" STREQUAL "${LEMON_GEN_SOURCE}")
|
||||
if(NOT "${LemonHeader}" STREQUAL "${LEMON_GEN_HEADER}")
|
||||
add_custom_command(
|
||||
OUTPUT ${LemonHeader}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LEMON_GEN_HEADER} ${LemonHeader}
|
||||
DEPENDS ${LemonInput} ${LEMON_EXECUTABLE_TARGET} ${LEMON_GEN_HEADER}
|
||||
)
|
||||
set(LEMON_${Name}_OUTPUTS ${LemonHeader} ${LEMON_${Name}_OUTPUTS})
|
||||
endif(NOT "${LemonHeader}" STREQUAL "${LEMON_GEN_HEADER}")
|
||||
|
||||
set(LEMON_${Name}_OUTPUTS ${LEMON_GEN_OUT} ${LemonSource} ${LemonHeader})
|
||||
|
||||
# make sure we clean up generated output and copied input
|
||||
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${LEMON_${Name}_OUTPUTS}")
|
||||
else("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${LEMON_${Name}_OUTPUTS};${LEMON_BIN_INPUT}")
|
||||
endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
|
||||
# macro ran successfully
|
||||
set(LEMON_${Name}_DEFINED TRUE)
|
||||
endif(NOT ${ARGC} EQUAL 4 AND NOT ${ARGC} EQUAL 5)
|
||||
endmacro(LEMON_TARGET)
|
||||
#
|
||||
#============================================================
|
||||
# LEMON_Utils.cmake ends here
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,134 +0,0 @@
|
||||
# Defines two macros - PERPLEX_TARGET, which takes perplex inputs and
|
||||
# runs both perplex and re2c to generate C source code/headers, and
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY which is used to set up dependencies between
|
||||
# scanner and parser targets when necessary.
|
||||
#
|
||||
# #====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# find_package(RE2C)
|
||||
# find_package(PERPLEX)
|
||||
#
|
||||
# LEMON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
|
||||
# PERPLEX_TARGET(MyScanner scanner.re ${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp ${CMAKE_CURRENT_BINARY_DIR}/scanner_header.hpp)
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY(MyScanner MyParser)
|
||||
#
|
||||
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
# add_executable(Foo
|
||||
# Foo.cc
|
||||
# ${LEMON_MyParser_OUTPUTS}
|
||||
# ${PERPLEX_MyScanner_OUTPUTS}
|
||||
# )
|
||||
# ====================================================================
|
||||
#
|
||||
#=============================================================================
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2012 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
#============================================================
|
||||
# PERPLEX_TARGET (public macro)
|
||||
#============================================================
|
||||
macro(PERPLEX_TARGET Name Input OutputSrc OutputHeader)
|
||||
if(${ARGC} GREATER 4)
|
||||
set(Template ${ARGV4})
|
||||
else(${ARGC} GREATER 4)
|
||||
if(PERPLEX_TEMPLATE)
|
||||
set(Template ${PERPLEX_TEMPLATE})
|
||||
else(PERPLEX_TEMPLATE)
|
||||
message(FATAL_ERROR "\nNo Perplex template file specifed - please specify the file using the PERPLEX_TEMPLATE variable:\ncmake .. -DPERPLEX_TEMPLATE=/path/to/template_file.c\n")
|
||||
endif(PERPLEX_TEMPLATE)
|
||||
endif(${ARGC} GREATER 4)
|
||||
|
||||
get_filename_component(OutputName ${OutputSrc} NAME)
|
||||
set(re2c_src "${CMAKE_CURRENT_BINARY_DIR}/${OutputName}.re")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${re2c_src} ${OutputHeader}
|
||||
COMMAND ${PERPLEX_EXECUTABLE} -c -o ${re2c_src} -i ${OutputHeader} -t ${Template} ${Input}
|
||||
DEPENDS ${Input} ${Template} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "[PERPLEX][${Name}] Generating re2c input with ${PERPLEX_EXECUTABLE}"
|
||||
)
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
add_custom_command(
|
||||
OUTPUT ${OutputSrc}
|
||||
COMMAND ${RE2C_EXECUTABLE} --no-debug-info --no-generation-date -c -o ${OutputSrc} ${re2c_src}
|
||||
DEPENDS ${Input} ${re2c_src} ${OutputHeader} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
)
|
||||
else(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
add_custom_command(
|
||||
OUTPUT ${OutputSrc}
|
||||
COMMAND ${RE2C_EXECUTABLE} --no-generation-date -c -o ${OutputSrc} ${re2c_src}
|
||||
DEPENDS ${Input} ${re2c_src} ${OutputHeader} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
)
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
set(PERPLEX_${Name}_DEFINED TRUE)
|
||||
set(PERPLEX_${Name}_OUTPUTS ${OutputSrc})
|
||||
set(PERPLEX_${Name}_INPUT ${Input})
|
||||
endmacro(PERPLEX_TARGET)
|
||||
|
||||
#============================================================
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY (public macro)
|
||||
#============================================================
|
||||
macro(ADD_PERPLEX_LEMON_DEPENDENCY PERPLEXTarget LemonTarget)
|
||||
|
||||
if(NOT PERPLEX_${PERPLEXTarget}_OUTPUTS)
|
||||
message(SEND_ERROR "PERPLEX target `${PERPLEXTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
if(NOT LEMON_${LemonTarget}_OUTPUT_HEADER)
|
||||
message(SEND_ERROR "Lemon target `${LemonTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${PERPLEX_${PERPLEXTarget}_OUTPUTS}
|
||||
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_OUTPUT_HEADER})
|
||||
endmacro(ADD_PERPLEX_LEMON_DEPENDENCY)
|
||||
|
||||
#============================================================
|
||||
# PERPLEX_Utils.cmake ends here
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,164 @@
|
||||
# Copyright (c) 2010-2020 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
#
|
||||
# 3. The name of the author may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Define relative install locations. Don't set these if they have already
|
||||
# been set by some other means (like a higher level CMakeLists.txt file
|
||||
# including this one).
|
||||
|
||||
# The location in which to install BRL-CAD executables.
|
||||
if(NOT BIN_DIR)
|
||||
set(BIN_DIR bin)
|
||||
endif(NOT BIN_DIR)
|
||||
|
||||
# Define a relative path that will "reset" a path back to
|
||||
# the point before BIN_DIR was appended. This is primarily
|
||||
# useful when working with generator expressions
|
||||
unset(RBIN_DIR CACHE)
|
||||
set(LBIN_DIR "${BIN_DIR}")
|
||||
while (NOT "${LBIN_DIR}" STREQUAL "")
|
||||
get_filename_component(LBDIR "${LBIN_DIR}" DIRECTORY)
|
||||
set(LBIN_DIR "${LBDIR}")
|
||||
if ("${RBIN_DIR}" STREQUAL "")
|
||||
set(RBIN_DIR "..")
|
||||
else ("${RBIN_DIR}" STREQUAL "")
|
||||
set(RBIN_DIR "../${RBIN_DIR}")
|
||||
endif ("${RBIN_DIR}" STREQUAL "")
|
||||
endwhile (NOT "${LBIN_DIR}" STREQUAL "")
|
||||
|
||||
# The location in which to install BRL-CAD libraries.
|
||||
if(NOT LIB_DIR)
|
||||
set(LIB_DIR lib)
|
||||
endif(NOT LIB_DIR)
|
||||
if(NOT LIBEXEC_DIR)
|
||||
set(LIBEXEC_DIR libexec)
|
||||
endif(NOT LIBEXEC_DIR)
|
||||
|
||||
# The location in which to install BRL-CAD header files.
|
||||
if(NOT INCLUDE_DIR)
|
||||
set(INCLUDE_DIR include)
|
||||
endif(NOT INCLUDE_DIR)
|
||||
|
||||
# The location in which to install BRL-CAD data files
|
||||
if(NOT DATA_DIR)
|
||||
set(DATA_DIR share)
|
||||
endif(NOT DATA_DIR)
|
||||
|
||||
# The location in which to install BRL-CAD documentation files
|
||||
if(NOT DOC_DIR)
|
||||
set(DOC_DIR ${DATA_DIR}/doc)
|
||||
endif(NOT DOC_DIR)
|
||||
|
||||
# The location in which to install BRL-CAD Manual pages
|
||||
if(NOT MAN_DIR)
|
||||
set(MAN_DIR ${DATA_DIR}/man)
|
||||
endif(NOT MAN_DIR)
|
||||
|
||||
# Make sure no absolute paths have been supplied to these variables
|
||||
set(INSTALL_DIRS BIN INCLUDE LIB LIBEXEC DATA MAN DOC)
|
||||
foreach(instdir ${INSTALL_DIRS})
|
||||
get_filename_component(instdir_full ${${instdir}_DIR} ABSOLUTE)
|
||||
if("${${instdir}_DIR}" STREQUAL "${instdir_full}")
|
||||
message(FATAL_ERROR "Error - absolute path supplied for ${instdir}_DIR. This path must be relative - e.g. \"bin\" instead of \"/usr/bin\"")
|
||||
set(HAVE_INSTALL_DIR_FULL_PATH 1)
|
||||
endif("${${instdir}_DIR}" STREQUAL "${instdir_full}")
|
||||
endforeach(instdir ${INSTALL_DIRS})
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Output directories - this is where built library and executable
|
||||
# files will be placed after building but prior to install. The
|
||||
# necessary variables change between single and multi configuration
|
||||
# build systems, so it is necessary to handle both cases on a
|
||||
# conditional basis.
|
||||
|
||||
if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
# If we're not doing multi-configuration, just set the three main
|
||||
# variables to the correct values.
|
||||
if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${${PROJECT_NAME}_BINARY_DIR}/${LIB_DIR} CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
endif(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${${PROJECT_NAME}_BINARY_DIR}/${LIB_DIR} CACHE INTERNAL "Single output directory for building all archives.")
|
||||
endif(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${${PROJECT_NAME}_BINARY_DIR}/${BIN_DIR} CACHE INTERNAL "Single output directory for building all executables.")
|
||||
endif(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
else(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
# Multi-configuration is more difficult. Not only do we need to
|
||||
# properly set the output directories, but we also need to
|
||||
# identify the "toplevel" directory for each configuration so
|
||||
# we can place files, documentation, etc. in the correct
|
||||
# relative positions. Because files may be placed by CMake
|
||||
# without a build target to put them in their proper relative build
|
||||
# directory position using these paths, we must fully qualify them
|
||||
# without using CMAKE_CFG_INTDIR.
|
||||
#
|
||||
# We define directories that may not be quite "standard"
|
||||
# for a particular build tool - for example, native VS2010 projects use
|
||||
# another directory to denote CPU type being compiled for - but CMake only
|
||||
# supports multi-configuration setups having multiple configurations,
|
||||
# not multiple compilers.
|
||||
#
|
||||
# One additional wrinkle we must watch for here is the case where
|
||||
# a multi-configuration setup uses "." for its internal directory -
|
||||
# if that's the case, we need to just set the various config output
|
||||
# directories to the same value.
|
||||
set(CFG_ROOT ${${PROJECT_NAME}_BINARY_DIR})
|
||||
foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
|
||||
if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
|
||||
set(CFG_ROOT ${${PROJECT_NAME}_BINARY_DIR}/${CFG_TYPE})
|
||||
endif(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
|
||||
string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
|
||||
if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
|
||||
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}" ${CFG_ROOT}/${LIB_DIR} CACHE INTERNAL "Single output directory for building ${CFG_TYPE} libraries.")
|
||||
endif(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
|
||||
if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
|
||||
set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}" ${CFG_ROOT}/${LIB_DIR} CACHE INTERNAL "Single output directory for building ${CFG_TYPE} archives.")
|
||||
endif(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
|
||||
if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
|
||||
set("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}" ${CFG_ROOT}/${BIN_DIR} CACHE INTERNAL "Single output directory for building ${CFG_TYPE} executables.")
|
||||
endif(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
|
||||
if(NOT DEFINED CMAKE_BINARY_DIR_${CFG_TYPE_UPPER})
|
||||
set("CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}" ${CFG_ROOT} CACHE INTERNAL "Toplevel binary dir for ${CFG_TYPE} building.")
|
||||
endif(NOT DEFINED CMAKE_BINARY_DIR_${CFG_TYPE_UPPER})
|
||||
if(NOT DEFINED ${PROJECT_NAME}_BINARY_DIR_${CFG_TYPE_UPPER})
|
||||
set("${PROJECT_NAME}_BINARY_DIR_${CFG_TYPE_UPPER}" ${CFG_ROOT} CACHE INTERNAL "Toplevel binary dir for ${CFG_TYPE} building.")
|
||||
endif(NOT DEFINED ${PROJECT_NAME}_BINARY_DIR_${CFG_TYPE_UPPER})
|
||||
endforeach()
|
||||
endif(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,136 @@
|
||||
# macros to be used in the CMakeLists generated by the schema scanner
|
||||
|
||||
# uses SC_GENERATE_CXX_ONESHOT - if true, files will only be generated once. this is useful when debugging and modifying code, not otherwise. TODO: print a warning when set
|
||||
if(NOT DEFINED SC_GENERATE_CXX_ONESHOT)
|
||||
set(SC_GENERATE_CXX_ONESHOT FALSE)
|
||||
endif(NOT DEFINED SC_GENERATE_CXX_ONESHOT)
|
||||
|
||||
# find all part 21 files in schema dir, add a test for each one
|
||||
macro(P21_TESTS sfile)
|
||||
get_filename_component(SCHEMA_DIR ${sfile} PATH)
|
||||
file(GLOB_RECURSE P21_FILES ${SCHEMA_DIR}/*.stp ${SCHEMA_DIR}/*.step ${SCHEMA_DIR}/*.p21 ${SCHEMA_DIR}/*.ifc)
|
||||
foreach(TEST_FILE ${P21_FILES})
|
||||
get_filename_component(FNAME ${TEST_FILE} NAME_WE)
|
||||
add_test(NAME read_write_cpp_${PROJECT_NAME}_${FNAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND p21read_${PROJECT_NAME} ${TEST_FILE})
|
||||
set_tests_properties(read_write_cpp_${PROJECT_NAME}_${FNAME} PROPERTIES DEPENDS build_cpp_${PROJECT_NAME} LABELS cpp_schema_rw)
|
||||
if(NOT WIN32)
|
||||
add_test(NAME read_lazy_cpp_${PROJECT_NAME}_${FNAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND lazy_${PROJECT_NAME} ${TEST_FILE})
|
||||
set_tests_properties(read_lazy_cpp_${PROJECT_NAME}_${FNAME} PROPERTIES DEPENDS build_lazy_cpp_${PROJECT_NAME} LABELS cpp_schema_rw)
|
||||
endif(NOT WIN32)
|
||||
endforeach()
|
||||
endmacro(P21_TESTS sfile)
|
||||
|
||||
# create p21read_sdai_*, lazy_sdai_*, any exes listed in SC_SDAI_ADDITIONAL_EXES_SRCS
|
||||
macro(SCHEMA_EXES)
|
||||
RELATIVE_PATH_TO_TOPLEVEL(${CMAKE_CURRENT_SOURCE_DIR} RELATIVE_PATH_COMPONENT)
|
||||
SC_ADDEXEC(p21read_${PROJECT_NAME} SOURCES "${RELATIVE_PATH_COMPONENT}/src/test/p21read/p21read.cc;${RELATIVE_PATH_COMPONENT}/src/test/p21read/sc_benchmark.cc" LINK_LIBRARIES ${PROJECT_NAME} stepdai stepcore stepeditor steputils TESTABLE)
|
||||
if(NOT WIN32)
|
||||
SC_ADDEXEC(lazy_${PROJECT_NAME} SOURCES "${RELATIVE_PATH_COMPONENT}/src/cllazyfile/lazy_test.cc;${RELATIVE_PATH_COMPONENT}/src/cllazyfile/sc_benchmark.cc" LINK_LIBRARIES ${PROJECT_NAME} steplazyfile stepdai stepcore stepeditor steputils TESTABLE)
|
||||
endif(NOT WIN32)
|
||||
|
||||
#add user-defined executables
|
||||
foreach(src ${SC_SDAI_ADDITIONAL_EXES_SRCS})
|
||||
get_filename_component(name ${src} NAME_WE)
|
||||
get_filename_component(path ${src} ABSOLUTE)
|
||||
SC_ADDEXEC(${name}_${PROJECT_NAME} SOURCES ${src} LINK_LIBRARIES ${PROJECT_NAME} stepdai stepcore stepeditor steputils TESTABLE)
|
||||
#set_target_properties(${name}_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${${PROJECT_NAME}_COMPILE_FLAGS} -I${path}")
|
||||
endforeach(src ${SC_SDAI_ADDITIONAL_EXES_SRCS})
|
||||
ENDMACRO(SCHEMA_EXES)
|
||||
|
||||
|
||||
# label the tests and set dependencies
|
||||
macro(SCHEMA_TESTS)
|
||||
add_test(NAME generate_cpp_${PROJECT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--target generate_cpp_${PROJECT_NAME}
|
||||
--config $<CONFIGURATION>)
|
||||
set_tests_properties(generate_cpp_${PROJECT_NAME} PROPERTIES LABELS cpp_schema_gen)
|
||||
add_test(NAME build_cpp_${PROJECT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--target p21read_${PROJECT_NAME}
|
||||
--config $<CONFIGURATION>)
|
||||
set_tests_properties(build_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${PROJECT_NAME} LABELS cpp_schema_build)
|
||||
if(NOT WIN32)
|
||||
add_test(NAME build_lazy_cpp_${PROJECT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--target lazy_${PROJECT_NAME}
|
||||
--config $<CONFIGURATION>)
|
||||
set_tests_properties(build_lazy_cpp_${PROJECT_NAME} PROPERTIES DEPENDS build_cpp_${PROJECT_NAME} LABELS cpp_schema_build)
|
||||
endif(NOT WIN32)
|
||||
endmacro(SCHEMA_TESTS)
|
||||
|
||||
# SCHEMA_TARGETS macro -
|
||||
# expFile: path to express file
|
||||
# schemaName: name of the schema
|
||||
# sourceFiles: list of .cc and .h files
|
||||
#
|
||||
# create targets for the schema(s) in expFile
|
||||
# targets include gen_cxx_*, sdai_cxx_*, p21read_*, lazyp21_*, ...
|
||||
macro(SCHEMA_TARGETS expFile schemaName sourceFiles)
|
||||
# schema scanner comes up with a short schema name for PROJECT() (which sets ${PROJECT_NAME})
|
||||
message(STATUS "Will generate ${${PROJECT_NAME}_file_count} C++ files for ${PROJECT_NAME}.")
|
||||
|
||||
add_custom_target(generate_cpp_${PROJECT_NAME} DEPENDS exp2cxx ${expFile} ${sourceFiles} SOURCES ${sourceFiles})
|
||||
# this calls a cmake script because it doesn't seem to be possible
|
||||
# to divert stdout, stderr in cmake except via execute_process
|
||||
add_custom_command(OUTPUT ${sourceFiles}
|
||||
COMMAND ${CMAKE_COMMAND} -DEXE=\"$<TARGET_FILE:exp2cxx>\" -DEXP=\"${expFile}\"
|
||||
-DONESHOT=\"${SC_GENERATE_CXX_ONESHOT}\" -DSDIR=\"${CMAKE_CURRENT_LIST_DIR}\"
|
||||
-P ${SC_CMAKE_DIR}/SC_Run_exp2cxx.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
COMMENT "[exp2cxx] Generating ${${PROJECT_NAME}_file_count} C++ files for ${PROJECT_NAME}."
|
||||
)
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR} ${SC_SOURCE_DIR}/src/cldai ${SC_SOURCE_DIR}/src/cleditor
|
||||
${SC_SOURCE_DIR}/src/clutils ${SC_SOURCE_DIR}/src/clstepcore ${SC_SOURCE_DIR}/src/cllazyfile
|
||||
${SC_SOURCE_DIR}/src/cllazyfile/judy/src
|
||||
)
|
||||
# if testing is enabled, "TESTABLE" sets property EXCLUDE_FROM_ALL and prevents installation
|
||||
if(BUILD_SHARED_LIBS)
|
||||
SC_ADDLIB(${PROJECT_NAME} SHARED SOURCES ${sourceFiles} LINK_LIBRARIES stepdai stepcore stepeditor steputils TESTABLE)
|
||||
add_dependencies(${PROJECT_NAME} generate_cpp_${PROJECT_NAME})
|
||||
if(WIN32)
|
||||
target_compile_definitions("${PROJECT_NAME}" PRIVATE SC_SCHEMA_DLL_EXPORTS)
|
||||
if(MSVC)
|
||||
target_compile_options("${PROJECT_NAME}" PRIVATE "/bigobj")
|
||||
endif()
|
||||
endif()
|
||||
# TODO - ideally we would avoid generating code that triggers this warning, but figuring out
|
||||
# how to do so is a non-trivial exercise. In the meantime, suppress the (very verbose) warnings
|
||||
# we get due to this issue so it doesn't mask other problems.
|
||||
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
|
||||
target_compile_options("${PROJECT_NAME}" PRIVATE "-Wno-ignored-qualifiers")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if($CACHE{SC_BUILD_STATIC_LIBS})
|
||||
SC_ADDLIB(${PROJECT_NAME}-static STATIC SOURCES ${sourceFiles} LINK_LIBRARIES stepdai-static stepcore-static stepeditor-static steputils-static TESTABLE)
|
||||
add_dependencies(${PROJECT_NAME}-static generate_cpp_${PROJECT_NAME})
|
||||
target_compile_definitions("${PROJECT_NAME}-static" PRIVATE SC_STATIC)
|
||||
if(MSVC)
|
||||
target_compile_options("${PROJECT_NAME}-static" PRIVATE "/bigobj")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
SCHEMA_EXES()
|
||||
SCHEMA_TESTS()
|
||||
P21_TESTS(${expFile})
|
||||
# TODO add test to verify that schema scanner output matches fedex_plus output
|
||||
|
||||
endmacro(SCHEMA_TARGETS expFile schemaName sourceFiles)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
# create config.h
|
||||
|
||||
include(CheckLibraryExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckTypeSize)
|
||||
include(CMakePushCheckState)
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckCXXSourceRuns)
|
||||
|
||||
CHECK_INCLUDE_FILE(ndir.h HAVE_NDIR_H)
|
||||
CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
|
||||
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
|
||||
CHECK_INCLUDE_FILE(sysent.h HAVE_SYSENT_H)
|
||||
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
|
||||
CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
|
||||
CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
|
||||
CHECK_INCLUDE_FILE(process.h HAVE_PROCESS_H)
|
||||
CHECK_INCLUDE_FILE(io.h HAVE_IO_H)
|
||||
|
||||
# ensure macro functions are captured
|
||||
CHECK_SYMBOL_EXISTS(abs "stdlib.h" HAVE_ABS)
|
||||
CHECK_SYMBOL_EXISTS(memcpy "string.h" HAVE_MEMCPY)
|
||||
CHECK_SYMBOL_EXISTS(memmove "string.h" HAVE_MEMMOVE)
|
||||
CHECK_SYMBOL_EXISTS(getopt "getopt.h" HAVE_GETOPT)
|
||||
CHECK_SYMBOL_EXISTS(snprintf "stdio.h" HAVE_SNPRINTF)
|
||||
CHECK_SYMBOL_EXISTS(vsnprintf "stdio.h" HAVE_VSNPRINTF)
|
||||
|
||||
CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
|
||||
|
||||
if(SC_ENABLE_CXX11)
|
||||
set( TEST_STD_THREAD "
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
void do_work() {std::cout << \"thread\" << std::endl;}
|
||||
int main() {std::thread t(do_work);t.join();}
|
||||
" )
|
||||
cmake_push_check_state()
|
||||
if( UNIX )
|
||||
set( CMAKE_REQUIRED_FLAGS "-pthread -std=c++11" )
|
||||
else( UNIX )
|
||||
# vars probably need set for embarcadero, etc
|
||||
endif( UNIX )
|
||||
CHECK_CXX_SOURCE_RUNS( "${TEST_STD_THREAD}" HAVE_STD_THREAD ) #quotes are *required*!
|
||||
cmake_pop_check_state()
|
||||
|
||||
set( TEST_STD_CHRONO "
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
int main() {
|
||||
std::chrono::seconds sec(1);
|
||||
std::cout << \"1s is \"<< std::chrono::duration_cast<std::chrono::milliseconds>(sec).count() << \" ms\" << std::endl;
|
||||
}
|
||||
" )
|
||||
cmake_push_check_state()
|
||||
if( UNIX )
|
||||
set( CMAKE_REQUIRED_FLAGS "-std=c++11" )
|
||||
else( UNIX )
|
||||
# vars probably need set for embarcadero, etc
|
||||
endif( UNIX )
|
||||
CHECK_CXX_SOURCE_RUNS( "${TEST_STD_CHRONO}" HAVE_STD_CHRONO ) #quotes are *required*!
|
||||
cmake_pop_check_state()
|
||||
|
||||
set( TEST_NULLPTR "
|
||||
#include <cstddef>
|
||||
std::nullptr_t f() {return nullptr;}
|
||||
int main() {return !(f() == f());}
|
||||
" )
|
||||
cmake_push_check_state()
|
||||
if( UNIX )
|
||||
set( CMAKE_REQUIRED_FLAGS "-std=c++11" )
|
||||
else( UNIX )
|
||||
# vars probably need set for embarcadero, etc
|
||||
endif( UNIX )
|
||||
CHECK_CXX_SOURCE_RUNS( "${TEST_NULLPTR}" HAVE_NULLPTR ) #quotes are *required*!
|
||||
cmake_pop_check_state()
|
||||
endif(SC_ENABLE_CXX11)
|
||||
|
||||
# Now that all the tests are done, configure the config.h file:
|
||||
configure_file(${CMAKE_SOURCE_DIR}/include/config.h.in ${SC_BINARY_DIR}/${INCLUDE_DIR}/config.h.gen)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SC_BINARY_DIR}/${INCLUDE_DIR}/config.h.gen ${SC_BINARY_DIR}/${INCLUDE_DIR}/config.h)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
|
||||
# to "C" so things like date output are as expected
|
||||
set(_orig_lc_all $ENV{LC_ALL})
|
||||
set(_orig_lc_messages $ENV{LC_MESSAGES})
|
||||
set(_orig_lang $ENV{LANG})
|
||||
if(_orig_lc_all)
|
||||
set(ENV{LC_ALL} C)
|
||||
endif(_orig_lc_all)
|
||||
if(_orig_lc_messages)
|
||||
set(ENV{LC_MESSAGES} C)
|
||||
endif(_orig_lc_messages)
|
||||
if(_orig_lang)
|
||||
set(ENV{LANG} C)
|
||||
endif(_orig_lang)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# in its own file so that it can be used by the schema scanner as well
|
||||
if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SC_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
endif(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SC_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
endif(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SC_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
endif(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
|
||||
string(TOUPPER "${CFG_TYPE}" CFG_TYPE)
|
||||
if(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SC_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
endif(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
if(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SC_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
endif(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
if(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
set("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SC_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
endif(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
endforeach()
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
macro(REVERSE_PATH in_path out_path drive_path)
|
||||
set(reversed_path)
|
||||
set(tmp_subpath "${in_path}")
|
||||
while(NOT "${tmp_subpath}" STREQUAL "" AND NOT "${tmp_subpath}" STREQUAL "/")
|
||||
get_filename_component(piece "${tmp_subpath}" NAME)
|
||||
get_filename_component(tmp_subpath "${tmp_subpath}" PATH)
|
||||
if(piece)
|
||||
set(reversed_path "${reversed_path}/${piece}")
|
||||
else(piece)
|
||||
set(${drive_path} ${tmp_subpath})
|
||||
set(tmp_subpath)
|
||||
endif(piece)
|
||||
endwhile(NOT "${tmp_subpath}" STREQUAL "" AND NOT "${tmp_subpath}" STREQUAL "/")
|
||||
set("${out_path}" "${reversed_path}")
|
||||
endmacro(REVERSE_PATH)
|
||||
|
||||
macro(GET_COMMON_ROOT_PATH dir1 dir2 common_subpath)
|
||||
get_filename_component(testpath "${dir1}" REALPATH)
|
||||
set(dir1_rev)
|
||||
set(dir2_rev)
|
||||
REVERSE_PATH("${dir1}" dir1_rev drive_name_1)
|
||||
REVERSE_PATH("${dir2}" dir2_rev drive_name_2)
|
||||
if("${drive_name_1}" STREQUAL "${drive_name_2}")
|
||||
set(component_same 1)
|
||||
set(${common_subpath})
|
||||
while(component_same)
|
||||
get_filename_component(piece1 "${dir1_rev}" NAME)
|
||||
get_filename_component(dir1_rev "${dir1_rev}" PATH)
|
||||
get_filename_component(piece2 "${dir2_rev}" NAME)
|
||||
get_filename_component(dir2_rev "${dir2_rev}" PATH)
|
||||
if("${piece1}" STREQUAL "${piece2}")
|
||||
set(${common_subpath} "${${common_subpath}}/${piece1}")
|
||||
else("${piece1}" STREQUAL "${piece2}")
|
||||
set(component_same 0)
|
||||
endif("${piece1}" STREQUAL "${piece2}")
|
||||
endwhile(component_same)
|
||||
if(drive_name_1)
|
||||
set(${common_subpath} "${drive_name_1}${${common_subpath}}")
|
||||
string(REPLACE "//" "/" ${common_subpath} "${${common_subpath}}")
|
||||
endif(drive_name_1)
|
||||
endif("${drive_name_1}" STREQUAL "${drive_name_2}")
|
||||
endmacro(GET_COMMON_ROOT_PATH)
|
||||
|
||||
|
||||
macro(RELATIVE_PATH_TO_TOPLEVEL current_dir rel_path)
|
||||
set(common_root_path)
|
||||
GET_COMMON_ROOT_PATH("${SC_SOURCE_DIR}" "${current_dir}" common_root_path)
|
||||
string(REPLACE "${common_root_path}" "" subpath "${current_dir}")
|
||||
string(REPLACE "${common_root_path}" "" needed_src_path "${SC_SOURCE_DIR}")
|
||||
string(REGEX REPLACE "^/" "" subpath "${subpath}")
|
||||
string(REGEX REPLACE "^/" "" needed_src_path "${needed_src_path}")
|
||||
string(LENGTH "${subpath}" PATH_LENGTH)
|
||||
if(PATH_LENGTH GREATER 0)
|
||||
set(${rel_path} "..")
|
||||
get_filename_component(subpath "${subpath}" PATH)
|
||||
string(LENGTH "${subpath}" PATH_LENGTH)
|
||||
while(PATH_LENGTH GREATER 0)
|
||||
set(${rel_path} "${${rel_path}}/..")
|
||||
get_filename_component(subpath "${subpath}" PATH)
|
||||
string(LENGTH "${subpath}" PATH_LENGTH)
|
||||
endwhile(PATH_LENGTH GREATER 0)
|
||||
endif(PATH_LENGTH GREATER 0)
|
||||
set(${rel_path} "${${rel_path}}/${needed_src_path}")
|
||||
string(REPLACE "//" "/" ${rel_path} "${${rel_path}}")
|
||||
endmacro(RELATIVE_PATH_TO_TOPLEVEL current_dir rel_path)
|
||||
|
||||
macro(LOCATE_SCHEMA SCHEMA_FILE _res_var)
|
||||
if(EXISTS "${CMAKE_BINARY_DIR}/${SCHEMA_FILE}") #is it a path relative to build dir?
|
||||
set(${_res_var} "${CMAKE_BINARY_DIR}/${SCHEMA_FILE}")
|
||||
elseif(EXISTS "${SC_SOURCE_DIR}/data/${SCHEMA_FILE}") # path relative to STEPcode/data?
|
||||
set(${_res_var} "${SC_SOURCE_DIR}/data/${SCHEMA_FILE}")
|
||||
elseif(EXISTS ${SCHEMA_FILE}) # already an absolute path
|
||||
set(${_res_var} ${SCHEMA_FILE})
|
||||
else()
|
||||
message(FATAL_ERROR "Cannot find ${CMAKE_BINARY_DIR}/${SCHEMA_FILE} or ${SC_SOURCE_DIR}/data/${SCHEMA_FILE}/*.exp or ${SCHEMA_FILE}")
|
||||
endif()
|
||||
|
||||
if(IS_DIRECTORY ${${_res_var}}) #if it is a dir, look for one .exp file inside
|
||||
file(GLOB ${_res_var} ${${_res_var}}/*.exp)
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS ${${_res_var}})
|
||||
message(FATAL_ERROR "Expected one express file. Found '${${_res_var}}' instead.")
|
||||
endif()
|
||||
endmacro(LOCATE_SCHEMA SCHEMA_FILE _res_var)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# The Express parser uses the tools RE2C and Lemon to generate code
|
||||
# from higher level inputs. Depending on available tools and options, the
|
||||
# SC build can either re-generate code as part of the build, or use cached
|
||||
# files that are ready for compilation.
|
||||
#
|
||||
# SC_GENERATE_LEXER_PARSER is the "high level" control a user sets to determine
|
||||
# how the SC build will interact (or not) with these tools. AUTO (the
|
||||
# default) means it will search for the necessary tools, and use them only if
|
||||
# everything is found. If not, it will fall back to the cached versions. If
|
||||
# this option is set to ON and the necessary tools are not found, the
|
||||
# configure step will fail. If it is set to OFF, SC will not even try to use
|
||||
# the generators and will instead use the cached sources.
|
||||
|
||||
set(_valid_gen_states AUTO ON OFF)
|
||||
set(_verbosity "QUIET")
|
||||
|
||||
set(SC_GENERATE_LEXER_PARSER "AUTO" CACHE
|
||||
STRING "Use Perplex, RE2C and Lemon to generate C source code.")
|
||||
set_property(CACHE SC_GENERATE_LEXER_PARSER PROPERTY STRINGS ${_valid_gen_states})
|
||||
string(TOUPPER "${SC_GENERATE_LEXER_PARSER}" SC_GENERATE_LEXER_PARSER)
|
||||
|
||||
if(NOT "${SC_GENERATE_LEXER_PARSER}" IN_LIST _valid_gen_states)
|
||||
message(WARNING "Unknown value ${SC_GENERATE_LEXER_PARSER} supplied for SC_GENERATE_LEXER_PARSER - defaulting to AUTO")
|
||||
message(WARNING "Valid options are AUTO, ON and OFF")
|
||||
set(SC_GENERATE_LEXER_PARSER "AUTO" CACHE STRING "Use Perplex, RE2C and Lemon to generate C source code.")
|
||||
endif()
|
||||
|
||||
# If the generators have not been turned off, we need to check for them
|
||||
if(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
|
||||
# NOTE: lemon doesn't have a stable versioning system (it's always 1)
|
||||
find_package(LEMON ${_verbosity})
|
||||
find_package(RE2C ${_verbosity})
|
||||
find_package(PERPLEX ${_verbosity})
|
||||
|
||||
if(LEMON_FOUND AND RE2C_FOUND)
|
||||
set(SC_GENERATE_LP_SOURCES 1)
|
||||
message(".. Found re2c, and lemon - can regenerate lexer/parser if necessary")
|
||||
else()
|
||||
if("${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON")
|
||||
message(FATAL_ERROR "\nSC_GENERATE_LEXER_PARSER set to ON, but couldn't find lemon/re2c")
|
||||
else("${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON")
|
||||
set(SC_GENERATE_LP_SOURCES 0)
|
||||
endif("${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON")
|
||||
endif()
|
||||
else(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
|
||||
set(SC_GENERATE_LP_SOURCES 0)
|
||||
endif(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
# if oneshot is true, don't run exp2cxx if source files exist. if schema.cc exists, assume others do
|
||||
if(ONESHOT AND EXISTS "${SDIR}/schema.cc")
|
||||
message("WARNING: SC_GENERATE_CXX_ONESHOT is enabled. If generated code has been modified, it will NOT be rewritten!")
|
||||
message("This is ONLY for debugging STEPcode internals!")
|
||||
else()
|
||||
execute_process(COMMAND ${EXE} ${EXP}
|
||||
WORKING_DIRECTORY ${SDIR}
|
||||
RESULT_VARIABLE _res
|
||||
OUTPUT_FILE exp2cxx_stdout.txt
|
||||
ERROR_FILE exp2cxx_stderr.txt
|
||||
)
|
||||
if(NOT "${_res}" STREQUAL "0")
|
||||
message(FATAL_ERROR "${EXE} reported an error for ${EXP}.\nsee exp2cxx_stdout.txt and exp2cxx_stderr.txt in ${SDIR} for details.")
|
||||
endif(NOT "${_res}" STREQUAL "0")
|
||||
# TODO count number of lines in stdout/stderr and tell user?
|
||||
endif()
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
macro(SC_ADDEXEC execname)
|
||||
set(_addexec_opts NO_INSTALL TESTABLE)
|
||||
set(_addexec_multikw SOURCES LINK_LIBRARIES)
|
||||
string(TOUPPER "SC_ADDEXEC_${execname}_ARG" _arg_prefix)
|
||||
cmake_parse_arguments(${_arg_prefix} "${_addexec_opts}" "" "${_addexec_multikw}" ${ARGN})
|
||||
|
||||
if(NOT DEFINED "${_arg_prefix}_SOURCES")
|
||||
message(SEND_ERROR "SC_ADDEXEC usage error!")
|
||||
endif()
|
||||
|
||||
add_executable(${execname} ${${_arg_prefix}_SOURCES})
|
||||
|
||||
if(DEFINED "${_arg_prefix}_LINK_LIBRARIES")
|
||||
foreach(_lib ${${_arg_prefix}_LINK_LIBRARIES})
|
||||
if($CACHE{SC_STATIC_UTILS})
|
||||
if(NOT $<TARGET_PROPERTY:${_lib},TYPE> STREQUAL "STATIC_LIBRARY")
|
||||
message(SEND_ERROR "SC_ADDEXEC usage error - expected STATIC LINK_LIBRARIES targets (${_lib})")
|
||||
endif()
|
||||
endif()
|
||||
target_link_libraries(${execname} ${_lib})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT ${_arg_prefix}_NO_INSTALL AND NOT ${_arg_prefix}_TESTABLE)
|
||||
install(TARGETS ${execname}
|
||||
RUNTIME DESTINATION ${BIN_DIR}
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT SC_ENABLE_TESTING AND ${_arg_prefix}_TESTABLE)
|
||||
set_target_properties(${execname} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(SC_ADDLIB _addlib_target)
|
||||
set(_addlib_opts SHARED STATIC NO_INSTALL TESTABLE)
|
||||
set(_addlib_multikw SOURCES LINK_LIBRARIES)
|
||||
string(TOUPPER "SC_ADDLIB_${libname}_ARG" _arg_prefix)
|
||||
cmake_parse_arguments(${_arg_prefix} "${_addlib_opts}" "" "${_addlib_multikw}" ${ARGN})
|
||||
|
||||
if(NOT DEFINED ${_arg_prefix}_SOURCES)
|
||||
message(SEND_ERROR "SC_ADDLIB usage error!")
|
||||
endif()
|
||||
|
||||
if(${_arg_prefix}_SHARED)
|
||||
add_library(${_addlib_target} SHARED ${${_arg_prefix}_SOURCES})
|
||||
if(OPENBSD)
|
||||
set_target_properties(${_addlib_target} PROPERTIES VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR})
|
||||
else(OPENBSD)
|
||||
set_target_properties(${_addlib_target} PROPERTIES VERSION ${SC_VERSION} SOVERSION ${SC_VERSION_MAJOR})
|
||||
endif(OPENBSD)
|
||||
if(APPLE)
|
||||
set_target_properties(${_addlib_target} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
elseif(${_arg_prefix}_STATIC)
|
||||
add_library(${_addlib_target} STATIC ${${_arg_prefix}_SOURCES})
|
||||
target_compile_definitions(${_addlib_target} PRIVATE SC_STATIC)
|
||||
else()
|
||||
message(SEND_ERROR "SC_ADDLIB usage error!")
|
||||
endif()
|
||||
|
||||
if(DEFINED ${_arg_prefix}_LINK_LIBRARIES)
|
||||
foreach(_lib ${${_arg_prefix}_LINK_LIBRARIES})
|
||||
if(${_arg_prefix}_STATIC AND TARGET ${_lib})
|
||||
get_property(_libtype TARGET ${_lib} PROPERTY TYPE)
|
||||
if(NOT ${_libtype} STREQUAL "STATIC_LIBRARY")
|
||||
message(SEND_ERROR "SC_ADDLIB usage error - expected (static) LINK_LIBRARIES targets (${_lib})")
|
||||
endif()
|
||||
endif()
|
||||
target_link_libraries(${_addlib_target} ${_lib})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT ${_arg_prefix}_NO_INSTALL AND NOT ${_arg_prefix}_TESTABLE)
|
||||
install(TARGETS ${_addlib_target}
|
||||
RUNTIME DESTINATION ${BIN_DIR}
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
|
||||
# set compile definitions for dll exports on windows
|
||||
MACRO(DEFINE_DLL_EXPORTS libname)
|
||||
IF( MSVC OR BORLAND )
|
||||
if( ${libname} MATCHES "sdai_.*" )
|
||||
set( export "SC_SCHEMA_DLL_EXPORTS" )
|
||||
else()
|
||||
STRING(REGEX REPLACE "lib" "" shortname "${libname}")
|
||||
STRING(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
|
||||
STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
set( export "SC_${UPPER_CORE}_DLL_EXPORTS" )
|
||||
endif()
|
||||
get_target_property(defs ${libname} COMPILE_DEFINITIONS )
|
||||
if( defs ) #if no properties, ${defs} will be defs-NOTFOUND which CMake interprets as false
|
||||
set( defs "${defs};${export}")
|
||||
else( defs )
|
||||
set( defs "${export}")
|
||||
endif( defs )
|
||||
set_target_properties(${libname} PROPERTIES COMPILE_DEFINITIONS "${defs}" )
|
||||
ENDIF( MSVC OR BORLAND )
|
||||
ENDMACRO(DEFINE_DLL_EXPORTS libname)
|
||||
|
||||
# set compile definitions for dll imports on windows
|
||||
MACRO( DEFINE_DLL_IMPORTS tgt libs )
|
||||
IF( MSVC OR BORLAND )
|
||||
get_target_property(defs ${tgt} COMPILE_DEFINITIONS )
|
||||
if( NOT defs ) #if no properties, ${defs} will be defs-NOTFOUND which CMake interprets as false
|
||||
set( defs "")
|
||||
endif( NOT defs )
|
||||
foreach( lib ${libs} )
|
||||
STRING(REGEX REPLACE "lib" "" shortname "${lib}")
|
||||
STRING(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
|
||||
STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
list( APPEND defs "SC_${UPPER_CORE}_DLL_IMPORTS" )
|
||||
endforeach( lib ${libs} )
|
||||
if( DEFINED defs )
|
||||
if( defs )
|
||||
set_target_properties( ${tgt} PROPERTIES COMPILE_DEFINITIONS "${defs}" )
|
||||
endif( defs )
|
||||
endif( DEFINED defs )
|
||||
ENDIF( MSVC OR BORLAND )
|
||||
ENDMACRO( DEFINE_DLL_IMPORTS tgt libs )
|
||||
|
||||
#EXCLUDE_OR_INSTALL(target destination ARGV3)
|
||||
# installs ${target} in ${destination} unless testing is enabled AND ${arg_3} == "TESTABLE",
|
||||
# in which case the EXCLUDE_FROM_ALL property is set for testing.
|
||||
# EXCLUDE_FROM_ALL cannot be set on targets that are to be installed,
|
||||
# so either test the target or install it - but not both
|
||||
MACRO(EXCLUDE_OR_INSTALL target dest arg_3 )
|
||||
if( NOT ( ( SC_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
|
||||
INSTALL(TARGETS ${target} DESTINATION ${dest})
|
||||
else( NOT ( ( SC_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
|
||||
set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
|
||||
endif( NOT ( ( SC_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
|
||||
ENDMACRO(EXCLUDE_OR_INSTALL target dest arg_3 )
|
||||
|
||||
#SC_ADDEXEC( execname "source files" "linked libs" ["TESTABLE"] ["MSVC flag" ...])
|
||||
# optional 4th argument of "TESTABLE", passed to EXCLUDE_OR_INSTALL macro
|
||||
# optional args can also be used by MSVC-specific code, but it looks like these two uses
|
||||
# will not conflict because the MSVC args must contain "STRICT"
|
||||
MACRO(SC_ADDEXEC execname srcslist libslist)
|
||||
add_executable(${execname} ${srcslist})
|
||||
target_link_libraries(${execname} ${libslist})
|
||||
DEFINE_DLL_IMPORTS(${execname} "${libslist}") #add import definitions for all libs that the executable is linked to
|
||||
EXCLUDE_OR_INSTALL( ${execname} "bin" "${ARGV3}" )
|
||||
# Enable extra compiler flags if local executables and/or global options dictate
|
||||
SET(LOCAL_COMPILE_FLAGS "")
|
||||
FOREACH(extraarg ${ARGN})
|
||||
IF(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
|
||||
ENDFOREACH(extraarg ${ARGN})
|
||||
IF(LOCAL_COMPILE_FLAGS)
|
||||
SET_TARGET_PROPERTIES(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(LOCAL_COMPILE_FLAGS)
|
||||
ENDMACRO(SC_ADDEXEC execname srcslist libslist)
|
||||
|
||||
#SC_ADDLIB( libname "source files" "linked libs" ["TESTABLE"] ["MSVC flag" ...])
|
||||
# optional 4th argument of "TESTABLE", passed to EXCLUDE_OR_INSTALL macro
|
||||
# optional args can also be used by MSVC-specific code, but it looks like these two uses
|
||||
# will not conflict because the MSVC args must contain "STRICT"
|
||||
MACRO(SC_ADDLIB libname srcslist libslist)
|
||||
STRING(REGEX REPLACE "-framework;" "-framework " libslist "${libslist1}")
|
||||
IF(SC_BUILD_SHARED_LIBS)
|
||||
add_library(${libname} SHARED ${srcslist})
|
||||
DEFINE_DLL_EXPORTS(${libname})
|
||||
if(NOT "${libs}" MATCHES "NONE")
|
||||
target_link_libraries(${libname} ${libslist})
|
||||
DEFINE_DLL_IMPORTS(${libname} "${libslist}" )
|
||||
endif(NOT "${libs}" MATCHES "NONE")
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SC_ABI_VERSION} SOVERSION ${SC_ABI_SOVERSION} )
|
||||
EXCLUDE_OR_INSTALL( ${libname} "lib" "${ARGV3}" )
|
||||
if(APPLE)
|
||||
set_target_properties(${libname} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
ENDIF(SC_BUILD_SHARED_LIBS)
|
||||
IF(SC_BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
if( NOT SC_BUILD_SHARED_LIBS )
|
||||
set( staticlibname "${libname}" )
|
||||
else()
|
||||
set( staticlibname "${libname}-static" )
|
||||
endif( NOT SC_BUILD_SHARED_LIBS )
|
||||
add_library(${staticlibname} STATIC ${srcslist})
|
||||
DEFINE_DLL_EXPORTS(${staticlibname})
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${staticlibname} "${libslist}")
|
||||
DEFINE_DLL_IMPORTS(${staticlibname} ${libslist} )
|
||||
endif(NOT ${libs} MATCHES "NONE")
|
||||
IF(NOT WIN32)
|
||||
SET_TARGET_PROPERTIES(${staticlibname} PROPERTIES OUTPUT_NAME "${libname}")
|
||||
ENDIF(NOT WIN32)
|
||||
IF(WIN32)
|
||||
# We need the lib prefix on win32, so add it even if our add_library
|
||||
# wrapper function has removed it due to the target name - see
|
||||
# http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_make_my_shared_and_static_libraries_have_the_same_root_name.2C_but_different_suffixes.3F
|
||||
SET_TARGET_PROPERTIES(${staticlibname} PROPERTIES PREFIX "lib")
|
||||
ENDIF(WIN32)
|
||||
EXCLUDE_OR_INSTALL( ${staticlibname} "lib" "${ARGV3}" )
|
||||
if(APPLE)
|
||||
set_target_properties(${staticlibname} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
ENDIF(SC_BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
# Enable extra compiler flags if local libraries and/or global options dictate
|
||||
SET(LOCAL_COMPILE_FLAGS "")
|
||||
FOREACH(extraarg ${ARGN})
|
||||
IF(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
|
||||
ENDFOREACH(extraarg ${ARGN})
|
||||
IF(LOCAL_COMPILE_FLAGS)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
IF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
SET_TARGET_PROPERTIES(${staticlibname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
ENDIF(LOCAL_COMPILE_FLAGS)
|
||||
ENDMACRO(SC_ADDLIB libname srcslist libslist)
|
||||
@@ -1,102 +0,0 @@
|
||||
# Inherit the parent CMake setting
|
||||
set(CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
|
||||
set(LEMON_EXECUTABLE "@LEMON_EXECUTABLE@")
|
||||
set(RE2C_EXECUTABLE "@RE2C_EXECUTABLE@")
|
||||
set(PERPLEX_EXECUTABLE "@PERPLEX_EXECUTABLE@")
|
||||
set(SYNC_SCRIPT "@SYNC_SCRIPT@")
|
||||
set(SYNC_TARGET_NAME "@SYNC_TARGET_NAME@")
|
||||
set(DEBUGGING_GENERATED_SOURCES "@DEBUGGING_GENERATED_SOURCES@")
|
||||
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
# Include the file the provides the baseline against which
|
||||
# current files will be compared
|
||||
include("@BASELINE_INFORMATION_FILE@")
|
||||
|
||||
# Define a variety of convenience routines
|
||||
include("@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake")
|
||||
|
||||
# The following need to be checked:
|
||||
#
|
||||
# 1. baseline input MD5 hashes against the current input
|
||||
# hashes. If the cached sources were generated using
|
||||
# inputs other than the current inputs, note they are
|
||||
# out of sync but don't stop. Templates used by perplex
|
||||
# and lemon are part of this group.
|
||||
#
|
||||
# 2. baseline cached source MD5 hashes against current
|
||||
# cached source MD5 hashes. Making sure no changes
|
||||
# have been made to the generated sources. If the
|
||||
# cached sources need to be updated (see #1, for example)
|
||||
# their MD5 hashes need to be updated at the same time.
|
||||
#
|
||||
# 3. MD5 hashes of output generated by the tools against
|
||||
# the MD5 hashes of the equalivent cached sources, if
|
||||
# a) the tool versions are the same b) the input MD5
|
||||
# hash comparisions were the same and c) the baseline
|
||||
# test from #2 passed. This is done to detect platform
|
||||
# differences in output sources, but is only valid if
|
||||
# the input files are in their "pristine" state and the
|
||||
# toolchain is equalivent to that used for the baseline.
|
||||
|
||||
# Individually verify all of the files in question.
|
||||
set(input_files "@INPUT_FILELIST@")
|
||||
VERIFY_FILES("${input_files}" 0 input_unchanged)
|
||||
set(template_files "@TEMPLATE_FILELIST@")
|
||||
VERIFY_FILES("${template_files}" 1 templates_unchanged)
|
||||
set(cached_files "@CACHED_FILELIST@")
|
||||
VERIFY_FILES("${cached_files}" 1 cached_unchanged)
|
||||
if(cached_unchanged)
|
||||
message( "Cached generated source code has not been modified.")
|
||||
else()
|
||||
message(FATAL_ERROR "Cached generated sources do not match the MD5 hashes present in /home/mark/step/sc/src/express/generated/verification_info.cmake - if updating cached sources, remember that the build enforces the requirement that associated MD5 hashes in /home/mark/step/sc/src/express/generated/verification_info.cmake are current as well. Cached generated sources should not be directly edited.")
|
||||
endif(cached_unchanged)
|
||||
|
||||
GET_GENERATOR_EXEC_VERSIONS()
|
||||
|
||||
if("${lemon_version}" VERSION_EQUAL "${baseline_lemon_version}" AND "${perplex_version}" VERSION_EQUAL "${baseline_perplex_version}" AND "${re2c_version}" VERSION_EQUAL "${baseline_re2c_version}")
|
||||
set(tool_versions_equal 1)
|
||||
else()
|
||||
set(tool_versions_equal 0)
|
||||
endif()
|
||||
|
||||
if(NOT input_unchanged)
|
||||
if(templates_unchanged AND tool_versions_equal)
|
||||
message("Input files changed - syncing cached outputs")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -P ${SYNC_SCRIPT} OUTPUT_VARIABLE output)
|
||||
else(templates_unchanged AND tool_versions_equal)
|
||||
if(NOT templates_unchanged AND NOT tool_versions_equal)
|
||||
message("Input files have been updated, but templates and current tool versions do not match those previously used to generate cached sources. Automatic syncing will not proceed.")
|
||||
message("To force syncing, use the build target ${SYNC_TARGET_NAME}")
|
||||
else(NOT templates_unchanged AND NOT tool_versions_equal)
|
||||
if(NOT templates_unchanged)
|
||||
message("Input files have been updated, but templates do not match those previously used to generate cached sources. Automatic syncing will not proceed.")
|
||||
message("To force syncing, use the build target ${SYNC_TARGET_NAME}")
|
||||
endif(NOT templates_unchanged)
|
||||
if(NOT tool_versions_equal)
|
||||
message("Input files have been updated, but tool versions do not match those previously used to generate cached sources. Automatic syncing will not proceed.")
|
||||
message("To force syncing, use the build target ${SYNC_TARGET_NAME}")
|
||||
endif(NOT tool_versions_equal)
|
||||
endif(NOT templates_unchanged AND NOT tool_versions_equal)
|
||||
endif(templates_unchanged AND tool_versions_equal)
|
||||
else(NOT input_unchanged)
|
||||
if(templates_unchanged AND cached_unchanged AND tool_versions_equal)
|
||||
# Under these conditions, the uncached generated output should be equal to the cached files.
|
||||
# Check if it is - a difference here may indicate a platform-specific behavior in one of the
|
||||
# generators.
|
||||
set(build_files "@BUILD_OUTPUT_FILELIST@")
|
||||
VERIFY_FILES("${build_files}" 1 platform_unchanged)
|
||||
if(NOT platform_unchanged)
|
||||
message("Note: give these build inputs and tools, source files should be identical to generated files. Differences were still observed - possible indiciation of platform-specific generator behavior.")
|
||||
endif(NOT platform_unchanged)
|
||||
endif(templates_unchanged AND cached_unchanged AND tool_versions_equal)
|
||||
endif(NOT input_unchanged)
|
||||
else(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
message("\nNote: DEBUGGING_GENERATED_SOURCES is enabled - generated outputs will contain configuration-specific debugging information, so syncing cached output files is not possible. To restore normal behavior, disable DEBUGGING_GENERATED_SOURCES.\n")
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,80 +0,0 @@
|
||||
# creates sc_version_string.h, which defines sc_version()
|
||||
# sc_version() returns a pretty commit description and a build timestamp.
|
||||
|
||||
# http://stackoverflow.com/questions/3780667
|
||||
# http://www.cmake.org/pipermail/cmake/2009-February/027014.html
|
||||
|
||||
|
||||
set(SC_IS_SUBBUILD "@SC_IS_SUBBUILD@")
|
||||
|
||||
#---------- find commit id ------------------
|
||||
#use git for a pretty commit id
|
||||
#uses 'git describe --tags', so tags are required in the repo
|
||||
#create a tag with 'git tag <name>' and 'git push --tags'
|
||||
#if git can't be found, uses contents of SC_VERSION.txt
|
||||
|
||||
set(VERS_FILE ${SOURCE_DIR}/SC_VERSION.txt )
|
||||
if( EXISTS ${SOURCE_DIR}/.git )
|
||||
find_package(Git QUIET)
|
||||
if(GIT_FOUND)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags WORKING_DIRECTORY ${SOURCE_DIR}
|
||||
RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COMMIT_ID )
|
||||
if( NOT ${res_var} EQUAL 0 )
|
||||
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
message( WARNING "Git failed (probably no tags in repo). Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(NOT SC_IS_SUBBUILD)
|
||||
endif()
|
||||
else(GIT_FOUND)
|
||||
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
message( WARNING "Git not found. Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(NOT SC_IS_SUBBUILD)
|
||||
endif(GIT_FOUND)
|
||||
else()
|
||||
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
message( WARNING "Git failed ('.git' not found). Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(NOT SC_IS_SUBBUILD)
|
||||
endif()
|
||||
string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID} )
|
||||
|
||||
#-------------- date and time ---------------
|
||||
#once cmake_minimum_required is >= 2.8.11, we can use TIMESTAMP:
|
||||
#string( TIMESTAMP date_time_string )
|
||||
|
||||
if( UNIX )
|
||||
execute_process( COMMAND date "+%d %b %Y %H:%M" OUTPUT_VARIABLE date_time_string OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
elseif( WIN32 )
|
||||
execute_process( COMMAND cmd /c date /t OUTPUT_VARIABLE currentDate OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
execute_process( COMMAND cmd /c time /t OUTPUT_VARIABLE currentTime OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
set ( date_time_string "${currentDate} ${currentTime}" )
|
||||
else()
|
||||
set( date_time_string "\" __DATE__ \" \" __TIME__ \" " )
|
||||
if( NOT SC_IS_SUBBUILD )
|
||||
message( STATUS "Unknown platform - using date from preprocessor" )
|
||||
endif( NOT SC_IS_SUBBUILD )
|
||||
endif()
|
||||
|
||||
set( header_string "/* sc_version_string.h - written by cmake. Changes will be lost! */\n"
|
||||
"#ifndef SC_VERSION_STRING\n"
|
||||
"#define SC_VERSION_STRING\n\n"
|
||||
"/*\n** The git commit id looks like \"test-1-g5e1fb47\", where test is the\n"
|
||||
"** name of the last tagged git revision, 1 is the number of commits since that tag,\n"
|
||||
"** 'g' is unknown, and 5e1fb47 is the first 7 chars of the git sha1 commit id.\n"
|
||||
"** timestamp is created from date/time commands on known platforms, and uses\n"
|
||||
"** preprocessor macros elsewhere.\n*/\n\n"
|
||||
"static char sc_version[512] = {\n"
|
||||
" \"git commit id: ${GIT_COMMIT_ID}, build timestamp ${date_time_string}\"\n"
|
||||
"}\;\n\n"
|
||||
"#endif\n"
|
||||
)
|
||||
|
||||
file(WRITE sc_version_string.h.txt ${header_string} )
|
||||
# copy the file to the final header only if the version changes
|
||||
# reduces needless rebuilds
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
sc_version_string.h.txt ${BINARY_DIR}/include/sc_version_string.h)
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
message("-- sc_version_string.h is up-to-date.")
|
||||
endif(NOT SC_IS_SUBBUILD)
|
||||
@@ -0,0 +1,75 @@
|
||||
project(SC_SUBPROJECT_SCHEMA_SCANNER)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
if(NOT ("${CALLED_FROM}" STREQUAL "STEPCODE_CMAKELISTS" AND DEFINED SC_ROOT AND DEFINED SC_BUILDDIR))
|
||||
message(" ${CALLED_FROM} ${SC_ROOT} ${SC_BUILDDIR}")
|
||||
message(FATAL_ERROR "This is not a truly independent project; it should be built during the STEPcode configuration stage.")
|
||||
endif()
|
||||
|
||||
# SC_ROOT: SC root dir
|
||||
# SC_BUILDDIR: SC build dir, so generated headers can be found
|
||||
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
|
||||
# set all target location variables so that MSVC will put the executable the same place as other compilers
|
||||
set(SC_BINARY_DIR ${SC_BUILDDIR})
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../SC_Outdirs.cmake)
|
||||
|
||||
set(schema_scanner_src
|
||||
${SC_ROOT}/src/exp2cxx/genCxxFilenames.c
|
||||
${SC_ROOT}/src/exp2cxx/class_strings.c
|
||||
${SC_ROOT}/src/express/generated/expparse.c
|
||||
${SC_ROOT}/src/express/generated/expscan.c
|
||||
${SC_ROOT}/src/express/alg.c
|
||||
${SC_ROOT}/src/express/alloc.c
|
||||
${SC_ROOT}/src/express/caseitem.c
|
||||
${SC_ROOT}/src/express/dict.c
|
||||
${SC_ROOT}/src/express/entity.c
|
||||
${SC_ROOT}/src/express/error.c
|
||||
${SC_ROOT}/src/express/exp_kw.c
|
||||
${SC_ROOT}/src/express/expr.c
|
||||
${SC_ROOT}/src/express/express.c
|
||||
${SC_ROOT}/src/express/factory.c
|
||||
${SC_ROOT}/src/express/hash.c
|
||||
${SC_ROOT}/src/express/lexact.c
|
||||
${SC_ROOT}/src/express/linklist.c
|
||||
${SC_ROOT}/src/express/memory.c
|
||||
${SC_ROOT}/src/express/object.c
|
||||
${SC_ROOT}/src/express/info.c
|
||||
${SC_ROOT}/src/express/resolve.c
|
||||
${SC_ROOT}/src/express/resolve2.c
|
||||
${SC_ROOT}/src/express/schema.c
|
||||
${SC_ROOT}/src/express/scope.c
|
||||
${SC_ROOT}/src/express/stmt.c
|
||||
${SC_ROOT}/src/express/symbol.c
|
||||
${SC_ROOT}/src/express/type.c
|
||||
${SC_ROOT}/src/express/variable.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/schemaScanner.cc
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${SC_ROOT}/include/
|
||||
${SC_ROOT}/src/express/
|
||||
${SC_ROOT}/src/express/generated
|
||||
${SC_ROOT}/src/exp2cxx
|
||||
${SC_BUILDDIR}/include
|
||||
)
|
||||
|
||||
add_executable(schema_scanner ${schema_scanner_src})
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning for preferred usage of secure functions (example strcpy should be strcpy_s, ...)
|
||||
target_compile_definitions(schema_scanner PUBLIC _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS)
|
||||
else()
|
||||
target_compile_options(schema_scanner PUBLIC -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(schema_scanner PUBLIC SC_STATIC SCHEMA_SCANNER)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
README for STEPcode schema scanner
|
||||
--------------
|
||||
|
||||
The files in this directory are for a schema scanner executable, built by CMake during the configuration stage.
|
||||
|
||||
This scanner is used to determine the file names that exp2cxx will use. In CMake, all file names must be known before
|
||||
configuration finishes - so it is necessary to parse the schemas early.
|
||||
|
||||
This appears to be a standalone project to CMake, but it is intended to be built only as part of STEPcode. It is configured,
|
||||
built, and executed during the configuration stage of STEPcode.
|
||||
@@ -0,0 +1,365 @@
|
||||
|
||||
/** \file schemaScanner.cc
|
||||
* This file, along with part of libexpress, are compiled (at configure time)
|
||||
* into a static executable. This executable is a schema scanner that is used
|
||||
* by CMake to determine what files exp2cxx will create. Otherwise, we'd need
|
||||
* to use a few huge files - there is no other way to tell CMake what the
|
||||
* generated files will be called.
|
||||
*/
|
||||
|
||||
/* WARNING
|
||||
* If you modify this file, you must re-run cmake. It doesn't seem to be possible
|
||||
* to re-run cmake automatically, as CMake's configure_file() gets confused by
|
||||
* the '${' and '}' in writeLists() below.
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
#define _XOPEN_SOURCE /* for S_IFDIR */
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "expparse.h"
|
||||
#include "expscan.h"
|
||||
#include "express/scope.h"
|
||||
#include "genCxxFilenames.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <direct.h>
|
||||
# define getcwd _getcwd
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
}
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
int multiple_inheritance = 0;
|
||||
|
||||
using std::string;
|
||||
using std::stringstream;
|
||||
using std::endl;
|
||||
using std::ofstream;
|
||||
using std::cerr;
|
||||
using std::cout;
|
||||
|
||||
/** \return true for types that exp2cxx won't generate code for */
|
||||
bool notGenerated( const Type t ) {
|
||||
switch( TYPEget_body( t )->type ) {
|
||||
case integer_:
|
||||
case real_:
|
||||
case string_:
|
||||
case binary_:
|
||||
case boolean_:
|
||||
case number_:
|
||||
case logical_:
|
||||
case aggregate_:
|
||||
case bag_:
|
||||
case set_:
|
||||
case list_:
|
||||
case array_:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* from addRenameTypedefs() in multpass.c - check for renamed
|
||||
* enums and selects - exp2cxx prints typedefs for them */
|
||||
if( ( TYPEis_enumeration( t ) || TYPEis_select( t ) ) && ( TYPEget_head( t ) ) ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** \return a short name for the schema
|
||||
* this name is intended to be unique, but no special care is put into its generation
|
||||
* the official schema name seems most likely to not be unique, but it is generally the longest
|
||||
*
|
||||
* picks the shortest of:
|
||||
* * the name of the dir containing the file (if in sc/data),
|
||||
* * the name of the file containing the schema (minus extension),
|
||||
* * the official name of the schema, passed in arg 'longName'
|
||||
*
|
||||
* TODO: maybe also consider an acronym, such that 'test_array_bounds_expr' becomes 'tabe', 'TABE', 'T_A_B_E', or similar
|
||||
*/
|
||||
string makeShortName( const char * longName ) {
|
||||
//input_filename is path to file. we will extract dir name and file name from it.
|
||||
string dirname = input_filename, filename = input_filename, schname = longName;
|
||||
const char slash = '/';
|
||||
|
||||
//for filename, get rid of dir name(s), if any, as well as the extension
|
||||
size_t sl = filename.rfind( slash );
|
||||
if( sl != string::npos ) {
|
||||
filename.erase( 0, sl + 1 );
|
||||
}
|
||||
size_t dot = filename.rfind( '.' );
|
||||
if( dot != string::npos ) {
|
||||
filename.erase( dot );
|
||||
}
|
||||
|
||||
//for dirname, get rid of the filename and ensure it's in data/
|
||||
sl = dirname.rfind( slash );
|
||||
if( sl != string::npos ) {
|
||||
dirname.erase( sl );
|
||||
}
|
||||
const char * dat = "data";
|
||||
size_t data = dirname.find( dat );
|
||||
if( ( data == string::npos ) || ( dirname[ data + strlen( dat ) ] != slash ) ) {
|
||||
//doesn't contain 'data/'. clear it so it'll be ignored.
|
||||
dirname.clear();
|
||||
} else {
|
||||
//get rid of all but last dir name
|
||||
dirname.erase( 0, dirname.rfind( slash ) + 1 );
|
||||
}
|
||||
|
||||
//use dir name if it's at least 3 chars and shorter than file name
|
||||
//length requirement gets rid of short, undescriptive dir names - including '.' and '..'
|
||||
if( ( dirname.size() > 2 ) && ( dirname.size() < filename.size() ) ) {
|
||||
filename = dirname;
|
||||
}
|
||||
if( strlen( longName ) < filename.size() ) {
|
||||
filename = longName;
|
||||
}
|
||||
filename.insert( 0, "sdai_" );
|
||||
return filename;
|
||||
}
|
||||
|
||||
/* cross-platform mkdir */
|
||||
int sc_mkdir( const char * path ) {
|
||||
#ifdef _WIN32
|
||||
return mkdir( path );
|
||||
#else
|
||||
return mkdir( path, 0777 );
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
/* return -1 if error, 0 if created, 1 if dir existed already */
|
||||
static int mkDirIfNone( const char * path ) {
|
||||
struct stat s;
|
||||
if( stat( path, &s ) != 0 ) {
|
||||
if( errno == ENOENT ) {
|
||||
return sc_mkdir( path );
|
||||
}
|
||||
} else if( s.st_mode & S_IFDIR ) {
|
||||
return 1;
|
||||
}
|
||||
/* either stat returned an error other than ENOENT, or 'path' exists but isn't a dir */
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/** write a CMakeLists.txt file for the schema; print its directory to stdout for CMake's add_subdirectory() command */
|
||||
void writeLists( const char * schemaName, stringstream & eh, stringstream & ei, int ecount,
|
||||
stringstream & th, stringstream & ti, int tcount ) {
|
||||
string shortName = makeShortName( schemaName );
|
||||
if( mkDirIfNone( shortName.c_str() ) < 0 ) {
|
||||
cerr << "Error creating directory " << shortName << " at " << __FILE__ << ":" << __LINE__;
|
||||
perror( 0 );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
size_t nameLen = strlen( schemaName );
|
||||
string schema_upper( nameLen, char() );
|
||||
for( size_t i = 0; i < nameLen; ++i) {
|
||||
schema_upper[i] = toupper(schemaName[i]);
|
||||
}
|
||||
string cmListsPath = shortName;
|
||||
cmListsPath += "/CMakeLists.txt";
|
||||
ofstream cmLists;
|
||||
cmLists.open( cmListsPath.c_str() );
|
||||
if( !cmLists.good() ) {
|
||||
cerr << "error opening file " << cmListsPath << " - exiting." << endl;
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
cmLists << "# ----- GENERATED FILE -----" << endl;
|
||||
cmLists << "# ----- Do not edit! -----" << endl << endl;
|
||||
|
||||
cmLists << "# schema name: " << schemaName << endl;
|
||||
cmLists << "# (short name: " << shortName << ")" << endl;
|
||||
cmLists << "# " << ecount << " entities, " << tcount << " types" << endl << endl;
|
||||
|
||||
cmLists << "# targets, logic, etc are within a set of macros shared by all schemas" << endl;
|
||||
cmLists << "include(${SC_CMAKE_DIR}/SC_CXX_schema_macros.cmake)" << endl;
|
||||
|
||||
// * 2 for headers, + 10 other files
|
||||
cmLists << "set(" << shortName << "_file_count " << ( ( ecount + tcount ) * 2 ) + 10 << ")" << endl << endl;
|
||||
|
||||
|
||||
cmLists << "PROJECT(" << shortName << ")" << endl;
|
||||
cmLists << "# list headers so they can be installed - entity, type, misc" << endl;
|
||||
|
||||
cmLists << "set(" << shortName << "_entity_hdrs" << endl;
|
||||
cmLists << eh.str();
|
||||
cmLists << " )" << endl << endl;
|
||||
|
||||
cmLists << "set(" << shortName << "_type_hdrs" << endl;
|
||||
cmLists << th.str();
|
||||
cmLists << " )" << endl << endl;
|
||||
|
||||
cmLists << "set(" << shortName << "_misc_hdrs" << endl;
|
||||
cmLists << " Sdaiclasses.h schema.h" << endl;
|
||||
cmLists << " Sdai" << schema_upper << "Names.h" << endl;
|
||||
cmLists << " Sdai" << schema_upper << ".h" << endl;
|
||||
cmLists << " )" << endl << endl;
|
||||
|
||||
cmLists << "# install all headers" << endl;
|
||||
cmLists << "set(all_headers ${" << shortName << "_entity_hdrs} ${" << shortName << "_type_hdrs} ${" << shortName << "_misc_hdrs})" << endl;
|
||||
cmLists << "foreach( header_file ${all_headers} )" << endl;
|
||||
cmLists << " set(curr_dir)" << endl;
|
||||
cmLists << " get_filename_component(curr_dir ${header_file} PATH)" << endl;
|
||||
cmLists << " get_filename_component(curr_name ${header_file} NAME)" << endl;
|
||||
cmLists << " if (curr_dir)" << endl;
|
||||
cmLists << " install( FILES ${header_file} DESTINATION \"include/schemas/" << shortName << "/${curr_dir}\" )" << endl;
|
||||
cmLists << " else (curr_dir)" << endl;
|
||||
cmLists << " install( FILES ${header_file} DESTINATION \"include/schemas/" << shortName << "\" )" << endl;
|
||||
cmLists << " endif (curr_dir)" << endl;
|
||||
cmLists << "endforeach()" << endl;
|
||||
|
||||
cmLists << "# implementation files - 3 lists" << endl << endl;
|
||||
|
||||
cmLists << "# unity build: #include small .cc files to reduce the number" << endl;
|
||||
cmLists << "# of translation units that must be compiled" << endl;
|
||||
cmLists << "if(SC_UNITY_BUILD)" << endl << " # turns off include statements within type and entity .cc's - the unity T.U.'s include a unity header" << endl;
|
||||
cmLists << " add_definitions( -DSC_SDAI_UNITY_BUILD)" << endl;
|
||||
cmLists << " set(" << shortName << "_entity_impls Sdai" << schema_upper << "_unity_entities.cc)" << endl;
|
||||
cmLists << " set(" << shortName << "_type_impls Sdai" << schema_upper << "_unity_types.cc)" << endl;
|
||||
cmLists << "else(SC_UNITY_BUILD)" << endl;
|
||||
cmLists << " set(" << shortName << "_entity_impls" << endl;
|
||||
cmLists << ei.str();
|
||||
cmLists << " )" << endl << endl;
|
||||
|
||||
cmLists << " set(" << shortName << "_type_impls" << endl;
|
||||
cmLists << ti.str();
|
||||
cmLists << " )" << endl;
|
||||
cmLists << "endif(SC_UNITY_BUILD)" << endl << endl;
|
||||
|
||||
cmLists << "set( " << shortName << "_misc_impls" << endl;
|
||||
cmLists << " SdaiAll.cc compstructs.cc schema.cc" << endl;
|
||||
cmLists << " Sdai" << schema_upper << ".cc" << endl;
|
||||
cmLists << " Sdai" << schema_upper << ".init.cc )" << endl << endl;
|
||||
|
||||
cmLists << "set(schema_target_files ${" << shortName << "_entity_impls} " << "${" << shortName << "_type_impls} " << "${" << shortName << "_misc_impls})" << endl;
|
||||
cmLists << "SCHEMA_TARGETS(\"" << input_filename << "\" \"" << schemaName << "\"" << endl;
|
||||
cmLists << " \"${schema_target_files}\")" << endl;
|
||||
|
||||
cmLists.close();
|
||||
|
||||
char pwd[BUFSIZ+1] = {0};
|
||||
if( getcwd( pwd, BUFSIZ ) ) {
|
||||
cout << pwd << "/" << shortName << endl;
|
||||
} else {
|
||||
cerr << "Error encountered by getcwd() for " << shortName << " - exiting. Error was ";
|
||||
perror( 0 );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
}
|
||||
|
||||
void printSchemaFilenames( Schema sch ){
|
||||
const int numColumns = 2;
|
||||
const int colWidth = 75;
|
||||
const char * tab = " ";
|
||||
|
||||
stringstream typeHeaders, typeImpls, entityHeaders, entityImpls;
|
||||
typeHeaders << tab;
|
||||
typeImpls << tab;
|
||||
entityHeaders << tab;
|
||||
entityImpls << tab;
|
||||
|
||||
int ecount = 0, tcount = 0;
|
||||
|
||||
DictionaryEntry de;
|
||||
void *x;
|
||||
filenames_t fn;
|
||||
DICTdo_init( sch->symbol_table, &de );
|
||||
while( 0 != ( x = DICTdo( &de ) ) ) {
|
||||
switch( DICT_type ) {
|
||||
case OBJ_ENTITY:
|
||||
fn = getEntityFilenames( ( Entity ) x );
|
||||
entityHeaders << std::left << std::setw( colWidth ) << fn.header << " ";
|
||||
entityImpls << std::left << std::setw( colWidth ) << fn.impl << " ";
|
||||
++ecount;
|
||||
if( ( ecount % numColumns ) == 0 ) {
|
||||
// columns
|
||||
entityHeaders << endl << tab;
|
||||
entityImpls << endl << tab;
|
||||
}
|
||||
break;
|
||||
case OBJ_TYPE: {
|
||||
Type t = ( Type ) x;
|
||||
if( TYPEis_enumeration( t ) && ( TYPEget_head( t ) ) ) {
|
||||
/* t is a renamed enum type, for which exp2cxx
|
||||
* will print a typedef in an existing file */
|
||||
break;
|
||||
}
|
||||
if( notGenerated( t ) ) {
|
||||
/* skip builtin types */
|
||||
break;
|
||||
}
|
||||
fn = getTypeFilenames( t );
|
||||
typeHeaders << std::left << std::setw( colWidth ) << fn.header << " ";
|
||||
typeImpls << std::left << std::setw( colWidth ) << fn.impl << " ";
|
||||
++tcount;
|
||||
if( ( tcount % numColumns ) == 0 ) {
|
||||
typeHeaders << endl << tab;
|
||||
typeImpls << endl << tab;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* case OBJ_FUNCTION:
|
||||
* case OBJ_PROCEDURE:
|
||||
* case OBJ_RULE: */
|
||||
default:
|
||||
/* ignore everything else */
|
||||
/* TODO: if DEBUG is defined, print the names of these to stderr */
|
||||
break;
|
||||
}
|
||||
}
|
||||
//write the CMakeLists.txt
|
||||
writeLists( sch->symbol.name, entityHeaders, entityImpls, ecount, typeHeaders, typeImpls, tcount );
|
||||
}
|
||||
|
||||
int main( int argc, char ** argv ) {
|
||||
/* TODO init globals! */
|
||||
|
||||
Schema schema;
|
||||
DictionaryEntry de;
|
||||
/* copied from fedex.c */
|
||||
Express model;
|
||||
if( ( argc != 2 ) || ( strlen( argv[1] ) < 1 ) ) {
|
||||
fprintf( stderr, "\nUsage: %s file.exp\nOutput: a CMakeLists.txt to build the schema,", argv[0] );
|
||||
fprintf( stderr, " containing file names for entities, types, etc\n" );
|
||||
fprintf( stderr, "also prints (to stdout) the absolute path to the directory CMakeLists.txt was created in\n" );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
EXPRESSprogram_name = argv[0];
|
||||
input_filename = argv[1];
|
||||
|
||||
EXPRESSinitialize();
|
||||
|
||||
model = EXPRESScreate();
|
||||
EXPRESSparse( model, ( FILE * )0, input_filename );
|
||||
if( ERRORoccurred ) {
|
||||
EXPRESSdestroy( model );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
EXPRESSresolve( model );
|
||||
if( ERRORoccurred ) {
|
||||
int result = EXPRESS_fail( model );
|
||||
EXPRESScleanup();
|
||||
EXPRESSdestroy( model );
|
||||
exit( result );
|
||||
}
|
||||
|
||||
DICTdo_type_init( model->symbol_table, &de, OBJ_SCHEMA );
|
||||
while( 0 != ( schema = ( Schema )DICTdo( &de ) ) ) {
|
||||
printSchemaFilenames( schema );
|
||||
}
|
||||
|
||||
EXPRESSdestroy( model );
|
||||
exit( EXIT_SUCCESS );
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
# this file should be included from data/CMakeLists.txt
|
||||
#
|
||||
# at configure time, this builds a small program
|
||||
# which will parse express schemas to determine
|
||||
# what files exp2cxx will create for that schema.
|
||||
#
|
||||
# The SCHEMA_CMLIST macro is to be used to run this
|
||||
# program. It will set variables for schema name(s),
|
||||
# headers, and implementation files.
|
||||
|
||||
# in a unity build, many small .cc files are #included to create a few large translation units
|
||||
# this makes compilation faster, but sometimes runs into compiler limitations
|
||||
if(NOT DEFINED SC_UNITY_BUILD)
|
||||
message( STATUS "Assuming compiler is capable of unity build. (SC_UNITY_BUILD=TRUE)")
|
||||
set(SC_UNITY_BUILD TRUE)
|
||||
message( STATUS "Override by setting SC_UNITY_BUILD; TRUE will result in faster build times but *huge* translation units and higher memory use in compilation.")
|
||||
else(NOT DEFINED SC_UNITY_BUILD)
|
||||
message( STATUS "Respecting user-defined SC_UNITY_BUILD value of ${SC_UNITY_BUILD}.")
|
||||
endif(NOT DEFINED SC_UNITY_BUILD)
|
||||
|
||||
|
||||
# --- variables ---
|
||||
# SC_ROOT: SC root dir
|
||||
# SC_BUILDDIR: SC build dir, so generated headers can be found
|
||||
# SCANNER_SRC_DIR: dir this file is in
|
||||
# SCANNER_OUT_DIR: location of binary, same dir as SC uses
|
||||
# SCANNER_BUILD_DIR: location scanner is built
|
||||
|
||||
set(SCANNER_SRC_DIR ${SC_CMAKE_DIR}/schema_scanner)
|
||||
set(SCANNER_BUILD_DIR ${SC_BINARY_DIR}/schema_scanner CACHE INTERNAL "location for scanner build, config files (copied schemas)")
|
||||
set(SCANNER_OUT_DIR ${SC_BINARY_DIR}/bin CACHE INTERNAL "location for schema_scanner executable")
|
||||
|
||||
#write a cmake file for the cache. the alternative is a very long
|
||||
# command line - and the command line can't have newlines in it
|
||||
set(initial_scanner_cache ${SCANNER_BUILD_DIR}/initial_scanner_cache.cmake)
|
||||
file(WRITE ${initial_scanner_cache} "
|
||||
set(SC_ROOT \"${SC_SOURCE_DIR}\" CACHE STRING \"root dir\")
|
||||
set(SC_BUILDDIR \"${SC_BINARY_DIR}\" CACHE PATH \"build dir\")
|
||||
set(CALLED_FROM \"STEPCODE_CMAKELISTS\" CACHE STRING \"verification\")
|
||||
set(CMAKE_BUILD_TYPE \"Debug\" CACHE STRING \"build type\")
|
||||
set(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\" CACHE STRING \"compiler\")
|
||||
set(CMAKE_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\" CACHE STRING \"compiler\")
|
||||
")
|
||||
|
||||
message( STATUS "Compiling schema scanner...")
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${SC_BINARY_DIR}/schemas)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${SCANNER_BUILD_DIR})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -C ${initial_scanner_cache} ${SCANNER_SRC_DIR} -G ${CMAKE_GENERATOR}
|
||||
WORKING_DIRECTORY ${SCANNER_BUILD_DIR}
|
||||
TIMEOUT 60
|
||||
OUTPUT_VARIABLE _ss_config_out
|
||||
RESULT_VARIABLE _ss_config_stat
|
||||
ERROR_VARIABLE _ss_config_err
|
||||
)
|
||||
if(NOT ${_ss_config_stat} STREQUAL "0")
|
||||
message(FATAL_ERROR "Scanner config status: ${_ss_config_stat}. stdout:\n${_ss_config_out}\nstderr:\n${_ss_config_err}")
|
||||
endif(NOT ${_ss_config_stat} STREQUAL "0")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --build ${SCANNER_BUILD_DIR} --config Debug --clean-first
|
||||
WORKING_DIRECTORY ${SCANNER_BUILD_DIR}
|
||||
TIMEOUT 120 # should take far less than 2m
|
||||
OUTPUT_VARIABLE _ss_build_out
|
||||
RESULT_VARIABLE _ss_build_stat
|
||||
ERROR_VARIABLE _ss_build_err
|
||||
)
|
||||
if(NOT ${_ss_build_stat} STREQUAL "0")
|
||||
message(FATAL_ERROR "Scanner build status: ${_ss_build_stat}. stdout:\n${_ss_build_out}\nstderr:\n${_ss_build_err}")
|
||||
endif(NOT ${_ss_build_stat} STREQUAL "0")
|
||||
|
||||
message( STATUS "Schema scanner built. Running it...")
|
||||
|
||||
# not sure if it makes sense to install this or not...
|
||||
if(WIN32)
|
||||
install(PROGRAMS ${SCANNER_OUT_DIR}/schema_scanner.exe DESTINATION ${BIN_DIR})
|
||||
else(WIN32)
|
||||
install(PROGRAMS ${SCANNER_OUT_DIR}/schema_scanner DESTINATION ${BIN_DIR})
|
||||
endif(WIN32)
|
||||
|
||||
# macro SCHEMA_CMLIST
|
||||
# runs the schema scanner on one express file, creating a CMakeLists.txt file for each schema found. Those files are added via add_subdirectory().
|
||||
#
|
||||
# SCHEMA_FILE - path to the schema
|
||||
# TODO should we have a result variable to return schema name(s) found?
|
||||
macro(SCHEMA_CMLIST SCHEMA_FILE)
|
||||
execute_process(COMMAND ${SCANNER_OUT_DIR}/schema_scanner ${SCHEMA_FILE}
|
||||
WORKING_DIRECTORY ${SC_BINARY_DIR}/schemas
|
||||
RESULT_VARIABLE _ss_stat
|
||||
OUTPUT_VARIABLE _ss_out
|
||||
ERROR_VARIABLE _ss_err
|
||||
)
|
||||
if(NOT "${_ss_stat}" STREQUAL "0")
|
||||
#check size of output, put in file if large?
|
||||
message(FATAL_ERROR "Schema scan for '${SCHEMA_FILE}'\nexited with error code '${_ss_stat}'\nstdout:\n${_ss_out}\nstderr:\n${_ss_err}\n")
|
||||
endif(NOT "${_ss_stat}" STREQUAL "0")
|
||||
# scanner output format: each line contains an absolute path. each path is a dir containing a CMakeLists for one schema
|
||||
# there will usually be a single line of output, but it is not illegal for multiple schemas to exist in one .exp file
|
||||
string(STRIP "${_ss_out}" _ss_stripped)
|
||||
string(REGEX REPLACE "\\\n" ";" _list ${_ss_stripped})
|
||||
foreach(_dir ${_list})
|
||||
add_subdirectory(${_dir} ${_dir}) #specify source and binary dirs as the same
|
||||
endforeach(_dir ${_ss_out})
|
||||
# configure_file forces cmake to run again if the schema has been modified
|
||||
#if multiple schemas in one file, _schema is the last one printed.
|
||||
# 2e6ee669 removed _schema, does this still work?
|
||||
configure_file(${SCHEMA_FILE} ${SCANNER_BUILD_DIR}/${_schema})
|
||||
endmacro(SCHEMA_CMLIST SCHEMA_FILE)
|
||||
@@ -1,83 +0,0 @@
|
||||
# Inherit the parent CMake setting
|
||||
set(CURRENT_SOURCE_DIR @CMAKE_CURRENT_SOURCE_DIR@)
|
||||
set(CURRENT_BINARY_DIR @CMAKE_CURRENT_BINARY_DIR@)
|
||||
set(CACHED_FILES_DIR @CACHED_FILES_DIR@)
|
||||
set(LEMON_EXECUTABLE @LEMON_EXECUTABLE@)
|
||||
set(RE2C_EXECUTABLE @RE2C_EXECUTABLE@)
|
||||
set(PERPLEX_EXECUTABLE @PERPLEX_EXECUTABLE@)
|
||||
set(LOCKED_SOURCE_DIR @LOCKED_SOURCE_DIR@)
|
||||
set(DEBUGGING_GENERATED_SOURCES @DEBUGGING_GENERATED_SOURCES@)
|
||||
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
# Define a variety of convenience routines
|
||||
include(@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake)
|
||||
|
||||
# The following steps are executed to sync generated sources:
|
||||
#
|
||||
# 1. Create a new verification_info.cmake file and populate
|
||||
# it with the current versions of perplex, re2c and lemon.
|
||||
# Also add the MD5 sums for current template files.
|
||||
#
|
||||
# 2. For all files that need to be updated in the cache,
|
||||
# calculate new MD5 sums and add them to the new
|
||||
# verification_info.cmake - this is usually the input
|
||||
# files and the generated outputs.
|
||||
#
|
||||
# 3. Overwrite the original cached verification_info.cmake
|
||||
# and generated files with the new ones. If LOCKED_SOURCE_DIR
|
||||
# is ON, this step will not be carried out - instead, an
|
||||
# informational message with manual updating instructions
|
||||
# will be printed.
|
||||
|
||||
set(new_info_file "${CURRENT_BINARY_DIR}/verification_info.cmake.new")
|
||||
|
||||
|
||||
file(WRITE ${new_info_file} "# Autogenerated verification information\n")
|
||||
|
||||
# Handle generator version numbers
|
||||
GET_GENERATOR_EXEC_VERSIONS()
|
||||
file(APPEND ${new_info_file} "set(baseline_lemon_version \"${lemon_version}\")\n")
|
||||
file(APPEND ${new_info_file} "set(baseline_re2c_version \"${re2c_version}\")\n")
|
||||
file(APPEND ${new_info_file} "set(baseline_perplex_version \"${perplex_version}\")\n")
|
||||
|
||||
# Handle template files
|
||||
set(template_files "@TEMPLATE_FILELIST@")
|
||||
WRITE_MD5_SUMS("${template_files}" "${new_info_file}")
|
||||
|
||||
# Handle input files
|
||||
set(input_files "@INPUT_FILELIST@")
|
||||
WRITE_MD5_SUMS("${input_files}" "${new_info_file}")
|
||||
|
||||
# Handle generated files
|
||||
set(output_files "@BUILD_OUTPUT_FILELIST@")
|
||||
WRITE_MD5_SUMS("${output_files}" "${new_info_file}")
|
||||
|
||||
# Copy files into their final locations
|
||||
if(NOT LOCKED_SOURCE_DIR)
|
||||
configure_file(${new_info_file} "${CACHED_FILES_DIR}/verification_info.cmake" COPYONLY)
|
||||
foreach(outf ${output_files})
|
||||
get_filename_component(filecorename ${outf} NAME)
|
||||
message("copying ${outf} to ${CACHED_FILES_DIR}/${filecorename}")
|
||||
configure_file(${outf} "${CACHED_FILES_DIR}/${filecorename}" COPYONLY)
|
||||
endforeach(outf ${output_files})
|
||||
else(NOT LOCKED_SOURCE_DIR)
|
||||
message("Source directory writing is locked - LOCKED_SOURCE_DIR is set.")
|
||||
message("To update the generated files, manually copy the following to ${CACHED_FILES_DIR}:")
|
||||
message(" ${new_info_file} (rename to verification_info.cmake)")
|
||||
foreach(outf ${output_files})
|
||||
message(" ${outf}")
|
||||
endforeach(outf ${output_files})
|
||||
endif(NOT LOCKED_SOURCE_DIR)
|
||||
|
||||
else (NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
message("\nNote: DEBUGGING_GENERATED_SOURCES is enabled - generated outputs will contain configuration-specific debugging information, so syncing cached output files is not possible. To restore normal behavior, disable DEBUGGING_GENERATED_SOURCES.\n")
|
||||
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,39 +0,0 @@
|
||||
# Inherit the parent CMake setting
|
||||
set(DEBUGGING_GENERATED_SOURCES @DEBUGGING_GENERATED_SOURCES@)
|
||||
set(CURRENT_SOURCE_DIR @CMAKE_CURRENT_SOURCE_DIR@)
|
||||
|
||||
# Include the file the provides the baseline against which
|
||||
# current files will be compared
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
include(@BASELINE_INFORMATION_FILE@)
|
||||
|
||||
# Define a variety of convenience routines
|
||||
include(@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake)
|
||||
|
||||
# Individually verify all of the files in question.
|
||||
set(filelist "@CACHED_FILELIST@")
|
||||
VERIFY_FILES("${filelist}" 1 srcs_pass)
|
||||
if( srcs_pass)
|
||||
message( "Generated source code has not been modified.")
|
||||
else(srcs_pass)
|
||||
message(FATAL_ERROR "Generated sources have been modified. These files should never be modified directly except when debugging faulty output from the generators - changes to lexer and parser logic should be made to the generator input files. If this is a debugging situation, set the variable DEBUGGING_GENERATED_SOURCES to ON during the CMake configure.")
|
||||
endif(srcs_pass)
|
||||
|
||||
# If we got by that test, see if it looks like these
|
||||
# sources came from the current input files. It's not
|
||||
# a failure condition if they didn't, but warn about it.
|
||||
set(filelist "@INPUT_FILELIST@")
|
||||
VERIFY_FILES("${filelist}" 0 inputs_same)
|
||||
if(NOT inputs_same)
|
||||
message("Note: cached generated sources are not in sync with input files.")
|
||||
endif(NOT inputs_same)
|
||||
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
+18
-10
@@ -1,11 +1,11 @@
|
||||
# run_ctest.cmake
|
||||
# `ctest -S run_ctest.cmake`
|
||||
|
||||
set( CTEST_SOURCE_DIRECTORY . )
|
||||
set( CTEST_BINARY_DIRECTORY build_matrix )
|
||||
set( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
|
||||
set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
|
||||
set( CTEST_INITIAL_CACHE "
|
||||
set(CTEST_SOURCE_DIRECTORY .)
|
||||
set(CTEST_BINARY_DIRECTORY build_matrix)
|
||||
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
|
||||
set(CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind)
|
||||
set(CTEST_INITIAL_CACHE "
|
||||
SITE:STRING=${CTEST_SITE}
|
||||
BUILDNAME:STRING=${CTEST_BUILD_NAME}
|
||||
SC_ENABLE_TESTING:BOOL=ON
|
||||
@@ -15,11 +15,19 @@ SC_BUILD_TYPE:STRING=Debug
|
||||
|
||||
ctest_start(matrix)
|
||||
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
|
||||
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS -DSC_ENABLE_TESTING=ON )
|
||||
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" )
|
||||
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS -DSC_ENABLE_TESTING=ON)
|
||||
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}")
|
||||
message("running tests")
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE_LABEL "cpp_schema_....*" )
|
||||
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE_LABEL "cpp_schema_....*")
|
||||
|
||||
message("running python script")
|
||||
execute_process( COMMAND python ../misc/wiki-scripts/update-matrix.py
|
||||
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} )
|
||||
execute_process(COMMAND python ../misc/wiki-scripts/update-matrix.py
|
||||
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY})
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
+31
-176
@@ -1,181 +1,36 @@
|
||||
# To build one or more schemas, configure with
|
||||
# 'cmake -DSC_BUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
|
||||
# you can specify a schema in 3 ways:
|
||||
# * path relative to build dir
|
||||
# * path relative to sc/data (this dir)
|
||||
# * absolute path
|
||||
#
|
||||
# cmake goes through the above options in order until it finds one
|
||||
# that exists. if ${path} is a dir, cmake expects to find a single
|
||||
# .exp file inside, which it uses. otherwise, ${path} is assumed to
|
||||
# be an express file.
|
||||
|
||||
MACRO(RELATIVE_PATH_TO_TOPLEVEL current_dir rel_path)
|
||||
string(REPLACE "${SC_SOURCE_DIR}" "" subpath "${current_dir}")
|
||||
string(REGEX REPLACE "^/" "" subpath "${subpath}")
|
||||
string(LENGTH "${subpath}" PATH_LENGTH)
|
||||
if(PATH_LENGTH GREATER 0)
|
||||
set(${rel_path} "..")
|
||||
get_filename_component(subpath "${subpath}" PATH)
|
||||
string(LENGTH "${subpath}" PATH_LENGTH)
|
||||
while(PATH_LENGTH GREATER 0)
|
||||
set(${rel_path} "${${rel_path}}/..")
|
||||
get_filename_component(subpath "${subpath}" PATH)
|
||||
string(LENGTH "${subpath}" PATH_LENGTH)
|
||||
endwhile(PATH_LENGTH GREATER 0)
|
||||
endif(PATH_LENGTH GREATER 0)
|
||||
ENDMACRO(RELATIVE_PATH_TO_TOPLEVEL current_dir rel_path)
|
||||
if(NOT "${SC_BUILD_EXPRESS_ONLY}" AND NOT "${SC_BUILD_SCHEMAS}" STREQUAL "")
|
||||
include(${SC_CMAKE_DIR}/schema_scanner/schemaScanner.cmake)
|
||||
foreach(src ${SC_SDAI_ADDITIONAL_EXES_SRCS})
|
||||
get_filename_component(name ${src} NAME_WE)
|
||||
message(STATUS "Additional SDAI executable: ${name}")
|
||||
endforeach(src ${SC_SDAI_ADDITIONAL_EXES_SRCS})
|
||||
|
||||
# This function runs fedex on one express file. The generated source goes in a dir
|
||||
# in the build dir, and it is compiled into a library. A p21read executable is
|
||||
# compiled and linked to the lib. p21read is used to test the lib.
|
||||
FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
|
||||
if( EXISTS "${CMAKE_BINARY_DIR}/${SCHEMA_FILE}" ) #is it a path relative to build dir?
|
||||
set( SCHEMA_FILE "${CMAKE_BINARY_DIR}/${SCHEMA_FILE}" )
|
||||
elseif( EXISTS "${SC_SOURCE_DIR}/data/${SCHEMA_FILE}" ) # path relative to STEPcode/data?
|
||||
set( SCHEMA_FILE "${SC_SOURCE_DIR}/data/${SCHEMA_FILE}" )
|
||||
elseif( NOT EXISTS ${SCHEMA_FILE} ) # absolute path
|
||||
message( FATAL_ERROR "Cannot find ${CMAKE_BINARY_DIR}/${SCHEMA_FILE} or ${SC_SOURCE_DIR}/data/${SCHEMA_FILE} or ${SCHEMA_FILE}" )
|
||||
endif()
|
||||
|
||||
if( IS_DIRECTORY ${SCHEMA_FILE} ) #if it is a dir, look for one .exp file inside
|
||||
file(GLOB SCHEMA_FILE ${SCHEMA_FILE}/*.exp )
|
||||
endif()
|
||||
|
||||
if( NOT EXISTS ${SCHEMA_FILE} )
|
||||
message(FATAL_ERROR "Expected one express file. Found '${SCHEMA_FILE}' instead.")
|
||||
endif()
|
||||
|
||||
# read the schema name from a line like 'SCHEMA AUTOMOTIVE_DESIGN;'
|
||||
file(STRINGS ${SCHEMA_FILE} SCHEMA_STATEMENT LIMIT_COUNT 1 REGEX "^SCHEMA .*")
|
||||
string(REGEX REPLACE "^SCHEMA \(.*\)\;$" "\\1" SCHEMA_N ${SCHEMA_STATEMENT} )
|
||||
string(TOUPPER ${SCHEMA_N} SCHEMA_LONG_NAME) #exp2cxx always uses upper case for file names
|
||||
get_filename_component( SCHEMA_SN ${SCHEMA_FILE} NAME )
|
||||
string( REGEX REPLACE "\(.*\).[Ee][Xx][Pp]" "\\1" SCHEMA_SHORT_NAME ${SCHEMA_SN} )
|
||||
|
||||
project( sdai_${SCHEMA_SHORT_NAME} )
|
||||
message( STATUS "Generating code for ${SCHEMA_SHORT_NAME}.")
|
||||
set( SCHEMA_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${SCHEMA_SHORT_NAME} )
|
||||
|
||||
#the names of the files that will be generated
|
||||
set( FEDEX_HEADERS ${SCHEMA_OUTPUT_DIR}/Sdaiclasses.h ${SCHEMA_OUTPUT_DIR}/schema.h
|
||||
${SCHEMA_OUTPUT_DIR}/Sdai${SCHEMA_LONG_NAME}.h )
|
||||
set( FEDEX_OUT ${SCHEMA_OUTPUT_DIR}/compstructs.cc ${SCHEMA_OUTPUT_DIR}/schema.cc
|
||||
${SCHEMA_OUTPUT_DIR}/Sdai${SCHEMA_LONG_NAME}.cc ${SCHEMA_OUTPUT_DIR}/SdaiAll.cc
|
||||
${SCHEMA_OUTPUT_DIR}/Sdai${SCHEMA_LONG_NAME}.init.cc ${FEDEX_HEADERS} )
|
||||
|
||||
install( FILES ${FEDEX_HEADERS} DESTINATION include/${SCHEMA_SHORT_NAME} )
|
||||
|
||||
# *cannot* use include_directories() because the includes keep piling up - if building
|
||||
# multiple schemas, each one will use the include dirs from all previous schemas. Since
|
||||
# one header (schema.h) is always named the same, this will not work. only workaround
|
||||
# seems to be set_target_properties( <target> PROPERTIES COMPILE_FLAGS <flags> )
|
||||
set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SC_SOURCE_DIR}/src/cldai -I${SC_SOURCE_DIR}/src/cleditor -I${SC_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SC_SOURCE_DIR}/src/clstepcore -I${SC_SOURCE_DIR}/src/base" )
|
||||
|
||||
add_custom_command( OUTPUT ${SCHEMA_OUTPUT_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${SCHEMA_OUTPUT_DIR}
|
||||
COMMENT "Creating ${SCHEMA_OUTPUT_DIR} for schema ${SCHEMA_SHORT_NAME}")
|
||||
add_custom_command( OUTPUT ${FEDEX_OUT}
|
||||
COMMAND exp2cxx ARGS ${SCHEMA_FILE}
|
||||
DEPENDS ${SCHEMA_FILE} ${SCHEMA_OUTPUT_DIR}
|
||||
WORKING_DIRECTORY ${SCHEMA_OUTPUT_DIR}
|
||||
COMMENT "Running exp2cxx for ${SCHEMA_SHORT_NAME}..."
|
||||
VERBATIM )
|
||||
add_custom_target( generate_cpp_${SCHEMA_SHORT_NAME} DEPENDS ${FEDEX_OUT} SOURCES ${FEDEX_OUT} )
|
||||
|
||||
if( SC_ENABLE_COVERAGE AND NOT SC_COVER_SCHEMAS )
|
||||
# Coverage will always be sparse on schema libs. Compiling the libs with the -fprofile-arcs and
|
||||
# -ftest-coverage is extremely slow. We can avoid that by temporarily changing build type to release.
|
||||
set( PREV_BUILD_TYPE ${CMAKE_BUILD_TYPE} )
|
||||
set( CMAKE_BUILD_TYPE "Release" )
|
||||
endif( SC_ENABLE_COVERAGE AND NOT SC_COVER_SCHEMAS )
|
||||
|
||||
# if testing is enabled, "TESTABLE" sets property EXCLUDE_FROM_ALL and prevents installation
|
||||
SC_ADDLIB( ${PROJECT_NAME} "${FEDEX_OUT}" "stepdai;stepcore;stepeditor;steputils;base" "TESTABLE" )
|
||||
add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} )
|
||||
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
|
||||
${${PROJECT_NAME}_COMPILE_FLAGS} )
|
||||
if( TARGET ${PROJECT_NAME}-static )
|
||||
set_target_properties( ${PROJECT_NAME}-static PROPERTIES COMPILE_FLAGS
|
||||
${${PROJECT_NAME}_COMPILE_FLAGS} )
|
||||
endif( TARGET ${PROJECT_NAME}-static )
|
||||
|
||||
if( SC_ENABLE_COVERAGE AND NOT SC_COVER_SCHEMAS )
|
||||
set( CMAKE_BUILD_TYPE ${PREV_BUILD_TYPE} )
|
||||
endif( SC_ENABLE_COVERAGE AND NOT SC_COVER_SCHEMAS )
|
||||
|
||||
add_test( NAME generate_cpp_${SCHEMA_SHORT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--target generate_cpp_${SCHEMA_SHORT_NAME}
|
||||
--config $<CONFIGURATION> )
|
||||
add_test( NAME build_cpp_${PROJECT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--target p21read_${PROJECT_NAME}
|
||||
--config $<CONFIGURATION> )
|
||||
if(NOT WIN32)
|
||||
add_test( NAME build_lazy_cpp_${PROJECT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--target lazy_${PROJECT_NAME}
|
||||
--config $<CONFIGURATION> )
|
||||
endif(NOT WIN32)
|
||||
|
||||
# label the tests and set dependencies
|
||||
set_tests_properties( generate_cpp_${SCHEMA_SHORT_NAME} PROPERTIES LABELS cpp_schema_gen )
|
||||
if(NOT WIN32)
|
||||
set_tests_properties( build_lazy_cpp_${PROJECT_NAME} build_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${SCHEMA_SHORT_NAME} LABELS cpp_schema_build )
|
||||
endif(NOT WIN32)
|
||||
|
||||
RELATIVE_PATH_TO_TOPLEVEL(${CMAKE_CURRENT_SOURCE_DIR} RELATIVE_PATH_COMPONENT)
|
||||
SC_ADDEXEC( p21read_${PROJECT_NAME} "${RELATIVE_PATH_COMPONENT}/src/test/p21read/p21read.cc" "${PROJECT_NAME};base" "TESTABLE" )
|
||||
if(NOT WIN32)
|
||||
SC_ADDEXEC( lazy_${PROJECT_NAME} "${RELATIVE_PATH_COMPONENT}/src/cllazyfile/lazy_test.cc" "${PROJECT_NAME};steplazyfile;stepeditor" "TESTABLE" )
|
||||
endif(NOT WIN32)
|
||||
add_dependencies( p21read_${PROJECT_NAME} version_string )
|
||||
if(NOT WIN32)
|
||||
add_dependencies( lazy_${PROJECT_NAME} version_string )
|
||||
endif(NOT WIN32)
|
||||
set_target_properties( p21read_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
|
||||
${${PROJECT_NAME}_COMPILE_FLAGS} )
|
||||
if(NOT WIN32)
|
||||
set_target_properties( lazy_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${${PROJECT_NAME}_COMPILE_FLAGS} -I${SC_SOURCE_DIR}/src/base/judy/src" )
|
||||
endif(NOT WIN32)
|
||||
|
||||
|
||||
#add user-defined executables
|
||||
foreach( src ${SC_SDAI_ADDITIONAL_EXES_SRCS} )
|
||||
get_filename_component( name ${src} NAME_WE )
|
||||
get_filename_component( path ${src} ABSOLUTE )
|
||||
SC_ADDEXEC( ${name}_${PROJECT_NAME} "${src}" "${PROJECT_NAME};base" "TESTABLE" )
|
||||
add_dependencies( ${name}_${PROJECT_NAME} version_string )
|
||||
set_target_properties( ${name}_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
|
||||
"${${PROJECT_NAME}_COMPILE_FLAGS} -I${path}" )
|
||||
endforeach( src ${SC_SDAI_ADDITIONAL_EXES_SRCS} )
|
||||
|
||||
#find all part 21 files in schema dir, add a test for each one
|
||||
get_filename_component( SCHEMA_DIR ${SCHEMA_FILE} PATH )
|
||||
file( GLOB_RECURSE P21_FILES ${SCHEMA_DIR}/*.stp ${SCHEMA_DIR}/*.step ${SCHEMA_DIR}/*.p21 ${SCHEMA_DIR}/*.ifc )
|
||||
foreach( TEST_FILE ${P21_FILES} )
|
||||
get_filename_component( FNAME ${TEST_FILE} NAME_WE )
|
||||
add_test( NAME read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND p21read_${PROJECT_NAME} ${TEST_FILE} )
|
||||
set_tests_properties( read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME} PROPERTIES DEPENDS build_cpp_${PROJECT_NAME} LABELS cpp_schema_rw )
|
||||
if(NOT WIN32)
|
||||
add_test( NAME read_lazy_cpp_${SCHEMA_SHORT_NAME}_${FNAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND lazy_${PROJECT_NAME} ${TEST_FILE} )
|
||||
set_tests_properties( read_lazy_cpp_${SCHEMA_SHORT_NAME}_${FNAME} PROPERTIES DEPENDS build_lazy_cpp_${PROJECT_NAME} LABELS cpp_schema_rw )
|
||||
endif(NOT WIN32)
|
||||
endforeach()
|
||||
|
||||
ENDFUNCTION(BUILD_A_SCHEMA)
|
||||
|
||||
#----------------------------------------------------------------------------------------------------
|
||||
|
||||
if( DEFINED SC_BUILD_SCHEMAS )
|
||||
foreach( src ${SC_SDAI_ADDITIONAL_EXES_SRCS} )
|
||||
get_filename_component( name ${src} NAME_WE )
|
||||
message( STATUS "Additional SDAI executable: ${name}" )
|
||||
endforeach( src ${SC_SDAI_ADDITIONAL_EXES_SRCS} )
|
||||
|
||||
if( SC_BUILD_SCHEMAS STREQUAL "ALL" )
|
||||
file( GLOB_RECURSE SC_BUILD_SCHEMAS ${SC_SOURCE_DIR}/data/*.exp )
|
||||
endif()
|
||||
foreach( ap ${SC_BUILD_SCHEMAS} )
|
||||
BUILD_A_SCHEMA( ${ap} )
|
||||
endforeach()
|
||||
if(SC_BUILD_SCHEMAS STREQUAL "ALL")
|
||||
file(GLOB_RECURSE SC_BUILD_SCHEMAS ${SC_SOURCE_DIR}/data/*.exp)
|
||||
endif()
|
||||
foreach(FILE ${SC_BUILD_SCHEMAS})
|
||||
# figure out an absolute path to the file
|
||||
LOCATE_SCHEMA(${FILE} abspath)
|
||||
SCHEMA_CMLIST(${abspath})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(* This is a MODIFIED version of AP203 Amd. 1.
|
||||
The change was to remove a useless IF...ELSE...ENDIF statement that always evaluated
|
||||
the same way. Statements in the branch that was never executed caused problems with
|
||||
the same way. Statements in the branch that were never executed caused problems with
|
||||
libexpress, and it was easier to modify the schema than to come up with a generic
|
||||
fix for libexpress. This change does *not* affect the behavior of the schema.
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
SCHEMA config_control_design;
|
||||
|
||||
CONSTANT
|
||||
(* FIXME: gcc error on next statement with c99/POSIX:
|
||||
Syntax error: "(" unexpected
|
||||
*)
|
||||
dummy_gri : geometric_representation_item := representation_item('') ||
|
||||
geometric_representation_item();
|
||||
dummy_tri : topological_representation_item := representation_item('')
|
||||
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538433= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538435= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CROD',((
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CROD',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.TORSION.))));
|
||||
#637538443= CURVE_3D_ELEMENT_PROPERTY('PROD.1','',(#637538445),(
|
||||
@@ -784,7 +784,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539490= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539494= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539494= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539496= VOLUME_3D_ELEMENT_REPRESENTATION('367',(#637539489),
|
||||
#637539490,(#637539284,#637539280,#637539252,#637539424,#637539420,
|
||||
@@ -1074,7 +1074,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539781= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539489),
|
||||
#637539490,(#637538832,#637538864,#637539000,#637538976),#637538282,
|
||||
#637539784,#637539460);
|
||||
#637539784= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539784= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637539786= VOLUME_3D_ELEMENT_REPRESENTATION('271',(#637539489),
|
||||
@@ -1797,7 +1797,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637540503= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539489),
|
||||
#637539490,(#637538500,#637538504,#637538524,#637538520,#637538560,
|
||||
#637538564,#637538584,#637538580),#637538282,#637540506,#637539460);
|
||||
#637540506= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637540506= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637540508= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637539489),
|
||||
@@ -784,7 +784,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539488= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539492= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539492= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539494= VOLUME_3D_ELEMENT_REPRESENTATION('367',(#637539487),
|
||||
#637539488,(#637539282,#637539278,#637539250,#637539422,#637539418,
|
||||
@@ -1074,7 +1074,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539779= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539487),
|
||||
#637539488,(#637538830,#637538862,#637538998,#637538974),#637538280,
|
||||
#637539782,#637539458);
|
||||
#637539782= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539782= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637539784= VOLUME_3D_ELEMENT_REPRESENTATION('271',(#637539487),
|
||||
@@ -1797,7 +1797,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637540501= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539487),
|
||||
#637539488,(#637538498,#637538502,#637538522,#637538518,#637538558,
|
||||
#637538562,#637538582,#637538578),#637538280,#637540504,#637539458);
|
||||
#637540504= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637540504= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637540506= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637539487),
|
||||
@@ -784,7 +784,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539490= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539494= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539494= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539496= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539497,
|
||||
#637539487,.F.,(#637539499,#637539504,#637539509,#637539514,#637539519,
|
||||
@@ -5698,7 +5698,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((3.419102,7.558704,4.948215,-9.982081,
|
||||
#637542876= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539489),
|
||||
#637539490,(#637538832,#637538864,#637539000,#637538976),#637538282,
|
||||
#637542879,#637539460);
|
||||
#637542879= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637542879= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637542881= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539497,
|
||||
@@ -15071,7 +15071,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((167.411,-189.9718,-234.8069,113.0858,
|
||||
#637549373= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539489),
|
||||
#637539490,(#637538500,#637538504,#637538524,#637538520,#637538560,
|
||||
#637538564,#637538584,#637538580),#637538282,#637549376,#637539460);
|
||||
#637549376= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637549376= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637549378= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539497,
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538431= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538433= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538437= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CROD',((
|
||||
#637538437= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CROD',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.TORSION.))));
|
||||
#637538441= CURVE_3D_ELEMENT_PROPERTY('PROD.1','',(#637538443),(
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538433= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538435= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CROD',((
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CROD',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.TORSION.))));
|
||||
#637538443= CURVE_3D_ELEMENT_PROPERTY('PROD.1','',(#637538445),(
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538433= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538435= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CBAR*',((
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CBAR*',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Y_Y_BENDING.),
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Z_Z_BENDING.)),(
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538431= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538433= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538437= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CBAR*',((
|
||||
#637538437= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CBAR*',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Y_Y_BENDING.),
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Z_Z_BENDING.)),(
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538433= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538435= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CBAR*',((
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CBAR*',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Y_Y_BENDING.),
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Z_Z_BENDING.)),(
|
||||
@@ -346,7 +346,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538689= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538690= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538694= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538694= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TRIANGLE.CTRIA3',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -503,7 +503,7 @@ UNSPECIFIED_VALUE(.UNSPECIFIED.),UNSPECIFIED_VALUE(.UNSPECIFIED.));
|
||||
#637538690,(#637538456,#637538460,#637538504,#637538500),#637538282,
|
||||
#637538847,#637538699,#637538660);
|
||||
#637538845= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538847= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538847= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_QUADRILATERAL.CQUAD4',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -346,7 +346,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538687= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538688= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538692= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538692= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TRIANGLE.CTRIA3',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -503,7 +503,7 @@ UNSPECIFIED_VALUE(.UNSPECIFIED.),UNSPECIFIED_VALUE(.UNSPECIFIED.));
|
||||
#637538688,(#637538454,#637538458,#637538502,#637538498),#637538280,
|
||||
#637538845,#637538697,#637538658);
|
||||
#637538843= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538845= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538845= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_QUADRILATERAL.CQUAD4',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -346,7 +346,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538689= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538690= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538694= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538694= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TRIANGLE.CTRIA3',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -1375,7 +1375,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((-500.0138,-127.7892,0.,25.74217,0.,0.)
|
||||
#637538690,(#637538456,#637538460,#637538504,#637538500),#637538282,
|
||||
#637539434,#637538699,#637538660);
|
||||
#637539432= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539434= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539434= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_QUADRILATERAL.CQUAD4',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -719,7 +719,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539370= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539374= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539374= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539376= VOLUME_3D_ELEMENT_REPRESENTATION('367',(#637539369),
|
||||
#637539370,(#637538804,#637539184,#637539160,#637538924,#637539304,
|
||||
@@ -1009,7 +1009,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539661= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539369),
|
||||
#637539370,(#637538800,#637538548,#637538944,#637538572),#637538282,
|
||||
#637539664,#637539340);
|
||||
#637539664= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539664= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637539666= VOLUME_3D_ELEMENT_REPRESENTATION('271',(#637539369),
|
||||
@@ -1732,7 +1732,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637540383= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539369),
|
||||
#637539370,(#637538500,#637538504,#637538524,#637538520,#637538560,
|
||||
#637538564,#637538584,#637538580),#637538282,#637540386,#637539340);
|
||||
#637540386= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637540386= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637540388= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637539369),
|
||||
@@ -719,7 +719,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539368= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539372= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539372= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539374= VOLUME_3D_ELEMENT_REPRESENTATION('367',(#637539367),
|
||||
#637539368,(#637538802,#637539182,#637539158,#637538922,#637539302,
|
||||
@@ -1009,7 +1009,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539659= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539367),
|
||||
#637539368,(#637538798,#637538546,#637538942,#637538570),#637538280,
|
||||
#637539662,#637539338);
|
||||
#637539662= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539662= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637539664= VOLUME_3D_ELEMENT_REPRESENTATION('271',(#637539367),
|
||||
@@ -1732,7 +1732,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637540381= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539367),
|
||||
#637539368,(#637538498,#637538502,#637538522,#637538518,#637538558,
|
||||
#637538562,#637538582,#637538578),#637538280,#637540384,#637539338);
|
||||
#637540384= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637540384= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637540386= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637539367),
|
||||
@@ -719,7 +719,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539370= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539374= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539374= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539376= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539377,
|
||||
#637539367,.F.,(#637539379,#637539384,#637539389,#637539394,#637539399,
|
||||
@@ -5633,7 +5633,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((3.419102,7.558704,4.948215,-9.982081,
|
||||
#637542756= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539369),
|
||||
#637539370,(#637538800,#637538548,#637538944,#637538572),#637538282,
|
||||
#637542759,#637539340);
|
||||
#637542759= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637542759= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637542761= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539377,
|
||||
@@ -15006,7 +15006,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((167.411,-189.9718,-234.8069,113.0858,
|
||||
#637549253= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539369),
|
||||
#637539370,(#637538500,#637538504,#637538524,#637538520,#637538560,
|
||||
#637538564,#637538584,#637538580),#637538282,#637549256,#637539340);
|
||||
#637549256= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637549256= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637549258= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539377,
|
||||
@@ -687,7 +687,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
#637539350= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539351= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539355= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539355= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_QUADRILATERAL.CQUAD8',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -896,7 +896,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539351,(#637538532,#637538372,#637538328,#637539004,#637538744,
|
||||
#637539008),#637538282,#637539515,#637539360,#637539363);
|
||||
#637539513= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539515= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539515= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TRIANGLE.CTRIA6',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -687,7 +687,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
#637539348= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539349= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539353= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539353= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_QUADRILATERAL.CQUAD8',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -896,7 +896,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539349,(#637538530,#637538370,#637538326,#637539002,#637538742,
|
||||
#637539006),#637538280,#637539513,#637539358,#637539361);
|
||||
#637539511= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539513= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539513= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TRIANGLE.CTRIA6',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -687,7 +687,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
#637539350= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539351= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539355= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539355= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_QUADRILATERAL.CQUAD8',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -3640,7 +3640,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((-783.8278,3524.98,0.,-750.8163,0.,0.))
|
||||
#637539351,(#637538532,#637538372,#637538328,#637539004,#637538744,
|
||||
#637539008),#637538282,#637541306,#637539360,#637539363);
|
||||
#637541304= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637541306= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637541306= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TRIANGLE.CTRIA6',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -2587,7 +2587,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
);
|
||||
#637542839= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637542843= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637542843= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_WEDGE.CPENTA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637542845= ELEMENT_MATERIAL('MAT1.1','Fea Material',(#637542847,
|
||||
@@ -3104,7 +3104,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539964,#637539780,#637539832,#637539836,#637539820,#637539928,
|
||||
#637539980,#637539984,#637539968,#637542834,#637542834,#637542834,
|
||||
#637542834,#637542834,#637542834),#637538282,#637543160,#637542845);
|
||||
#637543160= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637543160= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637543162= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637542838),
|
||||
@@ -3301,7 +3301,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637542839,(#637538588,#637538612,#637538708,#637538592,#637540000,
|
||||
#637540004,#637540008,#637539988,#637539992,#637539996),#637538282,
|
||||
#637543262,#637542845);
|
||||
#637543262= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637543262= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637543264= VOLUME_3D_ELEMENT_REPRESENTATION('34',(#637542838),
|
||||
@@ -2587,7 +2587,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
);
|
||||
#637542837= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637542841= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637542841= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_WEDGE.CPENTA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637542843= ELEMENT_MATERIAL('MAT1.1','Fea Material',(#637542845,
|
||||
@@ -3104,7 +3104,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539962,#637539778,#637539830,#637539834,#637539818,#637539926,
|
||||
#637539978,#637539982,#637539966,#637542832,#637542832,#637542832,
|
||||
#637542832,#637542832,#637542832),#637538280,#637543158,#637542843);
|
||||
#637543158= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637543158= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637543160= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637542836),
|
||||
@@ -3301,7 +3301,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637542837,(#637538586,#637538610,#637538706,#637538590,#637539998,
|
||||
#637540002,#637540006,#637539986,#637539990,#637539994),#637538280,
|
||||
#637543260,#637542843);
|
||||
#637543260= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637543260= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637543262= VOLUME_3D_ELEMENT_REPRESENTATION('34',(#637542836),
|
||||
@@ -2587,7 +2587,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
);
|
||||
#637542839= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637542843= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637542843= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_WEDGE.CPENTA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637542845= ELEMENT_MATERIAL('MAT1.1','Fea Material',(#637542847,
|
||||
@@ -7728,7 +7728,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((-11.57079,-8.150762,34.35221,-7.068575
|
||||
#637539964,#637539780,#637539832,#637539836,#637539820,#637539928,
|
||||
#637539980,#637539984,#637539968,#637542834,#637542834,#637542834,
|
||||
#637542834,#637542834,#637542834),#637538282,#637546255,#637542845);
|
||||
#637546255= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637546255= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637546257= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637542873,
|
||||
@@ -9927,7 +9927,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((-2814.943,159.5768,445.0004,-196.6884,
|
||||
#637542839,(#637538588,#637538612,#637538708,#637538592,#637540000,
|
||||
#637540004,#637540008,#637539988,#637539992,#637539996),#637538282,
|
||||
#637547664,#637542845);
|
||||
#637547664= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637547664= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637547666= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637542873,
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3891,11 +3891,11 @@ ENTITY grooving_turning_operation
|
||||
WR3: (verify_optional_action_property (SELF, 'allowance')) AND
|
||||
(verify_length_measure_action_property (SELF, 'allowance'));
|
||||
|
||||
-- allowance propery required for roughing
|
||||
-- allowance property required for roughing
|
||||
WR4: NOT (SELF.description = 'roughing') OR
|
||||
(verify_required_action_property (SELF, 'allowance'));
|
||||
|
||||
-- allowance propery forbidden for cutting in
|
||||
-- allowance property forbidden for cutting in
|
||||
WR5: NOT (SELF.description = 'cutting in') OR
|
||||
(0 = SIZEOF (get_action_property (SELF, 'allowance')));
|
||||
END_ENTITY; -- 10303-238: integrated_cnc_schema
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+15
-7
@@ -1,12 +1,20 @@
|
||||
SET(sc_MANS
|
||||
man/man1/fedex.1
|
||||
man/man1/exp2cxx.1
|
||||
)
|
||||
set(sc_MANS
|
||||
man/man1/fedex.1
|
||||
man/man1/exp2cxx.1
|
||||
)
|
||||
|
||||
if(NOT DEFINED MAN_DIR)
|
||||
set(MAN_DIR share/man)
|
||||
endif(NOT DEFINED MAN_DIR)
|
||||
|
||||
IF(NOT WIN32)
|
||||
INSTALL(FILES ${sc_MANS} DESTINATION ${MAN_DIR}/man1)
|
||||
ENDIF(NOT WIN32)
|
||||
if(NOT WIN32)
|
||||
install(FILES ${sc_MANS} DESTINATION ${MAN_DIR}/man1)
|
||||
endif(NOT WIN32)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
+114
-48
@@ -1,4 +1,4 @@
|
||||
# Doxyfile 1.7.4
|
||||
# Doxyfile 1.7.6.1
|
||||
|
||||
# This file describes the settings to be used by the documentation system
|
||||
# doxygen (www.doxygen.org) for a project
|
||||
@@ -22,22 +22,23 @@
|
||||
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
|
||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||
# by quotes) that should identify the project.
|
||||
# The PROJECT_NAME tag is a single word (or sequence of words) that should
|
||||
# identify the project. Note that if you do not use Doxywizard you need
|
||||
# to put quotes around the project name if it contains spaces.
|
||||
|
||||
PROJECT_NAME = scl
|
||||
PROJECT_NAME = SC
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.2
|
||||
PROJECT_NUMBER = 0.8
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer
|
||||
# a quick idea about the purpose of the project. Keep the description short.
|
||||
|
||||
PROJECT_BRIEF = "STEPcode"
|
||||
PROJECT_BRIEF = STEPcode
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is
|
||||
# included in the documentation. The maximum height of the logo should not
|
||||
@@ -51,7 +52,7 @@ PROJECT_LOGO =
|
||||
# If a relative path is entered, it will be relative to the location
|
||||
# where doxygen was started. If left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = .
|
||||
OUTPUT_DIRECTORY = /mnt/raid/mark/sc-doxygen
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
|
||||
# 4096 sub-directories (in 2 levels) under the output directory of each output
|
||||
@@ -204,6 +205,13 @@ TAB_SIZE = 8
|
||||
|
||||
ALIASES =
|
||||
|
||||
# This tag can be used to specify a number of word-keyword mappings (TCL only).
|
||||
# A mapping has the form "name=value". For example adding
|
||||
# "class=itcl::class" will allow you to use the command class in the
|
||||
# itcl::class meaning.
|
||||
|
||||
TCL_SUBST =
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
|
||||
# sources only. Doxygen will then generate output that is more tailored for C.
|
||||
# For instance, some of the names that are used will be different. The list
|
||||
@@ -293,6 +301,15 @@ SUBGROUPING = YES
|
||||
|
||||
INLINE_GROUPED_CLASSES = NO
|
||||
|
||||
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
|
||||
# unions with only public data fields will be shown inline in the documentation
|
||||
# of the scope in which they are defined (i.e. file, namespace, or group
|
||||
# documentation), provided this scope is documented. If set to NO (the default),
|
||||
# structs, classes, and unions are shown on a separate page (for HTML and Man
|
||||
# pages) or section (for LaTeX and RTF).
|
||||
|
||||
INLINE_SIMPLE_STRUCTS = NO
|
||||
|
||||
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
|
||||
# is documented as struct, union, or enum with the name of the typedef. So
|
||||
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
|
||||
@@ -315,10 +332,21 @@ TYPEDEF_HIDES_STRUCT = NO
|
||||
# a logarithmic scale so increasing the size by one will roughly double the
|
||||
# memory usage. The cache size is given by this formula:
|
||||
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
|
||||
# corresponding to a cache size of 2^16 = 65536 symbols
|
||||
# corresponding to a cache size of 2^16 = 65536 symbols.
|
||||
|
||||
SYMBOL_CACHE_SIZE = 0
|
||||
|
||||
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
|
||||
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
|
||||
# their name and scope. Since this can be an expensive process and often the
|
||||
# same symbol appear multiple times in the code, doxygen keeps a cache of
|
||||
# pre-resolved symbols. If the cache is too small doxygen will become slower.
|
||||
# If the cache is too large, memory is wasted. The cache size is given by this
|
||||
# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
|
||||
# corresponding to a cache size of 2^16 = 65536 symbols.
|
||||
|
||||
LOOKUP_CACHE_SIZE = 0
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -338,7 +366,7 @@ EXTRACT_PRIVATE = NO
|
||||
# If the EXTRACT_STATIC tag is set to YES all static members of a file
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_STATIC = YES
|
||||
|
||||
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
|
||||
# defined locally in source files will be included in the documentation.
|
||||
@@ -559,6 +587,16 @@ FILE_VERSION_FILTER =
|
||||
|
||||
LAYOUT_FILE =
|
||||
|
||||
# The CITE_BIB_FILES tag can be used to specify one or more bib files
|
||||
# containing the references data. This must be a list of .bib files. The
|
||||
# .bib extension is automatically appended if omitted. Using this command
|
||||
# requires the bibtex tool to be installed. See also
|
||||
# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
|
||||
# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
|
||||
# feature you need bibtex and perl available in the search path.
|
||||
|
||||
CITE_BIB_FILES =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -621,7 +659,8 @@ WARN_LOGFILE =
|
||||
|
||||
INPUT = src \
|
||||
include \
|
||||
build/src/express
|
||||
build/src/express \
|
||||
build/include
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||
@@ -677,13 +716,16 @@ FILE_PATTERNS = *.c \
|
||||
|
||||
RECURSIVE = YES
|
||||
|
||||
# The EXCLUDE tag can be used to specify files and/or directories that should
|
||||
# The EXCLUDE tag can be used to specify files and/or directories that should be
|
||||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
# Note that relative paths are relative to the directory from which doxygen is
|
||||
# run.
|
||||
|
||||
EXCLUDE =
|
||||
EXCLUDE = .git \
|
||||
cmake/
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
# from the input.
|
||||
|
||||
@@ -773,7 +815,7 @@ FILTER_SOURCE_PATTERNS =
|
||||
# Note: To get rid of all source code in the generated output, make sure also
|
||||
# VERBATIM_HEADERS is set to NO.
|
||||
|
||||
SOURCE_BROWSER = NO
|
||||
SOURCE_BROWSER = YES
|
||||
|
||||
# Setting the INLINE_SOURCES tag to YES will include the body
|
||||
# of functions and classes directly in the documentation.
|
||||
@@ -865,13 +907,13 @@ HTML_FILE_EXTENSION = .html
|
||||
|
||||
# The HTML_HEADER tag can be used to specify a personal HTML header for
|
||||
# each generated HTML page. If it is left blank doxygen will generate a
|
||||
# standard header. Note that when using a custom header you are responsible
|
||||
# standard header. Note that when using a custom header you are responsible
|
||||
# for the proper inclusion of any scripts and style sheets that doxygen
|
||||
# needs, which is dependent on the configuration options used.
|
||||
# It is adviced to generate a default header using "doxygen -w html
|
||||
# It is advised to generate a default header using "doxygen -w html
|
||||
# header.html footer.html stylesheet.css YourConfigFile" and then modify
|
||||
# that header. Note that the header is subject to change so you typically
|
||||
# have to redo this when upgrading to a newer version of doxygen or when
|
||||
# have to redo this when upgrading to a newer version of doxygen or when
|
||||
# changing the value of configuration settings such as GENERATE_TREEVIEW!
|
||||
|
||||
HTML_HEADER =
|
||||
@@ -887,7 +929,7 @@ HTML_FOOTER =
|
||||
# fine-tune the look of the HTML output. If the tag is left blank doxygen
|
||||
# will generate a default style sheet. Note that doxygen will try to copy
|
||||
# the style sheet file to the HTML output directory, so don't put your own
|
||||
# stylesheet in the HTML output directory as well, or it will be erased!
|
||||
# style sheet in the HTML output directory as well, or it will be erased!
|
||||
|
||||
HTML_STYLESHEET =
|
||||
|
||||
@@ -901,7 +943,7 @@ HTML_STYLESHEET =
|
||||
HTML_EXTRA_FILES =
|
||||
|
||||
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
|
||||
# Doxygen will adjust the colors in the stylesheet and background images
|
||||
# Doxygen will adjust the colors in the style sheet and background images
|
||||
# according to this color. Hue is specified as an angle on a colorwheel,
|
||||
# see http://en.wikipedia.org/wiki/Hue for more information.
|
||||
# For instance the value 0 represents red, 60 is yellow, 120 is green,
|
||||
@@ -1096,29 +1138,33 @@ GENERATE_ECLIPSEHELP = NO
|
||||
|
||||
ECLIPSE_DOC_ID = org.doxygen.Project
|
||||
|
||||
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
|
||||
# top of each HTML page. The value NO (the default) enables the index and
|
||||
# the value YES disables it.
|
||||
# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
|
||||
# at top of each HTML page. The value NO (the default) enables the index and
|
||||
# the value YES disables it. Since the tabs have the same information as the
|
||||
# navigation tree you can set this option to NO if you already set
|
||||
# GENERATE_TREEVIEW to YES.
|
||||
|
||||
DISABLE_INDEX = NO
|
||||
|
||||
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
|
||||
# (range [0,1..20]) that doxygen will group on one line in the generated HTML
|
||||
# documentation. Note that a value of 0 will completely suppress the enum
|
||||
# values from appearing in the overview section.
|
||||
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
|
||||
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
|
||||
# structure should be generated to display hierarchical information.
|
||||
# If the tag value is set to YES, a side panel will be generated
|
||||
# containing a tree-like index structure (just like the one that
|
||||
# is generated for HTML Help). For this to work a browser that supports
|
||||
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
|
||||
# Windows users are probably better off using the HTML help feature.
|
||||
# Windows users are probably better off using the HTML help feature.
|
||||
# Since the tree basically has the same information as the tab index you
|
||||
# could consider to set DISABLE_INDEX to NO when enabling this option.
|
||||
|
||||
GENERATE_TREEVIEW = YES
|
||||
|
||||
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
|
||||
# (range [0,1..20]) that doxygen will group on one line in the generated HTML
|
||||
# documentation. Note that a value of 0 will completely suppress the enum
|
||||
# values from appearing in the overview section.
|
||||
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
|
||||
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
|
||||
# and Class Hierarchy pages using a tree view instead of an ordered list.
|
||||
|
||||
@@ -1171,6 +1217,11 @@ USE_MATHJAX = NO
|
||||
|
||||
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
|
||||
|
||||
# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
|
||||
# names that should be enabled during MathJax rendering.
|
||||
|
||||
MATHJAX_EXTENSIONS =
|
||||
|
||||
# When the SEARCHENGINE tag is enabled doxygen will generate a search box
|
||||
# for the HTML output. The underlying search engine uses javascript
|
||||
# and DHTML and should work on any modern browser. Note that when using
|
||||
@@ -1179,7 +1230,7 @@ MATHJAX_RELPATH = http://www.mathjax.org/mathjax
|
||||
# typically be disabled. For large projects the javascript based search engine
|
||||
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
|
||||
|
||||
SEARCHENGINE = NO
|
||||
SEARCHENGINE = YES
|
||||
|
||||
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
||||
# implemented using a PHP enabled web server instead of at the web client
|
||||
@@ -1284,6 +1335,12 @@ LATEX_HIDE_INDICES = NO
|
||||
|
||||
LATEX_SOURCE_CODE = NO
|
||||
|
||||
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
|
||||
# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
|
||||
# http://en.wikipedia.org/wiki/BibTeX for more info.
|
||||
|
||||
LATEX_BIB_STYLE = plain
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -1315,7 +1372,7 @@ COMPACT_RTF = NO
|
||||
|
||||
RTF_HYPERLINKS = NO
|
||||
|
||||
# Load stylesheet definitions from file. Syntax is similar to doxygen's
|
||||
# Load style sheet definitions from file. Syntax is similar to doxygen's
|
||||
# config file, i.e. a series of assignments. You only have to provide
|
||||
# replacements, missing definitions are set to their default value.
|
||||
|
||||
@@ -1585,32 +1642,30 @@ HAVE_DOT = YES
|
||||
|
||||
DOT_NUM_THREADS = 0
|
||||
|
||||
# By default doxygen will write a font called Helvetica to the output
|
||||
# directory and reference it in all dot files that doxygen generates.
|
||||
# When you want a differently looking font you can specify the font name
|
||||
# using DOT_FONTNAME. You need to make sure dot is able to find the font,
|
||||
# which can be done by putting it in a standard location or by setting the
|
||||
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
|
||||
# containing the font.
|
||||
# By default doxygen will use the Helvetica font for all dot files that
|
||||
# doxygen generates. When you want a differently looking font you can specify
|
||||
# the font name using DOT_FONTNAME. You need to make sure dot is able to find
|
||||
# the font, which can be done by putting it in a standard location or by setting
|
||||
# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
|
||||
# directory containing the font.
|
||||
|
||||
DOT_FONTNAME = FreeSans
|
||||
DOT_FONTNAME = Roboto
|
||||
|
||||
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
|
||||
# The default size is 10pt.
|
||||
|
||||
DOT_FONTSIZE = 10
|
||||
|
||||
# By default doxygen will tell dot to use the output directory to look for the
|
||||
# FreeSans.ttf font (which doxygen will put there itself). If you specify a
|
||||
# different font using DOT_FONTNAME you can set the path where dot
|
||||
# can find it using this tag.
|
||||
# By default doxygen will tell dot to use the Helvetica font.
|
||||
# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
|
||||
# set the path where dot can find it.
|
||||
|
||||
DOT_FONTPATH =
|
||||
|
||||
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||
# will generate a graph for each documented class showing the direct and
|
||||
# indirect inheritance relations. Setting this tag to YES will force the
|
||||
# the CLASS_DIAGRAMS tag to NO.
|
||||
# CLASS_DIAGRAMS tag to NO.
|
||||
|
||||
CLASS_GRAPH = YES
|
||||
|
||||
@@ -1681,10 +1736,21 @@ DIRECTORY_GRAPH = YES
|
||||
|
||||
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
|
||||
# generated by dot. Possible values are svg, png, jpg, or gif.
|
||||
# If left blank png will be used.
|
||||
# If left blank png will be used. If you choose svg you need to set
|
||||
# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
|
||||
# visible in IE 9+ (other browsers do not have this requirement).
|
||||
|
||||
DOT_IMAGE_FORMAT = png
|
||||
|
||||
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
|
||||
# enable generation of interactive SVG images that allow zooming and panning.
|
||||
# Note that this requires a modern browser other than Internet Explorer.
|
||||
# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
|
||||
# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
|
||||
# visible. Older versions of IE do not have SVG support.
|
||||
|
||||
INTERACTIVE_SVG = NO
|
||||
|
||||
# The tag DOT_PATH can be used to specify the path where the dot tool can be
|
||||
# found. If left blank, it is assumed the dot tool can be found in the path.
|
||||
|
||||
@@ -1735,7 +1801,7 @@ DOT_TRANSPARENT = NO
|
||||
# makes dot run faster, but since only newer versions of dot (>1.8.10)
|
||||
# support this, this feature is disabled by default.
|
||||
|
||||
DOT_MULTI_TARGETS = NO
|
||||
DOT_MULTI_TARGETS = YES
|
||||
|
||||
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
|
||||
# generate a legend page explaining the meaning of the various boxes and
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
<!-- This is a single string setting. When writing this out to the doxyfile,
|
||||
it will be quoted and treated as a whole. -->
|
||||
<string name="OUTPUT_LANGUAGE">English</string>
|
||||
<!-- A list setting contains multiple elements, seperated by whitespace. Each
|
||||
<!-- A list setting contains multiple elements, separated by whitespace. Each
|
||||
individual item will be quoted and treated as a whole for Doxygen. By
|
||||
default a list replaces the existing setting. If the append attribute is
|
||||
set to true, then the items will be added to the existing set. -->
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
.\" $Id: exp2cxx.1,v 2.1.0.2 1998/02/27 23:54:30 sauderd Exp $
|
||||
.TH FEDEX_PLUS 1 "19 November 1997"
|
||||
.SH NAME
|
||||
exp2cxx - EXPRESS compiler and translater
|
||||
exp2cxx - EXPRESS compiler and translator
|
||||
.SH SYNOPSIS
|
||||
exp2cxx [ options ] [ express-file ]
|
||||
.nf
|
||||
|
||||
@@ -5,87 +5,90 @@
|
||||
# freely copied in part or in full for any purpose. No acknowledgment is required
|
||||
# for the use of this file.
|
||||
#
|
||||
PROJECT( AP203Minimum )
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
project(AP203Minimum)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# Set STEPCODE_ROOT_DIR to point to the root of the STEPcode source tree.
|
||||
if( NOT DEFINED STEPCODE_ROOT_DIR )
|
||||
message( FATAL_ERROR "STEPCODE_ROOT_DIR is not defined! Set via cmake-gui or on command line:\n cmake .. -DSTEPCODE_ROOT_DIR=/path/to/sc" )
|
||||
endif( NOT DEFINED STEPCODE_ROOT_DIR )
|
||||
if(NOT DEFINED STEPCODE_ROOT_DIR)
|
||||
message(FATAL_ERROR "STEPCODE_ROOT_DIR is not defined! Set via cmake-gui or on command line:\n cmake .. -DSTEPCODE_ROOT_DIR=/path/to/sc")
|
||||
endif(NOT DEFINED STEPCODE_ROOT_DIR)
|
||||
|
||||
# STEPCODE_ROOT_DIR is relative or absolute path?
|
||||
if( EXISTS "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}/SC_VERSION.txt" )
|
||||
set( STEPCODE_ROOT_DIR "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}" )
|
||||
message( "** STEPCODE_ROOT_DIR is a relative path; converted to absolute path: ${STEPCODE_ROOT_DIR}." )
|
||||
if(EXISTS "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}/src/express/express.c")
|
||||
set(STEPCODE_ROOT_DIR "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}")
|
||||
message("** STEPCODE_ROOT_DIR is a relative path; converted to absolute path: ${STEPCODE_ROOT_DIR}.")
|
||||
else()
|
||||
if( NOT EXISTS "${STEPCODE_ROOT_DIR}/SC_VERSION.txt" )
|
||||
message( FATAL_ERROR "**** Cannot locate STEPCODE_ROOT_DIR - try an absolute path." )
|
||||
endif( NOT EXISTS "${STEPCODE_ROOT_DIR}/SC_VERSION.txt" )
|
||||
endif( EXISTS "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}/SC_VERSION.txt" )
|
||||
if(NOT EXISTS "${STEPCODE_ROOT_DIR}/src/express/express.c")
|
||||
message(FATAL_ERROR "**** Cannot locate STEPCODE_ROOT_DIR - try an absolute path.")
|
||||
endif(NOT EXISTS "${STEPCODE_ROOT_DIR}/src/express/express.c")
|
||||
endif(EXISTS "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}/src/express/express.c")
|
||||
|
||||
|
||||
# Use STEPcode as library, but build from this build process.
|
||||
set( SC_IS_SUBBUILD TRUE )
|
||||
set(SC_IS_SUBBUILD TRUE)
|
||||
|
||||
# Build type, DEBUG or RELEASE
|
||||
if( NOT DEFINED CMAKE_BUILD_TYPE )
|
||||
set( CMAKE_BUILD_TYPE Debug )
|
||||
endif( NOT DEFINED CMAKE_BUILD_TYPE )
|
||||
set( SC_BUILD_TYPE ${CMAKE_BUILD_TYPE} )
|
||||
if(NOT DEFINED CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
endif(NOT DEFINED CMAKE_BUILD_TYPE)
|
||||
set(SC_BUILD_TYPE ${CMAKE_BUILD_TYPE})
|
||||
|
||||
# Path to STEPcode
|
||||
set( STEPCODE_BUILD_DIR ${CMAKE_BINARY_DIR}/sc CACHE PATH "STEPcode build subdir" )
|
||||
set(STEPCODE_BUILD_DIR ${CMAKE_BINARY_DIR}/sc CACHE PATH "STEPcode build subdir")
|
||||
|
||||
# STEP schema to build and link against.
|
||||
set( SCHEMA ap203 )
|
||||
set( SC_BUILD_SCHEMAS ${SCHEMA} CACHE INTERNAL "Schema, internal, immutable" FORCE )
|
||||
set(SCHEMA ap203)
|
||||
set(SC_BUILD_SCHEMAS ${SCHEMA} CACHE INTERNAL "Schema, internal, immutable" FORCE)
|
||||
|
||||
# Parse out schema name and library.
|
||||
set( SCHEMA_PATH "${STEPCODE_ROOT_DIR}/data/${SCHEMA}/*.exp" )
|
||||
file( GLOB SCHEMA_FILE "${SCHEMA_PATH}" )
|
||||
set(SCHEMA_PATH "${STEPCODE_ROOT_DIR}/data/${SCHEMA}/*.exp")
|
||||
file(GLOB SCHEMA_FILE "${SCHEMA_PATH}")
|
||||
|
||||
if( NOT EXISTS ${SCHEMA_FILE} )
|
||||
message( FATAL_ERROR "Cannot find the schema; cannot continue. Looked for ${SCHEMA_PATH} from ${CMAKE_CURRENT_LIST_DIR}" )
|
||||
endif( NOT EXISTS ${SCHEMA_FILE} )
|
||||
if(NOT EXISTS ${SCHEMA_FILE})
|
||||
message(FATAL_ERROR "Cannot find the schema; cannot continue. Looked for ${SCHEMA_PATH} from ${CMAKE_CURRENT_LIST_DIR}")
|
||||
endif(NOT EXISTS ${SCHEMA_FILE})
|
||||
|
||||
|
||||
get_filename_component( SCHEMA_SN ${SCHEMA_FILE} NAME )
|
||||
string( REGEX REPLACE "\(.*\).[Ee][Xx][Pp]" "\\1" SCHEMA_LINK_NAME ${SCHEMA_SN} )
|
||||
set( STEPCODE_LIBRARIES base stepcore stepeditor stepdai steputils sdai_${SCHEMA_LINK_NAME} )
|
||||
get_filename_component(SCHEMA_SN ${SCHEMA_FILE} NAME)
|
||||
string(REGEX REPLACE "\(.*\).[Ee][Xx][Pp]" "sdai_\\1" SCHEMA_LINK_NAME ${SCHEMA_SN})
|
||||
set(STEPCODE_LIBRARIES stepcore stepeditor stepdai steputils ${SCHEMA_LINK_NAME})
|
||||
|
||||
# Add STEPCode project to CMake build.
|
||||
add_subdirectory( ${STEPCODE_ROOT_DIR} "${CMAKE_CURRENT_BINARY_DIR}/sc" EXCLUDE_FROM_ALL )
|
||||
add_subdirectory(${STEPCODE_ROOT_DIR} "${CMAKE_CURRENT_BINARY_DIR}/sc" EXCLUDE_FROM_ALL)
|
||||
|
||||
# Set up STEPcode include directories.
|
||||
set( STEPCODE_INCLUDE_DIR
|
||||
${STEPCODE_ROOT_DIR}/src/base
|
||||
${STEPCODE_ROOT_DIR}/src/clstepcore
|
||||
${STEPCODE_ROOT_DIR}/src/cldai
|
||||
${STEPCODE_ROOT_DIR}/src/clutils
|
||||
${STEPCODE_ROOT_DIR}/src/cleditor
|
||||
${STEPCODE_BUILD_DIR}/include
|
||||
${STEPCODE_ROOT_DIR}/include
|
||||
${CMAKE_BINARY_DIR}
|
||||
)
|
||||
set(STEPCODE_INCLUDE_DIR
|
||||
${STEPCODE_ROOT_DIR}/src/clstepcore
|
||||
${STEPCODE_ROOT_DIR}/src/cldai
|
||||
${STEPCODE_ROOT_DIR}/src/clutils
|
||||
${STEPCODE_ROOT_DIR}/src/cleditor
|
||||
${STEPCODE_BUILD_DIR}/include
|
||||
${STEPCODE_ROOT_DIR}/include
|
||||
${CMAKE_BINARY_DIR}
|
||||
${STEPCODE_BUILD_DIR}/schemas/${SCHEMA_LINK_NAME}
|
||||
)
|
||||
|
||||
# Reset sane values for build destination. Otherwise, everything ends up in ${CMAKE_BINARY_DIR}/sc
|
||||
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
|
||||
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
include_directories(
|
||||
${STEPCODE_INCLUDE_DIR}
|
||||
)
|
||||
${STEPCODE_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# Application sources and headers
|
||||
set( SRCS
|
||||
ap203min.cpp
|
||||
)
|
||||
set(SRCS ap203min.cpp)
|
||||
|
||||
set( HDRS
|
||||
)
|
||||
set(HDRS )
|
||||
|
||||
add_executable( ${PROJECT_NAME} ${SRCS} ${HDRS} )
|
||||
add_executable(${PROJECT_NAME} ${SRCS} ${HDRS})
|
||||
|
||||
target_link_libraries( ${PROJECT_NAME} ${STEPCODE_LIBRARIES} )
|
||||
target_link_libraries(${PROJECT_NAME} ${STEPCODE_LIBRARIES})
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-I${STEPCODE_BUILD_DIR}/data/${SCHEMA_LINK_NAME}" )
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
#
|
||||
# CMakeLists.txt for AP203 Minimum
|
||||
#
|
||||
# This file is released to the public domain. Any part of this file may be
|
||||
# freely copied in part or in full for any purpose. No acknowledgment is required
|
||||
# for the use of this file.
|
||||
#
|
||||
project(AP203Minimum)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
INCLUDE( ExternalProject )
|
||||
|
||||
set(CMAKE_MODULE_PATH ${AP203Minimum_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
|
||||
|
||||
INCLUDE( External_STEPCode )
|
||||
|
||||
#####
|
||||
# Variables ideally set by FindSTEPCode.cmake
|
||||
|
||||
IF(NOT WIN32)
|
||||
set( STEPCODE_LIBRARIES
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepcore.a
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepeditor.a
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepdai.a
|
||||
${STEPCODE_INSTALL_DIR}/lib/libsteputils.a
|
||||
${STEPCODE_INSTALL_DIR}/lib/libsdai_ap203.a
|
||||
)
|
||||
ELSE()
|
||||
set( STEPCODE_LIBRARIES
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepcore.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepeditor.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepdai.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libsteputils.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libsdai_ap203.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libexpress.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libexppp.lib
|
||||
shlwapi.lib
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
MESSAGE( STATUS "STEPCODE_INSTALL_DIR: " ${STEPCODE_INSTALL_DIR} )
|
||||
|
||||
set( STEPCODE_INCLUDE_DIR
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode/clstepcore
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode/cldai
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode/clutils
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode/cleditor
|
||||
${STEPCODE_INSTALL_DIR}/include/schemas/sdai_ap203
|
||||
)
|
||||
|
||||
# End of variables ideally set by FindSTEPCode.cmake
|
||||
######
|
||||
|
||||
|
||||
include_directories(
|
||||
${STEPCODE_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(SRCS ../ap203min.cpp)
|
||||
|
||||
set(HDRS )
|
||||
|
||||
add_executable( ${PROJECT_NAME} ${SRCS} ${HDRS})
|
||||
|
||||
add_dependencies( ${PROJECT_NAME} STEPCODE )
|
||||
|
||||
target_link_libraries( ${PROJECT_NAME}
|
||||
${STEPCODE_LIBRARIES}
|
||||
)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,24 @@
|
||||
ExternalProject_Add( STEPCODE
|
||||
URL ${CMAKE_CURRENT_SOURCE_DIR}/../../..
|
||||
CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
|
||||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DSC_BUILD_TYPE=Debug
|
||||
-DSC_BUILD_SCHEMAS=ap203/ap203.exp
|
||||
-DSC_BUILD_STATIC_LIBS=ON
|
||||
-DSC_PYTHON_GENERATOR=OFF
|
||||
-DSC_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||
)
|
||||
ExternalProject_Get_Property( STEPCODE SOURCE_DIR )
|
||||
ExternalProject_Get_Property( STEPCODE BINARY_DIR )
|
||||
ExternalProject_Get_Property( STEPCODE INSTALL_DIR )
|
||||
|
||||
IF( NOT WIN32 )
|
||||
SET( STEPCODE_INSTALL_DIR ${SOURCE_DIR}/../sc-install )
|
||||
ELSE()
|
||||
SET( STEPCODE_INSTALL_DIR ${INSTALL_DIR} )
|
||||
ENDIF()
|
||||
|
||||
SET( STEPCODE_BINARY_DIR ${BINARY_DIR} )
|
||||
|
||||
@@ -49,10 +49,6 @@
|
||||
// $./AP203Minimum
|
||||
// AP203Minimum outfile.stp
|
||||
|
||||
|
||||
extern void
|
||||
SchemaInit( class Registry & );
|
||||
|
||||
#include <STEPfile.h>
|
||||
#include <sdai.h>
|
||||
#include <STEPattribute.h>
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
#define SCL_CF_H
|
||||
|
||||
/**** Define statements for CMake ****/
|
||||
#cmakedefine SC_VERSION "@SC_VERSION@"
|
||||
#cmakedefine HAVE_NDIR_H 1
|
||||
#cmakedefine HAVE_STDARG_H 1
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
#cmakedefine HAVE_SYS_STAT_H 1
|
||||
#cmakedefine HAVE_SYS_PARAM_H 1
|
||||
#cmakedefine HAVE_SYSENT_H 1
|
||||
@@ -14,15 +15,17 @@
|
||||
#cmakedefine HAVE_IO_H 1
|
||||
|
||||
#cmakedefine SC_TRACE_FPRINTF 1
|
||||
#cmakedefine SC_MEMMGR_ENABLE_CHECKS 1
|
||||
|
||||
#cmakedefine HAVE_ABS 1
|
||||
#cmakedefine HAVE_MEMCPY 1
|
||||
#cmakedefine HAVE_MEMMOVE 1
|
||||
#cmakedefine HAVE_GETOPT 1
|
||||
#cmakedefine HAVE_VSNPRINTF 1
|
||||
|
||||
#cmakedefine HAVE_SSIZE_T 1
|
||||
|
||||
#cmakedefine HAVE_STD_THREAD 1
|
||||
#cmakedefine HAVE_STD_CHRONO 1
|
||||
#cmakedefine HAVE_NULLPTR 1
|
||||
|
||||
#endif /* SCL_CF_H */
|
||||
+18
-12
@@ -1,4 +1,4 @@
|
||||
SET(express_HDRS
|
||||
set(express_HDRS
|
||||
express/alg.h
|
||||
express/basic.h
|
||||
express/caseitem.h
|
||||
@@ -20,21 +20,27 @@ SET(express_HDRS
|
||||
express/symbol.h
|
||||
express/type.h
|
||||
express/variable.h
|
||||
)
|
||||
)
|
||||
install(FILES ${express_HDRS}
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode/express)
|
||||
DESTINATION ${INCLUDE_DIR}/stepcode/express)
|
||||
|
||||
SET(exppp_HDRS
|
||||
set(exppp_HDRS
|
||||
exppp/exppp.h
|
||||
)
|
||||
)
|
||||
install(FILES ${exppp_HDRS}
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode/exppp)
|
||||
DESTINATION ${INCLUDE_DIR}/stepcode/exppp)
|
||||
|
||||
install(FILES ordered_attrs.h
|
||||
sc_export.h
|
||||
sc_stdbool.h
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode)
|
||||
sc_export.h
|
||||
DESTINATION ${INCLUDE_DIR}/stepcode)
|
||||
|
||||
install(FILES ${SC_BINARY_DIR}/${INCLUDE_DIR}/config.h
|
||||
DESTINATION ${INCLUDE_DIR}/stepcode)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
install(FILES ${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_cf.h
|
||||
${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef SCL_CF_H
|
||||
#define SCL_CF_H
|
||||
|
||||
/**** Define statements for CMake ****/
|
||||
#cmakedefine SC_VERSION "@SC_VERSION@"
|
||||
#cmakedefine HAVE_NDIR_H 1
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
#cmakedefine HAVE_SYS_STAT_H 1
|
||||
#cmakedefine HAVE_SYS_PARAM_H 1
|
||||
#cmakedefine HAVE_SYSENT_H 1
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
#cmakedefine HAVE_DIRENT_H 1
|
||||
#cmakedefine HAVE_STDBOOL_H 1
|
||||
#cmakedefine HAVE_PROCESS_H 1
|
||||
#cmakedefine HAVE_IO_H 1
|
||||
|
||||
#cmakedefine SC_TRACE_FPRINTF 1
|
||||
|
||||
#cmakedefine HAVE_ABS 1
|
||||
#cmakedefine HAVE_MEMCPY 1
|
||||
#cmakedefine HAVE_MEMMOVE 1
|
||||
#cmakedefine HAVE_GETOPT 1
|
||||
#cmakedefine HAVE_VSNPRINTF 1
|
||||
|
||||
#cmakedefine HAVE_SSIZE_T 1
|
||||
|
||||
#cmakedefine HAVE_STD_THREAD 1
|
||||
#cmakedefine HAVE_STD_CHRONO 1
|
||||
#cmakedefine HAVE_NULLPTR 1
|
||||
|
||||
#endif /* SCL_CF_H */
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EXPPP_H
|
||||
#define EXPPP_H
|
||||
|
||||
#include <sc_stdbool.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <sc_export.h>
|
||||
|
||||
|
||||
+14
-14
@@ -69,7 +69,7 @@ struct tag {
|
||||
|
||||
/** location of fulltext of algorithm in source file */
|
||||
struct FullText {
|
||||
char * filename;
|
||||
const char * filename;
|
||||
unsigned int start, end;
|
||||
};
|
||||
|
||||
@@ -119,16 +119,16 @@ extern SC_EXPRESS_EXPORT struct freelist_head WHERE_fl;
|
||||
/* macro function definitions */
|
||||
/******************************/
|
||||
|
||||
#define ALG_new() (struct Algorithm *)MEM_new(&ALG_fl);
|
||||
#define ALG_destroy(x) MEM_destroy(&ALG_fl,(Freelist *)(Generic)x)
|
||||
#define FUNC_new() (struct Function_ *)MEM_new(&FUNC_fl)
|
||||
#define FUNC_destroy(x) MEM_destroy(&FUNC_fl,(Freelist *)(Generic)x)
|
||||
#define RULE_new() (struct Rule_ *)MEM_new(&RULE_fl)
|
||||
#define RULE_destroy(x) MEM_destroy(&RULE_fl,(Freelist *)(Generic)x)
|
||||
#define PROC_new() (struct Procedure_ *)MEM_new(&PROC_fl)
|
||||
#define PROC_destroy(x) MEM_destroy(&PROC_fl,(Freelist *)(Generic)x)
|
||||
#define WHERE_new() (struct Where_ *)MEM_new(&WHERE_fl)
|
||||
#define WHERE_destroy(x) MEM_destroy(&WHERE_fl,(Freelist *)(Generic)x)
|
||||
#define ALG_new() (struct Algorithm *)ALLOC_new(&ALG_fl);
|
||||
#define ALG_destroy(x) ALLOC_destroy(&ALG_fl,(Freelist *)x)
|
||||
#define FUNC_new() (struct Function_ *)ALLOC_new(&FUNC_fl)
|
||||
#define FUNC_destroy(x) ALLOC_destroy(&FUNC_fl,(Freelist *)x)
|
||||
#define RULE_new() (struct Rule_ *)ALLOC_new(&RULE_fl)
|
||||
#define RULE_destroy(x) ALLOC_destroy(&RULE_fl,(Freelist *)x)
|
||||
#define PROC_new() (struct Procedure_ *)ALLOC_new(&PROC_fl)
|
||||
#define PROC_destroy(x) ALLOC_destroy(&PROC_fl,(Freelist *)x)
|
||||
#define WHERE_new() (struct Where_ *)ALLOC_new(&WHERE_fl)
|
||||
#define WHERE_destroy(x) ALLOC_destroy(&WHERE_fl,(Freelist *)x)
|
||||
|
||||
#define ALGput_name(algorithm, name) SCOPEput_name(algorithm,name)
|
||||
#define ALGget_name(algorithm) SCOPEget_name(algorithm)
|
||||
@@ -161,8 +161,8 @@ extern SC_EXPRESS_EXPORT struct freelist_head WHERE_fl;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT Scope ALGcreate PROTO( ( char ) );
|
||||
extern SC_EXPRESS_EXPORT void ALGinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void ALGput_full_text PROTO( ( Scope, int, int ) );
|
||||
extern SC_EXPRESS_EXPORT Scope ALGcreate( char );
|
||||
extern SC_EXPRESS_EXPORT void ALGinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT void ALGput_full_text( Scope, int, int );
|
||||
|
||||
#endif /* ALGORITHM_H */
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
#ifndef ALLOC_H
|
||||
#define ALLOC_H
|
||||
|
||||
/*
|
||||
* This work was supported by the United States Government, and is
|
||||
* not subject to copyright.
|
||||
*
|
||||
* $Log: memory.h,v $
|
||||
* Revision 1.5 1997/01/21 19:17:11 dar
|
||||
* made C++ compatible
|
||||
*
|
||||
* Revision 1.4 1993/10/15 18:49:23 libes
|
||||
* CADDETC certified
|
||||
*
|
||||
* Revision 1.3 1993/02/22 21:41:13 libes
|
||||
* ANSI compat
|
||||
*
|
||||
* Revision 1.2 1992/08/18 17:15:40 libes
|
||||
* rm'd extraneous error messages
|
||||
*
|
||||
* Revision 1.1 1992/05/28 03:56:02 libes
|
||||
* Initial revision
|
||||
*/
|
||||
|
||||
#include "basic.h"
|
||||
|
||||
/*****************/
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <sc_export.h>
|
||||
|
||||
/** \file alloc.h - defs for fixed size block memory allocator */
|
||||
|
||||
typedef long Align;
|
||||
|
||||
union freelist {
|
||||
union freelist * next; /**< next block on freelist */
|
||||
char memory; /**< user data */
|
||||
Align aligner; /**< force alignment of blocks */
|
||||
};
|
||||
|
||||
typedef union freelist Freelist;
|
||||
|
||||
struct freelist_head {
|
||||
int size_elt; /**< size of a single elt */
|
||||
#ifndef NOSTAT
|
||||
int alloc; /**< # of allocations */
|
||||
int dealloc;
|
||||
int create; /**< number of calls to create a new freelist */
|
||||
void *max; /**< end of freelist */
|
||||
#endif
|
||||
int size; /**< size of a single elt incl. next ptr */
|
||||
int bytes; /**< if we run out, allocate memory by this many bytes */
|
||||
Freelist * freelist;
|
||||
#ifdef SPACE_PROFILE
|
||||
int count;
|
||||
#endif
|
||||
};
|
||||
|
||||
char * nnew();
|
||||
|
||||
#include "error.h"
|
||||
|
||||
/***********************************************/
|
||||
/* space allocation macros with error package: */
|
||||
/***********************************************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT int yylineno;
|
||||
|
||||
/** CALLOC grabs and initializes to all 0s space for the indicated
|
||||
* number of instances of the indicated type */
|
||||
#define CALLOC(ptr, num, type) \
|
||||
if (((ptr) = (type*)calloc((num), (unsigned)sizeof(type)))==NULL) { \
|
||||
fprintf(stderr,"fedex: out of space");\
|
||||
} else {}
|
||||
|
||||
SC_EXPRESS_EXPORT void _ALLOCinitialize( void );
|
||||
SC_EXPRESS_EXPORT void ALLOCinitialize( struct freelist_head * flh, unsigned int size, int alloc1, int alloc2 );
|
||||
SC_EXPRESS_EXPORT void ALLOC_destroy( struct freelist_head *, Freelist * );
|
||||
SC_EXPRESS_EXPORT void * ALLOC_new( struct freelist_head * );
|
||||
|
||||
#endif /* ALLOC_H */
|
||||
|
||||
|
||||
+8
-55
@@ -71,7 +71,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sc_cf.h>
|
||||
#include "config.h"
|
||||
#include <sc_export.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -82,22 +82,12 @@
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#else
|
||||
# include <sc_stdbool.h>
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
|
||||
/************************/
|
||||
/* Generic pointer type */
|
||||
/************************/
|
||||
|
||||
#ifdef __STDC__
|
||||
typedef void * Generic;
|
||||
#else
|
||||
typedef char * Generic;
|
||||
#endif /* */
|
||||
|
||||
/* other handy macros */
|
||||
#define streq(x,y) (!strcmp((x),(y)))
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(__cplusplus)
|
||||
#define inline __inline
|
||||
#endif
|
||||
|
||||
/**************************/
|
||||
/* function pointer types */
|
||||
@@ -106,45 +96,8 @@ typedef char * Generic;
|
||||
typedef void ( *voidFuncptr )();
|
||||
typedef int ( *intFuncptr )();
|
||||
|
||||
/******************************/
|
||||
/* deal with inline functions */
|
||||
/******************************/
|
||||
|
||||
#if !defined(static_inline)
|
||||
#if (!defined(__GNUC__) && !defined(__MSVC__)) || defined(__STRICT_ANSI)
|
||||
#define static_inline
|
||||
#undef supports_inline_functions
|
||||
#else
|
||||
#define static_inline static __inline
|
||||
#define supports_inline_functions 1L
|
||||
#endif /* */
|
||||
#endif /* !defined(static_inline) */
|
||||
|
||||
/* allow same declarations to suffice for both Standard and Classic C */
|
||||
/* ... at least in header files ... */
|
||||
|
||||
#ifndef CONST
|
||||
# ifdef __STDC__
|
||||
# define CONST const
|
||||
# else
|
||||
# define CONST
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef PROTO
|
||||
# ifdef __STDC__
|
||||
# define PROTO(x) x
|
||||
# else
|
||||
|
||||
# if defined(__CLCC__) || defined(__MSVC__) || defined(__BORLAND__)
|
||||
# define PROTO(x) x
|
||||
#else
|
||||
# define PROTO(x) ()
|
||||
# endif
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* */
|
||||
/* Option index - can we get rid of this? */
|
||||
extern SC_EXPRESS_EXPORT int sc_optind;
|
||||
|
||||
#endif /* BASIC_H */
|
||||
|
||||
|
||||
@@ -83,10 +83,10 @@ extern SC_EXPRESS_EXPORT struct freelist_head CASE_IT_fl;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
#define CASE_IT_new() (struct Case_Item_ *)MEM_new(&CASE_IT_fl)
|
||||
#define CASE_IT_destroy(x) MEM_destroy(&CASE_IT_fl,(Freelist *)(Generic)x)
|
||||
#define CASE_IT_new() (struct Case_Item_ *)ALLOC_new(&CASE_IT_fl)
|
||||
#define CASE_IT_destroy(x) ALLOC_destroy(&CASE_IT_fl,(Freelist *)x)
|
||||
|
||||
extern SC_EXPRESS_EXPORT Case_Item CASE_ITcreate PROTO( ( Linked_List, struct Statement_ * ) );
|
||||
extern SC_EXPRESS_EXPORT void CASE_ITinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT Case_Item CASE_ITcreate( Linked_List, struct Statement_ * );
|
||||
extern SC_EXPRESS_EXPORT void CASE_ITinitialize( void );
|
||||
|
||||
#endif /*CASE_ITEM_H*/
|
||||
|
||||
@@ -97,14 +97,14 @@ extern SC_EXPRESS_EXPORT char DICT_type; /**< set as a side-effect of DICT look
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT void DICTinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void DICTcleanup PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT int DICTdefine PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
|
||||
extern SC_EXPRESS_EXPORT int DICT_define PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
|
||||
extern SC_EXPRESS_EXPORT void DICTundefine PROTO( ( Dictionary, char * ) );
|
||||
extern SC_EXPRESS_EXPORT Generic DICTlookup PROTO( ( Dictionary, char * ) );
|
||||
extern SC_EXPRESS_EXPORT Generic DICTlookup_symbol PROTO( ( Dictionary, char *, Symbol ** ) );
|
||||
extern SC_EXPRESS_EXPORT Generic DICTdo PROTO( ( DictionaryEntry * ) );
|
||||
extern SC_EXPRESS_EXPORT void DICTprint PROTO( ( Dictionary ) );
|
||||
extern SC_EXPRESS_EXPORT void DICTinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT void DICTcleanup( void );
|
||||
extern SC_EXPRESS_EXPORT int DICTdefine( Dictionary, char *, void *, Symbol *, char );
|
||||
extern SC_EXPRESS_EXPORT int DICT_define( Dictionary, char *, void *, Symbol *, char );
|
||||
extern SC_EXPRESS_EXPORT void DICTundefine( Dictionary, char * );
|
||||
extern SC_EXPRESS_EXPORT void * DICTlookup( Dictionary, char * );
|
||||
extern SC_EXPRESS_EXPORT void * DICTlookup_symbol( Dictionary, char *, Symbol ** );
|
||||
extern SC_EXPRESS_EXPORT void * DICTdo( DictionaryEntry * );
|
||||
extern SC_EXPRESS_EXPORT void DICTprint( Dictionary );
|
||||
|
||||
#endif /*DICTIONARY_H*/
|
||||
|
||||
+16
-16
@@ -109,8 +109,8 @@ extern SC_EXPRESS_EXPORT int ENTITY_MARK;
|
||||
/* macro function definitions */
|
||||
/******************************/
|
||||
|
||||
#define ENTITY_new() (struct Entity_ *)MEM_new(&ENTITY_fl)
|
||||
#define ENTITY_destroy(x) MEM_destroy(&ENTITY_fl,(Freelist *)(char *)x)
|
||||
#define ENTITY_new() (struct Entity_ *)ALLOC_new(&ENTITY_fl)
|
||||
#define ENTITY_destroy(x) ALLOC_destroy(&ENTITY_fl,(Freelist *)(char *)x)
|
||||
|
||||
#define ENTITYget_symbol(e) SCOPEget_symbol(e)
|
||||
/* returns a function (i.e., which can be passed to other functions) */
|
||||
@@ -140,19 +140,19 @@ extern SC_EXPRESS_EXPORT int ENTITY_MARK;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT struct Scope_ * ENTITYcreate PROTO( ( struct Symbol_ * ) );
|
||||
extern SC_EXPRESS_EXPORT void ENTITYinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void ENTITYadd_attribute PROTO( ( struct Scope_ *, struct Variable_ * ) );
|
||||
extern SC_EXPRESS_EXPORT struct Scope_ * ENTITYcopy PROTO( ( struct Scope_ * ) );
|
||||
extern SC_EXPRESS_EXPORT Entity ENTITYfind_inherited_entity PROTO( ( struct Scope_ *, char *, int ) );
|
||||
extern SC_EXPRESS_EXPORT Variable ENTITYfind_inherited_attribute PROTO( ( struct Scope_ *, char *, struct Symbol_ ** ) );
|
||||
extern SC_EXPRESS_EXPORT Variable ENTITYresolve_attr_ref PROTO( ( Entity, Symbol *, Symbol * ) );
|
||||
extern SC_EXPRESS_EXPORT bool ENTITYhas_immediate_supertype PROTO( ( Entity, Entity ) );
|
||||
extern SC_EXPRESS_EXPORT Variable ENTITYget_named_attribute PROTO( ( Entity, char * ) );
|
||||
extern SC_EXPRESS_EXPORT Linked_List ENTITYget_all_attributes PROTO( ( Entity ) );
|
||||
extern SC_EXPRESS_EXPORT bool ENTITYhas_supertype PROTO( ( Entity, Entity ) );
|
||||
extern SC_EXPRESS_EXPORT void ENTITYadd_instance PROTO( ( Entity, Generic ) );
|
||||
extern SC_EXPRESS_EXPORT int ENTITYget_initial_offset PROTO( ( Entity ) );
|
||||
extern SC_EXPRESS_EXPORT int ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
|
||||
extern SC_EXPRESS_EXPORT struct Scope_ * ENTITYcreate( struct Symbol_ * );
|
||||
extern SC_EXPRESS_EXPORT void ENTITYinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT void ENTITYadd_attribute( struct Scope_ *, struct Variable_ * );
|
||||
extern SC_EXPRESS_EXPORT struct Scope_ * ENTITYcopy( struct Scope_ * );
|
||||
extern SC_EXPRESS_EXPORT Entity ENTITYfind_inherited_entity( struct Scope_ *, char *, int );
|
||||
extern SC_EXPRESS_EXPORT Variable ENTITYfind_inherited_attribute( struct Scope_ *, char *, struct Symbol_ ** );
|
||||
extern SC_EXPRESS_EXPORT Variable ENTITYresolve_attr_ref( Entity, Symbol *, Symbol * );
|
||||
extern SC_EXPRESS_EXPORT bool ENTITYhas_immediate_supertype( Entity, Entity );
|
||||
extern SC_EXPRESS_EXPORT Variable ENTITYget_named_attribute( Entity, char * );
|
||||
extern SC_EXPRESS_EXPORT Linked_List ENTITYget_all_attributes( Entity );
|
||||
extern SC_EXPRESS_EXPORT bool ENTITYhas_supertype( Entity, Entity );
|
||||
extern SC_EXPRESS_EXPORT void ENTITYadd_instance( Entity, void *);
|
||||
extern SC_EXPRESS_EXPORT int ENTITYget_initial_offset( Entity );
|
||||
extern SC_EXPRESS_EXPORT int ENTITYdeclares_variable( Entity, struct Variable_ * );
|
||||
|
||||
#endif /* ENTITY_H */
|
||||
|
||||
+128
-95
@@ -28,10 +28,103 @@
|
||||
* prettied up interface to print_objects_when_running
|
||||
*/
|
||||
|
||||
#include <sc_export.h>
|
||||
#include "basic.h" /* get basic definitions */
|
||||
#include <setjmp.h>
|
||||
|
||||
#include "sc_export.h"
|
||||
#include "basic.h" /* get basic definitions */
|
||||
|
||||
/*****************/
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include "alloc.h"
|
||||
#include "symbol.h"
|
||||
|
||||
enum ErrorCode {
|
||||
/* dict.c */
|
||||
DUPLICATE_DECL = 1,
|
||||
DUPLICATE_DECL_DIFF_FILE,
|
||||
/* error.c */
|
||||
SUBORDINATE_FAILED,
|
||||
SYNTAX_EXPECTING,
|
||||
/* expr.c */
|
||||
INTEGER_EXPRESSION_EXPECTED,
|
||||
INTERNAL_UNRECOGNISED_OP_IN_EXPRESOLVE,
|
||||
ATTRIBUTE_REF_ON_AGGREGATE,
|
||||
ATTRIBUTE_REF_FROM_NON_ENTITY,
|
||||
INDEXING_ILLEGAL,
|
||||
WARN_INDEXING_MIXED,
|
||||
ENUM_NO_SUCH_ITEM,
|
||||
GROUP_REF_NO_SUCH_ENTITY,
|
||||
GROUP_REF_UNEXPECTED_TYPE,
|
||||
IMPLICIT_DOWNCAST,
|
||||
AMBIG_IMPLICIT_DOWNCAST,
|
||||
/* express.c */
|
||||
BAIL_OUT,
|
||||
SYNTAX,
|
||||
REF_NONEXISTENT,
|
||||
TILDE_EXPANSION_FAILED,
|
||||
SCHEMA_NOT_IN_OWN_SCHEMA_FILE,
|
||||
UNLABELLED_PARAM_TYPE,
|
||||
FILE_UNREADABLE,
|
||||
FILE_UNWRITABLE,
|
||||
WARN_UNSUPPORTED_LANG_FEAT,
|
||||
WARN_SMALL_REAL,
|
||||
/* lexact.c */
|
||||
INCLUDE_FILE,
|
||||
UNMATCHED_CLOSE_COMMENT,
|
||||
UNMATCHED_OPEN_COMMENT,
|
||||
UNTERMINATED_STRING,
|
||||
ENCODED_STRING_BAD_DIGIT,
|
||||
ENCODED_STRING_BAD_COUNT,
|
||||
BAD_IDENTIFIER,
|
||||
UNEXPECTED_CHARACTER,
|
||||
NONASCII_CHAR,
|
||||
/* linklist.c */
|
||||
EMPTY_LIST,
|
||||
/* resolve.c */
|
||||
UNDEFINED,
|
||||
UNDEFINED_ATTR,
|
||||
UNDEFINED_TYPE,
|
||||
UNDEFINED_SCHEMA,
|
||||
UNKNOWN_ATTR_IN_ENTITY,
|
||||
UNKNOWN_SUBTYPE,
|
||||
UNKNOWN_SUPERTYPE,
|
||||
CIRCULAR_REFERENCE,
|
||||
SUBSUPER_LOOP,
|
||||
SUBSUPER_CONTINUATION,
|
||||
SELECT_LOOP,
|
||||
SELECT_CONTINUATION,
|
||||
SUPERTYPE_RESOLVE,
|
||||
SUBTYPE_RESOLVE,
|
||||
NOT_A_TYPE,
|
||||
FUNCALL_NOT_A_FUNCTION,
|
||||
UNDEFINED_FUNC,
|
||||
EXPECTED_PROC,
|
||||
NO_SUCH_PROCEDURE,
|
||||
WRONG_ARG_COUNT,
|
||||
QUERY_REQUIRES_AGGREGATE,
|
||||
SELF_IS_UNKNOWN,
|
||||
INVERSE_BAD_ENTITY,
|
||||
INVERSE_BAD_ATTR,
|
||||
MISSING_SUPERTYPE,
|
||||
TYPE_IS_ENTITY,
|
||||
AMBIGUOUS_ATTR,
|
||||
AMBIGUOUS_GROUP,
|
||||
OVERLOADED_ATTR,
|
||||
REDECL_NO_SUCH_ATTR,
|
||||
REDECL_NO_SUCH_SUPERTYPE,
|
||||
MISSING_SELF,
|
||||
FN_SKIP_BRANCH,
|
||||
CASE_SKIP_LABEL,
|
||||
UNIQUE_QUAL_REDECL,
|
||||
/* type.c */
|
||||
CORRUPTED_TYPE,
|
||||
UNDEFINED_TAG,
|
||||
/* exppp.c */
|
||||
SELECT_EMPTY,
|
||||
};
|
||||
|
||||
/*************/
|
||||
/* constants */
|
||||
/*************/
|
||||
@@ -39,40 +132,30 @@
|
||||
#define ERROR_none (Error)NULL
|
||||
#define ERROR_MAX 100
|
||||
|
||||
/*****************/
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include "memory.h"
|
||||
#include "symbol.h"
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
/************/
|
||||
|
||||
typedef enum {
|
||||
SEVERITY_WARNING = 0,
|
||||
SEVERITY_ERROR = 1,
|
||||
SEVERITY_EXIT = 2,
|
||||
SEVERITY_DUMP = 3,
|
||||
SEVERITY_MAX = 4
|
||||
} Severity;
|
||||
enum Severity {
|
||||
SEVERITY_WARNING = 0,
|
||||
SEVERITY_ERROR,
|
||||
SEVERITY_EXIT,
|
||||
SEVERITY_DUMP,
|
||||
SEVERITY_MAX
|
||||
};
|
||||
|
||||
/***************************/
|
||||
/* hidden type definitions */
|
||||
/***************************/
|
||||
|
||||
typedef struct Error_ {
|
||||
bool enabled;
|
||||
Severity severity;
|
||||
char * message;
|
||||
int serial; /* used to give each type of error a unique identifier */
|
||||
} * Error;
|
||||
struct Error_ {
|
||||
enum Severity severity;
|
||||
const char *message;
|
||||
const char *name;
|
||||
bool override;
|
||||
};
|
||||
|
||||
typedef struct Error_Warning_ {
|
||||
char * name;
|
||||
struct Linked_List_ * errors;
|
||||
} * Error_Warning;
|
||||
typedef struct Error_ *Error;
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
@@ -83,16 +166,12 @@ typedef struct Error_Warning_ {
|
||||
/********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT bool __ERROR_buffer_errors;
|
||||
extern SC_EXPRESS_EXPORT char * current_filename;
|
||||
extern SC_EXPRESS_EXPORT const char * current_filename;
|
||||
|
||||
/* flag to remember whether non-warning errors have occurred */
|
||||
extern SC_EXPRESS_EXPORT bool ERRORoccurred;
|
||||
|
||||
|
||||
extern SC_EXPRESS_EXPORT Error experrc;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_subordinate_failed;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_syntax_expecting;
|
||||
|
||||
/* all of these are 1 if true, 0 if false switches */
|
||||
/* for debugging fedex */
|
||||
extern SC_EXPRESS_EXPORT int ERRORdebugging;
|
||||
@@ -101,52 +180,16 @@ extern SC_EXPRESS_EXPORT int malloc_debug_resolve;
|
||||
/* for debugging yacc/lex */
|
||||
extern SC_EXPRESS_EXPORT int debug;
|
||||
|
||||
extern SC_EXPRESS_EXPORT struct Linked_List_ * ERRORwarnings;
|
||||
extern SC_EXPRESS_EXPORT struct freelist_head ERROR_OPT_fl;
|
||||
|
||||
extern SC_EXPRESS_EXPORT void ( *ERRORusage_function )( void );
|
||||
|
||||
/******************************/
|
||||
/* macro function definitions */
|
||||
/******************************/
|
||||
|
||||
#define ERROR_OPT_new() (struct Error_Warning_ *)MEM_new(&ERROR_OPT_fl)
|
||||
#define ERROR_OPT_destroy(x) MEM_destroy(&ERROR_OPT_fl,(Freelist *)(Generic)x)
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
#if defined(__MSVC__) || defined(__BORLAND__)
|
||||
extern SC_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
|
||||
#endif
|
||||
extern SC_EXPRESS_EXPORT void ERROR_start_message_buffer( void );
|
||||
extern SC_EXPRESS_EXPORT void ERROR_flush_message_buffer( void );
|
||||
|
||||
/********************/
|
||||
/* Inline functions */
|
||||
/********************/
|
||||
|
||||
static_inline void ERRORdisable( Error error ) {
|
||||
if( error != ERROR_none ) {
|
||||
error->enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
static_inline void ERRORenable( Error error ) {
|
||||
if( error != ERROR_none ) {
|
||||
error->enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
static_inline bool ERRORis_enabled( Error error ) {
|
||||
return error->enabled;
|
||||
}
|
||||
|
||||
static_inline void ERRORbuffer_messages( bool flag ) {
|
||||
#if !defined(__MSVC__) && !defined(__BORLAND__)
|
||||
extern void ERROR_start_message_buffer( void ),
|
||||
ERROR_flush_message_buffer( void );
|
||||
#endif
|
||||
static inline void ERRORbuffer_messages( bool flag ) {
|
||||
__ERROR_buffer_errors = flag;
|
||||
if( __ERROR_buffer_errors ) {
|
||||
ERROR_start_message_buffer();
|
||||
@@ -155,44 +198,34 @@ static_inline void ERRORbuffer_messages( bool flag ) {
|
||||
}
|
||||
}
|
||||
|
||||
static_inline void ERRORflush_messages( void ) {
|
||||
#if !defined(__MSVC__) && !defined(__BORLAND__)
|
||||
extern void ERROR_start_message_buffer( void ),
|
||||
ERROR_flush_message_buffer( void );
|
||||
#endif
|
||||
|
||||
static inline void ERRORflush_messages( void ) {
|
||||
if( __ERROR_buffer_errors ) {
|
||||
ERROR_flush_message_buffer();
|
||||
ERROR_start_message_buffer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT void ERRORinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORinitialize_after_LIST PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORcleanup PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORnospace PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORabort PROTO( ( int ) );
|
||||
extern SC_EXPRESS_EXPORT Error ERRORcreate PROTO( ( char *, Severity ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORreport PROTO( ( Error, ... ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORdestroy PROTO( ( Error ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT void ERRORcleanup( void );
|
||||
extern SC_EXPRESS_EXPORT void ERRORnospace( void );
|
||||
extern SC_EXPRESS_EXPORT void ERRORabort( int );
|
||||
extern SC_EXPRESS_EXPORT void ERRORreport( enum ErrorCode, ... );
|
||||
|
||||
struct Symbol_; /* mention Symbol to avoid warning on following line */
|
||||
extern SC_EXPRESS_EXPORT void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORreport_with_line PROTO( ( Error, int, ... ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORreport_with_symbol( enum ErrorCode, struct Symbol_ *, ... );
|
||||
extern SC_EXPRESS_EXPORT void ERRORreport_with_line( enum ErrorCode, int, ... );
|
||||
|
||||
#if !defined(__MSVC__) && !defined(__BORLAND__)
|
||||
extern SC_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
|
||||
#endif
|
||||
extern SC_EXPRESS_EXPORT void ERRORset_warning( char *, bool );
|
||||
extern SC_EXPRESS_EXPORT void ERRORset_all_warnings( bool );
|
||||
extern SC_EXPRESS_EXPORT void ERRORsafe( jmp_buf env );
|
||||
extern SC_EXPRESS_EXPORT void ERRORunsafe( void );
|
||||
|
||||
extern SC_EXPRESS_EXPORT void ERRORcreate_warning PROTO( ( char *, Error ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORset_warning PROTO( ( char *, int ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORset_all_warnings PROTO( ( int ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORsafe PROTO( ( jmp_buf env ) );
|
||||
extern SC_EXPRESS_EXPORT void ERRORunsafe PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT char * ERRORget_warnings_help(const char* prefix, const char *eol);
|
||||
extern SC_EXPRESS_EXPORT bool ERRORis_enabled(enum ErrorCode errnum);
|
||||
|
||||
#endif /* ERROR_H */
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
#ifndef EXP_KW_H
|
||||
#define EXP_KW_H
|
||||
|
||||
#include "sc_export.h"
|
||||
|
||||
extern SC_EXPRESS_EXPORT char * KW_ABS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ABSTRACT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ACOS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_AGGREGATE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ALIAS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_AND;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ANDOR;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ARRAY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_AS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ASIN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ATAN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BAG;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BEGIN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BINARY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BLENGTH;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BOOLEAN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_CASE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_CONST_E;
|
||||
extern SC_EXPRESS_EXPORT char * KW_CONSTANT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_CONTEXT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_COS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_DERIVE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_DIV;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ELSE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_ALIAS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_CASE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_CONSTANT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_CONTEXT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_ENTITY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_FUNCTION;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_IF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_LOCAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_MODEL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_PROCEDURE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_REPEAT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_RULE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_SCHEMA;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_TYPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ENTITY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ENUMERATION;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ESCAPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_EXISTS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_EXP;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FALSE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FIXED;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FOR;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FORMAT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FROM;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FUNCTION;
|
||||
extern SC_EXPRESS_EXPORT char * KW_GENERIC;
|
||||
extern SC_EXPRESS_EXPORT char * KW_HIBOUND;
|
||||
extern SC_EXPRESS_EXPORT char * KW_HIINDEX;
|
||||
extern SC_EXPRESS_EXPORT char * KW_IF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_IN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_INCLUDE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_INSERT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_INTEGER;
|
||||
extern SC_EXPRESS_EXPORT char * KW_INVERSE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LENGTH;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LIKE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LIST;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOBOUND;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOCAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOG;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOG10;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOG2;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOGICAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOINDEX;
|
||||
extern SC_EXPRESS_EXPORT char * KW_MOD;
|
||||
extern SC_EXPRESS_EXPORT char * KW_MODEL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_NOT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_NUMBER;
|
||||
extern SC_EXPRESS_EXPORT char * KW_NVL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ODD;
|
||||
extern SC_EXPRESS_EXPORT char * KW_OF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ONEOF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_OPTIONAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_OR;
|
||||
extern SC_EXPRESS_EXPORT char * KW_OTHERWISE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_PI;
|
||||
extern SC_EXPRESS_EXPORT char * KW_PROCEDURE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_QUERY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_REAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_REFERENCE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_REMOVE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_REPEAT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_RETURN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ROLESOF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_RULE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SCHEMA;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SELECT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SELF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SET;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SIN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SIZEOF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SKIP;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SQRT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_STRING;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SUBTYPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SUPERTYPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TAN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_THEN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TO;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TRUE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TYPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TYPEOF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_UNIQUE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_UNKNOWN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_UNTIL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_USE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_USEDIN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_VALUE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_VALUE_IN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_VALUE_UNIQUE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_VAR;
|
||||
extern SC_EXPRESS_EXPORT char * KW_WHERE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_WHILE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_XOR;
|
||||
|
||||
#endif /* EXP_KW_H */
|
||||
@@ -46,11 +46,7 @@ typedef enum { Lfalse, Lunknown, Ltrue } Logical;
|
||||
/* typedef ... Binary; done below because String not defined yet */
|
||||
|
||||
#ifndef _CLIENTDATA
|
||||
# ifdef __STDC__
|
||||
typedef void * ClientData;
|
||||
# else
|
||||
typedef int * ClientData;
|
||||
# endif /* __STDC__ */
|
||||
#define _CLIENTDATA
|
||||
#endif
|
||||
|
||||
@@ -58,7 +54,7 @@ typedef int * ClientData;
|
||||
/* packages used throughout */
|
||||
/****************************/
|
||||
|
||||
#include "memory.h"
|
||||
#include "alloc.h"
|
||||
|
||||
typedef struct Scope_ * Type;
|
||||
typedef struct Scope_ * Scope;
|
||||
|
||||
+22
-25
@@ -178,7 +178,7 @@ struct Expression_ {
|
||||
/** indexed by the op enumeration values */
|
||||
struct EXPop_entry {
|
||||
char * token; /**< literal token, e.g., "<>" */
|
||||
Type( *resolve ) PROTO( ( Expression, struct Scope_ * ) );
|
||||
Type( *resolve )( Expression, struct Scope_ * );
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -193,11 +193,6 @@ extern SC_EXPRESS_EXPORT Expression LITERAL_PI;
|
||||
extern SC_EXPRESS_EXPORT Expression LITERAL_ZERO;
|
||||
extern SC_EXPRESS_EXPORT Expression LITERAL_ONE;
|
||||
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_bad_qualification;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_integer_expression_expected;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_implicit_downcast;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_ambig_implicit_downcast;
|
||||
|
||||
extern SC_EXPRESS_EXPORT struct freelist_head EXP_fl;
|
||||
extern SC_EXPRESS_EXPORT struct freelist_head OP_fl;
|
||||
extern SC_EXPRESS_EXPORT struct freelist_head QUERY_fl;
|
||||
@@ -207,14 +202,14 @@ extern SC_EXPRESS_EXPORT struct freelist_head QUAL_ATTR_fl;
|
||||
/* macro function definitions */
|
||||
/******************************/
|
||||
|
||||
#define EXP_new() (struct Expression_ *)MEM_new(&EXP_fl)
|
||||
#define EXP_destroy(x) MEM_destroy(&EXP_fl,(Freelist *)(Generic)x)
|
||||
#define OP_new() (struct Op_Subexpression *)MEM_new(&OP_fl)
|
||||
#define OP_destroy(x) MEM_destroy(&OP_fl,(Freelist *)(Generic)x)
|
||||
#define QUERY_new() (struct Query_ *)MEM_new(&QUERY_fl)
|
||||
#define QUERY_destroy(x) MEM_destroy(&QUERY_fl,(Freelist *)(Generic)x)
|
||||
#define QUAL_ATTR_new() (struct Qualified_Attr *)MEM_new(&QUAL_ATTR_fl)
|
||||
#define QUAL_ATTR_destroy(x) MEM_destroy(&QUAL_ATTR_fl,(Freelist *)(Generic)x)
|
||||
#define EXP_new() (struct Expression_ *)ALLOC_new(&EXP_fl)
|
||||
#define EXP_destroy(x) ALLOC_destroy(&EXP_fl,(Freelist *)x)
|
||||
#define OP_new() (struct Op_Subexpression *)ALLOC_new(&OP_fl)
|
||||
#define OP_destroy(x) ALLOC_destroy(&OP_fl,(Freelist *)x)
|
||||
#define QUERY_new() (struct Query_ *)ALLOC_new(&QUERY_fl)
|
||||
#define QUERY_destroy(x) ALLOC_destroy(&QUERY_fl,(Freelist *)x)
|
||||
#define QUAL_ATTR_new() (struct Qualified_Attr *)ALLOC_new(&QUAL_ATTR_fl)
|
||||
#define QUAL_ATTR_destroy(x) ALLOC_destroy(&QUAL_ATTR_fl,(Freelist *)x)
|
||||
|
||||
#define EXPget_name(e) ((e)->symbol.name)
|
||||
#define ENUMget_name(e) ((e)->symbol.name)
|
||||
@@ -254,16 +249,18 @@ extern SC_EXPRESS_EXPORT struct freelist_head QUAL_ATTR_fl;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT Expression EXPcreate PROTO( ( Type ) );
|
||||
extern SC_EXPRESS_EXPORT Expression EXPcreate_simple PROTO( ( Type ) );
|
||||
extern SC_EXPRESS_EXPORT Expression EXPcreate_from_symbol PROTO( ( Type, Symbol * ) );
|
||||
extern SC_EXPRESS_EXPORT Expression UN_EXPcreate PROTO( ( Op_Code, Expression ) );
|
||||
extern SC_EXPRESS_EXPORT Expression BIN_EXPcreate PROTO( ( Op_Code, Expression, Expression ) );
|
||||
extern SC_EXPRESS_EXPORT Expression TERN_EXPcreate PROTO( ( Op_Code, Expression, Expression, Expression ) );
|
||||
extern SC_EXPRESS_EXPORT Expression QUERYcreate PROTO( ( Symbol *, Expression ) );
|
||||
extern SC_EXPRESS_EXPORT void EXPinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void EXPcleanup PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT Type EXPtype PROTO( ( Expression, struct Scope_ * ) );
|
||||
extern SC_EXPRESS_EXPORT int EXPget_integer_value PROTO( ( Expression ) );
|
||||
extern SC_EXPRESS_EXPORT Expression EXPcreate( Type );
|
||||
extern SC_EXPRESS_EXPORT Expression EXPcreate_simple( Type );
|
||||
extern SC_EXPRESS_EXPORT Expression EXPcreate_from_symbol( Type, Symbol * );
|
||||
extern SC_EXPRESS_EXPORT Expression UN_EXPcreate( Op_Code, Expression );
|
||||
extern SC_EXPRESS_EXPORT Expression BIN_EXPcreate( Op_Code, Expression, Expression );
|
||||
extern SC_EXPRESS_EXPORT Expression TERN_EXPcreate( Op_Code, Expression, Expression, Expression );
|
||||
extern SC_EXPRESS_EXPORT Expression QUERYcreate( Symbol *, Expression );
|
||||
extern SC_EXPRESS_EXPORT void EXPinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT void EXPcleanup( void );
|
||||
extern SC_EXPRESS_EXPORT Type EXPtype( Expression, struct Scope_ * );
|
||||
extern SC_EXPRESS_EXPORT int EXPget_integer_value( Expression );
|
||||
|
||||
Type EXPresolve_op_dot( Expression, Scope );
|
||||
|
||||
#endif /*EXPRESSION_H*/
|
||||
|
||||
+15
-146
@@ -92,150 +92,21 @@ extern SC_EXPRESS_EXPORT char * input_filename;
|
||||
extern SC_EXPRESS_EXPORT Linked_List EXPRESS_path;
|
||||
extern SC_EXPRESS_EXPORT int EXPRESSpass;
|
||||
|
||||
extern SC_EXPRESS_EXPORT void ( *EXPRESSinit_args ) PROTO( ( int, char ** ) );
|
||||
extern SC_EXPRESS_EXPORT void ( *EXPRESSinit_parse ) PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT int ( *EXPRESSfail ) PROTO( ( Express ) );
|
||||
extern SC_EXPRESS_EXPORT int ( *EXPRESSsucceed ) PROTO( ( Express ) );
|
||||
extern SC_EXPRESS_EXPORT void ( *EXPRESSbackend ) PROTO( ( Express ) );
|
||||
extern SC_EXPRESS_EXPORT void ( *EXPRESSinit_args )( int, char ** );
|
||||
extern SC_EXPRESS_EXPORT void ( *EXPRESSinit_parse )( void );
|
||||
extern SC_EXPRESS_EXPORT int ( *EXPRESSfail )( Express );
|
||||
extern SC_EXPRESS_EXPORT int ( *EXPRESSsucceed )( Express );
|
||||
extern SC_EXPRESS_EXPORT void ( *EXPRESSbackend )( Express );
|
||||
extern SC_EXPRESS_EXPORT char * EXPRESSprogram_name;
|
||||
extern char EXPRESSgetopt_options[]; /* initialized elsewhere */
|
||||
extern SC_EXPRESS_EXPORT int ( *EXPRESSgetopt ) PROTO( ( int, char * ) );
|
||||
extern SC_EXPRESS_EXPORT int ( *EXPRESSgetopt )( int, char * );
|
||||
extern SC_EXPRESS_EXPORT bool EXPRESSignore_duplicate_schemas;
|
||||
|
||||
extern SC_EXPRESS_EXPORT Dictionary EXPRESSbuiltins; /* procedures/functions */
|
||||
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_bail_out;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_syntax;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_unlabelled_param_type;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_file_unreadable;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_file_unwriteable;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_warn_unsupported_lang_feat;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_warn_small_real;
|
||||
|
||||
extern SC_EXPRESS_EXPORT struct Scope_ * FUNC_NVL;
|
||||
extern SC_EXPRESS_EXPORT struct Scope_ * FUNC_USEDIN;
|
||||
|
||||
extern SC_EXPRESS_EXPORT char * KW_ABS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ABSTRACT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ACOS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_AGGREGATE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ALIAS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_AND;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ANDOR;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ARRAY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_AS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ASIN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ATAN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BAG;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BEGIN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BINARY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BLENGTH;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BOOLEAN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_BY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_CASE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_CONST_E;
|
||||
extern SC_EXPRESS_EXPORT char * KW_CONSTANT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_CONTEXT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_COS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_DERIVE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_DIV;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ELSE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_ALIAS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_CASE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_CONSTANT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_CONTEXT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_ENTITY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_FUNCTION;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_IF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_LOCAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_MODEL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_PROCEDURE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_REPEAT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_RULE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_SCHEMA;
|
||||
extern SC_EXPRESS_EXPORT char * KW_END_TYPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ENTITY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ENUMERATION;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ESCAPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_EXISTS;
|
||||
extern SC_EXPRESS_EXPORT char * KW_EXP;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FALSE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FIXED;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FOR;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FORMAT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FROM;
|
||||
extern SC_EXPRESS_EXPORT char * KW_FUNCTION;
|
||||
extern SC_EXPRESS_EXPORT char * KW_GENERIC;
|
||||
extern SC_EXPRESS_EXPORT char * KW_HIBOUND;
|
||||
extern SC_EXPRESS_EXPORT char * KW_HIINDEX;
|
||||
extern SC_EXPRESS_EXPORT char * KW_IF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_IN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_INCLUDE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_INSERT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_INTEGER;
|
||||
extern SC_EXPRESS_EXPORT char * KW_INVERSE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LENGTH;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LIKE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LIST;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOBOUND;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOCAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOG;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOG10;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOG2;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOGICAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_LOINDEX;
|
||||
extern SC_EXPRESS_EXPORT char * KW_MOD;
|
||||
extern SC_EXPRESS_EXPORT char * KW_MODEL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_NOT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_NUMBER;
|
||||
extern SC_EXPRESS_EXPORT char * KW_NVL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ODD;
|
||||
extern SC_EXPRESS_EXPORT char * KW_OF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ONEOF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_OPTIONAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_OR;
|
||||
extern SC_EXPRESS_EXPORT char * KW_OTHERWISE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_PI;
|
||||
extern SC_EXPRESS_EXPORT char * KW_PROCEDURE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_QUERY;
|
||||
extern SC_EXPRESS_EXPORT char * KW_REAL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_REFERENCE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_REMOVE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_REPEAT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_RETURN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_ROLESOF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_RULE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SCHEMA;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SELECT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SELF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SET;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SIN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SIZEOF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SKIP;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SQRT;
|
||||
extern SC_EXPRESS_EXPORT char * KW_STRING;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SUBTYPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_SUPERTYPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TAN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_THEN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TO;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TRUE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TYPE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_TYPEOF;
|
||||
extern SC_EXPRESS_EXPORT char * KW_UNIQUE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_UNKNOWN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_UNTIL;
|
||||
extern SC_EXPRESS_EXPORT char * KW_USE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_USEDIN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_VALUE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_VALUE_IN;
|
||||
extern SC_EXPRESS_EXPORT char * KW_VALUE_UNIQUE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_VAR;
|
||||
extern SC_EXPRESS_EXPORT char * KW_WHERE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_WHILE;
|
||||
extern SC_EXPRESS_EXPORT char * KW_XOR;
|
||||
|
||||
/******************************/
|
||||
/* macro function definitions */
|
||||
/******************************/
|
||||
@@ -249,17 +120,15 @@ extern SC_EXPRESS_EXPORT char * KW_XOR;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT Express EXPRESScreate PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSdestroy PROTO( ( Express ) );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSparse PROTO( ( Express, FILE *, char * ) );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESScleanup PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSresolve PROTO( ( Express ) );
|
||||
extern SC_EXPRESS_EXPORT char * EXPRESSversion PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT int EXPRESS_fail PROTO( ( Express ) );
|
||||
extern SC_EXPRESS_EXPORT int EXPRESS_succeed PROTO( ( Express ) );
|
||||
extern void EXPRESSinit_init PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSusage( int _exit ); /**< exit unless _exit is non-zero */
|
||||
extern SC_EXPRESS_EXPORT Express EXPRESScreate( void );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSdestroy( Express );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSparse( Express, FILE *, char * );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESScleanup( void );
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSresolve( Express );
|
||||
extern SC_EXPRESS_EXPORT int EXPRESS_fail( Express model );
|
||||
extern SC_EXPRESS_EXPORT int EXPRESS_succeed( Express model );
|
||||
extern void EXPRESSinit_init( void );
|
||||
extern SC_EXPRESS_EXPORT void build_complex( Express );
|
||||
|
||||
#endif /*EXPRESS_H*/
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef __FACTORY_H_
|
||||
#define __FACTORY_H_
|
||||
|
||||
#include "sc_export.h"
|
||||
|
||||
SC_EXPRESS_EXPORT void FACTORYinitialize();
|
||||
|
||||
#endif /* __FACTORY_H_ */
|
||||
+13
-14
@@ -101,7 +101,7 @@
|
||||
/*****************/
|
||||
|
||||
#include <sc_export.h>
|
||||
#include "memory.h"
|
||||
#include "alloc.h"
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
@@ -183,23 +183,22 @@ This change only seems to have affected hash.h and hash.c
|
||||
#define DIV(x,y) ((x) >> (y))
|
||||
#define MOD(x,y) ((x) & ((y)-1))
|
||||
|
||||
#define HASH_Table_new() (struct Hash_Table_ *)MEM_new(&HASH_Table_fl)
|
||||
#define HASH_Table_destroy(x) MEM_destroy(&HASH_Table_fl,(Freelist *)(Generic)x)
|
||||
#define HASH_Element_new() (struct Element_ *)MEM_new(&HASH_Element_fl)
|
||||
#define HASH_Element_destroy(x) MEM_destroy(&HASH_Element_fl,(Freelist *)(char *)x)
|
||||
|
||||
#define HASH_Table_new() (struct Hash_Table_ *)ALLOC_new(&HASH_Table_fl)
|
||||
#define HASH_Table_destroy(x) ALLOC_destroy(&HASH_Table_fl,(Freelist *)x)
|
||||
#define HASH_Element_new() (struct Element_ *)ALLOC_new(&HASH_Element_fl)
|
||||
#define HASH_Element_destroy(x) ALLOC_destroy(&HASH_Element_fl,(Freelist *)(char *)x)
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT void HASHinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT Hash_Table HASHcreate PROTO( ( unsigned ) );
|
||||
extern SC_EXPRESS_EXPORT Hash_Table HASHcopy PROTO( ( Hash_Table ) );
|
||||
extern SC_EXPRESS_EXPORT void HASHdestroy PROTO( ( Hash_Table ) );
|
||||
extern SC_EXPRESS_EXPORT Element HASHsearch PROTO( ( Hash_Table, Element, Action ) );
|
||||
extern SC_EXPRESS_EXPORT void HASHlistinit PROTO( ( Hash_Table, HashEntry * ) );
|
||||
extern SC_EXPRESS_EXPORT void HASHlistinit_by_type PROTO( ( Hash_Table, HashEntry *, char ) );
|
||||
extern SC_EXPRESS_EXPORT Element HASHlist PROTO( ( HashEntry * ) );
|
||||
extern SC_EXPRESS_EXPORT void HASHinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT Hash_Table HASHcreate( unsigned );
|
||||
extern SC_EXPRESS_EXPORT Hash_Table HASHcopy( Hash_Table );
|
||||
extern SC_EXPRESS_EXPORT void HASHdestroy( Hash_Table );
|
||||
extern SC_EXPRESS_EXPORT Element HASHsearch( Hash_Table, Element, Action );
|
||||
extern SC_EXPRESS_EXPORT void HASHlistinit( Hash_Table, HashEntry * );
|
||||
extern SC_EXPRESS_EXPORT void HASHlistinit_by_type( Hash_Table, HashEntry *, char );
|
||||
extern SC_EXPRESS_EXPORT Element HASHlist( HashEntry * );
|
||||
|
||||
#endif /*HASH_H*/
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef INFO_H
|
||||
#define INFO_H
|
||||
|
||||
#include "sc_export.h"
|
||||
/** \file info.h
|
||||
* informative functions that were in express.c/express.h
|
||||
*/
|
||||
|
||||
extern SC_EXPRESS_EXPORT char * EXPRESSversion( void );
|
||||
|
||||
/** print usage message, then exit if _exit is non-zero */
|
||||
extern SC_EXPRESS_EXPORT void EXPRESSusage( int _exit );
|
||||
|
||||
#endif /* INFO_H */
|
||||
+21
-27
@@ -58,7 +58,7 @@ typedef struct Scan_Buffer {
|
||||
#endif
|
||||
char * savedPos;
|
||||
FILE * file;
|
||||
char * filename;
|
||||
const char * filename;
|
||||
bool readEof;
|
||||
int lineno;
|
||||
int bol;
|
||||
@@ -72,16 +72,6 @@ extern SC_EXPRESS_EXPORT Scan_Buffer SCAN_buffers[SCAN_NESTING_DEPTH];
|
||||
extern SC_EXPRESS_EXPORT int SCAN_current_buffer;
|
||||
extern SC_EXPRESS_EXPORT char * SCANcurrent;
|
||||
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_include_file;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_unmatched_close_comment;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_unmatched_open_comment;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_unterminated_string;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_encoded_string_bad_digit;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_encoded_string_bad_count;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_bad_identifier;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_unexpected_character;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_nonascii_char;
|
||||
|
||||
/******************************/
|
||||
/* macro function definitions */
|
||||
/******************************/
|
||||
@@ -95,26 +85,30 @@ extern SC_EXPRESS_EXPORT Error ERROR_nonascii_char;
|
||||
# define SCANtext_ready (*SCANcurrent != '\0')
|
||||
#endif
|
||||
|
||||
#ifndef static_inline
|
||||
# define static_inline static inline
|
||||
#endif
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT void SCANinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void SCANinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT void SCANcleanup( void );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_real_literal PROTO( ( const char * ) );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_integer_literal PROTO( ( const char * ) );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_binary_literal PROTO( ( const char * ) );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_logical_literal PROTO( ( char * ) );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_identifier_or_keyword PROTO( ( const char * ) );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_string PROTO( ( const char * ) );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_encoded_string PROTO( ( const char * ) );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_semicolon PROTO( ( const char *, int ) );
|
||||
extern SC_EXPRESS_EXPORT void SCANsave_comment PROTO( ( const char * ) );
|
||||
extern SC_EXPRESS_EXPORT bool SCANread PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void SCANinclude_file PROTO( ( char * ) );
|
||||
SC_EXPRESS_EXPORT void SCANlowerize PROTO( ( char * ) );
|
||||
SC_EXPRESS_EXPORT void SCANupperize PROTO( ( char * ) );
|
||||
extern SC_EXPRESS_EXPORT char * SCANstrdup PROTO( ( const char * ) );
|
||||
extern SC_EXPRESS_EXPORT long SCANtell PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_real_literal( const char * );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_integer_literal( const char * );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_binary_literal( const char * );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_logical_literal( char * );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_identifier_or_keyword( const char * );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_string( const char * );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_encoded_string( const char * );
|
||||
extern SC_EXPRESS_EXPORT int SCANprocess_semicolon( const char *, int );
|
||||
extern SC_EXPRESS_EXPORT void SCANsave_comment( const char * );
|
||||
extern SC_EXPRESS_EXPORT bool SCANread( void );
|
||||
extern SC_EXPRESS_EXPORT void SCANinclude_file( char * );
|
||||
SC_EXPRESS_EXPORT void SCANlowerize( char * );
|
||||
SC_EXPRESS_EXPORT void SCANupperize( char * );
|
||||
extern SC_EXPRESS_EXPORT char * SCANstrdup( const char * );
|
||||
extern SC_EXPRESS_EXPORT long SCANtell( void );
|
||||
|
||||
#endif /* LEX_ACTIONS_H */
|
||||
|
||||
+22
-21
@@ -38,7 +38,7 @@
|
||||
|
||||
#include <sc_export.h>
|
||||
#include "basic.h"
|
||||
#include "memory.h"
|
||||
#include "alloc.h"
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
@@ -59,7 +59,7 @@ typedef struct Linked_List_ * Linked_List;
|
||||
typedef struct Link_ {
|
||||
struct Link_ * next;
|
||||
struct Link_ * prev;
|
||||
Generic data;
|
||||
void *data;
|
||||
} * Link;
|
||||
|
||||
struct Linked_List_ {
|
||||
@@ -70,7 +70,6 @@ struct Linked_List_ {
|
||||
/* global variables */
|
||||
/********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_empty_list;
|
||||
extern SC_EXPRESS_EXPORT struct freelist_head LINK_fl;
|
||||
extern SC_EXPRESS_EXPORT struct freelist_head LIST_fl;
|
||||
|
||||
@@ -78,10 +77,10 @@ extern SC_EXPRESS_EXPORT struct freelist_head LIST_fl;
|
||||
/* macro function definitions */
|
||||
/******************************/
|
||||
|
||||
#define LINK_new() (struct Link_ *)MEM_new(&LINK_fl)
|
||||
#define LINK_destroy(x) MEM_destroy(&LINK_fl,(Freelist *)(Generic)x)
|
||||
#define LIST_new() (struct Linked_List_ *)MEM_new(&LIST_fl)
|
||||
#define LIST_destroy(x) MEM_destroy(&LIST_fl,(Freelist *)(Generic)x)
|
||||
#define LINK_new() (struct Link_ *)ALLOC_new(&LINK_fl)
|
||||
#define LINK_destroy(x) ALLOC_destroy(&LINK_fl,(Freelist *)x)
|
||||
#define LIST_new() (struct Linked_List_ *)ALLOC_new(&LIST_fl)
|
||||
#define LIST_destroy(x) ALLOC_destroy(&LIST_fl,(Freelist *)x)
|
||||
|
||||
/** accessing links */
|
||||
#define LINKdata(link) (link)->data
|
||||
@@ -125,20 +124,22 @@ extern SC_EXPRESS_EXPORT struct freelist_head LIST_fl;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT void LISTinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void LISTcleanup PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT Linked_List LISTcreate PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT Linked_List LISTcopy PROTO( ( Linked_List ) );
|
||||
extern SC_EXPRESS_EXPORT Generic LISTadd_first PROTO( ( Linked_List, Generic ) );
|
||||
extern SC_EXPRESS_EXPORT Generic LISTadd_last PROTO( ( Linked_List, Generic ) );
|
||||
extern SC_EXPRESS_EXPORT Generic LISTadd_after PROTO( ( Linked_List, Link, Generic ) );
|
||||
extern SC_EXPRESS_EXPORT Generic LISTadd_before PROTO( ( Linked_List, Link, Generic ) );
|
||||
extern SC_EXPRESS_EXPORT Generic LISTremove_first PROTO( ( Linked_List ) );
|
||||
extern SC_EXPRESS_EXPORT Generic LISTget_first PROTO( ( Linked_List ) );
|
||||
extern SC_EXPRESS_EXPORT Generic LISTget_second PROTO( ( Linked_List ) );
|
||||
extern SC_EXPRESS_EXPORT Generic LISTget_nth PROTO( ( Linked_List, int ) );
|
||||
extern SC_EXPRESS_EXPORT void LISTfree PROTO( ( Linked_List ) );
|
||||
extern SC_EXPRESS_EXPORT int LISTget_length PROTO( ( Linked_List ) );
|
||||
extern SC_EXPRESS_EXPORT void LISTinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT void LISTcleanup( void );
|
||||
extern SC_EXPRESS_EXPORT Linked_List LISTcreate( void );
|
||||
extern SC_EXPRESS_EXPORT Linked_List LISTcopy( Linked_List );
|
||||
extern SC_EXPRESS_EXPORT void LISTsort( Linked_List, int (*comp)(void*, void*) );
|
||||
extern SC_EXPRESS_EXPORT void LISTswap( Link, Link );
|
||||
extern SC_EXPRESS_EXPORT void * LISTadd_first( Linked_List, void * );
|
||||
extern SC_EXPRESS_EXPORT void * LISTadd_last( Linked_List, void * );
|
||||
extern SC_EXPRESS_EXPORT void * LISTadd_after( Linked_List, Link, void * );
|
||||
extern SC_EXPRESS_EXPORT void * LISTadd_before( Linked_List, Link, void * );
|
||||
extern SC_EXPRESS_EXPORT void * LISTremove_first( Linked_List );
|
||||
extern SC_EXPRESS_EXPORT void * LISTget_first( Linked_List );
|
||||
extern SC_EXPRESS_EXPORT void * LISTget_second( Linked_List );
|
||||
extern SC_EXPRESS_EXPORT void * LISTget_nth( Linked_List, int );
|
||||
extern SC_EXPRESS_EXPORT void LISTfree( Linked_List );
|
||||
extern SC_EXPRESS_EXPORT int LISTget_length( Linked_List );
|
||||
extern SC_EXPRESS_EXPORT bool LISTempty( Linked_List list );
|
||||
|
||||
#endif /*LINKED_LIST_H*/
|
||||
|
||||
@@ -1,85 +1,8 @@
|
||||
#ifndef MEMORY_H
|
||||
#define MEMORY_H
|
||||
#ifndef __MEMORY_H
|
||||
#define __MEMORY_H
|
||||
|
||||
/*
|
||||
* This work was supported by the United States Government, and is
|
||||
* not subject to copyright.
|
||||
*
|
||||
* $Log: memory.h,v $
|
||||
* Revision 1.5 1997/01/21 19:17:11 dar
|
||||
* made C++ compatible
|
||||
*
|
||||
* Revision 1.4 1993/10/15 18:49:23 libes
|
||||
* CADDETC certified
|
||||
*
|
||||
* Revision 1.3 1993/02/22 21:41:13 libes
|
||||
* ANSI compat
|
||||
*
|
||||
* Revision 1.2 1992/08/18 17:15:40 libes
|
||||
* rm'd extraneous error messages
|
||||
*
|
||||
* Revision 1.1 1992/05/28 03:56:02 libes
|
||||
* Initial revision
|
||||
*/
|
||||
|
||||
#include "basic.h"
|
||||
|
||||
/*****************/
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <sc_export.h>
|
||||
|
||||
/** \file memory.h - defs for fixed size block memory allocator */
|
||||
|
||||
typedef long Align;
|
||||
|
||||
union freelist {
|
||||
union freelist * next; /**< next block on freelist */
|
||||
char memory; /**< user data */
|
||||
Align aligner; /**< force alignment of blocks */
|
||||
};
|
||||
|
||||
typedef union freelist Freelist;
|
||||
|
||||
struct freelist_head {
|
||||
int size_elt; /**< size of a single elt */
|
||||
#ifndef NOSTAT
|
||||
int alloc; /**< # of allocations */
|
||||
int dealloc;
|
||||
int create; /**< number of calls to create a new freelist */
|
||||
Generic max; /**< end of freelist */
|
||||
#endif
|
||||
int size; /**< size of a single elt incl. next ptr */
|
||||
int bytes; /**< if we run out, allocate memory by this many bytes */
|
||||
Freelist * freelist;
|
||||
#ifdef SPACE_PROFILE
|
||||
int count;
|
||||
#endif
|
||||
};
|
||||
|
||||
char * nnew();
|
||||
|
||||
#include "error.h"
|
||||
|
||||
/***********************************************/
|
||||
/* space allocation macros with error package: */
|
||||
/***********************************************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT int yylineno;
|
||||
|
||||
/** CALLOC grabs and initializes to all 0s space for the indicated
|
||||
* number of instances of the indicated type */
|
||||
#define CALLOC(ptr, num, type) \
|
||||
if (((ptr) = (type*)calloc((num), (unsigned)sizeof(type)))==NULL) { \
|
||||
fprintf(stderr,"fedex: out of space");\
|
||||
} else {}
|
||||
|
||||
SC_EXPRESS_EXPORT void _MEMinitialize PROTO( ( void ) );
|
||||
SC_EXPRESS_EXPORT void MEMinitialize PROTO( ( struct freelist_head * flh, unsigned int size, int alloc1, int alloc2 ) );
|
||||
SC_EXPRESS_EXPORT void MEM_destroy PROTO( ( struct freelist_head *, Freelist * ) );
|
||||
SC_EXPRESS_EXPORT Generic MEM_new PROTO( ( struct freelist_head * ) );
|
||||
|
||||
#endif /* MEMORY_H */
|
||||
#include "sc_export.h"
|
||||
|
||||
SC_EXPRESS_EXPORT void MEMORYinitialize();
|
||||
|
||||
#endif // __MEMORY_H
|
||||
|
||||
@@ -81,7 +81,7 @@ struct Object {
|
||||
/* global variables */
|
||||
/********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT struct Object * OBJ;
|
||||
extern SC_EXPRESS_EXPORT struct Object OBJ[];
|
||||
|
||||
/******************************/
|
||||
/* macro function definitions */
|
||||
@@ -97,9 +97,4 @@ extern SC_EXPRESS_EXPORT struct Object * OBJ;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT void OBJinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void OBJcleanup PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void OBJcreate PROTO( ( char, struct Symbol_ * ( * )( Generic ), char *, int ) );
|
||||
extern SC_EXPRESS_EXPORT Symbol * UNK_get_symbol PROTO( ( Generic x ) );
|
||||
|
||||
#endif /*OBJECT_H*/
|
||||
|
||||
+24
-22
@@ -47,19 +47,6 @@
|
||||
|
||||
extern SC_EXPRESS_EXPORT int print_objects_while_running;
|
||||
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_undefined_attribute;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_undefined_type;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_undefined_schema;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_unknown_attr_in_entity;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_unknown_subtype;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_unknown_supertype;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_circular_reference;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_ambiguous_attribute;
|
||||
extern SC_EXPRESS_EXPORT Error ERROR_ambiguous_group;
|
||||
|
||||
extern SC_EXPRESS_EXPORT Error WARNING_case_skip_label;
|
||||
extern SC_EXPRESS_EXPORT Error WARNING_fn_skip_branch;
|
||||
|
||||
/* macros */
|
||||
|
||||
/* cheaper doing the check here, then inside the function call. Return */
|
||||
@@ -73,14 +60,29 @@ extern SC_EXPRESS_EXPORT Error WARNING_fn_skip_branch;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern SC_EXPRESS_EXPORT void RESOLVEinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void RESOLVEcleanup PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void SCOPEresolve_expressions_statements PROTO( ( Scope ) );
|
||||
extern SC_EXPRESS_EXPORT void SCOPEresolve_subsupers PROTO( ( Scope ) );
|
||||
extern SC_EXPRESS_EXPORT void SCOPEresolve_types PROTO( ( Scope ) );
|
||||
extern SC_EXPRESS_EXPORT void TYPE_resolve PROTO( ( Type * ) );
|
||||
extern SC_EXPRESS_EXPORT void EXP_resolve PROTO( ( Expression, Scope, Type ) );
|
||||
extern SC_EXPRESS_EXPORT void ALGresolve PROTO( ( Scope ) );
|
||||
extern SC_EXPRESS_EXPORT void SCHEMAresolve PROTO( ( Scope ) );
|
||||
extern SC_EXPRESS_EXPORT void RESOLVEinitialize( void );
|
||||
extern SC_EXPRESS_EXPORT void RESOLVEcleanup( void );
|
||||
extern SC_EXPRESS_EXPORT void SCOPEresolve_expressions_statements( Scope );
|
||||
extern SC_EXPRESS_EXPORT void SCOPEresolve_subsupers( Scope );
|
||||
extern SC_EXPRESS_EXPORT void SCOPEresolve_types( Scope );
|
||||
extern SC_EXPRESS_EXPORT void TYPE_resolve( Type * );
|
||||
extern SC_EXPRESS_EXPORT void EXP_resolve( Expression, Scope, Type );
|
||||
extern SC_EXPRESS_EXPORT void ALGresolve( Scope );
|
||||
extern SC_EXPRESS_EXPORT void SCHEMAresolve( Scope );
|
||||
extern SC_EXPRESS_EXPORT void RENAMEresolve( Rename *, Schema );
|
||||
|
||||
/*
|
||||
* for unit tests, no extern / export
|
||||
*/
|
||||
void VAR_resolve_expressions( Variable, Entity );
|
||||
void ENTITYresolve_subtypes( Schema );
|
||||
void ENTITYresolve_supertypes( Entity );
|
||||
void ENTITYresolve_expressions( Entity e );
|
||||
void ALGresolve_expressions_statements( Scope, Linked_List );
|
||||
int WHEREresolve( Linked_List, Scope, int );
|
||||
void TYPEresolve_expressions( Type, Scope );
|
||||
void STMTresolve( Statement, Scope );
|
||||
void STMTlist_resolve( Linked_List, Scope );
|
||||
int ENTITYresolve_subtype_expression( Expression, Entity, Linked_List * );
|
||||
|
||||
#endif /*RESOLVE_H*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user