-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle_softbench.pl
executable file
·111 lines (95 loc) · 3.52 KB
/
style_softbench.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/* :- compile(library(sets)). */
/* alter attributes list, alter validentity predicates */
:- multifile(typeschema/6).
:- multifile(informalnames/2).
:- multifile(validentity/2).
:- multifile(style/2).
style(softbench, 'HP SoftBench').
/* Check constraints on an entity */
/* validentity(entity(style), name of entity) */
/* NOTE: IN ALL CASES WHERE THE DATABASE IS CHECKED FOR AN ATTRIBUTE,
MAKE SURE TO ALLOW FOR POSSIBILITY THAT THE ATTRIBUTE WAS NOT
ENTERED BY THE USER (A PARTIAL DESCRIPTION)!*/
validentity(event(softbench), Name) :-
indatabase([Name]),
validentity(datacomponent(base), Name).
validentity(controlcomponent(softbench), Name) :-
indatabase([Name]),
validentity(controlcomponent(base), Name).
validentity(trigger(softbench), Name) :-
indatabase([Name]),
validentity(trigger(base), Name),
getvalues(trigger, _, Name,
[controlcomponent, inmessage, outmessageset, outcalls, outspawns],
[Controlcomponent, Inmessage, Outmessageset, Outcalls, Outspawns]),
checkfortypemismatch(Name, Controlcomponent, controlcomponent(softbench),
'SoftBench trigger controlcomponent lacks proper type'),
checkfortypemismatch(Name, Inmessage, event(softbench),
'SoftBench trigger inmessage lacks proper type'),
checkfortypemismatch(Name, Outmessageset, event(softbench),
'SoftBench trigger outmessageset includes entity lacking proper type'),
checkfortypemismatch(Name, Outcalls, controlcomponent(softbench),
'SoftBench trigger outcalls includes entity lacking proper type'),
checkfortypemismatch(Name, Outspawns, controlcomponent(softbench),
'SoftBench trigger outspawns includes entity lacking proper type').
validentity(system(softbench), Name) :-
indatabase([Name]),
validentity(system(base), Name),
getvalues(system, _, Name,
[controlcomponents, recognizedmessages, triggers],
[Controlcomponents, Recognizedmessages, Triggers]),
checkfortypemismatch(Name, Controlcomponents, controlcomponent(softbench),
'SoftBench system controlcomponents includes entity lacking proper type'),
/* checkfortypemismatch(Name, Recognizedmessages, event(softbench),
'SoftBench system recognizedmessages includes entity lacking proper type'),*/
checkfortypemismatch(Name, Triggers, trigger(softbench),
'SoftBench system triggers includes entity lacking proper type'),
((Triggers == [unspecified] ; Triggers == []) ->
zz('SoftBench system needs a set of triggers', Name, Triggers);
true
).
/*************************************************************************/
/*typeschema(entity(style), variable attributes, types of former,
fixed attributes, fixed attributes values, parent entity(style))*/
typeschema(event(softbench),
[],
[],
[type],
[[string]],
datacomponent(base)).
typeschema(controlcomponent(softbench),
[],
[],
[codesize],
[[1200]],
controlcomponent(base)).
typeschema(trigger(softbench),
[],
[],
[],
[],
trigger(base)).
typeschema(system(softbench),
[],
[],
[recognizedmessages],
[[xevent_keypress, xevent_keyrelease, xevent_buttonpress]],
system(base)).
informalnames(system(softbench),
['Initial Control Components',
'Initial Data Connectors ',
'Global Objects ',
'Control Components ',
'Classes ',
'Shared Data ',
'Data Connectors ',
'Calls ',
'Spawns ',
'Recognized Messages ',
'Triggers ',
'Call Layers ',
'Spawn Layers ',
'Data Connector Layers ',
'Nodes ',
'Resources ',
'Platform ']).