]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Parser supports { } in parameters (for example min({1, 2})
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 4 Mar 2010 18:02:37 +0000 (18:02 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 4 Mar 2010 18:02:37 +0000 (18:02 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14584 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java
org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj

index da13092196ca0f4cad5ee2be131eca14fbae7c08..42cac6a6e66cd8adbe8a5df4b5599c984f35e728 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.sysdyn;
 \r
 import org.simantics.db.Resource;\r
 import org.simantics.db.ReadGraph;\r
+import org.simantics.db.request.Read;\r
 import org.simantics.db.Session;\r
 import org.simantics.db.exception.DatabaseException;\r
 \r
@@ -143,5 +144,18 @@ public class SysdynResource {
         return ret;\r
     }\r
     \r
+    public static SysdynResource getInstance(Session session) throws DatabaseException {\r
+        SysdynResource ret = session.getService(SysdynResource.class);\r
+        if(ret == null) {\r
+            ret = session.syncRequest(new Read<SysdynResource>() {\r
+                public SysdynResource perform(ReadGraph graph) throws DatabaseException {\r
+                    return new SysdynResource(graph);\r
+                }\r
+            });\r
+            session.registerService(SysdynResource.class, ret);\r
+        }\r
+        return ret;\r
+    }\r
+    \r
 }\r
 \r
index 14c4e66e5fac148869530801bc106bfaf94fdc0b..e6a1563c55cd9c43d36d35139ccd3f1ebdd2a77a 100644 (file)
@@ -141,7 +141,7 @@ void primary() : {
   | component_reference()\r
   | "(" output_expression_list() ")"\r
   | "[" expression_list() ( ";" expression_list() )* "]"\r
-  //| "{" function_arguments() "}"\r
+  | "{" function_arguments() "}"\r
   | "end"\r
 }\r
 \r