]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.document.base.ontology/graph/Components.pgraph
ValueType modifications to satisfy compilation of SCL-expressions
[simantics/platform.git] / bundles / org.simantics.document.base.ontology / graph / Components.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 STR = <http://www.simantics.org/Structural-1.2>
3 DOC = <http://www.simantics.org/Documentation-1.2>
4 RELATIONS = <http://www.simantics.org/Documentation-1.2/Relations>
5 PROPERTIES = <http://www.simantics.org/Documentation-1.2/Properties>
6 FUNCTIONS = <http://www.simantics.org/Documentation-1.2/Functions>
7
8 COMPONENTS = DOC.Components : L0.Library
9
10 attribute = COMPONENTS.attribute : L0.Template
11     @template %subject %relation %default
12         %subject
13             >-- %relation
14             L0.Asserts _ : L0.Assertion
15                 L0.HasPredicate %relation
16                 L0.HasObject %default
17
18 connectionPoint = COMPONENTS.connectionPoint : L0.Template
19     @template %subject %relation
20         %subject
21             >-- %relation    
22
23 sclAttribute = COMPONENTS.sclAttribute : L0.Template
24     @template %subject %relation %command %valueType
25         %subject
26             >-- %relation
27             L0.Asserts _ : L0.Assertion
28                 L0.HasPredicate %relation
29                 L0.HasObject _ : DOC.SCLValue
30                   L0.HasValueType %valueType
31                   L0.SCLValue.expression %command
32                   L0.default false
33
34 DOC.SCL : L0.SCLModule
35     L0.SCLModule.definition _ : L0.String
36         @L0.loadString "scl/Code.scl"
37
38 DOC.scl : L0.Template
39     @template %subject %property %expression %valueType
40         %subject
41             %property _ : DOC.SCLValue
42               L0.SCLValue.expression %expression
43               L0.HasValueType %valueType
44
45 DOC.sclValue : L0.Template
46     @template %subject %expression %valueType
47         %subject : DOC.SCLValue
48             L0.SCLValue.expression %expression
49             L0.HasValueType %valueType
50
51 DOC.SCLValue <T L0.SCLValue
52   @L0.scl L0.SCLValueType.validator """\self -> compileDocumentSCLValueExpression self""" "Variable -> <ReadGraph> String"
53   @L0.assert L0.ConvertsToValueWith
54     DOC.Functions.sclValue : L0.ExternalValue
55
56 /* Basic component types */
57 COMPONENTS.Component <T STR.Component
58     >-- COMPONENTS.Component.manualOrdinal --> L0.Integer <R L0.HasProperty
59     @attribute PROPERTIES.input FUNCTIONS.input
60     @attribute PROPERTIES.session FUNCTIONS.session
61     @attribute PROPERTIES.state FUNCTIONS.state
62     @attribute PROPERTIES.icstate FUNCTIONS.icstate
63     @sclAttribute PROPERTIES.commands "commandList self" "[Command]"
64
65 COMPONENTS.PrimitiveComponent <T COMPONENTS.Component
66     @L0.assert PROPERTIES.primitiveProperties
67       _ : L0.Value
68         L0.domainProperties FUNCTIONS.primitiveProperties
69
70 COMPONENTS.ParentlessComponent <T COMPONENTS.PrimitiveComponent /* Component without a parent, e.g. Root, DialogBox */
71
72 COMPONENTS.Composite <T STR.Composite <T COMPONENTS.Component
73
74 COMPONENTS.DummyContainer <T COMPONENTS.Component /* Dummy single component container which is not instantiated */
75     @attribute PROPERTIES.exists true
76     @attribute PROPERTIES.pathExists FUNCTIONS.pathExists
77
78 /* Root */
79 COMPONENTS.Root <T COMPONENTS.ParentlessComponent   
80     @connectionPoint RELATIONS.part1
81
82 COMPONENTS.Event <T COMPONENTS.ParentlessComponent
83     @connectionPoint RELATIONS.event
84  
85 COMPONENTS.CommandEvent <T COMPONENTS.Event
86    @connectionPoint RELATIONS.data1
87    @sclAttribute PROPERTIES.dataDefinitions "dataDefinitions self" "[DataDefinition]"
88    @sclAttribute PROPERTIES.SCLFunction "emptyOnClick ()" "String"
89
90 DOC.commandEvent : L0.Template
91     @template %instance %expression %valueType
92         %instance : COMPONENTS.CommandEvent
93             PROPERTIES.SCLFunction _ : %valueType
94                 L0.HasValueType "EventHandler"
95                 L0.SCLValue.expression %expression
96
97 COMPONENTS.DefVar <T COMPONENTS.ParentlessComponent
98    @connectionPoint RELATIONS.dataDefinition
99    @connectionPoint RELATIONS.dataIn
100    @attribute PROPERTIES.target ""
101    @attribute PROPERTIES.source ""
102    
103 COMPONENTS.DefVars <T COMPONENTS.ParentlessComponent
104    @connectionPoint RELATIONS.dataDefinition
105    @connectionPoint RELATIONS.dataIn
106    @attribute PROPERTIES.targets 
107      [] : L0.StringArray
108    @attribute PROPERTIES.sources
109      [] : L0.StringArray