From c4abdab0c8bc8018495c14e0e95e5ec8584f2d3f Mon Sep 17 00:00:00 2001 From: lempinen Date: Thu, 4 Mar 2010 18:02:37 +0000 Subject: [PATCH] Parser supports { } in parameters (for example min({1, 2}) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14584 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/sysdyn/SysdynResource.java | 14 ++++++++++++++ .../sysdyn/expressionParser/ExpressionParser.jj | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java index da130921..42cac6a6 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/SysdynResource.java @@ -13,6 +13,7 @@ package org.simantics.sysdyn; import org.simantics.db.Resource; import org.simantics.db.ReadGraph; +import org.simantics.db.request.Read; import org.simantics.db.Session; import org.simantics.db.exception.DatabaseException; @@ -143,5 +144,18 @@ public class SysdynResource { return ret; } + public static SysdynResource getInstance(Session session) throws DatabaseException { + SysdynResource ret = session.getService(SysdynResource.class); + if(ret == null) { + ret = session.syncRequest(new Read() { + public SysdynResource perform(ReadGraph graph) throws DatabaseException { + return new SysdynResource(graph); + } + }); + session.registerService(SysdynResource.class, ret); + } + return ret; + } + } diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj index 14c4e66e..e6a1563c 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/expressionParser/ExpressionParser.jj @@ -141,7 +141,7 @@ void primary() : { | component_reference() | "(" output_expression_list() ")" | "[" expression_list() ( ";" expression_list() )* "]" - //| "{" function_arguments() "}" + | "{" function_arguments() "}" | "end" } -- 2.47.1