]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/scl/Simantics/SCL.scl
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.modeling / scl / Simantics / SCL.scl
index 7298004aa6cf1241ceb35f467a2a352cc48a4046..32db0f4bc6545cca456aaa697aa49477aafe1ac3 100644 (file)
@@ -1,84 +1,84 @@
-include "Simantics/DB"\r
-include "Simantics/Variables"\r
-include "Simantics/Ontologies"\r
-\r
-include "http://www.simantics.org/Modeling-1.2/SCLQuery" as SCLQuery\r
-\r
-importJava "org.simantics.scl.compiler.errors.CompilationError" where\r
-    data CompilationError\r
-\r
-importJava "org.simantics.scl.ui.editor.TextAndErrors" where\r
-    data TextAndErrors\r
-    createTextAndErrors :: String -> [CompilationError] -> TextAndErrors\r
-\r
-createSCLModuleAction :: Resource -> <Proc> ()\r
-createSCLModuleAction res = do\r
-  syncWrite (\() -> createSCLModuleDefault res)\r
-  ()\r
-\r
-createPGraphAction :: Resource -> <Proc> ()\r
-createPGraphAction res = do\r
-  syncWrite (\() -> createPGraphDefault res)\r
-  ()\r
-\r
-createSCLValueIndependent :: Resource -> String -> <WriteGraph> Resource\r
-createSCLValueIndependent valueType expression = do\r
-    value = newResource ()\r
-    claim value L0.InstanceOf valueType\r
-    claimRelatedValue value L0.SCLValue.expression expression\r
-    value\r
-\r
-createSCLValue :: Resource -> Resource -> Resource -> String -> <WriteGraph> Resource\r
-createSCLValue container predicate valueType expression = do\r
-    value = createSCLValueIndependent valueType expression\r
-    claim container predicate value\r
-    value\r
-\r
-setExpression :: Variable -> String -> <WriteGraph> ()\r
-setExpression self expression = do\r
-    res = represents self\r
-    claimRelatedValue res L0.SCLValue.expression expression\r
-\r
-importJava "org.simantics.modeling.ModelingUtils" where\r
-    createSCLModuleDefault :: Resource -> <WriteGraph> ()\r
-    createPGraphDefault :: Resource -> <WriteGraph> ()\r
-    createSCLModule :: Resource -> String -> <WriteGraph> ()\r
-\r
-effect SCL \r
-    "scl" \r
-    "org.simantics.scl.compiler.commands.CommandSession"\r
-\r
-importJava "org.simantics.modeling.scl.SCLRealm" where\r
-    data SCLRealm\r
-    syncExec :: SCLRealm -> (<SCL, Proc> a) -> <Proc> a\r
-    @JavaName refreshVariablesSync\r
-    refreshVariables :: SCLRealm -> <Proc> ()\r
-    \r
-readSCLRealm :: Resource -> <ReadGraph,Proc> SCLRealm\r
-readSCLRealm r = let\r
-    id = relatedValue r L0.HasName\r
-  in match sclRealmById id with\r
-    Just realm -> realm\r
-    Nothing -> getOrCreateSCLRealm id\r
-\r
-importJava "org.simantics.modeling.scl.SCLSessionManager" where\r
-    getOrCreateSCLRealm :: String -> <Proc> SCLRealm\r
-    sclRealmById :: String -> <Proc> Maybe SCLRealm\r
-    \r
-importJava "org.simantics.scl.compiler.top.CommandResponse" where\r
-    data CommandResponse = \r
-        @FieldNames [message, error]\r
-        CommandResponse String Boolean\r
-\r
-isSuccessful :: CommandResponse -> Boolean\r
-isSuccessful (CommandResponse _ error) = not error\r
-\r
-instance Show CommandResponse where\r
-    show (CommandResponse message _) = message\r
-\r
-importJava "org.simantics.scl.compiler.commands.CommandSession" where\r
-    execute :: String -> <SCL, Proc> ()\r
-    \r
-    @JavaName getVariableValue\r
-    variableValue :: String -> <SCL> a\r
+include "Simantics/DB"
+include "Simantics/Variables"
+include "Simantics/Ontologies"
+
+include "http://www.simantics.org/Modeling-1.2/SCLQuery" as SCLQuery
+
+importJava "org.simantics.scl.compiler.errors.CompilationError" where
+    data CompilationError
+
+importJava "org.simantics.scl.ui.editor.TextAndErrors" where
+    data TextAndErrors
+    createTextAndErrors :: String -> [CompilationError] -> TextAndErrors
+
+createSCLModuleAction :: Resource -> <Proc> ()
+createSCLModuleAction res = do
+  syncWrite (\() -> createSCLModuleDefault res)
+  ()
+
+createPGraphAction :: Resource -> <Proc> ()
+createPGraphAction res = do
+  syncWrite (\() -> createPGraphDefault res)
+  ()
+
+createSCLValueIndependent :: Resource -> String -> <WriteGraph> Resource
+createSCLValueIndependent valueType expression = do
+    value = newResource ()
+    claim value L0.InstanceOf valueType
+    claimRelatedValue value L0.SCLValue.expression expression
+    value
+
+createSCLValue :: Resource -> Resource -> Resource -> String -> <WriteGraph> Resource
+createSCLValue container predicate valueType expression = do
+    value = createSCLValueIndependent valueType expression
+    claim container predicate value
+    value
+
+setExpression :: Variable -> String -> <WriteGraph> ()
+setExpression self expression = do
+    res = represents self
+    claimRelatedValue res L0.SCLValue.expression expression
+
+importJava "org.simantics.modeling.ModelingUtils" where
+    createSCLModuleDefault :: Resource -> <WriteGraph> ()
+    createPGraphDefault :: Resource -> <WriteGraph> ()
+    createSCLModule :: Resource -> String -> <WriteGraph> ()
+
+effect SCL 
+    "scl" 
+    "org.simantics.scl.compiler.commands.CommandSession"
+
+importJava "org.simantics.modeling.scl.SCLRealm" where
+    data SCLRealm
+    syncExec :: SCLRealm -> (<SCL, Proc> a) -> <Proc> a
+    @JavaName refreshVariablesSync
+    refreshVariables :: SCLRealm -> <Proc> ()
+    
+readSCLRealm :: Resource -> <ReadGraph,Proc> SCLRealm
+readSCLRealm r = let
+    id = relatedValue r L0.HasName
+  in match sclRealmById id with
+    Just realm -> realm
+    Nothing -> getOrCreateSCLRealm id
+
+importJava "org.simantics.modeling.scl.SCLSessionManager" where
+    getOrCreateSCLRealm :: String -> <Proc> SCLRealm
+    sclRealmById :: String -> <Proc> Maybe SCLRealm
+    
+importJava "org.simantics.scl.compiler.top.CommandResponse" where
+    data CommandResponse = 
+        @FieldNames [message, error]
+        CommandResponse String Boolean
+
+isSuccessful :: CommandResponse -> Boolean
+isSuccessful (CommandResponse _ error) = not error
+
+instance Show CommandResponse where
+    show (CommandResponse message _) = message
+
+importJava "org.simantics.scl.compiler.commands.CommandSession" where
+    execute :: String -> <SCL, Proc> ()
+    
+    @JavaName getVariableValue
+    variableValue :: String -> <SCL> a
     setVariable :: String -> Type -> a -> <SCL> ()
\ No newline at end of file