--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry kind="src" path="src"/>\r
+ <classpathentry kind="output" path="bin"/>\r
+</classpath>\r
--- /dev/null
+syntax: regexp\r
+^bin/\r
+\r
+syntax: glob\r
+*.svn/*
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+ <name>org.simantics.sysdyn</name>\r
+ <comment></comment>\r
+ <projects>\r
+ </projects>\r
+ <buildSpec>\r
+ <buildCommand>\r
+ <name>org.eclipse.jdt.core.javabuilder</name>\r
+ <arguments>\r
+ </arguments>\r
+ </buildCommand>\r
+ <buildCommand>\r
+ <name>org.eclipse.pde.ManifestBuilder</name>\r
+ <arguments>\r
+ </arguments>\r
+ </buildCommand>\r
+ <buildCommand>\r
+ <name>org.eclipse.pde.SchemaBuilder</name>\r
+ <arguments>\r
+ </arguments>\r
+ </buildCommand>\r
+ </buildSpec>\r
+ <natures>\r
+ <nature>org.eclipse.pde.PluginNature</nature>\r
+ <nature>org.eclipse.jdt.core.javanature</nature>\r
+ </natures>\r
+</projectDescription>\r
--- /dev/null
+#Mon Nov 16 15:37:44 EET 2009\r
+eclipse.preferences.version=1\r
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
+org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
+org.eclipse.jdt.core.compiler.source=1.6\r
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Simantics System Dynamics
+Bundle-SymbolicName: org.simantics.sysdyn;singleton:=true
+Bundle-Version: 1.8.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.simantics.objmap;bundle-version="0.1.0",
+ org.simantics.db;bundle-version="0.6.2",
+ org.simantics.modelica;bundle-version="1.0.0",
+ org.simantics.db.common;bundle-version="0.8.0",
+ org.simantics.simulation;bundle-version="1.0.0",
+ org.eclipse.ui.console;bundle-version="3.4.0",
+ org.eclipse.core.runtime;bundle-version="3.5.0",
+ org.eclipse.jface;bundle-version="3.5.2",
+ org.simantics.project;bundle-version="1.0.0",
+ org.simantics.layer0.utils;bundle-version="0.8.0",
+ org.simantics.layer0;bundle-version="1.0.0",
+ org.simantics.structural.ontology;bundle-version="1.0.0",
+ org.simantics.sysdyn.ontology;bundle-version="1.0.0",
+ org.simantics.modeling;bundle-version="1.1.1",
+ org.simantics.diagram;bundle-version="1.1.1",
+ org.simantics.diagram.ontology;bundle-version="1.1.1",
+ org.simantics.scl.runtime;bundle-version="0.1.3",
+ org.simantics.db.layer0;bundle-version="1.1.0",
+ org.simantics.spreadsheet.common;bundle-version="1.1.0",
+ org.simantics.spreadsheet;bundle-version="1.1.0",
+ org.eclipse.jface.text;bundle-version="3.6.1",
+ org.simantics.spreadsheet.ontology;bundle-version="1.2.0",
+ org.simantics.fmu;bundle-version="1.0.0",
+ org.simantics.issues;bundle-version="1.1.0",
+ org.simantics.issues.common;bundle-version="1.1.0",
+ org.simantics.jfreechart;bundle-version="1.0.0",
+ org.jfree.jchart;bundle-version="1.0.13",
+ org.jfree.jcommon;bundle-version="1.0.16",
+ org.simantics.spreadsheet.graph;bundle-version="1.1.0",
+ fi.semantum.sysdyn.solver;bundle-version="0.1.0"
+Export-Package: org.simantics.sysdyn,
+ org.simantics.sysdyn.adapter,
+ org.simantics.sysdyn.elementaryCycles,
+ org.simantics.sysdyn.expressionParser,
+ org.simantics.sysdyn.manager,
+ org.simantics.sysdyn.modelExport,
+ org.simantics.sysdyn.modelImport,
+ org.simantics.sysdyn.modelImport.model,
+ org.simantics.sysdyn.modelParser,
+ org.simantics.sysdyn.modelica,
+ org.simantics.sysdyn.representation,
+ org.simantics.sysdyn.representation.expressions,
+ org.simantics.sysdyn.representation.utils,
+ org.simantics.sysdyn.representation.visitors,
+ org.simantics.sysdyn.simulation,
+ org.simantics.sysdyn.solver,
+ org.simantics.sysdyn.tableParser,
+ org.simantics.sysdyn.utils,
+ org.simantics.sysdyn.utils.imports
+Bundle-Activator: org.simantics.sysdyn.Activator
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.ui,
+ org.simantics.sysdyn.utils,
+ org.simantics.ui
+Bundle-Vendor: VTT Technical Reserarch Centre of Finland
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<TITLE>BNF for ModelicaParser.jj </TITLE>
+</HEAD>
+<BODY>
+<H1 ALIGN=CENTER>BNF for ModelicaParser.jj </H1>
+<H2 ALIGN=CENTER>TOKENS</H2>
+<TABLE>
+ <!-- Special token -->
+ <TR>
+ <TD>
+<PRE>
+/*** Lexer *********************************************************/</PRE>
+ </TD>
+ </TR>
+ <!-- Token -->
+ <TR>
+ <TD>
+ <PRE>
+<DEFAULT> SKIP : {
+<WHITESPACE: " " | "\n" | "\r" | "\t">
+| <COMMENT1: "/*" (~["*"] | "*" ~["/"])* "*/">
+| <COMMENT2: "//" (~["\n"])*>
+}
+
+ </PRE>
+ </TD>
+ </TR>
+ <!-- Token -->
+ <TR>
+ <TD>
+ <PRE>
+<DEFAULT> TOKEN : {
+"algorithm"
+| "discrete"
+| "false"
+| "model"
+| "redeclare"
+| "and"
+| "each"
+| "final"
+| "not"
+| "replaceable"
+| "annotation"
+| "else"
+| "flow"
+| "operator"
+| "return"
+| "assert"
+| "elseif"
+| "for"
+| "or"
+| "stream"
+| "block"
+| "elsewhen"
+| "function"
+| "outer"
+| "then"
+| "break"
+| "encapsulated"
+| "if"
+| "output"
+| "true"
+| "class"
+| "end"
+| "import"
+| "package"
+| "type"
+| "connect"
+| "enumeration"
+| "in"
+| "parameter"
+| "when"
+| "connector"
+| "equation"
+| "initial"
+| "partial"
+| "while"
+| "constant"
+| "expandable"
+| "inner"
+| "protected"
+| "within"
+| "constrainedby"
+| "extends"
+| "input"
+| "public"
+| "der"
+| "external"
+| "loop"
+| "record"
+| "("
+| ")"
+| "{"
+| "}"
+| "["
+| "]"
+| "."
+| ":"
+| ";"
+| ","
+| "<"
+| "<="
+| ">"
+| ">="
+| "=="
+| "<>"
+| "+"
+| "-"
+| ".+"
+| ".-"
+| "*"
+| "/"
+| ".*"
+| "./"
+| "^"
+| ".^"
+| "="
+| ":="
+| <IDENT: ["a"-"z","A"-"Z","_"] (["a"-"z","A"-"Z","_","0"-"9"])*>
+| <STRING: "\"" (~["\"","\\","\n"] | "\\" ~["\n"])* "\""> : {
+| <UNSIGNED_INTEGER: (["0"-"9"])+>
+| <UNSIGNED_NUMBER: <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (["e","E"] <UNSIGNED_INTEGER>)? | "." <UNSIGNED_INTEGER> (["e","E"] <UNSIGNED_INTEGER>)? | <UNSIGNED_INTEGER> ["e","E"] <UNSIGNED_INTEGER>>
+}
+
+ </PRE>
+ </TD>
+ </TR>
+</TABLE>
+<H2 ALIGN=CENTER>NON-TERMINALS</H2>
+<TABLE>
+ <!-- Special token -->
+ <TR>
+ <TD>
+<PRE>
+/*** Parser ********************************************************/
+
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+</PRE>
+ </TD>
+ </TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod1">parse</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod2">stored_definition</A> <EOF></TD>
+</TR>
+ <!-- Special token -->
+ <TR>
+ <TD>
+<PRE>
+/*** Stored Definition - Within ************************************/</PRE>
+ </TD>
+ </TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod2">stored_definition</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "within" ( <A HREF="#prod3">name</A> )? ";" )? ( ( "final" )? <A HREF="#prod4">class_definition</A> ";" )*</TD>
+</TR>
+ <!-- Special token -->
+ <TR>
+ <TD>
+<PRE>
+/*** Class Definition **********************************************/</PRE>
+ </TD>
+ </TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod4">class_definition</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "encapsulated" )? ( "partial" )? ( "class" | "model" | "record" | "block" | ( "expandable" )? "connector" | "type" | "package" | "function" | "operator" | "operator function" | "operator record" ) <A HREF="#prod5">class_specifier</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod5">class_specifier</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><IDENT> <A HREF="#prod6">string_comment</A> <A HREF="#prod7">composition</A> "end" <IDENT></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><IDENT> "=" <A HREF="#prod8">base_prefix</A> <A HREF="#prod3">name</A> ( <A HREF="#prod9">array_subscripts</A> )? ( <A HREF="#prod10">class_modification</A> )? <A HREF="#prod11">comment</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><IDENT> "=" "enumeration" "(" ( ( <A HREF="#prod12">enum_list</A> )? | ":" ) ")" <A HREF="#prod11">comment</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><IDENT> "=" "der" "(" <A HREF="#prod3">name</A> "," <IDENT> ( "," <IDENT> )* ")" <A HREF="#prod11">comment</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"extends" <IDENT> ( <A HREF="#prod10">class_modification</A> )? <A HREF="#prod6">string_comment</A> <A HREF="#prod7">composition</A> "end" <IDENT></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod8">base_prefix</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod13">type_prefix</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod12">enum_list</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod14">enumeration_literal</A> ( "," <A HREF="#prod14">enumeration_literal</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod14">enumeration_literal</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><IDENT> <A HREF="#prod11">comment</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod15">parse_composition</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod7">composition</A> <EOF></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod7">composition</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod16">element_list</A> ( "public" <A HREF="#prod16">element_list</A> | "protected" <A HREF="#prod16">element_list</A> | <A HREF="#prod17">equation_section</A> | <A HREF="#prod18">algorithm_section</A> )* ( "external" ( <A HREF="#prod19">language_specification</A> )? ( <A HREF="#prod20">external_function_call</A> )? ( <A HREF="#prod21">annotation</A> )? ";" )? ( <A HREF="#prod21">annotation</A> ";" )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod19">language_specification</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><STRING></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod20">external_function_call</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod22">component_reference</A> "=" )? <IDENT> "(" ( <A HREF="#prod23">expression_list</A> )? ")"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod16">element_list</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod24">element</A> ";" )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod24">element</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod25">import_clause</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod26">extends_clause</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "redeclare" )? ( "final" )? ( "inner" )? ( "outer" )? ( ( <A HREF="#prod4">class_definition</A> | <A HREF="#prod27">component_clause</A> ) | "replaceable" ( <A HREF="#prod4">class_definition</A> | <A HREF="#prod27">component_clause</A> ) ( <A HREF="#prod28">constraining_clause</A> <A HREF="#prod11">comment</A> )? )</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod25">import_clause</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"import" ( <IDENT> "=" <A HREF="#prod3">name</A> | <A HREF="#prod3">name</A> ( "." "*" )? ) <A HREF="#prod11">comment</A></TD>
+</TR>
+ <!-- Special token -->
+ <TR>
+ <TD>
+<PRE>
+/*** Extends *******************************************************/</PRE>
+ </TD>
+ </TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod26">extends_clause</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"extends" <A HREF="#prod3">name</A> ( <A HREF="#prod10">class_modification</A> )? ( <A HREF="#prod21">annotation</A> )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod28">constraining_clause</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"constrainedby" <A HREF="#prod3">name</A> ( <A HREF="#prod10">class_modification</A> )?</TD>
+</TR>
+ <!-- Special token -->
+ <TR>
+ <TD>
+<PRE>
+/*** Component Clause **********************************************/</PRE>
+ </TD>
+ </TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod27">component_clause</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod13">type_prefix</A> ) ( <A HREF="#prod29">type_specifier</A> ) ( <A HREF="#prod9">array_subscripts</A> )? ( <A HREF="#prod30">component_list</A> )</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod13">type_prefix</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "flow" | "stream" )? ( "discrete" | "parameter" | "constant" )? ( "output" | "input" )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod29">type_specifier</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod3">name</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod30">component_list</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod31">component_declaration</A> ( "," <A HREF="#prod31">component_declaration</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod31">component_declaration</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod32">declaration</A> ( <A HREF="#prod33">conditional_attribute</A> )? <A HREF="#prod11">comment</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod33">conditional_attribute</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"if" <A HREF="#prod34">expression</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod32">declaration</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><IDENT> ( <A HREF="#prod9">array_subscripts</A> )? ( <A HREF="#prod35">modification</A> )?</TD>
+</TR>
+ <!-- Special token -->
+ <TR>
+ <TD>
+<PRE>
+/*** Modification **********************************************/</PRE>
+ </TD>
+ </TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod35">modification</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod10">class_modification</A> ( "=" <A HREF="#prod34">expression</A> )? | "=" <A HREF="#prod34">expression</A> | ":=" <A HREF="#prod34">expression</A> )</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod10">class_modification</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"(" ( <A HREF="#prod36">argument_list</A> )? ")"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod36">argument_list</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod37">argument</A> ( "," <A HREF="#prod37">argument</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod37">argument</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod38">element_modification_or_replaceable</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod39">element_redeclaration</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod38">element_modification_or_replaceable</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "each" )? ( "final" )? ( <A HREF="#prod40">element_modification</A> | <A HREF="#prod41">element_replaceable</A> )</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod40">element_modification</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod3">name</A> ( <A HREF="#prod35">modification</A> )? <A HREF="#prod6">string_comment</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod39">element_redeclaration</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"redeclare" ( "each" )? ( "final" )? ( ( <A HREF="#prod4">class_definition</A> | <A HREF="#prod42">component_clause1</A> ) | <A HREF="#prod41">element_replaceable</A> )</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod41">element_replaceable</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"replaceable" ( <A HREF="#prod4">class_definition</A> | <A HREF="#prod42">component_clause1</A> ) ( <A HREF="#prod28">constraining_clause</A> )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod42">component_clause1</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod13">type_prefix</A> <A HREF="#prod29">type_specifier</A> <A HREF="#prod43">component_declaration1</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod43">component_declaration1</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod32">declaration</A> <A HREF="#prod11">comment</A></TD>
+</TR>
+ <!-- Special token -->
+ <TR>
+ <TD>
+<PRE>
+/*** Equations *************************************************/</PRE>
+ </TD>
+ </TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod17">equation_section</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "initial" )? "equation" ( <A HREF="#prod44">equation</A> ";" )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod18">algorithm_section</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "initial" )? "algorithm" ( <A HREF="#prod45">statement</A> ";" )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod44">equation</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod46">simple_expression</A> "=" <A HREF="#prod34">expression</A> | <A HREF="#prod47">if_equation</A> | <A HREF="#prod48">for_equation</A> | <A HREF="#prod49">connect_clause</A> | <A HREF="#prod50">when_equation</A> | <IDENT> <A HREF="#prod51">function_call_args</A> ) <A HREF="#prod11">comment</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod45">statement</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod22">component_reference</A> ( ":=" <A HREF="#prod34">expression</A> | <A HREF="#prod51">function_call_args</A> ) | "(" <A HREF="#prod52">output_expression_list</A> ")" ":=" <A HREF="#prod22">component_reference</A> <A HREF="#prod51">function_call_args</A> | "break" | "return" | <A HREF="#prod53">if_statement</A> | <A HREF="#prod54">for_statement</A> | <A HREF="#prod55">while_statement</A> | <A HREF="#prod56">when_statement</A> ) <A HREF="#prod11">comment</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod47">if_equation</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"if" <A HREF="#prod34">expression</A> "then" ( <A HREF="#prod44">equation</A> ";" )* ( "elseif" <A HREF="#prod34">expression</A> "then" ( <A HREF="#prod44">equation</A> ";" )* )* ( "else" ( <A HREF="#prod44">equation</A> ";" )* )? "end" "if"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod53">if_statement</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"if" <A HREF="#prod34">expression</A> "then" ( <A HREF="#prod45">statement</A> ";" )* ( "elseif" <A HREF="#prod34">expression</A> "then" ( <A HREF="#prod45">statement</A> ";" )* )* ( "else" ( <A HREF="#prod45">statement</A> ";" )* )? "end" "if"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod48">for_equation</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"for" <A HREF="#prod57">for_indices</A> "loop" ( <A HREF="#prod44">equation</A> ";" )* "end" "for"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod54">for_statement</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"for" <A HREF="#prod57">for_indices</A> "loop" ( <A HREF="#prod45">statement</A> ";" )* "end" "for"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod57">for_indices</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod58">for_index</A> ( "," <A HREF="#prod58">for_index</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod58">for_index</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><IDENT> ( "in" <A HREF="#prod34">expression</A> )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod55">while_statement</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"while" <A HREF="#prod34">expression</A> "loop" ( <A HREF="#prod45">statement</A> ";" )* "end" "while"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod50">when_equation</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"when" <A HREF="#prod34">expression</A> "then" ( <A HREF="#prod44">equation</A> ";" )* ( "elsewhen" <A HREF="#prod34">expression</A> "then" ( <A HREF="#prod44">equation</A> ";" )* )* "end" "when"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod56">when_statement</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"when" <A HREF="#prod34">expression</A> "then" ( <A HREF="#prod45">statement</A> ";" )* ( "elsewhen" <A HREF="#prod34">expression</A> "then" ( <A HREF="#prod45">statement</A> ";" )* )* "end" "when"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod49">connect_clause</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"connect" "(" <A HREF="#prod22">component_reference</A> "," <A HREF="#prod22">component_reference</A> ")"</TD>
+</TR>
+ <!-- Special token -->
+ <TR>
+ <TD>
+<PRE>
+/*** Expressions ***************************************************/</PRE>
+ </TD>
+ </TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod59">expr</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod46">simple_expression</A> <EOF></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"if" <A HREF="#prod34">expression</A> "then" <A HREF="#prod34">expression</A> ( "elseif" <A HREF="#prod34">expression</A> "then" <A HREF="#prod34">expression</A> )* "else" <A HREF="#prod34">expression</A> <EOF></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod34">expression</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod46">simple_expression</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"if" <A HREF="#prod34">expression</A> "then" <A HREF="#prod34">expression</A> ( "elseif" <A HREF="#prod34">expression</A> "then" <A HREF="#prod34">expression</A> )* "else" <A HREF="#prod34">expression</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod46">simple_expression</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod60">logical_expression</A> ( ":" <A HREF="#prod60">logical_expression</A> ( ":" <A HREF="#prod60">logical_expression</A> )? )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod60">logical_expression</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod61">logical_term</A> ( "or" <A HREF="#prod61">logical_term</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod61">logical_term</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod62">logical_factor</A> ( "and" <A HREF="#prod62">logical_factor</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod62">logical_factor</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "not" )? <A HREF="#prod63">relation</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod63">relation</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod64">arithmetic_expression</A> ( <A HREF="#prod65">rel_op</A> <A HREF="#prod64">arithmetic_expression</A> )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod65">rel_op</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"<"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"<="</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>">"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>">="</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"=="</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"<>"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod64">arithmetic_expression</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod66">add_op</A> )? <A HREF="#prod67">term</A> ( <A HREF="#prod66">add_op</A> <A HREF="#prod67">term</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod66">add_op</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"+"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"-"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>".+"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>".-"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod67">term</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod68">factor</A> ( <A HREF="#prod69">mul_op</A> <A HREF="#prod68">factor</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod69">mul_op</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"*"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"/"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>".*"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"./"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod68">factor</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod70">primary</A> ( "^" | ".^" <A HREF="#prod70">primary</A> )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod70">primary</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><UNSIGNED_NUMBER></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><UNSIGNED_INTEGER></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><STRING></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"false"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"true"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod3">name</A> | "der" | "initial" ) <A HREF="#prod51">function_call_args</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod22">component_reference</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"(" <A HREF="#prod34">expression</A> ")"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"[" <A HREF="#prod23">expression_list</A> ( ";" <A HREF="#prod23">expression_list</A> )* "]"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"{" <A HREF="#prod71">function_arguments</A> "}"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"end"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod3">name</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "." )? <IDENT> ( "." <IDENT> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod22">component_reference</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( "." )? <IDENT> ( <A HREF="#prod9">array_subscripts</A> )? ( "." <IDENT> ( <A HREF="#prod9">array_subscripts</A> )? )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod51">function_call_args</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"(" ( <A HREF="#prod71">function_arguments</A> )? ")"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod71">function_arguments</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod34">expression</A> ( "," <A HREF="#prod71">function_arguments</A> | "for" <A HREF="#prod57">for_indices</A> )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod72">named_arguments</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod72">named_arguments</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod73">named_argument</A> ( "," <A HREF="#prod72">named_arguments</A> )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod73">named_argument</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><IDENT> "=" <A HREF="#prod34">expression</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod52">output_expression_list</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod34">expression</A> )? ( "," ( <A HREF="#prod34">expression</A> )? )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod23">expression_list</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod34">expression</A> ( "," <A HREF="#prod34">expression</A> )*</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod9">array_subscripts</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"[" <A HREF="#prod74">subscript</A> ( "," <A HREF="#prod74">subscript</A> )* "]"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod74">subscript</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>":"</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod34">expression</A></TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod11">comment</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod6">string_comment</A> ( <A HREF="#prod21">annotation</A> )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod6">string_comment</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>( <STRING> ( "+" <STRING> )* )?</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod21">annotation</A></TD>
+<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
+<TD ALIGN=LEFT VALIGN=BASELINE>"annotation" <A HREF="#prod10">class_modification</A></TD>
+</TR>
+</TABLE>
+</BODY>
+</HTML>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+ Copyright (c) 2010 Association for Decentralized Information Management in\r
+ Industry THTH ry.\r
+ All rights reserved. This program and the accompanying materials\r
+ are made available under the terms of the Eclipse Public License v1.0\r
+ which accompanies this distribution, and is available at\r
+ http://www.eclipse.org/legal/epl-v10.html\r
+ \r
+ Contributors:\r
+ VTT Technical Research Centre of Finland - initial API and implementation\r
+ -->\r
+\r
+<adapters> \r
+ <target\r
+ interface="org.simantics.simulation.model.IModel">\r
+ <type\r
+ uri="http://www.simantics.org/Sysdyn-0.0/SysdynModel"\r
+ class="org.simantics.sysdyn.manager.SysdynModel">\r
+ <this />\r
+ </type>\r
+ </target>\r
+ \r
+ <target\r
+ interface="org.simantics.sysdyn.adapter.distribution.IDistribution">\r
+ <type\r
+ uri="http://www.simantics.org/Sysdyn-0.0/NormalDistribution"\r
+ class="org.simantics.sysdyn.adapter.distribution.NormalDistribution">\r
+ <graph/> \r
+ <this />\r
+ </type>\r
+ <type\r
+ uri="http://www.simantics.org/Sysdyn-0.0/UniformDistribution"\r
+ class="org.simantics.sysdyn.adapter.distribution.UniformDistribution">\r
+ <graph/> \r
+ <this />\r
+ </type> \r
+ <type\r
+ uri="http://www.simantics.org/Sysdyn-0.0/Interval"\r
+ class="org.simantics.sysdyn.adapter.distribution.Interval">\r
+ <graph/> \r
+ <this />\r
+ </type>\r
+ </target>\r
+ \r
+ <target\r
+ interface="org.simantics.sysdyn.adapter.generator.IGenerator">\r
+ <type\r
+ uri="http://www.simantics.org/Sysdyn-0.0/RandomGenerator"\r
+ class="org.simantics.sysdyn.adapter.generator.RandomGenerator">\r
+ <graph/> \r
+ <this />\r
+ </type>\r
+ <type\r
+ uri="http://www.simantics.org/Sysdyn-0.0/HaltonSequenceGenerator"\r
+ class="org.simantics.sysdyn.adapter.generator.HaltonSequenceGenerator">\r
+ <graph/> \r
+ <this />\r
+ </type>\r
+ </target>\r
+ \r
+ <target\r
+ interface="org.simantics.sysdyn.adapter.SensitivityExperimentParameter">\r
+ <type\r
+ uri="http://www.simantics.org/Sysdyn-0.0/SensitivityAnalysisExperiment/Parameter"\r
+ class="org.simantics.sysdyn.adapter.SensitivityExperimentParameter">\r
+ <graph/> \r
+ <this />\r
+ </type>\r
+ </target> \r
+ \r
+<!-- <target interface="org.simantics.db.layer0.variable.Variable">\r
+ <type uri="http://www.simantics.org/Sysdyn-0.0/Configuration"\r
+ class="org.simantics.sysdyn.adapter.ConfigurationVariable" >\r
+ <this />\r
+ </type>\r
+ <type uri="http://www.simantics.org/Simulation-0.0/Run"\r
+ class="org.simantics.sysdyn.adapter.RunVariable" >\r
+ <this />\r
+ </type>\r
+ </target>-->\r
+ \r
+ <!-- \r
+ <target interface="org.simantics.db.layer0.variable.Variable">\r
+\r
+ <adapter uri="http://www.simantics.org/Sysdyn-0.0/Configuration"\r
+ contextClass="org.simantics.db.layer0.variable.Variable"\r
+ adapterClass="org.simantics.sysdyn.adapter.ConfigurationVariableAdapter"/>\r
+ <adapter uri="http://www.simantics.org/Sysdyn-0.0/Variable"\r
+ contextClass="org.simantics.db.layer0.variable.Variable"\r
+ adapterClass="org.simantics.sysdyn.adapter.ChildVariableAdapter"/>\r
+ <adapter uri="http://www.simantics.org/Sysdyn-0.0/Module"\r
+ contextClass="org.simantics.db.layer0.variable.Variable"\r
+ adapterClass="org.simantics.sysdyn.adapter.ChildVariableAdapter"/>\r
+ <adapter uri="http://www.simantics.org/Simulation-0.0/Run"\r
+ contextClass="org.simantics.db.layer0.variable.Variable"\r
+ adapterClass="org.simantics.sysdyn.adapter.RunVariableAdapter"/>\r
+ </target>\r
+ -->\r
+\r
+ <target\r
+ interface="org.simantics.db.layer0.migration.MigrationStep">\r
+ <resource\r
+ uri="http://www.simantics.org/Sysdyn-0.0/Migration/from1.6to1.7/Custom"\r
+ class="org.simantics.sysdyn.adapter.CustomMigrationStep">\r
+ </resource>\r
+ </target>\r
+ \r
+</adapters>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified" \r
+ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"\r
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"\r
+ xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"\r
+ targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL">\r
+\r
+ <xsd:import namespace="http://www.omg.org/spec/BPMN/20100524/DI" schemaLocation="BPMNDI.xsd"/>\r
+ <xsd:include schemaLocation="Semantic.xsd"/>\r
+\r
+ <xsd:element name="definitions" type="tDefinitions"/>\r
+ <xsd:complexType name="tDefinitions">\r
+ <xsd:sequence>\r
+ <xsd:element ref="import" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="rootElement" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="bpmndi:BPMNDiagram" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="relationship" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="id" type="xsd:ID" use="optional"/>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="targetNamespace" type="xsd:anyURI" use="required"/>\r
+ <xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional" default="http://www.w3.org/1999/XPath"/>\r
+ <xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional" default="http://www.w3.org/2001/XMLSchema"/>\r
+ <xsd:attribute name="exporter" type="xsd:string"/>\r
+ <xsd:attribute name="exporterVersion" type="xsd:string"/>\r
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="import" type="tImport"/>\r
+ <xsd:complexType name="tImport">\r
+ <xsd:attribute name="namespace" type="xsd:anyURI" use="required"/>\r
+ <xsd:attribute name="location" type="xsd:string" use="required"/>\r
+ <xsd:attribute name="importType" type="xsd:anyURI" use="required"/>\r
+ </xsd:complexType>\r
+\r
+</xsd:schema>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://www.omg.org/spec/BPMN/20100524/DI" elementFormDefault="qualified" attributeFormDefault="unqualified">\r
+\r
+ <xsd:import namespace="http://www.omg.org/spec/DD/20100524/DC" schemaLocation="DC.xsd" />\r
+ <xsd:import namespace="http://www.omg.org/spec/DD/20100524/DI" schemaLocation="DI.xsd" />\r
+ \r
+ <xsd:element name="BPMNDiagram" type="bpmndi:BPMNDiagram" />\r
+ <xsd:element name="BPMNPlane" type="bpmndi:BPMNPlane" />\r
+ <xsd:element name="BPMNLabelStyle" type="bpmndi:BPMNLabelStyle" />\r
+ <xsd:element name="BPMNShape" type="bpmndi:BPMNShape" substitutionGroup="di:DiagramElement" />\r
+ <xsd:element name="BPMNLabel" type="bpmndi:BPMNLabel" />\r
+ <xsd:element name="BPMNEdge" type="bpmndi:BPMNEdge" substitutionGroup="di:DiagramElement" />\r
+ \r
+ <xsd:complexType name="BPMNDiagram">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:Diagram">\r
+ <xsd:sequence>\r
+ <xsd:element ref="bpmndi:BPMNPlane" />\r
+ <xsd:element ref="bpmndi:BPMNLabelStyle" maxOccurs="unbounded" minOccurs="0" />\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType name="BPMNPlane">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:Plane">\r
+ <xsd:attribute name="bpmnElement" type="xsd:QName" />\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType name="BPMNEdge">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:LabeledEdge">\r
+ <xsd:sequence>\r
+ <xsd:element ref="bpmndi:BPMNLabel" minOccurs="0" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="bpmnElement" type="xsd:QName" />\r
+ <xsd:attribute name="sourceElement" type="xsd:QName" />\r
+ <xsd:attribute name="targetElement" type="xsd:QName" />\r
+ <xsd:attribute name="messageVisibleKind" type="bpmndi:MessageVisibleKind" />\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType name="BPMNShape">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:LabeledShape">\r
+ <xsd:sequence>\r
+ <xsd:element ref="bpmndi:BPMNLabel" minOccurs="0" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="bpmnElement" type="xsd:QName" />\r
+ <xsd:attribute name="isHorizontal" type="xsd:boolean" />\r
+ <xsd:attribute name="isExpanded" type="xsd:boolean" />\r
+ <xsd:attribute name="isMarkerVisible" type="xsd:boolean" />\r
+ <xsd:attribute name="isMessageVisible" type="xsd:boolean" />\r
+ <xsd:attribute name="participantBandKind" type="bpmndi:ParticipantBandKind" />\r
+ <xsd:attribute name="choreographyActivityShape" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType name="BPMNLabel">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:Label">\r
+ <xsd:attribute name="labelStyle" type="xsd:QName" />\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType name="BPMNLabelStyle">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:Style">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dc:Font" />\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:simpleType name="ParticipantBandKind">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="top_initiating" />\r
+ <xsd:enumeration value="middle_initiating" />\r
+ <xsd:enumeration value="bottom_initiating" />\r
+ <xsd:enumeration value="top_non_initiating" />\r
+ <xsd:enumeration value="middle_non_initiating" />\r
+ <xsd:enumeration value="bottom_non_initiating" />\r
+ </xsd:restriction>\r
+ </xsd:simpleType>\r
+ \r
+ <xsd:simpleType name="MessageVisibleKind">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="initiating" />\r
+ <xsd:enumeration value="non_initiating" />\r
+ </xsd:restriction>\r
+ </xsd:simpleType>\r
+\r
+</xsd:schema>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://www.omg.org/spec/DD/20100524/DC" elementFormDefault="qualified" attributeFormDefault="unqualified">\r
+\r
+ <xsd:element name="Font" type="dc:Font" />\r
+ <xsd:element name="Point" type="dc:Point" />\r
+ <xsd:element name="Bounds" type="dc:Bounds" />\r
+ \r
+ <xsd:complexType name="Font">\r
+ <xsd:attribute name="name" type="xsd:string" />\r
+ <xsd:attribute name="size" type="xsd:double" />\r
+ <xsd:attribute name="isBold" type="xsd:boolean" />\r
+ <xsd:attribute name="isItalic" type="xsd:boolean" />\r
+ <xsd:attribute name="isUnderline" type="xsd:boolean" />\r
+ <xsd:attribute name="isStrikeThrough" type="xsd:boolean" />\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType name="Point">\r
+ <xsd:attribute name="x" type="xsd:double" use="required" />\r
+ <xsd:attribute name="y" type="xsd:double" use="required" />\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType name="Bounds">\r
+ <xsd:attribute name="x" type="xsd:double" use="required" />\r
+ <xsd:attribute name="y" type="xsd:double" use="required" />\r
+ <xsd:attribute name="width" type="xsd:double" use="required" />\r
+ <xsd:attribute name="height" type="xsd:double" use="required" />\r
+ </xsd:complexType>\r
+\r
+</xsd:schema>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://www.omg.org/spec/DD/20100524/DI" elementFormDefault="qualified" attributeFormDefault="unqualified">\r
+\r
+ <xsd:import namespace="http://www.omg.org/spec/DD/20100524/DC" schemaLocation="DC.xsd" />\r
+ \r
+ <xsd:element name="DiagramElement" type="di:DiagramElement" />\r
+ <xsd:element name="Diagram" type="di:Diagram" />\r
+ <xsd:element name="Style" type="di:Style" />\r
+ <xsd:element name="Node" type="di:Node" />\r
+ <xsd:element name="Edge" type="di:Edge" />\r
+ <xsd:element name="Shape" type="di:Shape" />\r
+ <xsd:element name="Plane" type="di:Plane" />\r
+ <xsd:element name="LabeledEdge" type="di:LabeledEdge" />\r
+ <xsd:element name="Label" type="di:Label" />\r
+ <xsd:element name="LabeledShape" type="di:LabeledShape" />\r
+ \r
+ <xsd:complexType abstract="true" name="DiagramElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="extension" minOccurs="0">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" />\r
+ </xsd:sequence>\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="id" type="xsd:ID" />\r
+ <xsd:anyAttribute namespace="##other" processContents="lax" />\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType abstract="true" name="Diagram">\r
+ <xsd:attribute name="name" type="xsd:string" />\r
+ <xsd:attribute name="documentation" type="xsd:string" />\r
+ <xsd:attribute name="resolution" type="xsd:double" />\r
+ <xsd:attribute name="id" type="xsd:ID" />\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType abstract="true" name="Node">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:DiagramElement" />\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType abstract="true" name="Edge">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:DiagramElement">\r
+ <xsd:sequence>\r
+ <xsd:element maxOccurs="unbounded" minOccurs="2" name="waypoint" type="dc:Point" />\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType abstract="true" name="LabeledEdge">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:Edge" />\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType abstract="true" name="Shape">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:Node">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dc:Bounds" />\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType abstract="true" name="LabeledShape">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:Shape" />\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType abstract="true" name="Label">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:Node">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dc:Bounds" minOccurs="0" />\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType abstract="true" name="Plane">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="di:Node">\r
+ <xsd:sequence>\r
+ <xsd:element ref="di:DiagramElement" maxOccurs="unbounded" minOccurs="0" />\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:complexType abstract="true" name="Style">\r
+ <xsd:attribute name="id" type="xsd:ID" />\r
+ </xsd:complexType>\r
+ \r
+</xsd:schema>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"\r
+ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" \r
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" \r
+ targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL">\r
+ \r
+ <xsd:element name="activity" type="tActivity"/>\r
+ <xsd:complexType name="tActivity" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tFlowNode">\r
+ <xsd:sequence>\r
+ <xsd:element ref="ioSpecification" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="dataInputAssociation" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="dataOutputAssociation" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="loopCharacteristics" minOccurs="0"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="isForCompensation" type="xsd:boolean" default="false"/>\r
+ <xsd:attribute name="startQuantity" type="xsd:integer" default="1"/>\r
+ <xsd:attribute name="completionQuantity" type="xsd:integer" default="1"/>\r
+ <xsd:attribute name="default" type="xsd:IDREF" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="adHocSubProcess" type="tAdHocSubProcess" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tAdHocSubProcess">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tSubProcess">\r
+ <xsd:sequence>\r
+ <xsd:element name="completionCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="cancelRemainingInstances" type="xsd:boolean" default="true"/>\r
+ <xsd:attribute name="ordering" type="tAdHocOrdering"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:simpleType name="tAdHocOrdering">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="Parallel"/>\r
+ <xsd:enumeration value="Sequential"/>\r
+ </xsd:restriction>\r
+ </xsd:simpleType> \r
+\r
+ <xsd:element name="artifact" type="tArtifact"/>\r
+ <xsd:complexType name="tArtifact" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="assignment" type="tAssignment" />\r
+ <xsd:complexType name="tAssignment">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="from" type="tExpression" minOccurs="1" maxOccurs="1"/>\r
+ <xsd:element name="to" type="tExpression" minOccurs="1" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="association" type="tAssociation" substitutionGroup="artifact"/>\r
+ <xsd:complexType name="tAssociation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tArtifact">\r
+ <xsd:attribute name="sourceRef" type="xsd:QName" use="required"/>\r
+ <xsd:attribute name="targetRef" type="xsd:QName" use="required"/>\r
+ <xsd:attribute name="associationDirection" type="tAssociationDirection" default="None"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:simpleType name="tAssociationDirection">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="None"/>\r
+ <xsd:enumeration value="One"/>\r
+ <xsd:enumeration value="Both"/>\r
+ </xsd:restriction>\r
+ </xsd:simpleType>\r
+\r
+ <xsd:element name="auditing" type="tAuditing"/>\r
+ <xsd:complexType name="tAuditing">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="baseElement" type="tBaseElement"/>\r
+ <xsd:complexType name="tBaseElement" abstract="true">\r
+ <xsd:sequence>\r
+ <xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="extensionElements" minOccurs="0" maxOccurs="1" /> \r
+ </xsd:sequence>\r
+ <xsd:attribute name="id" type="xsd:ID" use="optional"/>\r
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="baseElementWithMixedContent" type="tBaseElementWithMixedContent"/>\r
+ <xsd:complexType name="tBaseElementWithMixedContent" abstract="true" mixed="true">\r
+ <xsd:sequence>\r
+ <xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="extensionElements" minOccurs="0" maxOccurs="1" /> \r
+ </xsd:sequence>\r
+ <xsd:attribute name="id" type="xsd:ID" use="optional"/>\r
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="boundaryEvent" type="tBoundaryEvent" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tBoundaryEvent">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tCatchEvent">\r
+ <xsd:attribute name="cancelActivity" type="xsd:boolean" default="true"/>\r
+ <xsd:attribute name="attachedToRef" type="xsd:QName" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="businessRuleTask" type="tBusinessRuleTask" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tBusinessRuleTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tTask">\r
+ <xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="callableElement" type="tCallableElement"/>\r
+ <xsd:complexType name="tCallableElement">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="supportedInterfaceRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="ioSpecification" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element ref="ioBinding" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="callActivity" type="tCallActivity" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tCallActivity">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tActivity">\r
+ <xsd:attribute name="calledElement" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="callChoreography" type="tCallChoreography" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tCallChoreography">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tChoreographyActivity">\r
+ <xsd:sequence>\r
+ <xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="calledChoreographyRef" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="callConversation" type="tCallConversation" substitutionGroup="conversationNode"/>\r
+ <xsd:complexType name="tCallConversation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tConversationNode">\r
+ <xsd:sequence>\r
+ <xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="calledCollaborationRef" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="cancelEventDefinition" type="tCancelEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tCancelEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="catchEvent" type="tCatchEvent"/>\r
+ <xsd:complexType name="tCatchEvent" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEvent">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataOutput" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="dataOutputAssociation" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="outputSet" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element ref="eventDefinition" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="eventDefinitionRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="parallelMultiple" type="xsd:boolean" default="false"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="category" type="tCategory" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tCategory">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="categoryValue" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="categoryValue" type="tCategoryValue"/>\r
+ <xsd:complexType name="tCategoryValue">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:attribute name="value" type="xsd:string" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="choreography" type="tChoreography" substitutionGroup="collaboration"/>\r
+ <xsd:complexType name="tChoreography">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tCollaboration">\r
+ <xsd:sequence>\r
+ <xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="choreographyActivity" type="tChoreographyActivity"/>\r
+ <xsd:complexType name="tChoreographyActivity" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tFlowNode">\r
+ <xsd:sequence>\r
+ <xsd:element name="participantRef" type="xsd:QName" minOccurs="2" maxOccurs="unbounded"/>\r
+ <xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="initiatingParticipantRef" type="xsd:QName" use="required"/>\r
+ <xsd:attribute name="loopType" type="tChoreographyLoopType" default="None"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:simpleType name="tChoreographyLoopType">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="None"/>\r
+ <xsd:enumeration value="Standard"/>\r
+ <xsd:enumeration value="MultiInstanceSequential"/>\r
+ <xsd:enumeration value="MultiInstanceParallel"/>\r
+ </xsd:restriction>\r
+ </xsd:simpleType> \r
+ \r
+ <xsd:element name="choreographyTask" type="tChoreographyTask" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tChoreographyTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tChoreographyActivity">\r
+ <xsd:sequence>\r
+ <xsd:element name="messageFlowRef" type="xsd:QName" minOccurs="1" maxOccurs="2"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="collaboration" type="tCollaboration" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tCollaboration">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="participant" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="messageFlow" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="conversationNode" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="conversationAssociation" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="participantAssociation" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="messageFlowAssociation" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="choreographyRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="conversationLink" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="isClosed" type="xsd:boolean" default="false"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="compensateEventDefinition" type="tCompensateEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tCompensateEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition">\r
+ <xsd:attribute name="waitForCompletion" type="xsd:boolean"/>\r
+ <xsd:attribute name="activityRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="complexBehaviorDefinition" type="tComplexBehaviorDefinition"/>\r
+ <xsd:complexType name="tComplexBehaviorDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="condition" type="tFormalExpression" minOccurs="1" maxOccurs="1"/>\r
+ <xsd:element name="event" type="tImplicitThrowEvent" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="complexGateway" type="tComplexGateway" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tComplexGateway">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tGateway">\r
+ <xsd:sequence>\r
+ <xsd:element name="activationCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="default" type="xsd:IDREF"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="conditionalEventDefinition" type="tConditionalEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tConditionalEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition">\r
+ <xsd:sequence>\r
+ <xsd:element name="condition" type="tExpression"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="conversation" type="tConversation" substitutionGroup="conversationNode"/>\r
+ <xsd:complexType name="tConversation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tConversationNode"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="conversationAssociation" type="tConversationAssociation"/>\r
+ <xsd:complexType name="tConversationAssociation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:attribute name="innerConversationNodeRef" type="xsd:QName" use="required"/>\r
+ <xsd:attribute name="outerConversationNodeRef" type="xsd:QName" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="conversationLink" type="tConversationLink"/> \r
+ <xsd:complexType name="tConversationLink"> \r
+ <xsd:complexContent> \r
+ <xsd:extension base="tBaseElement"> \r
+ <xsd:attribute name="name" type="xsd:string" use="optional"/> \r
+ <xsd:attribute name="sourceRef" type="xsd:QName" use="required"/> \r
+ <xsd:attribute name="targetRef" type="xsd:QName" use="required"/> \r
+ </xsd:extension> \r
+ </xsd:complexContent> \r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="conversationNode" type="tConversationNode"/>\r
+ <xsd:complexType name="tConversationNode" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="participantRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="messageFlowRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="correlationKey" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="correlationKey" type="tCorrelationKey"/>\r
+ <xsd:complexType name="tCorrelationKey">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="correlationPropertyRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="correlationProperty" type="tCorrelationProperty" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tCorrelationProperty">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="correlationPropertyRetrievalExpression" minOccurs="1" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="optional"/>\r
+ <xsd:attribute name="type" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="correlationPropertyBinding" type="tCorrelationPropertyBinding"/>\r
+ <xsd:complexType name="tCorrelationPropertyBinding">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="dataPath" type="tFormalExpression" minOccurs="1" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="correlationPropertyRef" type="xsd:QName" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="correlationPropertyRetrievalExpression" type="tCorrelationPropertyRetrievalExpression"/>\r
+ <xsd:complexType name="tCorrelationPropertyRetrievalExpression">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="messagePath" type="tFormalExpression" minOccurs="1" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="messageRef" type="xsd:QName" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="correlationSubscription" type="tCorrelationSubscription"/>\r
+ <xsd:complexType name="tCorrelationSubscription">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="correlationPropertyBinding" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="correlationKeyRef" type="xsd:QName" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="dataAssociation" type="tDataAssociation" />\r
+ <xsd:complexType name="tDataAssociation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="sourceRef" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="targetRef" type="xsd:IDREF" minOccurs="1" maxOccurs="1"/>\r
+ <xsd:element name="transformation" type="tFormalExpression" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element ref="assignment" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="dataInput" type="tDataInput" />\r
+ <xsd:complexType name="tDataInput">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="optional"/>\r
+ <xsd:attribute name="itemSubjectRef" type="xsd:QName" />\r
+ <xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="dataInputAssociation" type="tDataInputAssociation" />\r
+ <xsd:complexType name="tDataInputAssociation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tDataAssociation"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="dataObject" type="tDataObject" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tDataObject">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tFlowElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="itemSubjectRef" type="xsd:QName"/>\r
+ <xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="dataObjectReference" type="tDataObjectReference" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tDataObjectReference">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tFlowElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="itemSubjectRef" type="xsd:QName"/>\r
+ <xsd:attribute name="dataObjectRef" type="xsd:IDREF"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="dataOutput" type="tDataOutput" />\r
+ <xsd:complexType name="tDataOutput">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="optional" />\r
+ <xsd:attribute name="itemSubjectRef" type="xsd:QName"/>\r
+ <xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="dataOutputAssociation" type="tDataOutputAssociation" />\r
+ <xsd:complexType name="tDataOutputAssociation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tDataAssociation"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="dataState" type="tDataState" />\r
+ <xsd:complexType name="tDataState">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="dataStore" type="tDataStore" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tDataStore">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="capacity" type="xsd:integer"/>\r
+ <xsd:attribute name="isUnlimited" type="xsd:boolean" default="true"/>\r
+ <xsd:attribute name="itemSubjectRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="dataStoreReference" type="tDataStoreReference" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tDataStoreReference">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tFlowElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="itemSubjectRef" type="xsd:QName"/>\r
+ <xsd:attribute name="dataStoreRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="documentation" type="tDocumentation"/>\r
+ <xsd:complexType name="tDocumentation" mixed="true">\r
+ <xsd:sequence>\r
+ <xsd:any namespace="##any" processContents="lax" minOccurs="0"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="id" type="xsd:ID" use="optional"/>\r
+ <xsd:attribute name="textFormat" type="xsd:string" default="text/plain"/>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="endEvent" type="tEndEvent" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tEndEvent">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tThrowEvent"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="endPoint" type="tEndPoint" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tEndPoint">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="error" type="tError" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tError">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="errorCode" type="xsd:string"/>\r
+ <xsd:attribute name="structureRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="errorEventDefinition" type="tErrorEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tErrorEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition">\r
+ <xsd:attribute name="errorRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="escalation" type="tEscalation" substitutionGroup="rootElement"/> \r
+ <xsd:complexType name="tEscalation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="escalationCode" type="xsd:string"/>\r
+ <xsd:attribute name="structureRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="escalationEventDefinition" type="tEscalationEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tEscalationEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition">\r
+ <xsd:attribute name="escalationRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="event" type="tEvent" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tEvent" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tFlowNode">\r
+ <xsd:sequence>\r
+ <xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="eventBasedGateway" type="tEventBasedGateway" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tEventBasedGateway">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tGateway">\r
+ <xsd:attribute name="instantiate" type="xsd:boolean" default="false"/>\r
+ <xsd:attribute name="eventGatewayType" type="tEventBasedGatewayType" default="Exclusive"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:simpleType name="tEventBasedGatewayType">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="Exclusive"/>\r
+ <xsd:enumeration value="Parallel"/>\r
+ </xsd:restriction>\r
+ </xsd:simpleType> \r
+\r
+ <xsd:element name="eventDefinition" type="tEventDefinition" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tEventDefinition" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="exclusiveGateway" type="tExclusiveGateway" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tExclusiveGateway">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tGateway">\r
+ <xsd:attribute name="default" type="xsd:IDREF" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="expression" type="tExpression"/>\r
+ <xsd:complexType name="tExpression">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElementWithMixedContent"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="extension" type="tExtension"/>\r
+ <xsd:complexType name="tExtension">\r
+ <xsd:sequence>\r
+ <xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="definition" type="xsd:QName"/>\r
+ <xsd:attribute name="mustUnderstand" type="xsd:boolean" use="optional" default="false"/>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="extensionElements" type="tExtensionElements" /> \r
+ <xsd:complexType name="tExtensionElements">\r
+ <xsd:sequence>\r
+ <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" /> \r
+ </xsd:sequence>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="flowElement" type="tFlowElement"/>\r
+ <xsd:complexType name="tFlowElement" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="auditing" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element ref="monitoring" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element name="categoryValueRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="flowNode" type="tFlowNode"/>\r
+ <xsd:complexType name="tFlowNode" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tFlowElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="incoming" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="outgoing" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="formalExpression" type="tFormalExpression" substitutionGroup="expression"/>\r
+ <xsd:complexType name="tFormalExpression">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tExpression">\r
+ <xsd:attribute name="language" type="xsd:anyURI" use="optional"/>\r
+ <xsd:attribute name="evaluatesToTypeRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="gateway" type="tGateway" abstract="true"/>\r
+ <xsd:complexType name="tGateway">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tFlowNode">\r
+ <xsd:attribute name="gatewayDirection" type="tGatewayDirection" default="Unspecified"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:simpleType name="tGatewayDirection">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="Unspecified"/>\r
+ <xsd:enumeration value="Converging"/>\r
+ <xsd:enumeration value="Diverging"/>\r
+ <xsd:enumeration value="Mixed"/>\r
+ </xsd:restriction>\r
+ </xsd:simpleType> \r
+ \r
+ <xsd:element name="globalBusinessRuleTask" type="tGlobalBusinessRuleTask" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tGlobalBusinessRuleTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tGlobalTask">\r
+ <xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="globalChoreographyTask" type="tGlobalChoreographyTask" substitutionGroup="choreography"/>\r
+ <xsd:complexType name="tGlobalChoreographyTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tChoreography">\r
+ <xsd:attribute name="initiatingParticipantRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ <xsd:element name="globalConversation" type="tGlobalConversation" substitutionGroup="collaboration"/>\r
+ <xsd:complexType name="tGlobalConversation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tCollaboration"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="globalManualTask" type="tGlobalManualTask" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tGlobalManualTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tGlobalTask"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="globalScriptTask" type="tGlobalScriptTask" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tGlobalScriptTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tGlobalTask">\r
+ <xsd:sequence>\r
+ <xsd:element ref="script" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="scriptLanguage" type="xsd:anyURI"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="globalTask" type="tGlobalTask" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tGlobalTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tCallableElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="globalUserTask" type="tGlobalUserTask" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tGlobalUserTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tGlobalTask">\r
+ <xsd:sequence>\r
+ <xsd:element ref="rendering" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="group" type="tGroup" substitutionGroup="artifact"/>\r
+ <xsd:complexType name="tGroup">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tArtifact">\r
+ <xsd:attribute name="categoryValueRef" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="humanPerformer" type="tHumanPerformer" substitutionGroup="performer"/>\r
+ <xsd:complexType name="tHumanPerformer">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tPerformer"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:simpleType name="tImplementation">\r
+ <xsd:union memberTypes="xsd:anyURI">\r
+ <xsd:simpleType>\r
+ <xsd:restriction base="xsd:token">\r
+ <xsd:enumeration value="##unspecified" /> \r
+ <xsd:enumeration value="##WebService" />\r
+ </xsd:restriction>\r
+ </xsd:simpleType>\r
+ </xsd:union>\r
+ </xsd:simpleType>\r
+\r
+ <xsd:element name="implicitThrowEvent" type="tImplicitThrowEvent" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tImplicitThrowEvent">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tThrowEvent"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="inclusiveGateway" type="tInclusiveGateway" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tInclusiveGateway">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tGateway">\r
+ <xsd:attribute name="default" type="xsd:IDREF" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="inputSet" type="tInputSet" />\r
+ <xsd:complexType name="tInputSet">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="dataInputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="optionalInputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="whileExecutingInputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="outputSetRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" />\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="interface" type="tInterface" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tInterface">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="operation" minOccurs="1" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required"/>\r
+ <xsd:attribute name="implementationRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="intermediateCatchEvent" type="tIntermediateCatchEvent" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tIntermediateCatchEvent">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tCatchEvent"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="intermediateThrowEvent" type="tIntermediateThrowEvent" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tIntermediateThrowEvent">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tThrowEvent"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="ioBinding" type="tInputOutputBinding" />\r
+ <xsd:complexType name="tInputOutputBinding">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:attribute name="operationRef" type="xsd:QName" use="required"/>\r
+ <xsd:attribute name="inputDataRef" type="xsd:IDREF" use="required"/>\r
+ <xsd:attribute name="outputDataRef" type="xsd:IDREF" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="ioSpecification" type="tInputOutputSpecification" />\r
+ <xsd:complexType name="tInputOutputSpecification">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataInput" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="dataOutput" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="inputSet" minOccurs="1" maxOccurs="unbounded"/>\r
+ <xsd:element ref="outputSet" minOccurs="1" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="itemDefinition" type="tItemDefinition" substitutionGroup="rootElement"/> \r
+ <xsd:complexType name="tItemDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:attribute name="structureRef" type="xsd:QName"/>\r
+ <xsd:attribute name="isCollection" type="xsd:boolean" default="false"/>\r
+ <xsd:attribute name="itemKind" type="tItemKind" default="Information"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:simpleType name="tItemKind">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="Information"/>\r
+ <xsd:enumeration value="Physical"/>\r
+ </xsd:restriction>\r
+ </xsd:simpleType>\r
+\r
+ <xsd:element name="lane" type="tLane"/>\r
+ <xsd:complexType name="tLane">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="partitionElement" type="tBaseElement" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element name="flowNodeRef" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="childLaneSet" type="tLaneSet" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="partitionElementRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="laneSet" type="tLaneSet"/>\r
+ <xsd:complexType name="tLaneSet">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="lane" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="linkEventDefinition" type="tLinkEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tLinkEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition">\r
+ <xsd:sequence>\r
+ <xsd:element name="source" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="target" type="xsd:QName" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="loopCharacteristics" type="tLoopCharacteristics"/>\r
+ <xsd:complexType name="tLoopCharacteristics" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="manualTask" type="tManualTask" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tManualTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tTask"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="message" type="tMessage" substitutionGroup="rootElement"/> \r
+ <xsd:complexType name="tMessage">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="itemRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="messageEventDefinition" type="tMessageEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tMessageEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition">\r
+ <xsd:sequence>\r
+ <xsd:element name="operationRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="messageRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="messageFlow" type="tMessageFlow"/>\r
+ <xsd:complexType name="tMessageFlow">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:attribute name="name" type="xsd:string" use="optional"/>\r
+ <xsd:attribute name="sourceRef" type="xsd:QName" use="required"/>\r
+ <xsd:attribute name="targetRef" type="xsd:QName" use="required"/>\r
+ <xsd:attribute name="messageRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="messageFlowAssociation" type="tMessageFlowAssociation"/>\r
+ <xsd:complexType name="tMessageFlowAssociation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:attribute name="innerMessageFlowRef" type="xsd:QName" use="required"/>\r
+ <xsd:attribute name="outerMessageFlowRef" type="xsd:QName" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="monitoring" type="tMonitoring"/>\r
+ <xsd:complexType name="tMonitoring">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="multiInstanceLoopCharacteristics" type="tMultiInstanceLoopCharacteristics" substitutionGroup="loopCharacteristics"/>\r
+ <xsd:complexType name="tMultiInstanceLoopCharacteristics">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tLoopCharacteristics">\r
+ <xsd:sequence>\r
+ <xsd:element name="loopCardinality" type="tExpression" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element name="loopDataInputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element name="loopDataOutputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element name="inputDataItem" type="tDataInput" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element name="outputDataItem" type="tDataOutput" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element ref="complexBehaviorDefinition" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="completionCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="isSequential" type="xsd:boolean" default="false"/>\r
+ <xsd:attribute name="behavior" type="tMultiInstanceFlowCondition" default="All"/>\r
+ <xsd:attribute name="oneBehaviorEventRef" type="xsd:QName" use="optional"/>\r
+ <xsd:attribute name="noneBehaviorEventRef" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:simpleType name="tMultiInstanceFlowCondition">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="None"/>\r
+ <xsd:enumeration value="One"/>\r
+ <xsd:enumeration value="All"/>\r
+ <xsd:enumeration value="Complex"/>\r
+ </xsd:restriction>\r
+ </xsd:simpleType>\r
+ \r
+ <xsd:element name="operation" type="tOperation"/>\r
+ <xsd:complexType name="tOperation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="inMessageRef" type="xsd:QName" minOccurs="1" maxOccurs="1"/>\r
+ <xsd:element name="outMessageRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element name="errorRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required"/>\r
+ <xsd:attribute name="implementationRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="outputSet" type="tOutputSet" />\r
+ <xsd:complexType name="tOutputSet">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="dataOutputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="optionalOutputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="whileExecutingOutputRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="inputSetRefs" type="xsd:IDREF" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="parallelGateway" type="tParallelGateway" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tParallelGateway">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tGateway"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="participant" type="tParticipant"/>\r
+ <xsd:complexType name="tParticipant">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="interfaceRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="endPointRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="participantMultiplicity" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="processRef" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="participantAssociation" type="tParticipantAssociation"/>\r
+ <xsd:complexType name="tParticipantAssociation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="innerParticipantRef" type="xsd:QName" minOccurs="1" maxOccurs="1"/>\r
+ <xsd:element name="outerParticipantRef" type="xsd:QName" minOccurs="1" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="participantMultiplicity" type="tParticipantMultiplicity"/>\r
+ <xsd:complexType name="tParticipantMultiplicity">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:attribute name="minimum" type="xsd:int" default="0"/>\r
+ <xsd:attribute name="maximum" type="xsd:int" default="1"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="partnerEntity" type="tPartnerEntity" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tPartnerEntity">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="participantRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="partnerRole" type="tPartnerRole" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tPartnerRole">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="participantRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="performer" type="tPerformer" substitutionGroup="resourceRole"/>\r
+ <xsd:complexType name="tPerformer">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tResourceRole"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="potentialOwner" type="tPotentialOwner" substitutionGroup="performer"/>\r
+ <xsd:complexType name="tPotentialOwner">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tHumanPerformer"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="process" type="tProcess" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tProcess">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tCallableElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="auditing" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element ref="monitoring" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="laneSet" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="resourceRole" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="correlationSubscription" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="supports" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="processType" type="tProcessType" default="None"/>\r
+ <xsd:attribute name="isClosed" type="xsd:boolean" default="false"/>\r
+ <xsd:attribute name="isExecutable" type="xsd:boolean"/>\r
+ <xsd:attribute name="definitionalCollaborationRef" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:simpleType name="tProcessType">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="None"/>\r
+ <xsd:enumeration value="Public"/>\r
+ <xsd:enumeration value="Private"/>\r
+ </xsd:restriction>\r
+ </xsd:simpleType>\r
+\r
+ <xsd:element name="property" type="tProperty" />\r
+ <xsd:complexType name="tProperty">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataState" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="itemSubjectRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="receiveTask" type="tReceiveTask" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tReceiveTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tTask">\r
+ <xsd:attribute name="implementation" type="tImplementation" default="##WebService"/>\r
+ <xsd:attribute name="instantiate" type="xsd:boolean" default="false"/>\r
+ <xsd:attribute name="messageRef" type="xsd:QName" use="optional"/>\r
+ <xsd:attribute name="operationRef" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="relationship" type="tRelationship"/>\r
+ <xsd:complexType name="tRelationship">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="source" type="xsd:QName" minOccurs="1" maxOccurs="unbounded"/>\r
+ <xsd:element name="target" type="xsd:QName" minOccurs="1" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="type" type="xsd:string" use="required"/>\r
+ <xsd:attribute name="direction" type="tRelationshipDirection"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:simpleType name="tRelationshipDirection">\r
+ <xsd:restriction base="xsd:string">\r
+ <xsd:enumeration value="None"/>\r
+ <xsd:enumeration value="Forward"/>\r
+ <xsd:enumeration value="Backward"/>\r
+ <xsd:enumeration value="Both"/>\r
+ </xsd:restriction>\r
+ </xsd:simpleType>\r
+ \r
+ <xsd:element name="rendering" type="tRendering"/>\r
+ <xsd:complexType name="tRendering">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="resource" type="tResource" substitutionGroup="rootElement"/>\r
+ <xsd:complexType name="tResource">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="resourceParameter" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="resourceAssignmentExpression" type="tResourceAssignmentExpression"/>\r
+ <xsd:complexType name="tResourceAssignmentExpression">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="expression" minOccurs="1" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="resourceParameter" type="tResourceParameter"/>\r
+ <xsd:complexType name="tResourceParameter">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="type" type="xsd:QName"/>\r
+ <xsd:attribute name="isRequired" type="xsd:boolean"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="resourceParameterBinding" type="tResourceParameterBinding"/>\r
+ <xsd:complexType name="tResourceParameterBinding">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement">\r
+ <xsd:sequence>\r
+ <xsd:element ref="expression" minOccurs="1" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="parameterRef" type="xsd:QName" use="required"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="resourceRole" type="tResourceRole"/>\r
+ <xsd:complexType name="tResourceRole"> \r
+ <xsd:complexContent> \r
+ <xsd:extension base="tBaseElement"> \r
+ <xsd:choice> \r
+ <xsd:sequence> \r
+ <xsd:element name="resourceRef" type="xsd:QName"/> \r
+ <xsd:element ref="resourceParameterBinding" minOccurs="0" maxOccurs="unbounded"/> \r
+ </xsd:sequence> \r
+ <xsd:element ref="resourceAssignmentExpression" minOccurs="0" maxOccurs="1"/> \r
+ </xsd:choice>\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ </xsd:extension> \r
+ </xsd:complexContent> \r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="rootElement" type="tRootElement"/>\r
+ <xsd:complexType name="tRootElement" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tBaseElement"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="scriptTask" type="tScriptTask" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tScriptTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tTask">\r
+ <xsd:sequence>\r
+ <xsd:element ref="script" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="scriptFormat" type="xsd:string"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="script" type="tScript"/>\r
+ <xsd:complexType name="tScript" mixed="true">\r
+ <xsd:sequence>\r
+ <xsd:any namespace="##any" processContents="lax" minOccurs="0"/>\r
+ </xsd:sequence>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="sendTask" type="tSendTask" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tSendTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tTask">\r
+ <xsd:attribute name="implementation" type="tImplementation" default="##WebService"/>\r
+ <xsd:attribute name="messageRef" type="xsd:QName" use="optional"/>\r
+ <xsd:attribute name="operationRef" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="sequenceFlow" type="tSequenceFlow" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tSequenceFlow">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tFlowElement">\r
+ <xsd:sequence>\r
+ <xsd:element name="conditionExpression" type="tExpression" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="sourceRef" type="xsd:IDREF" use="required"/>\r
+ <xsd:attribute name="targetRef" type="xsd:IDREF" use="required"/>\r
+ <xsd:attribute name="isImmediate" type="xsd:boolean" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="serviceTask" type="tServiceTask" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tServiceTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tTask">\r
+ <xsd:attribute name="implementation" type="tImplementation" default="##WebService"/>\r
+ <xsd:attribute name="operationRef" type="xsd:QName" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="signal" type="tSignal" substitutionGroup="rootElement"/> \r
+ <xsd:complexType name="tSignal">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tRootElement">\r
+ <xsd:attribute name="name" type="xsd:string"/>\r
+ <xsd:attribute name="structureRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="signalEventDefinition" type="tSignalEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tSignalEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition">\r
+ <xsd:attribute name="signalRef" type="xsd:QName"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="standardLoopCharacteristics" type="tStandardLoopCharacteristics" substitutionGroup="loopCharacteristics"/>\r
+ <xsd:complexType name="tStandardLoopCharacteristics">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tLoopCharacteristics">\r
+ <xsd:sequence>\r
+ <xsd:element name="loopCondition" type="tExpression" minOccurs="0"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="testBefore" type="xsd:boolean" default="false"/>\r
+ <xsd:attribute name="loopMaximum" type="xsd:integer" use="optional"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+\r
+ <xsd:element name="startEvent" type="tStartEvent" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tStartEvent">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tCatchEvent">\r
+ <xsd:attribute name="isInterrupting" type="xsd:boolean" default="true"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="subChoreography" type="tSubChoreography" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tSubChoreography">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tChoreographyActivity">\r
+ <xsd:sequence>\r
+ <xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="subConversation" type="tSubConversation" substitutionGroup="conversationNode"/>\r
+ <xsd:complexType name="tSubConversation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tConversationNode">\r
+ <xsd:sequence>\r
+ <xsd:element ref="conversationNode" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="subProcess" type="tSubProcess" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tSubProcess">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tActivity">\r
+ <xsd:sequence>\r
+ <xsd:element ref="laneSet" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="triggeredByEvent" type="xsd:boolean" default="false"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="task" type="tTask" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tActivity"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:element name="terminateEventDefinition" type="tTerminateEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tTerminateEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition"/>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="textAnnotation" type="tTextAnnotation" substitutionGroup="artifact"/>\r
+ <xsd:complexType name="tTextAnnotation">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tArtifact">\r
+ <xsd:sequence>\r
+ <xsd:element ref="text" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="textFormat" type="xsd:string" default="text/plain"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="text" type="tText"/>\r
+ <xsd:complexType name="tText" mixed="true">\r
+ <xsd:sequence>\r
+ <xsd:any namespace="##any" processContents="lax" minOccurs="0"/>\r
+ </xsd:sequence>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="throwEvent" type="tThrowEvent"/>\r
+ <xsd:complexType name="tThrowEvent" abstract="true">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEvent">\r
+ <xsd:sequence>\r
+ <xsd:element ref="dataInput" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="dataInputAssociation" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element ref="inputSet" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element ref="eventDefinition" minOccurs="0" maxOccurs="unbounded"/>\r
+ <xsd:element name="eventDefinitionRef" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType> \r
+ \r
+ <xsd:element name="timerEventDefinition" type="tTimerEventDefinition" substitutionGroup="eventDefinition"/>\r
+ <xsd:complexType name="tTimerEventDefinition">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tEventDefinition">\r
+ <xsd:choice>\r
+ <xsd:element name="timeDate" type="tExpression" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element name="timeDuration" type="tExpression" minOccurs="0" maxOccurs="1"/>\r
+ <xsd:element name="timeCycle" type="tExpression" minOccurs="0" maxOccurs="1"/>\r
+ </xsd:choice>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+ <xsd:element name="transaction" type="tTransaction" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tTransaction">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tSubProcess">\r
+ <xsd:attribute name="method" type="tTransactionMethod" default="##Compensate"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+ \r
+ <xsd:simpleType name="tTransactionMethod">\r
+ <xsd:union memberTypes="xsd:anyURI">\r
+ <xsd:simpleType>\r
+ <xsd:restriction base="xsd:token">\r
+ <xsd:enumeration value="##Compensate" /> \r
+ <xsd:enumeration value="##Image" />\r
+ <xsd:enumeration value="##Store" />\r
+ </xsd:restriction>\r
+ </xsd:simpleType>\r
+ </xsd:union>\r
+ </xsd:simpleType>\r
+\r
+ <xsd:element name="userTask" type="tUserTask" substitutionGroup="flowElement"/>\r
+ <xsd:complexType name="tUserTask">\r
+ <xsd:complexContent>\r
+ <xsd:extension base="tTask">\r
+ <xsd:sequence>\r
+ <xsd:element ref="rendering" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xsd:sequence>\r
+ <xsd:attribute name="implementation" type="tImplementation" default="##unspecified"/>\r
+ </xsd:extension>\r
+ </xsd:complexContent>\r
+ </xsd:complexType>\r
+\r
+</xsd:schema>
\ No newline at end of file
--- /dev/null
+"C:\Program Files\Java\jdk1.7.0_51\bin\xjc" -target 2.1 -d ../src -p org.simantics.sysdyn.modelImport.bpmn BPMN20.xsd\r
+pause
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?> \r
+<definitions id="Definition"\r
+ targetNamespace="http://www.example.org/MinimalExample"\r
+ typeLanguage="http://www.java.com/javaTypes"\r
+ expressionLanguage="http://www.mvel.org/2.0"\r
+ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"\r
+ xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"\r
+ xs:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"\r
+ xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"\r
+ xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"\r
+ xmlns:di="http://www.omg.org/spec/DD/20100524/DI"\r
+ xmlns:tns="http://www.jboss.org/drools">\r
+\r
+ <process processType="Private" isExecutable="true" id="com.sample.HelloWorld" name="Hello World" >\r
+\r
+ <!-- nodes -->\r
+ <startEvent id="_1" name="StartProcess" />\r
+ <scriptTask id="_2" name="Hello" >\r
+ <script>System.out.println("Hello World");</script>\r
+ </scriptTask>\r
+ <endEvent id="_3" name="EndProcess" >\r
+ <terminateEventDefinition/>\r
+ </endEvent>\r
+\r
+ <!-- connections -->\r
+ <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />\r
+ <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />\r
+\r
+ </process>\r
+\r
+ <bpmndi:BPMNDiagram>\r
+ <bpmndi:BPMNPlane bpmnElement="Minimal" >\r
+ <bpmndi:BPMNShape bpmnElement="_1" >\r
+ <dc:Bounds x="15" y="91" width="48" height="48" />\r
+ </bpmndi:BPMNShape>\r
+ <bpmndi:BPMNShape bpmnElement="_2" >\r
+ <dc:Bounds x="95" y="88" width="83" height="48" />\r
+ </bpmndi:BPMNShape>\r
+ <bpmndi:BPMNShape bpmnElement="_3" >\r
+ <dc:Bounds x="258" y="86" width="48" height="48" />\r
+ </bpmndi:BPMNShape>\r
+ <bpmndi:BPMNEdge bpmnElement="_1-_2" >\r
+ <di:waypoint x="39" y="115" />\r
+ <di:waypoint x="75" y="46" />\r
+ <di:waypoint x="136" y="112" />\r
+ </bpmndi:BPMNEdge>\r
+ <bpmndi:BPMNEdge bpmnElement="_2-_3" >\r
+ <di:waypoint x="136" y="112" />\r
+ <di:waypoint x="240" y="240" />\r
+ <di:waypoint x="282" y="110" />\r
+ </bpmndi:BPMNEdge>\r
+ </bpmndi:BPMNPlane>\r
+ </bpmndi:BPMNDiagram>\r
+\r
+</definitions>
\ No newline at end of file
--- /dev/null
+###############################################################################\r
+# Copyright (c) 2010 Association for Decentralized Information Management in\r
+# Industry THTH ry.\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Eclipse Public License v1.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.eclipse.org/legal/epl-v10.html\r
+#\r
+# Contributors:\r
+# VTT Technical Research Centre of Finland - initial API and implementation\r
+###############################################################################\r
+source.. = src/\r
+output.. = bin/\r
+bin.includes = META-INF/,\\r
+ .,\\r
+ adapters.xml,\\r
+ plugin.xml,\\r
+ scl/\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<?eclipse version="3.4"?>\r
+<plugin>\r
+\r
+ <extension point="org.simantics.scl.reflection.binding">\r
+ <namespace path="http://www.simantics.org/Sysdyn-1.1/Functions">\r
+ <externalClass className="org.simantics.db.Resource"/>\r
+ <externalClass className="org.simantics.db.ReadGraph"/>\r
+ <externalClass className="org.simantics.db.WriteGraph"/>\r
+ <externalClass className="org.simantics.db.Issue"/>\r
+ <externalClass className="org.simantics.databoard.binding.Binding"/>\r
+ <externalClass className="org.simantics.db.layer0.variable.Variable"/>\r
+ <externalClass className="org.simantics.db.layer0.variable.ValueAccessor"/>\r
+ <externalClass className="org.simantics.db.layer0.variable.VariableMap"/>\r
+ <class className="org.simantics.sysdyn.Functions"/>\r
+ </namespace>\r
+ </extension>\r
+\r
+</plugin>\r
--- /dev/null
+include "UI/Progress"\r
+include "Simantics/DB"\r
+include "Simantics/Variables"\r
+\r
+importJava "org.simantics.sysdyn.utils.DocumentationUtils" where\r
+\r
+ @JavaName getModules\r
+ getModules :: Variable -> <ReadGraph> [Resource]\r
+ \r
+ @JavaName getExperimentVariables\r
+ getExperimentVariables :: Variable -> <ReadGraph> [Variable]\r
+ \r
+ @JavaName getRoleVariables\r
+ getRoleVariables :: Variable -> <ReadGraph> [Variable] \r
+\r
+ @JavaName getDocumentVariables\r
+ getDocumentVariables :: Variable -> <ReadGraph> [Variable] \r
+\r
+ @JavaName getIndexDocuments\r
+ getIndexDocuments :: Variable -> <ReadGraph> [Variable] \r
+ \r
+ @JavaName getResultVariables\r
+ getResultVariables :: Variable -> <ReadGraph> [Variable] \r
+ \r
+ @JavaName getConfiguration\r
+ getConfiguration :: Resource -> <ReadGraph> Resource\r
+ \r
+ @JavaName getConfigurationVariables\r
+ getConfigurationVariables :: Resource -> <ReadGraph> [Resource]\r
+ \r
+ @JavaName getName\r
+ getName :: Resource -> <ReadGraph> String\r
+ \r
+ @JavaName getType\r
+ getType :: Resource -> <ReadGraph> String\r
+\r
+ @JavaName getUnit\r
+ getUnit :: Resource -> <ReadGraph> String\r
+\r
+ @JavaName getVariability\r
+ getVariability :: Resource -> <ReadGraph> String \r
+ \r
+ @JavaName getDescription\r
+ getDescription :: Resource -> <ReadGraph> String\r
+ \r
+ @JavaName getDocumentationDefinition\r
+ getDocumentationDefinition :: Resource -> <ReadGraph> String\r
+ \r
+ \r
+ \r
+ @JavaName numberOfVariables\r
+ numberOfVariables :: Resource -> Boolean -> <ReadGraph> Integer\r
+\r
+ @JavaName totalNumberOfVariables\r
+ totalNumberOfVariables :: Resource -> Boolean -> <ReadGraph> Integer\r
+ \r
+ @JavaName numberOfStocks\r
+ numberOfStocks :: Resource -> Boolean -> <ReadGraph> Integer\r
+ \r
+ @JavaName numberOfValves\r
+ numberOfValves :: Resource -> Boolean -> <ReadGraph> Integer\r
+ \r
+ @JavaName numberOfInputs\r
+ numberOfInputs :: Resource -> Boolean -> <ReadGraph> Integer\r
+ \r
+ @JavaName numberOfShadows\r
+ numberOfShadows :: Resource -> Boolean -> <ReadGraph> Integer\r
+ \r
+ @JavaName numberOfAuxiliaries\r
+ numberOfAuxiliaries :: Resource -> Boolean -> <ReadGraph> Integer\r
+ \r
+ @JavaName numberOfModules\r
+ numberOfModules :: Resource -> Boolean -> <ReadGraph> Integer\r
+ \r
+ @JavaName numberOfSheets\r
+ numberOfSheets :: Resource -> Boolean -> <ReadGraph> Integer\r
+ \r
+ @JavaName numberOfModuleTypes\r
+ numberOfModuleTypes :: Variable -> <ReadGraph> Integer\r
+ \r
+ @JavaName base64Encode\r
+ base64Encode :: Variable -> String -> <ReadGraph> String \r
+ \r
+ @JavaName formatDate\r
+ formatDate :: Long -> <ReadGraph> String \r
+ \r
+ @JavaName importModel\r
+ importModel :: String -> <Proc> Resource\r
+ \r
+ @JavaName isParameter\r
+ isParameter :: Variable -> <ReadGraph> Boolean\r
+\r
+ lastValue :: Resource -> String -> String -> Double\r
+ lastValue2 :: Variable -> String -> <ReadGraph> Variable\r
+ currentValue :: Variable -> String -> <ReadGraph> Variable\r
+ lastValueIndexed :: Variable -> String -> <ReadGraph> Variable\r
+ equation :: Variable -> String -> <ReadGraph> Variable\r
+\r
+importJava "org.simantics.sysdyn.manager.SysdynExperiments" where\r
+ \r
+ activateExperiment :: Resource -> String\r
+ run :: String -> ()\r
+ saveIC :: Variable -> String -> <WriteGraph> Maybe Resource\r
+ assignIC :: Variable -> String -> <WriteGraph> ()\r
+ deassignIC :: Variable -> <WriteGraph> ()\r
+ applyIC :: Variable -> String -> <WriteGraph> ()\r
+ deleteIC :: Variable -> String -> <WriteGraph> ()\r
+\r
+ setPublishResults :: Variable -> Boolean -> <ReadGraph> ()\r
+
\ No newline at end of file
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn;\r
+\r
+import java.io.File;\r
+\r
+import org.osgi.framework.BundleActivator;\r
+import org.osgi.framework.BundleContext;\r
+\r
+public class Activator implements BundleActivator {\r
+\r
+ private static BundleContext bundleContext;\r
+ \r
+ // The plug-in ID\r
+ public static final String PLUGIN_ID = "org.simantics.sysdyn";\r
+ \r
+ // The shared instance\r
+ private static Activator plugin;\r
+ \r
+ @Override\r
+ public void start(BundleContext context) throws Exception {\r
+ bundleContext = context;\r
+ File modelsDir = Activator.getBundleContext().getDataFile("models");\r
+ if (!modelsDir.exists()) {\r
+ modelsDir.mkdir();\r
+ }\r
+ plugin = this;\r
+ }\r
+\r
+ @Override\r
+ public void stop(BundleContext context) throws Exception {\r
+ File modelsDir = Activator.getBundleContext().getDataFile("models");\r
+ if (modelsDir.exists()) {\r
+ recursiveDelete(modelsDir);\r
+ }\r
+ plugin = null;\r
+\r
+ }\r
+\r
+ public static Activator getDefault() {\r
+ return plugin;\r
+ }\r
+\r
+ public static BundleContext getBundleContext() {\r
+ return bundleContext;\r
+ }\r
+ \r
+ private static boolean recursiveDelete(File fileOrDir) {\r
+ if(fileOrDir.isDirectory())\r
+ for(File innerFile: fileOrDir.listFiles())\r
+ if(!recursiveDelete(innerFile))\r
+ return false;\r
+ return fileOrDir.delete();\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn;\r
+\r
+import java.util.Collection;\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ResourceRead;\r
+import org.simantics.db.common.uri.UnescapedChildMapOfResource;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.function.All;\r
+import org.simantics.db.layer0.variable.StandardGraphChildVariable;\r
+import org.simantics.db.layer0.variable.ValueAccessor;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.VariableMap;\r
+import org.simantics.db.layer0.variable.VariableMapImpl;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
+import org.simantics.scl.reflection.annotations.SCLValue;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.adapter.ActiveDatasetsIndexVariable;\r
+import org.simantics.sysdyn.adapter.NamesIndexVariable;\r
+import org.simantics.sysdyn.adapter.TimeIndexVariable;\r
+import org.simantics.sysdyn.adapter.TimesIndexVariable;\r
+import org.simantics.sysdyn.adapter.ValueIndexVariable;\r
+import org.simantics.sysdyn.adapter.ValueIndexVariableI;\r
+import org.simantics.sysdyn.adapter.ValuesIndexVariable;\r
+\r
+public class Functions {\r
+ \r
+ public static String VALUE = "value";\r
+ public static String VALUES = "values";\r
+ public static String TIME = "time";\r
+ public static String TIMES = "times";\r
+ public static String NAMES = "names"; \r
+ public static String ACTIVE_DATASETS = "activeDatasets"; \r
+ \r
+ @SCLValue(type = "ValueAccessor")\r
+ public static ValueAccessor valuePropertyValue = new ValueAccessor() {\r
+\r
+ @Override\r
+ public Object getValue(ReadGraph graph, Variable context)\r
+ throws DatabaseException {\r
+ // TODO Auto-generated method stub\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public Object getValue(ReadGraph graph, Variable context,\r
+ Binding binding) throws DatabaseException {\r
+ // TODO Auto-generated method stub\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public void setValue(WriteGraph graph, Variable context, Object value)\r
+ throws DatabaseException {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void setValue(WriteGraph graph, Variable context, Object value,\r
+ Binding binding) throws DatabaseException {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+ \r
+ };\r
+\r
+ @SCLValue(type = "ValueAccessor")\r
+ public static ValueAccessor equationPropertyValue = new ValueAccessor() {\r
+\r
+ @Override\r
+ public Object getValue(ReadGraph graph, Variable context) throws DatabaseException {\r
+ return getValue(graph, context, Bindings.STRING);\r
+ }\r
+\r
+ @Override\r
+ public Object getValue(ReadGraph graph, Variable context, Binding binding) throws DatabaseException {\r
+ \r
+ Variable v = context.getParent(graph);\r
+ \r
+ Resource represents = v.getPossibleRepresents(graph);\r
+ if(represents != null) {\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+ Collection<Resource> res = ListUtils.toList(graph, graph.getSingleObject(represents, SYSDYN.Variable_expressionList));\r
+ if(res.size() == 1) {\r
+ Resource exp = res.iterator().next();\r
+ String text = graph.getRelatedValue(exp, SYSDYN.Expression_equation, Bindings.STRING);\r
+ return text;\r
+ }\r
+ }\r
+\r
+ return null;\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void setValue(WriteGraph graph, Variable context, Object value) throws DatabaseException {\r
+ \r
+ if(value instanceof Variant) value = ((Variant)value).getValue();\r
+ \r
+ if(!(value instanceof String)) throw new DatabaseException("Unexpected value " + value + ", expected String");\r
+ \r
+ setValue(graph, context, value, Bindings.STRING);\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void setValue(WriteGraph graph, Variable context, Object value, Binding binding) throws DatabaseException {\r
+ \r
+ if(value instanceof Variant) value = ((Variant)value).getValue();\r
+ \r
+ if(!(value instanceof String)) throw new DatabaseException("Unexpected value " + value + ", expected String");\r
+\r
+ Variable v = context.getParent(graph);\r
+ \r
+ Resource represents = v.getPossibleRepresents(graph);\r
+ if(represents != null) {\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+ Collection<Resource> res = ListUtils.toList(graph, graph.getSingleObject(represents, SYSDYN.Variable_expressionList));\r
+ if(res.size() == 1) {\r
+ Resource exp = res.iterator().next();\r
+ graph.claimLiteral(exp, SYSDYN.Expression_equation, value, Bindings.STRING);\r
+ }\r
+ }\r
+ \r
+ }\r
+ \r
+ };\r
+ \r
+\r
+ @SCLValue(type = "VariableMap")\r
+ public static VariableMap runProperties = new VariableMapImpl() {\r
+\r
+ @Override\r
+ public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {\r
+\r
+ String property = context.getName(graph);\r
+ if(TIME.equals(property))\r
+ return new TimeIndexVariable(graph, context, name);\r
+ else\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public Map<String, Variable> getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {\r
+ return map;\r
+ }\r
+ };\r
+\r
+ @SCLValue(type = "VariableMap")\r
+ public static VariableMap valuePropertyProperties = new VariableMapImpl() {\r
+ \r
+ @Override\r
+ public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {\r
+ \r
+ String property = context.getName(graph);\r
+ if(VALUE.equals(property))\r
+ if(name.startsWith("$")) {\r
+ Integer index = Integer.parseInt(name.substring(1));\r
+ return new ValueIndexVariableI(graph, context, index);\r
+ } else {\r
+ return new ValueIndexVariable(graph, context, name);\r
+ }\r
+ else if(VALUES.equals(property))\r
+ return new ValuesIndexVariable(graph, context, name);\r
+ else if(TIMES.equals(property))\r
+ return new TimesIndexVariable(graph, context, name);\r
+ else if(TIME.equals(property))\r
+ return new TimeIndexVariable(graph, context, name); \r
+ else if(NAMES.equals(property))\r
+ return new NamesIndexVariable(graph, context, name);\r
+ else if(ACTIVE_DATASETS.equals(property))\r
+ return new ActiveDatasetsIndexVariable(graph, context, name);\r
+ else\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public Map<String, Variable> getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {\r
+ return map;\r
+// Collections.emptyList();\r
+// StandardGraphChildVariable variable = (StandardGraphChildVariable)context;\r
+// collectPropertiesFromContext(graph, variable, variable.resource, map);\r
+ }\r
+ \r
+ };\r
+ \r
+ \r
+ @SCLValue(type = "VariableMap")\r
+ public static VariableMap runChildren = new VariableMapImpl() {\r
+ \r
+ @Override\r
+ public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException {\r
+ StandardGraphChildVariable variable = (StandardGraphChildVariable)context;\r
+ Map<String, Resource> children = graph.syncRequest(new StructuralChildMapOfResource(getConfiguration(graph, variable)));\r
+ Resource child = children.get(name);\r
+ if(child == null) return All.getStandardChildDomainChildVariable(graph, context, name);\r
+ return graph.getPossibleContextualAdapter(child, variable, Variable.class, Variable.class);\r
+ }\r
+\r
+ @Override\r
+ public Map<String, Variable> getVariables(ReadGraph graph, Variable context, Map<String, Variable> map) throws DatabaseException {\r
+ \r
+ StandardGraphChildVariable variable = (StandardGraphChildVariable)context;\r
+ \r
+ map = All.getStandardChildDomainChildVariables(graph, context, map);\r
+ \r
+ for(Map.Entry<String, Resource> entry : graph.syncRequest(new StructuralChildMapOfResource(getConfiguration(graph, variable))).entrySet()) {\r
+ String name = entry.getKey();\r
+ Resource child = entry.getValue();\r
+ Variable var = graph.getPossibleContextualAdapter(child, variable, Variable.class, Variable.class);\r
+ if(var != null) {\r
+ if(map == null) map = new HashMap<String,Variable>();\r
+ map.put(name, var);\r
+ } else {\r
+ System.err.println("No adapter for " + child + " in " + variable.getURI(graph));\r
+ }\r
+ }\r
+ \r
+ return map;\r
+ \r
+ }\r
+ \r
+ Resource getConfiguration(ReadGraph graph, Variable run) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
+ Resource experiment = graph.getPossibleObject(run.getRepresents(graph), L0.PartOf);\r
+ Resource model = graph.getPossibleObject(experiment, L0.PartOf);\r
+ return graph.getPossibleObject(model, L0X.HasBaseRealization);\r
+ }\r
+ \r
+ };\r
+ \r
+ \r
+ static class StructuralChildMapOfResource extends ResourceRead<Map<String, Resource>> {\r
+\r
+ public StructuralChildMapOfResource(Resource resource) {\r
+ super(resource);\r
+ }\r
+\r
+ @Override\r
+ public Map<String, Resource> perform(ReadGraph graph) throws DatabaseException {\r
+ \r
+ StructuralResource2 STR = StructuralResource2.getInstance(graph);\r
+ Map<String, Resource> directChildren = graph.syncRequest(new UnescapedChildMapOfResource(resource));\r
+ Resource type = graph.getPossibleType(resource, STR.Component);\r
+ if(type != null) {\r
+ Resource definition = graph.getPossibleObject(type, STR.IsDefinedBy);\r
+ if(definition != null) {\r
+ return graph.syncRequest(new UnescapedChildMapOfResource(definition));\r
+ }\r
+ }\r
+\r
+ return directChildren;\r
+ \r
+ }\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn;\r
+\r
+import java.io.StringReader;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.ParseException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.UnitParser;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+public class TestParser {\r
+ \r
+ /**\r
+ * @param args\r
+ */\r
+ public static void main(String[] args) {\r
+\r
+ HashMap<String, String> units = new HashMap<String, String>();\r
+ boolean allowEquivalents = true;\r
+ \r
+ doScenario(scenario1(units), units, allowEquivalents);\r
+ doScenario(scenario2(units), units, allowEquivalents);\r
+ doScenario(scenario3(units), units, allowEquivalents);\r
+ doScenario(scenario4(units), units, allowEquivalents);\r
+ doScenario(scenario5(units), units, allowEquivalents);\r
+ doScenario(scenario6(units), units, allowEquivalents);\r
+ doScenario(scenario7(units), units, allowEquivalents);\r
+ doScenario(scenario8(units), units, allowEquivalents);\r
+ doScenario(scenario9(units), units, allowEquivalents);\r
+ doScenario(scenario10(units), units, allowEquivalents);\r
+ doScenario(scenario11(units), units, allowEquivalents);\r
+ doScenario(scenario12(units), units, allowEquivalents);\r
+ doScenario(scenario13(units), units, allowEquivalents);\r
+\r
+ }\r
+ \r
+ private static void doScenario(String expression, HashMap<String, String> units, boolean allowEquivalents) {\r
+ System.out.println("-----------------------------------");\r
+ System.out.println("Expression: " + expression);\r
+ System.out.println("Units: ");\r
+ for(String key : units.keySet()) {\r
+ System.out.println(" " + key + " -> " + units.get(key));\r
+ }\r
+ StringReader sr = new StringReader(expression);\r
+ UnitParser parser = new UnitParser(sr);\r
+ try {\r
+ UnitCheckingNode node = (UnitCheckingNode) parser.expr();\r
+ \r
+ try {\r
+ UnitResult u = node.getUnits(units, Function.getAllBuiltInFunctions(), allowEquivalents);\r
+ System.out.println("Result: " + u.getCleanFullUnit());\r
+ } catch (UnitCheckingException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+// node.dump("");\r
+ } catch (ParseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ \r
+ private static String scenario1(HashMap<String, String> units) {\r
+ units.clear();\r
+ \r
+ units.put("a", "m");\r
+ units.put("b", "m");\r
+ units.put("c", "m");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("a*b*c");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario2(HashMap<String, String> units) {\r
+ units.clear();\r
+ \r
+ units.put("a", "m");\r
+ units.put("b", "m");\r
+ units.put("c", "m");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("a+b+c");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario3(HashMap<String, String> units) {\r
+ units.clear();\r
+ \r
+ units.put("a", "m");\r
+ units.put("b", "m");\r
+ units.put("c", "m");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("a/b+b/c");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario4(HashMap<String, String> units) {\r
+ units.clear();\r
+ \r
+ units.put("a", "m");\r
+ units.put("b", "m");\r
+ units.put("c", "m");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("if a == b then a+b else b + c + a");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario5(HashMap<String, String> units) {\r
+ units.clear();\r
+ \r
+ units.put("a", "m");\r
+ units.put("b", "s");\r
+ units.put("c", "m");\r
+ units.put("d", "s");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+// sb.append("a / b + (c*a)/(b*a)");\r
+ sb.append("c/(b*a)");\r
+\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario6(HashMap<String, String> units) {\r
+ units.clear();\r
+ \r
+ units.put("a", "m");\r
+ units.put("b", "s");\r
+ units.put("c", "m");\r
+ units.put("d", "m/s");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("if a > c then c*a/b else a*d");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario7(HashMap<String, String> units) {\r
+ units.clear();\r
+ \r
+ units.put("a", "m/s");\r
+ units.put("b.e", "s");\r
+ units.put("c", "m");\r
+ units.put("d", "s");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("a[1] + c[1] / b.e[1]");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario8(HashMap<String, String> units) {\r
+ units.clear();\r
+ \r
+ units.put("a", "m");\r
+ units.put("b", "s");\r
+ units.put("c", "s*m");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("c + {a[i] * b[i] for i in 1:3}");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario9(HashMap<String, String> units) {\r
+ units.clear();\r
+ units.put("a", "m");\r
+ units.put("b", "m");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("1+a+1+b");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario10(HashMap<String, String> units) {\r
+ units.clear();\r
+ units.put("a", "m");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("1*a*1*a");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario11(HashMap<String, String> units) {\r
+ units.clear();\r
+ units.put("a", "m");\r
+ units.put("b", "m");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("-a+b");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario12(HashMap<String, String> units) {\r
+ units.clear();\r
+ units.put("a", "m");\r
+ units.put("b", "s");\r
+ units.put("c", "m/s");\r
+\r
+\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("1/a/b + 1/c");\r
+ return sb.toString();\r
+ }\r
+ \r
+ private static String scenario13(HashMap<String, String> units) {\r
+ units.clear();\r
+ \r
+ units.put("a", "m");\r
+ units.put("b", "m");\r
+ units.put("c", "m");\r
+ units.put("d", "s");\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("(a/b+b/c)/d");\r
+ return sb.toString();\r
+ }\r
+ \r
+}\r
+\r
+\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.modelica.data.DataSet;\r
+import org.simantics.sysdyn.manager.SysdynDataSet;\r
+import org.simantics.sysdyn.manager.SysdynResult;\r
+\r
+public class ActiveDatasetsIndexVariable extends IndexVariable< ArrayList<DataSet>> {\r
+\r
+ public ActiveDatasetsIndexVariable(ReadGraph graph, Variable parent, String indexes)\r
+ throws DatabaseException {\r
+ super(graph, parent, indexes);\r
+ }\r
+\r
+ @Override\r
+ public ArrayList<DataSet> getValue() {\r
+ ArrayList<DataSet> datasets = new ArrayList<DataSet>();\r
+\r
+ if(experiment == null)\r
+ return datasets;\r
+\r
+ Collection<SysdynResult> results = experiment.getActiveResults();\r
+ ArrayList<String> variableNamesWithIndexes = getVariableNamesWithIndexNumbers();\r
+ ArrayList<String> variableNames = getVariableNames();\r
+\r
+ for(int i = 0; i < variableNamesWithIndexes.size(); i++) {\r
+ for(SysdynResult result : results) {\r
+ SysdynDataSet ds = result.getDataSet(variableNamesWithIndexes.get(i));\r
+ if(ds != null) {\r
+ // NOTE: this method was changed to no longer remove\r
+ // remove enumeration indices from variable names as it\r
+ // seems unnecessary and makes different instances of the\r
+ // same variable with different enumeration indices\r
+ // indistinguishable from each other in simulation results\r
+ ds.name = variableNames.get(i);\r
+\r
+ datasets.add(ds);\r
+ }\r
+ }\r
+ }\r
+ return datasets;\r
+ }\r
+\r
+ @Override\r
+ public void setIndexedValue(WriteGraph graph, Object value)\r
+ throws DatabaseException {\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.migration.MigrationState;\r
+import org.simantics.db.layer0.migration.MigrationStateKeys;\r
+import org.simantics.db.layer0.migration.MigrationStep;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
+\r
+public class CustomMigrationStep implements MigrationStep {\r
+\r
+ @Override\r
+ public void applyTo(IProgressMonitor monitor, Session session, MigrationState state) throws DatabaseException {\r
+ \r
+ final Resource res = state.getProperty(MigrationStateKeys.CURRENT_RESOURCE);\r
+ \r
+ session.syncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+\r
+ for(Resource model : graph.syncRequest(new ObjectsWithType(res, l0.ConsistsOf, SIMU.Model))) {\r
+\r
+ Resource sheetExperiment = Layer0Utils.getPossibleChild(graph, model, "SheetExperiment");\r
+ if(sheetExperiment != null) return;\r
+ \r
+ SpreadsheetResource SHEET = SpreadsheetResource.getInstance(graph);\r
+ sheetExperiment = GraphUtils.create2(graph, SHEET.Experiment,\r
+ l0.HasName, "SheetExperiment",\r
+ l0.HasLabel, "Sheet Experiment",\r
+ l0.PartOf, model);\r
+ \r
+ Resource sheetRun = GraphUtils.create2(graph, SHEET.Run,\r
+ l0.HasName, "Default",\r
+ l0.PartOf, sheetExperiment);\r
+ \r
+\r
+ }\r
+ \r
+ }\r
+ \r
+ });\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.type.Datatype;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ParametrizedPrimitiveRead;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.AbstractPropertyVariable;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.db.procedure.Listener;\r
+import org.simantics.db.request.ExternalRead;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.project.IProject;\r
+import org.simantics.simulation.experiment.IExperiment;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.simulation.project.IExperimentManager;\r
+import org.simantics.sysdyn.manager.SysdynExperiment;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.manager.SysdynModelManager;\r
+import org.simantics.sysdyn.manager.VariableSubscriptionManager;\r
+import org.simantics.utils.datastructures.Pair;\r
+\r
+public abstract class IndexVariable<T> extends AbstractPropertyVariable {\r
+\r
+ protected Variable parent;\r
+ protected SysdynModel model;\r
+ protected SysdynExperiment experiment;\r
+ protected String rvi;\r
+ protected HashMap<String, String> rvis;\r
+ protected String indexes;\r
+ protected VariableSubscriptionManager subscriptionManager;\r
+ \r
+ public IndexVariable(ReadGraph graph, Variable parent, String indexes) throws DatabaseException {\r
+ this.parent = parent;\r
+ this.indexes = indexes;\r
+ }\r
+ \r
+ \r
+ protected VariableSubscriptionManager getSubscriptionManager() {\r
+ return this.experiment;\r
+ }\r
+\r
+ public String getIndexes() {\r
+ return this.indexes;\r
+ }\r
+\r
+ /**\r
+ * Register a property subscription\r
+ * \r
+ * @param request PropertyRequest\r
+ * @param procedure \r
+ * @return\r
+ */\r
+ protected VariableValueSubscription<T> registerSubscription(ExternalRead<?> request, Listener<T> procedure) {\r
+ // Other properties are requested from model (they listen to new simulation results)\r
+ VariableValueSubscription<T> subscription = new VariableValueSubscription<T>(request, this, procedure);\r
+ if(subscriptionManager != null) {\r
+ subscriptionManager.addVariableValueSubscription(subscription);\r
+ }\r
+ subscription.update();\r
+ return subscription;\r
+ }\r
+\r
+ /**\r
+ * Unregisters a subscription\r
+ * @param subscription\r
+ */\r
+ protected void unregisterSubscription(VariableValueSubscription<T> subscription) {\r
+ subscription.setListener(null);\r
+ if(subscriptionManager != null)\r
+ subscriptionManager.removeVariableValueSubscription(subscription);\r
+ }\r
+ \r
+ \r
+\r
+ /**\r
+ * Class for supporting requests with different property parameters. Equals-method has been modified \r
+ * from ParametrizedPrivimiteRead to check also the property value.\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+ class PropertyRequest extends ParametrizedPrimitiveRead<Variable, T> {\r
+\r
+\r
+ public PropertyRequest(Variable indexVariable) {\r
+ super(indexVariable);\r
+ }\r
+\r
+ VariableValueSubscription<T> subscription;\r
+\r
+ @Override\r
+ public void register(ReadGraph graph, Listener<T> procedure) {\r
+ subscription = registerSubscription(this, procedure);\r
+ }\r
+ @Override\r
+ public void unregistered() {\r
+ if(subscription != null) {\r
+ unregisterSubscription(subscription);\r
+ subscription = null;\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
+ public boolean equals(Object object) {\r
+ if(object instanceof IndexVariable.PropertyRequest && super.equals(object)) {\r
+ return this.parameter.equals(((PropertyRequest)object).parameter);\r
+ } else {\r
+ return super.equals(object);\r
+ }\r
+ }\r
+\r
+ }\r
+\r
+ @Override\r
+ public Resource getPropertyResource(ReadGraph graph) throws DatabaseException {\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public Resource getContainerResource(ReadGraph graph) throws DatabaseException {\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public Datatype getDatatype(ReadGraph graph) throws DatabaseException {\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public Variable getPredicate(ReadGraph graph) throws DatabaseException {\r
+ return null;\r
+ }\r
+\r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
+ public <U> U getValue(ReadGraph graph) throws DatabaseException {\r
+ return (U) getValue(graph, Bindings.DOUBLE);\r
+ }\r
+\r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
+ public <U> U getValue(ReadGraph graph, Binding binding) throws DatabaseException {\r
+ ensureInformationAvailable(graph);\r
+ // Do something before request, e.g. calculate some variables used in the request\r
+ beforeRequest(graph);\r
+ \r
+ return (U) graph.syncRequest(new PropertyRequest(this));\r
+ \r
+ }\r
+ \r
+ protected void beforeRequest(ReadGraph graph) throws DatabaseException {\r
+\r
+ }\r
+ \r
+ protected void ensureInformationAvailable(ReadGraph graph) throws DatabaseException {\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+ ModelingResources MOD = ModelingResources.getInstance(graph);\r
+ \r
+ if(model == null) {\r
+ Resource modelResource = Variables.getModel(graph, parent);\r
+ Resource configuration = graph.getPossibleObject(modelResource, SIMU.HasConfiguration);\r
+ model = SysdynModelManager.getInstance(graph.getSession()).getModel(graph, configuration);\r
+ }\r
+ \r
+ Variable var = parent.getParent(graph);\r
+ Resource represents = var.getRepresents(graph);\r
+ \r
+ Resource activeRun = null;\r
+ if(represents != null) {\r
+ do {\r
+ if(graph.isInstanceOf(represents, SIMU.Run)) {\r
+ activeRun = represents;\r
+ break;\r
+ }\r
+ var = var.getParent(graph);\r
+ represents = var.getRepresents(graph);\r
+ } while(represents != null && !graph.isInstanceOf(represents, MOD.StructuralModel));\r
+ }\r
+\r
+ IProject project = Simantics.peekProject();\r
+ if(activeRun != null && project != null) {\r
+ IExperimentManager expMan = project.getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
+ IExperiment e = expMan.getExperiment(NameUtils.getSafeName(graph, activeRun));\r
+ if(e instanceof SysdynExperiment)\r
+ this.experiment = (SysdynExperiment)e;\r
+ }\r
+ \r
+ this.subscriptionManager = getSubscriptionManager();\r
+ rvi = Variables.getPossibleRVI(graph, this);\r
+ if(rvi != null)\r
+ rvis = graph.syncRequest(new VariableRVIUtils.GetActiveRVIs(parent.getParent(graph))); //VariableRVIUtils.getActiveRVIs(graph, parent.getParent(graph)); \r
+ }\r
+ \r
+ private Pair<ArrayList<String>,ArrayList<String>> getVariableNameArrays() {\r
+ Pair<ArrayList<String>,ArrayList<String>> result = new Pair<ArrayList<String>,ArrayList<String>>(new ArrayList<String>(), new ArrayList<String>());\r
+ if(rvi == null || rvis == null)\r
+ return result;\r
+ \r
+ if(rvi.indexOf('#') > 0)\r
+ rvi = rvi.substring(0, rvi.indexOf('#'));\r
+ \r
+ String test = rvi;\r
+ if(indexes != null && !indexes.isEmpty()) {\r
+ String regexIndexes = indexes.trim().replaceAll(":", "[a-zA-Z0-9_]*"); // Why was there was ".replace('.', ',')" ? - Removed by Teemu 2.9.2012\r
+ test = rvi + "\\[" + regexIndexes + "\\]";\r
+ } else {\r
+ test = rvi + "(\\[.*\\])?";\r
+ }\r
+ for(String k : rvis.keySet()) {\r
+ String value = rvis.get(k);\r
+ if(k.matches(test) || value.matches(test)) {\r
+ result.first.add(k.substring(1).replace("/", ".").replace("%20", "_"));\r
+ result.second.add(value.substring(1).replace("/", ".").replace("%20", " "));\r
+ }\r
+ }\r
+ \r
+ return result;\r
+ \r
+ }\r
+ \r
+ protected ArrayList<String> getVariableNames() {\r
+ return getVariableNameArrays().second;\r
+ }\r
+ \r
+ protected ArrayList<String> getVariableNamesWithIndexNumbers() {\r
+ return getVariableNameArrays().first;\r
+ }\r
+ \r
+ abstract public T getValue();\r
+\r
+ @Override\r
+ public void setValue(WriteGraph graph, Object value, Binding binding) throws DatabaseException {\r
+ setValue(graph, value);\r
+ }\r
+ \r
+ @Override\r
+ public void setValue(WriteGraph graph, Object value) throws DatabaseException {\r
+ ensureInformationAvailable(graph);\r
+ setIndexedValue(graph, value);\r
+ }\r
+\r
+ abstract protected void setIndexedValue(WriteGraph graph, Object value) throws DatabaseException;\r
+ \r
+\r
+\r
+ @Override\r
+ public String getName(ReadGraph graph) throws DatabaseException {\r
+ return indexes;\r
+ }\r
+\r
+ @Override\r
+ public Object getSerialized(ReadGraph graph) throws DatabaseException {\r
+ return indexes;\r
+ }\r
+\r
+ @Override\r
+ public Variable getParent(ReadGraph graph) throws DatabaseException {\r
+ return parent;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+\r
+public class NamesIndexVariable extends IndexVariable<String[]> {\r
+\r
+ public NamesIndexVariable(ReadGraph graph, Variable parent, String indexes)\r
+ throws DatabaseException {\r
+ super(graph, parent, indexes);\r
+ }\r
+\r
+ @Override\r
+ public String[] getValue() {\r
+ ArrayList<String> names = getVariableNames();\r
+ return names.toArray(new String[names.size()]);\r
+ }\r
+\r
+ @Override\r
+ public void setIndexedValue(WriteGraph graph, Object value)\r
+ throws DatabaseException {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.request.PossibleModel;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.adapter.distribution.IDistribution;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.manager.SysdynModelManager;\r
+import org.simantics.sysdyn.representation.Enumeration;\r
+import org.simantics.sysdyn.representation.Variable;\r
+import org.simantics.sysdyn.representation.utils.IndexUtils;\r
+import org.simantics.sysdyn.representation.utils.RepresentationUtils;\r
+\r
+public class SensitivityExperimentParameter {\r
+ \r
+ private String variableName;\r
+ private String[] indexes;\r
+ private String fullName;\r
+ private IDistribution distribution;\r
+ \r
+ public SensitivityExperimentParameter(ReadGraph graph, Resource parameter) {\r
+ \r
+ try {\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ Resource distributionResource = graph.getPossibleObject(parameter, SR.SensitivityAnalysisExperiment_Parameter_propabilityDistribution);\r
+ distribution = graph.adapt(distributionResource, IDistribution.class);\r
+ variableName = graph.getPossibleRelatedValue(parameter, SR.SensitivityAnalysisExperiment_Parameter_variable, Bindings.STRING);\r
+ indexes = graph.getPossibleRelatedValue(parameter, SR.SensitivityAnalysisExperiment_Parameter_indexes, Bindings.STRING_ARRAY);\r
+ \r
+ Resource model = graph.syncRequest(new PossibleModel(parameter));\r
+ SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r
+ SysdynModel sm = smm.getModel(graph, graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration));\r
+ \r
+ Variable variable = RepresentationUtils.getVariable(sm.getConfiguration(), variableName);\r
+ \r
+ if (variable != null) {\r
+ if(indexes == null && (variable.getArrayIndexes() != null & variable.getArrayIndexes().size() > 0)) {\r
+ indexes = new String[variable.getArrayIndexes().size()];\r
+ \r
+ for(int i = 0; i < variable.getArrayIndexes().size(); i++) {\r
+ Enumeration e = variable.getArrayIndexes().get(i);\r
+ indexes[i] = e.getEnumerationIndexes().get(0).getName();\r
+ }\r
+ }\r
+ \r
+ if(indexes != null) {\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("[");\r
+ for(int i = 0; i < indexes.length; i++) {\r
+ if(i > 0)\r
+ sb.append(",");\r
+ \r
+ String index = indexes[i];\r
+ sb.append(index);\r
+ }\r
+ sb.append("]");\r
+ String result = IndexUtils.rangeToIndexes(variable, sb.toString());\r
+ fullName = variableName + result;\r
+ } else {\r
+ fullName = variableName;\r
+ }\r
+ }\r
+ } catch (DatabaseException e) {\r
+\r
+ }\r
+ }\r
+\r
+ public String getVariableName() {\r
+ return variableName;\r
+ }\r
+ \r
+ public String[] getIndexes() {\r
+ return indexes;\r
+ }\r
+\r
+ public String getFullName() {\r
+ return fullName;\r
+ }\r
+\r
+ public IDistribution getDistribution() {\r
+ return distribution;\r
+ }\r
+\r
+ public String getFullModelicaName() {\r
+ if (this.fullName == null)\r
+ return null;\r
+ return this.fullName.replace(' ', '_');\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.sysdyn.manager.SysdynGameExperimentBase;\r
+import org.simantics.sysdyn.manager.SysdynPlaybackExperiment;\r
+\r
+public class TimeIndexVariable extends IndexVariable<Double> {\r
+\r
+ public TimeIndexVariable(ReadGraph graph, Variable parent, String indexes)\r
+ throws DatabaseException {\r
+ super(graph, parent, indexes);\r
+ }\r
+\r
+ @Override\r
+ public Double getValue() {\r
+ if(experiment != null && experiment instanceof SysdynPlaybackExperiment)\r
+ return ((SysdynPlaybackExperiment)experiment).getTime();\r
+ if(experiment != null && experiment instanceof SysdynGameExperimentBase)\r
+ return ((SysdynGameExperimentBase)experiment).getSolver().getTime();\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public void setIndexedValue(WriteGraph graph, Object value)\r
+ throws DatabaseException {\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.sysdyn.manager.SysdynDataSet;\r
+import org.simantics.sysdyn.manager.SysdynResult;\r
+\r
+public class TimesIndexVariable extends IndexVariable<double[][]> {\r
+\r
+ public TimesIndexVariable(ReadGraph graph, Variable parent, String indexes)\r
+ throws DatabaseException {\r
+ super(graph, parent, indexes);\r
+ // TODO Auto-generated constructor stub\r
+ }\r
+\r
+ @Override\r
+ public double[][] getValue() {\r
+ if(experiment == null)\r
+ return new double[0][0];\r
+ \r
+ Collection<SysdynResult> results = experiment.getActiveResults();\r
+ ArrayList<String> variableNames = getVariableNamesWithIndexNumbers();\r
+\r
+ double[][] result = new double[variableNames.size()][];\r
+ for(int i = 0; i < variableNames.size(); i++) {\r
+ for(SysdynResult r : results) {\r
+ SysdynDataSet ds = r.getDataSet(variableNames.get(i));\r
+ if(ds != null && ds.times != null) {\r
+ result[i] = new double[ds.times.length];\r
+ for(int j = 0; j < ds.times.length; j++) {\r
+ result[i][j] = ds.times[j];\r
+ }\r
+ break; // Show the first result found. (i.e. do not show history datasets)\r
+ }\r
+ }\r
+ if(result[i] == null)\r
+ result[i] = new double[0];\r
+ }\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public void setIndexedValue(WriteGraph graph, Object value)\r
+ throws DatabaseException {\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import org.simantics.databoard.Datatypes;\r
+import org.simantics.databoard.type.Datatype;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+\r
+public class ValueIndexVariable extends ValueIndexVariableBase<Object> {\r
+ \r
+ private final boolean scalar;\r
+ \r
+ public ValueIndexVariable(ReadGraph graph, Variable parent, String indexes)\r
+ throws DatabaseException {\r
+ super(graph, parent, indexes);\r
+ scalar = indexes.indexOf(":") == -1;\r
+ }\r
+ \r
+ @Override\r
+ public Object getValue() {\r
+ double[] value = getValueFull();\r
+ if (scalar) {\r
+ if (value == UNRESOLVED) { \r
+ return Double.NaN;\r
+ } else {\r
+ return value[0];\r
+ }\r
+ } else {\r
+ return value;\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public Datatype getDatatype(ReadGraph graph) throws DatabaseException {\r
+ if (scalar) {\r
+ return Datatypes.DOUBLE;\r
+ } else {\r
+ return Datatypes.DOUBLE_ARRAY;\r
+ }\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.utils.Logger;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.simulation.experiment.ExperimentState;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynDataSet;\r
+import org.simantics.sysdyn.manager.SysdynGameExperimentBase;\r
+import org.simantics.sysdyn.manager.SysdynGameExperimentBase.Subscription;\r
+import org.simantics.sysdyn.manager.SysdynResult;\r
+import org.simantics.sysdyn.solver.ISolver;\r
+\r
+abstract public class ValueIndexVariableBase<T> extends IndexVariable<T> {\r
+\r
+ public ValueIndexVariableBase(ReadGraph graph, Variable parent, String indexes)\r
+ throws DatabaseException {\r
+ super(graph, parent, indexes);\r
+ ensureInformationAvailable(graph);\r
+ if(experiment instanceof SysdynGameExperimentBase) {\r
+ s = ((SysdynGameExperimentBase) experiment).subscribe(getVariableNamesWithIndexNumbers());\r
+ }\r
+ }\r
+\r
+ public static double[] UNRESOLVED = new double[0];\r
+ \r
+ public Subscription s;\r
+ \r
+ public double[] getValueFull() {\r
+ \r
+ if(experiment == null)\r
+ return UNRESOLVED;\r
+\r
+ if(experiment instanceof SysdynGameExperimentBase) {\r
+ double[] arr = new double[s.indexes.length];\r
+ s.getValues(arr);\r
+ return arr;\r
+ }\r
+\r
+ \r
+ Collection<SysdynResult> results = experiment.getActiveResults();\r
+ ArrayList<String> variableNames = getVariableNamesWithIndexNumbers();\r
+\r
+ double[] result = new double[variableNames.size()];\r
+ for(int i = 0; i < variableNames.size(); i++) {\r
+ for(SysdynResult r : results) { \r
+// if(experiment instanceof SysdynGameExperimentBase) {\r
+// Double d = ((SysdynGameExperimentBase)experiment).getCurrentValue(variableNames.get(i)); \r
+// result[i] = d != null ? d : 0;\r
+// } else {\r
+ SysdynDataSet ds = r.getDataSet(variableNames.get(i));\r
+ if(ds != null && ds.values != null && ds.values.length > 0) {\r
+ result[i] = ds.values[ds.values.length-1];\r
+ } else {\r
+ return UNRESOLVED;\r
+ }\r
+// }\r
+ }\r
+ }\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public void setIndexedValue(WriteGraph graph, Object value)\r
+ throws DatabaseException {\r
+ Variable var = parent.getParent(graph);\r
+ Resource resource = var.getRepresents(graph);\r
+ \r
+ if(!(value instanceof Double || value instanceof double[]) || resource == null)\r
+ return;\r
+ \r
+ double[] values = null;\r
+ if (value instanceof Double) {\r
+ values = new double[1];\r
+ values[0] = (Double)value;\r
+ } else if (value instanceof double[]) {\r
+ values = (double[]) value; \r
+ }\r
+ \r
+// FMUControlJNI control = null;\r
+ if(experiment instanceof SysdynGameExperimentBase) { // Support only game experiments for now..\r
+ \r
+ SysdynGameExperimentBase exp = (SysdynGameExperimentBase)experiment;\r
+ ExperimentState state = exp.getSysdynExperimentState();\r
+ // Set value to control only if the simulation is running or stopped, not before initialization\r
+ if(!(ExperimentState.RUNNING.equals(state) || ExperimentState.STOPPED.equals(state)))\r
+ return;\r
+ \r
+// control = ((SysdynGameExperimentBase)this.experiment).getFMUControl();\r
+// if(control == null) \r
+// return;\r
+ \r
+ ISolver solver = exp.getSolver();\r
+\r
+ try {\r
+ \r
+ ArrayList<String> variableNames = getVariableNamesWithIndexNumbers();\r
+ for(int i = 0; i < variableNames.size() && i < values.length; i++) {\r
+\r
+ if(values[i] == Double.NaN)\r
+ continue;\r
+\r
+ String name = variableNames.get(i);\r
+ solver.setRealValue(name, values[i]);\r
+\r
+ // Set value for all referred variables in modules\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ for(Resource dependency : graph.getObjects(resource, sr.Variable_isTailOf)) {\r
+ Resource head = graph.getPossibleObject(dependency, sr.Variable_HasHead);\r
+ Resource ref = graph.getPossibleObject(dependency, sr.Dependency_refersTo);\r
+ if(ref != null && head != null) {\r
+ String module = "";\r
+ if(name.indexOf(".") > 0)\r
+ module = name.substring(0, name.lastIndexOf(".") + 1);\r
+ String refName = module + NameUtils.getSafeName(graph, head) + "." + NameUtils.getSafeName(graph, ref);\r
+ solver.setRealValue(refName, values[i]);\r
+ } \r
+ }\r
+\r
+ }\r
+ exp.refresh();\r
+ exp.updateSubscriptions();\r
+ \r
+ } catch (Exception e) {\r
+ \r
+ Logger.defaultLogError(e);\r
+ \r
+ }\r
+ \r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.Arrays;\r
+\r
+import org.simantics.databoard.Datatypes;\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.type.Datatype;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+\r
+public class ValueIndexVariableI extends ValueIndexVariableBase<Double> {\r
+\r
+ final int index;\r
+ \r
+ public ValueIndexVariableI(ReadGraph graph, Variable parent, int index) throws DatabaseException {\r
+ super(graph, parent, "");\r
+ this.index = index;\r
+ }\r
+ \r
+ @Override\r
+ public Double getValue() {\r
+ double[] array = getValueFull();\r
+ if(array == null || index < 0 || array.length < index+1) return Double.NaN;\r
+ return array[index];\r
+ }\r
+ \r
+ @Override\r
+ public void setValue(WriteGraph graph, Object value) throws DatabaseException {\r
+ ensureInformationAvailable(graph);\r
+ double[] existing = getValueFull();\r
+ double[] newValue = Arrays.copyOf(existing, existing.length);\r
+ newValue[index] = (Double)value;\r
+ super.setValue(graph, newValue);\r
+ }\r
+ \r
+ @Override\r
+ public void setValue(WriteGraph graph, Object value, Binding binding) throws DatabaseException {\r
+ setValue(graph, value);\r
+ }\r
+ \r
+ @Override\r
+ public String getName(ReadGraph graph) throws DatabaseException {\r
+ return "$" + index;\r
+ }\r
+ \r
+ @Override\r
+ public Object getSerialized(ReadGraph graph) throws DatabaseException {\r
+ return "$" + index;\r
+ }\r
+ \r
+ @Override\r
+ public Datatype getDatatype(ReadGraph graph) throws DatabaseException {\r
+ return Datatypes.DOUBLE;\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.sysdyn.manager.SysdynDataSet;\r
+import org.simantics.sysdyn.manager.SysdynGameExperimentBase;\r
+import org.simantics.sysdyn.manager.SysdynResult;\r
+\r
+public class ValuesIndexVariable extends IndexVariable<double[][]> {\r
+\r
+ public ValuesIndexVariable(ReadGraph graph, Variable parent, String indexes)\r
+ throws DatabaseException {\r
+ super(graph, parent, indexes);\r
+ }\r
+\r
+ @Override\r
+ public double[][] getValue() {\r
+ ArrayList<String> variableNames = getVariableNamesWithIndexNumbers();\r
+ double[][] result = new double[variableNames.size()][];\r
+\r
+ if (experiment != null) {\r
+ Collection<SysdynResult> results = experiment.getActiveResults();\r
+ for(int i = 0; i < variableNames.size(); i++) {\r
+ for(SysdynResult r : results) { \r
+ SysdynDataSet ds = r.getDataSet(variableNames.get(i));\r
+ if(ds != null && ds.values != null) {\r
+ result[i] = new double[ds.values.length];\r
+ for(int j = 0; j < ds.values.length; j++) {\r
+ result[i][j] = ds.values[j];\r
+ }\r
+ \r
+ /*\r
+ * If this is the actual simulation result and experiment is game experiment, \r
+ * get the last value from experiment. It might be different from the result\r
+ * file, if it has been modified in current time step \r
+ */\r
+ if(experiment instanceof SysdynGameExperimentBase && ds.result == null) {\r
+ double d = ((SysdynGameExperimentBase)experiment).getCurrentValue(variableNames.get(i));\r
+ result[i][ds.values.length - 1] = d;\r
+ }\r
+ break; // Show the first result found. (i.e. do not show history datasets)\r
+ }\r
+ \r
+ if(result[i] == null)\r
+ result[i] = new double[0];\r
+ }\r
+ }\r
+ }\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public void setIndexedValue(WriteGraph graph, Object value)\r
+ throws DatabaseException {\r
+ \r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.LinkedHashMap;\r
+import java.util.List;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.request.VariableRead;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynDataSet;\r
+\r
+/**\r
+ * Utils for finding all active rvis for a single variable. A variable can have multiple \r
+ * rvis, if it is an array variable. Active rvis can be limited using a boolean value sr.ShowEnumerationIndexInCharts\r
+ * \r
+ * Example rvis for a variable with two enumerations (/ModuleInstance1/ModuleInstance2/Variable[Enumeration, Enumeration2]): \r
+ * \r
+ * /ModuleInstance1/ModuleInstance2/Variable[index1, index1]\r
+ * /ModuleInstance1/ModuleInstance2/Variable[index1, index2]\r
+ * /ModuleInstance1/ModuleInstance2/Variable[index2, index1]\r
+ * /ModuleInstance1/ModuleInstance2/Variable[index2, index2]\r
+ * \r
+ * \r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class VariableRVIUtils {\r
+\r
+ /**\r
+ * Recursive function for finding number format and label for the set of rvis. (rvis.put("Variable[1]", "Variable[index1]");\r
+ * At the end of the recursive calls, rvis contains all possible combinations of enumeration indexes that are\r
+ * set to be shown in charts\r
+ * \r
+ * @param g ReadGraph\r
+ * @param rvi RVI of the variable\r
+ * @param rvis RVI map containing the full rvi with enumerations. Key contains numerical \r
+ * value of the enumeration and value contains the name of the enumeration (e.g. ["Variable[1]", "Variable[index1]"])\r
+ * @param arrayIndexes ArrayIndex resources, Enumerations.\r
+ * @throws DatabaseException\r
+ */\r
+ private static void traverseIndexes(ReadGraph g, String rvi, HashMap<String, String> rvis, List<Resource> arrayIndexes) throws DatabaseException {\r
+ traverseIndexes(g, rvi, rvis, arrayIndexes, 0, "", "");\r
+ }\r
+\r
+ /**\r
+ * Recursive function for finding number format and label for the set of rvis. (rvis.put("Variable[1]", "Variable[index1]"); \r
+ * At the end of the recursive calls, rvis contains all possible combinations of enumeration indexes that are\r
+ * set to be shown in charts\r
+ * \r
+ * @param g ReadGraph\r
+ * @param rvi RVI of the variable\r
+ * @param rvis RVI map containing the full rvi with enumerations. Key contains numerical \r
+ * @param arrayIndexes ArrayIndex resources, Enumerations.\r
+ * @param currentEnumeration Currently evaluated enumeration index (in arrayIndexes list)\r
+ * @param indexesSoFar String representation of the indexes so far in numerical format\r
+ * @param indexNamesSoFar String representation of the indexes so far in name format\r
+ * @throws DatabaseException\r
+ */\r
+ private static void traverseIndexes(ReadGraph g, String rvi, HashMap<String, String> rvis, List<Resource> arrayIndexes, int currentIndex, String indexesSoFar, String indexNamesSoFar) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(g);\r
+ // Enumeration indexes of the current enumeration (e.g. the first EnumIndexes in Var[EnumIndexes, EnumIndexes, EnumIndexes])\r
+ Resource enumerationIndexes = g.getPossibleObject(arrayIndexes.get(currentIndex), sr.Enumeration_enumerationIndexList);\r
+ if(enumerationIndexes == null)\r
+ return;\r
+ List<Resource> indexes = ListUtils.toList(g, enumerationIndexes);\r
+ for(int i = 0; i < indexes.size(); i++) {\r
+ Boolean b = g.getPossibleRelatedValue(indexes.get(i), sr.EnumerationIndex_showEnumerationIndexInCharts, Bindings.BOOLEAN);\r
+ // If this index is not wanted to be shown in charts, the recursion does not go any further and rvis.put() is not called for this enumeration\r
+ if(Boolean.TRUE.equals(b)) {\r
+ // Get the name of the index\r
+ String name = g.getRelatedValue(indexes.get(i), Layer0.getInstance(g).HasName);\r
+ if(currentIndex < arrayIndexes.size() - 1)\r
+ // If there are still more EnumIndexes, recursively call the function and add current index to indexesSoFar and indexNamesSoFar\r
+ traverseIndexes(g, rvi, rvis, arrayIndexes, currentIndex + 1, \r
+ indexesSoFar + (i + 1) +",", indexNamesSoFar + (name) +",");\r
+ else {\r
+ // The last enumeration. Add [rvi[1, 1, 1] = rvi[index1, index1, index1]}and so on to the rvis map\r
+ rvis.put(\r
+ rvi + "[" + indexesSoFar + (i + 1) + "]", \r
+ rvi + "[" + indexNamesSoFar + (name) + "]");\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Resolves and replaces all overridden enumerations in enumerations -list\r
+ * \r
+ * @param graph ReadGraph\r
+ * @param variable Selected variable\r
+ * @param enumerations List of array indexes of the variable\r
+ * @return\r
+ */\r
+ private static List<Resource> resolveActiveArrayIndexes(ReadGraph graph, Variable variable, List<Resource> enumerations) {\r
+ try {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ String uri = variable.getURI(graph);\r
+ uri = uri.substring(0, uri.lastIndexOf("/"));\r
+ // The parent configuration or module\r
+ Variable v = Variables.getPossibleVariable(graph, uri);\r
+ if(v != null) {\r
+ Resource module = v.getRepresents(graph);\r
+ if(module != null && graph.isInheritedFrom(graph.getSingleObject(module, l0.InstanceOf), sr.Module)) {\r
+ // If the variable is located in a module, it might have overridden (redeclared) enumerations\r
+ boolean somethingIsReplaced = false;\r
+ // Find all redeclarations\r
+ for(Resource redeclaration : graph.syncRequest(new ObjectsWithType(module, sr.Module_redeclaration, sr.Redeclaration))) {\r
+ Resource replaced = graph.getSingleObject(redeclaration, sr.Redeclaration_replacedEnumeration);\r
+ while(enumerations.contains(replaced)) {\r
+ // Replace the redelcared enumeration in enumerations -list with the replacing enumeration\r
+ enumerations.add(enumerations.indexOf(replaced), graph.getSingleObject(redeclaration, sr.Redeclaration_replacingEnumeration));\r
+ enumerations.remove(replaced);\r
+ somethingIsReplaced = true;\r
+ }\r
+ }\r
+\r
+ if(somethingIsReplaced) {\r
+ // If something was replaced, do the same again for the parent configuration. The\r
+ // enumerations may be replaced throughout the whole model hierarchy\r
+ resolveActiveArrayIndexes(graph, v, enumerations);\r
+ }\r
+ }\r
+ }\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+\r
+ }\r
+ return enumerations;\r
+ }\r
+\r
+\r
+ /**\r
+ * Returns rvis in a map in format /ModuleInstance/Variable[1] = /ModuleInstance/Variable[index1]\r
+ * @param graph ReadGraph\r
+ * @param variable Variable for the rvis\r
+ * @return rvis in a map. Keys are numerical formatted array indexes and values are textual.\r
+ * @throws DatabaseException\r
+ */\r
+ public static HashMap<String, String> getActiveRVIs(ReadGraph graph, Variable variable) throws DatabaseException {\r
+ return graph.syncRequest(new GetActiveRVIs(variable));\r
+ }\r
+ \r
+ public static class GetActiveRVIs extends VariableRead<HashMap<String, String>> {\r
+\r
+ public GetActiveRVIs(Variable variable) {\r
+ super(variable);\r
+ }\r
+\r
+ @Override\r
+ public HashMap<String, String> perform(ReadGraph graph) throws DatabaseException {\r
+ HashMap<String, String> rvis = new LinkedHashMap<String, String>();\r
+\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ String rvi = Variables.getRVI(graph, variable);\r
+ Resource r = variable.getRepresents(graph);\r
+\r
+ Resource arrayIndexes = graph.getPossibleObject(r, sr.Variable_arrayIndexesList);\r
+ if(arrayIndexes == null) {\r
+ // If variable is single-dimensional, use the same rvi\r
+ rvis.put(rvi, rvi);\r
+ } else {\r
+ // If variable is multidimensional, get all indexes that are active and add them to rvis-map\r
+ List<Resource> arrayIndexList = ListUtils.toList(graph, arrayIndexes);\r
+ resolveActiveArrayIndexes(graph, variable, arrayIndexList);\r
+\r
+ if(arrayIndexList.size() > 0)\r
+ traverseIndexes(graph, rvi, rvis, arrayIndexList);\r
+ else\r
+ rvis.put(rvi, rvi);\r
+ }\r
+ return rvis;\r
+ }\r
+ }\r
+\r
+ \r
+ /**\r
+ * Filters a list of datasets of a single variable with a given filter. Filter should contain \r
+ * as many entries as the variable has enumerations. If the variable is Var[Enum1, Enum2, Enum3]\r
+ * the filter length should be 3.\r
+ * \r
+ * Allowed filter entries are All, Sum and a name of an index.\r
+ * \r
+ * Example filtering for variable Var[Enum1, Enum2, Enum3] where all enumerations have indexes {1, 2}\r
+ * \r
+ * filter: {All, Sum, 1}\r
+ * \r
+ * Filters are applied from back to front\r
+ * \r
+ * 1 1 1\r
+ * 1 1 2 \r
+ * 1 2 1 1 1 1 \r
+ * 1 2 2 => 1 2 1 => 1 SUM(1 1, 2 1)\r
+ * 2 1 1 2 1 1 2 SUM(1 1, 2 1)\r
+ * 2 1 2 2 2 1 \r
+ * 2 2 1 \r
+ * 2 2 2 \r
+ * \r
+ * @param datasets List of SysdynDatasets for a single multidimensional variable\r
+ * @param filter filter for the datasets\r
+ * @return filtered list of SysdynDatasets\r
+ */\r
+ public static ArrayList<SysdynDataSet> getDataset(ArrayList<SysdynDataSet> datasets, String[] filter) {\r
+ // If all filters are "All", no filtering is required.\r
+ boolean doFiltering = false;\r
+ for(String f : filter) {\r
+ if(!f.equalsIgnoreCase("All")) {\r
+ // One of the filters is not All -> do filtering\r
+ doFiltering = true;\r
+ break;\r
+ }\r
+ }\r
+ \r
+ if(doFiltering == false)\r
+ return datasets;\r
+ \r
+ // Start filtering with the complete set of datasets\r
+ ArrayList<SysdynDataSet> result = datasets;\r
+ \r
+ // Go through the filter from end to start\r
+ for(int i = filter.length - 1; i >= 0; i--) {\r
+ // Get the current filter\r
+ String currentFilter = filter[i].trim();\r
+ \r
+ ArrayList<SysdynDataSet> tempResult = new ArrayList<SysdynDataSet>();\r
+ HashMap<String, SysdynDataSet> sums = new HashMap<String, SysdynDataSet>();\r
+ for(SysdynDataSet dataset : result) {\r
+ String tempIndexes = dataset.name.substring(dataset.name.indexOf('[') + 1, dataset.name.indexOf(']'));\r
+ String[] indexes = tempIndexes.split(",");\r
+ if(currentFilter.equals("All")) {\r
+ /*\r
+ * If the filter is "All", all datasets \r
+ * are kept for the next filtering\r
+ */\r
+ tempResult.add(dataset);\r
+ } else if(currentFilter.equals(indexes[i].trim())) {\r
+ /*\r
+ * If the filter equals the index of the dataset\r
+ * at the same location, the dataset is kept for the next filtering\r
+ * \r
+ * e.g. \r
+ * dataset = Var[index3, index1, index2]\r
+ * filter = {All, index1, ALL}\r
+ * i = 1 (from 0 to 2)\r
+ * \r
+ * dataset's index and filter match at location 1 (the middle index)\r
+ */\r
+ tempResult.add(dataset);\r
+ } else if(currentFilter.equals("Sum")) {\r
+ /*\r
+ * Whenever Sum is used as the filter, all datasets having the\r
+ * same indexes before the sum filter location are summed. \r
+ * \r
+ * e.g.\r
+ * filter = {1, 1, SUM}\r
+ * 1, 1, 1 \r
+ * 1, 1, 2 => 1, 1, SUM(1, 1, 1; 1, 1, 2)\r
+ * 1, 2, 1 1, 2, SUM(1, 2, 1; 1, 2, 2)\r
+ * 1, 2, 2 \r
+ */\r
+ \r
+ // Find the preceding range (e.g. index1index2index2)\r
+ String rangeBefore = "";\r
+ for(int j = 0; j < i; j++)\r
+ rangeBefore += indexes[j].trim();\r
+ \r
+ // Find if there are any datasets for that preceding range in sums\r
+ SysdynDataSet sum = sums.get(rangeBefore);\r
+ if(sum != null) {\r
+ // A sum dataset was found. Add values from this dataset to the sum dataset\r
+ for(int j = 0; j < sum.values.length; j++)\r
+ sum.values[j] = sum.values[j] + dataset.values[j];\r
+ } else {\r
+ // The first occurence of this preceding range, create a new dataset for the sum\r
+ \r
+ // Copy times and values\r
+ double[] times = new double[dataset.times.length];\r
+ for(int j = 0; j < dataset.times.length; j++)\r
+ times[j] = dataset.times[j];\r
+ double[] values = new double[dataset.values.length];\r
+ for(int j = 0; j < dataset.values.length; j++)\r
+ values[j] = dataset.values[j];\r
+ \r
+ // Create the dataset and add it to both tempResult and sums map\r
+ SysdynDataSet newDataset = new SysdynDataSet(dataset.name, dataset.result, times, values);\r
+ tempResult.add(newDataset);\r
+ sums.put(rangeBefore, newDataset);\r
+ \r
+ // Modify the name of the dataset by adding "Sum" to the current index location.\r
+ String name = newDataset.name.substring(0, newDataset.name.indexOf('[') + 1);\r
+ for(int j = 0; j < indexes.length; j++) {\r
+ if(j < i)\r
+ // Indexes before "Sum" stay the same\r
+ name += indexes[j].trim();\r
+ else if(j >= i)\r
+ // Current "Sum" index and indexes after "Sum" are copied from filter\r
+ name += filter[j].trim();\r
+\r
+ if(j < indexes.length - 1)\r
+ name += ", ";\r
+ }\r
+ name += "]";\r
+ \r
+ // Replace the sum dataset's name\r
+ newDataset.name = name;\r
+ }\r
+ \r
+ } else {\r
+ // Discard the series\r
+ }\r
+ }\r
+ \r
+ /*\r
+ * Replace result list with the filtered results and move on to next\r
+ * filter index or return the list \r
+ */\r
+ result.clear();\r
+ for(SysdynDataSet dataset : tempResult)\r
+ result.add(dataset);\r
+ }\r
+ return result;\r
+ }\r
+ \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.concurrent.atomic.AtomicBoolean;\r
+\r
+import org.simantics.db.Session;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.Logger;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.procedure.Listener;\r
+import org.simantics.db.request.ExternalRead;\r
+import org.simantics.db.service.QueryControl;\r
+import org.simantics.utils.datastructures.Callback;\r
+\r
+public class VariableValueSubscription<T> {\r
+ \r
+ public static final long SUBSCRIPTION_COLLECTION_INTERVAL = 2000L;\r
+\r
+ protected ExternalRead<?> request;\r
+ protected IndexVariable<T> variable;\r
+ protected Listener<T> listener;\r
+\r
+ /**\r
+ * To protect against invoking listener.exception multiple times which is\r
+ * forbidden.\r
+ */\r
+ protected AtomicBoolean excepted = new AtomicBoolean(false);\r
+\r
+ public VariableValueSubscription(ExternalRead<?> request, IndexVariable<T> variable, Listener<T> listener) {\r
+ this.request = request;\r
+ this.variable = variable;\r
+ this.listener = listener;\r
+ }\r
+\r
+ public ExternalRead<?> getRequest() {\r
+ return request;\r
+ }\r
+\r
+ public void update() {\r
+ try {\r
+ T value = variable.getValue();\r
+ fireValue(value);\r
+ } catch (Throwable e) {\r
+ fireException(e);\r
+ }\r
+ }\r
+\r
+ void fireValue(T value) {\r
+ if (listener != null)\r
+ listener.execute(value);\r
+ }\r
+\r
+ void fireException(Throwable t) {\r
+ if (listener != null && excepted.compareAndSet(false, true))\r
+ listener.exception(t);\r
+ else\r
+ // Can't invoke listener.exception multiple times, but logging\r
+ // further exceptions anyway.\r
+ Logger.defaultLogError(t);\r
+ }\r
+ \r
+ public void setListener(Listener<T> listener) {\r
+ this.listener = listener;\r
+ }\r
+\r
+ /**\r
+ * This makes sure that subscriptions regarding performed DB external reads\r
+ * are abolished from DB client caches when no longer needed.\r
+ * \r
+ * @param session \r
+ * @param subscriptions\r
+ */\r
+ @SuppressWarnings("rawtypes") \r
+ public static void collectSubscriptions(Session session, final VariableValueSubscription[] subscriptions, final ExternalRead<?>... extraReads) {\r
+ if (subscriptions.length == 0 && extraReads.length == 0)\r
+ return;\r
+\r
+ session.asyncRequest(new WriteRequest() {\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ Collection<ExternalRead<?>> requests = new ArrayList<ExternalRead<?>>(subscriptions.length + extraReads.length);\r
+ for (VariableValueSubscription subscription : subscriptions)\r
+ requests.add(subscription.getRequest());\r
+ for (ExternalRead<?> read : extraReads)\r
+ requests.add(read);\r
+ graph.getService(QueryControl.class).gc(graph, requests);\r
+ }\r
+ }, new Callback<DatabaseException>() {\r
+ @Override\r
+ public void run(DatabaseException e) {\r
+ if (e != null)\r
+ e.printStackTrace();\r
+ }\r
+ });\r
+ }\r
+\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter.distribution;\r
+\r
+public interface IDistribution {\r
+\r
+ /**\r
+ * Map a probability to the random variable.\r
+ * When random numbers are used to generate the Monte Carlo simulation parameters, the probability\r
+ * is itself selected randomly (between (0,1); at the domain endpoints the value is undefined).\r
+ * \r
+ * @param probability\r
+ * @return Inverse cumulative distribution function at probability, i.e. the random variable at the\r
+ * point where the cumulative distribution function yields probability.\r
+ */\r
+ public double inverseCDF(double probability);\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter.distribution;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class Interval implements IDistribution {\r
+ \r
+ private double min = 0;\r
+ private double max = 10;\r
+ private double intervalLength = 1;\r
+ private int numberOfValues = 10;\r
+ private int index = 0;\r
+ \r
+ public Interval(ReadGraph graph, Resource distribution) {\r
+\r
+ try {\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+\r
+ Double minValue = graph.getPossibleRelatedValue(distribution, SR.Interval_minValue, Bindings.DOUBLE);\r
+ if(minValue != null)\r
+ this.min = minValue;\r
+ \r
+ Double maxValue = graph.getPossibleRelatedValue(distribution, SR.Interval_maxValue, Bindings.DOUBLE);\r
+ if(maxValue != null)\r
+ this.max = maxValue;\r
+ \r
+ Resource parameter = graph.getPossibleObject(distribution, SR.SensitivityAnalysisExperiment_Parameter_propabilityDistribution_Inverse);\r
+ \r
+ Resource experiment = graph.getPossibleObject(parameter, Layer0.getInstance(graph).PartOf);\r
+\r
+ Integer numberOfValues = graph.getPossibleRelatedValue(experiment, SR.SensitivityAnalysisExperiment_numberOfValues, Bindings.INTEGER);\r
+ if(numberOfValues != null)\r
+ this.numberOfValues = numberOfValues;\r
+ \r
+ intervalLength = (maxValue - minValue) / (this.numberOfValues - 1);\r
+ \r
+ } catch (DatabaseException e) {\r
+\r
+ }\r
+ }\r
+\r
+ public double getMin() {\r
+ return min;\r
+ }\r
+\r
+ public double getMax() {\r
+ return max;\r
+ }\r
+\r
+ public int getNumberOfValues() {\r
+ return numberOfValues;\r
+ }\r
+\r
+ public double getIntervalLength() {\r
+ return intervalLength;\r
+ }\r
+\r
+ @Override\r
+ public double inverseCDF(double probability) {\r
+ // This is a bit awkward...\r
+ double value = min + (intervalLength * index);\r
+ index++;\r
+ if (index >= numberOfValues)\r
+ index = 0;\r
+ return value;\r
+ }\r
+ \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter.distribution;\r
+\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class NormalDistribution implements IDistribution {\r
+\r
+ private Double min = null;\r
+ private Double max = null;\r
+ private double minProbability = 0;\r
+ private double maxProbability = 1;\r
+ private double mean;\r
+ private double stdDeviation; \r
+ \r
+ public NormalDistribution(ReadGraph graph, Resource distribution) {\r
+\r
+ try {\r
+\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+\r
+ min = graph.getPossibleRelatedValue(distribution, SR.NormalDistribution_minValue, Bindings.DOUBLE);\r
+ max = graph.getPossibleRelatedValue(distribution, SR.NormalDistribution_maxValue, Bindings.DOUBLE);\r
+ stdDeviation = graph.getPossibleRelatedValue(distribution, SR.NormalDistribution_stdDeviation, Bindings.DOUBLE);\r
+ mean = graph.getPossibleRelatedValue(distribution, SR.NormalDistribution_mean, Bindings.DOUBLE);\r
+ \r
+ // Determine the max and min probabilities.\r
+ if (min != null)\r
+ minProbability = cdf(min, mean, stdDeviation, false);\r
+ if (max != null)\r
+ maxProbability = cdf(max, mean, stdDeviation, false);\r
+\r
+ } catch (DatabaseException e) {\r
+\r
+ }\r
+ }\r
+ \r
+ public double getMin() {\r
+ return min;\r
+ }\r
+\r
+ public double getMax() {\r
+ return max;\r
+ }\r
+ \r
+ @Override\r
+ public double inverseCDF(double probability) {\r
+ // Map probability to [min,max]\r
+ double mappedProbability = minProbability + (maxProbability - minProbability) * probability;\r
+ // Calculate the inverse CDF\r
+ return quantile(mappedProbability, mean, stdDeviation);\r
+ }\r
+\r
+ //The following is from BEAST-MCMC (https://code.google.com/p/beast-mcmc/)\r
+ \r
+ /*\r
+ * NormalDistribution.java\r
+ *\r
+ * Copyright (c) 2002-2011 Alexei Drummond, Andrew Rambaut and Marc Suchard\r
+ *\r
+ * This file is part of BEAST.\r
+ * See the NOTICE file distributed with this work for additional\r
+ * information regarding copyright ownership and licensing.\r
+ *\r
+ * BEAST is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as\r
+ * published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * BEAST is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with BEAST; if not, write to the\r
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,\r
+ * Boston, MA 02110-1301 USA\r
+ */\r
+ \r
+ /**\r
+ * quantiles (=inverse cumulative density function)\r
+ *\r
+ * @param z argument\r
+ * @param m mean\r
+ * @param sd standard deviation\r
+ * @return icdf at z\r
+ */\r
+ public static double quantile(double z, double m, double sd) {\r
+ return m + Math.sqrt(2.0) * sd * inverseErf(2.0 * z - 1.0);\r
+ }\r
+ \r
+ /** A more accurate and faster implementation of the cdf (taken from function pnorm in the R statistical language)\r
+ * This implementation has discrepancies depending on the programming language and system architecture\r
+ * In Java, returned values become zero once z reaches -37.5193 exactly on the machine tested\r
+ * In the other implementation, the returned value 0 at about z = -8\r
+ * In C, this 0 value is reached approximately z = -37.51938\r
+ *\r
+ * Will later need to be optimised for BEAST\r
+ *\r
+ * @param x argument\r
+ * @param mu mean\r
+ * @param sigma standard deviation\r
+ * @param log_p is p logged\r
+ * @return cdf at x\r
+ */\r
+ public static double cdf(double x, double mu, double sigma, boolean log_p) {\r
+ boolean i_tail=false;\r
+ double p, cp = Double.NaN;\r
+\r
+ if(Double.isNaN(x) || Double.isNaN(mu) || Double.isNaN(sigma)) {\r
+ return Double.NaN;\r
+ }\r
+ if(Double.isInfinite(x) && mu == x) { /* x-mu is NaN */\r
+ return Double.NaN;\r
+ }\r
+ if (sigma <= 0) {\r
+ if(sigma < 0) {\r
+ return Double.NaN;\r
+ }\r
+ return (x < mu) ? 0.0 : 1.0;\r
+ }\r
+ p = (x - mu) / sigma;\r
+ if(Double.isInfinite(p)) {\r
+ return (x < mu) ? 0.0 : 1.0;\r
+ }\r
+ x = p;\r
+ if(Double.isNaN(x)) {\r
+ return Double.NaN;\r
+ }\r
+\r
+ double xden, xnum, temp, del, eps, xsq, y;\r
+ int i;\r
+ boolean lower, upper;\r
+ eps = DBL_EPSILON * 0.5;\r
+ lower = !i_tail;\r
+ upper = i_tail;\r
+\r
+ y = Math.abs(x);\r
+ if (y <= 0.67448975) { /* Normal.quantile(3/4, 1, 0) = 0.67448975 */\r
+ if (y > eps) {\r
+ xsq = x * x;\r
+ xnum = a[4] * xsq;\r
+ xden = xsq;\r
+ for (i = 0; i < 3; i++) {\r
+ xnum = (xnum + a[i]) * xsq;\r
+ xden = (xden + b[i]) * xsq;\r
+ }\r
+ }\r
+ else {\r
+ xnum = xden = 0.0;\r
+ }\r
+ temp = x * (xnum + a[3]) / (xden + b[3]);\r
+ if(lower) {\r
+ p = 0.5 + temp;\r
+ }\r
+ if(upper) {\r
+ cp = 0.5 - temp;\r
+ }\r
+ if(log_p) {\r
+ if(lower) {\r
+ p = Math.log(p);\r
+ }\r
+ if(upper) {\r
+ cp = Math.log(cp);\r
+ }\r
+ }\r
+ }\r
+\r
+\r
+ else if (y <= M_SQRT_32) {\r
+ /* Evaluate pnorm for 0.67448975 = Normal.quantile(3/4, 1, 0) < |x| <= sqrt(32) ~= 5.657 */\r
+\r
+ xnum = c[8] * y;\r
+ xden = y;\r
+ for (i = 0; i < 7; i++) {\r
+ xnum = (xnum + c[i]) * y;\r
+ xden = (xden + d[i]) * y;\r
+ }\r
+ temp = (xnum + c[7]) / (xden + d[7]);\r
+\r
+ //do_del(y);\r
+ //swap_tail;\r
+ //#define do_del(X) \\r
+ xsq = ((int) (y * CUTOFF)) * 1.0 / CUTOFF;\r
+ del = (y - xsq) * (y + xsq);\r
+ if(log_p) {\r
+ p = (-xsq * xsq * 0.5) + (-del * 0.5) + Math.log(temp);\r
+ if((lower && x > 0.0) || (upper && x <= 0.0)) {\r
+ cp = Math.log(1.0-Math.exp(-xsq * xsq * 0.5) * Math.exp(-del * 0.5) * temp);\r
+ }\r
+ }\r
+ else {\r
+ p = Math.exp(-xsq * xsq * 0.5) * Math.exp(-del * 0.5) * temp;\r
+ cp = 1.0 - p;\r
+ }\r
+ //#define swap_tail \\r
+ if (x > 0.0) {\r
+ temp = p;\r
+ if(lower) {\r
+ p = cp;\r
+ }\r
+ cp = temp;\r
+ }\r
+ }\r
+ /* else |x| > sqrt(32) = 5.657 :\r
+ * the next two case differentiations were really for lower=T, log=F\r
+ * Particularly *not* for log_p !\r
+ * Cody had (-37.5193 < x && x < 8.2924) ; R originally had y < 50\r
+ * Note that we do want symmetry(0), lower/upper -> hence use y\r
+ */\r
+ else if(log_p || (lower && -37.5193 < x && x < 8.2924)\r
+ || (upper && -8.2924 < x && x < 37.5193)) {\r
+\r
+ /* Evaluate pnorm for x in (-37.5, -5.657) union (5.657, 37.5) */\r
+ xsq = 1.0 / (x * x);\r
+ xnum = p_[5] * xsq;\r
+ xden = xsq;\r
+ for (i = 0; i < 4; i++) {\r
+ xnum = (xnum + p_[i]) * xsq;\r
+ xden = (xden + q[i]) * xsq;\r
+ }\r
+ temp = xsq * (xnum + p_[4]) / (xden + q[4]);\r
+ temp = (M_1_SQRT_2PI - temp) / y;\r
+\r
+ //do_del(x);\r
+ xsq = ((int) (x * CUTOFF)) * 1.0 / CUTOFF;\r
+ del = (x - xsq) * (x + xsq);\r
+ if(log_p) {\r
+ p = (-xsq * xsq * 0.5) + (-del * 0.5) + Math.log(temp);\r
+ if((lower && x > 0.0) || (upper && x <= 0.0)) {\r
+ cp = Math.log(1.0-Math.exp(-xsq * xsq * 0.5) * Math.exp(-del * 0.5) * temp);\r
+ }\r
+ }\r
+ else {\r
+ p = Math.exp(-xsq * xsq * 0.5) * Math.exp(-del * 0.5) * temp;\r
+ cp = 1.0 - p;\r
+ }\r
+ //swap_tail;\r
+ if (x > 0.0) {\r
+ temp = p;\r
+ if(lower) {\r
+ p = cp;\r
+ }\r
+ cp = temp;\r
+ }\r
+ }\r
+ else { /* no log_p , large x such that probs are 0 or 1 */\r
+ if(x > 0) {\r
+ p = 1.0;\r
+ cp = 0.0;\r
+ }\r
+ else {\r
+ p = 0.0;\r
+ cp = 1.0;\r
+ }\r
+ }\r
+ return p;\r
+\r
+ }\r
+\r
+ // Private\r
+\r
+ protected double m, sd;\r
+\r
+ private static final double[] a = {\r
+ 2.2352520354606839287,\r
+ 161.02823106855587881,\r
+ 1067.6894854603709582,\r
+ 18154.981253343561249,\r
+ 0.065682337918207449113\r
+ };\r
+ private static final double[] b = {\r
+ 47.20258190468824187,\r
+ 976.09855173777669322,\r
+ 10260.932208618978205,\r
+ 45507.789335026729956\r
+ };\r
+ private static final double[] c = {\r
+ 0.39894151208813466764,\r
+ 8.8831497943883759412,\r
+ 93.506656132177855979,\r
+ 597.27027639480026226,\r
+ 2494.5375852903726711,\r
+ 6848.1904505362823326,\r
+ 11602.651437647350124,\r
+ 9842.7148383839780218,\r
+ 1.0765576773720192317e-8\r
+ };\r
+ private static final double[] d = {\r
+ 22.266688044328115691,\r
+ 235.38790178262499861,\r
+ 1519.377599407554805,\r
+ 6485.558298266760755,\r
+ 18615.571640885098091,\r
+ 34900.952721145977266,\r
+ 38912.003286093271411,\r
+ 19685.429676859990727\r
+ };\r
+ private static final double[] p_ = {\r
+ 0.21589853405795699,\r
+ 0.1274011611602473639,\r
+ 0.022235277870649807,\r
+ 0.001421619193227893466,\r
+ 2.9112874951168792e-5,\r
+ 0.02307344176494017303\r
+ };\r
+ private static final double[] q = {\r
+ 1.28426009614491121,\r
+ 0.468238212480865118,\r
+ 0.0659881378689285515,\r
+ 0.00378239633202758244,\r
+ 7.29751555083966205e-5\r
+ };\r
+\r
+ private static final int CUTOFF = 16; /* Cutoff allowing exact "*" and "/" */\r
+\r
+ private static final double M_SQRT_32 = 5.656854249492380195206754896838; /* The square root of 32 */\r
+ private static final double M_1_SQRT_2PI = 0.398942280401432677939946059934;\r
+ private static final double DBL_EPSILON = 2.2204460492503131e-016;\r
+ \r
+ /*\r
+ * ErrorFunction.java\r
+ *\r
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut\r
+ *\r
+ * This file is part of BEAST.\r
+ * See the NOTICE file distributed with this work for additional\r
+ * information regarding copyright ownership and licensing.\r
+ *\r
+ * BEAST is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as\r
+ * published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * BEAST is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with BEAST; if not, write to the\r
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,\r
+ * Boston, MA 02110-1301 USA\r
+ */\r
+ \r
+ /**\r
+ * inverse error function\r
+ *\r
+ * @param z argument\r
+ *\r
+ * @return function value\r
+ */\r
+ public static double inverseErf(double z)\r
+ {\r
+ return pointNormal(0.5*z+0.5)/Math.sqrt(2.0);\r
+ }\r
+ \r
+ // Private\r
+ \r
+ // Returns z so that Prob{x<z}=prob where x ~ N(0,1) and (1e-12) < prob<1-(1e-12)\r
+ private static double pointNormal(double prob)\r
+ {\r
+ // Odeh RE & Evans JO (1974) The percentage points of the normal distribution.\r
+ // Applied Statistics 22: 96-97 (AS70)\r
+ \r
+ // Newer methods:\r
+ // Wichura MJ (1988) Algorithm AS 241: the percentage points of the\r
+ // normal distribution. 37: 477-484.\r
+ // Beasley JD & Springer SG (1977). Algorithm AS 111: the percentage \r
+ // points of the normal distribution. 26: 118-121.\r
+ \r
+ double a0 = -0.322232431088, a1 = -1, a2 = -0.342242088547, a3 = -0.0204231210245;\r
+ double a4 = -0.453642210148e-4, b0 = 0.0993484626060, b1 = 0.588581570495;\r
+ double b2 = 0.531103462366, b3 = 0.103537752850, b4 = 0.0038560700634;\r
+ double y, z = 0, p = prob, p1;\r
+ \r
+ p1 = (p < 0.5 ? p : 1-p);\r
+ if (p1 < 1e-20)\r
+ {\r
+ new IllegalArgumentException("Argument prob out of range");\r
+ }\r
+ \r
+ y = Math.sqrt(Math.log(1/(p1*p1))); \r
+ z = y + ((((y*a4+a3)*y+a2)*y+a1)*y+a0)/((((y*b4+b3)*y+b2)*y+b1)*y+b0);\r
+ return (p < 0.5 ? -z : z);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter.distribution;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class UniformDistribution implements IDistribution {\r
+ \r
+ private double min;\r
+ private double max;\r
+ \r
+ public UniformDistribution(ReadGraph graph, Resource distribution) {\r
+\r
+ try {\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+\r
+ Double minValue = graph.getPossibleRelatedValue(distribution, SR.UniformDistribution_minValue, Bindings.DOUBLE);\r
+ if(minValue != null)\r
+ this.min = minValue;\r
+ \r
+ Double maxValue = graph.getPossibleRelatedValue(distribution, SR.UniformDistribution_maxValue, Bindings.DOUBLE);\r
+ if(maxValue != null)\r
+ this.max = maxValue;\r
+ \r
+ } catch (DatabaseException e) {\r
+\r
+ }\r
+ }\r
+\r
+ public double getMin() {\r
+ return min;\r
+ }\r
+\r
+ public double getMax() {\r
+ return max;\r
+ }\r
+\r
+ @Override\r
+ public double inverseCDF(double probability) {\r
+ return min + probability * (max - min); \r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter.generator;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Halton sequence generator that creates ArrayLists of Doubles between 0 and 1.\r
+ * \r
+ * @author Tuomas Miettinen\r
+ */\r
+public class HaltonSequenceGenerator implements IGenerator {\r
+ \r
+ private int dimension;\r
+ private int index = 0;\r
+ private ArrayList<Integer> primes;\r
+ \r
+ private void getPrimes() {\r
+ int newPrime = 2;\r
+ while (primes.size() < dimension) {\r
+ boolean isPrime = true;\r
+ for (int p : primes) {\r
+ if (newPrime % p == 0) {\r
+ ++newPrime;\r
+ isPrime = false;\r
+ break;\r
+ }\r
+ }\r
+ if (isPrime) {\r
+ primes.add(newPrime); \r
+ }\r
+ }\r
+ }\r
+ \r
+ public HaltonSequenceGenerator(ReadGraph graph, Resource method) {\r
+ \r
+ try {\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ Resource experiment = graph.getPossibleObject(method, SR.SensitivityAnalysisExperiment_method_Inverse);\r
+ Resource parameterListResource = graph.getPossibleObject(experiment, SR.SensitivityAnalysisExperiment_parameterList);\r
+ dimension = ListUtils.getListNodes(graph, parameterListResource).size();\r
+\r
+ primes = new ArrayList<Integer>();\r
+ getPrimes();\r
+ \r
+ initialize();\r
+ } catch (DatabaseException e) {\r
+ \r
+ }\r
+ }\r
+\r
+ public static double getHalton(int index, int base) {\r
+ ++index; // Map indexes to start from 1;\r
+ double result = 0;\r
+ double f = 1.0 / base;\r
+ while (index > 0) {\r
+ result = result + f * (index % base);\r
+ index = index / base;\r
+ f = f / base;\r
+ }\r
+ return result;\r
+ }\r
+ \r
+ public List<Double> next() {\r
+ ArrayList<Double> retval = new ArrayList<Double>();\r
+ for (int i = 0; i < dimension; ++i) {\r
+ int base = primes.get(i);\r
+ double halton = getHalton(index, base);\r
+ retval.add(halton);\r
+ }\r
+ ++index;\r
+ return retval;\r
+ }\r
+ \r
+ public void initialize() {\r
+ index = 0;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter.generator;\r
+\r
+import java.util.List;\r
+\r
+/**\r
+ * Interface for parameter value generators. \r
+ * \r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public interface IGenerator {\r
+\r
+ /**\r
+ * Get the next parameter combination.\r
+ * @return list of generated parameter values \r
+ */\r
+ public List<Double> next();\r
+ \r
+ /**\r
+ * Initialize the generator.\r
+ */\r
+ public void initialize();\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.adapter.generator;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import java.util.Random;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Random generator that creates ArrayLists of random Doubles between 0 and 1.\r
+ * \r
+ * @author Tuomas Miettinen\r
+ */\r
+\r
+public class RandomGenerator implements IGenerator {\r
+ \r
+ private int seed;\r
+ private int dimension;\r
+ private Random random;\r
+ \r
+ public RandomGenerator(ReadGraph graph, Resource method) {\r
+ \r
+ try {\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ Resource experiment = graph.getPossibleObject(method, SR.SensitivityAnalysisExperiment_method_Inverse);\r
+ seed = graph.getPossibleRelatedValue(experiment, SR.SensitivityAnalysisExperiment_randomSeed, Bindings.INTEGER);\r
+ \r
+ Resource parameterListResource = graph.getPossibleObject(experiment, SR.SensitivityAnalysisExperiment_parameterList);\r
+ dimension = ListUtils.getListNodes(graph, parameterListResource).size();\r
+\r
+ initialize();\r
+ } catch (DatabaseException e) {\r
+ \r
+ }\r
+ }\r
+\r
+ public List<Double> next() {\r
+ ArrayList<Double> randoms = new ArrayList<Double>();\r
+ for (int i = 0; i < dimension; ++i)\r
+ randoms.add(random.nextDouble());\r
+ return randoms;\r
+ }\r
+ \r
+ public void initialize() {\r
+ random = new Random(this.seed);\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.elementaryCycles;
+
+import java.util.Vector;
+
+
+/**
+ * Calculates the adjacency-list for a given adjacency-matrix.
+ *
+ *
+ * @author Frank Meyer, web@normalisiert.de
+ * @version 1.0, 26.08.2006
+ *
+ */
+public class AdjacencyList {
+ /**
+ * Calculates a adjacency-list for a given array of an adjacency-matrix.
+ *
+ * @param adjacencyMatrix array with the adjacency-matrix that represents
+ * the graph
+ * @return int[][]-array of the adjacency-list of given nodes. The first
+ * dimension in the array represents the same node as in the given
+ * adjacency, the second dimension represents the indicies of those nodes,
+ * that are direct successornodes of the node.
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public static int[][] getAdjacencyList(boolean[][] adjacencyMatrix) {
+ int[][] list = new int[adjacencyMatrix.length][];
+
+ for (int i = 0; i < adjacencyMatrix.length; i++) {
+ Vector v = new Vector();
+ for (int j = 0; j < adjacencyMatrix[i].length; j++) {
+ if (adjacencyMatrix[i][j]) {
+ v.add(new Integer(j));
+ }
+ }
+
+ list[i] = new int[v.size()];
+ for (int j = 0; j < v.size(); j++) {
+ Integer in = (Integer) v.get(j);
+ list[i][j] = in.intValue();
+ }
+ }
+
+ return list;
+ }
+}
--- /dev/null
+package org.simantics.sysdyn.elementaryCycles;
+
+import java.util.List;
+import java.util.Vector;
+
+
+
+/**
+ * Searchs all elementary cycles in a given directed graph. The implementation
+ * is independent from the concrete objects that represent the graphnodes, it
+ * just needs an array of the objects representing the nodes the graph
+ * and an adjacency-matrix of type boolean, representing the edges of the
+ * graph. It then calculates based on the adjacency-matrix the elementary
+ * cycles and returns a list, which contains lists itself with the objects of the
+ * concrete graphnodes-implementation. Each of these lists represents an
+ * elementary cycle.<br><br>
+ *
+ * The implementation uses the algorithm of Donald B. Johnson for the search of
+ * the elementary cycles. For a description of the algorithm see:<br>
+ * Donald B. Johnson: Finding All the Elementary Circuits of a Directed Graph.
+ * SIAM Journal on Computing. Volumne 4, Nr. 1 (1975), pp. 77-84.<br><br>
+ *
+ * The algorithm of Johnson is based on the search for strong connected
+ * components in a graph. For a description of this part see:<br>
+ * Robert Tarjan: Depth-first search and linear graph algorithms. In: SIAM
+ * Journal on Computing. Volume 1, Nr. 2 (1972), pp. 146-160.<br>
+ *
+ * @author Frank Meyer, web_at_normalisiert_dot_de
+ * @version 1.2, 22.03.2009
+ *
+ */
+@SuppressWarnings("rawtypes")
+public class ElementaryCyclesSearch {
+ /** List of cycles */
+ private List cycles = null;
+
+ /** Adjacency-list of graph */
+ private int[][] adjList = null;
+
+ /** Graphnodes */
+ private Object[] graphNodes = null;
+
+ /** Blocked nodes, used by the algorithm of Johnson */
+ private boolean[] blocked = null;
+
+ /** B-Lists, used by the algorithm of Johnson */
+ private Vector[] B = null;
+
+ /** Stack for nodes, used by the algorithm of Johnson */
+ private Vector stack = null;
+
+ /**
+ * Constructor.
+ *
+ * @param matrix adjacency-matrix of the graph
+ * @param graphNodes array of the graphnodes of the graph; this is used to
+ * build sets of the elementary cycles containing the objects of the original
+ * graph-representation
+ */
+ public ElementaryCyclesSearch(boolean[][] matrix, Object[] graphNodes) {
+ this.graphNodes = graphNodes;
+ this.adjList = AdjacencyList.getAdjacencyList(matrix);
+ }
+
+ /**
+ * Returns List::List::Object with the Lists of nodes of all elementary
+ * cycles in the graph.
+ *
+ * @return List::List::Object with the Lists of the elementary cycles.
+ */
+ public List getElementaryCycles() {
+ this.cycles = new Vector();
+ this.blocked = new boolean[this.adjList.length];
+ this.B = new Vector[this.adjList.length];
+ this.stack = new Vector();
+ StrongConnectedComponents sccs = new StrongConnectedComponents(this.adjList);
+ int s = 0;
+
+ while (true) {
+ SCCResult sccResult = sccs.getAdjacencyList(s);
+ if (sccResult != null && sccResult.getAdjList() != null) {
+ Vector[] scc = sccResult.getAdjList();
+ s = sccResult.getLowestNodeId();
+ for (int j = 0; j < scc.length; j++) {
+ if ((scc[j] != null) && (scc[j].size() > 0)) {
+ this.blocked[j] = false;
+ this.B[j] = new Vector();
+ }
+ }
+
+ this.findCycles(s, s, scc);
+ s++;
+ } else {
+ break;
+ }
+ }
+
+ return this.cycles;
+ }
+
+ /**
+ * Calculates the cycles containing a given node in a strongly connected
+ * component. The method calls itself recursivly.
+ *
+ * @param v
+ * @param s
+ * @param adjList adjacency-list with the subgraph of the strongly
+ * connected component s is part of.
+ * @return true, if cycle found; false otherwise
+ */
+ @SuppressWarnings("unchecked")
+ private boolean findCycles(int v, int s, Vector[] adjList) {
+ boolean f = false;
+ this.stack.add(new Integer(v));
+ this.blocked[v] = true;
+
+ for (int i = 0; i < adjList[v].size(); i++) {
+ int w = ((Integer) adjList[v].get(i)).intValue();
+ // found cycle
+ if (w == s) {
+ Vector cycle = new Vector();
+ for (int j = 0; j < this.stack.size(); j++) {
+ int index = ((Integer) this.stack.get(j)).intValue();
+ cycle.add(this.graphNodes[index]);
+ }
+ this.cycles.add(cycle);
+ f = true;
+ } else if (!this.blocked[w]) {
+ if (this.findCycles(w, s, adjList)) {
+ f = true;
+ }
+ }
+ }
+
+ if (f) {
+ this.unblock(v);
+ } else {
+ for (int i = 0; i < adjList[v].size(); i++) {
+ int w = ((Integer) adjList[v].get(i)).intValue();
+ if (!this.B[w].contains(new Integer(v))) {
+ this.B[w].add(new Integer(v));
+ }
+ }
+ }
+
+ this.stack.remove(new Integer(v));
+ return f;
+ }
+
+ /**
+ * Unblocks recursivly all blocked nodes, starting with a given node.
+ *
+ * @param node node to unblock
+ */
+ private void unblock(int node) {
+ this.blocked[node] = false;
+ Vector Bnode = this.B[node];
+ while (Bnode.size() > 0) {
+ Integer w = (Integer) Bnode.get(0);
+ Bnode.remove(0);
+ if (this.blocked[w.intValue()]) {
+ this.unblock(w.intValue());
+ }
+ }
+ }
+}
+
--- /dev/null
+package org.simantics.sysdyn.elementaryCycles;\r
+\r
+import java.util.HashSet;\r
+import java.util.Set;\r
+import java.util.Vector;\r
+\r
+@SuppressWarnings("rawtypes")\r
+public class SCCResult {\r
+ private Set nodeIDsOfSCC = null;\r
+ private Vector[] adjList = null;\r
+ private int lowestNodeId = -1;\r
+ \r
+ @SuppressWarnings("unchecked")\r
+ public SCCResult(Vector[] adjList, int lowestNodeId) {\r
+ this.adjList = adjList;\r
+ this.lowestNodeId = lowestNodeId;\r
+ this.nodeIDsOfSCC = new HashSet();\r
+ if (this.adjList != null) {\r
+ for (int i = this.lowestNodeId; i < this.adjList.length; i++) {\r
+ if (this.adjList[i].size() > 0) {\r
+ this.nodeIDsOfSCC.add(new Integer(i));\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ public Vector[] getAdjList() {\r
+ return adjList;\r
+ }\r
+\r
+ public int getLowestNodeId() {\r
+ return lowestNodeId;\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.elementaryCycles;
+
+
+import java.util.Vector;
+
+/**
+ * This is a helpclass for the search of all elementary cycles in a graph
+ * with the algorithm of Johnson. For this it searches for strong connected
+ * components, using the algorithm of Tarjan. The constructor gets an
+ * adjacency-list of a graph. Based on this graph, it gets a nodenumber s,
+ * for which it calculates the subgraph, containing all nodes
+ * {s, s + 1, ..., n}, where n is the highest nodenumber in the original
+ * graph (e.g. it builds a subgraph with all nodes with higher or same
+ * nodenumbers like the given node s). It returns the strong connected
+ * component of this subgraph which contains the lowest nodenumber of all
+ * nodes in the subgraph.<br><br>
+ *
+ * For a description of the algorithm for calculating the strong connected
+ * components see:<br>
+ * Robert Tarjan: Depth-first search and linear graph algorithms. In: SIAM
+ * Journal on Computing. Volume 1, Nr. 2 (1972), pp. 146-160.<br>
+ * For a description of the algorithm for searching all elementary cycles in
+ * a directed graph see:<br>
+ * Donald B. Johnson: Finding All the Elementary Circuits of a Directed Graph.
+ * SIAM Journal on Computing. Volumne 4, Nr. 1 (1975), pp. 77-84.<br><br>
+ *
+ * @author Frank Meyer, web_at_normalisiert_dot_de
+ * @version 1.1, 22.03.2009
+ *
+ */
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class StrongConnectedComponents {
+ /** Adjacency-list of original graph */
+ private int[][] adjListOriginal = null;
+
+ /** Adjacency-list of currently viewed subgraph */
+ private int[][] adjList = null;
+
+ /** Helpattribute for finding scc's */
+ private boolean[] visited = null;
+
+ /** Helpattribute for finding scc's */
+ private Vector stack = null;
+
+ /** Helpattribute for finding scc's */
+ private int[] lowlink = null;
+
+ /** Helpattribute for finding scc's */
+ private int[] number = null;
+
+ /** Helpattribute for finding scc's */
+ private int sccCounter = 0;
+
+ /** Helpattribute for finding scc's */
+ private Vector currentSCCs = null;
+
+ /**
+ * Constructor.
+ *
+ * @param adjList adjacency-list of the graph
+ */
+ public StrongConnectedComponents(int[][] adjList) {
+ this.adjListOriginal = adjList;
+ }
+
+ /**
+ * This method returns the adjacency-structure of the strong connected
+ * component with the least vertex in a subgraph of the original graph
+ * induced by the nodes {s, s + 1, ..., n}, where s is a given node. Note
+ * that trivial strong connected components with just one node will not
+ * be returned.
+ *
+ * @param node node s
+ * @return SCCResult with adjacency-structure of the strong
+ * connected component; null, if no such component exists
+ */
+ public SCCResult getAdjacencyList(int node) {
+ this.visited = new boolean[this.adjListOriginal.length];
+ this.lowlink = new int[this.adjListOriginal.length];
+ this.number = new int[this.adjListOriginal.length];
+ this.visited = new boolean[this.adjListOriginal.length];
+ this.stack = new Vector();
+ this.currentSCCs = new Vector();
+
+ this.makeAdjListSubgraph(node);
+
+ for (int i = node; i < this.adjListOriginal.length; i++) {
+ if (!this.visited[i]) {
+ this.getStrongConnectedComponents(i);
+ Vector nodes = this.getLowestIdComponent();
+ if (nodes != null && !nodes.contains(new Integer(node)) && !nodes.contains(new Integer(node + 1))) {
+ return this.getAdjacencyList(node + 1);
+ } else {
+ Vector[] adjacencyList = this.getAdjList(nodes);
+ if (adjacencyList != null) {
+ for (int j = 0; j < this.adjListOriginal.length; j++) {
+ if (adjacencyList[j].size() > 0) {
+ return new SCCResult(adjacencyList, j);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Builds the adjacency-list for a subgraph containing just nodes
+ * >= a given index.
+ *
+ * @param node Node with lowest index in the subgraph
+ */
+ private void makeAdjListSubgraph(int node) {
+ this.adjList = new int[this.adjListOriginal.length][0];
+
+ for (int i = node; i < this.adjList.length; i++) {
+ Vector successors = new Vector();
+ for (int j = 0; j < this.adjListOriginal[i].length; j++) {
+ if (this.adjListOriginal[i][j] >= node) {
+ successors.add(new Integer(this.adjListOriginal[i][j]));
+ }
+ }
+ if (successors.size() > 0) {
+ this.adjList[i] = new int[successors.size()];
+ for (int j = 0; j < successors.size(); j++) {
+ Integer succ = (Integer) successors.get(j);
+ this.adjList[i][j] = succ.intValue();
+ }
+ }
+ }
+ }
+
+ /**
+ * Calculates the strong connected component out of a set of scc's, that
+ * contains the node with the lowest index.
+ *
+ * @return Vector::Integer of the scc containing the lowest nodenumber
+ */
+ private Vector getLowestIdComponent() {
+ int min = this.adjList.length;
+ Vector currScc = null;
+
+ for (int i = 0; i < this.currentSCCs.size(); i++) {
+ Vector scc = (Vector) this.currentSCCs.get(i);
+ for (int j = 0; j < scc.size(); j++) {
+ Integer node = (Integer) scc.get(j);
+ if (node.intValue() < min) {
+ currScc = scc;
+ min = node.intValue();
+ }
+ }
+ }
+
+ return currScc;
+ }
+
+ /**
+ * @return Vector[]::Integer representing the adjacency-structure of the
+ * strong connected component with least vertex in the currently viewed
+ * subgraph
+ */
+ private Vector[] getAdjList(Vector nodes) {
+ Vector[] lowestIdAdjacencyList = null;
+
+ if (nodes != null) {
+ lowestIdAdjacencyList = new Vector[this.adjList.length];
+ for (int i = 0; i < lowestIdAdjacencyList.length; i++) {
+ lowestIdAdjacencyList[i] = new Vector();
+ }
+ for (int i = 0; i < nodes.size(); i++) {
+ int node = ((Integer) nodes.get(i)).intValue();
+ for (int j = 0; j < this.adjList[node].length; j++) {
+ int succ = this.adjList[node][j];
+ if (nodes.contains(new Integer(succ))) {
+ lowestIdAdjacencyList[node].add(new Integer(succ));
+ }
+ }
+ }
+ }
+
+ return lowestIdAdjacencyList;
+ }
+
+ /**
+ * Searchs for strong connected components reachable from a given node.
+ *
+ * @param root node to start from.
+ */
+ private void getStrongConnectedComponents(int root) {
+ this.sccCounter++;
+ this.lowlink[root] = this.sccCounter;
+ this.number[root] = this.sccCounter;
+ this.visited[root] = true;
+ this.stack.add(new Integer(root));
+
+ for (int i = 0; i < this.adjList[root].length; i++) {
+ int w = this.adjList[root][i];
+ if (!this.visited[w]) {
+ this.getStrongConnectedComponents(w);
+ this.lowlink[root] = Math.min(lowlink[root], lowlink[w]);
+ } else if (this.number[w] < this.number[root]) {
+ if (this.stack.contains(new Integer(w))) {
+ lowlink[root] = Math.min(this.lowlink[root], this.number[w]);
+ }
+ }
+ }
+
+ // found scc
+ if ((lowlink[root] == number[root]) && (stack.size() > 0)) {
+ int next = -1;
+ Vector scc = new Vector();
+
+ do {
+ next = ((Integer) this.stack.get(stack.size() - 1)).intValue();
+ this.stack.remove(stack.size() - 1);
+ scc.add(new Integer(next));
+ } while (this.number[next] > this.number[root]);
+
+ // simple scc's with just one node will not be added
+ if (scc.size() > 1) {
+ this.currentSCCs.add(scc);
+ }
+ }
+ }
+
+ public static void main(String[] args) {
+ boolean[][] adjMatrix = new boolean[10][];
+
+ for (int i = 0; i < 10; i++) {
+ adjMatrix[i] = new boolean[10];
+ }
+
+ /*adjMatrix[0][1] = true;
+ adjMatrix[1][2] = true;
+ adjMatrix[2][0] = true;
+ adjMatrix[2][4] = true;
+ adjMatrix[1][3] = true;
+ adjMatrix[3][6] = true;
+ adjMatrix[6][5] = true;
+ adjMatrix[5][3] = true;
+ adjMatrix[6][7] = true;
+ adjMatrix[7][8] = true;
+ adjMatrix[7][9] = true;
+ adjMatrix[9][6] = true;*/
+
+ adjMatrix[0][1] = true;
+ adjMatrix[1][2] = true;
+ adjMatrix[2][0] = true; adjMatrix[2][6] = true;
+ adjMatrix[3][4] = true;
+ adjMatrix[4][5] = true; adjMatrix[4][6] = true;
+ adjMatrix[5][3] = true;
+ adjMatrix[6][7] = true;
+ adjMatrix[7][8] = true;
+ adjMatrix[8][6] = true;
+
+ adjMatrix[6][1] = true;
+
+ int[][] adjList = AdjacencyList.getAdjacencyList(adjMatrix);
+ StrongConnectedComponents scc = new StrongConnectedComponents(adjList);
+ for (int i = 0; i < adjList.length; i++) {
+ System.out.print("i: " + i + "\n");
+ SCCResult r = scc.getAdjacencyList(i);
+ if (r != null) {
+ Vector[] al = scc.getAdjacencyList(i).getAdjList();
+ for (int j = i; j < al.length; j++) {
+ if (al[j].size() > 0) {
+ System.out.print("j: " + j);
+ for (int k = 0; k < al[j].size(); k++) {
+ System.out.print(" _" + al[j].get(k).toString());
+ }
+ System.out.print("\n");
+ }
+ }
+ System.out.print("\n");
+ }
+ }
+ }
+}
--- /dev/null
+package org.simantics.sysdyn.elementaryCycles;\r
+\r
+\r
+import java.util.List;\r
+\r
+\r
+/**\r
+ * Testfile for elementary cycle search.\r
+ *\r
+ * @author Frank Meyer\r
+ *\r
+ */\r
+public class TestCycles {\r
+\r
+ /**\r
+ * @param args\r
+ */\r
+ @SuppressWarnings("rawtypes")\r
+ public static void main(String[] args) {\r
+ String nodes[] = new String[10];\r
+ boolean adjMatrix[][] = new boolean[10][10];\r
+\r
+ for (int i = 0; i < 10; i++) {\r
+ nodes[i] = "Node " + i;\r
+ }\r
+\r
+ adjMatrix[0][1] = true;\r
+ adjMatrix[1][2] = true;\r
+ adjMatrix[2][0] = true;\r
+ adjMatrix[2][4] = true;\r
+ adjMatrix[1][3] = true;\r
+ adjMatrix[3][6] = true;\r
+ adjMatrix[6][5] = true;\r
+ adjMatrix[5][3] = true;\r
+ adjMatrix[6][7] = true;\r
+ adjMatrix[7][8] = true;\r
+ adjMatrix[7][9] = true;\r
+ adjMatrix[9][6] = true;\r
+ /*\r
+ adjMatrix[0][1] = true;\r
+ adjMatrix[1][2] = true;\r
+ adjMatrix[2][0] = true; adjMatrix[2][6] = true;\r
+ adjMatrix[3][4] = true;\r
+ adjMatrix[4][5] = true; adjMatrix[4][6] = true;\r
+ adjMatrix[5][3] = true;\r
+ adjMatrix[6][7] = true;\r
+ adjMatrix[7][8] = true;\r
+ adjMatrix[8][6] = true;\r
+ \r
+ adjMatrix[6][1] = true;\r
+*/\r
+ ElementaryCyclesSearch ecs = new ElementaryCyclesSearch(adjMatrix, nodes);\r
+ List cycles = ecs.getElementaryCycles();\r
+ for (int i = 0; i < cycles.size(); i++) {\r
+ List cycle = (List) cycles.get(i);\r
+ for (int j = 0; j < cycle.size(); j++) {\r
+ String node = (String) cycle.get(j);\r
+ if (j < cycle.size() - 1) {\r
+ System.out.print(node + " -> ");\r
+ } else {\r
+ System.out.print(node);\r
+ }\r
+ }\r
+ System.out.print("\n");\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+(BSD-2 license)\r
+\r
+Copyright (c) 2012, Frank Meyer\r
+All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r
+\r
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. ExpressionParser.java */\r
+package org.simantics.sysdyn.expressionParser;\r
+\r
+import java.util.Set;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+@SuppressWarnings({"unused", "serial"})\r
+public class ExpressionParser implements ExpressionParserConstants {\r
+\r
+ public class ForRange {\r
+ public Token start;\r
+ public Token end;\r
+ }\r
+\r
+ boolean forIndex = false;\r
+ Token firstToken;\r
+\r
+ public Token getFirstToken() {\r
+ return firstToken;\r
+ }\r
+\r
+ List<ForRange> forRanges = new ArrayList<ForRange>();\r
+\r
+ public List<ForRange> getForRanges() {\r
+ return forRanges;\r
+ }\r
+\r
+ HashMap<String, List<Token>> references = new HashMap<String, List<Token>>();\r
+\r
+ public HashMap<String, List<Token>> getReferences() {\r
+ return references;\r
+ }\r
+\r
+ HashMap<String, List<List<Token>>> ranges = new HashMap<String, List<List<Token>>>();\r
+\r
+ public HashMap<String, List<List<Token>>> getRanges() {\r
+ return ranges;\r
+ }\r
+\r
+ List<Token> currentRange = null;\r
+\r
+ HashMap<Token, List<Token>> forIndices = new HashMap<Token, List<Token>>();\r
+\r
+ public HashMap<Token, List<Token>> getForIndices() {\r
+ return forIndices;\r
+ }\r
+\r
+ HashMap<String, List<Token>> enumerationReferences = new HashMap<String, List<Token>>();\r
+\r
+ public HashMap<String, List<Token>> getEnumerationReferences() {\r
+ return enumerationReferences;\r
+ }\r
+\r
+/*\r
+ Collect EACH function call and all references that are inside the call brackets.\r
+ These are later used to exclude spread sheet references out of the normal functions.\r
+*/\r
+ String functionCall = null;\r
+ HashMap<String, List<Token>> functionCallReferences = new HashMap<String, List<Token>>();\r
+\r
+ public HashMap<String, List<Token>> getFunctionCallReferences() {\r
+ return functionCallReferences;\r
+ }\r
+\r
+/*** Parser ********************************************************/\r
+\r
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+ final public void expr() throws ParseException {\r
+ jj_input_stream.setTabSize(1);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case QIDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ firstToken = token;\r
+ simple_expression();\r
+ jj_consume_token(0);\r
+ break;\r
+ case 31:\r
+ firstToken = token;\r
+ jj_consume_token(31);\r
+ expression();\r
+ jj_consume_token(28);\r
+ expression();\r
+ label_1:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 20:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[0] = jj_gen;\r
+ break label_1;\r
+ }\r
+ jj_consume_token(20);\r
+ expression();\r
+ jj_consume_token(28);\r
+ expression();\r
+ }\r
+ jj_consume_token(15);\r
+ expression();\r
+ jj_consume_token(0);\r
+ break;\r
+ default:\r
+ jj_la1[1] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void expression() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case QIDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ simple_expression();\r
+ break;\r
+ case 31:\r
+ jj_consume_token(31);\r
+ expression();\r
+ jj_consume_token(28);\r
+ expression();\r
+ label_2:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 20:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[2] = jj_gen;\r
+ break label_2;\r
+ }\r
+ jj_consume_token(20);\r
+ expression();\r
+ jj_consume_token(28);\r
+ expression();\r
+ }\r
+ jj_consume_token(15);\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[3] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void simple_expression() throws ParseException {\r
+ logical_expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 67:\r
+ jj_consume_token(67);\r
+ logical_expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 67:\r
+ jj_consume_token(67);\r
+ logical_expression();\r
+ break;\r
+ default:\r
+ jj_la1[4] = jj_gen;\r
+ ;\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[5] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void logical_expression() throws ParseException {\r
+ logical_term();\r
+ label_3:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 22:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[6] = jj_gen;\r
+ break label_3;\r
+ }\r
+ jj_consume_token(22);\r
+ logical_term();\r
+ }\r
+ }\r
+\r
+ final public void logical_term() throws ParseException {\r
+ logical_factor();\r
+ label_4:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 9:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[7] = jj_gen;\r
+ break label_4;\r
+ }\r
+ jj_consume_token(9);\r
+ logical_factor();\r
+ }\r
+ }\r
+\r
+ final public void logical_factor() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 12:\r
+ jj_consume_token(12);\r
+ break;\r
+ default:\r
+ jj_la1[8] = jj_gen;\r
+ ;\r
+ }\r
+ relation();\r
+ }\r
+\r
+ final public void relation() throws ParseException {\r
+ arithmetic_expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 70:\r
+ case 71:\r
+ case 72:\r
+ case 73:\r
+ case 74:\r
+ case 75:\r
+ rel_op();\r
+ arithmetic_expression();\r
+ break;\r
+ default:\r
+ jj_la1[9] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void rel_op() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 70:\r
+ jj_consume_token(70);\r
+ break;\r
+ case 71:\r
+ jj_consume_token(71);\r
+ break;\r
+ case 72:\r
+ jj_consume_token(72);\r
+ break;\r
+ case 73:\r
+ jj_consume_token(73);\r
+ break;\r
+ case 74:\r
+ jj_consume_token(74);\r
+ break;\r
+ case 75:\r
+ jj_consume_token(75);\r
+ break;\r
+ default:\r
+ jj_la1[10] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void arithmetic_expression() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ add_op();\r
+ break;\r
+ default:\r
+ jj_la1[11] = jj_gen;\r
+ ;\r
+ }\r
+ term();\r
+ label_5:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[12] = jj_gen;\r
+ break label_5;\r
+ }\r
+ add_op();\r
+ term();\r
+ }\r
+ }\r
+\r
+ final public void add_op() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 76:\r
+ jj_consume_token(76);\r
+ break;\r
+ case 77:\r
+ jj_consume_token(77);\r
+ break;\r
+ case 78:\r
+ jj_consume_token(78);\r
+ break;\r
+ case 79:\r
+ jj_consume_token(79);\r
+ break;\r
+ default:\r
+ jj_la1[13] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void term() throws ParseException {\r
+ factor();\r
+ label_6:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 80:\r
+ case 81:\r
+ case 82:\r
+ case 83:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[14] = jj_gen;\r
+ break label_6;\r
+ }\r
+ mul_op();\r
+ factor();\r
+ }\r
+ }\r
+\r
+ final public void factor() throws ParseException {\r
+ primary();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 84:\r
+ case 85:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 84:\r
+ jj_consume_token(84);\r
+ break;\r
+ case 85:\r
+ jj_consume_token(85);\r
+ break;\r
+ default:\r
+ jj_la1[15] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ primary();\r
+ break;\r
+ default:\r
+ jj_la1[16] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void mul_op() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 80:\r
+ jj_consume_token(80);\r
+ break;\r
+ case 81:\r
+ jj_consume_token(81);\r
+ break;\r
+ case 82:\r
+ jj_consume_token(82);\r
+ break;\r
+ case 83:\r
+ jj_consume_token(83);\r
+ break;\r
+ default:\r
+ jj_la1[17] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void primary() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case UNSIGNED_NUMBER:\r
+ jj_consume_token(UNSIGNED_NUMBER);\r
+ break;\r
+ case UNSIGNED_INTEGER:\r
+ jj_consume_token(UNSIGNED_INTEGER);\r
+ break;\r
+ case STRING:\r
+ jj_consume_token(STRING);\r
+ break;\r
+ case 6:\r
+ jj_consume_token(6);\r
+ break;\r
+ case 33:\r
+ jj_consume_token(33);\r
+ break;\r
+ default:\r
+ jj_la1[19] = jj_gen;\r
+ if (jj_2_1(2147483647)) {\r
+ functionCall = null;\r
+ name();\r
+ function_call_args();\r
+ functionCall = null;\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case IDENT:\r
+ case QIDENT:\r
+ component_reference(null);\r
+ break;\r
+ case 60:\r
+ jj_consume_token(60);\r
+ expression();\r
+ jj_consume_token(61);\r
+ break;\r
+ case 64:\r
+ jj_consume_token(64);\r
+ expression_list();\r
+ label_7:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[18] = jj_gen;\r
+ break label_7;\r
+ }\r
+ jj_consume_token(68);\r
+ expression_list();\r
+ }\r
+ jj_consume_token(65);\r
+ break;\r
+ case 62:\r
+ jj_consume_token(62);\r
+ function_arguments();\r
+ jj_consume_token(63);\r
+ break;\r
+ case 35:\r
+ jj_consume_token(35);\r
+ break;\r
+ default:\r
+ jj_la1[20] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ final public Token ident() throws ParseException {\r
+ Token concatToken = null;\r
+ Token continuationToken = null;\r
+ String fullStr = null;\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case IDENT:\r
+ jj_consume_token(IDENT);\r
+ concatToken = token;\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case IDENT:\r
+ case QIDENT:\r
+ continuationToken = ident();\r
+ fullStr = new String("");\r
+ // Replace whitespace sequence with a single space character.\r
+ fullStr += concatToken.image + " " + continuationToken.image;\r
+\r
+ Token tempToken = new Token(concatToken.kind, fullStr);\r
+ tempToken.beginLine = concatToken.beginLine;\r
+ tempToken.beginColumn = concatToken.beginColumn;\r
+ tempToken.endLine = token.endLine;\r
+ tempToken.endColumn = token.endColumn;\r
+ concatToken = tempToken;\r
+ break;\r
+ default:\r
+ jj_la1[21] = jj_gen;\r
+ ;\r
+ }\r
+ {if (true) return concatToken;}\r
+ break;\r
+ case QIDENT:\r
+ jj_consume_token(QIDENT);\r
+ {if (true) return token;}\r
+ break;\r
+ default:\r
+ jj_la1[22] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public void name() throws ParseException {\r
+ Token identToken = null;\r
+ identToken = ident();\r
+ if (functionCall == null)\r
+ functionCall = identToken.image;\r
+ else\r
+ functionCall += "." + identToken.image;\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 66:\r
+ jj_consume_token(66);\r
+ name();\r
+ break;\r
+ default:\r
+ jj_la1[23] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void component_reference(String prevToken) throws ParseException {\r
+ Token identToken = null;\r
+ //IDENT [ array_subscripts ] [ "." component_reference ]\r
+ identToken = ident();\r
+ String name = identToken.image;\r
+ // forIndex == true and prevToken != null => this is the second part of an enumeration in for-index\r
+ if(forIndex == true) {\r
+ if(prevToken != null) {\r
+ if(enumerationReferences.get(prevToken) == null) {\r
+ enumerationReferences.put(prevToken, new ArrayList<Token>());\r
+ }\r
+ List<Token> list = enumerationReferences.get(prevToken);\r
+ list.add(identToken);\r
+\r
+ // forIndex == true and prevToken == null => this is the enumeration in for-index\r
+ } else {\r
+ if(enumerationReferences.get(name) == null) {\r
+ enumerationReferences.put(name, new ArrayList<Token>());\r
+ }\r
+ List<Token> list = enumerationReferences.get(name);\r
+ list.add(identToken);\r
+ }\r
+ } else {\r
+ if(prevToken != null)\r
+ name = prevToken + "." + name;\r
+ if(references.get(name) == null) {\r
+ references.put(name, new ArrayList<Token>());\r
+ }\r
+ List<Token> list = references.get(name);\r
+ list.add(identToken);\r
+\r
+ if(functionCall != null) {\r
+ if(!functionCallReferences.containsKey(functionCall))\r
+ functionCallReferences.put(functionCall, new ArrayList<Token>());\r
+ List<Token> functionReferencelist = getFunctionCallReferences().get(functionCall);\r
+ functionReferencelist.add(identToken);\r
+ }\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 64:\r
+ array_subscripts(identToken);\r
+ break;\r
+ default:\r
+ jj_la1[24] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 66:\r
+ jj_consume_token(66);\r
+ component_reference(name);\r
+ break;\r
+ default:\r
+ jj_la1[25] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void function_call_args() throws ParseException {\r
+ jj_consume_token(60);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case QIDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ function_arguments();\r
+ break;\r
+ default:\r
+ jj_la1[26] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(61);\r
+ if(functionCall != null) {\r
+ if(!functionCallReferences.containsKey(functionCall))\r
+ functionCallReferences.put(functionCall, new ArrayList<Token>());\r
+ }\r
+ }\r
+\r
+ final public void function_arguments() throws ParseException {\r
+ if (jj_2_2(2147483647)) {\r
+ named_argument();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ jj_consume_token(69);\r
+ function_arguments();\r
+ break;\r
+ default:\r
+ jj_la1[27] = jj_gen;\r
+ ;\r
+ }\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case QIDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 21:\r
+ case 69:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ jj_consume_token(69);\r
+ function_arguments();\r
+ break;\r
+ case 21:\r
+ jj_consume_token(21);\r
+ for_indices();\r
+ break;\r
+ default:\r
+ jj_la1[28] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[29] = jj_gen;\r
+ ;\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[30] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void for_indices() throws ParseException {\r
+ for_index();\r
+ label_8:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[31] = jj_gen;\r
+ break label_8;\r
+ }\r
+ jj_consume_token(69);\r
+ for_index();\r
+ }\r
+ }\r
+\r
+ final public void for_index() throws ParseException {\r
+ Token identToken = null;\r
+ //IDENT [ in expression ]\r
+ identToken = ident();\r
+ forIndices.put(identToken, currentRange);\r
+ forIndex = true;\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 41:\r
+ jj_consume_token(41);\r
+ ForRange forRange = new ForRange();\r
+ forRange.start = token;\r
+ expression();\r
+ forRange.start = forRange.start.next;\r
+ forRange.end = token;\r
+ forRanges.add(forRange);\r
+ break;\r
+ default:\r
+ jj_la1[32] = jj_gen;\r
+ ;\r
+ }\r
+ forIndex = false;\r
+ }\r
+\r
+/* Removed by Teemu. Refactored in function_arguments)\r
+void named_arguments() : {\r
+} {\r
+ named_argument() ( "," named_arguments() )?\r
+}\r
+*/\r
+ final public void named_argument() throws ParseException {\r
+ ident();\r
+ jj_consume_token(86);\r
+ expression();\r
+ }\r
+\r
+ final public void output_expression_list() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case QIDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[33] = jj_gen;\r
+ ;\r
+ }\r
+ label_9:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[34] = jj_gen;\r
+ break label_9;\r
+ }\r
+ jj_consume_token(69);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case QIDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[35] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void expression_list() throws ParseException {\r
+ expression();\r
+ label_10:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[36] = jj_gen;\r
+ break label_10;\r
+ }\r
+ jj_consume_token(69);\r
+ expression();\r
+ }\r
+ }\r
+\r
+ final public void array_subscripts(Token prevToken) throws ParseException {\r
+ if(ranges.get(prevToken.image) == null) {\r
+ ranges.put(prevToken.image, new ArrayList<List<Token>>());\r
+ }\r
+ List<List<Token>> rangesList = ranges.get(prevToken.image);\r
+ currentRange = new ArrayList<Token>();\r
+ jj_consume_token(64);\r
+ subscript(currentRange);\r
+ label_11:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[37] = jj_gen;\r
+ break label_11;\r
+ }\r
+ jj_consume_token(69);\r
+ subscript(currentRange);\r
+ }\r
+ jj_consume_token(65);\r
+ rangesList.add(currentRange);\r
+ }\r
+\r
+ final public void subscript(List<Token> currentRange) throws ParseException {\r
+ Token rangeToken = new Token(token.kind, "");\r
+ rangeToken.beginColumn = token.beginColumn + 1;\r
+ rangeToken.beginLine = token.beginLine;\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 67:\r
+ jj_consume_token(67);\r
+ currentRange.add(token);\r
+ break;\r
+ default:\r
+ jj_la1[40] = jj_gen;\r
+ if (jj_2_3(2147483647)) {\r
+ functionCall = null;\r
+ name();\r
+ function_call_args();\r
+ functionCall = null;\r
+ rangeToken.image = "";\r
+ rangeToken.endColumn = token.endColumn;\r
+ rangeToken.endLine = token.endLine;\r
+ currentRange.add(rangeToken);\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case IDENT:\r
+ case QIDENT:\r
+ case UNSIGNED_INTEGER:\r
+ rangeIndex(rangeToken, true, ":");\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 67:\r
+ jj_consume_token(67);\r
+ rangeIndex(rangeToken, false, ":");\r
+ break;\r
+ default:\r
+ jj_la1[38] = jj_gen;\r
+ ;\r
+ }\r
+ rangeToken.endColumn = token.endColumn;\r
+ rangeToken.endLine = token.endLine;\r
+ currentRange.add(rangeToken);\r
+ break;\r
+ case 62:\r
+ jj_consume_token(62);\r
+ rangeToken.image = rangeToken.image + token.image;\r
+ rangeIndex(rangeToken, true, ",");\r
+ label_12:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[39] = jj_gen;\r
+ break label_12;\r
+ }\r
+ jj_consume_token(69);\r
+ rangeIndex(rangeToken, false, ",");\r
+ }\r
+ rangeToken.endColumn = token.endColumn;\r
+ rangeToken.endLine = token.endLine;\r
+ currentRange.add(rangeToken);\r
+ jj_consume_token(63);\r
+ rangeToken.image = rangeToken.image + token.image;\r
+ break;\r
+ default:\r
+ jj_la1[41] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void rangeIndex(Token rangeToken, boolean first, String delim) throws ParseException {\r
+ Token identToken = null;\r
+ if(!first)\r
+ rangeToken.image = rangeToken.image + delim;\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case UNSIGNED_INTEGER:\r
+ jj_consume_token(UNSIGNED_INTEGER);\r
+ rangeToken.image = rangeToken.image + token.image;\r
+ break;\r
+ case IDENT:\r
+ case QIDENT:\r
+ identToken = ident();\r
+ rangeToken.image = rangeToken.image + identToken;\r
+ break;\r
+ default:\r
+ jj_la1[42] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ private boolean jj_2_1(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_1(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(0, xla); }\r
+ }\r
+\r
+ private boolean jj_2_2(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_2(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(1, xla); }\r
+ }\r
+\r
+ private boolean jj_2_3(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_3(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(2, xla); }\r
+ }\r
+\r
+ private boolean jj_3R_74() {\r
+ if (jj_scan_token(67)) return true;\r
+ if (jj_3R_73()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_35() {\r
+ if (jj_3R_39()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_33() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_35()) jj_scanpos = xsp;\r
+ if (jj_3R_36()) return true;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_37()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_38() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(70)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(71)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(72)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(73)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(74)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(75)) return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_16() {\r
+ if (jj_scan_token(66)) return true;\r
+ if (jj_3R_13()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_26() {\r
+ if (jj_scan_token(67)) return true;\r
+ if (jj_3R_25()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_29()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_79() {\r
+ if (jj_3R_15()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_28() {\r
+ if (jj_scan_token(22)) return true;\r
+ if (jj_3R_27()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_80() {\r
+ if (jj_scan_token(41)) return true;\r
+ if (jj_3R_17()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_32() {\r
+ if (jj_3R_33()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_34()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_78() {\r
+ if (jj_scan_token(UNSIGNED_INTEGER)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_73() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_78()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_79()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_30() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(12)) jj_scanpos = xsp;\r
+ if (jj_3R_32()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_13() {\r
+ if (jj_3R_15()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_16()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_77() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_76()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_27() {\r
+ if (jj_3R_30()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_31()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_66() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_54()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_63() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_66()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_67()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_57() {\r
+ if (jj_scan_token(66)) return true;\r
+ if (jj_3R_51()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_76() {\r
+ if (jj_3R_15()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_80()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_25() {\r
+ if (jj_3R_27()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_28()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_2() {\r
+ if (jj_3R_14()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_23() {\r
+ if (jj_3R_25()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_26()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_19() {\r
+ if (jj_scan_token(QIDENT)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_72() {\r
+ if (jj_3R_76()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_77()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_71() {\r
+ if (jj_scan_token(62)) return true;\r
+ if (jj_3R_73()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_75()) { jj_scanpos = xsp; break; }\r
+ }\r
+ if (jj_scan_token(63)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_53() {\r
+ if (jj_scan_token(68)) return true;\r
+ if (jj_3R_52()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_21() {\r
+ if (jj_scan_token(31)) return true;\r
+ if (jj_3R_17()) return true;\r
+ if (jj_scan_token(28)) return true;\r
+ if (jj_3R_17()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_24()) { jj_scanpos = xsp; break; }\r
+ }\r
+ if (jj_scan_token(15)) return true;\r
+ if (jj_3R_17()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_60() {\r
+ if (jj_3R_17()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_63()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_65() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_64()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_20() {\r
+ if (jj_3R_23()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_17() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_20()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_21()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_3() {\r
+ if (jj_3R_13()) return true;\r
+ if (jj_scan_token(60)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_70() {\r
+ if (jj_3R_73()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_74()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_59() {\r
+ if (jj_3R_14()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_62()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_54() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_59()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_60()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_55() {\r
+ if (jj_3R_54()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_22() {\r
+ if (jj_3R_15()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_69() {\r
+ if (jj_3R_13()) return true;\r
+ if (jj_3R_50()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_18() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_22()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_15() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_18()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_19()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_50() {\r
+ if (jj_scan_token(60)) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_55()) jj_scanpos = xsp;\r
+ if (jj_scan_token(61)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_56() {\r
+ if (jj_3R_61()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_68() {\r
+ if (jj_scan_token(67)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_64() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_68()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_69()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_70()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_71()) return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_1() {\r
+ if (jj_3R_13()) return true;\r
+ if (jj_scan_token(60)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_49() {\r
+ if (jj_scan_token(62)) return true;\r
+ if (jj_3R_54()) return true;\r
+ if (jj_scan_token(63)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_48() {\r
+ if (jj_scan_token(64)) return true;\r
+ if (jj_3R_52()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_53()) { jj_scanpos = xsp; break; }\r
+ }\r
+ if (jj_scan_token(65)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_47() {\r
+ if (jj_scan_token(60)) return true;\r
+ if (jj_3R_17()) return true;\r
+ if (jj_scan_token(61)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_46() {\r
+ if (jj_3R_51()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_58() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_17()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_61() {\r
+ if (jj_scan_token(64)) return true;\r
+ if (jj_3R_64()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_65()) { jj_scanpos = xsp; break; }\r
+ }\r
+ if (jj_scan_token(65)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_45() {\r
+ if (jj_3R_13()) return true;\r
+ if (jj_3R_50()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_43() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(84)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(85)) return true;\r
+ }\r
+ if (jj_3R_42()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_42() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(92)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(91)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(90)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(6)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(33)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_45()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_46()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_47()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_48()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_49()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(35)) return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_29() {\r
+ if (jj_scan_token(67)) return true;\r
+ if (jj_3R_25()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_41() {\r
+ if (jj_3R_44()) return true;\r
+ if (jj_3R_40()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_34() {\r
+ if (jj_3R_38()) return true;\r
+ if (jj_3R_33()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_37() {\r
+ if (jj_3R_39()) return true;\r
+ if (jj_3R_36()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_44() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(80)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(81)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(82)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(83)) return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_40() {\r
+ if (jj_3R_42()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_43()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_52() {\r
+ if (jj_3R_17()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_58()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_75() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_73()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_62() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_54()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_14() {\r
+ if (jj_3R_15()) return true;\r
+ if (jj_scan_token(86)) return true;\r
+ if (jj_3R_17()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_67() {\r
+ if (jj_scan_token(21)) return true;\r
+ if (jj_3R_72()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_24() {\r
+ if (jj_scan_token(20)) return true;\r
+ if (jj_3R_17()) return true;\r
+ if (jj_scan_token(28)) return true;\r
+ if (jj_3R_17()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_36() {\r
+ if (jj_3R_40()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_41()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_39() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(76)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(77)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(78)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(79)) return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_51() {\r
+ if (jj_3R_15()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_56()) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_57()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_31() {\r
+ if (jj_scan_token(9)) return true;\r
+ if (jj_3R_30()) return true;\r
+ return false;\r
+ }\r
+\r
+ /** Generated Token Manager. */\r
+ public ExpressionParserTokenManager token_source;\r
+ SimpleCharStream jj_input_stream;\r
+ /** Current token. */\r
+ public Token token;\r
+ /** Next token. */\r
+ public Token jj_nt;\r
+ private int jj_ntk;\r
+ private Token jj_scanpos, jj_lastpos;\r
+ private int jj_la;\r
+ private int jj_gen;\r
+ final private int[] jj_la1 = new int[43];\r
+ static private int[] jj_la1_0;\r
+ static private int[] jj_la1_1;\r
+ static private int[] jj_la1_2;\r
+ static {\r
+ jj_la1_init_0();\r
+ jj_la1_init_1();\r
+ jj_la1_init_2();\r
+ }\r
+ private static void jj_la1_init_0() {\r
+ jj_la1_0 = new int[] {0x100000,0x80001040,0x100000,0x80001040,0x0,0x0,0x400000,0x200,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x80001040,0x0,0x200000,0x200000,0x80001040,0x0,0x0,0x80001040,0x0,0x80001040,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};\r
+ }\r
+ private static void jj_la1_init_1() {\r
+ jj_la1_1 = new int[] {0x0,0x5000000a,0x0,0x5000000a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x50000008,0x0,0x0,0x0,0x0,0x0,0x5000000a,0x0,0x0,0x0,0x5000000a,0x0,0x200,0x5000000a,0x0,0x5000000a,0x0,0x0,0x0,0x0,0x0,0x40000000,0x0,};\r
+ }\r
+ private static void jj_la1_init_2() {\r
+ jj_la1_2 = new int[] {0x0,0x1f00f001,0x0,0x1f00f001,0x8,0x8,0x0,0x0,0x0,0xfc0,0xfc0,0xf000,0xf000,0xf000,0xf0000,0x300000,0x300000,0xf0000,0x10,0x1c000000,0x3000001,0x3000000,0x3000000,0x4,0x1,0x4,0x1f00f001,0x20,0x20,0x20,0x1f00f001,0x20,0x0,0x1f00f001,0x20,0x1f00f001,0x20,0x20,0x8,0x20,0x8,0xb000000,0xb000000,};\r
+ }\r
+ final private JJCalls[] jj_2_rtns = new JJCalls[3];\r
+ private boolean jj_rescan = false;\r
+ private int jj_gc = 0;\r
+\r
+ /** Constructor with InputStream. */\r
+ public ExpressionParser(java.io.InputStream stream) {\r
+ this(stream, null);\r
+ }\r
+ /** Constructor with InputStream and supplied encoding */\r
+ public ExpressionParser(java.io.InputStream stream, String encoding) {\r
+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+ token_source = new ExpressionParserTokenManager(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 43; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream stream) {\r
+ ReInit(stream, null);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream stream, String encoding) {\r
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+ token_source.ReInit(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 43; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Constructor. */\r
+ public ExpressionParser(java.io.Reader stream) {\r
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);\r
+ token_source = new ExpressionParserTokenManager(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 43; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader stream) {\r
+ jj_input_stream.ReInit(stream, 1, 1);\r
+ token_source.ReInit(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 43; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Constructor with generated Token Manager. */\r
+ public ExpressionParser(ExpressionParserTokenManager tm) {\r
+ token_source = tm;\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 43; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(ExpressionParserTokenManager tm) {\r
+ token_source = tm;\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 43; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ private Token jj_consume_token(int kind) throws ParseException {\r
+ Token oldToken;\r
+ if ((oldToken = token).next != null) token = token.next;\r
+ else token = token.next = token_source.getNextToken();\r
+ jj_ntk = -1;\r
+ if (token.kind == kind) {\r
+ jj_gen++;\r
+ if (++jj_gc > 100) {\r
+ jj_gc = 0;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) {\r
+ JJCalls c = jj_2_rtns[i];\r
+ while (c != null) {\r
+ if (c.gen < jj_gen) c.first = null;\r
+ c = c.next;\r
+ }\r
+ }\r
+ }\r
+ return token;\r
+ }\r
+ token = oldToken;\r
+ jj_kind = kind;\r
+ throw generateParseException();\r
+ }\r
+\r
+ static private final class LookaheadSuccess extends java.lang.Error { }\r
+ final private LookaheadSuccess jj_ls = new LookaheadSuccess();\r
+ private boolean jj_scan_token(int kind) {\r
+ if (jj_scanpos == jj_lastpos) {\r
+ jj_la--;\r
+ if (jj_scanpos.next == null) {\r
+ jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();\r
+ } else {\r
+ jj_lastpos = jj_scanpos = jj_scanpos.next;\r
+ }\r
+ } else {\r
+ jj_scanpos = jj_scanpos.next;\r
+ }\r
+ if (jj_rescan) {\r
+ int i = 0; Token tok = token;\r
+ while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }\r
+ if (tok != null) jj_add_error_token(kind, i);\r
+ }\r
+ if (jj_scanpos.kind != kind) return true;\r
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;\r
+ return false;\r
+ }\r
+\r
+\r
+/** Get the next Token. */\r
+ final public Token getNextToken() {\r
+ if (token.next != null) token = token.next;\r
+ else token = token.next = token_source.getNextToken();\r
+ jj_ntk = -1;\r
+ jj_gen++;\r
+ return token;\r
+ }\r
+\r
+/** Get the specific Token. */\r
+ final public Token getToken(int index) {\r
+ Token t = token;\r
+ for (int i = 0; i < index; i++) {\r
+ if (t.next != null) t = t.next;\r
+ else t = t.next = token_source.getNextToken();\r
+ }\r
+ return t;\r
+ }\r
+\r
+ private int jj_ntk() {\r
+ if ((jj_nt=token.next) == null)\r
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);\r
+ else\r
+ return (jj_ntk = jj_nt.kind);\r
+ }\r
+\r
+ private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();\r
+ private int[] jj_expentry;\r
+ private int jj_kind = -1;\r
+ private int[] jj_lasttokens = new int[100];\r
+ private int jj_endpos;\r
+\r
+ private void jj_add_error_token(int kind, int pos) {\r
+ if (pos >= 100) return;\r
+ if (pos == jj_endpos + 1) {\r
+ jj_lasttokens[jj_endpos++] = kind;\r
+ } else if (jj_endpos != 0) {\r
+ jj_expentry = new int[jj_endpos];\r
+ for (int i = 0; i < jj_endpos; i++) {\r
+ jj_expentry[i] = jj_lasttokens[i];\r
+ }\r
+ jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) {\r
+ int[] oldentry = (int[])(it.next());\r
+ if (oldentry.length == jj_expentry.length) {\r
+ for (int i = 0; i < jj_expentry.length; i++) {\r
+ if (oldentry[i] != jj_expentry[i]) {\r
+ continue jj_entries_loop;\r
+ }\r
+ }\r
+ jj_expentries.add(jj_expentry);\r
+ break jj_entries_loop;\r
+ }\r
+ }\r
+ if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;\r
+ }\r
+ }\r
+\r
+ /** Generate ParseException. */\r
+ public ParseException generateParseException() {\r
+ jj_expentries.clear();\r
+ boolean[] la1tokens = new boolean[93];\r
+ if (jj_kind >= 0) {\r
+ la1tokens[jj_kind] = true;\r
+ jj_kind = -1;\r
+ }\r
+ for (int i = 0; i < 43; i++) {\r
+ if (jj_la1[i] == jj_gen) {\r
+ for (int j = 0; j < 32; j++) {\r
+ if ((jj_la1_0[i] & (1<<j)) != 0) {\r
+ la1tokens[j] = true;\r
+ }\r
+ if ((jj_la1_1[i] & (1<<j)) != 0) {\r
+ la1tokens[32+j] = true;\r
+ }\r
+ if ((jj_la1_2[i] & (1<<j)) != 0) {\r
+ la1tokens[64+j] = true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ for (int i = 0; i < 93; i++) {\r
+ if (la1tokens[i]) {\r
+ jj_expentry = new int[1];\r
+ jj_expentry[0] = i;\r
+ jj_expentries.add(jj_expentry);\r
+ }\r
+ }\r
+ jj_endpos = 0;\r
+ jj_rescan_token();\r
+ jj_add_error_token(0, 0);\r
+ int[][] exptokseq = new int[jj_expentries.size()][];\r
+ for (int i = 0; i < jj_expentries.size(); i++) {\r
+ exptokseq[i] = jj_expentries.get(i);\r
+ }\r
+ return new ParseException(token, exptokseq, tokenImage);\r
+ }\r
+\r
+ /** Enable tracing. */\r
+ final public void enable_tracing() {\r
+ }\r
+\r
+ /** Disable tracing. */\r
+ final public void disable_tracing() {\r
+ }\r
+\r
+ private void jj_rescan_token() {\r
+ jj_rescan = true;\r
+ for (int i = 0; i < 3; i++) {\r
+ try {\r
+ JJCalls p = jj_2_rtns[i];\r
+ do {\r
+ if (p.gen > jj_gen) {\r
+ jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;\r
+ switch (i) {\r
+ case 0: jj_3_1(); break;\r
+ case 1: jj_3_2(); break;\r
+ case 2: jj_3_3(); break;\r
+ }\r
+ }\r
+ p = p.next;\r
+ } while (p != null);\r
+ } catch(LookaheadSuccess ls) { }\r
+ }\r
+ jj_rescan = false;\r
+ }\r
+\r
+ private void jj_save(int index, int xla) {\r
+ JJCalls p = jj_2_rtns[index];\r
+ while (p.gen > jj_gen) {\r
+ if (p.next == null) { p = p.next = new JJCalls(); break; }\r
+ p = p.next;\r
+ }\r
+ p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;\r
+ }\r
+\r
+ static final class JJCalls {\r
+ int gen;\r
+ Token first;\r
+ int arg;\r
+ JJCalls next;\r
+ }\r
+\r
+}\r
--- /dev/null
+options {\r
+ JDK_VERSION = "1.6";\r
+ STATIC = false;\r
+}\r
+\r
+PARSER_BEGIN(ExpressionParser)\r
+package org.simantics.sysdyn.expressionParser;\r
+\r
+import java.util.Set;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+@SuppressWarnings({"unused", "serial"})\r
+public class ExpressionParser {\r
+\r
+ public class ForRange {\r public Token start;\r
+ public Token end;\r
+ }\r
+\r
+ boolean forIndex = false;\r
+ Token firstToken;\r
+\r
+ public Token getFirstToken() {\r return firstToken;\r
+ }\r\r
+ List<ForRange> forRanges = new ArrayList<ForRange>();\r
+ \r
+ public List<ForRange> getForRanges() {\r
+ return forRanges;\r
+ }\r
+ \r
+ HashMap<String, List<Token>> references = new HashMap<String, List<Token>>();\r
+ \r
+ public HashMap<String, List<Token>> getReferences() {\r
+ return references;\r
+ }\r
+\r
+ HashMap<String, List<List<Token>>> ranges = new HashMap<String, List<List<Token>>>();\r
+ \r
+ public HashMap<String, List<List<Token>>> getRanges() {\r
+ return ranges;\r
+ }\r
+\r
+ List<Token> currentRange = null;\r
+\r
+ HashMap<Token, List<Token>> forIndices = new HashMap<Token, List<Token>>();\r
+\r
+ public HashMap<Token, List<Token>> getForIndices() {\r
+ return forIndices;\r
+ }\r
+\r
+ HashMap<String, List<Token>> enumerationReferences = new HashMap<String, List<Token>>();\r
+ \r
+ public HashMap<String, List<Token>> getEnumerationReferences() {\r
+ return enumerationReferences;\r
+ }\r
+\r
+/*\r
+ Collect EACH function call and all references that are inside the call brackets.\r
+ These are later used to exclude spread sheet references out of the normal functions.\r
+*/\r
+ String functionCall = null;\r
+ HashMap<String, List<Token>> functionCallReferences = new HashMap<String, List<Token>>();\r
+ \r
+ public HashMap<String, List<Token>> getFunctionCallReferences() {\r
+ return functionCallReferences;\r
+ } \r
+ \r
+ \r
+}\r
+PARSER_END(ExpressionParser)\r
+\r
+/*** Lexer *********************************************************/\r
+\r
+SKIP:\r
+{ <WHITESPACE: " " | "\n" | "\r" | "\t" > \r
+| <COMMENT1: "/*" (~["*"] | "*" ~["/"])* "*/" > \r
+| <COMMENT2: "//" (~["\n"])* >\r
+}\r
+\r
+TOKEN:\r
+{\r
+"algorithm" | "discrete" | "false" | "model" | "redeclare"\r
+| "and" | "each" | "final" | "not" | "replaceable"\r
+| "annotation" | "else" | "flow" | "operator" | "return"\r
+|"assert" | "elseif" | "for" | "or" | "stream"\r
+| "block" | "elsewhen" | "function" | "outer" | "then"\r
+| "break" | "encapsulated" | "if" | "output" | "true"\r
+| "class" | "end" | "import" | "package" | "type"\r
+| "connect" | "enumeration" | "in" | "parameter" | "when"\r
+| "connector" | "equation" | /*"initial" |*/ "partial" | "while"\r
+| "constant" | "expandable" | "inner" | "protected" | "within"\r
+| "constrainedby" | "extends" | "input" | "public"\r
+| /*"der" |*/ "external" | "loop" | "record"\r
+| "(" | ")" | "{" | "}" | "[" | "]" | "." | ":" | ";" | ","\r
+| "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+| "+" | "-" | ".+" | ".-"\r
+| "*" | "/" | ".*" | "./"\r
+| "^" | ".^"\r
+| "=" | ":=" \r
+| <IDENT: ["a"-"z","A"-"Z","_"] (["a"-"z","A"-"Z","_","0"-"9"])* >\r
+| <QIDENT: "'" (["a"-"z","A"-"Z","_","0"-"9","!","*","+",",",\r
+ "-",".","/",":",";","=","?","@","^","~"," ","\'","\\","\b","\f"])* "'" >\r
+ /* Excluded "#","$","%","&","(",")","<",">","[","]","{","}","|", and "\"" because of Sysdyn */\r
+ /* Excluded "\?", "\a", and "\v" because of JavaCC */\r
+ /* Excluded "\n","\r", and "\t" just in case */\r
+| <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
+ { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
+| <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
+| <UNSIGNED_NUMBER: \r
+ ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | "." <UNSIGNED_INTEGER> (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | <UNSIGNED_INTEGER> ["e","E"] (["+","-"])? <UNSIGNED_INTEGER>\r
+ ) >\r
+}\r
+\r
+/*** Parser ********************************************************/\r
+\r
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+\r
+void expr() : {\r
+ jj_input_stream.setTabSize(1);\r
+} {\r
+ {\r
+ firstToken = token;\r
+ }\r
+ simple_expression() <EOF>\r
+ |\r
+ {\r
+ firstToken = token;\r
+ }\r
+ "if" expression() "then" expression() ( "elseif" expression() "then" expression() )*\r
+ "else" expression() <EOF>\r
+}\r
+\r
+void expression() : {\r
+} {\r
+ simple_expression()\r
+ | "if" expression() "then" expression() ( "elseif" expression() "then" expression() )*\r
+ "else" expression()\r
+}\r
+\r
+void simple_expression() : {\r
+} {\r
+ logical_expression() ( ":" logical_expression() ( ":" logical_expression() )? )?\r
+} \r
+\r
+void logical_expression() : {\r
+} {\r
+ logical_term() ( "or" logical_term() )*\r
+} \r
+\r
+void logical_term() : {\r
+} {\r
+ logical_factor() ( "and" logical_factor() )*\r
+}\r
+\r
+void logical_factor() : {\r
+} {\r
+ ( "not" )? relation()\r
+}\r
+\r
+void relation() : {\r
+} {\r
+ arithmetic_expression() ( rel_op() arithmetic_expression() )?\r
+}\r
+\r
+void rel_op() : {\r
+} {\r
+ "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+}\r
+\r
+void arithmetic_expression() : {\r
+} {\r
+ (add_op())? term() (add_op() term())*\r
+}\r
+\r
+void add_op() : {\r
+} {\r
+ "+" | "-" | ".+" | ".-"\r
+}\r
+\r
+void term() : {\r
+} {\r
+ factor() ( mul_op() factor() )*\r
+}\r
+\r
+void factor() : {\r
+} {\r
+ primary() ( ( "^" | ".^" ) primary() )?\r
+}\r
+\r
+void mul_op() : {\r
+} {\r
+ "*" | "/" | ".*" | "./"\r
+}\r
+\r
+void primary() : {\r
+} {\r
+ <UNSIGNED_NUMBER>\r
+ | <UNSIGNED_INTEGER>\r
+ | <STRING>\r
+ | "false"\r
+ | "true"\r
+ | LOOKAHEAD( name() "(" )\r {\r functionCall = null;\r
+ }\r
+ name() function_call_args()\r {\r functionCall = null;\r
+ } \r
+ | component_reference(null)\r
+ /*| "(" output_expression_list() ")"*/ // Not needed, replaced with following:\r
+ | "(" expression() ")"\r
+ | "[" expression_list() ( ";" expression_list() )* "]"\r
+ | "{" function_arguments() "}"\r
+ | "end"\r
+}\r
+\r
+Token ident() : {\r
+ Token concatToken = null;\r
+ Token continuationToken = null;\r
+ String fullStr = null;\r
+} {\r
+ <IDENT>\r
+ { concatToken = token; }\r
+ ( continuationToken = ident()\r
+ {\r
+ fullStr = new String("");\r
+ // Replace whitespace sequence with a single space character.\r
+ fullStr += concatToken.image + " " + continuationToken.image;\r
+ \r
+ Token tempToken = new Token(concatToken.kind, fullStr);\r
+ tempToken.beginLine = concatToken.beginLine;\r
+ tempToken.beginColumn = concatToken.beginColumn;\r
+ tempToken.endLine = token.endLine;\r
+ tempToken.endColumn = token.endColumn;\r
+ concatToken = tempToken;\r
+ }\r
+ )?\r
+ {\r return concatToken;\r
+ }\r
+ |\r
+ <QIDENT>\r
+ {\r
+ return token;\r
+ }\r
+}\r\r
+void name() : {\r
+ Token identToken = null;\r
+} {\r
+ identToken = ident()\r
+ {\r if (functionCall == null)\r
+ functionCall = identToken.image;\r
+ else\r
+ functionCall += "." + identToken.image;\r
+ }\r
+ ( "." name() )?\r
+}\r
+\r
+void component_reference(String prevToken) : {\r
+ Token identToken = null;\r
+} {\r
+ //IDENT [ array_subscripts ] [ "." component_reference ]\r
+ identToken = ident()\r
+ {\r
+ String name = identToken.image;\r
+ // forIndex == true and prevToken != null => this is the second part of an enumeration in for-index\r
+ if(forIndex == true) {\r if(prevToken != null) {\r
+ if(enumerationReferences.get(prevToken) == null) {\r enumerationReferences.put(prevToken, new ArrayList<Token>());\r
+ }\r
+ List<Token> list = enumerationReferences.get(prevToken);\r
+ list.add(identToken); \r
+ \r
+ // forIndex == true and prevToken == null => this is the enumeration in for-index\r
+ } else {\r
+ if(enumerationReferences.get(name) == null) {\r
+ enumerationReferences.put(name, new ArrayList<Token>());\r
+ }\r
+ List<Token> list = enumerationReferences.get(name);\r
+ list.add(identToken);\r
+ }\r
+ } else {\r
+ if(prevToken != null)\r
+ name = prevToken + "." + name; \r if(references.get(name) == null) {\r
+ references.put(name, new ArrayList<Token>());\r
+ }\r
+ List<Token> list = references.get(name);\r
+ list.add(identToken);\r
+\r
+ if(functionCall != null) {\r
+ if(!functionCallReferences.containsKey(functionCall))\r
+ functionCallReferences.put(functionCall, new ArrayList<Token>());\r
+ List<Token> functionReferencelist = getFunctionCallReferences().get(functionCall);\r
+ functionReferencelist.add(identToken);\r }\r
+ }\r
+\r
+ }\r
+ \r
+ ( array_subscripts(identToken) )? ( "." component_reference(name) )?\r
+}\r
+\r
+void function_call_args() : {\r
+} {\r
+ "(" ( function_arguments() )? ")"\r {\r if(functionCall != null) {\r
+ if(!functionCallReferences.containsKey(functionCall))\r
+ functionCallReferences.put(functionCall, new ArrayList<Token>());\r
+ }\r
+ }\r
+}\r
+\r
+void function_arguments() : {\r
+} {\r
+ //expression [ "," function_arguments | for for_indices ]\r
+ //| named_arguments\r
+ LOOKAHEAD(named_argument()) named_argument() ( "," function_arguments() )?\r
+ | expression() ( "," function_arguments() | "for" for_indices() )?\r
+ \r
+}\r
+\r
+void for_indices() : {\r
+} {\r
+ //for_index {"," for_index}\r
+ for_index() ("," for_index())*\r
+}\r
+\r
+void for_index() : {\r
+ Token identToken = null;\r
+} {\r
+ //IDENT [ in expression ]\r
+ identToken = ident()\r
+ {\r
+ forIndices.put(identToken, currentRange);\r
+ forIndex = true;\r }\r
+ ( "in"\r {\r
+ ForRange forRange = new ForRange();\r
+ forRange.start = token;\r }\r
+ expression()\r {\r
+ forRange.start = forRange.start.next;\r
+ forRange.end = token;\r
+ forRanges.add(forRange);\r }\r
+ )?\r
+ {\r forIndex = false;\r
+ }\r
+}\r
+\r
+/* Removed by Teemu. Refactored in function_arguments)\r
+void named_arguments() : {\r
+} {\r
+ named_argument() ( "," named_arguments() )?\r
+}\r
+*/\r
+\r
+void named_argument() : {\r
+} { \r
+ ident() "=" expression()\r
+}\r
+\r
+void output_expression_list() : {\r
+} {\r
+ ( expression() )? ( "," ( expression() )? )*\r
+}\r
+\r
+\r
+void expression_list() : {\r
+} {\r
+ expression() ( "," expression() )*\r
+}\r
+\r
+void array_subscripts(Token prevToken) : {\r if(ranges.get(prevToken.image) == null) {\r
+ ranges.put(prevToken.image, new ArrayList<List<Token>>());\r
+ }\r
+ List<List<Token>> rangesList = ranges.get(prevToken.image);\r
+ currentRange = new ArrayList<Token>(); \r
+} {\r
+ "[" subscript(currentRange) ( "," subscript(currentRange) )* "]"\r
+ {\r
+ rangesList.add(currentRange);\r
+ }\r
+}\r
+\r
+void subscript(List<Token> currentRange) : {\r
+ Token rangeToken = new Token(token.kind, "");\r
+ rangeToken.beginColumn = token.beginColumn + 1;\r
+ rangeToken.beginLine = token.beginLine;\r
+} {\r ":"\r {\r currentRange.add(token);\r
+ }\r
+ | LOOKAHEAD( name() "(" )\r
+ {\r
+ functionCall = null;\r
+ }\r
+ name() function_call_args()\r
+ {\r
+ functionCall = null;\r
+ rangeToken.image = "";\r
+ rangeToken.endColumn = token.endColumn;\r
+ rangeToken.endLine = token.endLine;\r
+ currentRange.add(rangeToken);\r
+ }\r
+ | rangeIndex(rangeToken, true, ":") ( ":" rangeIndex(rangeToken, false, ":"))? {\r
+ rangeToken.endColumn = token.endColumn;\r
+ rangeToken.endLine = token.endLine;\r
+ currentRange.add(rangeToken);\r
+ }\r
+ | "{"\r
+ {\r rangeToken.image = rangeToken.image + token.image;\r
+ }\r
+ rangeIndex(rangeToken, true, ",") ( "," rangeIndex(rangeToken, false, ","))*\r
+ {\r
+ rangeToken.endColumn = token.endColumn;\r
+ rangeToken.endLine = token.endLine;\r
+ currentRange.add(rangeToken);\r
+ }\r
+ "}"\r
+ {\r rangeToken.image = rangeToken.image + token.image;\r
+ }\r
+}\r
+\r
+void rangeIndex(Token rangeToken, boolean first, String delim) : {\r
+ Token identToken = null;\r
+ if(!first)\r
+ rangeToken.image = rangeToken.image + delim;\r
+} {\r <UNSIGNED_INTEGER>\r {\r
+ rangeToken.image = rangeToken.image + token.image; \r }\r
+ | identToken = ident()\r
+ {\r rangeToken.image = rangeToken.image + identToken;\r
+ }\r
+}\r \r
+\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. ExpressionParserConstants.java */\r
+package org.simantics.sysdyn.expressionParser;\r
+\r
+\r
+/**\r
+ * Token literal values and constants.\r
+ * Generated by org.javacc.parser.OtherFilesGen#start()\r
+ */\r
+public interface ExpressionParserConstants {\r
+\r
+ /** End of File. */\r
+ int EOF = 0;\r
+ /** RegularExpression Id. */\r
+ int WHITESPACE = 1;\r
+ /** RegularExpression Id. */\r
+ int COMMENT1 = 2;\r
+ /** RegularExpression Id. */\r
+ int COMMENT2 = 3;\r
+ /** RegularExpression Id. */\r
+ int IDENT = 88;\r
+ /** RegularExpression Id. */\r
+ int QIDENT = 89;\r
+ /** RegularExpression Id. */\r
+ int STRING = 90;\r
+ /** RegularExpression Id. */\r
+ int UNSIGNED_INTEGER = 91;\r
+ /** RegularExpression Id. */\r
+ int UNSIGNED_NUMBER = 92;\r
+\r
+ /** Lexical state. */\r
+ int DEFAULT = 0;\r
+\r
+ /** Literal token values. */\r
+ String[] tokenImage = {\r
+ "<EOF>",\r
+ "<WHITESPACE>",\r
+ "<COMMENT1>",\r
+ "<COMMENT2>",\r
+ "\"algorithm\"",\r
+ "\"discrete\"",\r
+ "\"false\"",\r
+ "\"model\"",\r
+ "\"redeclare\"",\r
+ "\"and\"",\r
+ "\"each\"",\r
+ "\"final\"",\r
+ "\"not\"",\r
+ "\"replaceable\"",\r
+ "\"annotation\"",\r
+ "\"else\"",\r
+ "\"flow\"",\r
+ "\"operator\"",\r
+ "\"return\"",\r
+ "\"assert\"",\r
+ "\"elseif\"",\r
+ "\"for\"",\r
+ "\"or\"",\r
+ "\"stream\"",\r
+ "\"block\"",\r
+ "\"elsewhen\"",\r
+ "\"function\"",\r
+ "\"outer\"",\r
+ "\"then\"",\r
+ "\"break\"",\r
+ "\"encapsulated\"",\r
+ "\"if\"",\r
+ "\"output\"",\r
+ "\"true\"",\r
+ "\"class\"",\r
+ "\"end\"",\r
+ "\"import\"",\r
+ "\"package\"",\r
+ "\"type\"",\r
+ "\"connect\"",\r
+ "\"enumeration\"",\r
+ "\"in\"",\r
+ "\"parameter\"",\r
+ "\"when\"",\r
+ "\"connector\"",\r
+ "\"equation\"",\r
+ "\"partial\"",\r
+ "\"while\"",\r
+ "\"constant\"",\r
+ "\"expandable\"",\r
+ "\"inner\"",\r
+ "\"protected\"",\r
+ "\"within\"",\r
+ "\"constrainedby\"",\r
+ "\"extends\"",\r
+ "\"input\"",\r
+ "\"public\"",\r
+ "\"external\"",\r
+ "\"loop\"",\r
+ "\"record\"",\r
+ "\"(\"",\r
+ "\")\"",\r
+ "\"{\"",\r
+ "\"}\"",\r
+ "\"[\"",\r
+ "\"]\"",\r
+ "\".\"",\r
+ "\":\"",\r
+ "\";\"",\r
+ "\",\"",\r
+ "\"<\"",\r
+ "\"<=\"",\r
+ "\">\"",\r
+ "\">=\"",\r
+ "\"==\"",\r
+ "\"<>\"",\r
+ "\"+\"",\r
+ "\"-\"",\r
+ "\".+\"",\r
+ "\".-\"",\r
+ "\"*\"",\r
+ "\"/\"",\r
+ "\".*\"",\r
+ "\"./\"",\r
+ "\"^\"",\r
+ "\".^\"",\r
+ "\"=\"",\r
+ "\":=\"",\r
+ "<IDENT>",\r
+ "<QIDENT>",\r
+ "<STRING>",\r
+ "<UNSIGNED_INTEGER>",\r
+ "<UNSIGNED_NUMBER>",\r
+ };\r
+\r
+}\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. ExpressionParserTokenManager.java */\r
+package org.simantics.sysdyn.expressionParser;\r
+import java.util.Set;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+/** Token Manager. */\r
+public class ExpressionParserTokenManager implements ExpressionParserConstants\r
+{\r
+\r
+ /** Debug output. */\r
+ public java.io.PrintStream debugStream = System.out;\r
+ /** Set debug output. */\r
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }\r
+private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
+{\r
+ switch (pos)
+ {\r
+ case 0:\r
+ if ((active1 & 0x2cc004L) != 0L)\r
+ return 12;\r
+ if ((active0 & 0xffffffffffffff0L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ return 2;\r
+ }\r
+ if ((active1 & 0x20000L) != 0L)\r
+ return 17;\r
+ return -1;\r
+ case 1:\r
+ if ((active0 & 0x84020080400000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0xf7bfdff7fbffff0L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 1)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 1;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 2:\r
+ if ((active0 & 0x800201200L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0xffffdf77f9fedf0L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 2;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 3:\r
+ if ((active0 & 0x400084212118400L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0xbfff5b56d8e69f0L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 3)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 3;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 4:\r
+ if ((active0 & 0x848004290008c0L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0xb7b75b1469e6130L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 4;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 5:\r
+ if ((active0 & 0x9100011009c0000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x26b75a046026130L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 5;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 6:\r
+ if ((active0 & 0x4050a000000000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x22b250046026130L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 6)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 6;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 7:\r
+ if ((active0 & 0x201200006020020L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x2a150040006110L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 7;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 8:\r
+ if ((active0 & 0x22010040006000L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 8;\r
+ return 2;\r
+ }\r
+ if ((active0 & 0x8140000000110L) != 0L)\r
+ return 2;\r
+ return -1;\r
+ case 9:\r
+ if ((active0 & 0x2000000004000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x20010040002000L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 9;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 10:\r
+ if ((active0 & 0x10000002000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x20000040000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 10;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 11:\r
+ if ((active0 & 0x40000000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x20000000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 11;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ default :\r
+ return -1;\r
+ }\r
+}\r
+private final int jjStartNfa_0(int pos, long active0, long active1)
+{\r
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);\r
+}\r
+private int jjStopAtPos(int pos, int kind)\r
+{\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = pos;\r
+ return pos + 1;\r
+}\r
+private int jjMoveStringLiteralDfa0_0()\r
+{\r
+ switch(curChar)\r
+ {\r
+ case 40:\r
+ return jjStopAtPos(0, 60);\r
+ case 41:\r
+ return jjStopAtPos(0, 61);\r
+ case 42:\r
+ return jjStopAtPos(0, 80);\r
+ case 43:\r
+ return jjStopAtPos(0, 76);\r
+ case 44:\r
+ return jjStopAtPos(0, 69);\r
+ case 45:\r
+ return jjStopAtPos(0, 77);\r
+ case 46:\r
+ jjmatchedKind = 66;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x2cc000L);\r
+ case 47:\r
+ return jjStartNfaWithStates_0(0, 81, 17);\r
+ case 58:\r
+ jjmatchedKind = 67;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x800000L);\r
+ case 59:\r
+ return jjStopAtPos(0, 68);\r
+ case 60:\r
+ jjmatchedKind = 70;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x880L);\r
+ case 61:\r
+ jjmatchedKind = 86;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x400L);\r
+ case 62:\r
+ jjmatchedKind = 72;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x200L);\r
+ case 91:\r
+ return jjStopAtPos(0, 64);\r
+ case 93:\r
+ return jjStopAtPos(0, 65);\r
+ case 94:\r
+ return jjStopAtPos(0, 84);\r
+ case 97:\r
+ return jjMoveStringLiteralDfa1_0(0x84210L, 0x0L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa1_0(0x21000000L, 0x0L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa1_0(0x21108400000000L, 0x0L);\r
+ case 100:\r
+ return jjMoveStringLiteralDfa1_0(0x20L, 0x0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa1_0(0x242210842108400L, 0x0L);\r
+ case 102:\r
+ return jjMoveStringLiteralDfa1_0(0x4210840L, 0x0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa1_0(0x84021080000000L, 0x0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa1_0(0x400000000000000L, 0x0L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa1_0(0x80L, 0x0L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa1_0(0x1000L, 0x0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa1_0(0x108420000L, 0x0L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa1_0(0x108442000000000L, 0x0L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa1_0(0x800000000042100L, 0x0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa1_0(0x800000L, 0x0L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa1_0(0x4210000000L, 0x0L);\r
+ case 119:\r
+ return jjMoveStringLiteralDfa1_0(0x10880000000000L, 0x0L);\r
+ case 123:\r
+ return jjStopAtPos(0, 62);\r
+ case 125:\r
+ return jjStopAtPos(0, 63);\r
+ default :\r
+ return jjMoveNfa_0(0, 0);\r
+ }\r
+}\r
+private int jjMoveStringLiteralDfa1_0(long active0, long active1)\r
+{\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(0, active0, active1);\r
+ return 1;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 42:\r
+ if ((active1 & 0x40000L) != 0L)\r
+ return jjStopAtPos(1, 82);\r
+ break;\r
+ case 43:\r
+ if ((active1 & 0x4000L) != 0L)\r
+ return jjStopAtPos(1, 78);\r
+ break;\r
+ case 45:\r
+ if ((active1 & 0x8000L) != 0L)\r
+ return jjStopAtPos(1, 79);\r
+ break;\r
+ case 47:\r
+ if ((active1 & 0x80000L) != 0L)\r
+ return jjStopAtPos(1, 83);\r
+ break;\r
+ case 61:\r
+ if ((active1 & 0x80L) != 0L)\r
+ return jjStopAtPos(1, 71);\r
+ else if ((active1 & 0x200L) != 0L)\r
+ return jjStopAtPos(1, 73);\r
+ else if ((active1 & 0x400L) != 0L)\r
+ return jjStopAtPos(1, 74);\r
+ else if ((active1 & 0x800000L) != 0L)\r
+ return jjStopAtPos(1, 87);\r
+ break;\r
+ case 62:\r
+ if ((active1 & 0x800L) != 0L)\r
+ return jjStopAtPos(1, 75);\r
+ break;\r
+ case 94:\r
+ if ((active1 & 0x200000L) != 0L)\r
+ return jjStopAtPos(1, 85);\r
+ break;\r
+ case 97:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x442000000440L, active1, 0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x800000000042100L, active1, 0L);\r
+ case 102:\r
+ if ((active0 & 0x80000000L) != 0L)\r
+ return jjStartNfaWithStates_0(1, 31, 2);\r
+ break;\r
+ case 104:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x880010000000L, active1, 0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x10000000000820L, active1, 0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x403118010L, active1, 0L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L, active1, 0L);\r
+ case 110:\r
+ if ((active0 & 0x20000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 41;\r
+ jjmatchedPos = 1;\r
+ }\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x84010840004200L, active1, 0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x421108000201080L, active1, 0L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000L, active1, 0L);\r
+ case 113:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L);\r
+ case 114:\r
+ if ((active0 & 0x400000L) != 0L)\r
+ return jjStartNfaWithStates_0(1, 22, 2);\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x8000220000000L, active1, 0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x80000L, active1, 0L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x800000L, active1, 0L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x10000010c000000L, active1, 0L);\r
+ case 120:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x242000000000000L, active1, 0L);\r
+ case 121:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x4000000000L, active1, 0L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(0, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(0, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(1, active0, 0L);\r
+ return 2;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x400000000L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x100000000000000L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x800002040000400L);\r
+ case 100:\r
+ if ((active0 & 0x200L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 9, 2);\r
+ else if ((active0 & 0x800000000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 35, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x180L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x80030020000L);\r
+ case 103:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x10L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x800000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x40L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x25108004004800L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x408000001010000L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x82005000002000L);\r
+ case 114:\r
+ if ((active0 & 0x200000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 21, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x440000800000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x2188020L);\r
+ case 116:\r
+ if ((active0 & 0x1000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 12, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x250000108040000L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x210200000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(1, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa3_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(1, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(2, active0, 0L);\r
+ return 3;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x2240060000800L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x5000020L);\r
+ case 101:\r
+ if ((active0 & 0x8000L) != 0L)\r
+ {\r
+ jjmatchedKind = 15;\r
+ jjmatchedPos = 3;\r
+ }\r
+ else if ((active0 & 0x200000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 33, 2);\r
+ else if ((active0 & 0x4000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 38, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x24400000a980180L);\r
+ case 104:\r
+ if ((active0 & 0x400L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 10, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000000000000L);\r
+ case 107:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x100800000002000L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L);\r
+ case 110:\r
+ if ((active0 & 0x10000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 28, 2);\r
+ else if ((active0 & 0x80000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 43, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x108000000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x800001000004010L);\r
+ case 112:\r
+ if ((active0 & 0x400000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 58, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x100000000L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x21000400000040L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x8400000000000L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x80000000040000L);\r
+ case 119:\r
+ if ((active0 & 0x10000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 16, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(2, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa4_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(2, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(3, active0, 0L);\r
+ return 4;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000822000L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x100L);\r
+ case 101:\r
+ if ((active0 & 0x40L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 6, 2);\r
+ else if ((active0 & 0x800000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 47, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x8118000000000L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x110400000100000L);\r
+ case 107:\r
+ if ((active0 & 0x1000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 24, 2);\r
+ else if ((active0 & 0x20000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 29, 2);\r
+ break;\r
+ case 108:\r
+ if ((active0 & 0x80L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 7, 2);\r
+ else if ((active0 & 0x800L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 11, 2);\r
+ break;\r
+ case 109:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x42000000000000L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000000L);\r
+ case 114:\r
+ if ((active0 & 0x8000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 27, 2);\r
+ else if ((active0 & 0x4000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 50, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0xa000010000c0030L);\r
+ case 115:\r
+ if ((active0 & 0x400000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 34, 2);\r
+ break;\r
+ case 116:\r
+ if ((active0 & 0x80000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 55, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x21200004004000L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x100000000L);\r
+ case 119:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(3, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa5_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(3, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(4, active0, 0L);\r
+ return 5;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x1400000004000L);\r
+ case 99:\r
+ if ((active0 & 0x100000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 56, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x8108000002000L);\r
+ case 100:\r
+ if ((active0 & 0x800000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 59, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x42000000000000L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40000000020L);\r
+ case 102:\r
+ if ((active0 & 0x100000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 20, 2);\r
+ break;\r
+ case 103:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000000L);\r
+ case 104:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x200004000010L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x100L);\r
+ case 109:\r
+ if ((active0 & 0x800000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 23, 2);\r
+ break;\r
+ case 110:\r
+ if ((active0 & 0x40000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 18, 2);\r
+ else if ((active0 & 0x10000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 52, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x200000000000000L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x20010000000000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40000000L);\r
+ case 116:\r
+ if ((active0 & 0x80000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 19, 2);\r
+ else if ((active0 & 0x100000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 32, 2);\r
+ else if ((active0 & 0x1000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 36, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x20000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(4, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa6_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(4, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(5, active0, 0L);\r
+ return 6;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x222010000000100L);\r
+ case 101:\r
+ if ((active0 & 0x2000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 37, 2);\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x2002000L);\r
+ case 108:\r
+ if ((active0 & 0x400000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 46, 2);\r
+ break;\r
+ case 110:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x1000000000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x200004020000L);\r
+ case 115:\r
+ if ((active0 & 0x40000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 54, 2);\r
+ break;\r
+ case 116:\r
+ if ((active0 & 0x8000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 39;\r
+ jjmatchedPos = 6;\r
+ }\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x8140000004030L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(5, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa7_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(5, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(6, active0, 0L);\r
+ return 7;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x2000L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x2000000000000L);\r
+ case 101:\r
+ if ((active0 & 0x20L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 5, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x8040000000000L);\r
+ case 104:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x20000000004000L);\r
+ case 108:\r
+ if ((active0 & 0x200000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 57, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x40000000L);\r
+ case 110:\r
+ if ((active0 & 0x2000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 25, 2);\r
+ else if ((active0 & 0x4000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 26, 2);\r
+ else if ((active0 & 0x200000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 45, 2);\r
+ break;\r
+ case 111:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x100000000000L);\r
+ case 114:\r
+ if ((active0 & 0x20000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 17, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x100L);\r
+ case 116:\r
+ if ((active0 & 0x1000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 48, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(6, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa8_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(6, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(7, active0, 0L);\r
+ return 8;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x40000000L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x2000L);\r
+ case 100:\r
+ if ((active0 & 0x8000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 51, 2);\r
+ break;\r
+ case 101:\r
+ if ((active0 & 0x100L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 8, 2);\r
+ break;\r
+ case 105:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x10000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000L);\r
+ case 109:\r
+ if ((active0 & 0x10L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 4, 2);\r
+ break;\r
+ case 110:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x20000000000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x4000L);\r
+ case 114:\r
+ if ((active0 & 0x40000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 42, 2);\r
+ else if ((active0 & 0x100000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 44, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(7, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa9_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(7, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(8, active0, 0L);\r
+ return 9;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 101:\r
+ if ((active0 & 0x2000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(9, 49, 2);\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x20000000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x2000L);\r
+ case 110:\r
+ if ((active0 & 0x4000L) != 0L)\r
+ return jjStartNfaWithStates_0(9, 14, 2);\r
+ break;\r
+ case 111:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x10000000000L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(8, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa10_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(8, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(9, active0, 0L);\r
+ return 10;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 100:\r
+ return jjMoveStringLiteralDfa11_0(active0, 0x20000000000000L);\r
+ case 101:\r
+ if ((active0 & 0x2000L) != 0L)\r
+ return jjStartNfaWithStates_0(10, 13, 2);\r
+ return jjMoveStringLiteralDfa11_0(active0, 0x40000000L);\r
+ case 110:\r
+ if ((active0 & 0x10000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(10, 40, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(9, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa11_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(9, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(10, active0, 0L);\r
+ return 11;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 98:\r
+ return jjMoveStringLiteralDfa12_0(active0, 0x20000000000000L);\r
+ case 100:\r
+ if ((active0 & 0x40000000L) != 0L)\r
+ return jjStartNfaWithStates_0(11, 30, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(10, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa12_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(10, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(11, active0, 0L);\r
+ return 12;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 121:\r
+ if ((active0 & 0x20000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(12, 53, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(11, active0, 0L);\r
+}\r
+private int jjStartNfaWithStates_0(int pos, int kind, int state)\r
+{\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = pos;\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) { return pos + 1; }\r
+ return jjMoveNfa_0(state, pos + 1);\r
+}\r
+static final long[] jjbitVec0 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};\r
+private int jjMoveNfa_0(int startState, int curPos)\r
+{\r
+ int startsAt = 0;\r
+ jjnewStateCnt = 37;\r
+ int i = 1;\r
+ jjstateSet[0] = startState;\r
+ int kind = 0x7fffffff;\r
+ for (;;)\r
+ {\r
+ if (++jjround == 0x7fffffff)\r
+ ReInitRounds();\r
+ if (curChar < 64)\r
+ {\r
+ long l = 1L << curChar;\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 0:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ {\r
+ if (kind > 91)\r
+ kind = 91;\r
+ jjCheckNAddStates(0, 4);\r
+ }\r
+ else if ((0x100002600L & l) != 0L)\r
+ {\r
+ if (kind > 1)\r
+ kind = 1;\r
+ }\r
+ else if (curChar == 47)\r
+ jjAddStates(5, 6);\r
+ else if (curChar == 46)\r
+ jjCheckNAdd(12);\r
+ else if (curChar == 34)\r
+ jjCheckNAddStates(7, 9);\r
+ else if (curChar == 39)\r
+ jjCheckNAddTwoStates(4, 5);\r
+ break;\r
+ case 17:\r
+ if (curChar == 47)\r
+ {\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(24);\r
+ }\r
+ else if (curChar == 42)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 2:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 88)\r
+ kind = 88;\r
+ jjstateSet[jjnewStateCnt++] = 2;\r
+ break;\r
+ case 3:\r
+ if (curChar == 39)\r
+ jjCheckNAddTwoStates(4, 5);\r
+ break;\r
+ case 4:\r
+ if ((0xaffffc8300001100L & l) != 0L)\r
+ jjCheckNAddTwoStates(4, 5);\r
+ break;\r
+ case 5:\r
+ if (curChar == 39 && kind > 89)\r
+ kind = 89;\r
+ break;\r
+ case 6:\r
+ if (curChar == 34)\r
+ jjCheckNAddStates(7, 9);\r
+ break;\r
+ case 7:\r
+ if ((0xfffffffbfffffbffL & l) != 0L)\r
+ jjCheckNAddStates(7, 9);\r
+ break;\r
+ case 9:\r
+ if ((0xfffffffffffffbffL & l) != 0L)\r
+ jjCheckNAddStates(7, 9);\r
+ break;\r
+ case 10:\r
+ if (curChar == 34 && kind > 90)\r
+ kind = 90;\r
+ break;\r
+ case 11:\r
+ if (curChar == 46)\r
+ jjCheckNAdd(12);\r
+ break;\r
+ case 12:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAddTwoStates(12, 13);\r
+ break;\r
+ case 14:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(15);\r
+ break;\r
+ case 15:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAdd(15);\r
+ break;\r
+ case 16:\r
+ if (curChar == 47)\r
+ jjAddStates(5, 6);\r
+ break;\r
+ case 18:\r
+ if ((0xfffffbffffffffffL & l) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 19:\r
+ if (curChar == 42)\r
+ jjstateSet[jjnewStateCnt++] = 20;\r
+ break;\r
+ case 20:\r
+ if ((0xffff7fffffffffffL & l) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 21:\r
+ if (curChar == 47 && kind > 2)\r
+ kind = 2;\r
+ break;\r
+ case 22:\r
+ if (curChar == 42)\r
+ jjstateSet[jjnewStateCnt++] = 21;\r
+ break;\r
+ case 23:\r
+ if (curChar != 47)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(24);\r
+ break;\r
+ case 24:\r
+ if ((0xfffffffffffffbffL & l) == 0L)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(24);\r
+ break;\r
+ case 25:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 91)\r
+ kind = 91;\r
+ jjCheckNAddStates(0, 4);\r
+ break;\r
+ case 26:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 91)\r
+ kind = 91;\r
+ jjCheckNAdd(26);\r
+ break;\r
+ case 27:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(27, 28);\r
+ break;\r
+ case 28:\r
+ if (curChar != 46)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAddTwoStates(29, 30);\r
+ break;\r
+ case 29:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAddTwoStates(29, 30);\r
+ break;\r
+ case 31:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(32);\r
+ break;\r
+ case 32:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAdd(32);\r
+ break;\r
+ case 33:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(33, 34);\r
+ break;\r
+ case 35:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(36);\r
+ break;\r
+ case 36:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAdd(36);\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ else if (curChar < 128)\r
+ {\r
+ long l = 1L << (curChar & 077);\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 0:\r
+ case 2:\r
+ if ((0x7fffffe87fffffeL & l) == 0L)\r
+ break;\r
+ if (kind > 88)\r
+ kind = 88;\r
+ jjCheckNAdd(2);\r
+ break;\r
+ case 4:\r
+ if ((0x47fffffed7ffffffL & l) != 0L)\r
+ jjAddStates(13, 14);\r
+ break;\r
+ case 7:\r
+ if ((0xffffffffefffffffL & l) != 0L)\r
+ jjCheckNAddStates(7, 9);\r
+ break;\r
+ case 8:\r
+ if (curChar == 92)\r
+ jjstateSet[jjnewStateCnt++] = 9;\r
+ break;\r
+ case 9:\r
+ jjCheckNAddStates(7, 9);\r
+ break;\r
+ case 13:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(15, 16);\r
+ break;\r
+ case 18:\r
+ case 20:\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 24:\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjstateSet[jjnewStateCnt++] = 24;\r
+ break;\r
+ case 30:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(17, 18);\r
+ break;\r
+ case 34:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(19, 20);\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ else\r
+ {\r
+ int i2 = (curChar & 0xff) >> 6;\r
+ long l2 = 1L << (curChar & 077);\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 7:\r
+ case 9:\r
+ if ((jjbitVec0[i2] & l2) != 0L)\r
+ jjCheckNAddStates(7, 9);\r
+ break;\r
+ case 18:\r
+ case 20:\r
+ if ((jjbitVec0[i2] & l2) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 24:\r
+ if ((jjbitVec0[i2] & l2) == 0L)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjstateSet[jjnewStateCnt++] = 24;\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ if (kind != 0x7fffffff)\r
+ {\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = curPos;\r
+ kind = 0x7fffffff;\r
+ }\r
+ ++curPos;\r
+ if ((i = jjnewStateCnt) == (startsAt = 37 - (jjnewStateCnt = startsAt)))\r
+ return curPos;\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) { return curPos; }\r
+ }\r
+}\r
+static final int[] jjnextStates = {
+ 26, 27, 28, 33, 34, 17, 23, 7, 8, 10, 18, 19, 22, 4, 5, 14,
+ 15, 31, 32, 35, 36,
+};\r
+\r
+/** Token literal values. */\r
+public static final String[] jjstrLiteralImages = {\r
+"", null, null, null, "\141\154\147\157\162\151\164\150\155", \r
+"\144\151\163\143\162\145\164\145", "\146\141\154\163\145", "\155\157\144\145\154", \r
+"\162\145\144\145\143\154\141\162\145", "\141\156\144", "\145\141\143\150", "\146\151\156\141\154", "\156\157\164", \r
+"\162\145\160\154\141\143\145\141\142\154\145", "\141\156\156\157\164\141\164\151\157\156", "\145\154\163\145", \r
+"\146\154\157\167", "\157\160\145\162\141\164\157\162", "\162\145\164\165\162\156", \r
+"\141\163\163\145\162\164", "\145\154\163\145\151\146", "\146\157\162", "\157\162", \r
+"\163\164\162\145\141\155", "\142\154\157\143\153", "\145\154\163\145\167\150\145\156", \r
+"\146\165\156\143\164\151\157\156", "\157\165\164\145\162", "\164\150\145\156", "\142\162\145\141\153", \r
+"\145\156\143\141\160\163\165\154\141\164\145\144", "\151\146", "\157\165\164\160\165\164", "\164\162\165\145", \r
+"\143\154\141\163\163", "\145\156\144", "\151\155\160\157\162\164", "\160\141\143\153\141\147\145", \r
+"\164\171\160\145", "\143\157\156\156\145\143\164", \r
+"\145\156\165\155\145\162\141\164\151\157\156", "\151\156", "\160\141\162\141\155\145\164\145\162", "\167\150\145\156", \r
+"\143\157\156\156\145\143\164\157\162", "\145\161\165\141\164\151\157\156", "\160\141\162\164\151\141\154", \r
+"\167\150\151\154\145", "\143\157\156\163\164\141\156\164", \r
+"\145\170\160\141\156\144\141\142\154\145", "\151\156\156\145\162", "\160\162\157\164\145\143\164\145\144", \r
+"\167\151\164\150\151\156", "\143\157\156\163\164\162\141\151\156\145\144\142\171", \r
+"\145\170\164\145\156\144\163", "\151\156\160\165\164", "\160\165\142\154\151\143", \r
+"\145\170\164\145\162\156\141\154", "\154\157\157\160", "\162\145\143\157\162\144", "\50", "\51", "\173", "\175", \r
+"\133", "\135", "\56", "\72", "\73", "\54", "\74", "\74\75", "\76", "\76\75", \r
+"\75\75", "\74\76", "\53", "\55", "\56\53", "\56\55", "\52", "\57", "\56\52", "\56\57", \r
+"\136", "\56\136", "\75", "\72\75", null, null, null, null, null, };\r
+\r
+/** Lexer state names. */\r
+public static final String[] lexStateNames = {\r
+ "DEFAULT",\r
+};\r
+static final long[] jjtoToken = {
+ 0xfffffffffffffff1L, 0x1fffffffL,
+};\r
+static final long[] jjtoSkip = {
+ 0xeL, 0x0L,
+};\r
+protected SimpleCharStream input_stream;\r
+private final int[] jjrounds = new int[37];\r
+private final int[] jjstateSet = new int[74];\r
+private final StringBuilder jjimage = new StringBuilder();\r
+private StringBuilder image = jjimage;\r
+private int jjimageLen;\r
+private int lengthOfMatch;\r
+protected char curChar;\r
+/** Constructor. */\r
+public ExpressionParserTokenManager(SimpleCharStream stream){\r
+ if (SimpleCharStream.staticFlag)\r
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");\r
+ input_stream = stream;\r
+}\r
+\r
+/** Constructor. */\r
+public ExpressionParserTokenManager(SimpleCharStream stream, int lexState){\r
+ this(stream);\r
+ SwitchTo(lexState);\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream)\r
+{\r
+ jjmatchedPos = jjnewStateCnt = 0;\r
+ curLexState = defaultLexState;\r
+ input_stream = stream;\r
+ ReInitRounds();\r
+}\r
+private void ReInitRounds()\r
+{\r
+ int i;\r
+ jjround = 0x80000001;\r
+ for (i = 37; i-- > 0;)\r
+ jjrounds[i] = 0x80000000;\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream, int lexState)\r
+{\r
+ ReInit(stream);\r
+ SwitchTo(lexState);\r
+}\r
+\r
+/** Switch to specified lex state. */\r
+public void SwitchTo(int lexState)\r
+{\r
+ if (lexState >= 1 || lexState < 0)\r
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);\r
+ else\r
+ curLexState = lexState;\r
+}\r
+\r
+protected Token jjFillToken()\r
+{\r
+ final Token t;\r
+ final String curTokenImage;\r
+ final int beginLine;\r
+ final int endLine;\r
+ final int beginColumn;\r
+ final int endColumn;\r
+ String im = jjstrLiteralImages[jjmatchedKind];\r
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;\r
+ beginLine = input_stream.getBeginLine();\r
+ beginColumn = input_stream.getBeginColumn();\r
+ endLine = input_stream.getEndLine();\r
+ endColumn = input_stream.getEndColumn();\r
+ t = Token.newToken(jjmatchedKind);\r
+ t.kind = jjmatchedKind;\r
+ t.image = curTokenImage;\r
+\r
+ t.beginLine = beginLine;\r
+ t.endLine = endLine;\r
+ t.beginColumn = beginColumn;\r
+ t.endColumn = endColumn;\r
+\r
+ return t;\r
+}\r
+\r
+int curLexState = 0;\r
+int defaultLexState = 0;\r
+int jjnewStateCnt;\r
+int jjround;\r
+int jjmatchedPos;\r
+int jjmatchedKind;\r
+\r
+/** Get the next Token. */\r
+public Token getNextToken() \r
+{\r
+ Token matchedToken;\r
+ int curPos = 0;\r
+\r
+ EOFLoop :
+ for (;;)\r
+ {\r
+ try\r
+ {\r
+ curChar = input_stream.BeginToken();\r
+ }\r
+ catch(java.io.IOException e)\r
+ {\r
+ jjmatchedKind = 0;\r
+ matchedToken = jjFillToken();\r
+ return matchedToken;\r
+ }\r
+ image = jjimage;\r
+ image.setLength(0);\r
+ jjimageLen = 0;\r
+\r
+ jjmatchedKind = 0x7fffffff;\r
+ jjmatchedPos = 0;\r
+ curPos = jjMoveStringLiteralDfa0_0();\r
+ if (jjmatchedKind != 0x7fffffff)\r
+ {\r
+ if (jjmatchedPos + 1 < curPos)\r
+ input_stream.backup(curPos - jjmatchedPos - 1);\r
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\r
+ {\r
+ matchedToken = jjFillToken();\r
+ TokenLexicalActions(matchedToken);\r
+ return matchedToken;\r
+ }\r
+ else\r
+ {\r
+ continue EOFLoop;\r
+ }\r
+ }\r
+ int error_line = input_stream.getEndLine();\r
+ int error_column = input_stream.getEndColumn();\r
+ String error_after = null;\r
+ boolean EOFSeen = false;\r
+ try { input_stream.readChar(); input_stream.backup(1); }\r
+ catch (java.io.IOException e1) {\r
+ EOFSeen = true;\r
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+ if (curChar == '\n' || curChar == '\r') {\r
+ error_line++;\r
+ error_column = 0;\r
+ }\r
+ else\r
+ error_column++;\r
+ }\r
+ if (!EOFSeen) {\r
+ input_stream.backup(1);\r
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+ }\r
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\r
+ }\r
+}\r
+\r
+void TokenLexicalActions(Token matchedToken)\r
+{\r
+ switch(jjmatchedKind)\r
+ {\r
+ case 90 :\r
+ image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));\r
+ matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+}\r
+private void jjCheckNAdd(int state)\r
+{\r
+ if (jjrounds[state] != jjround)\r
+ {\r
+ jjstateSet[jjnewStateCnt++] = state;\r
+ jjrounds[state] = jjround;\r
+ }\r
+}\r
+private void jjAddStates(int start, int end)\r
+{\r
+ do {\r
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];\r
+ } while (start++ != end);\r
+}\r
+private void jjCheckNAddTwoStates(int state1, int state2)\r
+{\r
+ jjCheckNAdd(state1);\r
+ jjCheckNAdd(state2);\r
+}\r
+\r
+private void jjCheckNAddStates(int start, int end)\r
+{\r
+ do {\r
+ jjCheckNAdd(jjnextStates[start]);\r
+ } while (start++ != end);\r
+}\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.expressionParser;\r
+\r
+/**\r
+ * This exception is thrown when parse errors are encountered.\r
+ * You can explicitly create objects of this exception type by\r
+ * calling the method generateParseException in the generated\r
+ * parser.\r
+ *\r
+ * You can modify this class to customize your error reporting\r
+ * mechanisms so long as you retain the public fields.\r
+ */\r
+public class ParseException extends Exception {\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /**\r
+ * This constructor is used by the method "generateParseException"\r
+ * in the generated parser. Calling this constructor generates\r
+ * a new object of this type with the fields "currentToken",\r
+ * "expectedTokenSequences", and "tokenImage" set.\r
+ */\r
+ public ParseException(Token currentTokenVal,\r
+ int[][] expectedTokenSequencesVal,\r
+ String[] tokenImageVal\r
+ )\r
+ {\r
+ super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));\r
+ currentToken = currentTokenVal;\r
+ expectedTokenSequences = expectedTokenSequencesVal;\r
+ tokenImage = tokenImageVal;\r
+ }\r
+\r
+ /**\r
+ * The following constructors are for use by you for whatever\r
+ * purpose you can think of. Constructing the exception in this\r
+ * manner makes the exception behave in the normal way - i.e., as\r
+ * documented in the class "Throwable". The fields "errorToken",\r
+ * "expectedTokenSequences", and "tokenImage" do not contain\r
+ * relevant information. The JavaCC generated code does not use\r
+ * these constructors.\r
+ */\r
+\r
+ public ParseException() {\r
+ super();\r
+ }\r
+\r
+ /** Constructor with message. */\r
+ public ParseException(String message) {\r
+ super(message);\r
+ }\r
+\r
+\r
+ /**\r
+ * This is the last token that has been consumed successfully. If\r
+ * this object has been created due to a parse error, the token\r
+ * followng this token will (therefore) be the first error token.\r
+ */\r
+ public Token currentToken;\r
+\r
+ /**\r
+ * Each entry in this array is an array of integers. Each array\r
+ * of integers represents a sequence of tokens (by their ordinal\r
+ * values) that is expected at this point of the parse.\r
+ */\r
+ public int[][] expectedTokenSequences;\r
+\r
+ /**\r
+ * This is a reference to the "tokenImage" array of the generated\r
+ * parser within which the parse error occurred. This array is\r
+ * defined in the generated ...Constants interface.\r
+ */\r
+ public String[] tokenImage;\r
+\r
+ /**\r
+ * It uses "currentToken" and "expectedTokenSequences" to generate a parse\r
+ * error message and returns it. If this object has been created\r
+ * due to a parse error, and you do not catch it (it gets thrown\r
+ * from the parser) the correct error message\r
+ * gets displayed.\r
+ */\r
+ private static String initialise(Token currentToken,\r
+ int[][] expectedTokenSequences,\r
+ String[] tokenImage) {\r
+ String eol = System.getProperty("line.separator", "\n");\r
+ StringBuffer expected = new StringBuffer();\r
+ int maxSize = 0;\r
+ for (int i = 0; i < expectedTokenSequences.length; i++) {\r
+ if (maxSize < expectedTokenSequences[i].length) {\r
+ maxSize = expectedTokenSequences[i].length;\r
+ }\r
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {\r
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');\r
+ }\r
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {\r
+ expected.append("...");\r
+ }\r
+ expected.append(eol).append(" ");\r
+ }\r
+ String retval = "Encountered \"";\r
+ Token tok = currentToken.next;\r
+ for (int i = 0; i < maxSize; i++) {\r
+ if (i != 0) retval += " ";\r
+ if (tok.kind == 0) {\r
+ retval += tokenImage[0];\r
+ break;\r
+ }\r
+ retval += " " + tokenImage[tok.kind];\r
+ retval += " \"";\r
+ retval += add_escapes(tok.image);\r
+ retval += " \"";\r
+ tok = tok.next;\r
+ }\r
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;\r
+ retval += "." + eol;\r
+ if (expectedTokenSequences.length == 1) {\r
+ retval += "Was expecting:" + eol + " ";\r
+ } else {\r
+ retval += "Was expecting one of:" + eol + " ";\r
+ }\r
+ retval += expected.toString();\r
+ return retval;\r
+ }\r
+\r
+ /**\r
+ * The end of line string for this machine.\r
+ */\r
+ protected String eol = System.getProperty("line.separator", "\n");\r
+\r
+ /**\r
+ * Used to convert raw characters to their escaped version\r
+ * when these raw version cannot be used as part of an ASCII\r
+ * string literal.\r
+ */\r
+ static String add_escapes(String str) {\r
+ StringBuffer retval = new StringBuffer();\r
+ char ch;\r
+ for (int i = 0; i < str.length(); i++) {\r
+ switch (str.charAt(i))\r
+ {\r
+ case 0 :\r
+ continue;\r
+ case '\b':\r
+ retval.append("\\b");\r
+ continue;\r
+ case '\t':\r
+ retval.append("\\t");\r
+ continue;\r
+ case '\n':\r
+ retval.append("\\n");\r
+ continue;\r
+ case '\f':\r
+ retval.append("\\f");\r
+ continue;\r
+ case '\r':\r
+ retval.append("\\r");\r
+ continue;\r
+ case '\"':\r
+ retval.append("\\\"");\r
+ continue;\r
+ case '\'':\r
+ retval.append("\\\'");\r
+ continue;\r
+ case '\\':\r
+ retval.append("\\\\");\r
+ continue;\r
+ default:\r
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+ String s = "0000" + Integer.toString(ch, 16);\r
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+ } else {\r
+ retval.append(ch);\r
+ }\r
+ continue;\r
+ }\r
+ }\r
+ return retval.toString();\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=65dcbd31a9e7a053287ebf70e24f8b8f (do not edit this line) */\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.expressionParser;\r
+\r
+/**\r
+ * An implementation of interface CharStream, where the stream is assumed to\r
+ * contain only ASCII characters (without unicode processing).\r
+ */\r
+\r
+public class SimpleCharStream\r
+{\r
+/** Whether parser is static. */\r
+ public static final boolean staticFlag = false;\r
+ int bufsize;\r
+ int available;\r
+ int tokenBegin;\r
+/** Position in buffer. */\r
+ public int bufpos = -1;\r
+ protected int bufline[];\r
+ protected int bufcolumn[];\r
+\r
+ protected int column = 0;\r
+ protected int line = 1;\r
+\r
+ protected boolean prevCharIsCR = false;\r
+ protected boolean prevCharIsLF = false;\r
+\r
+ protected java.io.Reader inputStream;\r
+\r
+ protected char[] buffer;\r
+ protected int maxNextCharInd = 0;\r
+ protected int inBuf = 0;\r
+ protected int tabSize = 8;\r
+\r
+ protected void setTabSize(int i) { tabSize = i; }\r
+ protected int getTabSize(int i) { return tabSize; }\r
+\r
+\r
+ protected void ExpandBuff(boolean wrapAround)\r
+ {\r
+ char[] newbuffer = new char[bufsize + 2048];\r
+ int newbufline[] = new int[bufsize + 2048];\r
+ int newbufcolumn[] = new int[bufsize + 2048];\r
+\r
+ try\r
+ {\r
+ if (wrapAround)\r
+ {\r
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+ System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);\r
+ buffer = newbuffer;\r
+\r
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);\r
+ bufline = newbufline;\r
+\r
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);\r
+ bufcolumn = newbufcolumn;\r
+\r
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));\r
+ }\r
+ else\r
+ {\r
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+ buffer = newbuffer;\r
+\r
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+ bufline = newbufline;\r
+\r
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+ bufcolumn = newbufcolumn;\r
+\r
+ maxNextCharInd = (bufpos -= tokenBegin);\r
+ }\r
+ }\r
+ catch (Throwable t)\r
+ {\r
+ throw new Error(t.getMessage());\r
+ }\r
+\r
+\r
+ bufsize += 2048;\r
+ available = bufsize;\r
+ tokenBegin = 0;\r
+ }\r
+\r
+ protected void FillBuff() throws java.io.IOException\r
+ {\r
+ if (maxNextCharInd == available)\r
+ {\r
+ if (available == bufsize)\r
+ {\r
+ if (tokenBegin > 2048)\r
+ {\r
+ bufpos = maxNextCharInd = 0;\r
+ available = tokenBegin;\r
+ }\r
+ else if (tokenBegin < 0)\r
+ bufpos = maxNextCharInd = 0;\r
+ else\r
+ ExpandBuff(false);\r
+ }\r
+ else if (available > tokenBegin)\r
+ available = bufsize;\r
+ else if ((tokenBegin - available) < 2048)\r
+ ExpandBuff(true);\r
+ else\r
+ available = tokenBegin;\r
+ }\r
+\r
+ int i;\r
+ try {\r
+ if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)\r
+ {\r
+ inputStream.close();\r
+ throw new java.io.IOException();\r
+ }\r
+ else\r
+ maxNextCharInd += i;\r
+ return;\r
+ }\r
+ catch(java.io.IOException e) {\r
+ --bufpos;\r
+ backup(0);\r
+ if (tokenBegin == -1)\r
+ tokenBegin = bufpos;\r
+ throw e;\r
+ }\r
+ }\r
+\r
+/** Start. */\r
+ public char BeginToken() throws java.io.IOException\r
+ {\r
+ tokenBegin = -1;\r
+ char c = readChar();\r
+ tokenBegin = bufpos;\r
+\r
+ return c;\r
+ }\r
+\r
+ protected void UpdateLineColumn(char c)\r
+ {\r
+ column++;\r
+\r
+ if (prevCharIsLF)\r
+ {\r
+ prevCharIsLF = false;\r
+ line += (column = 1);\r
+ }\r
+ else if (prevCharIsCR)\r
+ {\r
+ prevCharIsCR = false;\r
+ if (c == '\n')\r
+ {\r
+ prevCharIsLF = true;\r
+ }\r
+ else\r
+ line += (column = 1);\r
+ }\r
+\r
+ switch (c)\r
+ {\r
+ case '\r' :\r
+ prevCharIsCR = true;\r
+ break;\r
+ case '\n' :\r
+ prevCharIsLF = true;\r
+ break;\r
+ case '\t' :\r
+ column--;\r
+ column += (tabSize - (column % tabSize));\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+\r
+ bufline[bufpos] = line;\r
+ bufcolumn[bufpos] = column;\r
+ }\r
+\r
+/** Read a character. */\r
+ public char readChar() throws java.io.IOException\r
+ {\r
+ if (inBuf > 0)\r
+ {\r
+ --inBuf;\r
+\r
+ if (++bufpos == bufsize)\r
+ bufpos = 0;\r
+\r
+ return buffer[bufpos];\r
+ }\r
+\r
+ if (++bufpos >= maxNextCharInd)\r
+ FillBuff();\r
+\r
+ char c = buffer[bufpos];\r
+\r
+ UpdateLineColumn(c);\r
+ return c;\r
+ }\r
+\r
+ @Deprecated\r
+ /**\r
+ * @deprecated\r
+ * @see #getEndColumn\r
+ */\r
+\r
+ public int getColumn() {\r
+ return bufcolumn[bufpos];\r
+ }\r
+\r
+ @Deprecated\r
+ /**\r
+ * @deprecated\r
+ * @see #getEndLine\r
+ */\r
+\r
+ public int getLine() {\r
+ return bufline[bufpos];\r
+ }\r
+\r
+ /** Get token end column number. */\r
+ public int getEndColumn() {\r
+ return bufcolumn[bufpos];\r
+ }\r
+\r
+ /** Get token end line number. */\r
+ public int getEndLine() {\r
+ return bufline[bufpos];\r
+ }\r
+\r
+ /** Get token beginning column number. */\r
+ public int getBeginColumn() {\r
+ return bufcolumn[tokenBegin];\r
+ }\r
+\r
+ /** Get token beginning line number. */\r
+ public int getBeginLine() {\r
+ return bufline[tokenBegin];\r
+ }\r
+\r
+/** Backup a number of characters. */\r
+ public void backup(int amount) {\r
+\r
+ inBuf += amount;\r
+ if ((bufpos -= amount) < 0)\r
+ bufpos += bufsize;\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ inputStream = dstream;\r
+ line = startline;\r
+ column = startcolumn - 1;\r
+\r
+ available = bufsize = buffersize;\r
+ buffer = new char[buffersize];\r
+ bufline = new int[buffersize];\r
+ bufcolumn = new int[buffersize];\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ this(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream)\r
+ {\r
+ this(dstream, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ inputStream = dstream;\r
+ line = startline;\r
+ column = startcolumn - 1;\r
+\r
+ if (buffer == null || buffersize != buffer.length)\r
+ {\r
+ available = bufsize = buffersize;\r
+ buffer = new char[buffersize];\r
+ bufline = new int[buffersize];\r
+ bufcolumn = new int[buffersize];\r
+ }\r
+ prevCharIsLF = prevCharIsCR = false;\r
+ tokenBegin = inBuf = maxNextCharInd = 0;\r
+ bufpos = -1;\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ ReInit(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream)\r
+ {\r
+ ReInit(dstream, 1, 1, 4096);\r
+ }\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(dstream, encoding, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ this(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(dstream, encoding, 1, 1, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream)\r
+ {\r
+ this(dstream, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(dstream, encoding, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream)\r
+ {\r
+ ReInit(dstream, 1, 1, 4096);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(dstream, encoding, startline, startcolumn, 4096);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ ReInit(dstream, startline, startcolumn, 4096);\r
+ }\r
+ /** Get token literal value. */\r
+ public String GetImage()\r
+ {\r
+ if (bufpos >= tokenBegin)\r
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);\r
+ else\r
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +\r
+ new String(buffer, 0, bufpos + 1);\r
+ }\r
+\r
+ /** Get the suffix. */\r
+ public char[] GetSuffix(int len)\r
+ {\r
+ char[] ret = new char[len];\r
+\r
+ if ((bufpos + 1) >= len)\r
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);\r
+ else\r
+ {\r
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,\r
+ len - bufpos - 1);\r
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);\r
+ }\r
+\r
+ return ret;\r
+ }\r
+\r
+ /** Reset buffer when finished. */\r
+ public void Done()\r
+ {\r
+ buffer = null;\r
+ bufline = null;\r
+ bufcolumn = null;\r
+ }\r
+\r
+ /**\r
+ * Method to adjust line and column numbers for the start of a token.\r
+ */\r
+ public void adjustBeginLineColumn(int newLine, int newCol)\r
+ {\r
+ int start = tokenBegin;\r
+ int len;\r
+\r
+ if (bufpos >= tokenBegin)\r
+ {\r
+ len = bufpos - tokenBegin + inBuf + 1;\r
+ }\r
+ else\r
+ {\r
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;\r
+ }\r
+\r
+ int i = 0, j = 0, k = 0;\r
+ int nextColDiff = 0, columnDiff = 0;\r
+\r
+ while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])\r
+ {\r
+ bufline[j] = newLine;\r
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];\r
+ bufcolumn[j] = newCol + columnDiff;\r
+ columnDiff = nextColDiff;\r
+ i++;\r
+ }\r
+\r
+ if (i < len)\r
+ {\r
+ bufline[j] = newLine++;\r
+ bufcolumn[j] = newCol + columnDiff;\r
+\r
+ while (i++ < len)\r
+ {\r
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])\r
+ bufline[j] = newLine++;\r
+ else\r
+ bufline[j] = newLine;\r
+ }\r
+ }\r
+\r
+ line = bufline[j];\r
+ column = bufcolumn[j];\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=c766a5138ab7879b8b98d46681a242b8 (do not edit this line) */\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.expressionParser;\r
+\r
+import java.io.StringReader;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+\r
+public class TestExpressionParser {\r
+ \r
+ static private ExpressionParser parser;\r
+ \r
+ public static void parse(String string) {\r
+ parser.ReInit(new StringReader(string));\r
+ try {\r
+ parser.expr();\r
+ HashMap<String, List<Token>> references = parser.getReferences();\r
+ for(String ref : references.keySet()) {\r
+ System.out.println(ref);\r
+ }\r
+ } catch (ParseException e) {\r
+ System.out.println("While parsing " + string + ":");\r
+ // TODO Auto-generated catch block\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ \r
+ public static void main(String[] args) {\r
+ parser = new ExpressionParser(\r
+ new StringReader("")\r
+ );\r
+ parse("1 + m2ma");\r
+ System.out.println("##");\r
+ parse("ter2e + moro");\r
+ System.out.println("##");\r
+ parse("moro * sqr(4.0) + min(m2ma, moi)");\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.expressionParser;\r
+\r
+/**\r
+ * Describes the input token stream.\r
+ */\r
+\r
+public class Token implements java.io.Serializable, Comparable<Token> {\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /**\r
+ * An integer that describes the kind of this token. This numbering\r
+ * system is determined by JavaCCParser, and a table of these numbers is\r
+ * stored in the file ...Constants.java.\r
+ */\r
+ public int kind;\r
+\r
+ /** The line number of the first character of this Token. */\r
+ public int beginLine;\r
+ /** The column number of the first character of this Token. */\r
+ public int beginColumn;\r
+ /** The line number of the last character of this Token. */\r
+ public int endLine;\r
+ /** The column number of the last character of this Token. */\r
+ public int endColumn;\r
+\r
+ /**\r
+ * The string image of the token.\r
+ */\r
+ public String image;\r
+\r
+ /**\r
+ * A reference to the next regular (non-special) token from the input\r
+ * stream. If this is the last token from the input stream, or if the\r
+ * token manager has not read tokens beyond this one, this field is\r
+ * set to null. This is true only if this token is also a regular\r
+ * token. Otherwise, see below for a description of the contents of\r
+ * this field.\r
+ */\r
+ public Token next;\r
+\r
+ /**\r
+ * This field is used to access special tokens that occur prior to this\r
+ * token, but after the immediately preceding regular (non-special) token.\r
+ * If there are no such special tokens, this field is set to null.\r
+ * When there are more than one such special token, this field refers\r
+ * to the last of these special tokens, which in turn refers to the next\r
+ * previous special token through its specialToken field, and so on\r
+ * until the first special token (whose specialToken field is null).\r
+ * The next fields of special tokens refer to other special tokens that\r
+ * immediately follow it (without an intervening regular token). If there\r
+ * is no such token, this field is null.\r
+ */\r
+ public Token specialToken;\r
+\r
+ /**\r
+ * An optional attribute value of the Token.\r
+ * Tokens which are not used as syntactic sugar will often contain\r
+ * meaningful values that will be used later on by the compiler or\r
+ * interpreter. This attribute value is often different from the image.\r
+ * Any subclass of Token that actually wants to return a non-null value can\r
+ * override this method as appropriate.\r
+ */\r
+ public Object getValue() {\r
+ return null;\r
+ }\r
+\r
+ /**\r
+ * No-argument constructor\r
+ */\r
+ public Token() {}\r
+\r
+ /**\r
+ * Constructs a new token for the specified Image.\r
+ */\r
+ public Token(int kind)\r
+ {\r
+ this(kind, null);\r
+ }\r
+\r
+ /**\r
+ * Constructs a new token for the specified Image and Kind.\r
+ */\r
+ public Token(int kind, String image)\r
+ {\r
+ this.kind = kind;\r
+ this.image = image;\r
+ }\r
+\r
+ /**\r
+ * Returns the image.\r
+ */\r
+ public String toString()\r
+ {\r
+ return image;\r
+ }\r
+\r
+ /**\r
+ * Returns a new Token object, by default. However, if you want, you\r
+ * can create and return subclass objects based on the value of ofKind.\r
+ * Simply add the cases to the switch for all those special cases.\r
+ * For example, if you have a subclass of Token called IDToken that\r
+ * you want to create if ofKind is ID, simply add something like :\r
+ *\r
+ * case MyParserConstants.ID : return new IDToken(ofKind, image);\r
+ *\r
+ * to the following switch statement. Then you can cast matchedToken\r
+ * variable to the appropriate type and use sit in your lexical actions.\r
+ */\r
+ public static Token newToken(int ofKind, String image)\r
+ {\r
+ switch(ofKind)\r
+ {\r
+ default : return new Token(ofKind, image);\r
+ }\r
+ }\r
+\r
+ public static Token newToken(int ofKind)\r
+ {\r
+ return newToken(ofKind, null);\r
+ }\r
+\r
+ @Override\r
+ public int compareTo(Token o) {\r
+ if (this.beginLine < o.beginLine)\r
+ return -1;\r
+ if (this.beginLine > o.beginLine)\r
+ return 1;\r
+ else {\r
+ if (this.beginColumn < o.beginColumn)\r
+ return -1;\r
+ if (this.beginColumn > o.beginColumn)\r
+ return 1;\r
+ return 0;\r
+ }\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=ed7a6d865f7fbc2c64e008e34bd824b0 (do not edit this line) */\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.expressionParser;\r
+\r
+/** Token Manager Error. */\r
+public class TokenMgrError extends Error\r
+{\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /*\r
+ * Ordinals for various reasons why an Error of this type can be thrown.\r
+ */\r
+\r
+ /**\r
+ * Lexical error occurred.\r
+ */\r
+ static final int LEXICAL_ERROR = 0;\r
+\r
+ /**\r
+ * An attempt was made to create a second instance of a static token manager.\r
+ */\r
+ static final int STATIC_LEXER_ERROR = 1;\r
+\r
+ /**\r
+ * Tried to change to an invalid lexical state.\r
+ */\r
+ static final int INVALID_LEXICAL_STATE = 2;\r
+\r
+ /**\r
+ * Detected (and bailed out of) an infinite loop in the token manager.\r
+ */\r
+ static final int LOOP_DETECTED = 3;\r
+\r
+ /**\r
+ * Indicates the reason why the exception is thrown. It will have\r
+ * one of the above 4 values.\r
+ */\r
+ int errorCode;\r
+\r
+ /**\r
+ * Replaces unprintable characters by their escaped (or unicode escaped)\r
+ * equivalents in the given string\r
+ */\r
+ protected static final String addEscapes(String str) {\r
+ StringBuffer retval = new StringBuffer();\r
+ char ch;\r
+ for (int i = 0; i < str.length(); i++) {\r
+ switch (str.charAt(i))\r
+ {\r
+ case 0 :\r
+ continue;\r
+ case '\b':\r
+ retval.append("\\b");\r
+ continue;\r
+ case '\t':\r
+ retval.append("\\t");\r
+ continue;\r
+ case '\n':\r
+ retval.append("\\n");\r
+ continue;\r
+ case '\f':\r
+ retval.append("\\f");\r
+ continue;\r
+ case '\r':\r
+ retval.append("\\r");\r
+ continue;\r
+ case '\"':\r
+ retval.append("\\\"");\r
+ continue;\r
+ case '\'':\r
+ retval.append("\\\'");\r
+ continue;\r
+ case '\\':\r
+ retval.append("\\\\");\r
+ continue;\r
+ default:\r
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+ String s = "0000" + Integer.toString(ch, 16);\r
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+ } else {\r
+ retval.append(ch);\r
+ }\r
+ continue;\r
+ }\r
+ }\r
+ return retval.toString();\r
+ }\r
+\r
+ /**\r
+ * Returns a detailed message for the Error when it is thrown by the\r
+ * token manager to indicate a lexical error.\r
+ * Parameters :\r
+ * EOFSeen : indicates if EOF caused the lexical error\r
+ * curLexState : lexical state in which this error occurred\r
+ * errorLine : line number when the error occurred\r
+ * errorColumn : column number when the error occurred\r
+ * errorAfter : prefix that was seen before this error occurred\r
+ * curchar : the offending character\r
+ * Note: You can customize the lexical error message by modifying this method.\r
+ */\r
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {\r
+ return("Lexical error at line " +\r
+ errorLine + ", column " +\r
+ errorColumn + ". Encountered: " +\r
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +\r
+ "after : \"" + addEscapes(errorAfter) + "\"");\r
+ }\r
+\r
+ /**\r
+ * You can also modify the body of this method to customize your error messages.\r
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not\r
+ * of end-users concern, so you can return something like :\r
+ *\r
+ * "Internal Error : Please file a bug report .... "\r
+ *\r
+ * from this method for such cases in the release version of your parser.\r
+ */\r
+ public String getMessage() {\r
+ return super.getMessage();\r
+ }\r
+\r
+ /*\r
+ * Constructors of various flavors follow.\r
+ */\r
+\r
+ /** No arg constructor. */\r
+ public TokenMgrError() {\r
+ }\r
+\r
+ /** Constructor with message and reason. */\r
+ public TokenMgrError(String message, int reason) {\r
+ super(message);\r
+ errorCode = reason;\r
+ }\r
+\r
+ /** Full Constructor. */\r
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {\r
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);\r
+ }\r
+}\r
+/* JavaCC - OriginalChecksum=24b6b4792f62099f85bde9ed73a49451 (do not edit this line) */\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class ActiveResults implements Read<Collection<Resource>>{\r
+ \r
+ private Resource resource;\r
+ \r
+ public ActiveResults(Resource resource) {\r
+ this.resource = resource;\r
+ }\r
+\r
+ @Override\r
+ public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ ModelingResources MR = ModelingResources.getInstance(graph);\r
+ \r
+ Collection<Resource> result = new ArrayList<Resource>();\r
+ \r
+ Collection<Resource> experiments;\r
+ if(graph.isInstanceOf(resource, MR.StructuralModel))\r
+ experiments = graph.syncRequest(new ObjectsWithType(resource, L0.ConsistsOf, SR.Experiment));\r
+ else {\r
+ experiments = new ArrayList<Resource>();\r
+ experiments.add(resource);\r
+ }\r
+ \r
+ for(Resource experiment : experiments) {\r
+ Collection<Resource> experimentResults = graph.getObjects(experiment, SR.Experiment_result);\r
+ for(Resource r : experimentResults) {\r
+ if(graph.hasStatement(r, SR.Result_showResult)) {\r
+ result.add(r);\r
+ }\r
+ }\r
+ Collection<Resource> experimentResultSets = graph.getObjects(experiment, SR.Experiment_resultSet);\r
+ for(Resource resultSet : experimentResultSets) {\r
+ experimentResults = graph.getObjects(resultSet, SR.Experiment_result);\r
+ for(Resource r : experimentResults) {\r
+ if(graph.hasStatement(r, SR.Result_showResult)) {\r
+ result.add(r);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.io.File;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.simantics.databoard.Accessors;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.accessor.Accessor;\r
+import org.simantics.databoard.accessor.MapAccessor;\r
+import org.simantics.databoard.accessor.RecordAccessor;\r
+import org.simantics.databoard.accessor.binary.BinaryRecord;\r
+import org.simantics.databoard.accessor.binary.BinaryVariant;\r
+import org.simantics.databoard.accessor.error.AccessorConstructionException;\r
+import org.simantics.databoard.accessor.error.AccessorException;\r
+import org.simantics.databoard.accessor.reference.ChildReference;\r
+import org.simantics.databoard.accessor.reference.ComponentReference;\r
+import org.simantics.databoard.accessor.reference.IndexReference;\r
+import org.simantics.databoard.accessor.reference.KeyReference;\r
+import org.simantics.databoard.accessor.reference.NameReference;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+\r
+public class FileResult extends SysdynResult {\r
+ \r
+ private RecordAccessor accessor;\r
+\r
+ /**\r
+ * Open result from a file\r
+ * \r
+ * @param result Name of the result (seen in visualization)\r
+ * @param path file path\r
+ */\r
+ public FileResult(String resultName, String path) {\r
+ super(resultName);\r
+ File file = new File(path);\r
+ try {\r
+ BinaryVariant bv = (BinaryVariant)Accessors.openAccessor(file);\r
+ BinaryRecord br = bv.getContentAccessor();\r
+ accessor = br;\r
+ } catch (AccessorConstructionException e) {\r
+ e.printStackTrace();\r
+ } \r
+ }\r
+ \r
+ /**\r
+ * Get the {@link RecordAccessor} of this result\r
+ * @return {@link RecordAccessor} for this result\r
+ */\r
+ public Accessor getAccessor() {\r
+ return accessor;\r
+ }\r
+ \r
+ \r
+ /**\r
+ * Get dataset for a named variable from accessor\r
+ * @param variable The name of the variable\r
+ * @return {@link SysdynDataSet}\r
+ */\r
+ @Override\r
+ public SysdynDataSet getDataSet(String variable) {\r
+ if(accessor != null) {\r
+ synchronized(accessor) {\r
+ ChildReference ref = ChildReference.compile(\r
+ new NameReference("recordings"),\r
+ new KeyReference( Bindings.VARIANT, Variant.ofInstance(variable) ),\r
+ new ComponentReference(),\r
+ new NameReference("segments"),\r
+ new IndexReference(0)\r
+ );\r
+ MapAccessor ma;\r
+ try {\r
+ ma = accessor.getComponent( ref );\r
+ } catch (AccessorConstructionException e) {\r
+ return null;\r
+ } \r
+ \r
+ try {\r
+ int size = ma.size();\r
+ Double[] times = new Double[size];\r
+ Double[] values = new Double[size];\r
+ \r
+ ma.getAll(Bindings.DOUBLE, Bindings.DOUBLE, times, values);\r
+ \r
+ double[] times_ = new double[size];\r
+ double[] values_ = new double[size];\r
+ for (int i=0; i<size; i++) {\r
+ times_[i] = (times[i]!=null ? times[i] : 0);\r
+ values_[i] = (values[i]!=null ? values[i] : 0);\r
+ }\r
+ \r
+ return new SysdynDataSet(variable, getResultName(), times_, values_);\r
+ } catch (AccessorException e) {\r
+ // Unable to read data from file\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public void saveToFile(File file, IProgressMonitor progressMonitor) {\r
+ // Already a saved result. No need for action.\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.io.File;\r
+import java.io.FileNotFoundException;\r
+import java.io.FileOutputStream;\r
+import java.io.IOException;\r
+import java.io.PrintStream;\r
+import java.util.ArrayList;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.Set;\r
+\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.Activator;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class FunctionUtils {\r
+ \r
+ // SOMETHING WRONG HERE\r
+ \r
+ public static List<String> getLibraryPathsForModelica(final SysdynExperiment experiment) {\r
+ try {\r
+ return Simantics.getSession().syncRequest(new Read<List<String>>() {\r
+ @Override\r
+ public List<String> perform(ReadGraph graph) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+\r
+ List<String> paths = new ArrayList<String>();\r
+ for(Resource parent : getParents(graph, experiment.getModel(), true)) {\r
+ if(graph.isInstanceOf(parent, sr.SysdynModel)) {\r
+ String modelName = NameUtils.getSafeName(graph, parent);\r
+ paths.add(modelName + "_functions.mo");\r
+ } else {\r
+ String libraryName = NameUtils.getSafeName(graph, parent);\r
+ paths.add("..\\\\\\\\..\\\\\\\\libraries\\\\\\\\functions\\\\\\\\" + libraryName + ".mo");\r
+ }\r
+ }\r
+ return paths;\r
+ }\r
+ });\r
+ }\r
+ catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ return null;\r
+ }\r
+ }\r
+ \r
+ public static void updateFunctionFilesForExperiment(final SysdynExperiment experiment) {\r
+ try {\r
+ Simantics.getSession().syncRequest(new ReadRequest() {\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ for (Resource parent : getParents(graph, experiment.getModel(), false)) {\r
+ if(graph.isInstanceOf(parent, sr.SysdynModel)) {\r
+ String parentName = NameUtils.getSafeName(graph, parent);\r
+ File scriptFile = new File(experiment.getExperimentDir(), parentName + "_functions.mo");\r
+ updateFunctionFile(graph, parent, scriptFile, false);\r
+ } else {\r
+ updateFunctionFileForLibrary(graph, parent);\r
+ }\r
+ }\r
+ \r
+ }\r
+ });\r
+ }\r
+ catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ \r
+ private static Set<Resource> getParents(ReadGraph graph, Resource model, boolean ignoreEmpty) \r
+ throws DatabaseException{\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+\r
+ Set<Resource> parents = new HashSet<Resource>();\r
+\r
+ if(model == null) {\r
+ return parents;\r
+ }\r
+ \r
+ parents.add(model);\r
+ \r
+ for(Resource r : graph.getObjects(model, l0.IsLinkedTo)) {\r
+ if(graph.isInstanceOf(r, sr.SharedFunctionOntology)) {\r
+ parents.add(r);\r
+ } else {\r
+ if(!graph.syncRequest(new ObjectsWithType(r, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary)).isEmpty()) {\r
+ parents.add(r);\r
+ }\r
+ }\r
+ }\r
+ \r
+ if(ignoreEmpty) {\r
+ Set<Resource> nonEmptyParents = new HashSet<Resource>();\r
+ for(Resource parent : parents) {\r
+ if(isNonEmpty(graph, parent)) {\r
+ nonEmptyParents.add(parent);\r
+ }\r
+ }\r
+ parents = nonEmptyParents;\r
+ }\r
+ \r
+ return parents;\r
+ }\r
+ \r
+ private static boolean isNonEmpty(ReadGraph graph, Resource library) \r
+ throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ if(!graph.syncRequest(new ObjectsWithType(library, l0.ConsistsOf, sr.SysdynModelicaFunction)).isEmpty()) {\r
+ return true;\r
+ } else {\r
+ for(Resource l : graph.syncRequest(new ObjectsWithType(library, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary))) {\r
+ if(isNonEmpty(graph, l)) {\r
+ return true;\r
+ }\r
+ }\r
+ }\r
+ \r
+ return false;\r
+ }\r
+ \r
+ private static void updateFunctionFile(ReadGraph graph, Resource library, File scriptFile, boolean builtIn) \r
+ throws DatabaseException {\r
+ PrintStream s;\r
+ try {\r
+ s = new PrintStream(scriptFile);\r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ return;\r
+ }\r
+ \r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ String name = NameUtils.getSafeName(graph, library);\r
+ \r
+ if(!builtIn && !graph.isInstanceOf(library, sr.SysdynModel)) {\r
+ s.println("package " + name);\r
+ }\r
+ writeLibrary(graph, library, scriptFile, s, builtIn);\r
+ if(!builtIn && !graph.isInstanceOf(library, sr.SysdynModel)) {\r
+ s.println("end " + name + ";\n");\r
+ }\r
+ \r
+ s.close();\r
+ }\r
+ \r
+ private static void updateFunctionFileForLibrary(ReadGraph graph, Resource library) \r
+ throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+\r
+ while(!graph.isInstanceOf(library, l0.Ontology)) {\r
+ library = graph.getSingleObject(library, l0.PartOf);\r
+ }\r
+\r
+ File librariesDir = Activator.getBundleContext().getDataFile("libraries");\r
+ if (!librariesDir.exists()) {\r
+ librariesDir.mkdir();\r
+ }\r
+ File dir = new File(librariesDir, "functions");\r
+ if (!dir.exists()) {\r
+ dir.mkdir();\r
+ }\r
+ \r
+ String parentName = NameUtils.getSafeName(graph, library);\r
+ File scriptFile = new File(dir, parentName + ".mo");\r
+\r
+ Resource sysdyn = graph.getResource("http://www.simantics.org/Sysdyn-1.1");\r
+\r
+ if(library.equals(sysdyn)) {\r
+ updateFunctionFile(graph, library, scriptFile, true);\r
+ } else {\r
+ updateFunctionFile(graph, library, scriptFile, false);\r
+ }\r
+\r
+ }\r
+ \r
+ private static void writeLibrary(ReadGraph graph, Resource library, File scriptFile, PrintStream stream, boolean builtIn) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ writeLibraryFunctions(graph, library, scriptFile, stream);\r
+ for(Resource sublibrary : graph.syncRequest(new ObjectsWithType(library, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary))) {\r
+ String name = NameUtils.getSafeName(graph, sublibrary);\r
+ if(!builtIn)\r
+ stream.println("encapsulated package " + name);\r
+ writeLibrary(graph, sublibrary, scriptFile, stream, builtIn);\r
+ if(!builtIn)\r
+ stream.println("end " + name + ";\n");\r
+ }\r
+ }\r
+ \r
+ private static void writeLibraryFunctions(ReadGraph graph, Resource library, File scriptFile, PrintStream stream) \r
+ throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ for(Resource function : graph.syncRequest(new ObjectsWithType(library, l0.ConsistsOf, sr.SysdynModelicaFunction))) {\r
+ String name = NameUtils.getSafeName(graph, function);\r
+ // Built-in Modelica (array) functions have no function code and they don't need to be added explicitly.\r
+ String functionCode = graph.getPossibleRelatedValue(function, sr.SysdynModelicaFunction_modelicaFunctionCode);\r
+ if (functionCode == null) {\r
+ continue;\r
+ }\r
+ stream.println("function " + name);\r
+ stream.println(functionCode);\r
+ stream.println("end " + name + ";\n");\r
+ for(Resource externalFunction : graph.syncRequest(new ObjectsWithType(function, l0.ConsistsOf, sr.ExternalFunctionFile))) {\r
+ createExternalFunctionFile(graph, externalFunction, scriptFile);\r
+ }\r
+ }\r
+ }\r
+ \r
+ private static void createExternalFunctionFile(ReadGraph graph, Resource externalFunction, File scriptFile) \r
+ throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+\r
+ File dir = scriptFile.getParentFile();\r
+ \r
+ if(!dir.exists())\r
+ dir.mkdir();\r
+ \r
+ if(!dir.isDirectory())\r
+ return;\r
+\r
+ try {\r
+ String name = NameUtils.getSafeName(graph, externalFunction);\r
+ if(name.endsWith(".o") || name.endsWith(".a")) {\r
+ FileOutputStream fos = new FileOutputStream(dir + File.separator + name);\r
+ byte[] fileBArray = graph.getPossibleRelatedValue(externalFunction, sr.ExternalFunctionFile_externalFile, Bindings.BYTE_ARRAY);\r
+ fos.write(fileBArray);\r
+ fos.close();\r
+ }\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.manager;\r
+\r
+import gnu.trove.list.array.TDoubleArrayList;\r
+import gnu.trove.map.hash.THashMap;\r
+\r
+import org.simantics.modelica.data.DataSet;\r
+import org.simantics.modelica.data.SimulationResult;\r
+\r
+/**\r
+ * Game results\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class GameResult extends SimulationResult {\r
+ \r
+ public GameResult(SysdynGameExperimentBase sysdynGameExperiment, THashMap<String, TDoubleArrayList> results, String[] subscription) {\r
+ \r
+ // Get times\r
+ TDoubleArrayList timeList = results.get("time");\r
+ double[] times = timeList.toArray();\r
+ \r
+ String name;\r
+ for(int k = 0; k < subscription.length; k++) {\r
+ name = subscription[k];\r
+ TDoubleArrayList valueList = results.get(name);\r
+ if(valueList.size() == timeList.size()) {\r
+ this.variables.add(new DataSet(name, times, valueList.toArray()));\r
+ } else {\r
+ System.err.println("wrong amount of values " + name);\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ * Semantum Oy - Bug #4180\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.io.File;\r
+import java.io.InputStream;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.procedure.Listener;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.modelica.data.DataSet;\r
+import org.simantics.modelica.data.SimulationResult;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.spreadsheet.SheetVariables;\r
+import org.simantics.spreadsheet.common.matrix.VariantMatrix;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.IElement;\r
+import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.utils.IndexUtils;\r
+import org.simantics.utils.datastructures.Pair;\r
+\r
+/**\r
+ * A result built from a spreadsheet table. Imitates a normal simulation result for \r
+ * easy display on charts and tables.\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class HistoryDatasetResult extends SimulationResult {\r
+ @Override\r
+ public void read(File file, int interval) {} // Do nothing\r
+ @Override\r
+ public void read(InputStream stream, int interval) {} // Do nothing\r
+\r
+ private boolean disposed;\r
+\r
+ /**\r
+ * Dispose listeners of this result. It is important to dispose all listeners \r
+ * when they are not needed anymore.\r
+ */\r
+ public void disposeListeners() {\r
+ this.disposed = true;\r
+ }\r
+\r
+ /**\r
+ * Reads history data to this result. Location of the data is described in historyData resource.\r
+ * \r
+ * @param sysdynResult MemoryResult to which this simulation result is read\r
+ * @param historyData Resource describing the history data to be read from a spreadsheet\r
+ */\r
+ public void read(final MemoryResult sysdynResult, final Resource historyData) {\r
+\r
+ Simantics.getSession().asyncRequest(new Read<Pair<SysdynModel, List<DataSet>>>() {\r
+\r
+ @Override\r
+ public Pair<SysdynModel, List<DataSet>> perform(ReadGraph graph) throws DatabaseException {\r
+ ArrayList<DataSet> variables = new ArrayList<DataSet>();\r
+\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SimulationResource simu = SimulationResource.getInstance(graph);\r
+\r
+ String datasetName = "History Dataset";\r
+ VariantMatrix vm = null;\r
+ SysdynModel sdmodel = null;\r
+ String timeVariable = "time";\r
+ boolean columns = true;\r
+ try {\r
+ Pair<SysdynModel, List<DataSet>> emptyResult = new Pair<SysdynModel, List<DataSet>>(sdmodel, variables);\r
+\r
+ \r
+ // Find the SysdynModel of this historyData\r
+ Resource model = graph.getPossibleObject(historyData, l0.PartOf);\r
+ Resource config = graph.getPossibleObject(model, simu.HasConfiguration);\r
+ sdmodel = SysdynModelManager.getInstance(graph.getSession()).getModel(graph, config);\r
+ sdmodel.update(graph);\r
+ \r
+ // Find properties of the result: name, sheet, range, time variable, orientation\r
+ datasetName = NameUtils.getSafeLabel(graph, historyData);\r
+ \r
+\r
+ Resource sheet = graph.getPossibleObject(historyData, sr.HistoryDataset_sheet);\r
+ if(sheet == null)\r
+ return emptyResult;\r
+ \r
+ String start = graph.getPossibleRelatedValue(historyData, sr.HistoryDataset_start);\r
+ String end = graph.getPossibleRelatedValue(historyData, sr.HistoryDataset_end);\r
+ if(start == null || start.isEmpty() || end == null || end.isEmpty())\r
+ return emptyResult;\r
+ String r = start + ":" + end;\r
+ \r
+ String time = graph.getPossibleRelatedValue(historyData, sr.HistoryDataset_timeName);\r
+ if(time != null && !time.isEmpty())\r
+ timeVariable = time;\r
+ \r
+ if(graph.hasStatement(historyData, sr.HistoryDataset_columns))\r
+ columns = graph.getRelatedValue(historyData, sr.HistoryDataset_columns, Bindings.BOOLEAN);\r
+ \r
+ // Find the sheet variable\r
+ Variable v = graph.adapt(sheet, Variable.class);\r
+ Variable range = v.getChild(graph, r);\r
+ if(range == null)\r
+ return emptyResult;\r
+ \r
+ // Find the content of the range\r
+ Variant content = range.getPropertyValue(graph, SheetVariables.CONTENT, Bindings.VARIANT);\r
+ Object matrixValue = content.getValue();\r
+ if(matrixValue instanceof VariantMatrix) {\r
+ vm = (VariantMatrix)matrixValue;\r
+ }\r
+\r
+ } catch(DatabaseException e) {\r
+ return new Pair<SysdynModel, List<DataSet>>(sdmodel, variables);\r
+ } catch(NegativeArraySizeException e) {\r
+ // Negative array size may be result of mofifying start and end variables\r
+ return new Pair<SysdynModel, List<DataSet>>(sdmodel, variables);\r
+ }\r
+\r
+ \r
+ // Orientation\r
+ int x = columns ? vm.getColumnCount() : vm.getRowCount();\r
+ int y = columns ? vm.getRowCount() : vm.getColumnCount();\r
+ \r
+ /*\r
+ * The table needs at least:\r
+ * \r
+ * headers for variables + one value\r
+ * two variables (of which one is time-variable)\r
+ * \r
+ * => minimum of 2x2 matrix\r
+ */\r
+ if(vm == null || x < 2 || y < 2)\r
+ return new Pair<SysdynModel, List<DataSet>>(sdmodel, variables);\r
+\r
+ String[] names = new String[x];\r
+ HashMap<String, ArrayList<Pair<Double, Double>>> values = new HashMap<String, ArrayList<Pair<Double,Double>>>();\r
+ Integer timeIndex = null;\r
+ \r
+ // Find variable names\r
+ for(int i = 0; i < x ; i++) {\r
+ Variant cell = columns ? vm.get(0, i) : vm.get(i, 0);\r
+ if(cell != null && cell.getValue() != null) {\r
+ String name = cell.getValue().toString();\r
+ if(!values.containsKey(name)) {\r
+ names[i] = name;\r
+ values.put(names[i], new ArrayList<Pair<Double,Double>>());\r
+\r
+ // Time column index\r
+ if(names[i].equals(timeVariable))\r
+ timeIndex = i;\r
+ }\r
+ } else {\r
+ names[i] = null;\r
+ }\r
+ }\r
+\r
+ // If times were not found, return empty\r
+ if(timeIndex == null || names[timeIndex] == null)\r
+ return new Pair<SysdynModel, List<DataSet>>(sdmodel, variables);\r
+\r
+ // Get time column ready first\r
+ for(int i = 1; i < y; i++) {\r
+ Variant cell = columns ? vm.get(i, timeIndex) : vm.get(timeIndex, i);\r
+ Double value = null;\r
+ if(cell != null)\r
+ value = getDoubleValue(cell);\r
+ values.get(names[timeIndex]).add(new Pair<Double, Double>(value, value)); // add also null-values\r
+ }\r
+\r
+ // Get variable values column by column (or row by row\r
+ for(int i = 0; i < x; i++) {\r
+ if(i == timeIndex || names[i] == null) \r
+ continue;\r
+\r
+ for(int j = 1; j < y; j++) {\r
+ Variant cell = columns ? vm.get(j, i) : vm.get(i, j);\r
+ if(cell != null && cell.getValue() != null) {\r
+ Double value = getDoubleValue(cell);\r
+ if(value != null) {\r
+ Pair<Double, Double> time = values.get(names[timeIndex]).get(j - 1);\r
+ if(time != null && time.first != null) {\r
+ values.get(names[i]).add(\r
+ new Pair<Double, Double>(\r
+ time.first, \r
+ value)\r
+ );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ ArrayList<Pair<Double, Double>> doubles = values.get(names[i]);\r
+ \r
+ String name = names[i];\r
+ // If the variable has array indexes, they need to be converted to numbers\r
+ if(name.contains("[")) {\r
+ org.simantics.sysdyn.representation.Variable variable = getVariable(name, sdmodel.getConfiguration());\r
+ if(variable != null)\r
+ name = IndexUtils.equationRangesToIndexes(variable, name);\r
+ }\r
+ \r
+ // Replace spaces with '_'. That is how they are stored elsewhere\r
+ name = name.replace(" ", "_");\r
+\r
+ // Read values to SysdynDataSet\r
+ SysdynDataSet ds = new SysdynDataSet(name, datasetName, new double[doubles.size()], new double[doubles.size()]);\r
+ variables.add(ds);\r
+ for(int d = 0; d < doubles.size(); d++) {\r
+ Pair<Double, Double> pair = doubles.get(d);\r
+ ds.times[d] = pair.first;\r
+ ds.values[d] = pair.second;\r
+ }\r
+ }\r
+ return new Pair<SysdynModel, List<DataSet>>(sdmodel, variables);\r
+ }\r
+\r
+ }, new Listener<Pair<SysdynModel, List<DataSet>>>() {\r
+\r
+ @Override\r
+ public void execute(Pair<SysdynModel, List<DataSet>> result) {\r
+ // Update result set and send message to model that results have been changed\r
+ HistoryDatasetResult.this.variables = result.second;\r
+ sysdynResult.setResult(HistoryDatasetResult.this);\r
+ if(result.first != null)\r
+ result.first.resultChanged();\r
+ }\r
+\r
+ @Override\r
+ public void exception(Throwable t) {\r
+ t.printStackTrace();\r
+ }\r
+\r
+ @Override\r
+ public boolean isDisposed() {\r
+ return disposed;\r
+ }\r
+ });\r
+\r
+\r
+ }\r
+ \r
+ /**\r
+ * Finds a variable defined by path starting from configuration \r
+ * @param path Path of the variable\r
+ * @param configuration Configuration where to look for the variable\r
+ * @return Variable\r
+ */\r
+ private org.simantics.sysdyn.representation.Variable getVariable(String path, Configuration configuration) {\r
+ String next = path;\r
+ int index = next.indexOf(".");\r
+\r
+ // If path has commas, we are looking for a module\r
+ if(index > 0) {\r
+ path = path.substring(index + 1);\r
+ next = next.substring(0, index);\r
+ } else {\r
+ // No commas, we are looking for a variable\r
+ if(next.contains("["))\r
+ // Variable has array indexes, remove the array indexes\r
+ next = next.substring(0, next.indexOf("["));\r
+ }\r
+\r
+ for(IElement e : configuration.getElements()) {\r
+ if(e instanceof org.simantics.sysdyn.representation.Variable) {\r
+ org.simantics.sysdyn.representation.Variable v = (org.simantics.sysdyn.representation.Variable) e;\r
+ if(v.getName().equals(next)) {\r
+ return v; // found the variable\r
+ }\r
+ } else if(e instanceof Module && ((Module)e).getName().equals(next)) {\r
+ return getVariable(path, ((Module)e).getType().getConfiguration()); // Recursive call with a shorter path\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+ /**\r
+ * Finds the double value from a spreadsheet cell. \r
+ * @param cell Cell where to look for\r
+ * @return Double value of the cell or null if not double or if empty\r
+ */\r
+ private Double getDoubleValue(Variant cell) {\r
+ if(cell.getValue() == null)\r
+ return null;\r
+\r
+ Double value = null;\r
+ try {\r
+ value = Double.parseDouble(cell.getValue().toString());\r
+ } catch (NumberFormatException e) {\r
+ }\r
+ return value;\r
+ }\r
+\r
+ @Override\r
+ public DataSet getDataSet(String name) {\r
+ DataSet ds = super.getDataSet(name);\r
+ if(ds == null && name.contains(".")) {\r
+ ds = super.getDataSet(name.substring(name.lastIndexOf(".") + 1));\r
+ }\r
+ return ds;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.spreadsheet.SheetVariables;\r
+import org.simantics.spreadsheet.common.matrix.VariantMatrix;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class HistoryDatasetUtils {\r
+ \r
+ public static List<String> getVariableNamesInRange(ReadGraph graph, Resource historyData) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ ArrayList<String> values = new ArrayList<String>();\r
+\r
+\r
+ Resource sheet = graph.getPossibleObject(historyData, sr.HistoryDataset_sheet);\r
+ if(sheet == null)\r
+ return values;\r
+ \r
+ String start = graph.getPossibleRelatedValue(historyData, sr.HistoryDataset_start);\r
+ String end = graph.getPossibleRelatedValue(historyData, sr.HistoryDataset_end);\r
+ if(start == null || start.isEmpty() || end == null || end.isEmpty())\r
+ return values;\r
+ String r = start + ":" + end;\r
+ \r
+ if(!graph.hasStatement(historyData, sr.HistoryDataset_columns))\r
+ return values;\r
+ \r
+ boolean columns = graph.getRelatedValue(historyData, sr.HistoryDataset_columns, Bindings.BOOLEAN);\r
+ \r
+ Variable v = graph.adapt(sheet, Variable.class);\r
+ Variable range = v.getChild(graph, r);\r
+ if(range == null)\r
+ return values;\r
+ \r
+ Variant content = range.getPropertyValue(graph, SheetVariables.CONTENT, Bindings.VARIANT);\r
+ Object matrixValue = content.getValue();\r
+ if(!(matrixValue instanceof VariantMatrix))\r
+ return values;\r
+ \r
+ VariantMatrix vm = (VariantMatrix)matrixValue;\r
+ \r
+ /*\r
+ * The table needs at least:\r
+ * \r
+ * headers for variables + one value\r
+ * two variables (of which one is time-variable)\r
+ * \r
+ * => minimum of 2x2 matrix\r
+ */\r
+ \r
+ int x = columns ? vm.getColumnCount() : vm.getRowCount();\r
+ int y = columns ? vm.getRowCount() : vm.getColumnCount();\r
+ \r
+ if(vm == null || x < 2 || y < 2)\r
+ return values;\r
+\r
+ \r
+ // Names\r
+ for(int i = 0; i < x ; i++) {\r
+ Variant cell = columns ? vm.get(0, i) : vm.get(i, 0);\r
+ if(cell != null && cell.getValue() != null) {\r
+ String name = cell.getValue().toString();\r
+ if(!values.contains(name)) {\r
+ values.add(name);\r
+ }\r
+ }\r
+ }\r
+ \r
+ return values;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import gnu.trove.map.hash.THashMap;\r
+\r
+import java.io.File;\r
+import java.io.FileNotFoundException;\r
+import java.io.IOException;\r
+import java.util.List;\r
+import java.util.TreeMap;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.simantics.databoard.Accessors;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.Datatypes;\r
+import org.simantics.databoard.Files;\r
+import org.simantics.databoard.accessor.MapAccessor;\r
+import org.simantics.databoard.accessor.RecordAccessor;\r
+import org.simantics.databoard.accessor.error.AccessorConstructionException;\r
+import org.simantics.databoard.accessor.java.JavaRecord;\r
+import org.simantics.databoard.annotations.Arguments;\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.binding.RecordBinding;\r
+import org.simantics.databoard.binding.error.BindingException;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.databoard.type.Datatype;\r
+import org.simantics.modelica.data.DataSet;\r
+import org.simantics.modelica.data.SimulationResult;\r
+\r
+// TODO: rename to OpenModelicaResult or something as this is very specific?\r
+public class MemoryResult extends SysdynResult {\r
+ \r
+ private THashMap<String, SysdynDataSet> results;\r
+ private File resultFile;\r
+ private Integer resultIndex = null;\r
+ private SimulationResult simulationResult;\r
+\r
+\r
+ /**\r
+ * Create a sysdynresult accessor using a {@link SimulationResult}\r
+ * @param result\r
+ */\r
+ public MemoryResult(SimulationResult result, String resultName) {\r
+ super(resultName);\r
+ \r
+ results = new THashMap<String, SysdynDataSet>();\r
+\r
+ if(result != null)\r
+ setResult(result);\r
+ \r
+ }\r
+ \r
+ @Override\r
+ public SysdynDataSet getDataSet(String variable) {\r
+ // Try to get cached result\r
+ SysdynDataSet result = results.get(variable);\r
+ if(result != null)\r
+ return result;\r
+ \r
+ // if not found, try to read it\r
+ SimulationResult simulationResult = getSimulationResult();\r
+ try {\r
+ if (simulationResult != null) {\r
+ DataSet ds = simulationResult.getDataSet(variable);\r
+ if(ds == null)\r
+ ds = simulationResult.readVariable(variable, resultFile);\r
+\r
+ if(ds != null) {\r
+ SysdynDataSet sds = new SysdynDataSet(ds.name, getResultName(), ds.times, ds.values, resultIndex);\r
+ results.put(variable, sds);\r
+ return sds;\r
+ }\r
+ }\r
+ } catch (FileNotFoundException e1) {\r
+ // Unable to read data from OpenModelica result file\r
+ System.err.println("Variable " + variable + " not found in OpenModelica result file");\r
+ return null;\r
+ } catch (IOException e1) {\r
+ // IoFail\r
+ e1.printStackTrace();\r
+ }\r
+ \r
+ return null;\r
+ }\r
+\r
+ public void setResultFile(File resFile) {\r
+ this.resultFile = resFile;\r
+ }\r
+ \r
+ public int numberOfVariables() {\r
+ return simulationResult.getVariableDataSets().size();\r
+ }\r
+ \r
+ public void setResult(SimulationResult result) {\r
+ this.simulationResult = result;\r
+ this.results.clear();\r
+ if(result != null)\r
+ addAllInitialValues(result); // For legacy reasons\r
+ }\r
+ \r
+ public SimulationResult getSimulationResult() {\r
+ return this.simulationResult;\r
+ }\r
+\r
+ \r
+ \r
+ /**\r
+ * Read all results from their DataSets. --- Legacy init file support. Not needed with mat files.\r
+ */\r
+ private void addAllInitialValues(SimulationResult result) {\r
+ // Add initial values\r
+ for(DataSet ds : result.getInitialValueDataSets()){\r
+ SysdynDataSet sds = new SysdynDataSet(ds.name, getResultName(), ds.times, ds.values);\r
+ results.put(ds.name, sds);\r
+ }\r
+ }\r
+ \r
+ \r
+ /**\r
+ * Save current {@link RecordAccessor} to a {@link File}\r
+ * \r
+ * @param file {@link File} where the {@link RecordAccessor} is saved\r
+ */\r
+ @Override\r
+ public void saveToFile(File file, IProgressMonitor progressMonitor) {\r
+ try {\r
+ // Create Memory Historian\r
+ Datatype recordingSessionType = Datatypes.getDatatype("RecordingSession");\r
+ RecordBinding sessionBinding = (RecordBinding) Bindings.getBinding( recordingSessionType );\r
+ Object session = sessionBinding.createDefault(); \r
+ JavaRecord accessor = (JavaRecord) Accessors.getAccessor( sessionBinding, session );\r
+\r
+ // Get binding and value from memory\r
+ JavaRecord jr = (JavaRecord) accessor;\r
+ Binding binding = jr.getBinding();\r
+ Object value = jr.getObject();\r
+ \r
+ // Read the missing variables one by one.\r
+ getSimulationResult().readMissingVariables(this.resultFile);\r
+\r
+ addAllDataSetsToAccessor(accessor, progressMonitor);\r
+ // Write to file\r
+ if (progressMonitor != null) {\r
+ progressMonitor.subTask("Save results");\r
+ }\r
+ Files.createFile(file, binding, value);\r
+ \r
+ // The division is made so that 1 unit per variable and their sum for saving them.\r
+ progressMonitor.worked(numberOfVariables());\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ } catch (BindingException e) {\r
+ e.printStackTrace();\r
+ } catch (AccessorConstructionException e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ }\r
+ \r
+ \r
+ /**\r
+ * Read all results from their DataSets.\r
+ * @param progressMonitor \r
+ */\r
+ private void addAllDataSetsToAccessor(JavaRecord accessor, IProgressMonitor progressMonitor) {\r
+ try {\r
+ MapAccessor recordings = accessor.getFieldAccessor("recordings");\r
+ \r
+ // There is a recording for each variable\r
+ List<DataSet> datasets = getSimulationResult().getVariableDataSets();\r
+ RecordBinding recordingBinding = (RecordBinding) Bindings.getBinding( Recording.class );\r
+ if (progressMonitor != null) {\r
+ progressMonitor.subTask("Prepare saving");\r
+ }\r
+ // Add variables\r
+ for(DataSet ds : datasets){\r
+ if (progressMonitor != null) {\r
+ progressMonitor.worked(1);\r
+ }\r
+ // Add recording to session, if not already added\r
+ Variant dsNodeId = Variant.ofInstance( ds.name );\r
+ if (recordings.containsKey(Bindings.VARIANT, dsNodeId)) \r
+ continue;\r
+ \r
+ Recording recording = createRecording(ds);\r
+ recordings.put(Bindings.VARIANT, recording.nodeId, Bindings.VARIANT, new Variant(recordingBinding, recording));\r
+ }\r
+ } catch (Exception e) {\r
+ e.printStackTrace();\r
+ } \r
+ }\r
+ \r
+ /**\r
+ * Create a recording for a variable to this result's {@link RecordAccessor} \r
+ * @param ds {@link DataSet} for the variable\r
+ * @return {@link Recording}\r
+ * @throws BindingException\r
+ */\r
+ @SuppressWarnings("unchecked")\r
+ Recording createRecording(DataSet ds) throws BindingException {\r
+ RecordBinding recordingBinding = (RecordBinding) Bindings.getBindingUnchecked( Recording.class );\r
+ Recording recording = (Recording) recordingBinding.createDefault(); \r
+ recording.nodeId = Variant.ofInstance( ds.name );\r
+ recording.labels.put("en", ds.name);\r
+\r
+ // Create one segment\r
+ TreeMap<Double, Double> segment = new TreeMap<Double, Double>();\r
+ recording.segments = new TreeMap[] { segment };\r
+\r
+ int length = ds.values.length;\r
+ for (int i=0; i<length; i++) {\r
+ double time = ds.times[i];\r
+ double value = ds.values[i];\r
+ segment.put(time, value); \r
+ }\r
+ return recording;\r
+ }\r
+ \r
+ /**\r
+ * Class representing a recording for a variable\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+ public static class Recording {\r
+ public Variant nodeId;\r
+ public @Arguments({String.class, String.class}) TreeMap<String, String> labels;\r
+ public @Arguments({TreeMap.class, Double.class, Double.class}) TreeMap<Double, Double>[] segments;\r
+ }\r
+\r
+ /**\r
+ * Set the index of the run; used when the individual time series of a variable are shown in\r
+ * the same JFreeChart.\r
+ * @param currentRun The index of the run \r
+ */\r
+ public void setResultIndex(int resultIndex) {\r
+ this.resultIndex = resultIndex;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ * Semantum Oy - Bug #4180\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import gnu.trove.set.hash.THashSet;\r
+\r
+import java.io.File;\r
+import java.io.FileNotFoundException;\r
+import java.io.IOException;\r
+import java.util.ArrayList;\r
+import java.util.Arrays;\r
+import java.util.Collection;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.concurrent.locks.Lock;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.preferences.DefaultScope;\r
+import org.eclipse.core.runtime.preferences.IScopeContext;\r
+import org.osgi.service.prefs.Preferences;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.RequestProcessor;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.VirtualGraph;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.Logger;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.service.VirtualGraphSupport;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.modelica.IModelicaMonitor;\r
+import org.simantics.modelica.ModelicaException;\r
+import org.simantics.modelica.ModelicaKeys;\r
+import org.simantics.modelica.ModelicaManager;\r
+import org.simantics.modelica.SimulationLocation;\r
+import org.simantics.modelica.data.CSVSimulationResult;\r
+import org.simantics.modelica.data.MatSimulationResult;\r
+import org.simantics.modelica.data.SimulationResult;\r
+import org.simantics.modelica.preferences.OpenModelicaPreferences;\r
+import org.simantics.simulation.data.Datasource;\r
+import org.simantics.simulation.experiment.ExperimentState;\r
+import org.simantics.simulation.experiment.IExperimentListener;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.sysdyn.Activator;\r
+import org.simantics.sysdyn.adapter.VariableValueSubscription;\r
+import org.simantics.sysdyn.modelica.ModelicaWriter;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.Model;\r
+import org.simantics.sysdyn.simulation.SimulationScheduler;\r
+\r
+public class OldSysdynExperiment extends SysdynExperiment {\r
+\r
+ protected Session session;\r
+ protected Runnable modificationListener;\r
+ protected SysdynModel sysdynModel;\r
+ protected boolean toggled = false;\r
+ @SuppressWarnings("rawtypes")\r
+ protected THashSet<VariableValueSubscription> variableValueSubscriptions = new THashSet<VariableValueSubscription>();\r
+ @SuppressWarnings("rawtypes")\r
+ protected volatile VariableValueSubscription[] variableValueSubscriptionsSnapshot = null;\r
+\r
+ protected String previousModelStructure;\r
+ protected HashMap<String, String> previousParameters;\r
+ protected Process process;\r
+ protected boolean canceled = false;\r
+ protected ExperimentState sysdynExperimentState;\r
+\r
+ private SysdynResult result;\r
+ private File simulationDir;\r
+\r
+ protected String experimentName;\r
+ protected static String omcVersion = null;\r
+ protected static String omcHome = null;\r
+\r
+ public static OldSysdynExperiment INSTANCE;\r
+ \r
+ boolean publishResults = true;\r
+\r
+ public OldSysdynExperiment(Resource experiment, Resource model) {\r
+ super(experiment, model);\r
+ INSTANCE = this;\r
+ }\r
+\r
+ public static OldSysdynExperiment getInstance() {\r
+ return INSTANCE;\r
+ }\r
+\r
+ public SysdynResult getCurrentResult() {\r
+ if(this.result == null)\r
+ this.result = new MemoryResult(null, null);\r
+ return this.result;\r
+ }\r
+\r
+ public Collection<SysdynResult> getActiveResults() {\r
+ ArrayList<SysdynResult> result = new ArrayList<SysdynResult>();\r
+ if(getCurrentResult() != null)\r
+ result.add(getCurrentResult());\r
+ result.addAll(sysdynModel.getDisplayedResults());\r
+ return result;\r
+ }\r
+\r
+ /**\r
+ * Initialize this experiment\r
+ * @param g ReadGraph\r
+ */\r
+ public void init(ReadGraph g) {\r
+ try {\r
+ this.experimentName = NameUtils.getSafeName(g, experiment);\r
+ } catch (DatabaseException e) {\r
+ this.experimentName = "Experiment";\r
+ }\r
+\r
+ this.session = g.getSession();\r
+ state = ExperimentState.STOPPED;\r
+ for(IExperimentListener listener : listeners.getListeners())\r
+ listener.stateChanged(state);\r
+\r
+ try {\r
+ g.syncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ final Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
+ sysdynModel = SysdynModelManager.getInstance(session).getModel(graph, configuration);\r
+ toggleActivation(graph, true);\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ Logger.defaultLogError(e);\r
+ }\r
+\r
+ setSysdynExperimentState(ExperimentState.INITIALIZING);\r
+ }\r
+\r
+ @Override\r
+ public void saveState() {\r
+ if(result == null || !(result instanceof MemoryResult)) \r
+ return;\r
+ // TODO: temporary fix\r
+ SaveResultJob saveResultJob = new SaveResultJob(OldSysdynExperiment.this, session, (MemoryResult)result);\r
+ saveResultJob.schedule();\r
+ }\r
+\r
+ protected Thread getSaveThread(final SysdynResult result, final File file, final IProgressMonitor progressMonitor) {\r
+ return new Thread() {\r
+ @Override\r
+ public void run() {\r
+ if(!canceled) {\r
+ // Get and store results\r result.saveToFile(file, progressMonitor);\r
+ }\r }\r
+ };\r
+ }\r
+ \r
+ /**\r
+ * Starts a simulation job. Use this method to start a simulation.\r
+ */\r
+ @Override\r
+ public void simulate(boolean enabled) {\r
+ if(enabled && sysdynModel != null) {\r
+ if(!ExperimentState.RUNNING.equals(getState())) {\r
+ changeState(ExperimentState.RUNNING);\r
+ startSimulationJob();\r
+ }\r
+ } else if (!toggled){\r
+ changeState(ExperimentState.STOPPED);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Starts a simulation job\r
+ */\r
+ protected void startSimulationJob() {\r
+ session.asyncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ SimulationScheduler.start(sysdynModel, OldSysdynExperiment.this);\r
+ }\r
+ });\r
+ }\r
+\r
+\r
+ /**\r
+ * Write model configuration to a single Modelica code\r
+ * @param monitor\r
+ * @param isGame is the experiment a "game experiment". This is needed for modifying the code to work with FMU simulation\r
+ * @return Modelica code\r
+ */\r
+ protected String getModelicaCode(IModelicaMonitor monitor, boolean isGame, String modelicaVersion) {\r
+ String modelText = null;\r
+ try {\r
+ // Write all configurations once\r
+ modelText = ModelicaWriter.write(sysdynModel.getModules(), sysdynModel.getConfiguration().getModel().getStartTime(), isGame, modelicaVersion);\r
+ } catch (Exception e) {\r
+ // Stop experiment and show console\r
+ /*setExperimentStopped(experiment); =>*/ simulate(false);\r
+ monitor.showConsole();\r
+ monitor.message("Error when writing Modelica code.");\r
+ }\r
+ return modelText;\r
+ }\r
+\r
+ /**\r
+ * Get all inits and parameter values required for the inits -file\r
+ * @param monitor\r
+ * @return All inits in a map\r
+ */\r
+ protected HashMap<String, String> getExperimentParameters(IModelicaMonitor monitor) {\r
+ Configuration configuration = sysdynModel.getConfiguration();\r
+// HashMap<String, String> inits = sysdynModel.getInits(configuration, ""); Not needed anymore, whole xml content is replaced\r
+ HashMap<String, String> parameters = new HashMap<String, String>();\r
+ Model model = configuration.getModel();\r
+ Double startTime = model.getStartTime();\r
+ Double stopTime = model.getStopTime();\r
+ parameters.put(ModelicaKeys.START_VALUE, startTime.toString());\r
+ parameters.put(ModelicaKeys.STOP_VALUE, stopTime.toString());\r
+ String outputFormat = "mat";\r
+ parameters.put(ModelicaKeys.OUTPUT_FORMAT, outputFormat);\r
+\r
+ Double simulationStepLength = model.getSimulationStepLength();\r
+ if(simulationStepLength != null) {\r
+ parameters.put(ModelicaKeys.STEP_VALUE, simulationStepLength.toString());\r
+ parameters.put(ModelicaKeys.NUMBER_OF_INTERVALS, "" + ((int)((stopTime - startTime) / simulationStepLength)));\r
+ } else {\r
+ parameters.put(ModelicaKeys.STEP_VALUE, "" + (stopTime - startTime) / 500);\r
+ }\r
+\r
+ Double outputInterval = model.getOutputInterval();\r
+ parameters.put(ModelicaKeys.OUTPUT_INTERVAL, outputInterval != null ? outputInterval.toString() : parameters.get(ModelicaKeys.STEP_VALUE));\r
+\r
+ String method = "\"" + model.getSolver() + "\"";\r
+ parameters.put(ModelicaKeys.METHOD, method);\r
+ if(model.getTolerance() != null)\r
+ parameters.put(ModelicaKeys.TOLERANCE, model.getTolerance().toString());\r
+ String variableFilter = model.getVariableFilter();\r
+ if(variableFilter != null && !variableFilter.isEmpty())\r
+ parameters.put(ModelicaKeys.VARIABLE_FILTER, variableFilter);\r
+ return parameters;\r
+ }\r
+\r
+ /**\r
+ * Builds a model\r
+ * @param simulationLocation\r
+ * @param inits\r
+ * @param modelText\r
+ * @param monitor\r
+ */\r
+ protected void buildModel(SimulationLocation simulationLocation, IModelicaMonitor monitor) {\r
+\r
+ try {\r
+ simulationLocation.executableFile.delete();\r
+ ModelicaManager.buildModel(simulationLocation, monitor);\r
+ } catch (ModelicaException e) {\r
+ if(e.getMessage() != null)\r
+ monitor.message(e.getMessage());\r
+ monitor.showConsole();\r
+ canceled = true;\r
+ previousModelStructure = "";\r
+ previousParameters = null;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Run a built model\r
+ * @param structureChanged \r
+ * @throws IOException\r
+ */\r
+ protected void runModelica(SimulationLocation simulationLocation, IModelicaMonitor monitor, IProgressMonitor progressMonitor, HashMap<String, String> experimentParameters, HashMap<String, String> changes) throws IOException {\r
+ progressMonitor.subTask("Simulate model");\r
+ process = ModelicaManager.runModelica(\r
+ simulationLocation,\r
+ monitor,\r
+ experimentParameters, \r
+ changes\r
+ );\r
+ ModelicaManager.printProcessOutput(process, monitor);\r
+\r
+ Thread resultThread = getResultThread(simulationLocation, experimentParameters, monitor, progressMonitor);\r
+ resultThread.run();\r
+\r
+ process = null;\r
+ }\r
+\r
+ /**\r
+ * Get a thread for reading and saving reuslts from a normal simulation\r
+ * @param simulationLocation\r
+ * @param inits\r
+ * @param monitor\r
+ * @param progressMonitor\r
+ * @return\r
+ */\r
+ protected Thread getResultThread(final SimulationLocation simulationLocation, final HashMap<String, String> experimentParameters, final IModelicaMonitor monitor, final IProgressMonitor progressMonitor) {\r
+ return new Thread() {\r
+ @Override\r
+ public void run() {\r
+ try {\r
+ process.waitFor();\r
+\r
+ if(!canceled) {\r
+ // Get and store results\r
+ progressMonitor.worked(1);\r
+ progressMonitor.subTask("Read results");\r
+ SimulationResult result;\r
+ if(simulationLocation.resultFile.getName().endsWith(".csv"))\r
+ result = new CSVSimulationResult();\r
+ else if(simulationLocation.resultFile.getName().endsWith(".plt"))\r
+ result = new SimulationResult();\r
+ else\r
+ result = new MatSimulationResult(); // The latest format\r
+\r
+ // The interval of results saved. Every result? Every other result? etc...\r
+ int outIntervalInt = 1;\r
+ String outputInterval = experimentParameters.get(ModelicaKeys.OUTPUT_INTERVAL);\r
+ if(outputInterval != null) {\r
+ String stepTime = experimentParameters.get(ModelicaKeys.STEP_VALUE);\r
+ String stopTime = experimentParameters.get(ModelicaKeys.STOP_VALUE);\r
+ \r
+ Double step = Double.parseDouble(stepTime);\r
+ Double stop = Double.parseDouble(stopTime);\r
+ Double outInterval = Double.parseDouble(outputInterval);\r
+\r
+ outIntervalInt = (int)getInterval(outInterval, step);\r
+ // Actually you might be able to use an outInterval one or two longer. \r
+ int maxIntervalInt = (int)Math.round(stop / step);\r
+ if (outIntervalInt > maxIntervalInt)\r
+ outIntervalInt = maxIntervalInt;\r
+ }\r
+\r
+ result.initRead(simulationLocation.resultFile);\r
+ result.readTime(simulationLocation.resultFile, outIntervalInt);\r
+ //result.readInits(simulationLocation.initFile); // Parameter values are read from .mat\r
+ result.filter();\r
+ ((MemoryResult)getCurrentResult()).setResult(result);\r
+ ((MemoryResult)getCurrentResult()).setResultFile(simulationLocation.resultFile);\r
+ progressMonitor.worked(1);\r
+ resultsChanged();\r
+\r
+ simulate(false);\r
+\r
+ String errorString = result.getResultReadErrors();\r
+ if(errorString != null && !errorString.isEmpty())\r
+ monitor.message(errorString);\r
+ }\r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ } catch (InterruptedException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ };\r
+ }\r
+\r
+ protected static long getInterval(double outputLength, double stepLength) {\r
+ double interval = outputLength / stepLength;\r
+ if (interval <= 1)\r
+ return 1;\r
+ return Math.round(interval);\r
+ }\r
+\r
+\r
+ /**\r
+ * \r
+ * @param sysdynModel\r
+ * @param modelText\r
+ * @param inits\r
+ * @param additionalScript\r
+ * @return\r
+ * @throws IOException\r
+ */\r
+ protected SimulationLocation createSimulationFiles(SysdynModel sysdynModel, String modelText, HashMap<String, String> inits, String additionalScript, boolean fmu) throws IOException {\r
+ File simulationDir = getExperimentDir();\r
+\r
+ // update all function files. both the model's and built-in\r
+ FunctionUtils.updateFunctionFilesForExperiment(this);\r
+\r
+\r
+ SimulationLocation location = ModelicaManager.createSimulationLocation(simulationDir, sysdynModel.getConfiguration().getLabel(), modelText, ModelicaManager.getOMHome(), ModelicaManager.isOldOMVersion());\r
+ if (fmu) {\r
+ ModelicaManager.createFMUSimulationScripts(location, inits, additionalScript);\r
+ }\r
+ else {\r
+ ModelicaManager.createSimulationScripts(location, inits, additionalScript);\r
+ }\r
+ return location;\r
+ }\r
+\r
+ /**\r
+ * Get a simulation directory for this model\r
+ * @return File directory\r
+ */\r
+ public File getExperimentDir() {\r
+ if(simulationDir == null) {\r
+ File modelsDir = Activator.getBundleContext().getDataFile("models");\r
+ String experimentName = this.experimentName;\r
+ List<String> files = Arrays.asList(modelsDir.list());\r
+ if (files.contains(experimentName)) {\r
+ int i = 2;\r
+ while (files.contains(experimentName + "_" + i)){\r
+ i++;\r
+ }\r
+ experimentName += "_" + i;\r
+ }\r
+\r
+ simulationDir = Activator.getBundleContext().getDataFile("models/" + experimentName);\r
+ if (!simulationDir.exists()) {\r
+ simulationDir.mkdir();\r
+ }\r
+ }\r
+ return simulationDir;\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return\r
+ */\r
+ protected String getAdditionalScripts() {\r
+ StringBuilder functionscript = new StringBuilder();\r
+ for(String path : FunctionUtils.getLibraryPathsForModelica(this)) {\r
+ functionscript.append("loadFile(\"" + path + "\");\n");\r
+ }\r
+ return functionscript.toString();\r
+ }\r
+\r
+ /**\r
+ * Starts simulating a model. Call only from inside simulation job! Start simulation using simulate(true).\r
+ * @param monitor\r
+ * @param progressMonitor\r
+ * @throws IOException\r
+ */\r
+ public synchronized void simulate(final IModelicaMonitor monitor, final IProgressMonitor progressMonitor, String modelName) throws IOException {\r
+ canceled = false;\r
+ progressMonitor.subTask("Write modelica classes");\r
+\r
+ omcVersion = ModelicaManager.getDefaultOMVersion();\r
+ \r
+ monitor.message("Simulate " + modelName + " using OpenModelica " + omcVersion);\r
+ \r
+ // Get Modelica code\r
+ String modelText = getModelicaCode(monitor, false, omcVersion);\r
+ if(modelText == null)\r
+ return;\r
+ progressMonitor.worked(1);\r
+\r
+ // Write initial files and add init-parameters\r
+ progressMonitor.subTask("Write simulation files");\r
+ HashMap<String, String> experimentParameters = getExperimentParameters(monitor);\r
+ \r
+ // add loadFile script to load all related functions and function libraries\r
+ String additionalScript = getAdditionalScripts();\r
+ \r
+ // Create simulation files\r
+ SimulationLocation simulationLocation = createSimulationFiles(sysdynModel, modelText, experimentParameters, additionalScript, false);\r
+ progressMonitor.worked(1);\r
+ \r
+ // Build the model and store previous model structure and inits that affect the building\r
+ // If there is no exe file OR the model structure has not changed, no need to build\r
+ String flatModelText = ModelicaManager.getFlatModelText(simulationLocation, monitor, FunctionUtils.getLibraryPathsForModelica(this));\r
+ boolean structureChanged = sysdynModel.isStructureModified();\r
+ \r
+ if (!simulationLocation.executableFile.isFile() || structureChanged) {\r
+ progressMonitor.subTask("Build model");\r
+ previousModelStructure = flatModelText;\r
+ previousParameters = ModelicaManager.getModelParameters(previousModelStructure);\r
+ \r
+ buildModel(simulationLocation, monitor);\r
+ }\r
+ \r
+ // Add changed parameters in case that structure has not changed\r
+ HashMap<String, String> changes = structureChanged ? null : new HashMap<String, String>();\r
+ if(!structureChanged && previousParameters != null && omcVersion.startsWith("1.9")) {\r
+ HashMap<String, String> newParameters = ModelicaManager.getModelParameters(flatModelText);\r
+ for(String key : previousParameters.keySet()) {\r
+ if(!previousParameters.get(key).equals(newParameters.get(key))) {\r
+ changes.put(key, newParameters.get(key));\r
+ }\r
+ }\r
+ previousParameters = newParameters;\r
+ }\r
+ progressMonitor.worked(1);\r
+ \r
+ if(simulationLocation != null && !canceled) {\r
+ // Simulate the model\r
+ runModelica(simulationLocation, monitor, progressMonitor, experimentParameters, changes);\r
+ }\r
+ \r
+ if(canceled)\r
+ simulate(false);\r
+ process = null;\r
+ }\r
+\r
+ /**\r
+ * Get the version of the OpenModelica compiler that is defined to be used\r
+ * in Preferences\r
+ * @return OpenModelica version\r
+ */\r
+ protected String getOpenModelicaVersion() {\r
+ String omVersion = null;\r
+\r
+ IScopeContext context = DefaultScope.INSTANCE;\r
+ Preferences node = context.getNode(org.simantics.modelica.Activator.PLUGIN_ID);\r
+ String omHome = node.get(OpenModelicaPreferences.OM_HOME, null);\r
+ if(omHome != null) {\r
+ File omHomeDir = new File(omHome);\r
+ if(omHomeDir != null && omHomeDir.isDirectory())\r
+ omVersion = ModelicaManager.getOMVersion(omHomeDir);\r
+ }\r
+\r
+ if(omVersion == null) {\r
+ omVersion = ModelicaManager.getDefaultOMVersion();\r
+ }\r
+ \r
+ return omVersion;\r
+ }\r
+\r
+\r
+ /**\r
+ * Method that compares given modelText and inits to previous model and inits\r
+ * @param modelText Textual representation of a model (Modelica code)\r
+ * @param inits map of init parameters\r
+ * @return true if the model has changed, false otherwise\r
+ */\r
+// protected boolean hasStructureChanged(String modelText) {\r
+//\r
+// if(previousModelStructure == null)\r
+// return true;\r
+//\r
+// // Then compare the actual model structure\r
+// BufferedReader current = new BufferedReader(\r
+// new StringReader(modelText));\r
+// BufferedReader previous = new BufferedReader(\r
+// new StringReader(previousModelStructure));\r
+//\r
+// String c, p;\r
+// try {\r
+// // Read both current and previous model texts at the same time\r
+// c = current.readLine();\r
+// p = previous.readLine();\r
+//\r
+// while (c != null && p != null) {\r
+// // if the lines are the same, no need for further examination\r
+// if(!c.equals(p)) {\r
+// if(c.contains("parameter") && p.contains("parameter")) {\r
+// /*\r
+// * The line is a parameter definition.\r
+// * In this case only what is before '=' matters\r
+// * \r
+// * parameter Real Var = 1;\r
+// * is structurally same as\r
+// * parameter Real Var = 2;\r
+// */\r
+// int i = c.indexOf("=");\r
+// if(!c.substring(0, i).equals(p.substring(0, i))) {\r
+// // different parameter definition\r
+// return true;\r
+// }\r
+// } else {\r
+// // other than a line containing parameters differs\r
+// return true;\r
+// }\r
+// }\r
+// c = current.readLine();\r
+// p = previous.readLine();\r
+// }\r
+//\r
+// if((c == null && p != null) || (c != null && p == null)) {\r
+// // different lengths\r
+// return true;\r
+// }\r
+//\r
+// } catch(IOException e) {\r
+// // Something went wrong in the comparison, it is safer to say that the structure has changed\r
+// return true;\r
+// }\r
+// return false;\r
+// }\r
+\r
+ /**\r
+ * Destroy an ongoing simulation process\r
+ */\r
+ public void cancelSimulation() {\r
+ canceled = true;\r
+ if(process != null) {\r
+ process.destroy();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Toggle simulation state\r
+ * @param enabled true == RUNNING, false == STOPPED\r
+ */\r
+ public void toggleSimulation(boolean enabled) {\r
+ if(enabled) {\r
+ this.toggled = true;\r
+ changeState(ExperimentState.RUNNING);\r
+ if(modificationListener == null) {\r
+\r
+ modificationListener = new Runnable() {\r
+\r
+ @Override\r
+ public void run() {\r
+ session.asyncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ if(getState() == ExperimentState.RUNNING) {\r
+ SimulationScheduler.start(sysdynModel, OldSysdynExperiment.this);\r
+ }\r
+\r
+ }\r
+ });\r
+\r
+ };\r
+ };\r
+ sysdynModel.addModificationListener(modificationListener);\r
+ }\r
+ }\r
+ else {\r
+ changeState(ExperimentState.STOPPED);\r
+ this.toggled = false;\r
+ }\r
+\r
+ }\r
+\r
+ @Override\r
+ public void refresh(RequestProcessor session) {\r
+ session.asyncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ init(graph);\r
+ }\r
+\r
+ });\r
+ }\r
+ \r
+ @Override\r
+ public void refresh(Session session) {\r
+ refresh((RequestProcessor)session);\r
+ }\r
+\r
+ @Override\r
+ protected void localStateChange() {\r
+ setSysdynExperimentState(getState());\r
+ switch(state) {\r
+ case DISPOSED:\r
+ onExperimentDisposed();\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+\r
+ }\r
+\r
+ /**\r
+ * Returns sysdyn experiment state. It is usually the same as ordinary experiment state.\r
+ * Initializing phase takes longer than normally in game experiments.\r
+ * @return\r
+ */\r
+ public ExperimentState getSysdynExperimentState() {\r
+ return sysdynExperimentState;\r
+ }\r
+\r
+ protected void setSysdynExperimentState(final ExperimentState state) {\r
+ sysdynExperimentState = state;\r
+ session.asyncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ VirtualGraphSupport support = graph.getService(VirtualGraphSupport.class);\r
+ final Session session = graph.getSession();\r
+ session.asyncRequest(new WriteRequest(support.getWorkspacePersistent("experiments")) {\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SimulationResource SR = SimulationResource.getInstance(graph);\r
+ graph.deny(model, SR.HasExperimentState);\r
+ graph.deny(experiment, SR.HasExperimentState);\r
+\r
+ Resource st = graph.newResource();\r
+ switch(state) {\r
+ case INITIALIZING:\r
+ graph.claim(st, L0.InstanceOf, SR.ExperimentState_Initializing);\r
+ break;\r
+ case RUNNING:\r
+ graph.claim(st, L0.InstanceOf, SR.ExperimentState_Running);\r
+ break;\r
+ case STOPPED:\r
+ graph.claim(st, L0.InstanceOf, SR.ExperimentState_Stopped);\r
+ break;\r
+ case DISPOSED:\r
+ graph.claim(st, L0.InstanceOf, SR.ExperimentState_Disposed);\r
+ break;\r
+ }\r
+\r
+ graph.claim(model, SR.HasExperimentState, st);\r
+ graph.claim(experiment, SR.HasExperimentState, st);\r
+ }});\r
+ }\r
+ });\r
+ }\r
+\r
+ /**\r
+ * Actions performed when experiment is disposed\r
+ * @param graph\r
+ */\r
+ protected void onExperimentDisposed() {\r
+ cancelSimulation();\r
+ sysdynModel.removeModificationListener(modificationListener);\r
+ modificationListener = null;\r
+\r
+ session.asyncRequest(new ReadRequest() {\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ toggleActivation(graph, false);\r
+ }\r
+ });\r
+ }\r
+\r
+\r
+ /**\r
+ * Toggles the active-state of this experiment on or off\r
+ * @param graph ReadGraph\r
+ * @param activate The active-state of this experiment\r
+ */\r
+ protected void toggleActivation(ReadGraph graph, final boolean activate) {\r
+ VirtualGraphSupport support = graph.getService(VirtualGraphSupport.class);\r
+ final Session session = graph.getSession();\r
+ session.asyncRequest(new WriteRequest(support.getWorkspacePersistent("experiments")) {\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ VirtualGraph runtime = graph.getService(VirtualGraph.class);\r
+\r
+ session.asyncRequest(new WriteRequest(runtime) {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+ if(activate)\r
+ graph.claim(experiment, SIMU.IsActive, experiment);\r
+ else\r
+ graph.denyStatement(experiment, SIMU.IsActive, experiment);\r
+ }\r
+\r
+ });\r
+ }\r
+ });\r
+ }\r
+\r
+\r
+ /* Result subscriptions */\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Copy from AprosExperiment\r
+ * @param subscription\r
+ */\r
+ @Override\r
+ public void addVariableValueSubscription(VariableValueSubscription subscription) {\r
+ assert subscription != null;\r
+ synchronized (variableValueSubscriptions) {\r
+ //System.out.println("ADD listener " + subscription);\r
+ variableValueSubscriptions.add(subscription);\r
+ variableValueSubscriptionsSnapshot = null;\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Copy from AprosExperiment\r
+ * @param subscription\r
+ */\r
+ @Override\r
+ public void removeVariableValueSubscription(VariableValueSubscription subscription) {\r
+ assert subscription != null;\r
+ synchronized (variableValueSubscriptions) {\r
+ //System.out.println("REMOVE listener " + subscription);\r
+ variableValueSubscriptions.remove(subscription);\r
+ variableValueSubscriptionsSnapshot = null;\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Copy from AprosExperiment\r
+ * @return\r
+ */\r
+ @Override\r
+ public VariableValueSubscription[] getListenerSnapshot() {\r
+ VariableValueSubscription[] snapshot = variableValueSubscriptionsSnapshot;\r
+ if (snapshot == null) {\r
+ synchronized (variableValueSubscriptions) {\r
+ snapshot = variableValueSubscriptionsSnapshot;\r
+ if (snapshot == null) {\r
+ snapshot = variableValueSubscriptionsSnapshot = variableValueSubscriptions.toArray(new VariableValueSubscription[variableValueSubscriptions.size()]);\r
+ }\r
+ }\r
+ //System.out.println("listener count: " + snapshot.length);\r
+ }\r
+ return snapshot;\r
+ }\r
+\r
+ volatile long previousVariableUpdateTime = 0;\r
+ volatile boolean skippedVariableUpdate = true;\r
+\r
+\r
+ /**\r
+ * Modified copy from AprosExperiment\r
+ */\r
+ public void resultsChanged() {\r
+ resultsChanged(false);\r
+ }\r
+ \r
+ public void setPublishResults(boolean value) {\r
+ publishResults = value;\r
+ if(publishResults) resultsChanged(true);\r
+ }\r
+\r
+ public void resultsChanged(boolean force) {\r
+ long time = System.nanoTime();\r
+ long sinceLast = time - previousVariableUpdateTime;\r
+// System.err.println("sinceLast " + 1e-9*sinceLast);\r
+ if(sinceLast > 100000000 || force) {\r
+ updateSubscriptions();\r
+ previousVariableUpdateTime = time;\r
+ }\r
+ else\r
+ skippedVariableUpdate = true;\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Modified copy from AporsExperiment\r
+ */\r
+ @Override\r
+ public void updateSubscriptions() {\r
+ if(!publishResults) return;\r
+ for(VariableValueSubscription subscription : getListenerSnapshot())\r
+ subscription.update();\r
+ skippedVariableUpdate = false;\r
+ }\r
+ \r
+ public int numberOfSimulationRunSteps() {\r
+ /*\r
+ * 1. Write modelica files\r
+ * 2. Write other simulation files\r
+ * 3. Build model OR update parameters\r
+ * 4. Run modelica\r
+ * 5. Read results \r
+ */\r
+ return 5; \r
+ }\r
+\r
+\r
+ /* Experiment methods that are not used in this experiment */\r
+\r
+ @Override\r
+ public Lock getDatasourceLock() {\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public Datasource getDatasource() {\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public void simulateDuration(double duration) {\r
+ System.out.println("simulateDuartion");\r
+ }\r
+\r
+\r
+ @Override\r
+ public void rewindTo(double time) {\r
+ System.out.println("rewindTo");\r
+ }\r
+\r
+}\r
+\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ * Semantum Oy - Bug #4180\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.io.File;\r
+import java.util.UUID;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Platform;\r
+import org.eclipse.core.runtime.Status;\r
+import org.eclipse.core.runtime.jobs.Job;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Class for saving simulation results.\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class SaveResultJob extends Job {\r
+\r
+ private final MemoryResult sysdynResult;\r
+ private final OldSysdynExperiment experiment;\r
+ private final Session session;\r
+ private IProgressMonitor monitor;\r
+ private File file;\r
+ \r
+ public SaveResultJob(final OldSysdynExperiment experiment, Session session, final MemoryResult result) {\r
+ super("Save Result");\r
+ this.experiment = experiment;\r
+ this.sysdynResult = result;\r
+ this.session = session;\r
+ }\r
+\r
+ @Override\r
+ protected IStatus run(IProgressMonitor monitor) {\r
+ this.monitor = monitor;\r
+ int resultItemsNumber = sysdynResult.numberOfVariables();\r
+ monitor.beginTask("Save result", resultItemsNumber * 2 + 1); \r
+ try {\r
+ // Create result file\r
+ file = session.syncRequest(new Read<File>() {\r
+\r
+ @Override\r
+ public File perform(ReadGraph graph) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ Resource model = graph.getSingleObject(experiment.getResource(), l0.PartOf);\r
+ Resource project = graph.getSingleObject(model, l0.PartOf);\r
+ String projectName = graph.getPossibleRelatedValue(project, l0.HasName);\r
+ File root = new File(Platform.getLocation().toOSString(), "www.simantics.org");\r
+ if(!root.isDirectory()) root.mkdir();\r
+ File projectRoot = new File(root, projectName);\r
+ if(!projectRoot.isDirectory()) projectRoot.mkdir();\r
+ File file = new File(projectRoot, UUID.randomUUID().toString() + ".dbb");\r
+ return file;\r
+ }\r
+ });\r
+ \r
+ // Start the saving operation\r
+ Thread saveThread = experiment.getSaveThread(sysdynResult, file, SaveResultJob.this.monitor);\r
+ saveThread.run();\r
+ \r
+ // Add the result under the experiment within the model browser. \r
+ session.syncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ Resource model = graph.getSingleObject(experiment.getResource(), l0.PartOf);\r
+ String name = NameUtils.findFreshName(graph, "Result", model, l0.ConsistsOf, "%s%d");\r
+ \r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Resource res = GraphUtils.create2(graph, sr.Result,\r
+ l0.HasLabel, name,\r
+ l0.HasName, name,\r
+ l0.PartOf, model,\r
+ sr.Result_resultFile, file.getAbsolutePath(),\r
+ sr.Result_time, System.currentTimeMillis());\r
+ graph.claim(experiment.getResource(), sr.Experiment_result, res);\r
+ }\r
+ });\r
+\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ } catch (Exception e) {\r
+ e.printStackTrace();\r
+ return new Status(\r
+ Status.ERROR, \r
+ "org.simantics.sysdyn.ui", \r
+ "Save results failed: \n" + e.getMessage());\r
+ } \r
+ monitor.done(); \r
+ return Status.OK_STATUS;\r
+ }\r
+\r
+ @Override\r
+ public boolean belongsTo(Object family) {\r
+ return "SaveResultJob".equals(family);\r
+ }\r
+\r
+ @Override\r
+ protected void canceling() {\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.io.File;\r
+import java.util.ArrayList;\r
+import java.util.UUID;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Platform;\r
+import org.eclipse.core.runtime.Status;\r
+import org.eclipse.core.runtime.jobs.Job;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.request.WriteResultRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Class for saving simulation result sets.\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class SaveResultSetJob extends Job {\r
+\r
+ private final ArrayList<MemoryResult> sysdynResults;\r
+ private final OldSysdynExperiment experiment;\r
+ private final Session session;\r
+ private IProgressMonitor monitor;\r
+ private File file;\r
+\r
+ public SaveResultSetJob(final OldSysdynExperiment experiment, Session session, final ArrayList<MemoryResult> results) {\r
+ super("Save Results");\r
+ this.experiment = experiment;\r
+ this.sysdynResults = results;\r
+ this.session = session;\r
+ }\r
+\r
+ @Override\r
+ protected IStatus run(IProgressMonitor monitor) {\r
+ this.monitor = monitor;\r
+ if (sysdynResults == null || sysdynResults.size() == 0)\r
+ return Status.CANCEL_STATUS;\r
+ int resultItemsNumber = sysdynResults.get(0).numberOfVariables() * sysdynResults.size();\r
+ monitor.beginTask("Save results", resultItemsNumber * 2 + 2); \r
+ \r
+ try {\r
+ // Create a ResultSet, under which the individual results are stored, and\r
+ // add it under the experiment within the model browser. \r
+\r
+ final Resource resultSetResource = session.syncRequest(new WriteResultRequest<Resource>() {\r
+\r
+ @Override\r
+ public Resource perform(WriteGraph graph) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ Resource model = graph.getSingleObject(experiment.getResource(), l0.PartOf);\r
+ String name = NameUtils.findFreshName(graph, "ResultSet", model, l0.ConsistsOf, "%s%d");\r
+\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Resource res = GraphUtils.create2(graph, sr.ResultSet,\r
+ l0.HasLabel, name,\r
+ l0.HasName, name,\r
+ l0.PartOf, model,\r
+ sr.Result_time, System.currentTimeMillis());\r
+ graph.claim(experiment.getResource(), sr.Experiment_resultSet, res);\r
+ return res;\r
+ }\r
+ });\r
+ monitor.worked(1);\r
+ \r
+ // Save the individual results\r
+ for (int i = 0; i < sysdynResults.size(); ++i) {\r
+ MemoryResult result = sysdynResults.get(i);\r
+ final String name = new Integer(i+1).toString();\r
+ // Create result file\r
+ file = session.syncRequest(new Read<File>() {\r
+\r
+ @Override\r
+ public File perform(ReadGraph graph) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ Resource model = graph.getSingleObject(experiment.getResource(), l0.PartOf);\r
+ Resource project = graph.getSingleObject(model, l0.PartOf);\r
+ String projectName = graph.getPossibleRelatedValue(project, l0.HasName);\r
+ File root = new File(Platform.getLocation().toOSString(), "www.simantics.org");\r
+ if(!root.isDirectory()) root.mkdir();\r
+ File projectRoot = new File(root, projectName);\r
+ if(!projectRoot.isDirectory()) projectRoot.mkdir();\r
+ File file = new File( projectRoot, UUID.randomUUID().toString() + ".dbb");\r
+ return file;\r
+ }\r
+ });\r
+\r
+ // Start the saving operation\r
+ Thread saveThread = experiment.getSaveThread(result, file, SaveResultSetJob.this.monitor);\r
+ saveThread.run();\r
+\r
+ // Add the result under the ResultSet within the model browser. \r
+ session.syncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ String resultSetName = graph.getRelatedValue(resultSetResource, l0.HasName);\r
+ \r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Resource res = GraphUtils.create2(graph, sr.Result,\r
+ l0.HasLabel, name,\r
+ l0.HasName, resultSetName + "#" + name,\r
+ sr.Result_resultFile, file.getAbsolutePath(),\r
+ sr.Result_time, System.currentTimeMillis());\r
+ graph.claim(resultSetResource, sr.Experiment_result, res);\r
+ }\r
+ });\r
+\r
+ }\r
+\r
+ } catch (DatabaseException e1) {\r
+ // TODO Auto-generated catch block\r
+ e1.printStackTrace();\r
+ }\r
+\r
+ monitor.done(); \r
+ return Status.OK_STATUS;\r
+ }\r
+\r
+ @Override\r
+ public boolean belongsTo(Object family) {\r
+ return "SaveResultSetJob".equals(family);\r
+ }\r
+\r
+ @Override\r
+ protected void canceling() {\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.manager;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Status;\r
+import org.eclipse.core.runtime.jobs.Job;\r
+import org.simantics.simulation.experiment.ExperimentState;\r
+import org.simantics.sysdyn.solver.ISolver;\r
+\r
+class SimulateDurationJob extends Job {\r
+\r
+ private boolean canceled = false;\r
+ private double duration;\r
+ private final SysdynGameExperimentBase base;\r
+ private final ISolver solver;\r
+ \r
+ public SimulateDurationJob(SysdynGameExperimentBase base, String name, double duration) {\r
+ super(name);\r
+ this.base = base;\r
+ this.solver = base.getSolver();\r
+ this.duration = duration;\r
+ }\r
+\r
+ @Override\r
+ protected void canceling() {\r
+ canceled = true;\r
+ }\r
+\r
+ @Override\r
+ protected IStatus run(IProgressMonitor monitor) {\r
+ if(base == null || base.getState() != ExperimentState.STOPPED)\r
+ return Status.OK_STATUS;\r
+\r
+ long start = System.nanoTime();\r
+ \r
+ base.changeState(ExperimentState.RUNNING);\r
+ int nSteps = (int)(duration / base.stepLength); \r
+ int work = 1 + nSteps * 3 + 2; // initialization + number of steps * number of phases per step + set result + call result listeners \r
+\r
+ monitor.beginTask("Simulating " + duration + " time steps", work);\r
+ monitor.subTask("Initialize step simulation");\r
+\r
+ if(base.subscription == null || base.results == null)\r
+ return Status.OK_STATUS;\r
+\r
+ if(duration <= 0.0)\r
+ duration = base.stepDuration;\r
+\r
+\r
+ try {\r
+\r
+ solver.prepareToStep();\r
+\r
+ double time = solver.getTime();\r
+ double eTime = time + duration;\r
+\r
+ monitor.worked(1);\r
+\r
+ base.setSubscribedResults(monitor, time);\r
+\r
+ int stepNumber = 1;\r
+ while((eTime - time > base.stepLength * 1e-6) && !canceled) {\r
+ \r
+ if(eTime - time < base.stepLength)\r
+ solver.setStepLength(eTime - time);\r
+\r
+ monitor.subTask("Simulate step (time = " + time + ")");\r
+ solver.simulateStep();\r
+ monitor.worked(1);\r
+\r
+ time = solver.getTime();\r
+\r
+ if(stepNumber % base.savePer == 0) {\r
+ base.setSubscribedResults(monitor, time);\r
+ } else {\r
+ monitor.worked(1);\r
+ }\r
+ stepNumber++;\r
+ monitor.worked(1);\r
+\r
+ }\r
+\r
+ monitor.subTask("Display results");\r
+ ((MemoryResult)base.getCurrentResult()).setResult(new GameResult(base, base.results, base.subscription));\r
+ monitor.worked(1);\r
+\r
+ base.resultsChanged(true);\r
+ monitor.worked(1);\r
+ base.changeState(ExperimentState.STOPPED);\r
+\r
+ } catch (Exception e) {\r
+ e.printStackTrace();\r
+ System.err.println("SysdynGameExperiment simulateDuration failed: \n\t" + e.getMessage());\r
+ }\r
+ \r
+ long end = System.nanoTime();\r
+// System.err.println("simulate duration took " + 1e-6*(end-start) + "ms.");\r
+\r
+ return Status.OK_STATUS;\r
+ \r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+package org.simantics.sysdyn.manager;\r
+\r
+import java.text.SimpleDateFormat;\r
+import java.util.Calendar;\r
+\r
+import org.eclipse.jface.text.BadLocationException;\r
+import org.eclipse.ui.PartInitException;\r
+import org.eclipse.ui.PlatformUI;\r
+import org.eclipse.ui.console.ConsolePlugin;\r
+import org.eclipse.ui.console.IConsole;\r
+import org.eclipse.ui.console.IConsoleManager;\r
+import org.eclipse.ui.console.IHyperlink;\r
+import org.eclipse.ui.console.IPatternMatchListener;\r
+import org.eclipse.ui.console.MessageConsole;\r
+import org.eclipse.ui.console.MessageConsoleStream;\r
+import org.eclipse.ui.console.PatternMatchEvent;\r
+import org.eclipse.ui.console.TextConsole;\r
+import org.simantics.sysdyn.solver.ISolverMonitor;\r
+\r
+public class SysdynConsole implements ISolverMonitor {\r
+\r
+ private static String SYSDYN_CONSOLE = "Sysdyn modelica console";\r
+ private MessageConsole console;\r
+\r
+ public static SysdynConsole INSTANCE = new SysdynConsole();\r
+ \r
+ public SysdynConsole() {\r
+ ConsolePlugin plugin = ConsolePlugin.getDefault();\r
+ IConsoleManager conMan = plugin.getConsoleManager();\r
+ IConsole[] existing = conMan.getConsoles();\r
+ for (int i = 0; i < existing.length; i++)\r
+ if (existing[i].getName().equals(SYSDYN_CONSOLE))\r
+ console = (MessageConsole) existing[i];\r
+ if(console == null) {\r
+ MessageConsole myConsole = new MessageConsole(SYSDYN_CONSOLE, null);\r
+ conMan.addConsoles(new IConsole[]{myConsole});\r
+ console = myConsole;\r
+ console.addPatternMatchListener(new IPatternMatchListener() {\r
+\r
+ @Override\r
+ public void matchFound(PatternMatchEvent event) {\r
+ try {\r
+ console.addHyperlink(new IssueLink(), event.getOffset(), event.getLength());\r
+ } catch (BadLocationException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public void disconnect() {\r
+ }\r
+\r
+ @Override\r
+ public void connect(TextConsole console) {\r
+ }\r
+\r
+ @Override\r
+ public String getPattern() {\r
+ \r
+ return "Issues view";\r
+ }\r
+\r
+ @Override\r
+ public String getLineQualifier() {\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public int getCompilerFlags() {\r
+ return 0;\r
+ }\r
+ });\r
+ \r
+ /* Link to the modelica document: to be opened to a modelica code viewer.\r
+ console.addPatternMatchListener(new IPatternMatchListener() {\r
+\r
+ @Override\r
+ public void matchFound(PatternMatchEvent event) {\r
+ try {\r
+ if(event.getSource() instanceof MessageConsole) {\r
+ MessageConsole console = (MessageConsole) event.getSource();\r
+ IDocument document = console.getDocument();\r
+ String s = document.get(event.getOffset(), event.getLength());\r
+ s = s.substring(s.indexOf(":") + 1, s.lastIndexOf(":"));\r
+ String[] split = s.split(":|-");\r
+ \r
+ //TODO: Find the modelica document and its locations\r
+ int startOffset = modelicaDocument.getLineOffset(Integer.parseInt(split[0])) + Integer.parseInt(split[1]);\r
+ int endOffset = modelicaDocument.getLineOffset(Integer.parseInt(split[2])) + Integer.parseInt(split[3]);\r
+ System.out.println("Open modelica editor for model at: " + startOffset + ", " + (endOffset - startOffset));\r
+ \r
+ }\r
+ \r
+ console.addHyperlink(new ModelicaLink(), event.getOffset(), event.getLength());\r
+ } catch (BadLocationException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public void disconnect() {\r
+ }\r
+\r
+ @Override\r
+ public void connect(TextConsole console) {\r
+ }\r
+\r
+ @Override\r
+ public String getPattern() {\r
+ return "\\[[^\\[]*:[\\d]*:[\\d]*\\-[\\d]*:[\\d]*:writable\\]";\r
+\r
+ }\r
+\r
+ @Override\r
+ public String getLineQualifier() {\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public int getCompilerFlags() {\r
+ return 0;\r
+ }\r
+ });\r
+ */\r
+\r
+\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public void message(String message) {\r
+ message(message, "hh:mm:ss");\r
+ }\r
+\r
+ /**\r
+ * Print message to a console with a specified time stamp format\r
+ * \r
+ * @param message the message to be printed\r
+ * @param timeStampFormat simpledateformat timestamp format. null if no timestamp wanted\r
+ */\r
+ public void message(String message, String timeStampFormat) {\r
+ Calendar cal = Calendar.getInstance();\r
+ SimpleDateFormat sdf = new SimpleDateFormat(timeStampFormat);\r
+ String time = sdf.format(cal.getTime());\r
+\r
+ MessageConsoleStream out = this.console.newMessageStream();\r
+ if(message.length() > 1)\r
+ out.println("[" + time +"] " + message);\r
+\r
+\r
+\r
+ if(message.contains("Error")) {\r
+ showConsole();\r
+ out.println("See Issues view");\r
+ }\r
+ }\r
+\r
+ public void clearConsole() {\r
+ this.console.clearConsole();\r
+ }\r
+\r
+ public void showConsole() {\r
+ ConsolePlugin plugin = ConsolePlugin.getDefault();\r
+ IConsoleManager conMan = plugin.getConsoleManager();\r
+ conMan.showConsoleView(console);\r
+ }\r
+\r
+ class IssueLink implements IHyperlink {\r
+\r
+ @Override\r
+ public void linkEntered() {\r
+ }\r
+\r
+ @Override\r
+ public void linkExited() {\r
+ }\r
+\r
+ @Override\r
+ public void linkActivated() {\r
+ try {\r
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.simantics.issues.ui.issueview2");\r
+ } catch (PartInitException e) {\r
+ e.printStackTrace();\r
+ } \r
+ }\r
+ }\r
+ \r
+ class ModelicaLink implements IHyperlink {\r
+\r
+ @Override\r
+ public void linkEntered() {\r
+ }\r
+\r
+ @Override\r
+ public void linkExited() {\r
+ }\r
+\r
+ @Override\r
+ public void linkActivated() {\r
+ System.err.println("MODELICA LINK"); \r
+ }\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import org.simantics.modelica.data.DataSet;\r
+\r
+/**\r
+ * Extension for the basic Modelica result {@link DataSet} containing also an optional result name.\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class SysdynDataSet extends DataSet {\r
+\r
+ public String result; // Name of the result file if this is not the result of the current simulation\r
+ public Integer resultIndex = null;\r
+\r
+ public SysdynDataSet(String name, String result, double[] times, double[] values, Integer resultIndex) {\r
+ super(name, times, values);\r
+ this.result = result;\r
+ this.resultIndex = resultIndex;\r
+ }\r
+ \r
+ public SysdynDataSet(String name, String result, double[] times, double[] values) {\r
+ super(name, times, values);\r
+ this.result = result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ * Semantum Oy - Bug #4180\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import gnu.trove.set.hash.THashSet;\r
+\r
+import java.io.File;\r
+import java.util.ArrayList;\r
+import java.util.Arrays;\r
+import java.util.Collection;\r
+import java.util.List;\r
+import java.util.concurrent.locks.Lock;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.RequestProcessor;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.VirtualGraph;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.service.VirtualGraphSupport;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.simulation.data.Datasource;\r
+import org.simantics.simulation.experiment.Experiment;\r
+import org.simantics.simulation.experiment.ExperimentState;\r
+import org.simantics.simulation.experiment.IDynamicExperiment;\r
+import org.simantics.simulation.experiment.IExperimentListener;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.sysdyn.Activator;\r
+import org.simantics.sysdyn.adapter.VariableValueSubscription;\r
+import org.simantics.sysdyn.solver.SysdynSimulationJob;\r
+import org.simantics.sysdyn.solver.SolverSettings;\r
+import org.simantics.sysdyn.solver.SolverSettings.SolverType;\r
+\r
+public class SysdynExperiment extends Experiment implements IDynamicExperiment, VariableSubscriptionManager {\r
+ \r
+ // TODO: change to protected as necessary when oldSysdynExperiment is removed\r
+ \r
+ private Session session;\r
+ private Runnable modificationListener;\r
+ public SysdynModel sysdynModel;\r
+ private boolean toggled = false;\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ private THashSet<VariableValueSubscription> variableValueSubscriptions = new THashSet<VariableValueSubscription>();\r
+ @SuppressWarnings("rawtypes")\r
+ private VariableValueSubscription[] variableValueSubscriptionsSnapshot = null;\r
+\r
+ private Process process;\r
+ private boolean canceled = false;\r
+ private ExperimentState sysdynExperimentState;\r
+\r
+ private SysdynResult result;\r
+ \r
+ private String experimentName;\r
+ private File experimentDir;\r
+\r
+ public SysdynExperiment(Resource experiment, Resource model) {\r
+ super(experiment, model);\r
+ this.experimentName = "Experiment";\r
+ this.experimentDir = null;\r
+ }\r
+\r
+ public SysdynResult getCurrentResult() {\r
+ if(this.result == null)\r
+ this.result = new MemoryResult(null, null);\r
+ return this.result;\r
+ }\r
+ \r
+ public void setCurrentResult(SysdynResult result) {\r
+ this.result = result;\r
+ }\r
+\r
+ public Collection<SysdynResult> getActiveResults() {\r
+ ArrayList<SysdynResult> result = new ArrayList<SysdynResult>();\r
+ if(getCurrentResult() != null)\r
+ result.add(getCurrentResult());\r
+ result.addAll(sysdynModel.getDisplayedResults());\r
+ return result;\r
+ }\r
+\r
+ /**\r
+ * Initialize this experiment\r
+ * @param g ReadGraph\r
+ */\r
+ public void init(ReadGraph g) {\r
+ try {\r
+ this.experimentName = NameUtils.getSafeName(g, experiment);\r
+ } catch (DatabaseException e) {\r
+ this.experimentName = "Experiment";\r
+ }\r
+\r
+ this.session = g.getSession();\r
+ state = ExperimentState.STOPPED;\r
+ for(IExperimentListener listener : listeners.getListeners())\r
+ listener.stateChanged(state);\r
+\r
+ session.asyncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ final Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
+ sysdynModel = SysdynModelManager.getInstance(session).getModel(graph, configuration);\r
+ toggleActivation(graph, true);\r
+ }\r
+ });\r
+\r
+ setSysdynExperimentState(ExperimentState.INITIALIZING);\r
+ }\r
+\r
+ @Override\r
+ public void saveState() {\r
+ if(result == null || !(result instanceof MemoryResult)) \r
+ return;\r
+ // TODO: fix this\r
+ //SaveResultJob saveResultJob = new SaveResultJob(AltSysdynExperiment.this, session, result);\r
+ //saveResultJob.schedule();\r
+ }\r
+\r
+ protected Thread getSaveThread(final SysdynResult result, final File file, final IProgressMonitor progressMonitor) {\r
+ return new Thread() {\r
+ @Override\r
+ public void run() {\r
+ if(!canceled) {\r
+ // Get and store results\r result.saveToFile(file, progressMonitor);\r
+ }\r }\r
+ };\r
+ }\r
+\r
+ @Override\r
+ public void simulate(boolean enabled) {\r
+ // TODO: add state checks\r
+ if (enabled) {\r
+ SysdynSimulationJob job = new SysdynSimulationJob(sysdynModel.getConfiguration().getLabel(), this);\r
+ job.schedule();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Destroy an ongoing simulation process\r
+ */\r
+ public void cancelSimulation() {\r
+ canceled = true;\r
+ if(process != null) {\r
+ process.destroy();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Toggle simulation state\r
+ * @param enabled true == RUNNING, false == STOPPED\r
+ */\r
+ public void toggleSimulation(boolean enabled) {\r
+ if(enabled) {\r
+ this.toggled = true;\r
+ changeState(ExperimentState.RUNNING);\r
+ if(modificationListener == null) {\r
+\r
+ modificationListener = new Runnable() {\r
+\r
+ @Override\r
+ public void run() {\r
+ session.asyncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ if(getState() == ExperimentState.RUNNING) {\r
+ // TODO: fix this\r
+ //SimulationScheduler.start(sysdynModel, this);\r
+ }\r
+\r
+ }\r
+ });\r
+\r
+ };\r
+ };\r
+ sysdynModel.addModificationListener(modificationListener);\r
+ }\r
+ }\r
+ else {\r
+ changeState(ExperimentState.STOPPED);\r
+ this.toggled = false;\r
+ }\r
+\r
+ }\r
+\r
+ @Override\r
+ public void refresh(RequestProcessor session) {\r
+ session.asyncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ init(graph);\r
+ }\r
+\r
+ });\r
+ }\r
+\r
+ @Override\r
+ public void refresh(Session session) {\r
+ refresh((RequestProcessor)session);\r
+ }\r
+\r
+ @Override\r
+ protected void localStateChange() {\r
+ setSysdynExperimentState(getState());\r
+ switch(state) {\r
+ case DISPOSED:\r
+ onExperimentDisposed();\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+\r
+ }\r
+\r
+ /**\r
+ * Returns sysdyn experiment state. It is usually the same as ordinary experiment state.\r
+ * Initializing phase takes longer than normally in game experiments.\r
+ * @return\r
+ */\r
+ public ExperimentState getSysdynExperimentState() {\r
+ return sysdynExperimentState;\r
+ }\r
+\r
+ protected void setSysdynExperimentState(final ExperimentState state) {\r
+ sysdynExperimentState = state;\r
+ session.asyncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ VirtualGraphSupport support = graph.getService(VirtualGraphSupport.class);\r
+ final Session session = graph.getSession();\r
+ session.asyncRequest(new WriteRequest(support.getWorkspacePersistent("experiments")) {\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SimulationResource SR = SimulationResource.getInstance(graph);\r
+ graph.deny(model, SR.HasExperimentState);\r
+ graph.deny(experiment, SR.HasExperimentState);\r
+\r
+ Resource st = graph.newResource();\r
+ switch(state) {\r
+ case INITIALIZING:\r
+ graph.claim(st, L0.InstanceOf, SR.ExperimentState_Initializing);\r
+ break;\r
+ case RUNNING:\r
+ graph.claim(st, L0.InstanceOf, SR.ExperimentState_Running);\r
+ break;\r
+ case STOPPED:\r
+ graph.claim(st, L0.InstanceOf, SR.ExperimentState_Stopped);\r
+ break;\r
+ case DISPOSED:\r
+ graph.claim(st, L0.InstanceOf, SR.ExperimentState_Disposed);\r
+ break;\r
+ }\r
+\r
+ graph.claim(model, SR.HasExperimentState, st);\r
+ graph.claim(experiment, SR.HasExperimentState, st);\r
+ }});\r
+ }\r
+ });\r
+ }\r
+\r
+ /**\r
+ * Actions performed when experiment is disposed\r
+ * @param graph\r
+ */\r
+ protected void onExperimentDisposed() {\r
+ cancelSimulation();\r
+ sysdynModel.removeModificationListener(modificationListener);\r
+ modificationListener = null;\r
+\r
+ session.asyncRequest(new ReadRequest() {\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ toggleActivation(graph, false);\r
+ }\r
+ });\r
+ }\r
+\r
+\r
+ /**\r
+ * Toggles the active-state of this experiment on or off\r
+ * @param graph ReadGraph\r
+ * @param activate The active-state of this experiment\r
+ */\r
+ protected void toggleActivation(ReadGraph graph, final boolean activate) {\r
+ // TODO: does not work correctly, the experiment can appear inactive even when it is actually active\r
+ VirtualGraphSupport support = graph.getService(VirtualGraphSupport.class);\r
+ final Session session = graph.getSession();\r
+ session.asyncRequest(new WriteRequest(support.getWorkspacePersistent("experiments")) {\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ VirtualGraph runtime = graph.getService(VirtualGraph.class);\r
+\r
+ session.asyncRequest(new WriteRequest(runtime) {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+ if(activate)\r
+ graph.claim(experiment, SIMU.IsActive, experiment);\r
+ else\r
+ graph.denyStatement(experiment, SIMU.IsActive, experiment);\r
+ }\r
+\r
+ });\r
+ }\r
+ });\r
+ }\r
+\r
+\r
+ /* Result subscriptions */\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Copy from AprosExperiment\r
+ * @param subscription\r
+ */\r
+ @Override\r
+ public void addVariableValueSubscription(VariableValueSubscription subscription) {\r
+ assert subscription != null;\r
+ synchronized (variableValueSubscriptions) {\r
+ variableValueSubscriptions.add(subscription);\r
+ variableValueSubscriptionsSnapshot = null;\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Copy from AprosExperiment\r
+ * @param subscription\r
+ */\r
+ @Override\r
+ public void removeVariableValueSubscription(VariableValueSubscription subscription) {\r
+ assert subscription != null;\r
+ synchronized (variableValueSubscriptions) {\r
+ variableValueSubscriptions.remove(subscription);\r
+ variableValueSubscriptionsSnapshot = null;\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Copy from AprosExperiment\r
+ * @return\r
+ */\r
+ @Override\r
+ public VariableValueSubscription[] getListenerSnapshot() {\r
+ VariableValueSubscription[] snapshot = variableValueSubscriptionsSnapshot;\r
+ if (snapshot == null) {\r
+ synchronized (variableValueSubscriptions) {\r
+ snapshot = variableValueSubscriptionsSnapshot;\r
+ if (snapshot == null) {\r
+ snapshot = variableValueSubscriptionsSnapshot = \r
+ variableValueSubscriptions.toArray(new VariableValueSubscription[variableValueSubscriptions.size()]);\r
+ }\r
+ }\r
+ }\r
+ return snapshot;\r
+ }\r
+\r
+ volatile long previousVariableUpdateTime = 0;\r
+\r
+ /**\r
+ * Modified copy from AprosExperiment\r
+ */\r
+ public void resultsChanged() {\r
+ long time = System.nanoTime();\r
+ if (time - previousVariableUpdateTime > 10000000) {\r
+ updateSubscriptions();\r
+ previousVariableUpdateTime = time;\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Modified copy from AporsExperiment\r
+ */\r
+ @Override\r
+ public void updateSubscriptions() {\r
+ for(VariableValueSubscription subscription : getListenerSnapshot())\r
+ subscription.update();\r
+ }\r
+\r
+ /* Experiment methods that are not used in this experiment */\r
+\r
+ @Override\r
+ public Lock getDatasourceLock() {\r
+ throw new UnsupportedOperationException();\r
+ }\r
+\r
+ @Override\r
+ public Datasource getDatasource() {\r
+ throw new UnsupportedOperationException();\r
+ }\r
+\r
+ @Override\r
+ public void simulateDuration(double duration) {\r
+ throw new UnsupportedOperationException();\r
+ }\r
+\r
+ @Override\r
+ public void rewindTo(double time) {\r
+ throw new UnsupportedOperationException();\r
+ }\r
+ \r
+ \r
+ \r
+ // TODO: clean this up a bit maybe?\r
+ public File getExperimentDir() {\r
+ if (experimentDir == null) {\r
+ File modelsDir = Activator.getBundleContext().getDataFile("models");\r
+ String name = experimentName;\r
+ List<String> files = Arrays.asList(modelsDir.list());\r
+ if (files.contains(name)) {\r
+ int i = 2;\r
+ while (files.contains(name + "_" + i)){\r
+ i++;\r
+ }\r
+ name += "_" + i;\r
+ }\r
+ experimentDir = new File(modelsDir, name);\r
+ experimentDir.mkdir();\r
+ }\r
+ \r
+ return experimentDir;\r
+ }\r
+ \r
+ public SolverType getSolverType() {\r
+ // should be defined in experiment properties (similarly to other experiment types)\r
+ return SolverSettings.getSelectedSolverType();\r
+ }\r
+\r
+}\r
+\r
--- /dev/null
+package org.simantics.sysdyn.manager;\r
+\r
+import java.util.Collection;\r
+import java.util.concurrent.Semaphore;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.NullProgressMonitor;\r
+import org.eclipse.core.runtime.SubMonitor;\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
+import org.simantics.db.layer0.util.RemoverUtil;\r
+import org.simantics.db.layer0.variable.RVI;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.modeling.PartialIC;\r
+import org.simantics.project.IProject;\r
+import org.simantics.simulation.experiment.ExperimentState;\r
+import org.simantics.simulation.experiment.IDynamicExperiment;\r
+import org.simantics.simulation.experiment.IExperiment;\r
+import org.simantics.simulation.model.ExperimentLoadingFailed;\r
+import org.simantics.simulation.project.IExperimentActivationListener;\r
+import org.simantics.simulation.project.IExperimentManager;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.utils.DataContainer;\r
+\r
+public class SysdynExperiments {\r
+\r
+ public static void setPublishResults(ReadGraph graph, Variable variable, boolean value) throws DatabaseException {\r
+\r
+ final IProject project = Simantics.getProject();\r
+ if (project == null) return;\r
+\r
+ final IExperimentManager experimentManager = project.getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
+ if(experimentManager == null) return;\r
+ \r
+ IExperiment exp = experimentManager.getExperiment(variable.getName(graph));\r
+ if(exp instanceof OldSysdynExperiment) {\r
+ OldSysdynExperiment experiment = (OldSysdynExperiment)exp;\r
+ experiment.setPublishResults(value);\r
+ }\r
+\r
+ }\r
+ \r
+ public static String activateExperiment(IProgressMonitor monitor, final IProject project, final IExperimentManager manager, final Resource experimentResource) {\r
+ \r
+ if(monitor == null) monitor = new NullProgressMonitor();\r
+ \r
+ final SubMonitor mon = SubMonitor.convert(monitor, "Activating experiment", 100000);\r
+\r
+// SysdynExperimentManagerListener.listenManager(manager);\r
+ IExperiment[] experiments = manager.getExperiments();\r
+ SubMonitor shutdownMon = mon.newChild(10000);\r
+ int workPerExperiment;\r
+ if (experiments.length > 0)\r
+ workPerExperiment = 10000 / experiments.length;\r
+ else\r
+ workPerExperiment = 10000;\r
+ for(IExperiment e : experiments)\r
+ if(e.getState() != ExperimentState.DISPOSED)\r
+ e.shutdown(shutdownMon.newChild(workPerExperiment));\r
+ mon.setWorkRemaining(90000);\r
+\r
+ final Semaphore activated = new Semaphore(0);\r
+ final DataContainer<Throwable> problem = new DataContainer<Throwable>();\r
+ final DataContainer<IExperiment> run = new DataContainer<IExperiment>();\r
+ manager.startExperiment(experimentResource, new IExperimentActivationListener() {\r
+\r
+ @Override\r
+ public void onExperimentActivated(final IExperiment experiment) {\r
+// MessageService.defaultLog(new org.eclipse.core.runtime.Status(IStatus.INFO, "org.simantics.simulation.ui", 0, "Activated experiment " + experiment.getIdentifier() , null));\r
+ activated.release();\r
+ run.set(experiment);\r
+ }\r
+ @Override\r
+ public void onFailure(Throwable e) {\r
+ problem.set(e);\r
+ activated.release();\r
+ }\r
+ @Override\r
+ public void onMessage(IStatus message) {\r
+// MessageService.getDefault().log(message);\r
+ }\r
+ @Override\r
+ public IProgressMonitor getProgressMonitor() {\r
+ return mon;\r
+ }\r
+ }, true);\r
+ try {\r
+ activated.acquire();\r
+ Throwable t = problem.get();\r
+ if (t != null) {\r
+ if (t instanceof ExperimentLoadingFailed) {\r
+// ErrorLogger.defaultLogError(t);\r
+// ShowMessage.showError("Experiment Activation Failed", t.getMessage());\r
+ } else {\r
+// ExceptionUtils.logAndShowError(t);\r
+ }\r
+ }\r
+\r
+ return run.get().getIdentifier();\r
+ //return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Experiment activation failed, see exception for details.", problem.get());\r
+ } catch (InterruptedException e) {\r
+ return null;\r
+ }\r
+ }\r
+ \r
+ \r
+ public static String activateExperiment(Resource experiment) throws DatabaseException {\r
+\r
+// Resource experiment = Layer0Utils.getPossibleChild(graph, model, name);\r
+// if( experiment == null) return false;\r
+\r
+// SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+// if (!graph.isInstanceOf(experiment, SIMU.Experiment)) return false;\r
+ \r
+ final IProject project = Simantics.getProject();\r
+ if (project == null) return null;\r
+ \r
+ final IExperimentManager experimentManager = project.getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
+ if(experimentManager == null) return null;\r
+ \r
+ return SysdynExperiments.activateExperiment(null, project, experimentManager, experiment);\r
+ \r
+ }\r
+ \r
+ public static void run(String experimentId) throws DatabaseException {\r
+\r
+ final IProject project = Simantics.getProject();\r
+ if (project == null) return;\r
+ \r
+ final IExperimentManager experimentManager = project.getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
+ if(experimentManager == null) return;\r
+ \r
+ IExperiment experiment = experimentManager.getExperiment(experimentId);\r
+ if(experiment instanceof IDynamicExperiment)\r
+ ((IDynamicExperiment)experiment).simulate(true);\r
+ \r
+ }\r
+\r
+ private static void processChild(ReadGraph graph, Variable child, PartialIC IC) throws DatabaseException {\r
+ \r
+ System.err.println("processChild " + child.getURI(graph));\r
+ \r
+ for(Variable c : child.getChildren(graph)) {\r
+ processChild(graph, c, IC);\r
+ }\r
+ Variable values = child.getPossibleProperty(graph, "values");\r
+ if(values == null) return;\r
+ \r
+ Resource represents = child.getPossibleRepresents(graph);\r
+ if(represents == null) return;\r
+ \r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+ \r
+ Collection<Resource> exprs = graph.syncRequest(new ObjectsWithType(represents, L0.ConsistsOf, SYSDYN.ParameterExpression));\r
+ if(exprs.size() == 0) return;\r
+ \r
+ Variable v = values.getPossibleProperty(graph, "");\r
+ if(v == null) return;\r
+ double[][] vs = v.getValue(graph);\r
+ Variable value = child.getPossibleProperty(graph, "value");\r
+ if(value == null) return;\r
+ for(int i=0;i<vs.length;i++) {\r
+ double[] ds = vs[i];\r
+ if(ds == null) continue;\r
+ Variable target = value.getPossibleProperty(graph, "$" + i);\r
+ if(target != null && ds.length > 0) {\r
+ RVI rvi = target.getRVI(graph);\r
+ double initial = ds[0];\r
+ System.err.println("rvi=" + rvi + " value=" + initial);\r
+ IC.add(rvi, Variant.ofInstance(initial));\r
+ }\r
+ }\r
+ }\r
+ \r
+ public static Resource saveIC(WriteGraph graph, Variable input) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ Resource model = Variables.getModel(graph, input);\r
+ String name = NameUtils.findFreshName(graph, "IC", model, L0.ConsistsOf);\r
+ return saveIC(graph, input, name);\r
+ }\r
+\r
+ public static Resource saveIC(WriteGraph graph, Variable input, String name) throws DatabaseException {\r
+ graph.markUndoPoint();\r
+ Resource model = Variables.getModel(graph, input);\r
+ Resource child = Layer0Utils.getPossibleChild(graph, model, name);\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+ \r
+ if(child != null) {\r
+ if(graph.isInstanceOf(child, SYSDYN.InitialCondition)) {\r
+ RemoverUtil.remove(graph, child);\r
+ } else {\r
+ return null;\r
+ }\r
+ }\r
+ \r
+ PartialIC IC = new PartialIC();\r
+ processChild(graph, input, IC);\r
+\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ ModelingResources MOD = ModelingResources.getInstance(graph);\r
+ Resource ic = graph.newResource();\r
+ graph.claim(ic, L0.InstanceOf, SYSDYN.InitialCondition);\r
+ graph.addLiteral(ic, L0.HasName, L0.NameOf, L0.String, name, Bindings.STRING);\r
+ graph.addLiteral(ic, SYSDYN.InitialCondition_HasInitialValues, SYSDYN.InitialCondition_HasInitialValues_Inverse, MOD.PartialIC, IC, PartialIC.BINDING);\r
+ graph.claim(model, L0.ConsistsOf, ic);\r
+ \r
+ Layer0Utils.addCommentMetadata(graph, "Saved new Initial Condition " + name + " " + ic);\r
+ return ic;\r
+ \r
+ }\r
+\r
+ public static void assignIC(WriteGraph graph, Variable experiment, String name) throws DatabaseException {\r
+ graph.markUndoPoint();\r
+ System.err.println("assignIC " + experiment.getURI(graph));\r
+\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+\r
+ Resource run = experiment.getPossibleRepresents(graph);\r
+ if(run == null) return;\r
+ Resource exp = graph.getPossibleObject(run, L0.PartOf);\r
+ if(exp == null) return;\r
+\r
+ Resource model = Variables.getModel(graph, experiment);\r
+ Resource ic = Layer0Utils.getPossibleChild(graph, model, name);\r
+ if(ic == null) return;\r
+ \r
+ if(!graph.isInstanceOf(ic, SYSDYN.InitialCondition)) return;\r
+ \r
+ graph.deny(exp, SYSDYN.Experiment_ic);\r
+ graph.claim(exp, SYSDYN.Experiment_ic, ic);\r
+ Layer0Utils.addCommentMetadata(graph, "Assigned Initial Condition " + graph.getRelatedValue2(ic, L0.HasName, Bindings.STRING) + " to experiment " + graph.getRelatedValue2(exp, L0.HasName, Bindings.STRING));\r
+ }\r
+ \r
+ public static void deassignIC(WriteGraph graph, Variable experiment) throws DatabaseException {\r
+\r
+ System.err.println("deassignIC " + experiment.getURI(graph));\r
+\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+\r
+ Resource run = experiment.getPossibleRepresents(graph);\r
+ if(run == null) return;\r
+ Resource exp = graph.getPossibleObject(run, L0.PartOf);\r
+ if(exp == null) return;\r
+ \r
+ graph.deny(exp, SYSDYN.Experiment_ic);\r
+ \r
+ }\r
+\r
+ public static void applyIC(WriteGraph graph, Variable experiment, String name) throws DatabaseException {\r
+\r
+ System.err.println("applyIC " + experiment.getURI(graph));\r
+\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+\r
+ Resource run = experiment.getPossibleRepresents(graph);\r
+ if(run == null) return;\r
+ Resource exp = graph.getPossibleObject(run, L0.PartOf);\r
+ if(exp == null) return;\r
+\r
+ Resource model = Variables.getModel(graph, experiment);\r
+ Resource ic = Layer0Utils.getPossibleChild(graph, model, name);\r
+ if(ic == null) return;\r
+ \r
+ if(!graph.isInstanceOf(ic, SYSDYN.InitialCondition)) return;\r
+ \r
+ Variable base = Variables.getVariable(graph, run);\r
+ \r
+ PartialIC data = graph.getPossibleRelatedValue(ic, SYSDYN.InitialCondition_HasInitialValues, PartialIC.BINDING);\r
+ data.apply(graph, base);\r
+ \r
+ }\r
+ \r
+ public static void deleteIC(WriteGraph graph, Variable input, String name) throws DatabaseException {\r
+ graph.markUndoPoint();\r
+ Resource model = Variables.getModel(graph, input);\r
+ Resource child = Layer0Utils.getPossibleChild(graph, model, name);\r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+\r
+ if((child != null) && graph.isInstanceOf(child, SYSDYN.InitialCondition))\r
+ RemoverUtil.remove(graph, child);\r
+ Layer0Utils.addCommentMetadata(graph, "Deleted Initial Condition " + graph.getRelatedValue2(child, Layer0.getInstance(graph).HasName, Bindings.STRING));\r
+ }\r
+ \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import gnu.trove.list.array.TDoubleArrayList;\r
+import gnu.trove.map.hash.THashMap;\r
+\r
+import java.io.File;\r
+import java.io.FileInputStream;\r
+import java.io.FileNotFoundException;\r
+import java.io.FileOutputStream;\r
+import java.io.IOException;\r
+import java.lang.reflect.Field;\r
+import java.util.HashMap;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.NullProgressMonitor;\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.Logger;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.fmu.FMUControlJNI;\r
+import org.simantics.fmu.FMUJNIException;\r
+import org.simantics.modelica.IModelicaMonitor;\r
+import org.simantics.modelica.ModelicaManager;\r
+import org.simantics.modelica.SimulationLocation;\r
+import org.simantics.modeling.PartialIC;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.simulation.SimulationJob.HeadlessModelicaMonitor;\r
+import org.simantics.sysdyn.solver.ISolver;\r
+import org.simantics.sysdyn.solver.ModelicaSolver;\r
+\r
+/**\r
+ * Game experiment\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class SysdynGameExperiment extends SysdynGameExperimentBase {\r
+\r
+ private ModelicaSolver solver;\r
+ public FMUControlJNI control;\r
+ private boolean loaded = false;\r
+ \r
+ private static boolean fortranLibrariesLoaded = false;\r
+ \r
+ public SysdynGameExperiment(Resource experiment, Resource model) {\r
+ super(experiment, model);\r
+ this.solver = new ModelicaSolver(this);\r
+ }\r
+ \r
+ public FMUControlJNI getFMUControl() {\r
+ return control;\r
+ }\r
+ \r
+ @Override\r
+ public void init(ReadGraph g) {\r
+ super.init(g);\r
+\r
+ if(control == null)\r
+ control = new FMUControlJNI();\r
+ \r
+ results = new THashMap<String, TDoubleArrayList>();\r
+ \r
+ }\r
+ \r
+ @Override\r
+ protected void onExperimentDisposed() {\r
+ super.onExperimentDisposed();\r
+ if(control!=null) {\r
+ try {\r
+ control.unloadFMU();\r
+ loaded = false;\r
+ } catch (FMUJNIException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ }\r
+\r
+ private boolean isValidFMU(File file) {\r
+ if(!file.exists()) return false;\r
+ if(!file.isFile()) return false;\r
+ if(file.length() == 0) return false;\r
+ return true;\r
+ }\r
+ \r
+\r
+ @Override\r
+ public synchronized void simulate(final IModelicaMonitor monitor, final IProgressMonitor progressMonitor, String modelName) throws IOException {\r
+ canceled = false;\r
+\r
+ progressMonitor.subTask("Write modelica classes");\r
+\r
+ // Write Modelica files \r
+ String modelText = getModelicaCode(monitor, true, getOpenModelicaVersion());\r
+ if(modelText == null)\r
+ return;\r
+ \r
+ omcVersion = ModelicaManager.getDefaultOMVersion();\r
+ \r
+ monitor.message("Simulate " + modelName + " using OpenModelica " + omcVersion);\r
+ \r
+ progressMonitor.worked(1);\r
+\r
+ // Write initial files and add init-parameters\r
+ progressMonitor.subTask("Write simulation files");\r
+ HashMap<String, String> inits = getExperimentParameters(monitor);\r
+\r
+\r
+ // add loadFile script to load all related functions and function libraries \r
+ String additionalScript = getAdditionalScripts();\r
+\r
+ // Create simulation files\r
+ SimulationLocation simulationLocation = createSimulationFiles(sysdynModel, modelText, inits, additionalScript, true);\r
+ progressMonitor.worked(1);\r
+\r
+ // Load precompiled fmu if structure has not changed and it has not yet been loaded\r
+ File fmu = null;\r
+ if(!sysdynModel.isStructureModified()) {\r
+ if(!simulationLocation.executableFile.isFile()) {\r
+ fmu = loadModelFmu(simulationLocation);\r
+ } else {\r
+ fmu = simulationLocation.executableFile;\r
+ }\r
+ }\r
+ // Build the model and store previous model structure and inits that affect the building\r
+ // If there is no exe file OR the model structure has not changed, no need to build\r
+ if (fmu == null && (!isValidFMU(simulationLocation.executableFile) || sysdynModel.isStructureModified())) {\r
+ progressMonitor.subTask("Build model");\r
+ buildModel(simulationLocation, monitor);\r
+ previousModelStructure = modelText;\r
+ \r
+ saveModelFmu(simulationLocation);\r
+ }\r
+\r
+ progressMonitor.worked(1);\r
+\r
+ if(simulationLocation != null && !canceled) {\r
+ // Load fmu and initialize it for simulation\r
+ try {\r
+ if (false && !fortranLibrariesLoaded) { // Enable this when we update from OpenModelica 1.9.0beta4!\r
+ File omDir = ModelicaManager.getOMHome();\r
+ File mingw = new File(omDir, "MinGW");\r
+ File mbin = new File(mingw, "bin");\r
+ \r
+ // Add MinGW path to java.library.path. This is a bit of a hack because \r
+ // java.library.path isn't intended to be set programmatically.\r
+ String newLibPath = System.getProperty("java.library.path") + File.pathSeparator + mbin.getAbsolutePath();\r
+ System.setProperty("java.library.path", newLibPath);\r
+ Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");\r
+ fieldSysPath.setAccessible(true);\r
+ if (fieldSysPath != null) {\r
+ fieldSysPath.set(System.class.getClassLoader(), null);\r
+ }\r
+ \r
+ System.loadLibrary("libgfortran-3");\r
+ System.out.println("Loaded libgfortran-3.dll");\r
+ System.loadLibrary("pthreadGC2");\r
+ System.out.println("Loaded pthreadGC2.dll");\r
+ fortranLibrariesLoaded = true;\r
+ }\r
+ \r
+ control.loadFMUFile(simulationLocation.executableFile.getAbsolutePath()); // unzip and load fmu\r
+ loaded = true;\r
+ instantiate();\r
+ \r
+ } catch (FMUJNIException e) {\r
+ System.err.println("SysdynGameExperiment initialization failed:\n\t" + e.getMessage());\r
+ } catch (SecurityException e) {\r
+ // TODO Auto-generated catch block\r
+ e.printStackTrace();\r
+ } catch (NoSuchFieldException e) {\r
+ // TODO Auto-generated catch block\r
+ e.printStackTrace();\r
+ } catch (IllegalArgumentException e) {\r
+ // TODO Auto-generated catch block\r
+ e.printStackTrace();\r
+ } catch (IllegalAccessException e) {\r
+ // TODO Auto-generated catch block\r
+ e.printStackTrace();\r
+ }\r
+\r
+ }\r
+ process = null;\r
+ simulate(false); \r
+ }\r
+\r
+ /**\r
+ * Load fmu file from database, if it exists for the model of this experiment\r
+ * \r
+ * @param simulationLocation SimulationLocation indicating where the fmu should be loaded\r
+ * @return Loaded fmu or null if it was not loaded from database\r
+ */\r
+ private File loadModelFmu(SimulationLocation simulationLocation) {\r
+ File fmu = null;\r
+ try {\r
+ final String fmuLocation = simulationLocation.executableFile.getAbsolutePath();\r
+ fmu = session.syncRequest(new Read<File>() {\r
+ @Override\r
+ public File perform(ReadGraph graph) throws DatabaseException {\r
+ File result = null;\r
+ FileOutputStream fos;\r
+ try {\r
+ fos = new FileOutputStream(fmuLocation);\r
+ byte[] fileBArray = graph.getPossibleRelatedValue(\r
+ getModel(), SysdynResource.getInstance(graph).SysdynModel_fmuFile, Bindings.BYTE_ARRAY);\r
+ \r
+ if(fileBArray != null) {\r
+ fos.write(fileBArray);\r
+ fos.close();\r
+ result = new File(fmuLocation);\r
+ } else {\r
+ fos.close();\r
+ return null;\r
+ }\r
+ \r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ }\r
+ return result;\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+ return fmu;\r
+ }\r
+ \r
+ /**\r
+ * Save fmu file from simulationLocation to database\r
+ * @param simulationLocation Location for finding fmu\r
+ */\r
+ private void saveModelFmu(SimulationLocation simulationLocation) {\r
+ final String fmuLocation = simulationLocation.executableFile.getAbsolutePath();\r
+ session.asyncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ File file = new File(fmuLocation);\r
+ byte[] fileBArray = new byte[(int)file.length()];\r
+ FileInputStream fis;\r
+ try {\r
+ fis = new FileInputStream(file);\r
+\r
+ fis.read(fileBArray);\r
+ graph.claimLiteral(\r
+ getModel(), \r
+ SysdynResource.getInstance(graph).SysdynModel_fmuFile, \r
+ fileBArray, Bindings.BYTE_ARRAY);\r
+ fis.close();\r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+\r
+ @Override\r
+ public void rewindTo(double time) {\r
+ \r
+ if(control == null)\r
+ return;\r
+ \r
+ if(time >-0.001 && time < 0.001) {\r
+ try {\r
+ simulate(new HeadlessModelicaMonitor(), new NullProgressMonitor(), sysdynModel.getConfiguration().getLabel());\r
+ //instantiate();\r
+ } catch (IOException e) {\r
+ Logger.defaultLogError(e);\r
+ }\r
+ } else {\r
+ System.out.println("rewindTo");\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public void refresh(Session session) {\r
+ try {\r
+ control.initializeSimulation();\r
+ clearResults();\r
+ //getInitialResultValues();\r
+ \r
+ } catch (FMUJNIException e) {\r
+ System.err.println("SysdynGameExperiment instantiate failed: " + e.getMessage());\r
+ }\r
+ }\r
+ \r
+ private synchronized void instantiate() {\r
+ try {\r
+ HashMap<String, String> inits = getExperimentParameters(null);\r
+\r
+ control.setStepLength(stepLength); // FIXME: fixed step lenghth\r
+ control.setTime(startTime);\r
+ control.instantiateSimulation(); // instantiate simulation\r
+\r
+ if(!control.isInitialized()) {\r
+ control.initializeSimulation();\r
+ }\r
+\r
+ if(inits.get("variableFilter") == null || inits.get("variableFilter").equals(".*"))\r
+ subscription = control.getAllVariables();\r
+ else\r
+ subscription = control.filterVariables(inits.get("variableFilter"));\r
+ \r
+ // Initialize subscription indexes map for fast result reading in getValue()\r
+ if(subscriptionIndexes == null)\r
+ subscriptionIndexes = new HashMap<String, Integer>();\r
+ \r
+ subscriptionIndexes.clear();\r
+ for(int i = 0; i < subscription.length; i++) {\r
+ subscriptionIndexes.put(subscription[i], i);\r
+ }\r
+\r
+ // Initialize container for current simulation results\r
+ currentValues = new double[subscription.length];\r
+ \r
+ // subscribe all variables\r
+ control.subscribe(subscription); \r
+\r
+ clearResults();\r
+ //getInitialResultValues();\r
+ \r
+ Simantics.getSession().syncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+\r
+ Resource run = Layer0Utils.getPossibleChild(graph, SysdynGameExperiment.this.experiment, getIdentifier());\r
+ if(run == null) {\r
+ System.err.println("No run");\r
+ return;\r
+ }\r
+ \r
+ Variable base = Variables.getVariable(graph, run);\r
+ \r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+ \r
+ Resource ic = graph.getPossibleObject(SysdynGameExperiment.this.experiment, SYSDYN.Experiment_ic);\r
+ if(ic == null) return;\r
+ \r
+ PartialIC data = graph.getPossibleRelatedValue(ic, SYSDYN.InitialCondition_HasInitialValues, PartialIC.BINDING);\r
+ data.apply(graph, base);\r
+ \r
+ }\r
+ \r
+ });\r
+ \r
+ } catch (FMUJNIException e) {\r
+ System.err.println("SysdynGameExperiment instantiate failed: " + e.getMessage());\r
+ } catch (DatabaseException e) {\r
+ System.err.println("SysdynGameExperiment instantiate failed: " + e.getMessage());\r
+ }\r
+ }\r
+\r
+// private synchronized void getInitialResultValues() {\r
+// try {\r
+// // Initialize results\r
+// results.clear();\r
+//\r
+// currentValues = control.getSubscribedResults(currentValues);\r
+// for(int k = 0; k < subscription.length; k++) {\r
+// results.put(subscription[k], new ArrayList<Double>());\r
+// results.get(subscription[k]).add(currentValues[k]);\r
+// }\r
+//\r
+// ((MemoryResult)getCurrentResult()).setResult(new GameResult(this.results, this.subscription));\r
+// resultsChanged(); \r
+// } catch (FMUJNIException e) {\r
+// System.err.println("SysdynGameExperiment getInitialResultValues failed: " + e.getMessage());\r
+// }\r
+// }\r
+ \r
+ @Override\r
+ public void updateSubscriptions() {\r
+ \r
+ if(!loaded) return;\r
+ \r
+ try {\r
+ if(control.isInitialized())\r
+ currentValues = control.getSubscribedResults(currentValues);\r
+ } catch (FMUJNIException e) {\r
+ e.printStackTrace();\r
+ }\r
+ super.updateSubscriptions();\r
+ }\r
+\r
+ @Override\r
+ public ISolver getSolver() {\r
+ return solver;\r
+ }\r
+ \r
+ }\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import gnu.trove.list.array.TDoubleArrayList;\r
+import gnu.trove.map.hash.THashMap;\r
+\r
+import java.util.Collection;\r
+import java.util.HashMap;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.jobs.Job;\r
+import org.simantics.db.AsyncReadGraph;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.procedure.AsyncListener;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.fmu.FMUJNIException;\r
+import org.simantics.simulation.experiment.ExperimentState;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.solver.ISolver;\r
+import org.simantics.utils.datastructures.Quad;\r
+\r
+/**\r
+ * Game experiment\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+abstract public class SysdynGameExperimentBase extends OldSysdynExperiment {\r
+\r
+ public double stepLength = DEFAULT_STEP_LENGTH;\r
+ public double startTime = DEFAULT_START_TIME;\r
+ protected double stepDuration = DEFAULT_STEP_DURATION;\r
+ protected int savePer = 1;\r
+\r
+ protected HashMap<String, Integer> subscriptionIndexes;\r
+ protected double[] currentValues; // Current values from FMU. Updated with updateSubscriptions\r
+ \r
+ THashMap<String, TDoubleArrayList> results;\r
+\r
+ public String[] subscription;\r
+ \r
+ public static double DEFAULT_STEP_DURATION = 1.0;\r
+ public static double DEFAULT_STEP_LENGTH = 0.1;\r
+ public static double DEFAULT_START_TIME = 0.0;\r
+ public static int DEFAULT_OUTPUT_INTERVAL = 1;\r
+ \r
+ public SysdynGameExperimentBase(Resource experiment, Resource model) {\r
+ super(experiment, model);\r
+ }\r
+\r
+ public double getStepDuration() {\r
+ return stepDuration;\r
+ }\r
+ \r
+ public void setStepDuration(double duration) {\r
+ this.stepDuration = duration;\r
+ }\r
+ \r
+ public double getStepLength() {\r
+ return stepLength;\r
+ }\r
+ \r
+ public void setStepLength(double stepLength) {\r
+ this.stepLength = stepLength;\r
+ }\r
+ \r
+ public void setStartTime(double startTime) {\r
+ this.startTime = startTime;\r
+ }\r
+\r
+ public void setOutputInterval(int interval) {\r
+ this.savePer = interval;\r
+ }\r
+ \r
+ public static class Subscription {\r
+ public SysdynGameExperimentBase exp;\r
+ public int[] indexes;\r
+ public void getValues(double[] data) {\r
+ for(int i=0;i<indexes.length;i++) data[i] = exp.currentValues[indexes[i]];\r
+ }\r
+ }\r
+ \r
+ public Subscription subscribe(Collection<String> names) {\r
+ Subscription result = new Subscription();\r
+ int[] indexes = new int[names.size()];\r
+ int index = 0;\r
+ for(String name : names)\r
+ indexes[index++] = subscriptionIndexes.get(name);\r
+ result.exp = this;\r
+ result.indexes = indexes;\r
+ return result;\r
+ }\r
+ \r
+ public Double getCurrentValue(String name) {\r
+ if(subscriptionIndexes != null && name != null) {\r
+ Integer index = subscriptionIndexes.get(name);\r
+ if(index != null) {\r
+ return currentValues[index];\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+ public void setSubscribedResults(IProgressMonitor monitor, double time) throws FMUJNIException {\r
+\r
+ monitor.subTask("Get results (time = " + time + ")");\r
+ currentValues = getSolver().getSubscribedResults(currentValues);\r
+ monitor.worked(1);\r
+\r
+ monitor.subTask("Save results (time = " + time + ")");\r
+ for(int k = 0; k < subscription.length; k++) {\r
+ setResults(time, subscription[k], currentValues[k]);\r
+ }\r
+ \r
+ lastResultTime = time;\r
+ \r
+ }\r
+ \r
+ private double lastResultTime = Double.NaN;\r
+\r
+ public void setResults(double time, String key, Double value) {\r
+ TDoubleArrayList list = results.get(key);\r
+ if(list == null) {\r
+ list = new TDoubleArrayList();\r
+ results.put(key, list);\r
+ }\r
+ if(time == lastResultTime) {\r
+ list.set(list.size()-1, value);\r
+ } else {\r
+ list.add(value);\r
+ }\r
+// System.err.println("setResults " + time + " " + key + " = " + list);\r
+ }\r
+ \r
+ public void clearResults() {\r
+ lastResultTime = Double.NaN;\r
+ results.clear();\r
+ }\r
+ \r
+ @Override\r
+ public void simulateDuration(double duration) {\r
+ Job job = new SimulateDurationJob(this, "Simulate steps", duration);\r
+ // Start the Job\r
+ job.schedule();\r
+ }\r
+ \r
+ public void refresh() {\r
+ }\r
+ \r
+ public abstract ISolver getSolver();\r
+ \r
+ @Override\r
+ public void init(ReadGraph g) {\r
+ \r
+ super.init(g);\r
+ \r
+ try {\r
+ g.syncRequest(new Read<Quad<Double, Double, Double, Double>>() {\r
+\r
+ @Override\r
+ public Quad<Double, Double, Double, Double> perform(ReadGraph graph)\r
+ throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Double stepDuration = graph.getPossibleRelatedValue(experiment, sr.GameExperiment_stepDuration);\r
+ Double stepLength = graph.getPossibleRelatedValue(experiment, sr.GameExperiment_stepLength);\r
+ Double outputInterval = graph.getPossibleRelatedValue(model, sr.SysdynModel_outputInterval);\r
+ Double startTime = graph.getPossibleRelatedValue(model, sr.SysdynModel_startTime);\r
+ return new Quad<Double, Double, Double, Double>(stepDuration, stepLength, outputInterval, startTime);\r
+ }\r
+ }, new AsyncListener<Quad<Double, Double, Double, Double>>() {\r
+\r
+ @Override\r
+ public void execute(AsyncReadGraph graph,\r
+ Quad<Double, Double, Double, Double> result) {\r
+ setStepDuration(result.first != null ? result.first : DEFAULT_STEP_DURATION);\r
+ setStepLength(result.second != null ? result.second : DEFAULT_STEP_LENGTH);\r
+ setStartTime(result.fourth != null ? result.fourth : DEFAULT_START_TIME);\r
+\r
+ if(result.third == null) {\r
+ setOutputInterval(DEFAULT_OUTPUT_INTERVAL);\r
+ } else {\r
+ int interval = (int)getInterval(result.third, getStepLength());\r
+ setOutputInterval(interval);\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public void exception(AsyncReadGraph graph, Throwable throwable) {\r
+ throwable.printStackTrace();\r
+ setStepDuration(DEFAULT_STEP_DURATION);\r
+ setStepLength(DEFAULT_STEP_LENGTH);\r
+ setStartTime(DEFAULT_START_TIME);\r
+ setOutputInterval(DEFAULT_OUTPUT_INTERVAL);\r
+ }\r
+\r
+ @Override\r
+ public boolean isDisposed() {\r
+ return getState().equals(ExperimentState.DISPOSED);\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+ }\r
+ \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import gnu.trove.list.array.TDoubleArrayList;\r
+import gnu.trove.map.hash.THashMap;\r
+\r
+import java.io.IOException;\r
+import java.util.HashMap;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.NullProgressMonitor;\r
+import org.simantics.Simantics;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.Logger;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.modelica.IModelicaMonitor;\r
+import org.simantics.modeling.PartialIC;\r
+import org.simantics.simulation.experiment.ExperimentState;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.simulation.SimulationJob.HeadlessModelicaMonitor;\r
+import org.simantics.sysdyn.solver.ISolver;\r
+import org.simantics.sysdyn.solver.ISolverMonitor;\r
+import org.simantics.sysdyn.solver.InternalSolver;\r
+\r
+\r
+public class SysdynGameExperimentInternal extends SysdynGameExperimentBase {\r
+\r
+ public InternalSolver solver;\r
+ \r
+ public SysdynGameExperimentInternal(Resource experiment, Resource model) {\r
+ super(experiment, model);\r
+ }\r
+\r
+ @Override\r
+ public ISolver getSolver() {\r
+ return solver;\r
+ }\r
+ \r
+ @Override\r
+ public void init(ReadGraph g) {\r
+ \r
+ super.init(g);\r
+ \r
+ results = new THashMap<String, TDoubleArrayList>();\r
+\r
+ solver = new InternalSolver(this, sysdynModel, true, new ISolverMonitor() {\r
+ \r
+ @Override\r
+ public void showConsole() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+ \r
+ @Override\r
+ public void message(String message) {\r
+ System.err.println("Internal solver:" + message);\r
+ }\r
+ \r
+ @Override\r
+ public void clearConsole() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+ });\r
+\r
+ }\r
+\r
+ @Override\r
+ public synchronized void simulate(final IModelicaMonitor monitor, final IProgressMonitor progressMonitor, String modelName) throws IOException {\r
+ \r
+ try {\r
+\r
+ solver.initialize();\r
+ solver.buildModel();\r
+\r
+ //solver.setTime(startTime);\r
+\r
+ subscription = solver.solver.keys();\r
+ \r
+ // Initialize subscription indexes map for fast result reading in getValue()\r
+ if(subscriptionIndexes == null)\r
+ subscriptionIndexes = new HashMap<String, Integer>();\r
+ \r
+ subscriptionIndexes.clear();\r
+ for(int i = 0; i < subscription.length; i++) {\r
+ subscriptionIndexes.put(subscription[i], i);\r
+ }\r
+\r
+ // Initialize container for current simulation results\r
+ currentValues = new double[subscription.length];\r
+ \r
+ // subscribe all variables\r
+ //solver.subscribe(subscription); \r
+\r
+ clearResults();\r
+ //getInitialResultValues();\r
+ \r
+ Simantics.getSession().syncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+\r
+ Resource run = Layer0Utils.getPossibleChild(graph, SysdynGameExperimentInternal.this.experiment, getIdentifier());\r
+ if(run == null) {\r
+ System.err.println("No run");\r
+ return;\r
+ }\r
+ \r
+ Variable base = Variables.getVariable(graph, run);\r
+ \r
+ SysdynResource SYSDYN = SysdynResource.getInstance(graph);\r
+ \r
+ Resource ic = graph.getPossibleObject(SysdynGameExperimentInternal.this.experiment, SYSDYN.Experiment_ic);\r
+ if(ic == null) return;\r
+ \r
+ PartialIC data = graph.getPossibleRelatedValue(ic, SYSDYN.InitialCondition_HasInitialValues, PartialIC.BINDING);\r
+ data.apply(graph, base);\r
+ \r
+ }\r
+ \r
+ });\r
+ \r
+ \r
+ setSubscribedResults(new NullProgressMonitor(), solver.getTime());\r
+\r
+ ((MemoryResult)getCurrentResult()).setResult(new GameResult(this, this.results, this.subscription));\r
+\r
+ resultsChanged(true);\r
+ \r
+ changeState(ExperimentState.STOPPED);\r
+ \r
+ } catch (Exception e) {\r
+ Logger.defaultLogError(e);\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public void refresh() {\r
+ try {\r
+ setSubscribedResults(new NullProgressMonitor(), solver.getTime());\r
+ \r
+ ((MemoryResult)getCurrentResult()).setResult(new GameResult(this, this.results, this.subscription));\r
+ \r
+ resultsChanged(true);\r
+ } catch (Exception e) {\r
+ Logger.defaultLogError(e);\r
+ } \r
+ }\r
+ \r
+ @Override\r
+ public void rewindTo(double time) {\r
+ \r
+ if(time >-0.001 && time < 0.001) {\r
+ try {\r
+ simulate(new HeadlessModelicaMonitor(), new NullProgressMonitor(), sysdynModel.getConfiguration().getLabel());\r
+ //instantiate();\r
+ } catch (IOException e) {\r
+ Logger.defaultLogError(e);\r
+ }\r
+ } else {\r
+ System.out.println("rewindTo");\r
+ }\r
+ }\r
+\r
+ }\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2013, 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ * Semantum Oy - Bug #4180\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import gnu.trove.set.hash.THashSet;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.HashMap;\r
+import java.util.HashSet;\r
+import java.util.Map;\r
+import java.util.Set;\r
+import java.util.concurrent.CopyOnWriteArrayList;\r
+\r
+import org.simantics.Simantics;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.exception.ManyObjectsForFunctionalRelationException;\r
+import org.simantics.db.exception.ServiceException;\r
+import org.simantics.db.procedure.Listener;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.db.service.VirtualGraphSupport;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.IMapping;\r
+import org.simantics.objmap.IMappingListener;\r
+import org.simantics.objmap.MappingException;\r
+import org.simantics.objmap.Mappings;\r
+import org.simantics.project.IProject;\r
+import org.simantics.simulation.experiment.IExperiment;\r
+import org.simantics.simulation.model.IModel;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.simulation.project.ExperimentRuns;\r
+import org.simantics.simulation.project.IExperimentActivationListener;\r
+import org.simantics.simulation.project.IExperimentManager;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.adapter.VariableValueSubscription;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.IElement;\r
+import org.simantics.sysdyn.representation.IndependentVariable;\r
+import org.simantics.sysdyn.representation.Model;\r
+import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.ParameterOverride;\r
+import org.simantics.sysdyn.representation.Sheet;\r
+import org.simantics.sysdyn.representation.SysdynSchema;\r
+import org.simantics.sysdyn.representation.Variability;\r
+import org.simantics.sysdyn.representation.expressions.Expression;\r
+import org.simantics.sysdyn.representation.expressions.IExpression;\r
+import org.simantics.sysdyn.representation.expressions.ParameterExpression;\r
+import org.simantics.sysdyn.representation.expressions.StockExpression;\r
+import org.simantics.sysdyn.solver.SolverSettings;\r
+import org.simantics.sysdyn.solver.SolverSettings.SolverType;\r
+\r
+/**\r
+ * Maintains a Java representation of system dynamic model.\r
+ * @author Hannu Niemistö, Teemu Lempinen, Tuomas Miettinen\r
+ */\r
+public class SysdynModel implements IModel, IMappingListener, VariableSubscriptionManager {\r
+\r
+ private Session session;\r
+\r
+ private IMapping mapping;\r
+\r
+ private Resource configurationResource;\r
+ private Resource modelResource;\r
+\r
+ private Configuration configuration;\r
+\r
+ private final Set<Configuration> modules = new HashSet<Configuration>();\r
+\r
+ private ArrayList<SysdynResult> displayedResults;\r
+ private final ArrayList<HistoryDatasetResult> listeningHistories = new ArrayList<HistoryDatasetResult>();\r
+\r
+ private final CopyOnWriteArrayList<Runnable> modificationListeners =\r
+ new CopyOnWriteArrayList<Runnable>();\r
+ \r
+ @SuppressWarnings("rawtypes")\r
+ protected THashSet<VariableValueSubscription> variableValueSubscriptions = new THashSet<VariableValueSubscription>();\r
+ @SuppressWarnings("rawtypes")\r
+ protected volatile VariableValueSubscription[] variableValueSubscriptionsSnapshot = null;\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ private final Map<Class, Object> services = new HashMap<Class, Object>();\r
+ \r
+ private boolean structureModified = false;\r
+\r
+ /**\r
+ * Recursively read all module configurations that are used in \r
+ * configResource and its components children\r
+ * \r
+ * @param graph ReadGraph\r
+ * @param configResource Configuration\r
+ * @param result set containing all encountered configurations\r
+ * @throws DatabaseException\r
+ */\r
+ void readModules(ReadGraph graph, Resource configResource, Set<Resource> result) throws DatabaseException {\r
+\r
+ // if result does not contain this resource, add it to the result\r
+ if(!result.add(configResource)) return;\r
+\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ StructuralResource2 str = StructuralResource2.getInstance(graph);\r
+\r
+ for(Resource part : graph.getObjects(configResource, l0.ConsistsOf)) {\r
+ if(graph.isInstanceOf(part, sr.Module)) {\r
+ Resource type = graph.getPossibleType(part, sr.Module);\r
+ Resource config = graph.getPossibleObject(type, str.IsDefinedBy);\r
+ // Recursively readModules\r
+ readModules(graph, config, result);\r
+ }\r
+ }\r
+\r
+ }\r
+\r
+ /**\r
+ * Get all modules that have been used in configResource and its children\r
+ * @param graph ReadGraph\r
+ * @param configResource Configuration\r
+ * @return All modules (configuration resources) that have been used in configResource \r
+ * @throws DatabaseException\r
+ */\r
+ Set<Resource> readModules(ReadGraph graph, Resource configResource) throws DatabaseException {\r
+ HashSet<Resource> result = new HashSet<Resource>();\r
+ readModules(graph, configResource, result);\r
+ return result;\r
+ }\r
+\r
+ /**\r
+ * Create an ObjMapping\r
+ * @param g ReadGraph\r
+ * @throws DatabaseException\r
+ */\r
+ private void createMapping(ReadGraph g) throws DatabaseException {\r
+ SysdynSchema schema = new SysdynSchema(g);\r
+ mapping = Mappings.createWithListening(schema);\r
+ mapping.addMappingListener(SysdynModel.this);\r
+ try {\r
+ configuration = (Configuration)mapping.map(g, configurationResource); \r
+ } catch (MappingException e) {\r
+ SysdynConsole.INSTANCE.message(\r
+ "Error: Mapping is broken! Find the problem, " +\r
+ "fix it and restart the program." +\r
+ "\nJava error message:\n" + \r
+ e.getMessage());\r
+ throw e;\r
+ }\r
+ for(Resource config : readModules(g, configurationResource)) {\r
+ modules.add((Configuration)mapping.map(g, config));\r
+ }\r
+ }\r
+\r
+ /**\r
+ * New Sysdyn model\r
+ * @param g ReadGraph\r
+ * @param configurationResource Configration resource of the model\r
+ */\r
+ public SysdynModel(ReadGraph g, Resource configurationResource) {\r
+ this.session = g.getSession();\r
+ this.configurationResource = configurationResource;\r
+\r
+ try {\r
+ createMapping(g);\r
+ } catch(DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ g.asyncRequest(new Read<ArrayList<SysdynResult>> () {\r
+ @Override\r
+ public ArrayList<SysdynResult> perform(ReadGraph graph) throws DatabaseException {\r
+ ArrayList<SysdynResult> displayedResults = new ArrayList<SysdynResult>();\r
+ // TODO: this can be done automatically with a listener\r
+ \r
+ for(HistoryDatasetResult hs : listeningHistories)\r
+ hs.disposeListeners(); // dispose old histories listening to spreadsheets\r
+ \r
+ try {\r
+ // Find all active saved results\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+ Resource model = graph.getPossibleObject(getConfigurationResource(), SIMU.IsConfigurationOf);\r
+ if(model == null)\r
+ return null;\r
+ \r
+ Collection<Resource> results = graph.syncRequest(new ActiveResults(model));\r
+ for(Resource result : results) {\r
+ if(graph.hasStatement(result, sr.Result_showResult)) {\r
+ SysdynResult sysdynResult = null;\r
+ if(graph.isInstanceOf(result, sr.HistoryDataset)) {\r
+ HistoryDatasetResult r = new HistoryDatasetResult();\r
+ listeningHistories.add(r);\r
+ sysdynResult = new MemoryResult(r, NameUtils.getSafeLabel(graph, result));\r
+ r.read((MemoryResult)sysdynResult, result);\r
+ } else {\r
+ sysdynResult = new FileResult(\r
+ (String) graph.getPossibleRelatedValue(result, l0.HasLabel),\r
+ (String) graph.getPossibleRelatedValue(result, sr.Result_resultFile));\r
+ }\r
+\r
+ if(sysdynResult != null)\r
+ displayedResults.add(sysdynResult);\r
+ }\r
+ }\r
+ } catch (Exception e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ return displayedResults;\r
+ }\r
+\r
+ }, new Listener<ArrayList<SysdynResult>> () {\r
+\r
+ @Override\r
+ public void execute(ArrayList<SysdynResult> result) {\r
+ // Add the current result if there is one\r
+ displayedResults = result;\r
+ resultChanged();\r
+ }\r
+\r
+ @Override\r
+ public void exception(Throwable t) {\r
+ t.printStackTrace();\r
+ }\r
+\r
+ @Override\r
+ public boolean isDisposed() {\r
+ return false;\r
+ }\r
+\r
+ });\r
+ }\r
+\r
+ // A dummy call for experiments\r
+ public SysdynModel(Resource modelResource) {\r
+ this.modelResource = modelResource;\r
+ }\r
+ \r
+ /**\r
+ * Get modules\r
+ * @return modules\r
+ */\r
+ public Set<Configuration> getModules() {\r
+ return modules;\r
+ }\r
+\r
+ /**\r
+ * Update mapping.\r
+ * \r
+ * Use this if inside a transaction.\r
+ * \r
+ * @param graph ReadGraph\r
+ * @return has the range been modified\r
+ * @throws DatabaseException\r
+ */\r
+ public synchronized boolean update(ReadGraph graph) throws DatabaseException {\r
+ if(mapping.isDomainModified()) {\r
+ try {\r
+ Collection<Object> updated = mapping.updateRange(graph);\r
+\r
+ for(Object o : updated) {\r
+ if(o instanceof Model) {\r
+ continue;\r
+ } else if(o instanceof Expression && !(o instanceof StockExpression)) {\r
+ IndependentVariable variable = ((Expression)o).getParent();\r
+ Variability variability = Variability.getVariability(variable, false, configuration);\r
+ if(variability == Variability.PARAMETER)\r
+ continue;\r
+ }\r
+ \r
+ // if continue has not been called, the structure has changed\r
+ setStructureModified(true);\r
+ break;\r
+\r
+ }\r
+ \r
+ } catch (MappingException e) {\r
+ SysdynConsole.INSTANCE.message(\r
+ "Error: Mapping is broken! Find the problem, " +\r
+ "fix it and restart the program." +\r
+ "\nJava error message:\n" + \r
+ e.getMessage());\r
+ throw e;\r
+ }\r
+\r
+ // Remove all unnecessary module configurations from modules \r
+ Set<Resource> configs = readModules(graph, configurationResource); \r
+ for(Resource config : configs) {\r
+ if(!modules.contains(config))\r
+ modules.add((Configuration)mapping.map(graph, config));\r
+ }\r
+\r
+ HashSet<Configuration> toBeRemoved = null;\r
+ for(Configuration module : modules) {\r
+ if(!configs.contains(mapping.inverseGet(module))) {\r
+ if(toBeRemoved == null)\r
+ toBeRemoved = new HashSet<Configuration>();\r
+ toBeRemoved.add(module);\r
+ }\r
+ }\r
+ if(toBeRemoved != null)\r
+ modules.removeAll(toBeRemoved);\r
+ return true;\r
+ }\r
+ else\r
+ return false;\r
+ } \r
+\r
+ /**\r
+ * Update mapping.\r
+ * \r
+ * Use only if not inside a transaction\r
+ * @return has range been updated\r
+ * @throws DatabaseException\r
+ */\r
+ public boolean update() throws DatabaseException {\r
+ return session.syncRequest(new Read<Boolean>() {\r
+ @Override\r
+ public Boolean perform(ReadGraph graph) throws DatabaseException {\r
+ return update(graph);\r
+ }\r
+ });\r
+ }\r
+ \r
+ /**\r
+ * Fires an update to all result listeners and subscriptions\r
+ * after results have changed\r
+ */\r
+ public void resultChanged() {\r
+ IProject project = Simantics.peekProject();\r
+ IExperimentManager manager = project.getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
+ IExperiment active = manager.getActiveExperiment(); \r
+ if(active != null && active instanceof SysdynExperiment) {\r
+ ((SysdynExperiment)active).resultsChanged();\r
+ }\r
+ \r
+ updateSubscriptions();\r
+ }\r
+\r
+ public void addModificationListener(Runnable listener) {\r
+ synchronized(modificationListeners) {\r
+ modificationListeners.add(listener);\r
+ }\r
+ }\r
+\r
+ public void removeModificationListener(Runnable listener) {\r
+ synchronized(modificationListeners) {\r
+ modificationListeners.remove(listener);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Fires all modification listeners after a change in the domain\r
+ */\r
+ @Override\r
+ public void domainModified() {\r
+ synchronized(modificationListeners) {\r
+ for(Runnable listener : modificationListeners)\r
+ listener.run();\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public void rangeModified() {\r
+ }\r
+\r
+ public Configuration getConfiguration() {\r
+ return configuration;\r
+ }\r
+\r
+ public Resource getConfigurationResource() {\r
+ return configurationResource;\r
+ }\r
+\r
+ public IMapping getMapping() {\r
+ return mapping;\r
+ }\r
+\r
+ public synchronized IElement getElement(Resource resource) {\r
+ return (IElement)mapping.get(resource);\r
+ }\r
+\r
+ public <T> T getService(Class<T> clazz) {\r
+ synchronized(services) {\r
+ return clazz.cast(services.get(clazz));\r
+ }\r
+ }\r
+\r
+ public <T> void addService(Class<T> clazz, T service) {\r
+ synchronized(services) {\r
+ services.put(clazz, service);\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public IExperiment loadExperiment(ReadGraph g, Resource experiment, IExperimentActivationListener listener) {\r
+ // Make sure that configurationResource exists\r
+ if(configurationResource == null && modelResource != null) {\r
+ SimulationResource simu = SimulationResource.getInstance(g);\r
+ try {\r
+ configurationResource = g.getPossibleObject(modelResource, simu.HasConfiguration);\r
+ } catch (ManyObjectsForFunctionalRelationException e) {\r
+ e.printStackTrace();\r
+ } catch (ServiceException e) {\r
+ e.printStackTrace();\r
+ } \r
+ }\r
+\r
+ try {\r
+ // Create a new experiment based on the experiment resource type\r
+ SysdynResource sr = SysdynResource.getInstance(g);\r
+ SysdynExperiment exp;\r
+ \r
+ if(g.isInstanceOf(experiment, sr.PlaybackExperiment)) {\r
+ exp = new SysdynPlaybackExperiment(experiment, modelResource);\r
+ } else if(g.isInstanceOf(experiment, sr.GameExperiment)) {\r
+ if (SolverType.INTERNAL.equals(SolverSettings.getSelectedSolverType())) {\r
+ exp = new SysdynGameExperimentInternal(experiment, modelResource);\r
+ }\r
+ else {\r
+ exp = new SysdynGameExperiment(experiment, modelResource);\r
+ }\r
+ } else if(g.isInstanceOf(experiment, sr.SensitivityAnalysisExperiment)) {\r
+ exp = new SysdynSensitivityAnalysisExperiment(experiment, modelResource);\r
+ } else if(g.isInstanceOf(experiment, sr.BasicExperiment)) {\r
+ // TODO: this is a temporary hack to make sure at least one \r
+ // working implementation is available even if the new solver \r
+ // architecture is completely broken\r
+ if (SolverType.INTERNAL.equals(SolverSettings.getSelectedSolverType())) {\r
+ exp = new SysdynExperiment(experiment, modelResource);\r
+ }\r
+ else {\r
+ exp = new OldSysdynExperiment(experiment, modelResource);\r
+ }\r
+ } else {\r
+ return null;\r
+ }\r
+ \r
+ // TODO: should maybe get the model from model manager?\r
+ \r
+ exp.init(g);\r
+ \r
+ VirtualGraphSupport support = g.getSession().getService(VirtualGraphSupport.class);\r
+ ExperimentRuns.createRun(g.getSession(), support.getWorkspacePersistent("experiments"), experiment, exp, SysdynResource.URIs.Experiment_Run, listener, null);\r
+ if(listener != null)\r
+ listener.onExperimentActivated(exp);\r
+ return exp;\r
+ } catch(Exception e) {\r
+ if(listener != null)\r
+ listener.onFailure(e);\r
+ return null;\r
+ }\r
+ }\r
+\r
+\r
+ /**\r
+ * Get active results. To update the active results, use getAndUpdateActiveResults()\r
+ * \r
+ * @param graph ReadGraph\r
+ * @return all active SysdynResults (last update with getAndUpdateActiveResults())\r
+ */\r
+ public Collection<SysdynResult> getDisplayedResults() {\r
+ // TODO: displayedResults are always empty?\r
+ if(displayedResults == null)\r
+ return new ArrayList<SysdynResult>();\r
+ else\r
+ return displayedResults;\r
+ }\r
+\r
+ /**\r
+ * Get all parameters for Configuration\r
+ * \r
+ * @param configuration Configuration\r
+ * @param prefix String prefix of configuration in this model (Module1.Module2...)\r
+ * @return\r
+ */\r
+ public HashMap<String, String> getInits(Configuration configuration, String prefix) {\r
+ HashMap<String, String> inits = new HashMap<String, String>();\r
+ for (IElement element : configuration.getElements()) {\r
+ if (element instanceof Module) {\r
+ Module module = (Module) element;\r
+ Configuration conf = module.getType().getConfiguration();\r
+ String prfx = prefix + module.getModelicaName() + ".";\r
+ inits.putAll(getInits(conf, prfx));\r
+ for(ParameterOverride po : module.getParameterOverrides()) {\r
+ inits.put(prfx + po.getVariable().getName(), po.getExpression());\r
+ }\r
+ } else if (element instanceof IndependentVariable) {\r
+ IndependentVariable variable = (IndependentVariable) element;\r
+ //FIXME: more general solution for finding out if the variable is a parameter\r
+ if(variable != null && variable.getExpressions() != null && variable.getExpressions().get(0) != null) {\r
+ IExpression expression = variable.getExpressions().get(0);\r
+ if (expression instanceof ParameterExpression) {\r
+ Double value = ((ParameterExpression)expression).getValue();\r
+ if(value != null)\r
+ inits.put(prefix + variable.getName(), "" + value);\r
+ }\r
+ }\r
+ } else if(element instanceof Sheet) {\r
+ Sheet sheet = (Sheet) element;\r
+ for(String cell : sheet.getCells().keySet()) {\r
+ inits.put(sheet.getName() + "." + cell, sheet.getCells().get(cell).toString());\r
+ }\r
+ }\r
+ }\r
+ return inits;\r
+ }\r
+\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Copy from AprosExperiment\r
+ * @param subscription\r
+ */\r
+ @Override\r
+ public void addVariableValueSubscription(VariableValueSubscription subscription) {\r
+ assert subscription != null;\r
+ synchronized (variableValueSubscriptions) {\r
+ variableValueSubscriptions.add(subscription);\r
+ variableValueSubscriptionsSnapshot = null;\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Copy from AprosExperiment\r
+ * @param subscription\r
+ */\r
+ @Override\r
+ public void removeVariableValueSubscription(VariableValueSubscription subscription) {\r
+ assert subscription != null;\r
+ synchronized (variableValueSubscriptions) {\r
+ variableValueSubscriptions.remove(subscription);\r
+ variableValueSubscriptionsSnapshot = null;\r
+ }\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Copy from AprosExperiment\r
+ * @return\r
+ */\r
+ @Override\r
+ public VariableValueSubscription[] getListenerSnapshot() {\r
+ VariableValueSubscription[] snapshot = variableValueSubscriptionsSnapshot;\r
+ if (snapshot == null) {\r
+ synchronized (variableValueSubscriptions) {\r
+ snapshot = variableValueSubscriptionsSnapshot;\r
+ if (snapshot == null) {\r
+ snapshot = variableValueSubscriptionsSnapshot = variableValueSubscriptions.toArray(new VariableValueSubscription[variableValueSubscriptions.size()]);\r
+ }\r
+ }\r
+ }\r
+ return snapshot;\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ /**\r
+ * Modified copy from AporsExperiment\r
+ */\r
+ @Override\r
+ public void updateSubscriptions() {\r
+ VariableValueSubscription[] snapShot = getListenerSnapshot();\r
+ for(VariableValueSubscription subscription : snapShot)\r
+ subscription.update();\r
+ }\r
+ \r
+ \r
+ public boolean isStructureModified() {\r
+ return structureModified;\r
+ }\r
+\r
+ public void setStructureModified(boolean structureModified) {\r
+ this.structureModified = structureModified;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.util.WeakHashMap;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+/**\r
+ * Manages system dynamic models.\r
+ * @author Hannu Niemistö\r
+ */\r
+public class SysdynModelManager {\r
+ WeakHashMap<Resource, SysdynModel> models =\r
+ new WeakHashMap<Resource, SysdynModel>(); // FIXME: Resources are weak, there is no guarantee that model exists in this map as long as needed.\r
+ // HashTable with a disposal procedure could be better solution..\r
+ Session session;\r
+\r
+ public SysdynModelManager(Session session) {\r
+ this.session = session;\r
+ }\r
+\r
+ /**\r
+ * Use only if not inside a transaction\r
+ */\r
+ public SysdynModel getModel(final Resource resource) {\r
+ synchronized(models) {\r
+ SysdynModel model = models.get(resource);\r
+ if(model == null) {\r
+ try {\r
+ session.syncRequest(new ReadRequest() {\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ SysdynModel model = new SysdynModel(graph, resource);\r
+ models.put(resource, model);\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+ model = models.get(resource);\r
+ }\r
+ return model;\r
+ }\r
+ }\r
+ \r
+ /**\r
+ * Should be used if called inside a transaction\r
+ */\r
+ public SysdynModel getModel(ReadGraph g, Resource resource) {\r
+ synchronized(models) {\r
+ SysdynModel model = models.get(resource);\r
+ if(model == null) {\r
+ model = new SysdynModel(g, resource);\r
+ models.put(resource, model);\r
+ }\r
+ return model;\r
+ }\r
+ }\r
+\r
+ public synchronized static SysdynModelManager getInstance(Session session) {\r
+ SysdynModelManager manager =\r
+ session.peekService(SysdynModelManager.class);\r
+ if(manager == null) {\r
+ manager = new SysdynModelManager(session);\r
+ session.registerService(SysdynModelManager.class, manager);\r
+ }\r
+ return manager;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.concurrent.Executors;\r
+import java.util.concurrent.ScheduledExecutorService;\r
+import java.util.concurrent.ScheduledFuture;\r
+import java.util.concurrent.TimeUnit;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.Simantics;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.simulation.experiment.ExperimentState;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class SysdynPlaybackExperiment extends OldSysdynExperiment {\r
+\r
+ public static long DURATION_SLOW = 20000;\r
+ public static long DURATION_NORMAL = 10000;\r
+ public static long DURATION_FAST = 5000;\r
+\r
+ double time, startTime, endTime;\r
+ public static final long VARIABLE_UPDATE_INTERVAL = 500000000;\r
+ private static final double UPDATES_PER_TIME_UNIT = 0.015;\r
+ private long playbackDuration = DURATION_NORMAL;\r
+ private Collection<Runnable> timeListeners = new ArrayList<Runnable>();\r
+\r
+ ScheduledExecutorService playbackExecutionService;\r
+ PlaybackConfiguration playbackConfiguration;\r
+\r
+ public SysdynPlaybackExperiment(Resource experiment, Resource model) {\r
+ super(experiment, model);\r
+ this.time = 0;\r
+ }\r
+\r
+\r
+ /**\r
+ * Interrupts a possible ongoing playback\r
+ * \r
+ * @param time\r
+ */\r
+ public void setTimeInterrupting(double time) {\r
+ stopPlayback();\r
+ setTime(time);\r
+ }\r
+\r
+ /**\r
+ * Sets a new time and continues playback from that point if \r
+ * playback was running \r
+ * @param time\r
+ */\r
+ public void setTimeAndContinue(double time) {\r
+ if(isPlaybackRunning()) {\r
+ stopPlayback();\r
+ setTime(time);\r
+ startPlayback(500);\r
+ } else {\r
+ setTime(time);\r
+ }\r
+ }\r
+\r
+ private void setTime(double time) {\r
+ this.time = time;\r
+ resultsChanged(); \r
+ }\r
+\r
+ public double getTime() {\r
+ return this.time;\r
+ }\r
+\r
+ public double getStartTime() {\r
+ return this.startTime;\r
+ }\r
+\r
+ public double getEndTime() {\r
+ return this.endTime;\r
+ }\r
+\r
+ public void setPlaybackDuration(long duration) {\r
+ this.playbackDuration = duration;\r
+ if(isPlaybackRunning()) {\r
+ //Restart playback with different time settings\r
+ startPlayback();\r
+ }\r
+ }\r
+\r
+ public long getPlaybackDuration() {\r
+ return this.playbackDuration;\r
+ }\r
+\r
+ @Override\r
+ public void init(ReadGraph g) {\r
+ this.session = g.getSession();\r
+ session.asyncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ changeState(ExperimentState.RUNNING);\r
+ final Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
+ sysdynModel = SysdynModelManager.getInstance(session).getModel(graph, configuration);\r
+ toggleActivation(graph, true);\r
+ getPlaybackConfiguration(graph);\r
+ startSimulationJob();\r
+ }\r
+ });\r
+ }\r
+\r
+\r
+ // PLAYBACK CONTROLS\r
+ public void startPlayback() {\r
+ startPlayback(0);\r
+ }\r
+ public void startPlayback(long initialDelay) {\r
+ if(isPlaybackRunning()) {\r
+ stopPlayback();\r
+ }\r
+ playbackConfiguration = getPlaybackConfiguration();\r
+ playbackExecutionService = Executors.newScheduledThreadPool(1); \r
+\r
+ if(time >= playbackConfiguration.endTime) {\r
+ setTime(playbackConfiguration.startTime);\r
+ playbackConfiguration = getPlaybackConfiguration();\r
+ }\r
+\r
+ Runnable playbackSimulationTask = new PlaybackSimulationTask(time, playbackConfiguration.simulationStepLength);\r
+\r
+ long delay = (long) (playbackConfiguration.playbackDuration / playbackConfiguration.intervals);\r
+ ScheduledFuture<?> stepper = playbackExecutionService.scheduleWithFixedDelay(\r
+ playbackSimulationTask, initialDelay, delay, TimeUnit.MILLISECONDS\r
+ );\r
+\r
+ Runnable stopSimulationTask = new StopSimulationTask(stepper, playbackConfiguration.endTime);\r
+ playbackExecutionService.schedule(stopSimulationTask, playbackConfiguration.playbackDuration + initialDelay, TimeUnit.MILLISECONDS);\r
+\r
+ changeState(ExperimentState.RUNNING);\r
+ }\r
+\r
+ public boolean isPlaybackRunning() {\r
+ return playbackExecutionService != null && !playbackExecutionService.isShutdown();\r
+ }\r
+\r
+ public void resetPlayback() {\r
+ double startTime = 0.0;\r
+ if(isPlaybackRunning() && playbackConfiguration != null) {\r
+ startTime = playbackConfiguration.startTime;\r
+ } else {\r
+ startTime = getPlaybackConfiguration().startTime;\r
+ }\r
+ setTimeInterrupting(startTime);\r
+ }\r
+\r
+ public void stopPlayback() {\r
+ if(isPlaybackRunning()) {\r
+ playbackExecutionService.shutdownNow();\r
+ playbackExecutionService.shutdown();\r
+ if(playbackConfiguration != null)\r
+ playbackConfiguration = null;\r
+ changeState(ExperimentState.STOPPED);\r
+ }\r
+ }\r
+\r
+\r
+ private class PlaybackSimulationTask implements Runnable {\r
+ private int stepCount;\r
+ private double startTime, stepLength;\r
+\r
+ public PlaybackSimulationTask(double startTime, double stepLength) {\r
+ this.startTime = startTime;\r
+ this.stepLength = stepLength;\r
+ }\r
+\r
+ public void run() {\r
+ ++stepCount;\r
+ setTime(startTime + stepCount * stepLength);\r
+// System.out.println("Playback step at time: " + (startTime + stepCount * stepLength) + " (step: " + stepCount + ")");\r
+ }\r
+ }\r
+\r
+ private class StopSimulationTask implements Runnable {\r
+\r
+ private ScheduledFuture<?> scheduledFuture;\r
+ private double endTime;\r
+\r
+ public StopSimulationTask(ScheduledFuture<?> aSchedFuture, double endTime){\r
+ scheduledFuture = aSchedFuture;\r
+ this.endTime = endTime;\r
+ }\r
+ public void run() {\r
+// System.out.println("Stopping playback");\r
+ scheduledFuture.cancel(false);\r
+ stopPlayback();\r
+ setTime(endTime);\r
+ }\r
+\r
+ }\r
+\r
+ private PlaybackConfiguration getPlaybackConfiguration() {\r
+ PlaybackConfiguration config = null;\r
+ try {\r
+ config = Simantics.getSession().syncRequest(new Read<PlaybackConfiguration>() {\r
+\r
+ @Override\r
+ public PlaybackConfiguration perform(ReadGraph graph) throws DatabaseException {\r
+ return getPlaybackConfiguration(graph);\r
+ }\r
+\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ return config;\r
+ }\r
+ private PlaybackConfiguration getPlaybackConfiguration(ReadGraph graph) throws DatabaseException {\r
+ Double[] numbers = new Double[3];\r
+ Resource model = getModel();\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ numbers[0] = graph.getRelatedValue(model, sr.SysdynModel_startTime);\r
+ numbers[1] = graph.getRelatedValue(model, sr.SysdynModel_stopTime);\r
+\r
+ PlaybackConfiguration config = new PlaybackConfiguration();\r
+ config.simulationDuration = numbers[1] - numbers[0] - time;\r
+ config.playbackDuration = (long) (config.simulationDuration / (config.simulationDuration + time) * playbackDuration);\r
+ config.intervals = config.playbackDuration * UPDATES_PER_TIME_UNIT;\r
+ config.simulationStepLength = config.simulationDuration / config.intervals;\r
+ config.endTime = numbers[1];\r
+ config.startTime = numbers[0];\r
+\r
+ this.startTime = config.startTime;\r
+ this.endTime = config.endTime;\r
+ return config;\r
+ }\r
+\r
+ private class PlaybackConfiguration {\r
+ public double simulationDuration, simulationStepLength, intervals, endTime, startTime;\r
+ public long playbackDuration;\r
+ }\r
+\r
+ protected void localStateChange() {\r
+ super.localStateChange();\r
+\r
+ ExperimentState state = getState();\r
+ if(ExperimentState.DISPOSED.equals(state)) {\r
+ stopPlayback();\r
+ }\r
+ }\r
+\r
+ // TIME LISTENERS\r
+ public void addTimeListener(Runnable timeListener) {\r
+ if(!this.timeListeners.contains(timeListener))\r
+ this.timeListeners.add(timeListener);\r
+ }\r
+\r
+ public Collection<Runnable> getTimeListeners() {\r
+ return this.timeListeners;\r
+ }\r
+\r
+ public void removeTimeListener(Runnable timeListener) {\r
+ this.timeListeners.remove(timeListener);\r
+ }\r
+\r
+ @Override\r
+ public void resultsChanged() {\r
+ for(Runnable listener : timeListeners) {\r
+ listener.run();\r
+ }\r
+ super.resultsChanged();\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ * Semantum Oy - Bug #4180\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+\r
+import java.io.File;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+\r
+/**\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public abstract class SysdynResult {\r
+\r
+ private String resultName;\r
+\r
+ public SysdynResult(String resultName) {\r
+ this.resultName = resultName;\r
+ }\r
+\r
+ public String getResultName() {\r
+ return this.resultName;\r
+ }\r
+\r
+ public abstract SysdynDataSet getDataSet(String variable);\r
+\r
+ public abstract void saveToFile(File file, IProgressMonitor progressMonitor);\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.manager;\r
+\r
+import java.io.File;\r
+import java.io.FileNotFoundException;\r
+import java.io.IOException;\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.modelica.IModelicaMonitor;\r
+import org.simantics.modelica.ModelicaKeys;\r
+import org.simantics.modelica.ModelicaManager;\r
+import org.simantics.modelica.SimulationLocation;\r
+import org.simantics.modelica.data.CSVSimulationResult;\r
+import org.simantics.modelica.data.MatSimulationResult;\r
+import org.simantics.modelica.data.SimulationResult;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.adapter.SensitivityExperimentParameter;\r
+import org.simantics.sysdyn.adapter.generator.IGenerator;\r
+\r
+/**\r
+ * Sensitivity analysis experiment\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class SysdynSensitivityAnalysisExperiment extends OldSysdynExperiment {\r
+\r
+ private ArrayList<MemoryResult> results = null;\r
+ private int numberOfRuns = 0;\r
+ private IGenerator valueGenerator = null;\r
+ \r
+ public SysdynSensitivityAnalysisExperiment(Resource experiment, Resource model) {\r
+ super(experiment, model);\r
+ }\r
+ \r
+ private void findValuesAndRun(List<SensitivityExperimentParameter> parameters, HashMap<String, String> values, HashMap<String, String> experimentParameters) {\r
+ ArrayList<HashMap<String, String>> parameterMaps = new ArrayList<HashMap<String, String>>();\r
+ int parametersSize = parameters.size();\r
+\r
+ // Get method and number of runs\r
+ try {\r
+ session.syncRequest(new WriteRequest() {\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ numberOfRuns = graph.getPossibleRelatedValue(experiment, SR.SensitivityAnalysisExperiment_numberOfValues, Bindings.INTEGER);\r
+ Resource methodResource = graph.getPossibleObject(experiment, SR.SensitivityAnalysisExperiment_method);\r
+ if (methodResource == null) {\r
+ methodResource = GraphUtils.create2(graph, SR.RandomGenerator);\r
+ graph.claim(experiment, SR.SensitivityAnalysisExperiment_method, methodResource);\r
+ }\r
+ valueGenerator = graph.adapt(methodResource, IGenerator.class);\r
+ }\r
+\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+ // Refresh rate for charts\r
+ refreshRate = numberOfRuns / 20 + 1;\r
+ \r
+ // Initialize the random generator\r
+ valueGenerator.initialize();\r
+ \r
+ // Determine the changed parameters and their values for each individual run\r
+ for (int i = 0; i < numberOfRuns; ++i) {\r
+ List<Double> randoms = valueGenerator.next();// multi-dimensional random\r
+ HashMap<String, String> parameterMap = new HashMap<String, String>(parametersSize);\r
+ for (int j = 0; j < parametersSize; ++j) {\r
+ SensitivityExperimentParameter p = parameters.get(j);\r
+ // Get the random value\r
+ double value = p.getDistribution().inverseCDF(randoms.get(j));\r
+ // Add the new parameter-value-pair \r
+ parameterMap.put(p.getFullModelicaName(), Double.toString(value));\r
+ }\r
+ // Add the complete list of one individual run parameter-value-pairs.\r
+ parameterMaps.add(parameterMap);\r
+ }\r
+ \r
+ // Set the parameters for each individual experiment and run them.\r
+ for (HashMap<String, String> parameterSet : parameterMaps) {\r
+ values.putAll(parameterSet);\r
+ runSensitivityRun(values, experimentParameters);\r
+ }\r
+ }\r
+ \r
+ private void runSensitivityRun(HashMap<String, String> values, HashMap<String, String> experimentParameters) {\r
+ int indexOfDot = simulationLocation.resultFile.toString().lastIndexOf('.');\r
+ if (indexOfDot > 1) {\r
+ String resFile = simulationLocation.resultFile.toString();\r
+ String newResFile = resFile.substring(0, indexOfDot) + currentRun + resFile.substring(indexOfDot);\r
+ experimentParameters.put(ModelicaManager.RESULT_FILE_NAME, newResFile);\r
+ } \r
+ // Simulate the model for one parameter set\r
+ progressMonitor.subTask("Simulation iteration " + (currentRun+1) + "/" + numberOfRuns);\r
+\r
+ \r
+ try {\r
+ process = ModelicaManager.runModelica(\r
+ simulationLocation,\r
+ monitor,\r
+ experimentParameters, \r
+ values\r
+ );\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ ModelicaManager.printProcessOutput(process, monitor);\r
+\r
+ File resFile = new File(experimentParameters.get(ModelicaManager.RESULT_FILE_NAME));\r
+ boolean updateMonitors = currentRun % refreshRate == 0 || currentRun == numberOfRuns - 1;\r
+ Thread resultThread = getResultThread(resFile, experimentParameters, monitor, progressMonitor, updateMonitors, currentRun);\r
+ resultThread.run();\r
+\r
+ process = null;\r
+ \r
+ progressMonitor.worked(1);\r
+ currentRun++;\r
+\r
+ }\r
+ \r
+ private SimulationLocation simulationLocation;\r
+ private IModelicaMonitor monitor;\r
+ private IProgressMonitor progressMonitor;\r
+// private HashMap<String, String> experimentParameters;\r
+ private int currentRun = 0;\r
+ private int refreshRate = 1;\r
+ private List<SensitivityExperimentParameter> parameters = new ArrayList<SensitivityExperimentParameter>();\r
+ \r
+ @Override\r
+ protected void runModelica(SimulationLocation simulationLocation, IModelicaMonitor monitor, IProgressMonitor progressMonitor, HashMap<String, String> experimentParameters, HashMap<String, String> changes) throws IOException {\r
+ results = null;\r
+ \r
+ this.simulationLocation = simulationLocation;\r
+ this.monitor = monitor;\r
+ this.progressMonitor = progressMonitor;\r
+ \r
+ if (changes == null) {\r
+ changes = new HashMap<String, String>();\r
+ }\r
+ \r
+ String version = ModelicaManager.getOMVersion(simulationLocation.omHome);\r
+ experimentParameters.put(ModelicaManager.OMC_VERSION, version);\r
+ \r
+ \r
+ loadConfiguration();\r
+ \r
+ currentRun = 0;\r
+ \r
+ \r
+ findValuesAndRun(parameters, changes, experimentParameters);\r
+ }\r
+\r
+ private void loadConfiguration(){\r
+ try {\r
+ session.syncRequest(new ReadRequest() {\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ \r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ \r
+ Integer rRate = graph.getPossibleRelatedValue(experiment, SR.SensitivityAnalysisExperiment_resultRefreshRate, Bindings.INTEGER);\r
+ if(rRate != null)\r
+ refreshRate = rRate;\r
+ \r
+ Resource parameterListResource = graph.getPossibleObject(experiment, SR.SensitivityAnalysisExperiment_parameterList);\r
+ List<Resource> parameterResources = ListUtils.toList(graph, parameterListResource);\r
+ \r
+ if(parameters != null) {\r
+ parameters.clear();\r
+ for(Resource p : parameterResources) {\r
+ SensitivityExperimentParameter parameter = graph.adapt(p, SensitivityExperimentParameter.class);\r
+ if (parameter.getFullName() != null)\r
+ parameters.add(parameter);\r
+ }\r
+ }\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ \r
+ /**\r
+ * Get a thread for reading and saving reuslts from a normal simulation\r
+ * @param simulationLocation\r
+ * @param inits\r
+ * @param monitor\r
+ * @param progressMonitor\r
+ * @param currentRun\r
+ * @return\r
+ */\r
+ protected Thread getResultThread(final File resFile, \r
+ final HashMap<String, String> experimentParameters, \r
+ final IModelicaMonitor monitor, \r
+ final IProgressMonitor progressMonitor,\r
+ final boolean updateMonitors,\r
+ final int currentRun) {\r
+ return new Thread() {\r
+ @Override\r
+ public void run() {\r
+ try {\r
+ process.waitFor();\r
+\r
+ if(!canceled) {\r
+ // Get and store results\r
+ SimulationResult result;\r
+ if(resFile.getName().endsWith(".csv"))\r
+ result = new CSVSimulationResult();\r
+ else if(resFile.getName().endsWith(".plt"))\r
+ result = new SimulationResult();\r
+ else\r
+ result = new MatSimulationResult(); // The latest format\r
+\r
+ // The interval of results saved. Every result? Every other result? etc...\r
+ int outIntervalInt = 1;\r
+ String outputInterval = experimentParameters.get(ModelicaKeys.OUTPUT_INTERVAL);\r
+ if(outputInterval != null) {\r
+ String stepTime = experimentParameters.get(ModelicaKeys.STEP_VALUE);\r
+ String stopTime = experimentParameters.get(ModelicaKeys.STOP_VALUE);\r
+ \r
+ Double step = Double.parseDouble(stepTime);\r
+ Double stop = Double.parseDouble(stopTime);\r
+ Double outInterval = Double.parseDouble(outputInterval);\r
+\r
+ outIntervalInt = (int)getInterval(outInterval, step);\r
+ // Actually you might be able to use an outInterval one or two longer. \r
+ int maxIntervalInt = (int)Math.round(stop / step);\r
+ if (outIntervalInt > maxIntervalInt)\r
+ outIntervalInt = maxIntervalInt;\r
+ }\r
+\r
+ result.initRead(resFile);\r
+ result.readTime(resFile, outIntervalInt);\r
+ //result.readInits(simulationLocation.initFile); // Parameter values are read from .mat\r
+ result.filter();\r
+ \r
+ MemoryResult currentResult = new MemoryResult(null, null);\r
+ getCurrentResults().add(currentResult);\r
+ currentResult.setResult(result);\r
+ currentResult.setResultFile(resFile);\r
+ currentResult.setResultIndex(currentRun);\r
+ \r
+ if(updateMonitors)\r
+ resultsChanged();\r
+\r
+ simulate(false);\r
+\r
+ String errorString = result.getResultReadErrors();\r
+ if(errorString != null && !errorString.isEmpty())\r
+ monitor.message(errorString);\r
+ }\r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ } catch (InterruptedException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ };\r
+ }\r
+ \r
+ public ArrayList<MemoryResult> getCurrentResults() {\r
+ if(this.results == null) {\r
+ this.results = new ArrayList<MemoryResult>();\r
+ }\r
+ return this.results;\r
+ }\r
+ \r
+ @Override\r
+ public Collection<SysdynResult> getActiveResults() {\r
+ ArrayList<SysdynResult> result = new ArrayList<SysdynResult>();\r
+ result.addAll(getCurrentResults());\r
+ result.addAll(sysdynModel.getDisplayedResults());\r
+ return result;\r
+ }\r
+ \r
+ @Override\r
+ public MemoryResult getCurrentResult() {\r
+ if (this.results == null || this.results.size() < 1)\r
+ return null;\r
+ /* There should be a better alternative solution for this. Currently\r
+ * the return value is next to nonsense.\r
+ */\r
+ return this.results.get(0);\r
+ }\r
+ \r
+ @Override\r
+ public void resultsChanged() {\r
+ long time = System.nanoTime();\r
+ updateSubscriptions();\r
+ previousVariableUpdateTime = time;\r
+ }\r
+ \r
+ @Override\r
+ public void saveState() {\r
+ if(results == null || !(results instanceof ArrayList<?>)) \r
+ return;\r
+ SaveResultSetJob saveResultSetJob = new SaveResultSetJob((OldSysdynExperiment)this, session, results);\r
+ saveResultSetJob.schedule();\r
+ }\r
+ \r
+ @Override\r
+ public int numberOfSimulationRunSteps() {\r
+ try {\r
+ Integer numberOfIterations = session.syncRequest(new Read<Integer>() {\r
+ @Override\r
+ public Integer perform(ReadGraph graph) throws DatabaseException {\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ Integer numberOfIterations = graph.getPossibleRelatedValue(experiment, SR.SensitivityAnalysisExperiment_numberOfValues, Bindings.INTEGER);\r
+ \r
+ return numberOfIterations;\r
+ }\r
+ });\r
+ \r
+ if(numberOfIterations == null)\r
+ numberOfIterations = 0;\r
+ \r
+ // 3 steps before sensitivity iterations\r
+ return 3 + numberOfIterations; \r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+ return super.numberOfSimulationRunSteps();\r
+\r
+ }\r
+ \r
+ \r
+ @Override\r
+ public synchronized void simulate(IModelicaMonitor monitor, IProgressMonitor progressMonitor, String modelName) throws IOException {\r
+ \r
+ omcVersion = ModelicaManager.getDefaultOMVersion();\r
+\r
+ // Make sure that omc version is 1.9 or higher. \r
+ // Builtin version during this change is 1.9 beta 4\r
+ if(omcVersion != null) {\r
+ try {\r
+ double v = Double.parseDouble(omcVersion.substring(0, 3));\r
+ if(v < 1.9) {\r
+ monitor.message("Error: Sensitivity analysis requires OMC version >= 1.9 \n" +\r
+ "Current version is " + omcVersion +"\n" +\r
+ "Change version from Window->Preferences->Modelica");\r
+ simulate(false);\r
+ return;\r
+ }\r
+ } catch (NumberFormatException e) {}\r
+ }\r
+ \r
+ super.simulate(monitor, progressMonitor, modelName);\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.manager;\r
+\r
+import org.simantics.sysdyn.adapter.VariableValueSubscription;\r
+\r
+@SuppressWarnings("rawtypes") \r
+public interface VariableSubscriptionManager {\r
+ \r
+ public void addVariableValueSubscription(VariableValueSubscription subscription);\r
+ \r
+ public void removeVariableValueSubscription(VariableValueSubscription subscription);\r
+ \r
+ public VariableValueSubscription[] getListenerSnapshot();\r
+ \r
+ public void updateSubscriptions();\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelExport;\r
+\r
+public class ExportConstants {\r
+\r
+ public static final String MODEL_FILE_EXTENSION = ".sysdyn";\r
+ public static final String CURRENT_MODEL_EXPORT_FORMAT = ".sysdyn";\r
+ public static final int CURRENT_MODEL_EXPORT_VERSION = 1;\r
+ //public static final int SMALLEST_MIGRATED_MODEL_EXPORT_VERSION = 0;\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelExport;\r
+\r
+import gnu.trove.map.hash.THashMap;\r
+\r
+import java.io.File;\r
+import java.lang.reflect.InvocationTargetException;\r
+import java.text.DateFormat;\r
+import java.util.Date;\r
+import java.util.LinkedList;\r
+import java.util.Map;\r
+import java.util.Set;\r
+import java.util.TreeMap;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.SubMonitor;\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.common.request.UniqueRead;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.adapter.CopyHandler;\r
+import org.simantics.db.layer0.util.ClipboardUtils;\r
+import org.simantics.db.layer0.util.ModelDependenciesBean;\r
+import org.simantics.db.layer0.util.ModelDependency;\r
+import org.simantics.db.layer0.util.ModelTransferableGraphSource;\r
+import org.simantics.db.layer0.util.ModelTransferableGraphSourceRequest;\r
+import org.simantics.db.layer0.util.SimanticsClipboard.Representation;\r
+import org.simantics.db.layer0.util.SimanticsClipboardImpl;\r
+import org.simantics.db.layer0.util.SimanticsKeys;\r
+import org.simantics.db.layer0.util.TransferableGraphConfiguration2;\r
+import org.simantics.graph.db.TransferableGraphs;\r
+import org.simantics.graph.representation.TransferableGraph1;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.modeling.ModelingResources;\r
+\r
+public class SysdynModelExporter {\r
+\r
+ private SysdynModelExporter() {\r
+ }\r
+ \r
+ \r
+ public static void exportModel(IProgressMonitor monitor, final Resource model, File exportLocation, String description, boolean dependencies) throws InvocationTargetException {\r
+ try {\r
+ final SubMonitor mon = SubMonitor.convert(monitor, 100);\r
+ mon.beginTask("Exporting Sysdyn Model...", 100);\r
+ final Map<String, Variant> tgExtensions = new THashMap<String, Variant>();\r
+ Session session = Simantics.getSession();\r
+ if (dependencies) {\r
+ session.syncRequest(new ReadRequest() {\r
+ \r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ mon.setTaskName("Scanning model dependencies..");\r
+ mon.worked(10);\r
+ LinkedList<ModelDependency> modelDependencies = new LinkedList<ModelDependency>();\r
+ scanDependencies(graph, model, modelDependencies);\r
+ if (!modelDependencies.isEmpty())\r
+ tgExtensions.put(ModelDependenciesBean.EXTENSION_KEY, new Variant(ModelDependenciesBean.BINDING, new ModelDependenciesBean(modelDependencies.toArray(new ModelDependency[modelDependencies.size()]))));\r
+ }\r
+\r
+ private void scanDependencies(ReadGraph graph, Resource resource, LinkedList<ModelDependency> modelDependencies) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ ModelingResources MOD = ModelingResources.getInstance(graph);\r
+ for(Resource library : graph.syncRequest(new ObjectsWithType(resource, L0.IsLinkedTo, MOD.SharedOntology))) {\r
+ String uri = graph.getPossibleURI(library);\r
+ if(uri == null) continue;\r
+ CopyHandler ch = graph.adapt(library, CopyHandler.class);\r
+ SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();\r
+ ch.copyToClipboard(graph, clipboard);\r
+ for (Set<Representation> object : clipboard.getContents()) {\r
+ TransferableGraph1 tg = ClipboardUtils.accept(graph, object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);\r
+ if(tg != null) modelDependencies.addFirst(new ModelDependency(uri, tg));\r
+ }\r
+ scanDependencies(graph, library, modelDependencies);\r
+ }\r
+ }\r
+ });\r
+ }\r
+ \r
+ mon.setTaskName("Creating transferable graph source...");\r
+ mon.worked(10);\r
+ ModelTransferableGraphSource source = session.sync(new UniqueRead<ModelTransferableGraphSource>() {\r
+ @Override\r
+ public ModelTransferableGraphSource perform(ReadGraph graph) throws DatabaseException {\r
+ mon.worked(10);\r
+ TransferableGraphConfiguration2 conf = new TransferableGraphConfiguration2(graph, model);\r
+ mon.worked(10);\r
+ if (!tgExtensions.isEmpty())\r
+ conf.baseExtensions.putAll(tgExtensions);\r
+ mon.worked(10);\r
+ return new ModelTransferableGraphSourceRequest(conf).perform(graph);\r
+ }\r
+ });\r
+ \r
+ mon.worked(10);\r
+ mon.setTaskName("Writing metadata...");\r
+ TreeMap<String,Variant> metadata = getModelExportMetadata(description);\r
+ mon.worked(10);\r
+ mon.setTaskName("Writing transferable graph...");\r
+ \r
+ try {\r
+ TransferableGraphs.writeTransferableGraph(session, \r
+ ExportConstants.CURRENT_MODEL_EXPORT_FORMAT, ExportConstants.CURRENT_MODEL_EXPORT_VERSION, metadata, source, exportLocation);\r
+ mon.worked(20);\r
+ source.closeStreams();\r
+ } catch (Exception e) {\r
+ throw new InvocationTargetException(e);\r
+ }\r
+\r
+ for(File f : source.getFiles())\r
+ f.delete();\r
+ \r
+ mon.worked(10);\r
+ mon.setTaskName("Done!");\r
+ } catch (DatabaseException e) {\r
+ throw new InvocationTargetException(e);\r
+ }\r
+ }\r
+\r
+\r
+ private static TreeMap<String, Variant> getModelExportMetadata(String description) {\r
+ TreeMap<String,Variant> metadata = new TreeMap<String,Variant>();\r
+ metadata.put("date", Variant.ofInstance(DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date())));\r
+ metadata.put("author", Variant.ofInstance(System.getProperty("user.name", "")));\r
+ metadata.put("description", Variant.ofInstance(description));\r
+ \r
+ return metadata;\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport;\r
+\r
+import java.io.File;\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import javax.xml.bind.JAXBContext;\r
+import javax.xml.bind.JAXBElement;\r
+\r
+import org.simantics.sysdyn.modelImport.bpmn.BPMNDiagram;\r
+import org.simantics.sysdyn.modelImport.bpmn.TDefinitions;\r
+import org.simantics.sysdyn.modelImport.bpmn.TEndEvent;\r
+import org.simantics.sysdyn.modelImport.bpmn.TEvent;\r
+import org.simantics.sysdyn.modelImport.bpmn.TFlowElement;\r
+import org.simantics.sysdyn.modelImport.bpmn.TGateway;\r
+import org.simantics.sysdyn.modelImport.bpmn.TProcess;\r
+import org.simantics.sysdyn.modelImport.bpmn.TSequenceFlow;\r
+import org.simantics.sysdyn.modelImport.bpmn.TStartEvent;\r
+import org.simantics.sysdyn.modelImport.bpmn.TTask;\r
+import org.simantics.sysdyn.modelImport.model.Cloud;\r
+import org.simantics.sysdyn.modelImport.model.Connection;\r
+import org.simantics.sysdyn.modelImport.model.Flow;\r
+import org.simantics.sysdyn.modelImport.model.Model;\r
+import org.simantics.sysdyn.modelImport.model.Stock;\r
+import org.simantics.sysdyn.modelImport.model.Symbol;\r
+import org.simantics.sysdyn.modelImport.model.Valve;\r
+import org.simantics.sysdyn.modelImport.model.Valve.Orientation;\r
+import org.simantics.sysdyn.modelImport.model.Valve.TextPosition;\r
+\r
+public class BPMNParser implements IModelParser {\r
+ \r
+ private static final double[] DEF_DIM = { 1, 1, 0, 0 };\r
+\r
+ @Override\r
+ public Model parse(File file) throws Exception {\r
+ Map<Object, Symbol> symbols = new HashMap<Object, Symbol>();\r
+ Map<Object, Connection> connections = new HashMap<Object, Connection>();\r
+ \r
+ Model model = new Model("BPMN prototype");\r
+ \r
+ JAXBContext context = JAXBContext.newInstance("org.simantics.sysdyn.modelImport.bpmn");\r
+ JAXBElement<?> parent = (JAXBElement<?>)context.createUnmarshaller().unmarshal(file);\r
+ \r
+ TDefinitions definitions = (TDefinitions)parent.getValue();\r
+ \r
+ // TODO: can there be more than one process and/or diagram?\r
+ \r
+ TProcess process = (TProcess)definitions.getRootElement().iterator().next().getValue();\r
+ \r
+ System.err.println("process "+process.getId());\r
+ \r
+ for (int i = 0; i < process.getFlowElement().size(); i++) {\r
+ TFlowElement element = (TFlowElement)process.getFlowElement().get(i).getValue();\r
+ // start and end events should be clouds\r
+ if (element instanceof TStartEvent || element instanceof TEndEvent) {\r
+ System.err.println("start or end event");\r
+ TEvent event = (TEvent)element;\r
+ \r
+ Cloud cloud = new Cloud(DEF_DIM);\r
+ symbols.put(event, cloud);\r
+ model.addSymbol(cloud);\r
+ }\r
+ else if (element instanceof TEvent) {\r
+ System.err.println("events other than start or end events are nod handled");\r
+ }\r
+ else if (element instanceof TGateway) {\r
+ System.err.println("gateway");\r
+ }\r
+ else if (element instanceof TTask) {\r
+ System.err.println("task");\r
+ TTask task = (TTask)element;\r
+ \r
+ Stock stock = new Stock(DEF_DIM, task.getName(), null, null, null, null);\r
+ symbols.put(task, stock);\r
+ model.addVariable(stock);\r
+ }\r
+ else if (element instanceof TSequenceFlow) {\r
+ System.err.println("sequence");\r
+ TSequenceFlow sequence = (TSequenceFlow)element;\r
+ \r
+ Symbol tail = symbols.get(sequence.getSourceRef());\r
+ Symbol head = symbols.get(sequence.getTargetRef());\r
+ \r
+ String name = sequence.getName();\r
+ \r
+ Valve valve = new Valve(DEF_DIM, sequence.getId(), null, null, null, null, Orientation.HORIZONTAL, TextPosition.UNSET);\r
+ \r
+ Flow first = new Flow(tail, valve);\r
+ Flow second = new Flow(valve, head);\r
+ \r
+ model.addVariable(valve);\r
+ model.addConnection(first);\r
+ model.addConnection(second);\r
+ }\r
+ else {\r
+ System.err.println("element type "+element.getClass()+" not handled");\r
+ }\r
+ }\r
+ \r
+ BPMNDiagram diagram = (BPMNDiagram)definitions.getBPMNDiagram().iterator().next();\r
+ \r
+ return model;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport;\r
+\r
+import java.io.File;\r
+\r
+import org.simantics.sysdyn.modelImport.model.Model;\r
+\r
+public interface IModelParser {\r
+ public Model parse(File file) throws Exception; \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.modelImport;\r
+\r
+import java.io.BufferedReader;\r
+import java.io.File;\r
+import java.io.FileInputStream;\r
+import java.io.InputStreamReader;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.mdl.Declaration;\r
+import org.simantics.sysdyn.modelImport.mdl.Lookup;\r
+import org.simantics.sysdyn.modelImport.mdl.MdlModel;\r
+import org.simantics.sysdyn.modelImport.mdl.MdlVariable;\r
+import org.simantics.sysdyn.modelImport.mdl.Sketch;\r
+import org.simantics.sysdyn.modelImport.mdl.SketchComment;\r
+import org.simantics.sysdyn.modelImport.mdl.SketchConnection;\r
+import org.simantics.sysdyn.modelImport.mdl.SketchObject;\r
+import org.simantics.sysdyn.modelImport.mdl.SketchValve;\r
+import org.simantics.sysdyn.modelImport.mdl.SketchVariable;\r
+import org.simantics.sysdyn.modelImport.mdl.Subscript;\r
+import org.simantics.sysdyn.modelImport.mdl.SubscriptVariable;\r
+import org.simantics.sysdyn.modelImport.model.Comment;\r
+import org.simantics.sysdyn.modelImport.model.Connection;\r
+import org.simantics.sysdyn.modelImport.model.Model;\r
+import org.simantics.sysdyn.modelImport.model.Variable;\r
+import org.simantics.sysdyn.modelImport.model.Shadow;\r
+import org.simantics.sysdyn.modelImport.model.Symbol;\r
+import org.simantics.sysdyn.modelImport.model.Valve;\r
+\r
+public class MdlParser implements IModelParser {\r
+ \r
+ private static final String UTF_8 = "{UTF-8}";\r
+ private static final String SKETCH_VERSION = "V300";\r
+ private static final String SKETCH_START = "\\\\\\---///";\r
+ private static final String SKETCH_END = "///---\\\\\\";\r
+ \r
+ private static final String PARAMETER_START = "INITIAL TIME";\r
+ private static final String PARAMETER_STOP = "FINAL TIME";\r
+ private static final String PARAMETER_STEP = "TIME STEP";\r
+\r
+ @Override\r
+ public Model parse(File file) throws Exception {\r
+ // generate a mdl model based on the contents of the file\r
+ MdlModel mdl = parseFile(file);\r
+ \r
+ // generate a sysdyn model from the mdl model\r
+ Model model = new Model(mdl.getName());\r
+\r
+ // add (necessary) enumerations\r
+ for (Subscript subscript : mdl.getAllSubscripts()) {\r
+ if (!subscript.isEquivalent())\r
+ model.addEnumeration(subscript.getEnumeration());\r
+ }\r
+ \r
+ // add lookup functions\r
+ for (Lookup lookup : mdl.getAllLookups()) {\r
+ model.addFunction(lookup.getFunction());\r
+ }\r
+ \r
+ int offset = 0;\r
+ \r
+ // add sketch labels and independent elements\r
+ for (Sketch sketch : mdl.getSketches()) {\r
+ \r
+ // add the sketch label to the diagram for the sake of clarity\r
+ model.addSymbol(new Comment(\r
+ MdlUtil.getSysdynDimensions(offset, 0, -1, -1), \r
+ "=== VENSIM SKETCH: "+sketch.getName()+" ======>"));\r
+ sketch.setLocation(offset, 20);\r
+ \r
+ for (SketchComment comment : sketch.getComments()) {\r
+ Symbol symbol = comment.getSymbol();\r
+ if (symbol != null) {\r
+ comment.setModelObject(symbol);\r
+ model.addSymbol(symbol);\r
+ }\r
+ }\r
+ \r
+ for (SketchValve valve : sketch.getValves()) {\r
+ Valve symbol = valve.getSymbol();\r
+ if (symbol != null) {\r
+ valve.setModelObject(symbol);\r
+ model.addVariable(symbol);\r
+ }\r
+ }\r
+ \r
+ for (SketchVariable variable : sketch.getNonShadowVariables()) {\r
+ Variable symbol = variable.getSymbol();\r
+ if (symbol != null) {\r
+ variable.setModelObject(symbol);\r
+ model.addVariable(symbol);\r
+ }\r
+ }\r
+ \r
+ offset += sketch.getWidth();\r
+ }\r
+ \r
+ // add dependent elements\r
+ for (Sketch sketch : mdl.getSketches()) {\r
+ for (SketchVariable variable : sketch.getShadowVariables()) {\r
+ Variable original = model.getVariable(variable.getName());\r
+ if (original != null) {\r
+ // create a shadow variable if the original variable exists\r
+ Shadow symbol = new Shadow(variable.getDimensions(), original);\r
+ variable.setModelObject(symbol);\r
+ model.addShadow(symbol);\r
+ }\r
+ else {\r
+ // create a new original variable instead of a shadow variable if\r
+ // the original variable does not exist\r
+ Variable symbol = variable.getSymbol();\r
+ if (symbol != null) {\r
+ variable.setModelObject(symbol);\r
+ model.addVariable(symbol);\r
+ }\r
+ }\r
+ }\r
+\r
+ for (SketchConnection connection : sketch.getConnections()) {\r
+ Connection conn = connection.getConnection();\r
+ if (conn != null) {\r
+ connection.setModelObject(conn);\r
+ model.addConnection(conn);\r
+ }\r
+ }\r
+ }\r
+ \r
+ // Set simulation parameters\r
+ MdlVariable start = mdl.getVariable(PARAMETER_START);\r
+ if (start != null && Pattern.matches(MdlUtil.DBL, start.getExpressionString()))\r
+ model.setStartTime(Double.parseDouble(start.getExpressionString()));\r
+ \r
+ MdlVariable stop = mdl.getVariable(PARAMETER_STOP);\r
+ if (stop != null && Pattern.matches(MdlUtil.DBL, stop.getExpressionString()))\r
+ model.setStopTime(Double.parseDouble(stop.getExpressionString()));\r
+ \r
+ MdlVariable step = mdl.getVariable(PARAMETER_STEP);\r
+ if (step != null && Pattern.matches(MdlUtil.DBL, step.getExpressionString())) {\r
+ model.setTimeStep(Double.parseDouble(step.getExpressionString()));\r
+ // TODO: for some reason sysdyn only accepts certain time units\r
+ // so this most definitely does not work in all cases\r
+ String unit = step.getUnit();\r
+ if (unit.contains("[")) {\r
+ unit = unit.substring(0, unit.indexOf('[')).trim();\r
+ }\r
+ model.setTimeUnit(unit.toLowerCase());\r
+ }\r
+ \r
+ \r
+ // TODO: unit and result step thingamajig\r
+ \r
+ return model;\r
+ }\r
+ \r
+ private static MdlModel parseFile(File file) throws Exception {\r
+ // strip the file suffix from file name\r
+ String name = file.getName();\r
+ if (file.getName().contains(".")) {\r
+ name = name.substring(0, name.indexOf('.'));\r
+ }\r
+ \r
+ MdlModel mdl = new MdlModel(name);\r
+ \r
+ // peek at the first line to see if we need to use UTF-8\r
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));\r
+ String line = reader.readLine();\r
+\r
+ if (line == null) {\r
+ // file is empty, nothing to do here\r
+ reader.close();\r
+ return null;\r
+ }\r
+\r
+ if (line.startsWith(UTF_8)) {\r
+ reader.close();\r
+ reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));\r
+ // skip the first line\r
+ reader.readLine();\r
+ line = reader.readLine();\r
+ }\r
+\r
+ // START READING VARIABLE DATA\r
+\r
+ // keep track of the current category\r
+ String category = null;\r
+\r
+ do {\r
+ // skip empty lines\r
+ if (line.isEmpty()) \r
+ continue;\r
+\r
+ // combine the (possible) variable declaration into one line \r
+ StringBuilder buffer = new StringBuilder();\r
+ do {\r
+ // strip leading whitespace if present\r
+ line = line.replaceFirst("^\\s*", "");\r
+ // strip trailing '\' if present\r
+ line = line.replaceFirst("\\\\$", "");\r
+ \r
+ buffer.append(line);\r
+ \r
+ // each variable declaration ends with '|'\r
+ if (line.endsWith("|"))\r
+ break;\r
+ } while ((line = reader.readLine()) != null);\r
+ String str = buffer.toString();\r
+\r
+ String cat;\r
+ Declaration decl;\r
+ \r
+ // parse the (possible) variable declaration\r
+ if ((cat = Declaration.parseCategory(str)) != null) {\r
+ category = cat;\r
+ }\r
+ else if ((decl = MdlVariable.getPossible(str, mdl)) != null) {\r
+ mdl.addVariable((MdlVariable)decl, category);\r
+ }\r
+ else if ((decl = SubscriptVariable.getPossible(str, mdl)) != null) {\r
+ mdl.addSubscriptVariable((SubscriptVariable)decl, category);\r
+ }\r
+ else if ((decl = Lookup.getPossible(str, mdl)) != null) {\r
+ mdl.addLookup((Lookup)decl);\r
+ }\r
+ else if ((decl = Subscript.getPossible(str, mdl)) != null) {\r
+ mdl.addSubscript((Subscript)decl);\r
+ }\r
+ else {\r
+ // if we got this far, the variable could not be parsed\r
+ throw new Exception("unrecognized variable "+str);\r
+ }\r
+\r
+ } while ((line = reader.readLine()) != null && !line.startsWith(SKETCH_START));\r
+\r
+ // END READING VARIABLE DATA\r
+\r
+ if (line == null) {\r
+ throw new Exception("unexpected end of file");\r
+ }\r
+\r
+ // START READING SKETCH DATA\r
+\r
+ // keep track of the current sketch\r
+ Sketch sketch = null;\r
+\r
+ do {\r
+ // skip empty lines\r
+ if (line.isEmpty())\r
+ continue;\r
+ \r
+ SketchObject so;\r
+\r
+ if (line.startsWith(SKETCH_START)) {\r
+ sketch = new Sketch(mdl);\r
+ mdl.addSketch(sketch);\r
+ }\r
+ else if (line.startsWith(SKETCH_VERSION)) {\r
+ // version declaration, nothing to do here\r
+ }\r
+ else if (line.startsWith("*")) {\r
+ sketch.setName(line.substring(1));\r
+ }\r
+ else if (line.startsWith("$")) {\r
+ // font declaration, nothing to do here\r
+ }\r
+ else if ((so = SketchConnection.getPossible(line, sketch)) != null) {\r
+ sketch.addConnection((SketchConnection)so);\r
+ }\r
+ else if ((so = SketchVariable.getPossible(line, sketch)) != null) {\r
+ sketch.addVariable((SketchVariable)so);\r
+ }\r
+ else if ((so = SketchValve.getPossible(line, sketch)) != null) {\r
+ SketchValve valve = (SketchValve)so;\r
+ // the next row after a valve should always the variable associated with the valve\r
+ SketchVariable attached = SketchVariable.getPossible(reader.readLine(), sketch);\r
+ if (attached == null || !attached.isAttached()) {\r
+ throw new Exception("attached variable not found for valve");\r
+ }\r
+ valve.setAttached(attached);\r
+ sketch.addValve(valve);\r
+ }\r
+ else if ((so = SketchComment.getPossible(line, sketch)) != null) {\r
+ SketchComment comment = (SketchComment)so;\r
+ if (comment.hasTextLine()) {\r
+ comment.setText(reader.readLine());\r
+ }\r
+ // do not add i/o objects to the sketch currently\r
+ if (!comment.isInputOutput())\r
+ sketch.addComment(comment);\r
+ }\r
+ else {\r
+ // if we got this far, the element could not be parsed\r
+ throw new Exception("unrecognized element "+line);\r
+ }\r
+\r
+ } while ((line = reader.readLine()) != null && !line.startsWith(SKETCH_END));\r
+\r
+ // END READING SKETCH DATA\r
+\r
+ if (line == null) {\r
+ throw new Exception("unexpected end of file");\r
+ }\r
+\r
+ // START READING OTHER DATA\r
+\r
+ do {\r
+ // TODO: is there anything relevant here?\r
+ } while ((line = reader.readLine()) != null);\r
+\r
+ // END READING OTHER DATA\r
+\r
+ reader.close();\r
+ return mdl;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport;\r
+\r
+import java.util.List;\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.mdl.Lookup;\r
+import org.simantics.sysdyn.modelImport.mdl.MdlModel;\r
+\r
+public class MdlUtil {\r
+ \r
+ // multiplier for dimension conversion between vensim and sysdyn\r
+ private static final double SCALE_MULTIPLIER = 0.45;\r
+\r
+ // most of this is based on the documentation of the .mdl file format \r
+ // available in http://www.vensim.com/documentation/24305.htm\r
+\r
+ // some regular expressions that are used commonly in the parser\r
+ public static final String DBL = "[+-]?(?:NaN|Infinity|\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)";\r
+ public static final String DBL_G = "("+DBL+")";\r
+ public static final String INT = "[+-]?\\d+";\r
+ public static final String INT_G = "("+INT+")";\r
+\r
+ // matches a basic vensim name (starts with a letter, may contain any word \r
+ // characters and white space)\r
+ public static final String BASIC_NAME =\r
+ "[A-Za-z]\\w*(?:\\s+\\w+)*";\r
+ // matches a special vensim name (starts and ends with a quotation mark, \r
+ // may contain escaped special characters)\r
+ public static final String SPECIAL_NAME =\r
+ "\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"";\r
+\r
+ // matches a vensim variable (either basic name or special name)\r
+ public static final String VARIABLE =\r
+ "("+BASIC_NAME+"|"+SPECIAL_NAME+")";\r
+ // matches a vensim variable inside an expression (basic name not followed \r
+ // by an open parenthesis or a special name)\r
+ public static final String VARIABLE_EXPRESSION =\r
+ "([A-Za-z](?![\\s\\w]*\\()\\w*(?:\\s+\\w+)*|"+SPECIAL_NAME+")";\r
+ // matches a vensim subscript variable (basic name with a list of indices)\r
+ public static final String SUBSCRIPT =\r
+ "("+BASIC_NAME+")\\[("+BASIC_NAME+"\\!?(?:,"+BASIC_NAME+"\\!?)*)\\]";\r
+ // matches a vensim function (basic name followed by an open parenthesis)\r
+ public static final String FUNCTION =\r
+ "("+BASIC_NAME+")\\s*\\(";\r
+\r
+ public static String normalize(String str) {\r
+ // start by removing all tabs from the string, not really necessary \r
+ // but does make the equation cleaner\r
+ str = str.replaceAll("\t", "");\r
+\r
+ // normalize functions\r
+ str = normalizeFunctions(str);\r
+ // normalize variables\r
+ str = normalizeVariables(str);\r
+\r
+ // replace inline operations\r
+ str = str.replaceAll(":AND:", " and ");\r
+ str = str.replaceAll(":OR:", " or ");\r
+ \r
+ // foo^-bar does not work in Modelica, it needs to be changed to foo^(-bar)\r
+ str = addParenthesesToExponents(str);\r
+ \r
+ // NOTE: something like this must be done to replace Vensim comparison \r
+ // "=" with Modelica comparison "==" but this solution breaks geq and leq\r
+ //str = str.replaceAll("=", "==");\r
+\r
+ return str;\r
+ }\r
+\r
+ private static String normalizeVariables(String expression) {\r
+ StringBuilder result = new StringBuilder();\r
+ int offset = 0;\r
+\r
+ Matcher matcher = Pattern.compile(VARIABLE_EXPRESSION).matcher(expression);\r
+ while (matcher.find()) {\r
+ result.append(expression.substring(offset, matcher.start()));\r
+\r
+ String variable = matcher.group(1);\r
+\r
+ // TODO: fix this after proper support for quoted variable names\r
+ // is implemented\r
+ \r
+ if (variable.equalsIgnoreCase("time")) {\r
+ // replace all references to simulation time with references\r
+ // to the special purpose time variable\r
+ result.append("time");\r
+ }\r
+ else if (variable.startsWith("\"") && variable.endsWith("\"")) {\r
+ // replace double quotes with single quotes in quoted variable\r
+ // names as per modelica syntax (currently useless and might \r
+ // actually break something)\r
+ result.append('\'');\r
+ result.append(variable.substring(1, variable.length() - 1));\r
+ result.append('\'');\r
+ }\r
+ else {\r
+ // in all other cases, manipulate variable names slightly to \r
+ // make them conform to Modelica syntax (the proper way to do \r
+ // this would be to simply quote problematic variable names \r
+ // but quoted variable names are currently broken in sysdyn so \r
+ // that is not an option)\r
+ \r
+ // capitalize each part of the variable name to prevent \r
+ // collisions with reserved keywords (e.g. "public")\r
+ String[] parts = variable.split("\\s+");\r
+ for (int i = 0; i < parts.length; i++) {\r
+ // a part of a variable name can not start with a number so\r
+ // concatenate the parts if this is the case\r
+ if (i > 0 && !Character.isDigit(parts[i].charAt(0)))\r
+ result.append(' ');\r
+ result.append(parts[i].substring(0, 1).toUpperCase() + parts[i].substring(1));\r
+ }\r
+ }\r
+\r
+ offset = matcher.end();\r
+ }\r
+ if (offset < expression.length()) {\r
+ result.append(expression.substring(offset));\r
+ }\r
+\r
+ return result.toString();\r
+ }\r
+\r
+ private static String normalizeFunctions(String expression) {\r
+ StringBuilder result = new StringBuilder();\r
+ int offset = 0;\r
+\r
+ Matcher matcher = Pattern.compile(FUNCTION).matcher(expression);\r
+ while (matcher.find()) {\r
+ result.append(expression.substring(offset, matcher.start()));\r
+\r
+ String function = matcher.group(1);\r
+\r
+ if (function.equalsIgnoreCase("sum")) {\r
+ // vensim "sum" is similar to modelica "sum" if operations \r
+ // are replaced with dot-operations (e.g. * with .*) inside\r
+ // the parameters\r
+ result.append("sum(");\r
+ int closing = expression.indexOf(')', matcher.end());\r
+ String parameters = expression.substring(matcher.end(), closing);\r
+ parameters = parameters.replaceAll("\\*", ".*");\r
+ parameters = parameters.replaceAll("/", "./");\r
+ parameters = parameters.replaceAll("\\+", ".+");\r
+ parameters = parameters.replaceAll("-", ".-");\r
+ result.append(parameters);\r
+ offset = closing;\r
+ }\r
+ else if (function.equalsIgnoreCase("if then else")) {\r
+ result.append("IFTHENELSE(");\r
+ offset = matcher.end();\r
+ }\r
+ else {\r
+ // this will also capitalize lookups, is this ok?\r
+ result.append(function.toUpperCase()+"(");\r
+ offset = matcher.end();\r
+ }\r
+ }\r
+ if (offset < expression.length()) {\r
+ result.append(expression.substring(offset));\r
+ }\r
+\r
+ return result.toString();\r
+ }\r
+ \r
+ private static String addParenthesesToExponents(String expression) {\r
+ if (!expression.contains("^")) {\r
+ return expression;\r
+ }\r
+ \r
+ StringBuilder result = new StringBuilder();\r
+ int offset = 0;\r
+ \r
+ Matcher matcher = Pattern.compile("\\^\\s*-\\s*"+VARIABLE_EXPRESSION).matcher(expression);\r
+ while (matcher.find()) {\r
+ result.append(expression.substring(offset, matcher.start()));\r
+ \r
+ result.append("^(-").append(matcher.group(1)).append(")");\r
+ \r
+ offset = matcher.end();\r
+ }\r
+ if (offset < expression.length()) {\r
+ result.append(expression.substring(offset));\r
+ }\r
+\r
+ return result.toString();\r
+ }\r
+\r
+ public static String finalize(String expression, MdlModel mdl) {\r
+ expression = expandIterations(expression, mdl);\r
+ expression = renameLookups(expression, mdl);\r
+\r
+ return expression;\r
+ }\r
+\r
+ private static String expandIterations(String expression, MdlModel mdl) {\r
+ StringBuilder result = new StringBuilder();\r
+ int offset = 0;\r
+\r
+ Matcher matcher = Pattern.compile(SUBSCRIPT).matcher(expression);\r
+ while (matcher.find()) {\r
+ result.append(expression.substring(offset, matcher.start()));\r
+\r
+ String name = matcher.group(1);\r
+ String[] indices = matcher.group(2).split(",");\r
+\r
+ result.append(name);\r
+\r
+ result.append('[');\r
+ for (int i = 0; i < indices.length; i++) {\r
+ if (i > 0)\r
+ result.append(',');\r
+\r
+ if (indices[i].endsWith("!")) {\r
+ String subscript = indices[i].substring(0, indices[i].length() - 1);\r
+ List<String> values = mdl.getSubscript(subscript).getValues();\r
+ result.append('{');\r
+ for (int j = 0; j < values.size(); j++) {\r
+ if (j > 0)\r
+ result.append(',');\r
+ result.append(values.get(j));\r
+ }\r
+ result.append('}');\r
+ }\r
+ else {\r
+ result.append(indices[i]);\r
+ }\r
+ }\r
+ result.append(']');\r
+\r
+ offset = matcher.end();\r
+ }\r
+ if (offset < expression.length()) {\r
+ result.append(expression.substring(offset));\r
+ }\r
+\r
+ return result.toString();\r
+ }\r
+\r
+ private static String renameLookups(String expression, MdlModel mdl) {\r
+ StringBuilder result = new StringBuilder();\r
+ int offset = 0;\r
+\r
+ Matcher matcher = Pattern.compile(FUNCTION).matcher(expression);\r
+ while (matcher.find()) {\r
+ result.append(expression.substring(offset, matcher.start()));\r
+\r
+ String name = matcher.group(1);\r
+\r
+ Lookup potential = mdl.getLookup(name);\r
+\r
+ if (potential != null) {\r
+ name = name.replaceAll("\\s+", "");\r
+ }\r
+\r
+ result.append(name+"(");\r
+ offset = matcher.end();\r
+ }\r
+ if (offset < expression.length()) {\r
+ result.append(expression.substring(offset));\r
+ }\r
+\r
+ return result.toString();\r
+ }\r
+\r
+ public static String replaceSubscripts(String expression, String subscript, String replacement) {\r
+ StringBuilder result = new StringBuilder();\r
+ int offset = 0;\r
+\r
+ Matcher matcher = Pattern.compile(SUBSCRIPT).matcher(expression);\r
+ while (matcher.find()) {\r
+ result.append(expression.substring(offset, matcher.start()));\r
+\r
+ String name = matcher.group(1);\r
+ String[] indices = matcher.group(2).split(",");\r
+\r
+ result.append(name);\r
+\r
+ result.append('[');\r
+ for (int i = 0; i < indices.length; i++) {\r
+ if (i > 0)\r
+ result.append(',');\r
+\r
+ if (indices[i].equals(subscript)) {\r
+ result.append(replacement);\r
+ }\r
+ else {\r
+ result.append(indices[i]);\r
+ }\r
+ }\r
+ result.append(']');\r
+\r
+ offset = matcher.end();\r
+ }\r
+ if (offset < expression.length()) {\r
+ result.append(expression.substring(offset));\r
+ }\r
+\r
+ return result.toString();\r
+ }\r
+ \r
+ public static double[] getSysdynDimensions(int x, int y, int width, int height) {\r
+ return new double[] {\r
+ x * SCALE_MULTIPLIER,\r
+ y * SCALE_MULTIPLIER,\r
+ width * SCALE_MULTIPLIER,\r
+ height * SCALE_MULTIPLIER\r
+ };\r
+ }\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for BPMNDiagram complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="BPMNDiagram">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}Diagram">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/DI}BPMNPlane"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/DI}BPMNLabelStyle" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "BPMNDiagram", namespace = "http://www.omg.org/spec/BPMN/20100524/DI", propOrder = {\r
+ "bpmnPlane",\r
+ "bpmnLabelStyle"\r
+})\r
+public class BPMNDiagram\r
+ extends Diagram\r
+{\r
+\r
+ @XmlElement(name = "BPMNPlane", required = true)\r
+ protected BPMNPlane bpmnPlane;\r
+ @XmlElement(name = "BPMNLabelStyle")\r
+ protected List<BPMNLabelStyle> bpmnLabelStyle;\r
+\r
+ /**\r
+ * Gets the value of the bpmnPlane property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link BPMNPlane }\r
+ * \r
+ */\r
+ public BPMNPlane getBPMNPlane() {\r
+ return bpmnPlane;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the bpmnPlane property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link BPMNPlane }\r
+ * \r
+ */\r
+ public void setBPMNPlane(BPMNPlane value) {\r
+ this.bpmnPlane = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the bpmnLabelStyle property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the bpmnLabelStyle property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getBPMNLabelStyle().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link BPMNLabelStyle }\r
+ * \r
+ * \r
+ */\r
+ public List<BPMNLabelStyle> getBPMNLabelStyle() {\r
+ if (bpmnLabelStyle == null) {\r
+ bpmnLabelStyle = new ArrayList<BPMNLabelStyle>();\r
+ }\r
+ return this.bpmnLabelStyle;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for BPMNEdge complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="BPMNEdge">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}LabeledEdge">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/DI}BPMNLabel" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="bpmnElement" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="sourceElement" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="targetElement" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="messageVisibleKind" type="{http://www.omg.org/spec/BPMN/20100524/DI}MessageVisibleKind" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "BPMNEdge", namespace = "http://www.omg.org/spec/BPMN/20100524/DI", propOrder = {\r
+ "bpmnLabel"\r
+})\r
+public class BPMNEdge\r
+ extends LabeledEdge\r
+{\r
+\r
+ @XmlElement(name = "BPMNLabel")\r
+ protected BPMNLabel bpmnLabel;\r
+ @XmlAttribute(name = "bpmnElement")\r
+ protected QName bpmnElement;\r
+ @XmlAttribute(name = "sourceElement")\r
+ protected QName sourceElement;\r
+ @XmlAttribute(name = "targetElement")\r
+ protected QName targetElement;\r
+ @XmlAttribute(name = "messageVisibleKind")\r
+ protected MessageVisibleKind messageVisibleKind;\r
+\r
+ /**\r
+ * Gets the value of the bpmnLabel property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link BPMNLabel }\r
+ * \r
+ */\r
+ public BPMNLabel getBPMNLabel() {\r
+ return bpmnLabel;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the bpmnLabel property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link BPMNLabel }\r
+ * \r
+ */\r
+ public void setBPMNLabel(BPMNLabel value) {\r
+ this.bpmnLabel = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the bpmnElement property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getBpmnElement() {\r
+ return bpmnElement;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the bpmnElement property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setBpmnElement(QName value) {\r
+ this.bpmnElement = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the sourceElement property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getSourceElement() {\r
+ return sourceElement;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the sourceElement property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setSourceElement(QName value) {\r
+ this.sourceElement = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the targetElement property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getTargetElement() {\r
+ return targetElement;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the targetElement property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setTargetElement(QName value) {\r
+ this.targetElement = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the messageVisibleKind property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link MessageVisibleKind }\r
+ * \r
+ */\r
+ public MessageVisibleKind getMessageVisibleKind() {\r
+ return messageVisibleKind;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the messageVisibleKind property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link MessageVisibleKind }\r
+ * \r
+ */\r
+ public void setMessageVisibleKind(MessageVisibleKind value) {\r
+ this.messageVisibleKind = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for BPMNLabel complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="BPMNLabel">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}Label">\r
+ * <attribute name="labelStyle" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "BPMNLabel", namespace = "http://www.omg.org/spec/BPMN/20100524/DI")\r
+public class BPMNLabel\r
+ extends Label\r
+{\r
+\r
+ @XmlAttribute(name = "labelStyle")\r
+ protected QName labelStyle;\r
+\r
+ /**\r
+ * Gets the value of the labelStyle property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getLabelStyle() {\r
+ return labelStyle;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the labelStyle property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setLabelStyle(QName value) {\r
+ this.labelStyle = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for BPMNLabelStyle complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="BPMNLabelStyle">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}Style">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/DD/20100524/DC}Font"/>\r
+ * </sequence>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "BPMNLabelStyle", namespace = "http://www.omg.org/spec/BPMN/20100524/DI", propOrder = {\r
+ "font"\r
+})\r
+public class BPMNLabelStyle\r
+ extends Style\r
+{\r
+\r
+ @XmlElement(name = "Font", namespace = "http://www.omg.org/spec/DD/20100524/DC", required = true)\r
+ protected Font font;\r
+\r
+ /**\r
+ * Gets the value of the font property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Font }\r
+ * \r
+ */\r
+ public Font getFont() {\r
+ return font;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the font property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Font }\r
+ * \r
+ */\r
+ public void setFont(Font value) {\r
+ this.font = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for BPMNPlane complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="BPMNPlane">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}Plane">\r
+ * <attribute name="bpmnElement" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "BPMNPlane", namespace = "http://www.omg.org/spec/BPMN/20100524/DI")\r
+public class BPMNPlane\r
+ extends Plane\r
+{\r
+\r
+ @XmlAttribute(name = "bpmnElement")\r
+ protected QName bpmnElement;\r
+\r
+ /**\r
+ * Gets the value of the bpmnElement property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getBpmnElement() {\r
+ return bpmnElement;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the bpmnElement property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setBpmnElement(QName value) {\r
+ this.bpmnElement = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for BPMNShape complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="BPMNShape">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}LabeledShape">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/DI}BPMNLabel" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="bpmnElement" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="isHorizontal" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <attribute name="isExpanded" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <attribute name="isMarkerVisible" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <attribute name="isMessageVisible" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <attribute name="participantBandKind" type="{http://www.omg.org/spec/BPMN/20100524/DI}ParticipantBandKind" />\r
+ * <attribute name="choreographyActivityShape" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "BPMNShape", namespace = "http://www.omg.org/spec/BPMN/20100524/DI", propOrder = {\r
+ "bpmnLabel"\r
+})\r
+public class BPMNShape\r
+ extends LabeledShape\r
+{\r
+\r
+ @XmlElement(name = "BPMNLabel")\r
+ protected BPMNLabel bpmnLabel;\r
+ @XmlAttribute(name = "bpmnElement")\r
+ protected QName bpmnElement;\r
+ @XmlAttribute(name = "isHorizontal")\r
+ protected Boolean isHorizontal;\r
+ @XmlAttribute(name = "isExpanded")\r
+ protected Boolean isExpanded;\r
+ @XmlAttribute(name = "isMarkerVisible")\r
+ protected Boolean isMarkerVisible;\r
+ @XmlAttribute(name = "isMessageVisible")\r
+ protected Boolean isMessageVisible;\r
+ @XmlAttribute(name = "participantBandKind")\r
+ protected ParticipantBandKind participantBandKind;\r
+ @XmlAttribute(name = "choreographyActivityShape")\r
+ protected QName choreographyActivityShape;\r
+\r
+ /**\r
+ * Gets the value of the bpmnLabel property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link BPMNLabel }\r
+ * \r
+ */\r
+ public BPMNLabel getBPMNLabel() {\r
+ return bpmnLabel;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the bpmnLabel property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link BPMNLabel }\r
+ * \r
+ */\r
+ public void setBPMNLabel(BPMNLabel value) {\r
+ this.bpmnLabel = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the bpmnElement property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getBpmnElement() {\r
+ return bpmnElement;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the bpmnElement property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setBpmnElement(QName value) {\r
+ this.bpmnElement = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isHorizontal property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsHorizontal() {\r
+ return isHorizontal;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isHorizontal property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsHorizontal(Boolean value) {\r
+ this.isHorizontal = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isExpanded property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsExpanded() {\r
+ return isExpanded;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isExpanded property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsExpanded(Boolean value) {\r
+ this.isExpanded = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isMarkerVisible property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsMarkerVisible() {\r
+ return isMarkerVisible;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isMarkerVisible property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsMarkerVisible(Boolean value) {\r
+ this.isMarkerVisible = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isMessageVisible property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsMessageVisible() {\r
+ return isMessageVisible;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isMessageVisible property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsMessageVisible(Boolean value) {\r
+ this.isMessageVisible = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the participantBandKind property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link ParticipantBandKind }\r
+ * \r
+ */\r
+ public ParticipantBandKind getParticipantBandKind() {\r
+ return participantBandKind;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the participantBandKind property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link ParticipantBandKind }\r
+ * \r
+ */\r
+ public void setParticipantBandKind(ParticipantBandKind value) {\r
+ this.participantBandKind = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the choreographyActivityShape property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getChoreographyActivityShape() {\r
+ return choreographyActivityShape;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the choreographyActivityShape property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setChoreographyActivityShape(QName value) {\r
+ this.choreographyActivityShape = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for Bounds complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Bounds">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <attribute name="x" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />\r
+ * <attribute name="y" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />\r
+ * <attribute name="width" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />\r
+ * <attribute name="height" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Bounds", namespace = "http://www.omg.org/spec/DD/20100524/DC")\r
+public class Bounds {\r
+\r
+ @XmlAttribute(name = "x", required = true)\r
+ protected double x;\r
+ @XmlAttribute(name = "y", required = true)\r
+ protected double y;\r
+ @XmlAttribute(name = "width", required = true)\r
+ protected double width;\r
+ @XmlAttribute(name = "height", required = true)\r
+ protected double height;\r
+\r
+ /**\r
+ * Gets the value of the x property.\r
+ * \r
+ */\r
+ public double getX() {\r
+ return x;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the x property.\r
+ * \r
+ */\r
+ public void setX(double value) {\r
+ this.x = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the y property.\r
+ * \r
+ */\r
+ public double getY() {\r
+ return y;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the y property.\r
+ * \r
+ */\r
+ public void setY(double value) {\r
+ this.y = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the width property.\r
+ * \r
+ */\r
+ public double getWidth() {\r
+ return width;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the width property.\r
+ * \r
+ */\r
+ public void setWidth(double value) {\r
+ this.width = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the height property.\r
+ * \r
+ */\r
+ public double getHeight() {\r
+ return height;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the height property.\r
+ * \r
+ */\r
+ public void setHeight(double value) {\r
+ this.height = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlID;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;\r
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\r
+\r
+\r
+/**\r
+ * <p>Java class for Diagram complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Diagram">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="documentation" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="resolution" type="{http://www.w3.org/2001/XMLSchema}double" />\r
+ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Diagram", namespace = "http://www.omg.org/spec/DD/20100524/DI")\r
+@XmlSeeAlso({\r
+ BPMNDiagram.class\r
+})\r
+public abstract class Diagram {\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "documentation")\r
+ protected String documentation;\r
+ @XmlAttribute(name = "resolution")\r
+ protected Double resolution;\r
+ @XmlAttribute(name = "id")\r
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)\r
+ @XmlID\r
+ @XmlSchemaType(name = "ID")\r
+ protected String id;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the documentation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getDocumentation() {\r
+ return documentation;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the documentation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setDocumentation(String value) {\r
+ this.documentation = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the resolution property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Double }\r
+ * \r
+ */\r
+ public Double getResolution() {\r
+ return resolution;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the resolution property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Double }\r
+ * \r
+ */\r
+ public void setResolution(Double value) {\r
+ this.resolution = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the id property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getId() {\r
+ return id;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the id property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setId(String value) {\r
+ this.id = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAnyAttribute;\r
+import javax.xml.bind.annotation.XmlAnyElement;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlID;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;\r
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for DiagramElement complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="DiagramElement">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <element name="extension" minOccurs="0">\r
+ * <complexType>\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </element>\r
+ * </sequence>\r
+ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "DiagramElement", namespace = "http://www.omg.org/spec/DD/20100524/DI", propOrder = {\r
+ "extension"\r
+})\r
+@XmlSeeAlso({\r
+ Node.class,\r
+ Edge.class\r
+})\r
+public abstract class DiagramElement {\r
+\r
+ protected DiagramElement.Extension extension;\r
+ @XmlAttribute(name = "id")\r
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)\r
+ @XmlID\r
+ @XmlSchemaType(name = "ID")\r
+ protected String id;\r
+ @XmlAnyAttribute\r
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();\r
+\r
+ /**\r
+ * Gets the value of the extension property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link DiagramElement.Extension }\r
+ * \r
+ */\r
+ public DiagramElement.Extension getExtension() {\r
+ return extension;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the extension property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link DiagramElement.Extension }\r
+ * \r
+ */\r
+ public void setExtension(DiagramElement.Extension value) {\r
+ this.extension = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the id property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getId() {\r
+ return id;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the id property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setId(String value) {\r
+ this.id = value;\r
+ }\r
+\r
+ /**\r
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.\r
+ * \r
+ * <p>\r
+ * the map is keyed by the name of the attribute and \r
+ * the value is the string value of the attribute.\r
+ * \r
+ * the map returned by this method is live, and you can add new attribute\r
+ * by updating the map directly. Because of this design, there's no setter.\r
+ * \r
+ * \r
+ * @return\r
+ * always non-null\r
+ */\r
+ public Map<QName, String> getOtherAttributes() {\r
+ return otherAttributes;\r
+ }\r
+\r
+\r
+ /**\r
+ * <p>Java class for anonymous complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType>\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+ @XmlAccessorType(XmlAccessType.FIELD)\r
+ @XmlType(name = "", propOrder = {\r
+ "any"\r
+ })\r
+ public static class Extension {\r
+\r
+ @XmlAnyElement(lax = true)\r
+ protected List<Object> any;\r
+\r
+ /**\r
+ * Gets the value of the any property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the any property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getAny().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link Object }\r
+ * \r
+ * \r
+ */\r
+ public List<Object> getAny() {\r
+ if (any == null) {\r
+ any = new ArrayList<Object>();\r
+ }\r
+ return this.any;\r
+ }\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for Edge complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Edge">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}DiagramElement">\r
+ * <sequence>\r
+ * <element name="waypoint" type="{http://www.omg.org/spec/DD/20100524/DC}Point" maxOccurs="unbounded" minOccurs="2"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Edge", namespace = "http://www.omg.org/spec/DD/20100524/DI", propOrder = {\r
+ "waypoint"\r
+})\r
+@XmlSeeAlso({\r
+ LabeledEdge.class\r
+})\r
+public abstract class Edge\r
+ extends DiagramElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected List<Point> waypoint;\r
+\r
+ /**\r
+ * Gets the value of the waypoint property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the waypoint property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getWaypoint().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link Point }\r
+ * \r
+ * \r
+ */\r
+ public List<Point> getWaypoint() {\r
+ if (waypoint == null) {\r
+ waypoint = new ArrayList<Point>();\r
+ }\r
+ return this.waypoint;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for Font complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Font">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="size" type="{http://www.w3.org/2001/XMLSchema}double" />\r
+ * <attribute name="isBold" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <attribute name="isItalic" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <attribute name="isUnderline" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <attribute name="isStrikeThrough" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Font", namespace = "http://www.omg.org/spec/DD/20100524/DC")\r
+public class Font {\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "size")\r
+ protected Double size;\r
+ @XmlAttribute(name = "isBold")\r
+ protected Boolean isBold;\r
+ @XmlAttribute(name = "isItalic")\r
+ protected Boolean isItalic;\r
+ @XmlAttribute(name = "isUnderline")\r
+ protected Boolean isUnderline;\r
+ @XmlAttribute(name = "isStrikeThrough")\r
+ protected Boolean isStrikeThrough;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the size property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Double }\r
+ * \r
+ */\r
+ public Double getSize() {\r
+ return size;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the size property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Double }\r
+ * \r
+ */\r
+ public void setSize(Double value) {\r
+ this.size = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isBold property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsBold() {\r
+ return isBold;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isBold property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsBold(Boolean value) {\r
+ this.isBold = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isItalic property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsItalic() {\r
+ return isItalic;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isItalic property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsItalic(Boolean value) {\r
+ this.isItalic = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isUnderline property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsUnderline() {\r
+ return isUnderline;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isUnderline property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsUnderline(Boolean value) {\r
+ this.isUnderline = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isStrikeThrough property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsStrikeThrough() {\r
+ return isStrikeThrough;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isStrikeThrough property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsStrikeThrough(Boolean value) {\r
+ this.isStrikeThrough = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for Label complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Label">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}Node">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/DD/20100524/DC}Bounds" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Label", namespace = "http://www.omg.org/spec/DD/20100524/DI", propOrder = {\r
+ "bounds"\r
+})\r
+@XmlSeeAlso({\r
+ BPMNLabel.class\r
+})\r
+public abstract class Label\r
+ extends Node\r
+{\r
+\r
+ @XmlElement(name = "Bounds", namespace = "http://www.omg.org/spec/DD/20100524/DC")\r
+ protected Bounds bounds;\r
+\r
+ /**\r
+ * Gets the value of the bounds property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Bounds }\r
+ * \r
+ */\r
+ public Bounds getBounds() {\r
+ return bounds;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the bounds property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Bounds }\r
+ * \r
+ */\r
+ public void setBounds(Bounds value) {\r
+ this.bounds = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for LabeledEdge complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="LabeledEdge">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}Edge">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "LabeledEdge", namespace = "http://www.omg.org/spec/DD/20100524/DI")\r
+@XmlSeeAlso({\r
+ BPMNEdge.class\r
+})\r
+public abstract class LabeledEdge\r
+ extends Edge\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for LabeledShape complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="LabeledShape">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}Shape">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "LabeledShape", namespace = "http://www.omg.org/spec/DD/20100524/DI")\r
+@XmlSeeAlso({\r
+ BPMNShape.class\r
+})\r
+public abstract class LabeledShape\r
+ extends Shape\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for MessageVisibleKind.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="MessageVisibleKind">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="initiating"/>\r
+ * <enumeration value="non_initiating"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "MessageVisibleKind", namespace = "http://www.omg.org/spec/BPMN/20100524/DI")\r
+@XmlEnum\r
+public enum MessageVisibleKind {\r
+\r
+ @XmlEnumValue("initiating")\r
+ INITIATING("initiating"),\r
+ @XmlEnumValue("non_initiating")\r
+ NON_INITIATING("non_initiating");\r
+ private final String value;\r
+\r
+ MessageVisibleKind(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static MessageVisibleKind fromValue(String v) {\r
+ for (MessageVisibleKind c: MessageVisibleKind.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for Node complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Node">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}DiagramElement">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Node", namespace = "http://www.omg.org/spec/DD/20100524/DI")\r
+@XmlSeeAlso({\r
+ Plane.class,\r
+ Shape.class,\r
+ Label.class\r
+})\r
+public abstract class Node\r
+ extends DiagramElement\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlElementDecl;\r
+import javax.xml.bind.annotation.XmlIDREF;\r
+import javax.xml.bind.annotation.XmlRegistry;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * This object contains factory methods for each \r
+ * Java content interface and Java element interface \r
+ * generated in the org.simantics.sysdyn.modelImport.bpmn package. \r
+ * <p>An ObjectFactory allows you to programatically \r
+ * construct new instances of the Java representation \r
+ * for XML content. The Java representation of XML \r
+ * content can consist of schema derived interfaces \r
+ * and classes representing the binding of schema \r
+ * type definitions, element declarations and model \r
+ * groups. Factory methods for each of these are \r
+ * provided in this class.\r
+ * \r
+ */\r
+@XmlRegistry\r
+public class ObjectFactory {\r
+\r
+ private final static QName _ExtensionElements_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "extensionElements");\r
+ private final static QName _HumanPerformer_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "humanPerformer");\r
+ private final static QName _Collaboration_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "collaboration");\r
+ private final static QName _ParticipantMultiplicity_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "participantMultiplicity");\r
+ private final static QName _ScriptTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "scriptTask");\r
+ private final static QName _SequenceFlow_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "sequenceFlow");\r
+ private final static QName _GlobalBusinessRuleTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "globalBusinessRuleTask");\r
+ private final static QName _DataAssociation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataAssociation");\r
+ private final static QName _InputSet_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "inputSet");\r
+ private final static QName _DataInputAssociation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataInputAssociation");\r
+ private final static QName _IntermediateThrowEvent_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "intermediateThrowEvent");\r
+ private final static QName _BPMNLabelStyle_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/DI", "BPMNLabelStyle");\r
+ private final static QName _ErrorEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "errorEventDefinition");\r
+ private final static QName _ReceiveTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "receiveTask");\r
+ private final static QName _Conversation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "conversation");\r
+ private final static QName _Style_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "Style");\r
+ private final static QName _ImplicitThrowEvent_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "implicitThrowEvent");\r
+ private final static QName _InclusiveGateway_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "inclusiveGateway");\r
+ private final static QName _IntermediateCatchEvent_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "intermediateCatchEvent");\r
+ private final static QName _OutputSet_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "outputSet");\r
+ private final static QName _LabeledEdge_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "LabeledEdge");\r
+ private final static QName _BPMNLabel_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/DI", "BPMNLabel");\r
+ private final static QName _LoopCharacteristics_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "loopCharacteristics");\r
+ private final static QName _Relationship_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "relationship");\r
+ private final static QName _Process_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "process");\r
+ private final static QName _Extension_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "extension");\r
+ private final static QName _ConditionalEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "conditionalEventDefinition");\r
+ private final static QName _Assignment_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "assignment");\r
+ private final static QName _Artifact_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "artifact");\r
+ private final static QName _FlowNode_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "flowNode");\r
+ private final static QName _EndPoint_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "endPoint");\r
+ private final static QName _MessageFlow_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "messageFlow");\r
+ private final static QName _SubProcess_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "subProcess");\r
+ private final static QName _EndEvent_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "endEvent");\r
+ private final static QName _Plane_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "Plane");\r
+ private final static QName _Documentation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "documentation");\r
+ private final static QName _BaseElement_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "baseElement");\r
+ private final static QName _TerminateEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "terminateEventDefinition");\r
+ private final static QName _EventBasedGateway_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "eventBasedGateway");\r
+ private final static QName _GlobalScriptTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "globalScriptTask");\r
+ private final static QName _TimerEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "timerEventDefinition");\r
+ private final static QName _ComplexGateway_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "complexGateway");\r
+ private final static QName _ManualTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "manualTask");\r
+ private final static QName _LabeledShape_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "LabeledShape");\r
+ private final static QName _CallableElement_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "callableElement");\r
+ private final static QName _CancelEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "cancelEventDefinition");\r
+ private final static QName _ServiceTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "serviceTask");\r
+ private final static QName _Operation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "operation");\r
+ private final static QName _SubChoreography_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "subChoreography");\r
+ private final static QName _CorrelationSubscription_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "correlationSubscription");\r
+ private final static QName _ChoreographyActivity_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "choreographyActivity");\r
+ private final static QName _Event_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "event");\r
+ private final static QName _GlobalConversation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "globalConversation");\r
+ private final static QName _Shape_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "Shape");\r
+ private final static QName _Import_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "import");\r
+ private final static QName _ResourceAssignmentExpression_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "resourceAssignmentExpression");\r
+ private final static QName _EventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "eventDefinition");\r
+ private final static QName _Monitoring_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "monitoring");\r
+ private final static QName _ThrowEvent_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "throwEvent");\r
+ private final static QName _ItemDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "itemDefinition");\r
+ private final static QName _AdHocSubProcess_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "adHocSubProcess");\r
+ private final static QName _GlobalUserTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "globalUserTask");\r
+ private final static QName _Category_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "category");\r
+ private final static QName _StartEvent_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "startEvent");\r
+ private final static QName _Participant_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "participant");\r
+ private final static QName _Performer_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "performer");\r
+ private final static QName _FormalExpression_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "formalExpression");\r
+ private final static QName _MessageEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "messageEventDefinition");\r
+ private final static QName _Edge_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "Edge");\r
+ private final static QName _CatchEvent_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "catchEvent");\r
+ private final static QName _ParticipantAssociation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "participantAssociation");\r
+ private final static QName _DataOutputAssociation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataOutputAssociation");\r
+ private final static QName _DataObjectReference_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataObjectReference");\r
+ private final static QName _BoundaryEvent_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "boundaryEvent");\r
+ private final static QName _SendTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "sendTask");\r
+ private final static QName _CategoryValue_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "categoryValue");\r
+ private final static QName _Choreography_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "choreography");\r
+ private final static QName _GlobalChoreographyTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "globalChoreographyTask");\r
+ private final static QName _CallChoreography_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "callChoreography");\r
+ private final static QName _Bounds_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DC", "Bounds");\r
+ private final static QName _MultiInstanceLoopCharacteristics_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "multiInstanceLoopCharacteristics");\r
+ private final static QName _PotentialOwner_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "potentialOwner");\r
+ private final static QName _CorrelationPropertyBinding_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "correlationPropertyBinding");\r
+ private final static QName _Signal_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "signal");\r
+ private final static QName _UserTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "userTask");\r
+ private final static QName _ParallelGateway_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "parallelGateway");\r
+ private final static QName _Lane_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "lane");\r
+ private final static QName _SubConversation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "subConversation");\r
+ private final static QName _BPMNEdge_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/DI", "BPMNEdge");\r
+ private final static QName _BaseElementWithMixedContent_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "baseElementWithMixedContent");\r
+ private final static QName _DataStore_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataStore");\r
+ private final static QName _SignalEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "signalEventDefinition");\r
+ private final static QName _RootElement_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "rootElement");\r
+ private final static QName _DataState_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataState");\r
+ private final static QName _CorrelationPropertyRetrievalExpression_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "correlationPropertyRetrievalExpression");\r
+ private final static QName _Node_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "Node");\r
+ private final static QName _IoSpecification_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "ioSpecification");\r
+ private final static QName _ConversationAssociation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "conversationAssociation");\r
+ private final static QName _LaneSet_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "laneSet");\r
+ private final static QName _Activity_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "activity");\r
+ private final static QName _GlobalTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "globalTask");\r
+ private final static QName _Diagram_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "Diagram");\r
+ private final static QName _Error_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "error");\r
+ private final static QName _Task_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "task");\r
+ private final static QName _Resource_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "resource");\r
+ private final static QName _Interface_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "interface");\r
+ private final static QName _CorrelationKey_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "correlationKey");\r
+ private final static QName _Rendering_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "rendering");\r
+ private final static QName _ResourceParameterBinding_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "resourceParameterBinding");\r
+ private final static QName _ExclusiveGateway_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "exclusiveGateway");\r
+ private final static QName _CorrelationProperty_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "correlationProperty");\r
+ private final static QName _Message_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "message");\r
+ private final static QName _DataStoreReference_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataStoreReference");\r
+ private final static QName _GlobalManualTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "globalManualTask");\r
+ private final static QName _Escalation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "escalation");\r
+ private final static QName _CallActivity_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "callActivity");\r
+ private final static QName _TextAnnotation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "textAnnotation");\r
+ private final static QName _Group_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "group");\r
+ private final static QName _Auditing_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "auditing");\r
+ private final static QName _DataOutput_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataOutput");\r
+ private final static QName _Point_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DC", "Point");\r
+ private final static QName _Expression_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "expression");\r
+ private final static QName _Transaction_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "transaction");\r
+ private final static QName _ChoreographyTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "choreographyTask");\r
+ private final static QName _Gateway_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "gateway");\r
+ private final static QName _ResourceRole_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "resourceRole");\r
+ private final static QName _Label_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "Label");\r
+ private final static QName _PartnerEntity_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "partnerEntity");\r
+ private final static QName _PartnerRole_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "partnerRole");\r
+ private final static QName _BPMNDiagram_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/DI", "BPMNDiagram");\r
+ private final static QName _BusinessRuleTask_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "businessRuleTask");\r
+ private final static QName _IoBinding_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "ioBinding");\r
+ private final static QName _FlowElement_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "flowElement");\r
+ private final static QName _DataObject_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataObject");\r
+ private final static QName _LinkEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "linkEventDefinition");\r
+ private final static QName _ResourceParameter_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "resourceParameter");\r
+ private final static QName _Text_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "text");\r
+ private final static QName _Association_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "association");\r
+ private final static QName _CallConversation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "callConversation");\r
+ private final static QName _EscalationEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "escalationEventDefinition");\r
+ private final static QName _Definitions_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "definitions");\r
+ private final static QName _Property_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "property");\r
+ private final static QName _DiagramElement_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DI", "DiagramElement");\r
+ private final static QName _Script_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "script");\r
+ private final static QName _DataInput_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataInput");\r
+ private final static QName _BPMNShape_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/DI", "BPMNShape");\r
+ private final static QName _BPMNPlane_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/DI", "BPMNPlane");\r
+ private final static QName _ConversationNode_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "conversationNode");\r
+ private final static QName _CompensateEventDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "compensateEventDefinition");\r
+ private final static QName _Font_QNAME = new QName("http://www.omg.org/spec/DD/20100524/DC", "Font");\r
+ private final static QName _ComplexBehaviorDefinition_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "complexBehaviorDefinition");\r
+ private final static QName _ConversationLink_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "conversationLink");\r
+ private final static QName _MessageFlowAssociation_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "messageFlowAssociation");\r
+ private final static QName _StandardLoopCharacteristics_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "standardLoopCharacteristics");\r
+ private final static QName _TInputSetWhileExecutingInputRefs_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "whileExecutingInputRefs");\r
+ private final static QName _TInputSetOutputSetRefs_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "outputSetRefs");\r
+ private final static QName _TInputSetOptionalInputRefs_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "optionalInputRefs");\r
+ private final static QName _TInputSetDataInputRefs_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataInputRefs");\r
+ private final static QName _TLaneFlowNodeRef_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "flowNodeRef");\r
+ private final static QName _TDataAssociationSourceRef_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "sourceRef");\r
+ private final static QName _TOutputSetDataOutputRefs_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "dataOutputRefs");\r
+ private final static QName _TOutputSetOptionalOutputRefs_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "optionalOutputRefs");\r
+ private final static QName _TOutputSetWhileExecutingOutputRefs_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "whileExecutingOutputRefs");\r
+ private final static QName _TOutputSetInputSetRefs_QNAME = new QName("http://www.omg.org/spec/BPMN/20100524/MODEL", "inputSetRefs");\r
+\r
+ /**\r
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.simantics.sysdyn.modelImport.bpmn\r
+ * \r
+ */\r
+ public ObjectFactory() {\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TComplexGateway }\r
+ * \r
+ */\r
+ public TComplexGateway createTComplexGateway() {\r
+ return new TComplexGateway();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TTimerEventDefinition }\r
+ * \r
+ */\r
+ public TTimerEventDefinition createTTimerEventDefinition() {\r
+ return new TTimerEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TManualTask }\r
+ * \r
+ */\r
+ public TManualTask createTManualTask() {\r
+ return new TManualTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCallableElement }\r
+ * \r
+ */\r
+ public TCallableElement createTCallableElement() {\r
+ return new TCallableElement();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TServiceTask }\r
+ * \r
+ */\r
+ public TServiceTask createTServiceTask() {\r
+ return new TServiceTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCancelEventDefinition }\r
+ * \r
+ */\r
+ public TCancelEventDefinition createTCancelEventDefinition() {\r
+ return new TCancelEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TSubChoreography }\r
+ * \r
+ */\r
+ public TSubChoreography createTSubChoreography() {\r
+ return new TSubChoreography();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TOperation }\r
+ * \r
+ */\r
+ public TOperation createTOperation() {\r
+ return new TOperation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCorrelationSubscription }\r
+ * \r
+ */\r
+ public TCorrelationSubscription createTCorrelationSubscription() {\r
+ return new TCorrelationSubscription();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TGlobalConversation }\r
+ * \r
+ */\r
+ public TGlobalConversation createTGlobalConversation() {\r
+ return new TGlobalConversation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCollaboration }\r
+ * \r
+ */\r
+ public TCollaboration createTCollaboration() {\r
+ return new TCollaboration();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TImport }\r
+ * \r
+ */\r
+ public TImport createTImport() {\r
+ return new TImport();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TResourceAssignmentExpression }\r
+ * \r
+ */\r
+ public TResourceAssignmentExpression createTResourceAssignmentExpression() {\r
+ return new TResourceAssignmentExpression();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TMonitoring }\r
+ * \r
+ */\r
+ public TMonitoring createTMonitoring() {\r
+ return new TMonitoring();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TItemDefinition }\r
+ * \r
+ */\r
+ public TItemDefinition createTItemDefinition() {\r
+ return new TItemDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TAdHocSubProcess }\r
+ * \r
+ */\r
+ public TAdHocSubProcess createTAdHocSubProcess() {\r
+ return new TAdHocSubProcess();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TGlobalUserTask }\r
+ * \r
+ */\r
+ public TGlobalUserTask createTGlobalUserTask() {\r
+ return new TGlobalUserTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCategory }\r
+ * \r
+ */\r
+ public TCategory createTCategory() {\r
+ return new TCategory();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TStartEvent }\r
+ * \r
+ */\r
+ public TStartEvent createTStartEvent() {\r
+ return new TStartEvent();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TPerformer }\r
+ * \r
+ */\r
+ public TPerformer createTPerformer() {\r
+ return new TPerformer();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TResourceRole }\r
+ * \r
+ */\r
+ public TResourceRole createTResourceRole() {\r
+ return new TResourceRole();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TParticipant }\r
+ * \r
+ */\r
+ public TParticipant createTParticipant() {\r
+ return new TParticipant();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TFormalExpression }\r
+ * \r
+ */\r
+ public TFormalExpression createTFormalExpression() {\r
+ return new TFormalExpression();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression createTExpression() {\r
+ return new TExpression();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TMessageEventDefinition }\r
+ * \r
+ */\r
+ public TMessageEventDefinition createTMessageEventDefinition() {\r
+ return new TMessageEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TExtensionElements }\r
+ * \r
+ */\r
+ public TExtensionElements createTExtensionElements() {\r
+ return new TExtensionElements();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link THumanPerformer }\r
+ * \r
+ */\r
+ public THumanPerformer createTHumanPerformer() {\r
+ return new THumanPerformer();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TParticipantMultiplicity }\r
+ * \r
+ */\r
+ public TParticipantMultiplicity createTParticipantMultiplicity() {\r
+ return new TParticipantMultiplicity();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TSequenceFlow }\r
+ * \r
+ */\r
+ public TSequenceFlow createTSequenceFlow() {\r
+ return new TSequenceFlow();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TScriptTask }\r
+ * \r
+ */\r
+ public TScriptTask createTScriptTask() {\r
+ return new TScriptTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataAssociation }\r
+ * \r
+ */\r
+ public TDataAssociation createTDataAssociation() {\r
+ return new TDataAssociation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TGlobalBusinessRuleTask }\r
+ * \r
+ */\r
+ public TGlobalBusinessRuleTask createTGlobalBusinessRuleTask() {\r
+ return new TGlobalBusinessRuleTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TInputSet }\r
+ * \r
+ */\r
+ public TInputSet createTInputSet() {\r
+ return new TInputSet();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TIntermediateThrowEvent }\r
+ * \r
+ */\r
+ public TIntermediateThrowEvent createTIntermediateThrowEvent() {\r
+ return new TIntermediateThrowEvent();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataInputAssociation }\r
+ * \r
+ */\r
+ public TDataInputAssociation createTDataInputAssociation() {\r
+ return new TDataInputAssociation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TErrorEventDefinition }\r
+ * \r
+ */\r
+ public TErrorEventDefinition createTErrorEventDefinition() {\r
+ return new TErrorEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TReceiveTask }\r
+ * \r
+ */\r
+ public TReceiveTask createTReceiveTask() {\r
+ return new TReceiveTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TConversation }\r
+ * \r
+ */\r
+ public TConversation createTConversation() {\r
+ return new TConversation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TImplicitThrowEvent }\r
+ * \r
+ */\r
+ public TImplicitThrowEvent createTImplicitThrowEvent() {\r
+ return new TImplicitThrowEvent();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TInclusiveGateway }\r
+ * \r
+ */\r
+ public TInclusiveGateway createTInclusiveGateway() {\r
+ return new TInclusiveGateway();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TIntermediateCatchEvent }\r
+ * \r
+ */\r
+ public TIntermediateCatchEvent createTIntermediateCatchEvent() {\r
+ return new TIntermediateCatchEvent();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TOutputSet }\r
+ * \r
+ */\r
+ public TOutputSet createTOutputSet() {\r
+ return new TOutputSet();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TRelationship }\r
+ * \r
+ */\r
+ public TRelationship createTRelationship() {\r
+ return new TRelationship();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TProcess }\r
+ * \r
+ */\r
+ public TProcess createTProcess() {\r
+ return new TProcess();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TExtension }\r
+ * \r
+ */\r
+ public TExtension createTExtension() {\r
+ return new TExtension();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TAssignment }\r
+ * \r
+ */\r
+ public TAssignment createTAssignment() {\r
+ return new TAssignment();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TConditionalEventDefinition }\r
+ * \r
+ */\r
+ public TConditionalEventDefinition createTConditionalEventDefinition() {\r
+ return new TConditionalEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TEndPoint }\r
+ * \r
+ */\r
+ public TEndPoint createTEndPoint() {\r
+ return new TEndPoint();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TMessageFlow }\r
+ * \r
+ */\r
+ public TMessageFlow createTMessageFlow() {\r
+ return new TMessageFlow();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TSubProcess }\r
+ * \r
+ */\r
+ public TSubProcess createTSubProcess() {\r
+ return new TSubProcess();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TEndEvent }\r
+ * \r
+ */\r
+ public TEndEvent createTEndEvent() {\r
+ return new TEndEvent();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDocumentation }\r
+ * \r
+ */\r
+ public TDocumentation createTDocumentation() {\r
+ return new TDocumentation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TTerminateEventDefinition }\r
+ * \r
+ */\r
+ public TTerminateEventDefinition createTTerminateEventDefinition() {\r
+ return new TTerminateEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TEventBasedGateway }\r
+ * \r
+ */\r
+ public TEventBasedGateway createTEventBasedGateway() {\r
+ return new TEventBasedGateway();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TGlobalScriptTask }\r
+ * \r
+ */\r
+ public TGlobalScriptTask createTGlobalScriptTask() {\r
+ return new TGlobalScriptTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TGateway }\r
+ * \r
+ */\r
+ public TGateway createTGateway() {\r
+ return new TGateway();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TTransaction }\r
+ * \r
+ */\r
+ public TTransaction createTTransaction() {\r
+ return new TTransaction();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TChoreographyTask }\r
+ * \r
+ */\r
+ public TChoreographyTask createTChoreographyTask() {\r
+ return new TChoreographyTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TPartnerRole }\r
+ * \r
+ */\r
+ public TPartnerRole createTPartnerRole() {\r
+ return new TPartnerRole();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TPartnerEntity }\r
+ * \r
+ */\r
+ public TPartnerEntity createTPartnerEntity() {\r
+ return new TPartnerEntity();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TBusinessRuleTask }\r
+ * \r
+ */\r
+ public TBusinessRuleTask createTBusinessRuleTask() {\r
+ return new TBusinessRuleTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TInputOutputBinding }\r
+ * \r
+ */\r
+ public TInputOutputBinding createTInputOutputBinding() {\r
+ return new TInputOutputBinding();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataObject }\r
+ * \r
+ */\r
+ public TDataObject createTDataObject() {\r
+ return new TDataObject();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TLinkEventDefinition }\r
+ * \r
+ */\r
+ public TLinkEventDefinition createTLinkEventDefinition() {\r
+ return new TLinkEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TText }\r
+ * \r
+ */\r
+ public TText createTText() {\r
+ return new TText();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TResourceParameter }\r
+ * \r
+ */\r
+ public TResourceParameter createTResourceParameter() {\r
+ return new TResourceParameter();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TAssociation }\r
+ * \r
+ */\r
+ public TAssociation createTAssociation() {\r
+ return new TAssociation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCallConversation }\r
+ * \r
+ */\r
+ public TCallConversation createTCallConversation() {\r
+ return new TCallConversation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TEscalationEventDefinition }\r
+ * \r
+ */\r
+ public TEscalationEventDefinition createTEscalationEventDefinition() {\r
+ return new TEscalationEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TProperty }\r
+ * \r
+ */\r
+ public TProperty createTProperty() {\r
+ return new TProperty();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDefinitions }\r
+ * \r
+ */\r
+ public TDefinitions createTDefinitions() {\r
+ return new TDefinitions();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TScript }\r
+ * \r
+ */\r
+ public TScript createTScript() {\r
+ return new TScript();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataInput }\r
+ * \r
+ */\r
+ public TDataInput createTDataInput() {\r
+ return new TDataInput();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TComplexBehaviorDefinition }\r
+ * \r
+ */\r
+ public TComplexBehaviorDefinition createTComplexBehaviorDefinition() {\r
+ return new TComplexBehaviorDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCompensateEventDefinition }\r
+ * \r
+ */\r
+ public TCompensateEventDefinition createTCompensateEventDefinition() {\r
+ return new TCompensateEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TMessageFlowAssociation }\r
+ * \r
+ */\r
+ public TMessageFlowAssociation createTMessageFlowAssociation() {\r
+ return new TMessageFlowAssociation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TConversationLink }\r
+ * \r
+ */\r
+ public TConversationLink createTConversationLink() {\r
+ return new TConversationLink();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TStandardLoopCharacteristics }\r
+ * \r
+ */\r
+ public TStandardLoopCharacteristics createTStandardLoopCharacteristics() {\r
+ return new TStandardLoopCharacteristics();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TParticipantAssociation }\r
+ * \r
+ */\r
+ public TParticipantAssociation createTParticipantAssociation() {\r
+ return new TParticipantAssociation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataOutputAssociation }\r
+ * \r
+ */\r
+ public TDataOutputAssociation createTDataOutputAssociation() {\r
+ return new TDataOutputAssociation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataObjectReference }\r
+ * \r
+ */\r
+ public TDataObjectReference createTDataObjectReference() {\r
+ return new TDataObjectReference();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TBoundaryEvent }\r
+ * \r
+ */\r
+ public TBoundaryEvent createTBoundaryEvent() {\r
+ return new TBoundaryEvent();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCategoryValue }\r
+ * \r
+ */\r
+ public TCategoryValue createTCategoryValue() {\r
+ return new TCategoryValue();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TSendTask }\r
+ * \r
+ */\r
+ public TSendTask createTSendTask() {\r
+ return new TSendTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TChoreography }\r
+ * \r
+ */\r
+ public TChoreography createTChoreography() {\r
+ return new TChoreography();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TMultiInstanceLoopCharacteristics }\r
+ * \r
+ */\r
+ public TMultiInstanceLoopCharacteristics createTMultiInstanceLoopCharacteristics() {\r
+ return new TMultiInstanceLoopCharacteristics();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCallChoreography }\r
+ * \r
+ */\r
+ public TCallChoreography createTCallChoreography() {\r
+ return new TCallChoreography();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TGlobalChoreographyTask }\r
+ * \r
+ */\r
+ public TGlobalChoreographyTask createTGlobalChoreographyTask() {\r
+ return new TGlobalChoreographyTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TUserTask }\r
+ * \r
+ */\r
+ public TUserTask createTUserTask() {\r
+ return new TUserTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TSignal }\r
+ * \r
+ */\r
+ public TSignal createTSignal() {\r
+ return new TSignal();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCorrelationPropertyBinding }\r
+ * \r
+ */\r
+ public TCorrelationPropertyBinding createTCorrelationPropertyBinding() {\r
+ return new TCorrelationPropertyBinding();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TPotentialOwner }\r
+ * \r
+ */\r
+ public TPotentialOwner createTPotentialOwner() {\r
+ return new TPotentialOwner();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TParallelGateway }\r
+ * \r
+ */\r
+ public TParallelGateway createTParallelGateway() {\r
+ return new TParallelGateway();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TSubConversation }\r
+ * \r
+ */\r
+ public TSubConversation createTSubConversation() {\r
+ return new TSubConversation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TLane }\r
+ * \r
+ */\r
+ public TLane createTLane() {\r
+ return new TLane();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TSignalEventDefinition }\r
+ * \r
+ */\r
+ public TSignalEventDefinition createTSignalEventDefinition() {\r
+ return new TSignalEventDefinition();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataStore }\r
+ * \r
+ */\r
+ public TDataStore createTDataStore() {\r
+ return new TDataStore();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCorrelationPropertyRetrievalExpression }\r
+ * \r
+ */\r
+ public TCorrelationPropertyRetrievalExpression createTCorrelationPropertyRetrievalExpression() {\r
+ return new TCorrelationPropertyRetrievalExpression();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataState }\r
+ * \r
+ */\r
+ public TDataState createTDataState() {\r
+ return new TDataState();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TLaneSet }\r
+ * \r
+ */\r
+ public TLaneSet createTLaneSet() {\r
+ return new TLaneSet();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TConversationAssociation }\r
+ * \r
+ */\r
+ public TConversationAssociation createTConversationAssociation() {\r
+ return new TConversationAssociation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TInputOutputSpecification }\r
+ * \r
+ */\r
+ public TInputOutputSpecification createTInputOutputSpecification() {\r
+ return new TInputOutputSpecification();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TGlobalTask }\r
+ * \r
+ */\r
+ public TGlobalTask createTGlobalTask() {\r
+ return new TGlobalTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TError }\r
+ * \r
+ */\r
+ public TError createTError() {\r
+ return new TError();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TTask }\r
+ * \r
+ */\r
+ public TTask createTTask() {\r
+ return new TTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TResource }\r
+ * \r
+ */\r
+ public TResource createTResource() {\r
+ return new TResource();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCorrelationKey }\r
+ * \r
+ */\r
+ public TCorrelationKey createTCorrelationKey() {\r
+ return new TCorrelationKey();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TInterface }\r
+ * \r
+ */\r
+ public TInterface createTInterface() {\r
+ return new TInterface();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCorrelationProperty }\r
+ * \r
+ */\r
+ public TCorrelationProperty createTCorrelationProperty() {\r
+ return new TCorrelationProperty();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TExclusiveGateway }\r
+ * \r
+ */\r
+ public TExclusiveGateway createTExclusiveGateway() {\r
+ return new TExclusiveGateway();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TResourceParameterBinding }\r
+ * \r
+ */\r
+ public TResourceParameterBinding createTResourceParameterBinding() {\r
+ return new TResourceParameterBinding();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TRendering }\r
+ * \r
+ */\r
+ public TRendering createTRendering() {\r
+ return new TRendering();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TMessage }\r
+ * \r
+ */\r
+ public TMessage createTMessage() {\r
+ return new TMessage();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataStoreReference }\r
+ * \r
+ */\r
+ public TDataStoreReference createTDataStoreReference() {\r
+ return new TDataStoreReference();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TGlobalManualTask }\r
+ * \r
+ */\r
+ public TGlobalManualTask createTGlobalManualTask() {\r
+ return new TGlobalManualTask();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TCallActivity }\r
+ * \r
+ */\r
+ public TCallActivity createTCallActivity() {\r
+ return new TCallActivity();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TEscalation }\r
+ * \r
+ */\r
+ public TEscalation createTEscalation() {\r
+ return new TEscalation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TAuditing }\r
+ * \r
+ */\r
+ public TAuditing createTAuditing() {\r
+ return new TAuditing();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TGroup }\r
+ * \r
+ */\r
+ public TGroup createTGroup() {\r
+ return new TGroup();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TTextAnnotation }\r
+ * \r
+ */\r
+ public TTextAnnotation createTTextAnnotation() {\r
+ return new TTextAnnotation();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link TDataOutput }\r
+ * \r
+ */\r
+ public TDataOutput createTDataOutput() {\r
+ return new TDataOutput();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link BPMNLabel }\r
+ * \r
+ */\r
+ public BPMNLabel createBPMNLabel() {\r
+ return new BPMNLabel();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link BPMNLabelStyle }\r
+ * \r
+ */\r
+ public BPMNLabelStyle createBPMNLabelStyle() {\r
+ return new BPMNLabelStyle();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link BPMNPlane }\r
+ * \r
+ */\r
+ public BPMNPlane createBPMNPlane() {\r
+ return new BPMNPlane();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link BPMNDiagram }\r
+ * \r
+ */\r
+ public BPMNDiagram createBPMNDiagram() {\r
+ return new BPMNDiagram();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link BPMNEdge }\r
+ * \r
+ */\r
+ public BPMNEdge createBPMNEdge() {\r
+ return new BPMNEdge();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link BPMNShape }\r
+ * \r
+ */\r
+ public BPMNShape createBPMNShape() {\r
+ return new BPMNShape();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link Font }\r
+ * \r
+ */\r
+ public Font createFont() {\r
+ return new Font();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link Bounds }\r
+ * \r
+ */\r
+ public Bounds createBounds() {\r
+ return new Bounds();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link Point }\r
+ * \r
+ */\r
+ public Point createPoint() {\r
+ return new Point();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link DiagramElement.Extension }\r
+ * \r
+ */\r
+ public DiagramElement.Extension createDiagramElementExtension() {\r
+ return new DiagramElement.Extension();\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TExtensionElements }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "extensionElements")\r
+ public JAXBElement<TExtensionElements> createExtensionElements(TExtensionElements value) {\r
+ return new JAXBElement<TExtensionElements>(_ExtensionElements_QNAME, TExtensionElements.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link THumanPerformer }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "humanPerformer", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "performer")\r
+ public JAXBElement<THumanPerformer> createHumanPerformer(THumanPerformer value) {\r
+ return new JAXBElement<THumanPerformer>(_HumanPerformer_QNAME, THumanPerformer.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCollaboration }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "collaboration", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TCollaboration> createCollaboration(TCollaboration value) {\r
+ return new JAXBElement<TCollaboration>(_Collaboration_QNAME, TCollaboration.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TParticipantMultiplicity }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "participantMultiplicity")\r
+ public JAXBElement<TParticipantMultiplicity> createParticipantMultiplicity(TParticipantMultiplicity value) {\r
+ return new JAXBElement<TParticipantMultiplicity>(_ParticipantMultiplicity_QNAME, TParticipantMultiplicity.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TScriptTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "scriptTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TScriptTask> createScriptTask(TScriptTask value) {\r
+ return new JAXBElement<TScriptTask>(_ScriptTask_QNAME, TScriptTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TSequenceFlow }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "sequenceFlow", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TSequenceFlow> createSequenceFlow(TSequenceFlow value) {\r
+ return new JAXBElement<TSequenceFlow>(_SequenceFlow_QNAME, TSequenceFlow.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TGlobalBusinessRuleTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "globalBusinessRuleTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TGlobalBusinessRuleTask> createGlobalBusinessRuleTask(TGlobalBusinessRuleTask value) {\r
+ return new JAXBElement<TGlobalBusinessRuleTask>(_GlobalBusinessRuleTask_QNAME, TGlobalBusinessRuleTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataAssociation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataAssociation")\r
+ public JAXBElement<TDataAssociation> createDataAssociation(TDataAssociation value) {\r
+ return new JAXBElement<TDataAssociation>(_DataAssociation_QNAME, TDataAssociation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TInputSet }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "inputSet")\r
+ public JAXBElement<TInputSet> createInputSet(TInputSet value) {\r
+ return new JAXBElement<TInputSet>(_InputSet_QNAME, TInputSet.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataInputAssociation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataInputAssociation")\r
+ public JAXBElement<TDataInputAssociation> createDataInputAssociation(TDataInputAssociation value) {\r
+ return new JAXBElement<TDataInputAssociation>(_DataInputAssociation_QNAME, TDataInputAssociation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TIntermediateThrowEvent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "intermediateThrowEvent", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TIntermediateThrowEvent> createIntermediateThrowEvent(TIntermediateThrowEvent value) {\r
+ return new JAXBElement<TIntermediateThrowEvent>(_IntermediateThrowEvent_QNAME, TIntermediateThrowEvent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link BPMNLabelStyle }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/DI", name = "BPMNLabelStyle")\r
+ public JAXBElement<BPMNLabelStyle> createBPMNLabelStyle(BPMNLabelStyle value) {\r
+ return new JAXBElement<BPMNLabelStyle>(_BPMNLabelStyle_QNAME, BPMNLabelStyle.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TErrorEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "errorEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TErrorEventDefinition> createErrorEventDefinition(TErrorEventDefinition value) {\r
+ return new JAXBElement<TErrorEventDefinition>(_ErrorEventDefinition_QNAME, TErrorEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TReceiveTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "receiveTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TReceiveTask> createReceiveTask(TReceiveTask value) {\r
+ return new JAXBElement<TReceiveTask>(_ReceiveTask_QNAME, TReceiveTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TConversation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "conversation", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "conversationNode")\r
+ public JAXBElement<TConversation> createConversation(TConversation value) {\r
+ return new JAXBElement<TConversation>(_Conversation_QNAME, TConversation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Style }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "Style")\r
+ public JAXBElement<Style> createStyle(Style value) {\r
+ return new JAXBElement<Style>(_Style_QNAME, Style.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TImplicitThrowEvent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "implicitThrowEvent", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TImplicitThrowEvent> createImplicitThrowEvent(TImplicitThrowEvent value) {\r
+ return new JAXBElement<TImplicitThrowEvent>(_ImplicitThrowEvent_QNAME, TImplicitThrowEvent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TInclusiveGateway }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "inclusiveGateway", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TInclusiveGateway> createInclusiveGateway(TInclusiveGateway value) {\r
+ return new JAXBElement<TInclusiveGateway>(_InclusiveGateway_QNAME, TInclusiveGateway.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TIntermediateCatchEvent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "intermediateCatchEvent", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TIntermediateCatchEvent> createIntermediateCatchEvent(TIntermediateCatchEvent value) {\r
+ return new JAXBElement<TIntermediateCatchEvent>(_IntermediateCatchEvent_QNAME, TIntermediateCatchEvent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TOutputSet }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "outputSet")\r
+ public JAXBElement<TOutputSet> createOutputSet(TOutputSet value) {\r
+ return new JAXBElement<TOutputSet>(_OutputSet_QNAME, TOutputSet.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link LabeledEdge }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "LabeledEdge")\r
+ public JAXBElement<LabeledEdge> createLabeledEdge(LabeledEdge value) {\r
+ return new JAXBElement<LabeledEdge>(_LabeledEdge_QNAME, LabeledEdge.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link BPMNLabel }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/DI", name = "BPMNLabel")\r
+ public JAXBElement<BPMNLabel> createBPMNLabel(BPMNLabel value) {\r
+ return new JAXBElement<BPMNLabel>(_BPMNLabel_QNAME, BPMNLabel.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TLoopCharacteristics }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "loopCharacteristics")\r
+ public JAXBElement<TLoopCharacteristics> createLoopCharacteristics(TLoopCharacteristics value) {\r
+ return new JAXBElement<TLoopCharacteristics>(_LoopCharacteristics_QNAME, TLoopCharacteristics.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TRelationship }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "relationship")\r
+ public JAXBElement<TRelationship> createRelationship(TRelationship value) {\r
+ return new JAXBElement<TRelationship>(_Relationship_QNAME, TRelationship.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TProcess }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "process", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TProcess> createProcess(TProcess value) {\r
+ return new JAXBElement<TProcess>(_Process_QNAME, TProcess.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TExtension }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "extension")\r
+ public JAXBElement<TExtension> createExtension(TExtension value) {\r
+ return new JAXBElement<TExtension>(_Extension_QNAME, TExtension.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TConditionalEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "conditionalEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TConditionalEventDefinition> createConditionalEventDefinition(TConditionalEventDefinition value) {\r
+ return new JAXBElement<TConditionalEventDefinition>(_ConditionalEventDefinition_QNAME, TConditionalEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TAssignment }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "assignment")\r
+ public JAXBElement<TAssignment> createAssignment(TAssignment value) {\r
+ return new JAXBElement<TAssignment>(_Assignment_QNAME, TAssignment.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TArtifact }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "artifact")\r
+ public JAXBElement<TArtifact> createArtifact(TArtifact value) {\r
+ return new JAXBElement<TArtifact>(_Artifact_QNAME, TArtifact.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TFlowNode }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "flowNode")\r
+ public JAXBElement<TFlowNode> createFlowNode(TFlowNode value) {\r
+ return new JAXBElement<TFlowNode>(_FlowNode_QNAME, TFlowNode.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TEndPoint }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "endPoint", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TEndPoint> createEndPoint(TEndPoint value) {\r
+ return new JAXBElement<TEndPoint>(_EndPoint_QNAME, TEndPoint.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TMessageFlow }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "messageFlow")\r
+ public JAXBElement<TMessageFlow> createMessageFlow(TMessageFlow value) {\r
+ return new JAXBElement<TMessageFlow>(_MessageFlow_QNAME, TMessageFlow.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TSubProcess }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "subProcess", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TSubProcess> createSubProcess(TSubProcess value) {\r
+ return new JAXBElement<TSubProcess>(_SubProcess_QNAME, TSubProcess.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TEndEvent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "endEvent", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TEndEvent> createEndEvent(TEndEvent value) {\r
+ return new JAXBElement<TEndEvent>(_EndEvent_QNAME, TEndEvent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Plane }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "Plane")\r
+ public JAXBElement<Plane> createPlane(Plane value) {\r
+ return new JAXBElement<Plane>(_Plane_QNAME, Plane.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDocumentation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "documentation")\r
+ public JAXBElement<TDocumentation> createDocumentation(TDocumentation value) {\r
+ return new JAXBElement<TDocumentation>(_Documentation_QNAME, TDocumentation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TBaseElement }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "baseElement")\r
+ public JAXBElement<TBaseElement> createBaseElement(TBaseElement value) {\r
+ return new JAXBElement<TBaseElement>(_BaseElement_QNAME, TBaseElement.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TTerminateEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "terminateEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TTerminateEventDefinition> createTerminateEventDefinition(TTerminateEventDefinition value) {\r
+ return new JAXBElement<TTerminateEventDefinition>(_TerminateEventDefinition_QNAME, TTerminateEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TEventBasedGateway }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "eventBasedGateway", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TEventBasedGateway> createEventBasedGateway(TEventBasedGateway value) {\r
+ return new JAXBElement<TEventBasedGateway>(_EventBasedGateway_QNAME, TEventBasedGateway.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TGlobalScriptTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "globalScriptTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TGlobalScriptTask> createGlobalScriptTask(TGlobalScriptTask value) {\r
+ return new JAXBElement<TGlobalScriptTask>(_GlobalScriptTask_QNAME, TGlobalScriptTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TTimerEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "timerEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TTimerEventDefinition> createTimerEventDefinition(TTimerEventDefinition value) {\r
+ return new JAXBElement<TTimerEventDefinition>(_TimerEventDefinition_QNAME, TTimerEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TComplexGateway }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "complexGateway", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TComplexGateway> createComplexGateway(TComplexGateway value) {\r
+ return new JAXBElement<TComplexGateway>(_ComplexGateway_QNAME, TComplexGateway.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TManualTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "manualTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TManualTask> createManualTask(TManualTask value) {\r
+ return new JAXBElement<TManualTask>(_ManualTask_QNAME, TManualTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link LabeledShape }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "LabeledShape")\r
+ public JAXBElement<LabeledShape> createLabeledShape(LabeledShape value) {\r
+ return new JAXBElement<LabeledShape>(_LabeledShape_QNAME, LabeledShape.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCallableElement }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "callableElement")\r
+ public JAXBElement<TCallableElement> createCallableElement(TCallableElement value) {\r
+ return new JAXBElement<TCallableElement>(_CallableElement_QNAME, TCallableElement.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCancelEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "cancelEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TCancelEventDefinition> createCancelEventDefinition(TCancelEventDefinition value) {\r
+ return new JAXBElement<TCancelEventDefinition>(_CancelEventDefinition_QNAME, TCancelEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TServiceTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "serviceTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TServiceTask> createServiceTask(TServiceTask value) {\r
+ return new JAXBElement<TServiceTask>(_ServiceTask_QNAME, TServiceTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TOperation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "operation")\r
+ public JAXBElement<TOperation> createOperation(TOperation value) {\r
+ return new JAXBElement<TOperation>(_Operation_QNAME, TOperation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TSubChoreography }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "subChoreography", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TSubChoreography> createSubChoreography(TSubChoreography value) {\r
+ return new JAXBElement<TSubChoreography>(_SubChoreography_QNAME, TSubChoreography.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCorrelationSubscription }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "correlationSubscription")\r
+ public JAXBElement<TCorrelationSubscription> createCorrelationSubscription(TCorrelationSubscription value) {\r
+ return new JAXBElement<TCorrelationSubscription>(_CorrelationSubscription_QNAME, TCorrelationSubscription.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TChoreographyActivity }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "choreographyActivity")\r
+ public JAXBElement<TChoreographyActivity> createChoreographyActivity(TChoreographyActivity value) {\r
+ return new JAXBElement<TChoreographyActivity>(_ChoreographyActivity_QNAME, TChoreographyActivity.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TEvent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "event", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TEvent> createEvent(TEvent value) {\r
+ return new JAXBElement<TEvent>(_Event_QNAME, TEvent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TGlobalConversation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "globalConversation", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "collaboration")\r
+ public JAXBElement<TGlobalConversation> createGlobalConversation(TGlobalConversation value) {\r
+ return new JAXBElement<TGlobalConversation>(_GlobalConversation_QNAME, TGlobalConversation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Shape }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "Shape")\r
+ public JAXBElement<Shape> createShape(Shape value) {\r
+ return new JAXBElement<Shape>(_Shape_QNAME, Shape.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TImport }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "import")\r
+ public JAXBElement<TImport> createImport(TImport value) {\r
+ return new JAXBElement<TImport>(_Import_QNAME, TImport.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TResourceAssignmentExpression }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "resourceAssignmentExpression")\r
+ public JAXBElement<TResourceAssignmentExpression> createResourceAssignmentExpression(TResourceAssignmentExpression value) {\r
+ return new JAXBElement<TResourceAssignmentExpression>(_ResourceAssignmentExpression_QNAME, TResourceAssignmentExpression.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "eventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TEventDefinition> createEventDefinition(TEventDefinition value) {\r
+ return new JAXBElement<TEventDefinition>(_EventDefinition_QNAME, TEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TMonitoring }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "monitoring")\r
+ public JAXBElement<TMonitoring> createMonitoring(TMonitoring value) {\r
+ return new JAXBElement<TMonitoring>(_Monitoring_QNAME, TMonitoring.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TThrowEvent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "throwEvent")\r
+ public JAXBElement<TThrowEvent> createThrowEvent(TThrowEvent value) {\r
+ return new JAXBElement<TThrowEvent>(_ThrowEvent_QNAME, TThrowEvent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TItemDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "itemDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TItemDefinition> createItemDefinition(TItemDefinition value) {\r
+ return new JAXBElement<TItemDefinition>(_ItemDefinition_QNAME, TItemDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TAdHocSubProcess }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "adHocSubProcess", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TAdHocSubProcess> createAdHocSubProcess(TAdHocSubProcess value) {\r
+ return new JAXBElement<TAdHocSubProcess>(_AdHocSubProcess_QNAME, TAdHocSubProcess.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TGlobalUserTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "globalUserTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TGlobalUserTask> createGlobalUserTask(TGlobalUserTask value) {\r
+ return new JAXBElement<TGlobalUserTask>(_GlobalUserTask_QNAME, TGlobalUserTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCategory }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "category", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TCategory> createCategory(TCategory value) {\r
+ return new JAXBElement<TCategory>(_Category_QNAME, TCategory.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TStartEvent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "startEvent", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TStartEvent> createStartEvent(TStartEvent value) {\r
+ return new JAXBElement<TStartEvent>(_StartEvent_QNAME, TStartEvent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TParticipant }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "participant")\r
+ public JAXBElement<TParticipant> createParticipant(TParticipant value) {\r
+ return new JAXBElement<TParticipant>(_Participant_QNAME, TParticipant.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TPerformer }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "performer", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "resourceRole")\r
+ public JAXBElement<TPerformer> createPerformer(TPerformer value) {\r
+ return new JAXBElement<TPerformer>(_Performer_QNAME, TPerformer.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TFormalExpression }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "formalExpression", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "expression")\r
+ public JAXBElement<TFormalExpression> createFormalExpression(TFormalExpression value) {\r
+ return new JAXBElement<TFormalExpression>(_FormalExpression_QNAME, TFormalExpression.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TMessageEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "messageEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TMessageEventDefinition> createMessageEventDefinition(TMessageEventDefinition value) {\r
+ return new JAXBElement<TMessageEventDefinition>(_MessageEventDefinition_QNAME, TMessageEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Edge }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "Edge")\r
+ public JAXBElement<Edge> createEdge(Edge value) {\r
+ return new JAXBElement<Edge>(_Edge_QNAME, Edge.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCatchEvent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "catchEvent")\r
+ public JAXBElement<TCatchEvent> createCatchEvent(TCatchEvent value) {\r
+ return new JAXBElement<TCatchEvent>(_CatchEvent_QNAME, TCatchEvent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TParticipantAssociation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "participantAssociation")\r
+ public JAXBElement<TParticipantAssociation> createParticipantAssociation(TParticipantAssociation value) {\r
+ return new JAXBElement<TParticipantAssociation>(_ParticipantAssociation_QNAME, TParticipantAssociation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataOutputAssociation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataOutputAssociation")\r
+ public JAXBElement<TDataOutputAssociation> createDataOutputAssociation(TDataOutputAssociation value) {\r
+ return new JAXBElement<TDataOutputAssociation>(_DataOutputAssociation_QNAME, TDataOutputAssociation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataObjectReference }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataObjectReference", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TDataObjectReference> createDataObjectReference(TDataObjectReference value) {\r
+ return new JAXBElement<TDataObjectReference>(_DataObjectReference_QNAME, TDataObjectReference.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TBoundaryEvent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "boundaryEvent", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TBoundaryEvent> createBoundaryEvent(TBoundaryEvent value) {\r
+ return new JAXBElement<TBoundaryEvent>(_BoundaryEvent_QNAME, TBoundaryEvent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TSendTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "sendTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TSendTask> createSendTask(TSendTask value) {\r
+ return new JAXBElement<TSendTask>(_SendTask_QNAME, TSendTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCategoryValue }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "categoryValue")\r
+ public JAXBElement<TCategoryValue> createCategoryValue(TCategoryValue value) {\r
+ return new JAXBElement<TCategoryValue>(_CategoryValue_QNAME, TCategoryValue.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TChoreography }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "choreography", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "collaboration")\r
+ public JAXBElement<TChoreography> createChoreography(TChoreography value) {\r
+ return new JAXBElement<TChoreography>(_Choreography_QNAME, TChoreography.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TGlobalChoreographyTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "globalChoreographyTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "choreography")\r
+ public JAXBElement<TGlobalChoreographyTask> createGlobalChoreographyTask(TGlobalChoreographyTask value) {\r
+ return new JAXBElement<TGlobalChoreographyTask>(_GlobalChoreographyTask_QNAME, TGlobalChoreographyTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCallChoreography }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "callChoreography", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TCallChoreography> createCallChoreography(TCallChoreography value) {\r
+ return new JAXBElement<TCallChoreography>(_CallChoreography_QNAME, TCallChoreography.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Bounds }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DC", name = "Bounds")\r
+ public JAXBElement<Bounds> createBounds(Bounds value) {\r
+ return new JAXBElement<Bounds>(_Bounds_QNAME, Bounds.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TMultiInstanceLoopCharacteristics }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "multiInstanceLoopCharacteristics", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "loopCharacteristics")\r
+ public JAXBElement<TMultiInstanceLoopCharacteristics> createMultiInstanceLoopCharacteristics(TMultiInstanceLoopCharacteristics value) {\r
+ return new JAXBElement<TMultiInstanceLoopCharacteristics>(_MultiInstanceLoopCharacteristics_QNAME, TMultiInstanceLoopCharacteristics.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TPotentialOwner }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "potentialOwner", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "performer")\r
+ public JAXBElement<TPotentialOwner> createPotentialOwner(TPotentialOwner value) {\r
+ return new JAXBElement<TPotentialOwner>(_PotentialOwner_QNAME, TPotentialOwner.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCorrelationPropertyBinding }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "correlationPropertyBinding")\r
+ public JAXBElement<TCorrelationPropertyBinding> createCorrelationPropertyBinding(TCorrelationPropertyBinding value) {\r
+ return new JAXBElement<TCorrelationPropertyBinding>(_CorrelationPropertyBinding_QNAME, TCorrelationPropertyBinding.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TSignal }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "signal", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TSignal> createSignal(TSignal value) {\r
+ return new JAXBElement<TSignal>(_Signal_QNAME, TSignal.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TUserTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "userTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TUserTask> createUserTask(TUserTask value) {\r
+ return new JAXBElement<TUserTask>(_UserTask_QNAME, TUserTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TParallelGateway }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "parallelGateway", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TParallelGateway> createParallelGateway(TParallelGateway value) {\r
+ return new JAXBElement<TParallelGateway>(_ParallelGateway_QNAME, TParallelGateway.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TLane }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "lane")\r
+ public JAXBElement<TLane> createLane(TLane value) {\r
+ return new JAXBElement<TLane>(_Lane_QNAME, TLane.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TSubConversation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "subConversation", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "conversationNode")\r
+ public JAXBElement<TSubConversation> createSubConversation(TSubConversation value) {\r
+ return new JAXBElement<TSubConversation>(_SubConversation_QNAME, TSubConversation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link BPMNEdge }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/DI", name = "BPMNEdge", substitutionHeadNamespace = "http://www.omg.org/spec/DD/20100524/DI", substitutionHeadName = "DiagramElement")\r
+ public JAXBElement<BPMNEdge> createBPMNEdge(BPMNEdge value) {\r
+ return new JAXBElement<BPMNEdge>(_BPMNEdge_QNAME, BPMNEdge.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TBaseElementWithMixedContent }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "baseElementWithMixedContent")\r
+ public JAXBElement<TBaseElementWithMixedContent> createBaseElementWithMixedContent(TBaseElementWithMixedContent value) {\r
+ return new JAXBElement<TBaseElementWithMixedContent>(_BaseElementWithMixedContent_QNAME, TBaseElementWithMixedContent.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataStore }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataStore", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TDataStore> createDataStore(TDataStore value) {\r
+ return new JAXBElement<TDataStore>(_DataStore_QNAME, TDataStore.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TSignalEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "signalEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TSignalEventDefinition> createSignalEventDefinition(TSignalEventDefinition value) {\r
+ return new JAXBElement<TSignalEventDefinition>(_SignalEventDefinition_QNAME, TSignalEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TRootElement }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "rootElement")\r
+ public JAXBElement<TRootElement> createRootElement(TRootElement value) {\r
+ return new JAXBElement<TRootElement>(_RootElement_QNAME, TRootElement.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataState }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataState")\r
+ public JAXBElement<TDataState> createDataState(TDataState value) {\r
+ return new JAXBElement<TDataState>(_DataState_QNAME, TDataState.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCorrelationPropertyRetrievalExpression }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "correlationPropertyRetrievalExpression")\r
+ public JAXBElement<TCorrelationPropertyRetrievalExpression> createCorrelationPropertyRetrievalExpression(TCorrelationPropertyRetrievalExpression value) {\r
+ return new JAXBElement<TCorrelationPropertyRetrievalExpression>(_CorrelationPropertyRetrievalExpression_QNAME, TCorrelationPropertyRetrievalExpression.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Node }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "Node")\r
+ public JAXBElement<Node> createNode(Node value) {\r
+ return new JAXBElement<Node>(_Node_QNAME, Node.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TInputOutputSpecification }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "ioSpecification")\r
+ public JAXBElement<TInputOutputSpecification> createIoSpecification(TInputOutputSpecification value) {\r
+ return new JAXBElement<TInputOutputSpecification>(_IoSpecification_QNAME, TInputOutputSpecification.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TConversationAssociation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "conversationAssociation")\r
+ public JAXBElement<TConversationAssociation> createConversationAssociation(TConversationAssociation value) {\r
+ return new JAXBElement<TConversationAssociation>(_ConversationAssociation_QNAME, TConversationAssociation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TLaneSet }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "laneSet")\r
+ public JAXBElement<TLaneSet> createLaneSet(TLaneSet value) {\r
+ return new JAXBElement<TLaneSet>(_LaneSet_QNAME, TLaneSet.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TActivity }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "activity")\r
+ public JAXBElement<TActivity> createActivity(TActivity value) {\r
+ return new JAXBElement<TActivity>(_Activity_QNAME, TActivity.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TGlobalTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "globalTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TGlobalTask> createGlobalTask(TGlobalTask value) {\r
+ return new JAXBElement<TGlobalTask>(_GlobalTask_QNAME, TGlobalTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Diagram }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "Diagram")\r
+ public JAXBElement<Diagram> createDiagram(Diagram value) {\r
+ return new JAXBElement<Diagram>(_Diagram_QNAME, Diagram.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TError }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "error", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TError> createError(TError value) {\r
+ return new JAXBElement<TError>(_Error_QNAME, TError.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "task", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TTask> createTask(TTask value) {\r
+ return new JAXBElement<TTask>(_Task_QNAME, TTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TResource }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "resource", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TResource> createResource(TResource value) {\r
+ return new JAXBElement<TResource>(_Resource_QNAME, TResource.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TInterface }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "interface", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TInterface> createInterface(TInterface value) {\r
+ return new JAXBElement<TInterface>(_Interface_QNAME, TInterface.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCorrelationKey }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "correlationKey")\r
+ public JAXBElement<TCorrelationKey> createCorrelationKey(TCorrelationKey value) {\r
+ return new JAXBElement<TCorrelationKey>(_CorrelationKey_QNAME, TCorrelationKey.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TRendering }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "rendering")\r
+ public JAXBElement<TRendering> createRendering(TRendering value) {\r
+ return new JAXBElement<TRendering>(_Rendering_QNAME, TRendering.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TResourceParameterBinding }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "resourceParameterBinding")\r
+ public JAXBElement<TResourceParameterBinding> createResourceParameterBinding(TResourceParameterBinding value) {\r
+ return new JAXBElement<TResourceParameterBinding>(_ResourceParameterBinding_QNAME, TResourceParameterBinding.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TExclusiveGateway }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "exclusiveGateway", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TExclusiveGateway> createExclusiveGateway(TExclusiveGateway value) {\r
+ return new JAXBElement<TExclusiveGateway>(_ExclusiveGateway_QNAME, TExclusiveGateway.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCorrelationProperty }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "correlationProperty", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TCorrelationProperty> createCorrelationProperty(TCorrelationProperty value) {\r
+ return new JAXBElement<TCorrelationProperty>(_CorrelationProperty_QNAME, TCorrelationProperty.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TMessage }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "message", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TMessage> createMessage(TMessage value) {\r
+ return new JAXBElement<TMessage>(_Message_QNAME, TMessage.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataStoreReference }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataStoreReference", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TDataStoreReference> createDataStoreReference(TDataStoreReference value) {\r
+ return new JAXBElement<TDataStoreReference>(_DataStoreReference_QNAME, TDataStoreReference.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TGlobalManualTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "globalManualTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TGlobalManualTask> createGlobalManualTask(TGlobalManualTask value) {\r
+ return new JAXBElement<TGlobalManualTask>(_GlobalManualTask_QNAME, TGlobalManualTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TEscalation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "escalation", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TEscalation> createEscalation(TEscalation value) {\r
+ return new JAXBElement<TEscalation>(_Escalation_QNAME, TEscalation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCallActivity }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "callActivity", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TCallActivity> createCallActivity(TCallActivity value) {\r
+ return new JAXBElement<TCallActivity>(_CallActivity_QNAME, TCallActivity.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TTextAnnotation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "textAnnotation", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "artifact")\r
+ public JAXBElement<TTextAnnotation> createTextAnnotation(TTextAnnotation value) {\r
+ return new JAXBElement<TTextAnnotation>(_TextAnnotation_QNAME, TTextAnnotation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TGroup }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "group", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "artifact")\r
+ public JAXBElement<TGroup> createGroup(TGroup value) {\r
+ return new JAXBElement<TGroup>(_Group_QNAME, TGroup.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TAuditing }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "auditing")\r
+ public JAXBElement<TAuditing> createAuditing(TAuditing value) {\r
+ return new JAXBElement<TAuditing>(_Auditing_QNAME, TAuditing.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataOutput }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataOutput")\r
+ public JAXBElement<TDataOutput> createDataOutput(TDataOutput value) {\r
+ return new JAXBElement<TDataOutput>(_DataOutput_QNAME, TDataOutput.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Point }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DC", name = "Point")\r
+ public JAXBElement<Point> createPoint(Point value) {\r
+ return new JAXBElement<Point>(_Point_QNAME, Point.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TExpression }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "expression")\r
+ public JAXBElement<TExpression> createExpression(TExpression value) {\r
+ return new JAXBElement<TExpression>(_Expression_QNAME, TExpression.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TTransaction }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "transaction", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TTransaction> createTransaction(TTransaction value) {\r
+ return new JAXBElement<TTransaction>(_Transaction_QNAME, TTransaction.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TChoreographyTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "choreographyTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TChoreographyTask> createChoreographyTask(TChoreographyTask value) {\r
+ return new JAXBElement<TChoreographyTask>(_ChoreographyTask_QNAME, TChoreographyTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TGateway }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "gateway")\r
+ public JAXBElement<TGateway> createGateway(TGateway value) {\r
+ return new JAXBElement<TGateway>(_Gateway_QNAME, TGateway.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TResourceRole }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "resourceRole")\r
+ public JAXBElement<TResourceRole> createResourceRole(TResourceRole value) {\r
+ return new JAXBElement<TResourceRole>(_ResourceRole_QNAME, TResourceRole.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Label }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "Label")\r
+ public JAXBElement<Label> createLabel(Label value) {\r
+ return new JAXBElement<Label>(_Label_QNAME, Label.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TPartnerEntity }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "partnerEntity", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TPartnerEntity> createPartnerEntity(TPartnerEntity value) {\r
+ return new JAXBElement<TPartnerEntity>(_PartnerEntity_QNAME, TPartnerEntity.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TPartnerRole }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "partnerRole", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "rootElement")\r
+ public JAXBElement<TPartnerRole> createPartnerRole(TPartnerRole value) {\r
+ return new JAXBElement<TPartnerRole>(_PartnerRole_QNAME, TPartnerRole.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link BPMNDiagram }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/DI", name = "BPMNDiagram")\r
+ public JAXBElement<BPMNDiagram> createBPMNDiagram(BPMNDiagram value) {\r
+ return new JAXBElement<BPMNDiagram>(_BPMNDiagram_QNAME, BPMNDiagram.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TBusinessRuleTask }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "businessRuleTask", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TBusinessRuleTask> createBusinessRuleTask(TBusinessRuleTask value) {\r
+ return new JAXBElement<TBusinessRuleTask>(_BusinessRuleTask_QNAME, TBusinessRuleTask.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TInputOutputBinding }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "ioBinding")\r
+ public JAXBElement<TInputOutputBinding> createIoBinding(TInputOutputBinding value) {\r
+ return new JAXBElement<TInputOutputBinding>(_IoBinding_QNAME, TInputOutputBinding.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TFlowElement }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "flowElement")\r
+ public JAXBElement<TFlowElement> createFlowElement(TFlowElement value) {\r
+ return new JAXBElement<TFlowElement>(_FlowElement_QNAME, TFlowElement.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataObject }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataObject", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "flowElement")\r
+ public JAXBElement<TDataObject> createDataObject(TDataObject value) {\r
+ return new JAXBElement<TDataObject>(_DataObject_QNAME, TDataObject.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TLinkEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "linkEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TLinkEventDefinition> createLinkEventDefinition(TLinkEventDefinition value) {\r
+ return new JAXBElement<TLinkEventDefinition>(_LinkEventDefinition_QNAME, TLinkEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TResourceParameter }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "resourceParameter")\r
+ public JAXBElement<TResourceParameter> createResourceParameter(TResourceParameter value) {\r
+ return new JAXBElement<TResourceParameter>(_ResourceParameter_QNAME, TResourceParameter.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TText }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "text")\r
+ public JAXBElement<TText> createText(TText value) {\r
+ return new JAXBElement<TText>(_Text_QNAME, TText.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TAssociation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "association", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "artifact")\r
+ public JAXBElement<TAssociation> createAssociation(TAssociation value) {\r
+ return new JAXBElement<TAssociation>(_Association_QNAME, TAssociation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCallConversation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "callConversation", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "conversationNode")\r
+ public JAXBElement<TCallConversation> createCallConversation(TCallConversation value) {\r
+ return new JAXBElement<TCallConversation>(_CallConversation_QNAME, TCallConversation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TEscalationEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "escalationEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TEscalationEventDefinition> createEscalationEventDefinition(TEscalationEventDefinition value) {\r
+ return new JAXBElement<TEscalationEventDefinition>(_EscalationEventDefinition_QNAME, TEscalationEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDefinitions }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "definitions")\r
+ public JAXBElement<TDefinitions> createDefinitions(TDefinitions value) {\r
+ return new JAXBElement<TDefinitions>(_Definitions_QNAME, TDefinitions.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TProperty }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "property")\r
+ public JAXBElement<TProperty> createProperty(TProperty value) {\r
+ return new JAXBElement<TProperty>(_Property_QNAME, TProperty.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link DiagramElement }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DI", name = "DiagramElement")\r
+ public JAXBElement<DiagramElement> createDiagramElement(DiagramElement value) {\r
+ return new JAXBElement<DiagramElement>(_DiagramElement_QNAME, DiagramElement.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TScript }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "script")\r
+ public JAXBElement<TScript> createScript(TScript value) {\r
+ return new JAXBElement<TScript>(_Script_QNAME, TScript.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TDataInput }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataInput")\r
+ public JAXBElement<TDataInput> createDataInput(TDataInput value) {\r
+ return new JAXBElement<TDataInput>(_DataInput_QNAME, TDataInput.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link BPMNShape }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/DI", name = "BPMNShape", substitutionHeadNamespace = "http://www.omg.org/spec/DD/20100524/DI", substitutionHeadName = "DiagramElement")\r
+ public JAXBElement<BPMNShape> createBPMNShape(BPMNShape value) {\r
+ return new JAXBElement<BPMNShape>(_BPMNShape_QNAME, BPMNShape.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link BPMNPlane }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/DI", name = "BPMNPlane")\r
+ public JAXBElement<BPMNPlane> createBPMNPlane(BPMNPlane value) {\r
+ return new JAXBElement<BPMNPlane>(_BPMNPlane_QNAME, BPMNPlane.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TConversationNode }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "conversationNode")\r
+ public JAXBElement<TConversationNode> createConversationNode(TConversationNode value) {\r
+ return new JAXBElement<TConversationNode>(_ConversationNode_QNAME, TConversationNode.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TCompensateEventDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "compensateEventDefinition", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "eventDefinition")\r
+ public JAXBElement<TCompensateEventDefinition> createCompensateEventDefinition(TCompensateEventDefinition value) {\r
+ return new JAXBElement<TCompensateEventDefinition>(_CompensateEventDefinition_QNAME, TCompensateEventDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Font }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/DD/20100524/DC", name = "Font")\r
+ public JAXBElement<Font> createFont(Font value) {\r
+ return new JAXBElement<Font>(_Font_QNAME, Font.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TComplexBehaviorDefinition }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "complexBehaviorDefinition")\r
+ public JAXBElement<TComplexBehaviorDefinition> createComplexBehaviorDefinition(TComplexBehaviorDefinition value) {\r
+ return new JAXBElement<TComplexBehaviorDefinition>(_ComplexBehaviorDefinition_QNAME, TComplexBehaviorDefinition.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TConversationLink }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "conversationLink")\r
+ public JAXBElement<TConversationLink> createConversationLink(TConversationLink value) {\r
+ return new JAXBElement<TConversationLink>(_ConversationLink_QNAME, TConversationLink.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TMessageFlowAssociation }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "messageFlowAssociation")\r
+ public JAXBElement<TMessageFlowAssociation> createMessageFlowAssociation(TMessageFlowAssociation value) {\r
+ return new JAXBElement<TMessageFlowAssociation>(_MessageFlowAssociation_QNAME, TMessageFlowAssociation.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link TStandardLoopCharacteristics }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "standardLoopCharacteristics", substitutionHeadNamespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", substitutionHeadName = "loopCharacteristics")\r
+ public JAXBElement<TStandardLoopCharacteristics> createStandardLoopCharacteristics(TStandardLoopCharacteristics value) {\r
+ return new JAXBElement<TStandardLoopCharacteristics>(_StandardLoopCharacteristics_QNAME, TStandardLoopCharacteristics.class, null, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "whileExecutingInputRefs", scope = TInputSet.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTInputSetWhileExecutingInputRefs(Object value) {\r
+ return new JAXBElement<Object>(_TInputSetWhileExecutingInputRefs_QNAME, Object.class, TInputSet.class, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "outputSetRefs", scope = TInputSet.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTInputSetOutputSetRefs(Object value) {\r
+ return new JAXBElement<Object>(_TInputSetOutputSetRefs_QNAME, Object.class, TInputSet.class, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "optionalInputRefs", scope = TInputSet.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTInputSetOptionalInputRefs(Object value) {\r
+ return new JAXBElement<Object>(_TInputSetOptionalInputRefs_QNAME, Object.class, TInputSet.class, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataInputRefs", scope = TInputSet.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTInputSetDataInputRefs(Object value) {\r
+ return new JAXBElement<Object>(_TInputSetDataInputRefs_QNAME, Object.class, TInputSet.class, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "flowNodeRef", scope = TLane.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTLaneFlowNodeRef(Object value) {\r
+ return new JAXBElement<Object>(_TLaneFlowNodeRef_QNAME, Object.class, TLane.class, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "sourceRef", scope = TDataAssociation.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTDataAssociationSourceRef(Object value) {\r
+ return new JAXBElement<Object>(_TDataAssociationSourceRef_QNAME, Object.class, TDataAssociation.class, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "dataOutputRefs", scope = TOutputSet.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTOutputSetDataOutputRefs(Object value) {\r
+ return new JAXBElement<Object>(_TOutputSetDataOutputRefs_QNAME, Object.class, TOutputSet.class, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "optionalOutputRefs", scope = TOutputSet.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTOutputSetOptionalOutputRefs(Object value) {\r
+ return new JAXBElement<Object>(_TOutputSetOptionalOutputRefs_QNAME, Object.class, TOutputSet.class, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "whileExecutingOutputRefs", scope = TOutputSet.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTOutputSetWhileExecutingOutputRefs(Object value) {\r
+ return new JAXBElement<Object>(_TOutputSetWhileExecutingOutputRefs_QNAME, Object.class, TOutputSet.class, value);\r
+ }\r
+\r
+ /**\r
+ * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}\r
+ * \r
+ */\r
+ @XmlElementDecl(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", name = "inputSetRefs", scope = TOutputSet.class)\r
+ @XmlIDREF\r
+ public JAXBElement<Object> createTOutputSetInputSetRefs(Object value) {\r
+ return new JAXBElement<Object>(_TOutputSetInputSetRefs_QNAME, Object.class, TOutputSet.class, value);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for ParticipantBandKind.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="ParticipantBandKind">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="top_initiating"/>\r
+ * <enumeration value="middle_initiating"/>\r
+ * <enumeration value="bottom_initiating"/>\r
+ * <enumeration value="top_non_initiating"/>\r
+ * <enumeration value="middle_non_initiating"/>\r
+ * <enumeration value="bottom_non_initiating"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "ParticipantBandKind", namespace = "http://www.omg.org/spec/BPMN/20100524/DI")\r
+@XmlEnum\r
+public enum ParticipantBandKind {\r
+\r
+ @XmlEnumValue("top_initiating")\r
+ TOP_INITIATING("top_initiating"),\r
+ @XmlEnumValue("middle_initiating")\r
+ MIDDLE_INITIATING("middle_initiating"),\r
+ @XmlEnumValue("bottom_initiating")\r
+ BOTTOM_INITIATING("bottom_initiating"),\r
+ @XmlEnumValue("top_non_initiating")\r
+ TOP_NON_INITIATING("top_non_initiating"),\r
+ @XmlEnumValue("middle_non_initiating")\r
+ MIDDLE_NON_INITIATING("middle_non_initiating"),\r
+ @XmlEnumValue("bottom_non_initiating")\r
+ BOTTOM_NON_INITIATING("bottom_non_initiating");\r
+ private final String value;\r
+\r
+ ParticipantBandKind(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static ParticipantBandKind fromValue(String v) {\r
+ for (ParticipantBandKind c: ParticipantBandKind.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for Plane complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Plane">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}Node">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/DD/20100524/DI}DiagramElement" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Plane", namespace = "http://www.omg.org/spec/DD/20100524/DI", propOrder = {\r
+ "diagramElement"\r
+})\r
+@XmlSeeAlso({\r
+ BPMNPlane.class\r
+})\r
+public abstract class Plane\r
+ extends Node\r
+{\r
+\r
+ @XmlElementRef(name = "DiagramElement", namespace = "http://www.omg.org/spec/DD/20100524/DI", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends DiagramElement>> diagramElement;\r
+\r
+ /**\r
+ * Gets the value of the diagramElement property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the diagramElement property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDiagramElement().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link BPMNEdge }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link BPMNShape }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link DiagramElement }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends DiagramElement>> getDiagramElement() {\r
+ if (diagramElement == null) {\r
+ diagramElement = new ArrayList<JAXBElement<? extends DiagramElement>>();\r
+ }\r
+ return this.diagramElement;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for Point complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Point">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <attribute name="x" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />\r
+ * <attribute name="y" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Point", namespace = "http://www.omg.org/spec/DD/20100524/DC")\r
+public class Point {\r
+\r
+ @XmlAttribute(name = "x", required = true)\r
+ protected double x;\r
+ @XmlAttribute(name = "y", required = true)\r
+ protected double y;\r
+\r
+ /**\r
+ * Gets the value of the x property.\r
+ * \r
+ */\r
+ public double getX() {\r
+ return x;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the x property.\r
+ * \r
+ */\r
+ public void setX(double value) {\r
+ this.x = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the y property.\r
+ * \r
+ */\r
+ public double getY() {\r
+ return y;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the y property.\r
+ * \r
+ */\r
+ public void setY(double value) {\r
+ this.y = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for Shape complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Shape">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/DD/20100524/DI}Node">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/DD/20100524/DC}Bounds"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Shape", namespace = "http://www.omg.org/spec/DD/20100524/DI", propOrder = {\r
+ "bounds"\r
+})\r
+@XmlSeeAlso({\r
+ LabeledShape.class\r
+})\r
+public abstract class Shape\r
+ extends Node\r
+{\r
+\r
+ @XmlElement(name = "Bounds", namespace = "http://www.omg.org/spec/DD/20100524/DC", required = true)\r
+ protected Bounds bounds;\r
+\r
+ /**\r
+ * Gets the value of the bounds property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Bounds }\r
+ * \r
+ */\r
+ public Bounds getBounds() {\r
+ return bounds;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the bounds property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Bounds }\r
+ * \r
+ */\r
+ public void setBounds(Bounds value) {\r
+ this.bounds = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlID;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;\r
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\r
+\r
+\r
+/**\r
+ * <p>Java class for Style complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="Style">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "Style", namespace = "http://www.omg.org/spec/DD/20100524/DI")\r
+@XmlSeeAlso({\r
+ BPMNLabelStyle.class\r
+})\r
+public abstract class Style {\r
+\r
+ @XmlAttribute(name = "id")\r
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)\r
+ @XmlID\r
+ @XmlSchemaType(name = "ID")\r
+ protected String id;\r
+\r
+ /**\r
+ * Gets the value of the id property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getId() {\r
+ return id;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the id property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setId(String value) {\r
+ this.id = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.math.BigInteger;\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlIDREF;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tActivity complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tActivity">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFlowNode">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}ioSpecification" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}property" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataInputAssociation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataOutputAssociation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}resourceRole" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}loopCharacteristics" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="isForCompensation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <attribute name="startQuantity" type="{http://www.w3.org/2001/XMLSchema}integer" default="1" />\r
+ * <attribute name="completionQuantity" type="{http://www.w3.org/2001/XMLSchema}integer" default="1" />\r
+ * <attribute name="default" type="{http://www.w3.org/2001/XMLSchema}IDREF" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tActivity", propOrder = {\r
+ "ioSpecification",\r
+ "property",\r
+ "dataInputAssociation",\r
+ "dataOutputAssociation",\r
+ "resourceRole",\r
+ "loopCharacteristics"\r
+})\r
+@XmlSeeAlso({\r
+ TSubProcess.class,\r
+ TTask.class,\r
+ TCallActivity.class\r
+})\r
+public abstract class TActivity\r
+ extends TFlowNode\r
+{\r
+\r
+ protected TInputOutputSpecification ioSpecification;\r
+ protected List<TProperty> property;\r
+ protected List<TDataInputAssociation> dataInputAssociation;\r
+ protected List<TDataOutputAssociation> dataOutputAssociation;\r
+ @XmlElementRef(name = "resourceRole", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TResourceRole>> resourceRole;\r
+ @XmlElementRef(name = "loopCharacteristics", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected JAXBElement<? extends TLoopCharacteristics> loopCharacteristics;\r
+ @XmlAttribute(name = "isForCompensation")\r
+ protected Boolean isForCompensation;\r
+ @XmlAttribute(name = "startQuantity")\r
+ protected BigInteger startQuantity;\r
+ @XmlAttribute(name = "completionQuantity")\r
+ protected BigInteger completionQuantity;\r
+ @XmlAttribute(name = "default")\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object _default;\r
+\r
+ /**\r
+ * Gets the value of the ioSpecification property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TInputOutputSpecification }\r
+ * \r
+ */\r
+ public TInputOutputSpecification getIoSpecification() {\r
+ return ioSpecification;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the ioSpecification property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TInputOutputSpecification }\r
+ * \r
+ */\r
+ public void setIoSpecification(TInputOutputSpecification value) {\r
+ this.ioSpecification = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the property property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the property property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getProperty().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TProperty }\r
+ * \r
+ * \r
+ */\r
+ public List<TProperty> getProperty() {\r
+ if (property == null) {\r
+ property = new ArrayList<TProperty>();\r
+ }\r
+ return this.property;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the dataInputAssociation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataInputAssociation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataInputAssociation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDataInputAssociation }\r
+ * \r
+ * \r
+ */\r
+ public List<TDataInputAssociation> getDataInputAssociation() {\r
+ if (dataInputAssociation == null) {\r
+ dataInputAssociation = new ArrayList<TDataInputAssociation>();\r
+ }\r
+ return this.dataInputAssociation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the dataOutputAssociation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataOutputAssociation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataOutputAssociation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDataOutputAssociation }\r
+ * \r
+ * \r
+ */\r
+ public List<TDataOutputAssociation> getDataOutputAssociation() {\r
+ if (dataOutputAssociation == null) {\r
+ dataOutputAssociation = new ArrayList<TDataOutputAssociation>();\r
+ }\r
+ return this.dataOutputAssociation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the resourceRole property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the resourceRole property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getResourceRole().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TPerformer }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TResourceRole }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TPotentialOwner }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link THumanPerformer }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TResourceRole>> getResourceRole() {\r
+ if (resourceRole == null) {\r
+ resourceRole = new ArrayList<JAXBElement<? extends TResourceRole>>();\r
+ }\r
+ return this.resourceRole;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the loopCharacteristics property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link JAXBElement }{@code <}{@link TLoopCharacteristics }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TMultiInstanceLoopCharacteristics }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TStandardLoopCharacteristics }{@code >}\r
+ * \r
+ */\r
+ public JAXBElement<? extends TLoopCharacteristics> getLoopCharacteristics() {\r
+ return loopCharacteristics;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the loopCharacteristics property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link JAXBElement }{@code <}{@link TLoopCharacteristics }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TMultiInstanceLoopCharacteristics }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TStandardLoopCharacteristics }{@code >}\r
+ * \r
+ */\r
+ public void setLoopCharacteristics(JAXBElement<? extends TLoopCharacteristics> value) {\r
+ this.loopCharacteristics = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isForCompensation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsForCompensation() {\r
+ if (isForCompensation == null) {\r
+ return false;\r
+ } else {\r
+ return isForCompensation;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isForCompensation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsForCompensation(Boolean value) {\r
+ this.isForCompensation = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the startQuantity property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link BigInteger }\r
+ * \r
+ */\r
+ public BigInteger getStartQuantity() {\r
+ if (startQuantity == null) {\r
+ return new BigInteger("1");\r
+ } else {\r
+ return startQuantity;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the startQuantity property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link BigInteger }\r
+ * \r
+ */\r
+ public void setStartQuantity(BigInteger value) {\r
+ this.startQuantity = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the completionQuantity property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link BigInteger }\r
+ * \r
+ */\r
+ public BigInteger getCompletionQuantity() {\r
+ if (completionQuantity == null) {\r
+ return new BigInteger("1");\r
+ } else {\r
+ return completionQuantity;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the completionQuantity property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link BigInteger }\r
+ * \r
+ */\r
+ public void setCompletionQuantity(BigInteger value) {\r
+ this.completionQuantity = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the default property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getDefault() {\r
+ return _default;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the default property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setDefault(Object value) {\r
+ this._default = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tAdHocOrdering.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="tAdHocOrdering">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="Parallel"/>\r
+ * <enumeration value="Sequential"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "tAdHocOrdering")\r
+@XmlEnum\r
+public enum TAdHocOrdering {\r
+\r
+ @XmlEnumValue("Parallel")\r
+ PARALLEL("Parallel"),\r
+ @XmlEnumValue("Sequential")\r
+ SEQUENTIAL("Sequential");\r
+ private final String value;\r
+\r
+ TAdHocOrdering(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static TAdHocOrdering fromValue(String v) {\r
+ for (TAdHocOrdering c: TAdHocOrdering.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tAdHocSubProcess complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tAdHocSubProcess">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tSubProcess">\r
+ * <sequence>\r
+ * <element name="completionCondition" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="cancelRemainingInstances" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />\r
+ * <attribute name="ordering" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tAdHocOrdering" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tAdHocSubProcess", propOrder = {\r
+ "completionCondition"\r
+})\r
+public class TAdHocSubProcess\r
+ extends TSubProcess\r
+{\r
+\r
+ protected TExpression completionCondition;\r
+ @XmlAttribute(name = "cancelRemainingInstances")\r
+ protected Boolean cancelRemainingInstances;\r
+ @XmlAttribute(name = "ordering")\r
+ protected TAdHocOrdering ordering;\r
+\r
+ /**\r
+ * Gets the value of the completionCondition property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getCompletionCondition() {\r
+ return completionCondition;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the completionCondition property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setCompletionCondition(TExpression value) {\r
+ this.completionCondition = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the cancelRemainingInstances property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isCancelRemainingInstances() {\r
+ if (cancelRemainingInstances == null) {\r
+ return true;\r
+ } else {\r
+ return cancelRemainingInstances;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the cancelRemainingInstances property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setCancelRemainingInstances(Boolean value) {\r
+ this.cancelRemainingInstances = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the ordering property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TAdHocOrdering }\r
+ * \r
+ */\r
+ public TAdHocOrdering getOrdering() {\r
+ return ordering;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the ordering property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TAdHocOrdering }\r
+ * \r
+ */\r
+ public void setOrdering(TAdHocOrdering value) {\r
+ this.ordering = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tArtifact complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tArtifact">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tArtifact")\r
+@XmlSeeAlso({\r
+ TAssociation.class,\r
+ TGroup.class,\r
+ TTextAnnotation.class\r
+})\r
+public abstract class TArtifact\r
+ extends TBaseElement\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tAssignment complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tAssignment">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="from" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression"/>\r
+ * <element name="to" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tAssignment", propOrder = {\r
+ "from",\r
+ "to"\r
+})\r
+public class TAssignment\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected TExpression from;\r
+ @XmlElement(required = true)\r
+ protected TExpression to;\r
+\r
+ /**\r
+ * Gets the value of the from property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getFrom() {\r
+ return from;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the from property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setFrom(TExpression value) {\r
+ this.from = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the to property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getTo() {\r
+ return to;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the to property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setTo(TExpression value) {\r
+ this.to = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tAssociation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tAssociation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tArtifact">\r
+ * <attribute name="sourceRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="targetRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="associationDirection" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tAssociationDirection" default="None" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tAssociation")\r
+public class TAssociation\r
+ extends TArtifact\r
+{\r
+\r
+ @XmlAttribute(name = "sourceRef", required = true)\r
+ protected QName sourceRef;\r
+ @XmlAttribute(name = "targetRef", required = true)\r
+ protected QName targetRef;\r
+ @XmlAttribute(name = "associationDirection")\r
+ protected TAssociationDirection associationDirection;\r
+\r
+ /**\r
+ * Gets the value of the sourceRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getSourceRef() {\r
+ return sourceRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the sourceRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setSourceRef(QName value) {\r
+ this.sourceRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the targetRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getTargetRef() {\r
+ return targetRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the targetRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setTargetRef(QName value) {\r
+ this.targetRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the associationDirection property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TAssociationDirection }\r
+ * \r
+ */\r
+ public TAssociationDirection getAssociationDirection() {\r
+ if (associationDirection == null) {\r
+ return TAssociationDirection.NONE;\r
+ } else {\r
+ return associationDirection;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the associationDirection property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TAssociationDirection }\r
+ * \r
+ */\r
+ public void setAssociationDirection(TAssociationDirection value) {\r
+ this.associationDirection = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tAssociationDirection.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="tAssociationDirection">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="None"/>\r
+ * <enumeration value="One"/>\r
+ * <enumeration value="Both"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "tAssociationDirection")\r
+@XmlEnum\r
+public enum TAssociationDirection {\r
+\r
+ @XmlEnumValue("None")\r
+ NONE("None"),\r
+ @XmlEnumValue("One")\r
+ ONE("One"),\r
+ @XmlEnumValue("Both")\r
+ BOTH("Both");\r
+ private final String value;\r
+\r
+ TAssociationDirection(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static TAssociationDirection fromValue(String v) {\r
+ for (TAssociationDirection c: TAssociationDirection.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tAuditing complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tAuditing">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tAuditing")\r
+public class TAuditing\r
+ extends TBaseElement\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAnyAttribute;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlID;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;\r
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tBaseElement complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tBaseElement">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}documentation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}extensionElements" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tBaseElement", propOrder = {\r
+ "documentation",\r
+ "extensionElements"\r
+})\r
+@XmlSeeAlso({\r
+ TOperation.class,\r
+ TCorrelationSubscription.class,\r
+ TResourceAssignmentExpression.class,\r
+ TMonitoring.class,\r
+ TParticipant.class,\r
+ TParticipantMultiplicity.class,\r
+ TInputSet.class,\r
+ TOutputSet.class,\r
+ TRelationship.class,\r
+ TAssignment.class,\r
+ TMessageFlow.class,\r
+ TInputOutputBinding.class,\r
+ TResourceParameter.class,\r
+ TProperty.class,\r
+ TDataInput.class,\r
+ TComplexBehaviorDefinition.class,\r
+ TMessageFlowAssociation.class,\r
+ TConversationLink.class,\r
+ TParticipantAssociation.class,\r
+ TDataAssociation.class,\r
+ TCategoryValue.class,\r
+ TLoopCharacteristics.class,\r
+ TCorrelationPropertyBinding.class,\r
+ TResourceRole.class,\r
+ TConversationNode.class,\r
+ TLane.class,\r
+ TCorrelationPropertyRetrievalExpression.class,\r
+ TDataState.class,\r
+ TLaneSet.class,\r
+ TConversationAssociation.class,\r
+ TInputOutputSpecification.class,\r
+ TCorrelationKey.class,\r
+ TResourceParameterBinding.class,\r
+ TRendering.class,\r
+ TFlowElement.class,\r
+ TRootElement.class,\r
+ TAuditing.class,\r
+ TArtifact.class,\r
+ TDataOutput.class\r
+})\r
+public abstract class TBaseElement {\r
+\r
+ protected List<TDocumentation> documentation;\r
+ protected TExtensionElements extensionElements;\r
+ @XmlAttribute(name = "id")\r
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)\r
+ @XmlID\r
+ @XmlSchemaType(name = "ID")\r
+ protected String id;\r
+ @XmlAnyAttribute\r
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();\r
+\r
+ /**\r
+ * Gets the value of the documentation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the documentation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDocumentation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDocumentation }\r
+ * \r
+ * \r
+ */\r
+ public List<TDocumentation> getDocumentation() {\r
+ if (documentation == null) {\r
+ documentation = new ArrayList<TDocumentation>();\r
+ }\r
+ return this.documentation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the extensionElements property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExtensionElements }\r
+ * \r
+ */\r
+ public TExtensionElements getExtensionElements() {\r
+ return extensionElements;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the extensionElements property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExtensionElements }\r
+ * \r
+ */\r
+ public void setExtensionElements(TExtensionElements value) {\r
+ this.extensionElements = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the id property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getId() {\r
+ return id;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the id property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setId(String value) {\r
+ this.id = value;\r
+ }\r
+\r
+ /**\r
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.\r
+ * \r
+ * <p>\r
+ * the map is keyed by the name of the attribute and \r
+ * the value is the string value of the attribute.\r
+ * \r
+ * the map returned by this method is live, and you can add new attribute\r
+ * by updating the map directly. Because of this design, there's no setter.\r
+ * \r
+ * \r
+ * @return\r
+ * always non-null\r
+ */\r
+ public Map<QName, String> getOtherAttributes() {\r
+ return otherAttributes;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.io.Serializable;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAnyAttribute;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlElementRefs;\r
+import javax.xml.bind.annotation.XmlID;\r
+import javax.xml.bind.annotation.XmlMixed;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;\r
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tBaseElementWithMixedContent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tBaseElementWithMixedContent">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}documentation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}extensionElements" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tBaseElementWithMixedContent", propOrder = {\r
+ "content"\r
+})\r
+@XmlSeeAlso({\r
+ TExpression.class\r
+})\r
+public abstract class TBaseElementWithMixedContent {\r
+\r
+ @XmlElementRefs({\r
+ @XmlElementRef(name = "extensionElements", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class),\r
+ @XmlElementRef(name = "documentation", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ })\r
+ @XmlMixed\r
+ protected List<Serializable> content;\r
+ @XmlAttribute(name = "id")\r
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)\r
+ @XmlID\r
+ @XmlSchemaType(name = "ID")\r
+ protected String id;\r
+ @XmlAnyAttribute\r
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();\r
+\r
+ /**\r
+ * Gets the value of the content property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the content property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getContent().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TDocumentation }{@code >}\r
+ * {@link String }\r
+ * {@link JAXBElement }{@code <}{@link TExtensionElements }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<Serializable> getContent() {\r
+ if (content == null) {\r
+ content = new ArrayList<Serializable>();\r
+ }\r
+ return this.content;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the id property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getId() {\r
+ return id;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the id property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setId(String value) {\r
+ this.id = value;\r
+ }\r
+\r
+ /**\r
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.\r
+ * \r
+ * <p>\r
+ * the map is keyed by the name of the attribute and \r
+ * the value is the string value of the attribute.\r
+ * \r
+ * the map returned by this method is live, and you can add new attribute\r
+ * by updating the map directly. Because of this design, there's no setter.\r
+ * \r
+ * \r
+ * @return\r
+ * always non-null\r
+ */\r
+ public Map<QName, String> getOtherAttributes() {\r
+ return otherAttributes;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tBoundaryEvent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tBoundaryEvent">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tCatchEvent">\r
+ * <attribute name="cancelActivity" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />\r
+ * <attribute name="attachedToRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tBoundaryEvent")\r
+public class TBoundaryEvent\r
+ extends TCatchEvent\r
+{\r
+\r
+ @XmlAttribute(name = "cancelActivity")\r
+ protected Boolean cancelActivity;\r
+ @XmlAttribute(name = "attachedToRef", required = true)\r
+ protected QName attachedToRef;\r
+\r
+ /**\r
+ * Gets the value of the cancelActivity property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isCancelActivity() {\r
+ if (cancelActivity == null) {\r
+ return true;\r
+ } else {\r
+ return cancelActivity;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the cancelActivity property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setCancelActivity(Boolean value) {\r
+ this.cancelActivity = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the attachedToRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getAttachedToRef() {\r
+ return attachedToRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the attachedToRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setAttachedToRef(QName value) {\r
+ this.attachedToRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tBusinessRuleTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tBusinessRuleTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tTask">\r
+ * <attribute name="implementation" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tImplementation" default="##unspecified" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tBusinessRuleTask")\r
+public class TBusinessRuleTask\r
+ extends TTask\r
+{\r
+\r
+ @XmlAttribute(name = "implementation")\r
+ protected String implementation;\r
+\r
+ /**\r
+ * Gets the value of the implementation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getImplementation() {\r
+ if (implementation == null) {\r
+ return "##unspecified";\r
+ } else {\r
+ return implementation;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the implementation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setImplementation(String value) {\r
+ this.implementation = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCallActivity complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCallActivity">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tActivity">\r
+ * <attribute name="calledElement" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCallActivity")\r
+public class TCallActivity\r
+ extends TActivity\r
+{\r
+\r
+ @XmlAttribute(name = "calledElement")\r
+ protected QName calledElement;\r
+\r
+ /**\r
+ * Gets the value of the calledElement property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getCalledElement() {\r
+ return calledElement;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the calledElement property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setCalledElement(QName value) {\r
+ this.calledElement = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCallChoreography complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCallChoreography">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tChoreographyActivity">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}participantAssociation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="calledChoreographyRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCallChoreography", propOrder = {\r
+ "participantAssociation"\r
+})\r
+public class TCallChoreography\r
+ extends TChoreographyActivity\r
+{\r
+\r
+ protected List<TParticipantAssociation> participantAssociation;\r
+ @XmlAttribute(name = "calledChoreographyRef")\r
+ protected QName calledChoreographyRef;\r
+\r
+ /**\r
+ * Gets the value of the participantAssociation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the participantAssociation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getParticipantAssociation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TParticipantAssociation }\r
+ * \r
+ * \r
+ */\r
+ public List<TParticipantAssociation> getParticipantAssociation() {\r
+ if (participantAssociation == null) {\r
+ participantAssociation = new ArrayList<TParticipantAssociation>();\r
+ }\r
+ return this.participantAssociation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the calledChoreographyRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getCalledChoreographyRef() {\r
+ return calledChoreographyRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the calledChoreographyRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setCalledChoreographyRef(QName value) {\r
+ this.calledChoreographyRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCallConversation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCallConversation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tConversationNode">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}participantAssociation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="calledCollaborationRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCallConversation", propOrder = {\r
+ "participantAssociation"\r
+})\r
+public class TCallConversation\r
+ extends TConversationNode\r
+{\r
+\r
+ protected List<TParticipantAssociation> participantAssociation;\r
+ @XmlAttribute(name = "calledCollaborationRef")\r
+ protected QName calledCollaborationRef;\r
+\r
+ /**\r
+ * Gets the value of the participantAssociation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the participantAssociation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getParticipantAssociation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TParticipantAssociation }\r
+ * \r
+ * \r
+ */\r
+ public List<TParticipantAssociation> getParticipantAssociation() {\r
+ if (participantAssociation == null) {\r
+ participantAssociation = new ArrayList<TParticipantAssociation>();\r
+ }\r
+ return this.participantAssociation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the calledCollaborationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getCalledCollaborationRef() {\r
+ return calledCollaborationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the calledCollaborationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setCalledCollaborationRef(QName value) {\r
+ this.calledCollaborationRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCallableElement complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCallableElement">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <sequence>\r
+ * <element name="supportedInterfaceRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}ioSpecification" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}ioBinding" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCallableElement", propOrder = {\r
+ "supportedInterfaceRef",\r
+ "ioSpecification",\r
+ "ioBinding"\r
+})\r
+@XmlSeeAlso({\r
+ TProcess.class,\r
+ TGlobalTask.class\r
+})\r
+public class TCallableElement\r
+ extends TRootElement\r
+{\r
+\r
+ protected List<QName> supportedInterfaceRef;\r
+ protected TInputOutputSpecification ioSpecification;\r
+ protected List<TInputOutputBinding> ioBinding;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the supportedInterfaceRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the supportedInterfaceRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getSupportedInterfaceRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getSupportedInterfaceRef() {\r
+ if (supportedInterfaceRef == null) {\r
+ supportedInterfaceRef = new ArrayList<QName>();\r
+ }\r
+ return this.supportedInterfaceRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the ioSpecification property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TInputOutputSpecification }\r
+ * \r
+ */\r
+ public TInputOutputSpecification getIoSpecification() {\r
+ return ioSpecification;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the ioSpecification property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TInputOutputSpecification }\r
+ * \r
+ */\r
+ public void setIoSpecification(TInputOutputSpecification value) {\r
+ this.ioSpecification = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the ioBinding property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the ioBinding property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getIoBinding().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TInputOutputBinding }\r
+ * \r
+ * \r
+ */\r
+ public List<TInputOutputBinding> getIoBinding() {\r
+ if (ioBinding == null) {\r
+ ioBinding = new ArrayList<TInputOutputBinding>();\r
+ }\r
+ return this.ioBinding;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCancelEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCancelEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCancelEventDefinition")\r
+public class TCancelEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCatchEvent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCatchEvent">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEvent">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataOutput" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataOutputAssociation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}outputSet" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}eventDefinition" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="eventDefinitionRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="parallelMultiple" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCatchEvent", propOrder = {\r
+ "dataOutput",\r
+ "dataOutputAssociation",\r
+ "outputSet",\r
+ "eventDefinition",\r
+ "eventDefinitionRef"\r
+})\r
+@XmlSeeAlso({\r
+ TStartEvent.class,\r
+ TIntermediateCatchEvent.class,\r
+ TBoundaryEvent.class\r
+})\r
+public abstract class TCatchEvent\r
+ extends TEvent\r
+{\r
+\r
+ protected List<TDataOutput> dataOutput;\r
+ protected List<TDataOutputAssociation> dataOutputAssociation;\r
+ protected TOutputSet outputSet;\r
+ @XmlElementRef(name = "eventDefinition", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TEventDefinition>> eventDefinition;\r
+ protected List<QName> eventDefinitionRef;\r
+ @XmlAttribute(name = "parallelMultiple")\r
+ protected Boolean parallelMultiple;\r
+\r
+ /**\r
+ * Gets the value of the dataOutput property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataOutput property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataOutput().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDataOutput }\r
+ * \r
+ * \r
+ */\r
+ public List<TDataOutput> getDataOutput() {\r
+ if (dataOutput == null) {\r
+ dataOutput = new ArrayList<TDataOutput>();\r
+ }\r
+ return this.dataOutput;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the dataOutputAssociation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataOutputAssociation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataOutputAssociation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDataOutputAssociation }\r
+ * \r
+ * \r
+ */\r
+ public List<TDataOutputAssociation> getDataOutputAssociation() {\r
+ if (dataOutputAssociation == null) {\r
+ dataOutputAssociation = new ArrayList<TDataOutputAssociation>();\r
+ }\r
+ return this.dataOutputAssociation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outputSet property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TOutputSet }\r
+ * \r
+ */\r
+ public TOutputSet getOutputSet() {\r
+ return outputSet;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the outputSet property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TOutputSet }\r
+ * \r
+ */\r
+ public void setOutputSet(TOutputSet value) {\r
+ this.outputSet = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the eventDefinition property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the eventDefinition property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getEventDefinition().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TCancelEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTimerEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSignalEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TLinkEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TMessageEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCompensateEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TErrorEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEscalationEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTerminateEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TConditionalEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEventDefinition }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TEventDefinition>> getEventDefinition() {\r
+ if (eventDefinition == null) {\r
+ eventDefinition = new ArrayList<JAXBElement<? extends TEventDefinition>>();\r
+ }\r
+ return this.eventDefinition;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the eventDefinitionRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the eventDefinitionRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getEventDefinitionRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getEventDefinitionRef() {\r
+ if (eventDefinitionRef == null) {\r
+ eventDefinitionRef = new ArrayList<QName>();\r
+ }\r
+ return this.eventDefinitionRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the parallelMultiple property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isParallelMultiple() {\r
+ if (parallelMultiple == null) {\r
+ return false;\r
+ } else {\r
+ return parallelMultiple;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the parallelMultiple property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setParallelMultiple(Boolean value) {\r
+ this.parallelMultiple = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCategory complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCategory">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}categoryValue" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCategory", propOrder = {\r
+ "categoryValue"\r
+})\r
+public class TCategory\r
+ extends TRootElement\r
+{\r
+\r
+ protected List<TCategoryValue> categoryValue;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the categoryValue property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the categoryValue property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getCategoryValue().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TCategoryValue }\r
+ * \r
+ * \r
+ */\r
+ public List<TCategoryValue> getCategoryValue() {\r
+ if (categoryValue == null) {\r
+ categoryValue = new ArrayList<TCategoryValue>();\r
+ }\r
+ return this.categoryValue;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCategoryValue complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCategoryValue">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCategoryValue")\r
+public class TCategoryValue\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlAttribute(name = "value")\r
+ protected String value;\r
+\r
+ /**\r
+ * Gets the value of the value property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getValue() {\r
+ return value;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the value property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setValue(String value) {\r
+ this.value = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tChoreography complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tChoreography">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tCollaboration">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}flowElement" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tChoreography", propOrder = {\r
+ "flowElement"\r
+})\r
+@XmlSeeAlso({\r
+ TGlobalChoreographyTask.class\r
+})\r
+public class TChoreography\r
+ extends TCollaboration\r
+{\r
+\r
+ @XmlElementRef(name = "flowElement", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TFlowElement>> flowElement;\r
+\r
+ /**\r
+ * Gets the value of the flowElement property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the flowElement property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getFlowElement().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TFlowElement }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TExclusiveGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEndEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TAdHocSubProcess }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataObjectReference }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TComplexGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TReceiveTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSequenceFlow }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataStoreReference }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSendTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallActivity }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TScriptTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TImplicitThrowEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTransaction }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TIntermediateCatchEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TStartEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSubChoreography }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataObject }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TUserTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TBusinessRuleTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TManualTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallChoreography }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TChoreographyTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TInclusiveGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TBoundaryEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEventBasedGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TIntermediateThrowEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSubProcess }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TParallelGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TServiceTask }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TFlowElement>> getFlowElement() {\r
+ if (flowElement == null) {\r
+ flowElement = new ArrayList<JAXBElement<? extends TFlowElement>>();\r
+ }\r
+ return this.flowElement;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tChoreographyActivity complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tChoreographyActivity">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFlowNode">\r
+ * <sequence>\r
+ * <element name="participantRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="2"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}correlationKey" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="initiatingParticipantRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="loopType" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tChoreographyLoopType" default="None" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tChoreographyActivity", propOrder = {\r
+ "participantRef",\r
+ "correlationKey"\r
+})\r
+@XmlSeeAlso({\r
+ TSubChoreography.class,\r
+ TChoreographyTask.class,\r
+ TCallChoreography.class\r
+})\r
+public abstract class TChoreographyActivity\r
+ extends TFlowNode\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected List<QName> participantRef;\r
+ protected List<TCorrelationKey> correlationKey;\r
+ @XmlAttribute(name = "initiatingParticipantRef", required = true)\r
+ protected QName initiatingParticipantRef;\r
+ @XmlAttribute(name = "loopType")\r
+ protected TChoreographyLoopType loopType;\r
+\r
+ /**\r
+ * Gets the value of the participantRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the participantRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getParticipantRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getParticipantRef() {\r
+ if (participantRef == null) {\r
+ participantRef = new ArrayList<QName>();\r
+ }\r
+ return this.participantRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the correlationKey property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the correlationKey property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getCorrelationKey().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TCorrelationKey }\r
+ * \r
+ * \r
+ */\r
+ public List<TCorrelationKey> getCorrelationKey() {\r
+ if (correlationKey == null) {\r
+ correlationKey = new ArrayList<TCorrelationKey>();\r
+ }\r
+ return this.correlationKey;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the initiatingParticipantRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getInitiatingParticipantRef() {\r
+ return initiatingParticipantRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the initiatingParticipantRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setInitiatingParticipantRef(QName value) {\r
+ this.initiatingParticipantRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the loopType property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TChoreographyLoopType }\r
+ * \r
+ */\r
+ public TChoreographyLoopType getLoopType() {\r
+ if (loopType == null) {\r
+ return TChoreographyLoopType.NONE;\r
+ } else {\r
+ return loopType;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the loopType property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TChoreographyLoopType }\r
+ * \r
+ */\r
+ public void setLoopType(TChoreographyLoopType value) {\r
+ this.loopType = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tChoreographyLoopType.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="tChoreographyLoopType">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="None"/>\r
+ * <enumeration value="Standard"/>\r
+ * <enumeration value="MultiInstanceSequential"/>\r
+ * <enumeration value="MultiInstanceParallel"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "tChoreographyLoopType")\r
+@XmlEnum\r
+public enum TChoreographyLoopType {\r
+\r
+ @XmlEnumValue("None")\r
+ NONE("None"),\r
+ @XmlEnumValue("Standard")\r
+ STANDARD("Standard"),\r
+ @XmlEnumValue("MultiInstanceSequential")\r
+ MULTI_INSTANCE_SEQUENTIAL("MultiInstanceSequential"),\r
+ @XmlEnumValue("MultiInstanceParallel")\r
+ MULTI_INSTANCE_PARALLEL("MultiInstanceParallel");\r
+ private final String value;\r
+\r
+ TChoreographyLoopType(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static TChoreographyLoopType fromValue(String v) {\r
+ for (TChoreographyLoopType c: TChoreographyLoopType.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tChoreographyTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tChoreographyTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tChoreographyActivity">\r
+ * <sequence>\r
+ * <element name="messageFlowRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="2"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tChoreographyTask", propOrder = {\r
+ "messageFlowRef"\r
+})\r
+public class TChoreographyTask\r
+ extends TChoreographyActivity\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected List<QName> messageFlowRef;\r
+\r
+ /**\r
+ * Gets the value of the messageFlowRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the messageFlowRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getMessageFlowRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getMessageFlowRef() {\r
+ if (messageFlowRef == null) {\r
+ messageFlowRef = new ArrayList<QName>();\r
+ }\r
+ return this.messageFlowRef;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCollaboration complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCollaboration">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}participant" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}messageFlow" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}artifact" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}conversationNode" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}conversationAssociation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}participantAssociation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}messageFlowAssociation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}correlationKey" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="choreographyRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}conversationLink" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="isClosed" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCollaboration", propOrder = {\r
+ "participant",\r
+ "messageFlow",\r
+ "artifact",\r
+ "conversationNode",\r
+ "conversationAssociation",\r
+ "participantAssociation",\r
+ "messageFlowAssociation",\r
+ "correlationKey",\r
+ "choreographyRef",\r
+ "conversationLink"\r
+})\r
+@XmlSeeAlso({\r
+ TGlobalConversation.class,\r
+ TChoreography.class\r
+})\r
+public class TCollaboration\r
+ extends TRootElement\r
+{\r
+\r
+ protected List<TParticipant> participant;\r
+ protected List<TMessageFlow> messageFlow;\r
+ @XmlElementRef(name = "artifact", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TArtifact>> artifact;\r
+ @XmlElementRef(name = "conversationNode", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TConversationNode>> conversationNode;\r
+ protected List<TConversationAssociation> conversationAssociation;\r
+ protected List<TParticipantAssociation> participantAssociation;\r
+ protected List<TMessageFlowAssociation> messageFlowAssociation;\r
+ protected List<TCorrelationKey> correlationKey;\r
+ protected List<QName> choreographyRef;\r
+ protected List<TConversationLink> conversationLink;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "isClosed")\r
+ protected Boolean isClosed;\r
+\r
+ /**\r
+ * Gets the value of the participant property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the participant property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getParticipant().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TParticipant }\r
+ * \r
+ * \r
+ */\r
+ public List<TParticipant> getParticipant() {\r
+ if (participant == null) {\r
+ participant = new ArrayList<TParticipant>();\r
+ }\r
+ return this.participant;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the messageFlow property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the messageFlow property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getMessageFlow().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TMessageFlow }\r
+ * \r
+ * \r
+ */\r
+ public List<TMessageFlow> getMessageFlow() {\r
+ if (messageFlow == null) {\r
+ messageFlow = new ArrayList<TMessageFlow>();\r
+ }\r
+ return this.messageFlow;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the artifact property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the artifact property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getArtifact().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TArtifact }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGroup }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTextAnnotation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TAssociation }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TArtifact>> getArtifact() {\r
+ if (artifact == null) {\r
+ artifact = new ArrayList<JAXBElement<? extends TArtifact>>();\r
+ }\r
+ return this.artifact;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the conversationNode property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the conversationNode property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getConversationNode().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TSubConversation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TConversationNode }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TConversation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallConversation }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TConversationNode>> getConversationNode() {\r
+ if (conversationNode == null) {\r
+ conversationNode = new ArrayList<JAXBElement<? extends TConversationNode>>();\r
+ }\r
+ return this.conversationNode;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the conversationAssociation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the conversationAssociation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getConversationAssociation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TConversationAssociation }\r
+ * \r
+ * \r
+ */\r
+ public List<TConversationAssociation> getConversationAssociation() {\r
+ if (conversationAssociation == null) {\r
+ conversationAssociation = new ArrayList<TConversationAssociation>();\r
+ }\r
+ return this.conversationAssociation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the participantAssociation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the participantAssociation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getParticipantAssociation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TParticipantAssociation }\r
+ * \r
+ * \r
+ */\r
+ public List<TParticipantAssociation> getParticipantAssociation() {\r
+ if (participantAssociation == null) {\r
+ participantAssociation = new ArrayList<TParticipantAssociation>();\r
+ }\r
+ return this.participantAssociation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the messageFlowAssociation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the messageFlowAssociation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getMessageFlowAssociation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TMessageFlowAssociation }\r
+ * \r
+ * \r
+ */\r
+ public List<TMessageFlowAssociation> getMessageFlowAssociation() {\r
+ if (messageFlowAssociation == null) {\r
+ messageFlowAssociation = new ArrayList<TMessageFlowAssociation>();\r
+ }\r
+ return this.messageFlowAssociation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the correlationKey property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the correlationKey property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getCorrelationKey().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TCorrelationKey }\r
+ * \r
+ * \r
+ */\r
+ public List<TCorrelationKey> getCorrelationKey() {\r
+ if (correlationKey == null) {\r
+ correlationKey = new ArrayList<TCorrelationKey>();\r
+ }\r
+ return this.correlationKey;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the choreographyRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the choreographyRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getChoreographyRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getChoreographyRef() {\r
+ if (choreographyRef == null) {\r
+ choreographyRef = new ArrayList<QName>();\r
+ }\r
+ return this.choreographyRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the conversationLink property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the conversationLink property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getConversationLink().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TConversationLink }\r
+ * \r
+ * \r
+ */\r
+ public List<TConversationLink> getConversationLink() {\r
+ if (conversationLink == null) {\r
+ conversationLink = new ArrayList<TConversationLink>();\r
+ }\r
+ return this.conversationLink;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isClosed property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsClosed() {\r
+ if (isClosed == null) {\r
+ return false;\r
+ } else {\r
+ return isClosed;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isClosed property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsClosed(Boolean value) {\r
+ this.isClosed = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCompensateEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCompensateEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <attribute name="waitForCompletion" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <attribute name="activityRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCompensateEventDefinition")\r
+public class TCompensateEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+ @XmlAttribute(name = "waitForCompletion")\r
+ protected Boolean waitForCompletion;\r
+ @XmlAttribute(name = "activityRef")\r
+ protected QName activityRef;\r
+\r
+ /**\r
+ * Gets the value of the waitForCompletion property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isWaitForCompletion() {\r
+ return waitForCompletion;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the waitForCompletion property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setWaitForCompletion(Boolean value) {\r
+ this.waitForCompletion = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the activityRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getActivityRef() {\r
+ return activityRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the activityRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setActivityRef(QName value) {\r
+ this.activityRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tComplexBehaviorDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tComplexBehaviorDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="condition" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFormalExpression"/>\r
+ * <element name="event" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tImplicitThrowEvent" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tComplexBehaviorDefinition", propOrder = {\r
+ "condition",\r
+ "event"\r
+})\r
+public class TComplexBehaviorDefinition\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected TFormalExpression condition;\r
+ protected TImplicitThrowEvent event;\r
+\r
+ /**\r
+ * Gets the value of the condition property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TFormalExpression }\r
+ * \r
+ */\r
+ public TFormalExpression getCondition() {\r
+ return condition;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the condition property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TFormalExpression }\r
+ * \r
+ */\r
+ public void setCondition(TFormalExpression value) {\r
+ this.condition = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the event property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TImplicitThrowEvent }\r
+ * \r
+ */\r
+ public TImplicitThrowEvent getEvent() {\r
+ return event;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the event property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TImplicitThrowEvent }\r
+ * \r
+ */\r
+ public void setEvent(TImplicitThrowEvent value) {\r
+ this.event = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlIDREF;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tComplexGateway complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tComplexGateway">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGateway">\r
+ * <sequence>\r
+ * <element name="activationCondition" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="default" type="{http://www.w3.org/2001/XMLSchema}IDREF" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tComplexGateway", propOrder = {\r
+ "activationCondition"\r
+})\r
+public class TComplexGateway\r
+ extends TGateway\r
+{\r
+\r
+ protected TExpression activationCondition;\r
+ @XmlAttribute(name = "default")\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object _default;\r
+\r
+ /**\r
+ * Gets the value of the activationCondition property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getActivationCondition() {\r
+ return activationCondition;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the activationCondition property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setActivationCondition(TExpression value) {\r
+ this.activationCondition = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the default property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getDefault() {\r
+ return _default;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the default property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setDefault(Object value) {\r
+ this._default = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tConditionalEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tConditionalEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <sequence>\r
+ * <element name="condition" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tConditionalEventDefinition", propOrder = {\r
+ "condition"\r
+})\r
+public class TConditionalEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected TExpression condition;\r
+\r
+ /**\r
+ * Gets the value of the condition property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getCondition() {\r
+ return condition;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the condition property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setCondition(TExpression value) {\r
+ this.condition = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tConversation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tConversation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tConversationNode">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tConversation")\r
+public class TConversation\r
+ extends TConversationNode\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tConversationAssociation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tConversationAssociation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <attribute name="innerConversationNodeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="outerConversationNodeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tConversationAssociation")\r
+public class TConversationAssociation\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlAttribute(name = "innerConversationNodeRef", required = true)\r
+ protected QName innerConversationNodeRef;\r
+ @XmlAttribute(name = "outerConversationNodeRef", required = true)\r
+ protected QName outerConversationNodeRef;\r
+\r
+ /**\r
+ * Gets the value of the innerConversationNodeRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getInnerConversationNodeRef() {\r
+ return innerConversationNodeRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the innerConversationNodeRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setInnerConversationNodeRef(QName value) {\r
+ this.innerConversationNodeRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outerConversationNodeRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOuterConversationNodeRef() {\r
+ return outerConversationNodeRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the outerConversationNodeRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOuterConversationNodeRef(QName value) {\r
+ this.outerConversationNodeRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tConversationLink complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tConversationLink">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="sourceRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="targetRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tConversationLink")\r
+public class TConversationLink\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "sourceRef", required = true)\r
+ protected QName sourceRef;\r
+ @XmlAttribute(name = "targetRef", required = true)\r
+ protected QName targetRef;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the sourceRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getSourceRef() {\r
+ return sourceRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the sourceRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setSourceRef(QName value) {\r
+ this.sourceRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the targetRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getTargetRef() {\r
+ return targetRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the targetRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setTargetRef(QName value) {\r
+ this.targetRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tConversationNode complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tConversationNode">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="participantRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="messageFlowRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}correlationKey" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tConversationNode", propOrder = {\r
+ "participantRef",\r
+ "messageFlowRef",\r
+ "correlationKey"\r
+})\r
+@XmlSeeAlso({\r
+ TConversation.class,\r
+ TCallConversation.class,\r
+ TSubConversation.class\r
+})\r
+public abstract class TConversationNode\r
+ extends TBaseElement\r
+{\r
+\r
+ protected List<QName> participantRef;\r
+ protected List<QName> messageFlowRef;\r
+ protected List<TCorrelationKey> correlationKey;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the participantRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the participantRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getParticipantRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getParticipantRef() {\r
+ if (participantRef == null) {\r
+ participantRef = new ArrayList<QName>();\r
+ }\r
+ return this.participantRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the messageFlowRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the messageFlowRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getMessageFlowRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getMessageFlowRef() {\r
+ if (messageFlowRef == null) {\r
+ messageFlowRef = new ArrayList<QName>();\r
+ }\r
+ return this.messageFlowRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the correlationKey property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the correlationKey property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getCorrelationKey().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TCorrelationKey }\r
+ * \r
+ * \r
+ */\r
+ public List<TCorrelationKey> getCorrelationKey() {\r
+ if (correlationKey == null) {\r
+ correlationKey = new ArrayList<TCorrelationKey>();\r
+ }\r
+ return this.correlationKey;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCorrelationKey complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCorrelationKey">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="correlationPropertyRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCorrelationKey", propOrder = {\r
+ "correlationPropertyRef"\r
+})\r
+public class TCorrelationKey\r
+ extends TBaseElement\r
+{\r
+\r
+ protected List<QName> correlationPropertyRef;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the correlationPropertyRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the correlationPropertyRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getCorrelationPropertyRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getCorrelationPropertyRef() {\r
+ if (correlationPropertyRef == null) {\r
+ correlationPropertyRef = new ArrayList<QName>();\r
+ }\r
+ return this.correlationPropertyRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCorrelationProperty complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCorrelationProperty">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}correlationPropertyRetrievalExpression" maxOccurs="unbounded"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCorrelationProperty", propOrder = {\r
+ "correlationPropertyRetrievalExpression"\r
+})\r
+public class TCorrelationProperty\r
+ extends TRootElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected List<TCorrelationPropertyRetrievalExpression> correlationPropertyRetrievalExpression;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "type")\r
+ protected QName type;\r
+\r
+ /**\r
+ * Gets the value of the correlationPropertyRetrievalExpression property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the correlationPropertyRetrievalExpression property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getCorrelationPropertyRetrievalExpression().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TCorrelationPropertyRetrievalExpression }\r
+ * \r
+ * \r
+ */\r
+ public List<TCorrelationPropertyRetrievalExpression> getCorrelationPropertyRetrievalExpression() {\r
+ if (correlationPropertyRetrievalExpression == null) {\r
+ correlationPropertyRetrievalExpression = new ArrayList<TCorrelationPropertyRetrievalExpression>();\r
+ }\r
+ return this.correlationPropertyRetrievalExpression;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the type property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getType() {\r
+ return type;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the type property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setType(QName value) {\r
+ this.type = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCorrelationPropertyBinding complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCorrelationPropertyBinding">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="dataPath" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFormalExpression"/>\r
+ * </sequence>\r
+ * <attribute name="correlationPropertyRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCorrelationPropertyBinding", propOrder = {\r
+ "dataPath"\r
+})\r
+public class TCorrelationPropertyBinding\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected TFormalExpression dataPath;\r
+ @XmlAttribute(name = "correlationPropertyRef", required = true)\r
+ protected QName correlationPropertyRef;\r
+\r
+ /**\r
+ * Gets the value of the dataPath property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TFormalExpression }\r
+ * \r
+ */\r
+ public TFormalExpression getDataPath() {\r
+ return dataPath;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataPath property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TFormalExpression }\r
+ * \r
+ */\r
+ public void setDataPath(TFormalExpression value) {\r
+ this.dataPath = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the correlationPropertyRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getCorrelationPropertyRef() {\r
+ return correlationPropertyRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the correlationPropertyRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setCorrelationPropertyRef(QName value) {\r
+ this.correlationPropertyRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCorrelationPropertyRetrievalExpression complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCorrelationPropertyRetrievalExpression">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="messagePath" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFormalExpression"/>\r
+ * </sequence>\r
+ * <attribute name="messageRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCorrelationPropertyRetrievalExpression", propOrder = {\r
+ "messagePath"\r
+})\r
+public class TCorrelationPropertyRetrievalExpression\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected TFormalExpression messagePath;\r
+ @XmlAttribute(name = "messageRef", required = true)\r
+ protected QName messageRef;\r
+\r
+ /**\r
+ * Gets the value of the messagePath property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TFormalExpression }\r
+ * \r
+ */\r
+ public TFormalExpression getMessagePath() {\r
+ return messagePath;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the messagePath property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TFormalExpression }\r
+ * \r
+ */\r
+ public void setMessagePath(TFormalExpression value) {\r
+ this.messagePath = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the messageRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getMessageRef() {\r
+ return messageRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the messageRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setMessageRef(QName value) {\r
+ this.messageRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tCorrelationSubscription complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tCorrelationSubscription">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}correlationPropertyBinding" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="correlationKeyRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tCorrelationSubscription", propOrder = {\r
+ "correlationPropertyBinding"\r
+})\r
+public class TCorrelationSubscription\r
+ extends TBaseElement\r
+{\r
+\r
+ protected List<TCorrelationPropertyBinding> correlationPropertyBinding;\r
+ @XmlAttribute(name = "correlationKeyRef", required = true)\r
+ protected QName correlationKeyRef;\r
+\r
+ /**\r
+ * Gets the value of the correlationPropertyBinding property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the correlationPropertyBinding property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getCorrelationPropertyBinding().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TCorrelationPropertyBinding }\r
+ * \r
+ * \r
+ */\r
+ public List<TCorrelationPropertyBinding> getCorrelationPropertyBinding() {\r
+ if (correlationPropertyBinding == null) {\r
+ correlationPropertyBinding = new ArrayList<TCorrelationPropertyBinding>();\r
+ }\r
+ return this.correlationPropertyBinding;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the correlationKeyRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getCorrelationKeyRef() {\r
+ return correlationKeyRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the correlationKeyRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setCorrelationKeyRef(QName value) {\r
+ this.correlationKeyRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlIDREF;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataAssociation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataAssociation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="sourceRef" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="targetRef" type="{http://www.w3.org/2001/XMLSchema}IDREF"/>\r
+ * <element name="transformation" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFormalExpression" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}assignment" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataAssociation", propOrder = {\r
+ "sourceRef",\r
+ "targetRef",\r
+ "transformation",\r
+ "assignment"\r
+})\r
+@XmlSeeAlso({\r
+ TDataInputAssociation.class,\r
+ TDataOutputAssociation.class\r
+})\r
+public class TDataAssociation\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElementRef(name = "sourceRef", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> sourceRef;\r
+ @XmlElement(required = true)\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object targetRef;\r
+ protected TFormalExpression transformation;\r
+ protected List<TAssignment> assignment;\r
+\r
+ /**\r
+ * Gets the value of the sourceRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the sourceRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getSourceRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getSourceRef() {\r
+ if (sourceRef == null) {\r
+ sourceRef = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.sourceRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the targetRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getTargetRef() {\r
+ return targetRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the targetRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setTargetRef(Object value) {\r
+ this.targetRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the transformation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TFormalExpression }\r
+ * \r
+ */\r
+ public TFormalExpression getTransformation() {\r
+ return transformation;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the transformation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TFormalExpression }\r
+ * \r
+ */\r
+ public void setTransformation(TFormalExpression value) {\r
+ this.transformation = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the assignment property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the assignment property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getAssignment().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TAssignment }\r
+ * \r
+ * \r
+ */\r
+ public List<TAssignment> getAssignment() {\r
+ if (assignment == null) {\r
+ assignment = new ArrayList<TAssignment>();\r
+ }\r
+ return this.assignment;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataInput complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataInput">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataState" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="itemSubjectRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="isCollection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataInput", propOrder = {\r
+ "dataState"\r
+})\r
+public class TDataInput\r
+ extends TBaseElement\r
+{\r
+\r
+ protected TDataState dataState;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "itemSubjectRef")\r
+ protected QName itemSubjectRef;\r
+ @XmlAttribute(name = "isCollection")\r
+ protected Boolean isCollection;\r
+\r
+ /**\r
+ * Gets the value of the dataState property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public TDataState getDataState() {\r
+ return dataState;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataState property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public void setDataState(TDataState value) {\r
+ this.dataState = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the itemSubjectRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getItemSubjectRef() {\r
+ return itemSubjectRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the itemSubjectRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setItemSubjectRef(QName value) {\r
+ this.itemSubjectRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isCollection property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsCollection() {\r
+ if (isCollection == null) {\r
+ return false;\r
+ } else {\r
+ return isCollection;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isCollection property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsCollection(Boolean value) {\r
+ this.isCollection = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataInputAssociation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataInputAssociation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tDataAssociation">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataInputAssociation")\r
+public class TDataInputAssociation\r
+ extends TDataAssociation\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataObject complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataObject">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFlowElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataState" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="itemSubjectRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="isCollection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataObject", propOrder = {\r
+ "dataState"\r
+})\r
+public class TDataObject\r
+ extends TFlowElement\r
+{\r
+\r
+ protected TDataState dataState;\r
+ @XmlAttribute(name = "itemSubjectRef")\r
+ protected QName itemSubjectRef;\r
+ @XmlAttribute(name = "isCollection")\r
+ protected Boolean isCollection;\r
+\r
+ /**\r
+ * Gets the value of the dataState property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public TDataState getDataState() {\r
+ return dataState;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataState property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public void setDataState(TDataState value) {\r
+ this.dataState = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the itemSubjectRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getItemSubjectRef() {\r
+ return itemSubjectRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the itemSubjectRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setItemSubjectRef(QName value) {\r
+ this.itemSubjectRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isCollection property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsCollection() {\r
+ if (isCollection == null) {\r
+ return false;\r
+ } else {\r
+ return isCollection;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isCollection property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsCollection(Boolean value) {\r
+ this.isCollection = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlIDREF;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataObjectReference complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataObjectReference">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFlowElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataState" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="itemSubjectRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="dataObjectRef" type="{http://www.w3.org/2001/XMLSchema}IDREF" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataObjectReference", propOrder = {\r
+ "dataState"\r
+})\r
+public class TDataObjectReference\r
+ extends TFlowElement\r
+{\r
+\r
+ protected TDataState dataState;\r
+ @XmlAttribute(name = "itemSubjectRef")\r
+ protected QName itemSubjectRef;\r
+ @XmlAttribute(name = "dataObjectRef")\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object dataObjectRef;\r
+\r
+ /**\r
+ * Gets the value of the dataState property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public TDataState getDataState() {\r
+ return dataState;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataState property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public void setDataState(TDataState value) {\r
+ this.dataState = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the itemSubjectRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getItemSubjectRef() {\r
+ return itemSubjectRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the itemSubjectRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setItemSubjectRef(QName value) {\r
+ this.itemSubjectRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the dataObjectRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getDataObjectRef() {\r
+ return dataObjectRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataObjectRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setDataObjectRef(Object value) {\r
+ this.dataObjectRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataOutput complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataOutput">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataState" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="itemSubjectRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="isCollection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataOutput", propOrder = {\r
+ "dataState"\r
+})\r
+public class TDataOutput\r
+ extends TBaseElement\r
+{\r
+\r
+ protected TDataState dataState;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "itemSubjectRef")\r
+ protected QName itemSubjectRef;\r
+ @XmlAttribute(name = "isCollection")\r
+ protected Boolean isCollection;\r
+\r
+ /**\r
+ * Gets the value of the dataState property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public TDataState getDataState() {\r
+ return dataState;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataState property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public void setDataState(TDataState value) {\r
+ this.dataState = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the itemSubjectRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getItemSubjectRef() {\r
+ return itemSubjectRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the itemSubjectRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setItemSubjectRef(QName value) {\r
+ this.itemSubjectRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isCollection property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsCollection() {\r
+ if (isCollection == null) {\r
+ return false;\r
+ } else {\r
+ return isCollection;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isCollection property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsCollection(Boolean value) {\r
+ this.isCollection = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataOutputAssociation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataOutputAssociation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tDataAssociation">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataOutputAssociation")\r
+public class TDataOutputAssociation\r
+ extends TDataAssociation\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataState complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataState">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataState")\r
+public class TDataState\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.math.BigInteger;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataStore complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataStore">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataState" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="capacity" type="{http://www.w3.org/2001/XMLSchema}integer" />\r
+ * <attribute name="isUnlimited" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />\r
+ * <attribute name="itemSubjectRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataStore", propOrder = {\r
+ "dataState"\r
+})\r
+public class TDataStore\r
+ extends TRootElement\r
+{\r
+\r
+ protected TDataState dataState;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "capacity")\r
+ protected BigInteger capacity;\r
+ @XmlAttribute(name = "isUnlimited")\r
+ protected Boolean isUnlimited;\r
+ @XmlAttribute(name = "itemSubjectRef")\r
+ protected QName itemSubjectRef;\r
+\r
+ /**\r
+ * Gets the value of the dataState property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public TDataState getDataState() {\r
+ return dataState;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataState property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public void setDataState(TDataState value) {\r
+ this.dataState = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the capacity property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link BigInteger }\r
+ * \r
+ */\r
+ public BigInteger getCapacity() {\r
+ return capacity;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the capacity property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link BigInteger }\r
+ * \r
+ */\r
+ public void setCapacity(BigInteger value) {\r
+ this.capacity = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isUnlimited property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsUnlimited() {\r
+ if (isUnlimited == null) {\r
+ return true;\r
+ } else {\r
+ return isUnlimited;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isUnlimited property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsUnlimited(Boolean value) {\r
+ this.isUnlimited = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the itemSubjectRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getItemSubjectRef() {\r
+ return itemSubjectRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the itemSubjectRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setItemSubjectRef(QName value) {\r
+ this.itemSubjectRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDataStoreReference complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDataStoreReference">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFlowElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataState" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="itemSubjectRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="dataStoreRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDataStoreReference", propOrder = {\r
+ "dataState"\r
+})\r
+public class TDataStoreReference\r
+ extends TFlowElement\r
+{\r
+\r
+ protected TDataState dataState;\r
+ @XmlAttribute(name = "itemSubjectRef")\r
+ protected QName itemSubjectRef;\r
+ @XmlAttribute(name = "dataStoreRef")\r
+ protected QName dataStoreRef;\r
+\r
+ /**\r
+ * Gets the value of the dataState property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public TDataState getDataState() {\r
+ return dataState;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataState property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public void setDataState(TDataState value) {\r
+ this.dataState = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the itemSubjectRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getItemSubjectRef() {\r
+ return itemSubjectRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the itemSubjectRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setItemSubjectRef(QName value) {\r
+ this.itemSubjectRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the dataStoreRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getDataStoreRef() {\r
+ return dataStoreRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataStoreRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setDataStoreRef(QName value) {\r
+ this.dataStoreRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAnyAttribute;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlID;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;\r
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDefinitions complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDefinitions">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}import" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}extension" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}rootElement" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/DI}BPMNDiagram" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}relationship" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="targetNamespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />\r
+ * <attribute name="expressionLanguage" type="{http://www.w3.org/2001/XMLSchema}anyURI" default="http://www.w3.org/1999/XPath" />\r
+ * <attribute name="typeLanguage" type="{http://www.w3.org/2001/XMLSchema}anyURI" default="http://www.w3.org/2001/XMLSchema" />\r
+ * <attribute name="exporter" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="exporterVersion" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDefinitions", propOrder = {\r
+ "_import",\r
+ "extension",\r
+ "rootElement",\r
+ "bpmnDiagram",\r
+ "relationship"\r
+})\r
+public class TDefinitions {\r
+\r
+ @XmlElement(name = "import")\r
+ protected List<TImport> _import;\r
+ protected List<TExtension> extension;\r
+ @XmlElementRef(name = "rootElement", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TRootElement>> rootElement;\r
+ @XmlElement(name = "BPMNDiagram", namespace = "http://www.omg.org/spec/BPMN/20100524/DI")\r
+ protected List<BPMNDiagram> bpmnDiagram;\r
+ protected List<TRelationship> relationship;\r
+ @XmlAttribute(name = "id")\r
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)\r
+ @XmlID\r
+ @XmlSchemaType(name = "ID")\r
+ protected String id;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "targetNamespace", required = true)\r
+ @XmlSchemaType(name = "anyURI")\r
+ protected String targetNamespace;\r
+ @XmlAttribute(name = "expressionLanguage")\r
+ @XmlSchemaType(name = "anyURI")\r
+ protected String expressionLanguage;\r
+ @XmlAttribute(name = "typeLanguage")\r
+ @XmlSchemaType(name = "anyURI")\r
+ protected String typeLanguage;\r
+ @XmlAttribute(name = "exporter")\r
+ protected String exporter;\r
+ @XmlAttribute(name = "exporterVersion")\r
+ protected String exporterVersion;\r
+ @XmlAnyAttribute\r
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();\r
+\r
+ /**\r
+ * Gets the value of the import property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the import property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getImport().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TImport }\r
+ * \r
+ * \r
+ */\r
+ public List<TImport> getImport() {\r
+ if (_import == null) {\r
+ _import = new ArrayList<TImport>();\r
+ }\r
+ return this._import;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the extension property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the extension property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getExtension().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TExtension }\r
+ * \r
+ * \r
+ */\r
+ public List<TExtension> getExtension() {\r
+ if (extension == null) {\r
+ extension = new ArrayList<TExtension>();\r
+ }\r
+ return this.extension;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the rootElement property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the rootElement property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getRootElement().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TCancelEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TMessage }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TLinkEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCategory }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGlobalScriptTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TRootElement }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGlobalTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TChoreography }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataStore }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TPartnerRole }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TProcess }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TMessageEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCorrelationProperty }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TErrorEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEndPoint }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TInterface }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGlobalManualTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TPartnerEntity }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGlobalUserTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TResource }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCompensateEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGlobalConversation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEscalation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TItemDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTimerEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSignalEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TError }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGlobalChoreographyTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCollaboration }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEscalationEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTerminateEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TConditionalEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSignal }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGlobalBusinessRuleTask }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TRootElement>> getRootElement() {\r
+ if (rootElement == null) {\r
+ rootElement = new ArrayList<JAXBElement<? extends TRootElement>>();\r
+ }\r
+ return this.rootElement;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the bpmnDiagram property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the bpmnDiagram property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getBPMNDiagram().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link BPMNDiagram }\r
+ * \r
+ * \r
+ */\r
+ public List<BPMNDiagram> getBPMNDiagram() {\r
+ if (bpmnDiagram == null) {\r
+ bpmnDiagram = new ArrayList<BPMNDiagram>();\r
+ }\r
+ return this.bpmnDiagram;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the relationship property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the relationship property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getRelationship().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TRelationship }\r
+ * \r
+ * \r
+ */\r
+ public List<TRelationship> getRelationship() {\r
+ if (relationship == null) {\r
+ relationship = new ArrayList<TRelationship>();\r
+ }\r
+ return this.relationship;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the id property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getId() {\r
+ return id;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the id property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setId(String value) {\r
+ this.id = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the targetNamespace property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getTargetNamespace() {\r
+ return targetNamespace;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the targetNamespace property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setTargetNamespace(String value) {\r
+ this.targetNamespace = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the expressionLanguage property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getExpressionLanguage() {\r
+ if (expressionLanguage == null) {\r
+ return "http://www.w3.org/1999/XPath";\r
+ } else {\r
+ return expressionLanguage;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the expressionLanguage property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setExpressionLanguage(String value) {\r
+ this.expressionLanguage = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the typeLanguage property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getTypeLanguage() {\r
+ if (typeLanguage == null) {\r
+ return "http://www.w3.org/2001/XMLSchema";\r
+ } else {\r
+ return typeLanguage;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the typeLanguage property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setTypeLanguage(String value) {\r
+ this.typeLanguage = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the exporter property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getExporter() {\r
+ return exporter;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the exporter property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setExporter(String value) {\r
+ this.exporter = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the exporterVersion property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getExporterVersion() {\r
+ return exporterVersion;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the exporterVersion property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setExporterVersion(String value) {\r
+ this.exporterVersion = value;\r
+ }\r
+\r
+ /**\r
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.\r
+ * \r
+ * <p>\r
+ * the map is keyed by the name of the attribute and \r
+ * the value is the string value of the attribute.\r
+ * \r
+ * the map returned by this method is live, and you can add new attribute\r
+ * by updating the map directly. Because of this design, there's no setter.\r
+ * \r
+ * \r
+ * @return\r
+ * always non-null\r
+ */\r
+ public Map<QName, String> getOtherAttributes() {\r
+ return otherAttributes;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAnyElement;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlID;\r
+import javax.xml.bind.annotation.XmlMixed;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;\r
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\r
+import org.w3c.dom.Element;\r
+\r
+\r
+/**\r
+ * <p>Java class for tDocumentation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tDocumentation">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <any processContents='lax' minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />\r
+ * <attribute name="textFormat" type="{http://www.w3.org/2001/XMLSchema}string" default="text/plain" />\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tDocumentation", propOrder = {\r
+ "content"\r
+})\r
+public class TDocumentation {\r
+\r
+ @XmlMixed\r
+ @XmlAnyElement(lax = true)\r
+ protected List<Object> content;\r
+ @XmlAttribute(name = "id")\r
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)\r
+ @XmlID\r
+ @XmlSchemaType(name = "ID")\r
+ protected String id;\r
+ @XmlAttribute(name = "textFormat")\r
+ protected String textFormat;\r
+\r
+ /**\r
+ * Gets the value of the content property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the content property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getContent().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link Element }\r
+ * {@link Object }\r
+ * {@link String }\r
+ * \r
+ * \r
+ */\r
+ public List<Object> getContent() {\r
+ if (content == null) {\r
+ content = new ArrayList<Object>();\r
+ }\r
+ return this.content;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the id property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getId() {\r
+ return id;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the id property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setId(String value) {\r
+ this.id = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the textFormat property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getTextFormat() {\r
+ if (textFormat == null) {\r
+ return "text/plain";\r
+ } else {\r
+ return textFormat;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the textFormat property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setTextFormat(String value) {\r
+ this.textFormat = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tEndEvent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tEndEvent">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tThrowEvent">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tEndEvent")\r
+public class TEndEvent\r
+ extends TThrowEvent\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tEndPoint complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tEndPoint">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tEndPoint")\r
+public class TEndPoint\r
+ extends TRootElement\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tError complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tError">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="errorCode" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="structureRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tError")\r
+public class TError\r
+ extends TRootElement\r
+{\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "errorCode")\r
+ protected String errorCode;\r
+ @XmlAttribute(name = "structureRef")\r
+ protected QName structureRef;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the errorCode property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getErrorCode() {\r
+ return errorCode;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the errorCode property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setErrorCode(String value) {\r
+ this.errorCode = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the structureRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getStructureRef() {\r
+ return structureRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the structureRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setStructureRef(QName value) {\r
+ this.structureRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tErrorEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tErrorEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <attribute name="errorRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tErrorEventDefinition")\r
+public class TErrorEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+ @XmlAttribute(name = "errorRef")\r
+ protected QName errorRef;\r
+\r
+ /**\r
+ * Gets the value of the errorRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getErrorRef() {\r
+ return errorRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the errorRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setErrorRef(QName value) {\r
+ this.errorRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tEscalation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tEscalation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="escalationCode" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="structureRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tEscalation")\r
+public class TEscalation\r
+ extends TRootElement\r
+{\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "escalationCode")\r
+ protected String escalationCode;\r
+ @XmlAttribute(name = "structureRef")\r
+ protected QName structureRef;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the escalationCode property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getEscalationCode() {\r
+ return escalationCode;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the escalationCode property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setEscalationCode(String value) {\r
+ this.escalationCode = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the structureRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getStructureRef() {\r
+ return structureRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the structureRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setStructureRef(QName value) {\r
+ this.structureRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tEscalationEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tEscalationEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <attribute name="escalationRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tEscalationEventDefinition")\r
+public class TEscalationEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+ @XmlAttribute(name = "escalationRef")\r
+ protected QName escalationRef;\r
+\r
+ /**\r
+ * Gets the value of the escalationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getEscalationRef() {\r
+ return escalationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the escalationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setEscalationRef(QName value) {\r
+ this.escalationRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tEvent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tEvent">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFlowNode">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}property" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tEvent", propOrder = {\r
+ "property"\r
+})\r
+@XmlSeeAlso({\r
+ TThrowEvent.class,\r
+ TCatchEvent.class\r
+})\r
+public abstract class TEvent\r
+ extends TFlowNode\r
+{\r
+\r
+ protected List<TProperty> property;\r
+\r
+ /**\r
+ * Gets the value of the property property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the property property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getProperty().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TProperty }\r
+ * \r
+ * \r
+ */\r
+ public List<TProperty> getProperty() {\r
+ if (property == null) {\r
+ property = new ArrayList<TProperty>();\r
+ }\r
+ return this.property;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tEventBasedGateway complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tEventBasedGateway">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGateway">\r
+ * <attribute name="instantiate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <attribute name="eventGatewayType" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventBasedGatewayType" default="Exclusive" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tEventBasedGateway")\r
+public class TEventBasedGateway\r
+ extends TGateway\r
+{\r
+\r
+ @XmlAttribute(name = "instantiate")\r
+ protected Boolean instantiate;\r
+ @XmlAttribute(name = "eventGatewayType")\r
+ protected TEventBasedGatewayType eventGatewayType;\r
+\r
+ /**\r
+ * Gets the value of the instantiate property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isInstantiate() {\r
+ if (instantiate == null) {\r
+ return false;\r
+ } else {\r
+ return instantiate;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the instantiate property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setInstantiate(Boolean value) {\r
+ this.instantiate = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the eventGatewayType property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TEventBasedGatewayType }\r
+ * \r
+ */\r
+ public TEventBasedGatewayType getEventGatewayType() {\r
+ if (eventGatewayType == null) {\r
+ return TEventBasedGatewayType.EXCLUSIVE;\r
+ } else {\r
+ return eventGatewayType;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the eventGatewayType property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TEventBasedGatewayType }\r
+ * \r
+ */\r
+ public void setEventGatewayType(TEventBasedGatewayType value) {\r
+ this.eventGatewayType = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tEventBasedGatewayType.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="tEventBasedGatewayType">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="Exclusive"/>\r
+ * <enumeration value="Parallel"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "tEventBasedGatewayType")\r
+@XmlEnum\r
+public enum TEventBasedGatewayType {\r
+\r
+ @XmlEnumValue("Exclusive")\r
+ EXCLUSIVE("Exclusive"),\r
+ @XmlEnumValue("Parallel")\r
+ PARALLEL("Parallel");\r
+ private final String value;\r
+\r
+ TEventBasedGatewayType(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static TEventBasedGatewayType fromValue(String v) {\r
+ for (TEventBasedGatewayType c: TEventBasedGatewayType.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tEventDefinition")\r
+@XmlSeeAlso({\r
+ TTimerEventDefinition.class,\r
+ TCancelEventDefinition.class,\r
+ TMessageEventDefinition.class,\r
+ TErrorEventDefinition.class,\r
+ TConditionalEventDefinition.class,\r
+ TTerminateEventDefinition.class,\r
+ TLinkEventDefinition.class,\r
+ TEscalationEventDefinition.class,\r
+ TCompensateEventDefinition.class,\r
+ TSignalEventDefinition.class\r
+})\r
+public abstract class TEventDefinition\r
+ extends TRootElement\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlIDREF;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tExclusiveGateway complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tExclusiveGateway">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGateway">\r
+ * <attribute name="default" type="{http://www.w3.org/2001/XMLSchema}IDREF" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tExclusiveGateway")\r
+public class TExclusiveGateway\r
+ extends TGateway\r
+{\r
+\r
+ @XmlAttribute(name = "default")\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object _default;\r
+\r
+ /**\r
+ * Gets the value of the default property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getDefault() {\r
+ return _default;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the default property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setDefault(Object value) {\r
+ this._default = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tExpression complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tExpression">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElementWithMixedContent">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tExpression")\r
+@XmlSeeAlso({\r
+ TFormalExpression.class\r
+})\r
+public class TExpression\r
+ extends TBaseElementWithMixedContent\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tExtension complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tExtension">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}documentation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="definition" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="mustUnderstand" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tExtension", propOrder = {\r
+ "documentation"\r
+})\r
+public class TExtension {\r
+\r
+ protected List<TDocumentation> documentation;\r
+ @XmlAttribute(name = "definition")\r
+ protected QName definition;\r
+ @XmlAttribute(name = "mustUnderstand")\r
+ protected Boolean mustUnderstand;\r
+\r
+ /**\r
+ * Gets the value of the documentation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the documentation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDocumentation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDocumentation }\r
+ * \r
+ * \r
+ */\r
+ public List<TDocumentation> getDocumentation() {\r
+ if (documentation == null) {\r
+ documentation = new ArrayList<TDocumentation>();\r
+ }\r
+ return this.documentation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the definition property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getDefinition() {\r
+ return definition;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the definition property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setDefinition(QName value) {\r
+ this.definition = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the mustUnderstand property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isMustUnderstand() {\r
+ if (mustUnderstand == null) {\r
+ return false;\r
+ } else {\r
+ return mustUnderstand;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the mustUnderstand property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setMustUnderstand(Boolean value) {\r
+ this.mustUnderstand = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAnyElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import org.w3c.dom.Element;\r
+\r
+\r
+/**\r
+ * <p>Java class for tExtensionElements complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tExtensionElements">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tExtensionElements", propOrder = {\r
+ "any"\r
+})\r
+public class TExtensionElements {\r
+\r
+ @XmlAnyElement(lax = true)\r
+ protected List<Object> any;\r
+\r
+ /**\r
+ * Gets the value of the any property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the any property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getAny().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link Object }\r
+ * {@link Element }\r
+ * \r
+ * \r
+ */\r
+ public List<Object> getAny() {\r
+ if (any == null) {\r
+ any = new ArrayList<Object>();\r
+ }\r
+ return this.any;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tFlowElement complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tFlowElement">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}auditing" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}monitoring" minOccurs="0"/>\r
+ * <element name="categoryValueRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tFlowElement", propOrder = {\r
+ "auditing",\r
+ "monitoring",\r
+ "categoryValueRef"\r
+})\r
+@XmlSeeAlso({\r
+ TSequenceFlow.class,\r
+ TDataObject.class,\r
+ TDataObjectReference.class,\r
+ TDataStoreReference.class,\r
+ TFlowNode.class\r
+})\r
+public abstract class TFlowElement\r
+ extends TBaseElement\r
+{\r
+\r
+ protected TAuditing auditing;\r
+ protected TMonitoring monitoring;\r
+ protected List<QName> categoryValueRef;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the auditing property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TAuditing }\r
+ * \r
+ */\r
+ public TAuditing getAuditing() {\r
+ return auditing;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the auditing property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TAuditing }\r
+ * \r
+ */\r
+ public void setAuditing(TAuditing value) {\r
+ this.auditing = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the monitoring property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TMonitoring }\r
+ * \r
+ */\r
+ public TMonitoring getMonitoring() {\r
+ return monitoring;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the monitoring property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TMonitoring }\r
+ * \r
+ */\r
+ public void setMonitoring(TMonitoring value) {\r
+ this.monitoring = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the categoryValueRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the categoryValueRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getCategoryValueRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getCategoryValueRef() {\r
+ if (categoryValueRef == null) {\r
+ categoryValueRef = new ArrayList<QName>();\r
+ }\r
+ return this.categoryValueRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tFlowNode complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tFlowNode">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFlowElement">\r
+ * <sequence>\r
+ * <element name="incoming" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="outgoing" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tFlowNode", propOrder = {\r
+ "incoming",\r
+ "outgoing"\r
+})\r
+@XmlSeeAlso({\r
+ TEvent.class,\r
+ TChoreographyActivity.class,\r
+ TGateway.class,\r
+ TActivity.class\r
+})\r
+public abstract class TFlowNode\r
+ extends TFlowElement\r
+{\r
+\r
+ protected List<QName> incoming;\r
+ protected List<QName> outgoing;\r
+\r
+ /**\r
+ * Gets the value of the incoming property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the incoming property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getIncoming().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getIncoming() {\r
+ if (incoming == null) {\r
+ incoming = new ArrayList<QName>();\r
+ }\r
+ return this.incoming;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outgoing property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the outgoing property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getOutgoing().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getOutgoing() {\r
+ if (outgoing == null) {\r
+ outgoing = new ArrayList<QName>();\r
+ }\r
+ return this.outgoing;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tFormalExpression complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tFormalExpression">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression">\r
+ * <attribute name="language" type="{http://www.w3.org/2001/XMLSchema}anyURI" />\r
+ * <attribute name="evaluatesToTypeRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tFormalExpression")\r
+public class TFormalExpression\r
+ extends TExpression\r
+{\r
+\r
+ @XmlAttribute(name = "language")\r
+ @XmlSchemaType(name = "anyURI")\r
+ protected String language;\r
+ @XmlAttribute(name = "evaluatesToTypeRef")\r
+ protected QName evaluatesToTypeRef;\r
+\r
+ /**\r
+ * Gets the value of the language property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getLanguage() {\r
+ return language;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the language property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setLanguage(String value) {\r
+ this.language = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the evaluatesToTypeRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getEvaluatesToTypeRef() {\r
+ return evaluatesToTypeRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the evaluatesToTypeRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setEvaluatesToTypeRef(QName value) {\r
+ this.evaluatesToTypeRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGateway complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tGateway">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFlowNode">\r
+ * <attribute name="gatewayDirection" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGatewayDirection" default="Unspecified" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tGateway")\r
+@XmlSeeAlso({\r
+ TComplexGateway.class,\r
+ TInclusiveGateway.class,\r
+ TEventBasedGateway.class,\r
+ TParallelGateway.class,\r
+ TExclusiveGateway.class\r
+})\r
+public class TGateway\r
+ extends TFlowNode\r
+{\r
+\r
+ @XmlAttribute(name = "gatewayDirection")\r
+ protected TGatewayDirection gatewayDirection;\r
+\r
+ /**\r
+ * Gets the value of the gatewayDirection property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TGatewayDirection }\r
+ * \r
+ */\r
+ public TGatewayDirection getGatewayDirection() {\r
+ if (gatewayDirection == null) {\r
+ return TGatewayDirection.UNSPECIFIED;\r
+ } else {\r
+ return gatewayDirection;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the gatewayDirection property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TGatewayDirection }\r
+ * \r
+ */\r
+ public void setGatewayDirection(TGatewayDirection value) {\r
+ this.gatewayDirection = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGatewayDirection.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="tGatewayDirection">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="Unspecified"/>\r
+ * <enumeration value="Converging"/>\r
+ * <enumeration value="Diverging"/>\r
+ * <enumeration value="Mixed"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "tGatewayDirection")\r
+@XmlEnum\r
+public enum TGatewayDirection {\r
+\r
+ @XmlEnumValue("Unspecified")\r
+ UNSPECIFIED("Unspecified"),\r
+ @XmlEnumValue("Converging")\r
+ CONVERGING("Converging"),\r
+ @XmlEnumValue("Diverging")\r
+ DIVERGING("Diverging"),\r
+ @XmlEnumValue("Mixed")\r
+ MIXED("Mixed");\r
+ private final String value;\r
+\r
+ TGatewayDirection(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static TGatewayDirection fromValue(String v) {\r
+ for (TGatewayDirection c: TGatewayDirection.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGlobalBusinessRuleTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tGlobalBusinessRuleTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGlobalTask">\r
+ * <attribute name="implementation" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tImplementation" default="##unspecified" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tGlobalBusinessRuleTask")\r
+public class TGlobalBusinessRuleTask\r
+ extends TGlobalTask\r
+{\r
+\r
+ @XmlAttribute(name = "implementation")\r
+ protected String implementation;\r
+\r
+ /**\r
+ * Gets the value of the implementation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getImplementation() {\r
+ if (implementation == null) {\r
+ return "##unspecified";\r
+ } else {\r
+ return implementation;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the implementation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setImplementation(String value) {\r
+ this.implementation = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGlobalChoreographyTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tGlobalChoreographyTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tChoreography">\r
+ * <attribute name="initiatingParticipantRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tGlobalChoreographyTask")\r
+public class TGlobalChoreographyTask\r
+ extends TChoreography\r
+{\r
+\r
+ @XmlAttribute(name = "initiatingParticipantRef")\r
+ protected QName initiatingParticipantRef;\r
+\r
+ /**\r
+ * Gets the value of the initiatingParticipantRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getInitiatingParticipantRef() {\r
+ return initiatingParticipantRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the initiatingParticipantRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setInitiatingParticipantRef(QName value) {\r
+ this.initiatingParticipantRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGlobalConversation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tGlobalConversation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tCollaboration">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tGlobalConversation")\r
+public class TGlobalConversation\r
+ extends TCollaboration\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGlobalManualTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tGlobalManualTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGlobalTask">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tGlobalManualTask")\r
+public class TGlobalManualTask\r
+ extends TGlobalTask\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGlobalScriptTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tGlobalScriptTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGlobalTask">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}script" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="scriptLanguage" type="{http://www.w3.org/2001/XMLSchema}anyURI" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tGlobalScriptTask", propOrder = {\r
+ "script"\r
+})\r
+public class TGlobalScriptTask\r
+ extends TGlobalTask\r
+{\r
+\r
+ protected TScript script;\r
+ @XmlAttribute(name = "scriptLanguage")\r
+ @XmlSchemaType(name = "anyURI")\r
+ protected String scriptLanguage;\r
+\r
+ /**\r
+ * Gets the value of the script property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TScript }\r
+ * \r
+ */\r
+ public TScript getScript() {\r
+ return script;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the script property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TScript }\r
+ * \r
+ */\r
+ public void setScript(TScript value) {\r
+ this.script = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the scriptLanguage property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getScriptLanguage() {\r
+ return scriptLanguage;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the scriptLanguage property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setScriptLanguage(String value) {\r
+ this.scriptLanguage = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGlobalTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tGlobalTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tCallableElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}resourceRole" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tGlobalTask", propOrder = {\r
+ "resourceRole"\r
+})\r
+@XmlSeeAlso({\r
+ TGlobalUserTask.class,\r
+ TGlobalBusinessRuleTask.class,\r
+ TGlobalScriptTask.class,\r
+ TGlobalManualTask.class\r
+})\r
+public class TGlobalTask\r
+ extends TCallableElement\r
+{\r
+\r
+ @XmlElementRef(name = "resourceRole", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TResourceRole>> resourceRole;\r
+\r
+ /**\r
+ * Gets the value of the resourceRole property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the resourceRole property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getResourceRole().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TPerformer }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TResourceRole }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TPotentialOwner }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link THumanPerformer }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TResourceRole>> getResourceRole() {\r
+ if (resourceRole == null) {\r
+ resourceRole = new ArrayList<JAXBElement<? extends TResourceRole>>();\r
+ }\r
+ return this.resourceRole;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGlobalUserTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tGlobalUserTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGlobalTask">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}rendering" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="implementation" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tImplementation" default="##unspecified" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tGlobalUserTask", propOrder = {\r
+ "rendering"\r
+})\r
+public class TGlobalUserTask\r
+ extends TGlobalTask\r
+{\r
+\r
+ protected List<TRendering> rendering;\r
+ @XmlAttribute(name = "implementation")\r
+ protected String implementation;\r
+\r
+ /**\r
+ * Gets the value of the rendering property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the rendering property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getRendering().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TRendering }\r
+ * \r
+ * \r
+ */\r
+ public List<TRendering> getRendering() {\r
+ if (rendering == null) {\r
+ rendering = new ArrayList<TRendering>();\r
+ }\r
+ return this.rendering;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the implementation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getImplementation() {\r
+ if (implementation == null) {\r
+ return "##unspecified";\r
+ } else {\r
+ return implementation;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the implementation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setImplementation(String value) {\r
+ this.implementation = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tGroup complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tGroup">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tArtifact">\r
+ * <attribute name="categoryValueRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tGroup")\r
+public class TGroup\r
+ extends TArtifact\r
+{\r
+\r
+ @XmlAttribute(name = "categoryValueRef")\r
+ protected QName categoryValueRef;\r
+\r
+ /**\r
+ * Gets the value of the categoryValueRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getCategoryValueRef() {\r
+ return categoryValueRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the categoryValueRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setCategoryValueRef(QName value) {\r
+ this.categoryValueRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tHumanPerformer complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tHumanPerformer">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tPerformer">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tHumanPerformer")\r
+@XmlSeeAlso({\r
+ TPotentialOwner.class\r
+})\r
+public class THumanPerformer\r
+ extends TPerformer\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tImplicitThrowEvent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tImplicitThrowEvent">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tThrowEvent">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tImplicitThrowEvent")\r
+public class TImplicitThrowEvent\r
+ extends TThrowEvent\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tImport complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tImport">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <attribute name="namespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />\r
+ * <attribute name="location" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="importType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tImport")\r
+public class TImport {\r
+\r
+ @XmlAttribute(name = "namespace", required = true)\r
+ @XmlSchemaType(name = "anyURI")\r
+ protected String namespace;\r
+ @XmlAttribute(name = "location", required = true)\r
+ protected String location;\r
+ @XmlAttribute(name = "importType", required = true)\r
+ @XmlSchemaType(name = "anyURI")\r
+ protected String importType;\r
+\r
+ /**\r
+ * Gets the value of the namespace property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getNamespace() {\r
+ return namespace;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the namespace property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setNamespace(String value) {\r
+ this.namespace = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the location property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getLocation() {\r
+ return location;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the location property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setLocation(String value) {\r
+ this.location = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the importType property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getImportType() {\r
+ return importType;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the importType property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setImportType(String value) {\r
+ this.importType = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlIDREF;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tInclusiveGateway complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tInclusiveGateway">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGateway">\r
+ * <attribute name="default" type="{http://www.w3.org/2001/XMLSchema}IDREF" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tInclusiveGateway")\r
+public class TInclusiveGateway\r
+ extends TGateway\r
+{\r
+\r
+ @XmlAttribute(name = "default")\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object _default;\r
+\r
+ /**\r
+ * Gets the value of the default property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getDefault() {\r
+ return _default;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the default property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setDefault(Object value) {\r
+ this._default = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlIDREF;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tInputOutputBinding complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tInputOutputBinding">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <attribute name="operationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="inputDataRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />\r
+ * <attribute name="outputDataRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tInputOutputBinding")\r
+public class TInputOutputBinding\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlAttribute(name = "operationRef", required = true)\r
+ protected QName operationRef;\r
+ @XmlAttribute(name = "inputDataRef", required = true)\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object inputDataRef;\r
+ @XmlAttribute(name = "outputDataRef", required = true)\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object outputDataRef;\r
+\r
+ /**\r
+ * Gets the value of the operationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOperationRef() {\r
+ return operationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the operationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOperationRef(QName value) {\r
+ this.operationRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the inputDataRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getInputDataRef() {\r
+ return inputDataRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the inputDataRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setInputDataRef(Object value) {\r
+ this.inputDataRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outputDataRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getOutputDataRef() {\r
+ return outputDataRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the outputDataRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setOutputDataRef(Object value) {\r
+ this.outputDataRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tInputOutputSpecification complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tInputOutputSpecification">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataInput" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataOutput" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}inputSet" maxOccurs="unbounded"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}outputSet" maxOccurs="unbounded"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tInputOutputSpecification", propOrder = {\r
+ "dataInput",\r
+ "dataOutput",\r
+ "inputSet",\r
+ "outputSet"\r
+})\r
+public class TInputOutputSpecification\r
+ extends TBaseElement\r
+{\r
+\r
+ protected List<TDataInput> dataInput;\r
+ protected List<TDataOutput> dataOutput;\r
+ @XmlElement(required = true)\r
+ protected List<TInputSet> inputSet;\r
+ @XmlElement(required = true)\r
+ protected List<TOutputSet> outputSet;\r
+\r
+ /**\r
+ * Gets the value of the dataInput property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataInput property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataInput().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDataInput }\r
+ * \r
+ * \r
+ */\r
+ public List<TDataInput> getDataInput() {\r
+ if (dataInput == null) {\r
+ dataInput = new ArrayList<TDataInput>();\r
+ }\r
+ return this.dataInput;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the dataOutput property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataOutput property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataOutput().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDataOutput }\r
+ * \r
+ * \r
+ */\r
+ public List<TDataOutput> getDataOutput() {\r
+ if (dataOutput == null) {\r
+ dataOutput = new ArrayList<TDataOutput>();\r
+ }\r
+ return this.dataOutput;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the inputSet property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the inputSet property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getInputSet().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TInputSet }\r
+ * \r
+ * \r
+ */\r
+ public List<TInputSet> getInputSet() {\r
+ if (inputSet == null) {\r
+ inputSet = new ArrayList<TInputSet>();\r
+ }\r
+ return this.inputSet;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outputSet property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the outputSet property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getOutputSet().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TOutputSet }\r
+ * \r
+ * \r
+ */\r
+ public List<TOutputSet> getOutputSet() {\r
+ if (outputSet == null) {\r
+ outputSet = new ArrayList<TOutputSet>();\r
+ }\r
+ return this.outputSet;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tInputSet complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tInputSet">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="dataInputRefs" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="optionalInputRefs" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="whileExecutingInputRefs" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="outputSetRefs" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tInputSet", propOrder = {\r
+ "dataInputRefs",\r
+ "optionalInputRefs",\r
+ "whileExecutingInputRefs",\r
+ "outputSetRefs"\r
+})\r
+public class TInputSet\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElementRef(name = "dataInputRefs", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> dataInputRefs;\r
+ @XmlElementRef(name = "optionalInputRefs", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> optionalInputRefs;\r
+ @XmlElementRef(name = "whileExecutingInputRefs", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> whileExecutingInputRefs;\r
+ @XmlElementRef(name = "outputSetRefs", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> outputSetRefs;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the dataInputRefs property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataInputRefs property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataInputRefs().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getDataInputRefs() {\r
+ if (dataInputRefs == null) {\r
+ dataInputRefs = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.dataInputRefs;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the optionalInputRefs property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the optionalInputRefs property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getOptionalInputRefs().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getOptionalInputRefs() {\r
+ if (optionalInputRefs == null) {\r
+ optionalInputRefs = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.optionalInputRefs;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the whileExecutingInputRefs property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the whileExecutingInputRefs property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getWhileExecutingInputRefs().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getWhileExecutingInputRefs() {\r
+ if (whileExecutingInputRefs == null) {\r
+ whileExecutingInputRefs = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.whileExecutingInputRefs;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outputSetRefs property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the outputSetRefs property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getOutputSetRefs().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getOutputSetRefs() {\r
+ if (outputSetRefs == null) {\r
+ outputSetRefs = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.outputSetRefs;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tInterface complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tInterface">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}operation" maxOccurs="unbounded"/>\r
+ * </sequence>\r
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="implementationRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tInterface", propOrder = {\r
+ "operation"\r
+})\r
+public class TInterface\r
+ extends TRootElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected List<TOperation> operation;\r
+ @XmlAttribute(name = "name", required = true)\r
+ protected String name;\r
+ @XmlAttribute(name = "implementationRef")\r
+ protected QName implementationRef;\r
+\r
+ /**\r
+ * Gets the value of the operation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the operation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getOperation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TOperation }\r
+ * \r
+ * \r
+ */\r
+ public List<TOperation> getOperation() {\r
+ if (operation == null) {\r
+ operation = new ArrayList<TOperation>();\r
+ }\r
+ return this.operation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the implementationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getImplementationRef() {\r
+ return implementationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the implementationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setImplementationRef(QName value) {\r
+ this.implementationRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tIntermediateCatchEvent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tIntermediateCatchEvent">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tCatchEvent">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tIntermediateCatchEvent")\r
+public class TIntermediateCatchEvent\r
+ extends TCatchEvent\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tIntermediateThrowEvent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tIntermediateThrowEvent">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tThrowEvent">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tIntermediateThrowEvent")\r
+public class TIntermediateThrowEvent\r
+ extends TThrowEvent\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tItemDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tItemDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <attribute name="structureRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="isCollection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <attribute name="itemKind" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tItemKind" default="Information" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tItemDefinition")\r
+public class TItemDefinition\r
+ extends TRootElement\r
+{\r
+\r
+ @XmlAttribute(name = "structureRef")\r
+ protected QName structureRef;\r
+ @XmlAttribute(name = "isCollection")\r
+ protected Boolean isCollection;\r
+ @XmlAttribute(name = "itemKind")\r
+ protected TItemKind itemKind;\r
+\r
+ /**\r
+ * Gets the value of the structureRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getStructureRef() {\r
+ return structureRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the structureRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setStructureRef(QName value) {\r
+ this.structureRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isCollection property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsCollection() {\r
+ if (isCollection == null) {\r
+ return false;\r
+ } else {\r
+ return isCollection;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isCollection property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsCollection(Boolean value) {\r
+ this.isCollection = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the itemKind property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TItemKind }\r
+ * \r
+ */\r
+ public TItemKind getItemKind() {\r
+ if (itemKind == null) {\r
+ return TItemKind.INFORMATION;\r
+ } else {\r
+ return itemKind;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the itemKind property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TItemKind }\r
+ * \r
+ */\r
+ public void setItemKind(TItemKind value) {\r
+ this.itemKind = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tItemKind.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="tItemKind">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="Information"/>\r
+ * <enumeration value="Physical"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "tItemKind")\r
+@XmlEnum\r
+public enum TItemKind {\r
+\r
+ @XmlEnumValue("Information")\r
+ INFORMATION("Information"),\r
+ @XmlEnumValue("Physical")\r
+ PHYSICAL("Physical");\r
+ private final String value;\r
+\r
+ TItemKind(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static TItemKind fromValue(String v) {\r
+ for (TItemKind c: TItemKind.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tLane complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tLane">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="partitionElement" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement" minOccurs="0"/>\r
+ * <element name="flowNodeRef" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="childLaneSet" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tLaneSet" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="partitionElementRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tLane", propOrder = {\r
+ "partitionElement",\r
+ "flowNodeRef",\r
+ "childLaneSet"\r
+})\r
+public class TLane\r
+ extends TBaseElement\r
+{\r
+\r
+ protected TBaseElement partitionElement;\r
+ @XmlElementRef(name = "flowNodeRef", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> flowNodeRef;\r
+ protected TLaneSet childLaneSet;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "partitionElementRef")\r
+ protected QName partitionElementRef;\r
+\r
+ /**\r
+ * Gets the value of the partitionElement property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TBaseElement }\r
+ * \r
+ */\r
+ public TBaseElement getPartitionElement() {\r
+ return partitionElement;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the partitionElement property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TBaseElement }\r
+ * \r
+ */\r
+ public void setPartitionElement(TBaseElement value) {\r
+ this.partitionElement = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the flowNodeRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the flowNodeRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getFlowNodeRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getFlowNodeRef() {\r
+ if (flowNodeRef == null) {\r
+ flowNodeRef = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.flowNodeRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the childLaneSet property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TLaneSet }\r
+ * \r
+ */\r
+ public TLaneSet getChildLaneSet() {\r
+ return childLaneSet;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the childLaneSet property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TLaneSet }\r
+ * \r
+ */\r
+ public void setChildLaneSet(TLaneSet value) {\r
+ this.childLaneSet = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the partitionElementRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getPartitionElementRef() {\r
+ return partitionElementRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the partitionElementRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setPartitionElementRef(QName value) {\r
+ this.partitionElementRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tLaneSet complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tLaneSet">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}lane" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tLaneSet", propOrder = {\r
+ "lane"\r
+})\r
+public class TLaneSet\r
+ extends TBaseElement\r
+{\r
+\r
+ protected List<TLane> lane;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the lane property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the lane property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getLane().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TLane }\r
+ * \r
+ * \r
+ */\r
+ public List<TLane> getLane() {\r
+ if (lane == null) {\r
+ lane = new ArrayList<TLane>();\r
+ }\r
+ return this.lane;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tLinkEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tLinkEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <sequence>\r
+ * <element name="source" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="target" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tLinkEventDefinition", propOrder = {\r
+ "source",\r
+ "target"\r
+})\r
+public class TLinkEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+ protected List<QName> source;\r
+ protected QName target;\r
+ @XmlAttribute(name = "name", required = true)\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the source property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the source property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getSource().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getSource() {\r
+ if (source == null) {\r
+ source = new ArrayList<QName>();\r
+ }\r
+ return this.source;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the target property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getTarget() {\r
+ return target;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the target property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setTarget(QName value) {\r
+ this.target = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tLoopCharacteristics complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tLoopCharacteristics">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tLoopCharacteristics")\r
+@XmlSeeAlso({\r
+ TStandardLoopCharacteristics.class,\r
+ TMultiInstanceLoopCharacteristics.class\r
+})\r
+public abstract class TLoopCharacteristics\r
+ extends TBaseElement\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tManualTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tManualTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tTask">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tManualTask")\r
+public class TManualTask\r
+ extends TTask\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tMessage complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tMessage">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="itemRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tMessage")\r
+public class TMessage\r
+ extends TRootElement\r
+{\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "itemRef")\r
+ protected QName itemRef;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the itemRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getItemRef() {\r
+ return itemRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the itemRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setItemRef(QName value) {\r
+ this.itemRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tMessageEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tMessageEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <sequence>\r
+ * <element name="operationRef" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="messageRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tMessageEventDefinition", propOrder = {\r
+ "operationRef"\r
+})\r
+public class TMessageEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+ protected QName operationRef;\r
+ @XmlAttribute(name = "messageRef")\r
+ protected QName messageRef;\r
+\r
+ /**\r
+ * Gets the value of the operationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOperationRef() {\r
+ return operationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the operationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOperationRef(QName value) {\r
+ this.operationRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the messageRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getMessageRef() {\r
+ return messageRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the messageRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setMessageRef(QName value) {\r
+ this.messageRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tMessageFlow complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tMessageFlow">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="sourceRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="targetRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="messageRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tMessageFlow")\r
+public class TMessageFlow\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "sourceRef", required = true)\r
+ protected QName sourceRef;\r
+ @XmlAttribute(name = "targetRef", required = true)\r
+ protected QName targetRef;\r
+ @XmlAttribute(name = "messageRef")\r
+ protected QName messageRef;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the sourceRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getSourceRef() {\r
+ return sourceRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the sourceRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setSourceRef(QName value) {\r
+ this.sourceRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the targetRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getTargetRef() {\r
+ return targetRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the targetRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setTargetRef(QName value) {\r
+ this.targetRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the messageRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getMessageRef() {\r
+ return messageRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the messageRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setMessageRef(QName value) {\r
+ this.messageRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tMessageFlowAssociation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tMessageFlowAssociation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <attribute name="innerMessageFlowRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="outerMessageFlowRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tMessageFlowAssociation")\r
+public class TMessageFlowAssociation\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlAttribute(name = "innerMessageFlowRef", required = true)\r
+ protected QName innerMessageFlowRef;\r
+ @XmlAttribute(name = "outerMessageFlowRef", required = true)\r
+ protected QName outerMessageFlowRef;\r
+\r
+ /**\r
+ * Gets the value of the innerMessageFlowRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getInnerMessageFlowRef() {\r
+ return innerMessageFlowRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the innerMessageFlowRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setInnerMessageFlowRef(QName value) {\r
+ this.innerMessageFlowRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outerMessageFlowRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOuterMessageFlowRef() {\r
+ return outerMessageFlowRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the outerMessageFlowRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOuterMessageFlowRef(QName value) {\r
+ this.outerMessageFlowRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tMonitoring complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tMonitoring">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tMonitoring")\r
+public class TMonitoring\r
+ extends TBaseElement\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tMultiInstanceFlowCondition.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="tMultiInstanceFlowCondition">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="None"/>\r
+ * <enumeration value="One"/>\r
+ * <enumeration value="All"/>\r
+ * <enumeration value="Complex"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "tMultiInstanceFlowCondition")\r
+@XmlEnum\r
+public enum TMultiInstanceFlowCondition {\r
+\r
+ @XmlEnumValue("None")\r
+ NONE("None"),\r
+ @XmlEnumValue("One")\r
+ ONE("One"),\r
+ @XmlEnumValue("All")\r
+ ALL("All"),\r
+ @XmlEnumValue("Complex")\r
+ COMPLEX("Complex");\r
+ private final String value;\r
+\r
+ TMultiInstanceFlowCondition(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static TMultiInstanceFlowCondition fromValue(String v) {\r
+ for (TMultiInstanceFlowCondition c: TMultiInstanceFlowCondition.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tMultiInstanceLoopCharacteristics complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tMultiInstanceLoopCharacteristics">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tLoopCharacteristics">\r
+ * <sequence>\r
+ * <element name="loopCardinality" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression" minOccurs="0"/>\r
+ * <element name="loopDataInputRef" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>\r
+ * <element name="loopDataOutputRef" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>\r
+ * <element name="inputDataItem" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tDataInput" minOccurs="0"/>\r
+ * <element name="outputDataItem" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tDataOutput" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}complexBehaviorDefinition" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="completionCondition" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="isSequential" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <attribute name="behavior" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tMultiInstanceFlowCondition" default="All" />\r
+ * <attribute name="oneBehaviorEventRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="noneBehaviorEventRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tMultiInstanceLoopCharacteristics", propOrder = {\r
+ "loopCardinality",\r
+ "loopDataInputRef",\r
+ "loopDataOutputRef",\r
+ "inputDataItem",\r
+ "outputDataItem",\r
+ "complexBehaviorDefinition",\r
+ "completionCondition"\r
+})\r
+public class TMultiInstanceLoopCharacteristics\r
+ extends TLoopCharacteristics\r
+{\r
+\r
+ protected TExpression loopCardinality;\r
+ protected QName loopDataInputRef;\r
+ protected QName loopDataOutputRef;\r
+ protected TDataInput inputDataItem;\r
+ protected TDataOutput outputDataItem;\r
+ protected List<TComplexBehaviorDefinition> complexBehaviorDefinition;\r
+ protected TExpression completionCondition;\r
+ @XmlAttribute(name = "isSequential")\r
+ protected Boolean isSequential;\r
+ @XmlAttribute(name = "behavior")\r
+ protected TMultiInstanceFlowCondition behavior;\r
+ @XmlAttribute(name = "oneBehaviorEventRef")\r
+ protected QName oneBehaviorEventRef;\r
+ @XmlAttribute(name = "noneBehaviorEventRef")\r
+ protected QName noneBehaviorEventRef;\r
+\r
+ /**\r
+ * Gets the value of the loopCardinality property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getLoopCardinality() {\r
+ return loopCardinality;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the loopCardinality property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setLoopCardinality(TExpression value) {\r
+ this.loopCardinality = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the loopDataInputRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getLoopDataInputRef() {\r
+ return loopDataInputRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the loopDataInputRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setLoopDataInputRef(QName value) {\r
+ this.loopDataInputRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the loopDataOutputRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getLoopDataOutputRef() {\r
+ return loopDataOutputRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the loopDataOutputRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setLoopDataOutputRef(QName value) {\r
+ this.loopDataOutputRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the inputDataItem property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TDataInput }\r
+ * \r
+ */\r
+ public TDataInput getInputDataItem() {\r
+ return inputDataItem;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the inputDataItem property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TDataInput }\r
+ * \r
+ */\r
+ public void setInputDataItem(TDataInput value) {\r
+ this.inputDataItem = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outputDataItem property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TDataOutput }\r
+ * \r
+ */\r
+ public TDataOutput getOutputDataItem() {\r
+ return outputDataItem;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the outputDataItem property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TDataOutput }\r
+ * \r
+ */\r
+ public void setOutputDataItem(TDataOutput value) {\r
+ this.outputDataItem = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the complexBehaviorDefinition property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the complexBehaviorDefinition property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getComplexBehaviorDefinition().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TComplexBehaviorDefinition }\r
+ * \r
+ * \r
+ */\r
+ public List<TComplexBehaviorDefinition> getComplexBehaviorDefinition() {\r
+ if (complexBehaviorDefinition == null) {\r
+ complexBehaviorDefinition = new ArrayList<TComplexBehaviorDefinition>();\r
+ }\r
+ return this.complexBehaviorDefinition;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the completionCondition property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getCompletionCondition() {\r
+ return completionCondition;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the completionCondition property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setCompletionCondition(TExpression value) {\r
+ this.completionCondition = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isSequential property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsSequential() {\r
+ if (isSequential == null) {\r
+ return false;\r
+ } else {\r
+ return isSequential;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isSequential property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsSequential(Boolean value) {\r
+ this.isSequential = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the behavior property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TMultiInstanceFlowCondition }\r
+ * \r
+ */\r
+ public TMultiInstanceFlowCondition getBehavior() {\r
+ if (behavior == null) {\r
+ return TMultiInstanceFlowCondition.ALL;\r
+ } else {\r
+ return behavior;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the behavior property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TMultiInstanceFlowCondition }\r
+ * \r
+ */\r
+ public void setBehavior(TMultiInstanceFlowCondition value) {\r
+ this.behavior = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the oneBehaviorEventRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOneBehaviorEventRef() {\r
+ return oneBehaviorEventRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the oneBehaviorEventRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOneBehaviorEventRef(QName value) {\r
+ this.oneBehaviorEventRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the noneBehaviorEventRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getNoneBehaviorEventRef() {\r
+ return noneBehaviorEventRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the noneBehaviorEventRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setNoneBehaviorEventRef(QName value) {\r
+ this.noneBehaviorEventRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tOperation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tOperation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="inMessageRef" type="{http://www.w3.org/2001/XMLSchema}QName"/>\r
+ * <element name="outMessageRef" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>\r
+ * <element name="errorRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="implementationRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tOperation", propOrder = {\r
+ "inMessageRef",\r
+ "outMessageRef",\r
+ "errorRef"\r
+})\r
+public class TOperation\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected QName inMessageRef;\r
+ protected QName outMessageRef;\r
+ protected List<QName> errorRef;\r
+ @XmlAttribute(name = "name", required = true)\r
+ protected String name;\r
+ @XmlAttribute(name = "implementationRef")\r
+ protected QName implementationRef;\r
+\r
+ /**\r
+ * Gets the value of the inMessageRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getInMessageRef() {\r
+ return inMessageRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the inMessageRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setInMessageRef(QName value) {\r
+ this.inMessageRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outMessageRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOutMessageRef() {\r
+ return outMessageRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the outMessageRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOutMessageRef(QName value) {\r
+ this.outMessageRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the errorRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the errorRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getErrorRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getErrorRef() {\r
+ if (errorRef == null) {\r
+ errorRef = new ArrayList<QName>();\r
+ }\r
+ return this.errorRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the implementationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getImplementationRef() {\r
+ return implementationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the implementationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setImplementationRef(QName value) {\r
+ this.implementationRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tOutputSet complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tOutputSet">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="dataOutputRefs" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="optionalOutputRefs" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="whileExecutingOutputRefs" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="inputSetRefs" type="{http://www.w3.org/2001/XMLSchema}IDREF" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tOutputSet", propOrder = {\r
+ "dataOutputRefs",\r
+ "optionalOutputRefs",\r
+ "whileExecutingOutputRefs",\r
+ "inputSetRefs"\r
+})\r
+public class TOutputSet\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElementRef(name = "dataOutputRefs", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> dataOutputRefs;\r
+ @XmlElementRef(name = "optionalOutputRefs", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> optionalOutputRefs;\r
+ @XmlElementRef(name = "whileExecutingOutputRefs", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> whileExecutingOutputRefs;\r
+ @XmlElementRef(name = "inputSetRefs", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<Object>> inputSetRefs;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the dataOutputRefs property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataOutputRefs property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataOutputRefs().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getDataOutputRefs() {\r
+ if (dataOutputRefs == null) {\r
+ dataOutputRefs = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.dataOutputRefs;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the optionalOutputRefs property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the optionalOutputRefs property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getOptionalOutputRefs().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getOptionalOutputRefs() {\r
+ if (optionalOutputRefs == null) {\r
+ optionalOutputRefs = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.optionalOutputRefs;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the whileExecutingOutputRefs property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the whileExecutingOutputRefs property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getWhileExecutingOutputRefs().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getWhileExecutingOutputRefs() {\r
+ if (whileExecutingOutputRefs == null) {\r
+ whileExecutingOutputRefs = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.whileExecutingOutputRefs;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the inputSetRefs property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the inputSetRefs property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getInputSetRefs().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link Object }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<Object>> getInputSetRefs() {\r
+ if (inputSetRefs == null) {\r
+ inputSetRefs = new ArrayList<JAXBElement<Object>>();\r
+ }\r
+ return this.inputSetRefs;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tParallelGateway complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tParallelGateway">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tGateway">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tParallelGateway")\r
+public class TParallelGateway\r
+ extends TGateway\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tParticipant complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tParticipant">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="interfaceRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="endPointRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}participantMultiplicity" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="processRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tParticipant", propOrder = {\r
+ "interfaceRef",\r
+ "endPointRef",\r
+ "participantMultiplicity"\r
+})\r
+public class TParticipant\r
+ extends TBaseElement\r
+{\r
+\r
+ protected List<QName> interfaceRef;\r
+ protected List<QName> endPointRef;\r
+ protected TParticipantMultiplicity participantMultiplicity;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "processRef")\r
+ protected QName processRef;\r
+\r
+ /**\r
+ * Gets the value of the interfaceRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the interfaceRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getInterfaceRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getInterfaceRef() {\r
+ if (interfaceRef == null) {\r
+ interfaceRef = new ArrayList<QName>();\r
+ }\r
+ return this.interfaceRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the endPointRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the endPointRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getEndPointRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getEndPointRef() {\r
+ if (endPointRef == null) {\r
+ endPointRef = new ArrayList<QName>();\r
+ }\r
+ return this.endPointRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the participantMultiplicity property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TParticipantMultiplicity }\r
+ * \r
+ */\r
+ public TParticipantMultiplicity getParticipantMultiplicity() {\r
+ return participantMultiplicity;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the participantMultiplicity property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TParticipantMultiplicity }\r
+ * \r
+ */\r
+ public void setParticipantMultiplicity(TParticipantMultiplicity value) {\r
+ this.participantMultiplicity = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the processRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getProcessRef() {\r
+ return processRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the processRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setProcessRef(QName value) {\r
+ this.processRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tParticipantAssociation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tParticipantAssociation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="innerParticipantRef" type="{http://www.w3.org/2001/XMLSchema}QName"/>\r
+ * <element name="outerParticipantRef" type="{http://www.w3.org/2001/XMLSchema}QName"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tParticipantAssociation", propOrder = {\r
+ "innerParticipantRef",\r
+ "outerParticipantRef"\r
+})\r
+public class TParticipantAssociation\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected QName innerParticipantRef;\r
+ @XmlElement(required = true)\r
+ protected QName outerParticipantRef;\r
+\r
+ /**\r
+ * Gets the value of the innerParticipantRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getInnerParticipantRef() {\r
+ return innerParticipantRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the innerParticipantRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setInnerParticipantRef(QName value) {\r
+ this.innerParticipantRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the outerParticipantRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOuterParticipantRef() {\r
+ return outerParticipantRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the outerParticipantRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOuterParticipantRef(QName value) {\r
+ this.outerParticipantRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tParticipantMultiplicity complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tParticipantMultiplicity">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <attribute name="minimum" type="{http://www.w3.org/2001/XMLSchema}int" default="0" />\r
+ * <attribute name="maximum" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tParticipantMultiplicity")\r
+public class TParticipantMultiplicity\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlAttribute(name = "minimum")\r
+ protected Integer minimum;\r
+ @XmlAttribute(name = "maximum")\r
+ protected Integer maximum;\r
+\r
+ /**\r
+ * Gets the value of the minimum property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Integer }\r
+ * \r
+ */\r
+ public int getMinimum() {\r
+ if (minimum == null) {\r
+ return 0;\r
+ } else {\r
+ return minimum;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the minimum property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Integer }\r
+ * \r
+ */\r
+ public void setMinimum(Integer value) {\r
+ this.minimum = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the maximum property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Integer }\r
+ * \r
+ */\r
+ public int getMaximum() {\r
+ if (maximum == null) {\r
+ return 1;\r
+ } else {\r
+ return maximum;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the maximum property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Integer }\r
+ * \r
+ */\r
+ public void setMaximum(Integer value) {\r
+ this.maximum = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tPartnerEntity complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tPartnerEntity">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <sequence>\r
+ * <element name="participantRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tPartnerEntity", propOrder = {\r
+ "participantRef"\r
+})\r
+public class TPartnerEntity\r
+ extends TRootElement\r
+{\r
+\r
+ protected List<QName> participantRef;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the participantRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the participantRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getParticipantRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getParticipantRef() {\r
+ if (participantRef == null) {\r
+ participantRef = new ArrayList<QName>();\r
+ }\r
+ return this.participantRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tPartnerRole complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tPartnerRole">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <sequence>\r
+ * <element name="participantRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tPartnerRole", propOrder = {\r
+ "participantRef"\r
+})\r
+public class TPartnerRole\r
+ extends TRootElement\r
+{\r
+\r
+ protected List<QName> participantRef;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the participantRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the participantRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getParticipantRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getParticipantRef() {\r
+ if (participantRef == null) {\r
+ participantRef = new ArrayList<QName>();\r
+ }\r
+ return this.participantRef;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tPerformer complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tPerformer">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tResourceRole">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tPerformer")\r
+@XmlSeeAlso({\r
+ THumanPerformer.class\r
+})\r
+public class TPerformer\r
+ extends TResourceRole\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tPotentialOwner complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tPotentialOwner">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tHumanPerformer">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tPotentialOwner")\r
+public class TPotentialOwner\r
+ extends THumanPerformer\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tProcess complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tProcess">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tCallableElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}auditing" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}monitoring" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}property" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}laneSet" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}flowElement" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}artifact" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}resourceRole" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}correlationSubscription" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="supports" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="processType" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tProcessType" default="None" />\r
+ * <attribute name="isClosed" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <attribute name="isExecutable" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <attribute name="definitionalCollaborationRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tProcess", propOrder = {\r
+ "auditing",\r
+ "monitoring",\r
+ "property",\r
+ "laneSet",\r
+ "flowElement",\r
+ "artifact",\r
+ "resourceRole",\r
+ "correlationSubscription",\r
+ "supports"\r
+})\r
+public class TProcess\r
+ extends TCallableElement\r
+{\r
+\r
+ protected TAuditing auditing;\r
+ protected TMonitoring monitoring;\r
+ protected List<TProperty> property;\r
+ protected List<TLaneSet> laneSet;\r
+ @XmlElementRef(name = "flowElement", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TFlowElement>> flowElement;\r
+ @XmlElementRef(name = "artifact", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TArtifact>> artifact;\r
+ @XmlElementRef(name = "resourceRole", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TResourceRole>> resourceRole;\r
+ protected List<TCorrelationSubscription> correlationSubscription;\r
+ protected List<QName> supports;\r
+ @XmlAttribute(name = "processType")\r
+ protected TProcessType processType;\r
+ @XmlAttribute(name = "isClosed")\r
+ protected Boolean isClosed;\r
+ @XmlAttribute(name = "isExecutable")\r
+ protected Boolean isExecutable;\r
+ @XmlAttribute(name = "definitionalCollaborationRef")\r
+ protected QName definitionalCollaborationRef;\r
+\r
+ /**\r
+ * Gets the value of the auditing property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TAuditing }\r
+ * \r
+ */\r
+ public TAuditing getAuditing() {\r
+ return auditing;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the auditing property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TAuditing }\r
+ * \r
+ */\r
+ public void setAuditing(TAuditing value) {\r
+ this.auditing = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the monitoring property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TMonitoring }\r
+ * \r
+ */\r
+ public TMonitoring getMonitoring() {\r
+ return monitoring;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the monitoring property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TMonitoring }\r
+ * \r
+ */\r
+ public void setMonitoring(TMonitoring value) {\r
+ this.monitoring = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the property property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the property property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getProperty().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TProperty }\r
+ * \r
+ * \r
+ */\r
+ public List<TProperty> getProperty() {\r
+ if (property == null) {\r
+ property = new ArrayList<TProperty>();\r
+ }\r
+ return this.property;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the laneSet property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the laneSet property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getLaneSet().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TLaneSet }\r
+ * \r
+ * \r
+ */\r
+ public List<TLaneSet> getLaneSet() {\r
+ if (laneSet == null) {\r
+ laneSet = new ArrayList<TLaneSet>();\r
+ }\r
+ return this.laneSet;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the flowElement property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the flowElement property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getFlowElement().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TFlowElement }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TExclusiveGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEndEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TAdHocSubProcess }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataObjectReference }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TComplexGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TReceiveTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSequenceFlow }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataStoreReference }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSendTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallActivity }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TScriptTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TImplicitThrowEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTransaction }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TIntermediateCatchEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TStartEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSubChoreography }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataObject }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TUserTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TBusinessRuleTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TManualTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallChoreography }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TChoreographyTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TInclusiveGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TBoundaryEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEventBasedGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TIntermediateThrowEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSubProcess }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TParallelGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TServiceTask }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TFlowElement>> getFlowElement() {\r
+ if (flowElement == null) {\r
+ flowElement = new ArrayList<JAXBElement<? extends TFlowElement>>();\r
+ }\r
+ return this.flowElement;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the artifact property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the artifact property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getArtifact().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TArtifact }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGroup }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTextAnnotation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TAssociation }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TArtifact>> getArtifact() {\r
+ if (artifact == null) {\r
+ artifact = new ArrayList<JAXBElement<? extends TArtifact>>();\r
+ }\r
+ return this.artifact;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the resourceRole property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the resourceRole property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getResourceRole().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TPerformer }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TResourceRole }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TPotentialOwner }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link THumanPerformer }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TResourceRole>> getResourceRole() {\r
+ if (resourceRole == null) {\r
+ resourceRole = new ArrayList<JAXBElement<? extends TResourceRole>>();\r
+ }\r
+ return this.resourceRole;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the correlationSubscription property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the correlationSubscription property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getCorrelationSubscription().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TCorrelationSubscription }\r
+ * \r
+ * \r
+ */\r
+ public List<TCorrelationSubscription> getCorrelationSubscription() {\r
+ if (correlationSubscription == null) {\r
+ correlationSubscription = new ArrayList<TCorrelationSubscription>();\r
+ }\r
+ return this.correlationSubscription;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the supports property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the supports property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getSupports().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getSupports() {\r
+ if (supports == null) {\r
+ supports = new ArrayList<QName>();\r
+ }\r
+ return this.supports;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the processType property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TProcessType }\r
+ * \r
+ */\r
+ public TProcessType getProcessType() {\r
+ if (processType == null) {\r
+ return TProcessType.NONE;\r
+ } else {\r
+ return processType;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the processType property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TProcessType }\r
+ * \r
+ */\r
+ public void setProcessType(TProcessType value) {\r
+ this.processType = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isClosed property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsClosed() {\r
+ if (isClosed == null) {\r
+ return false;\r
+ } else {\r
+ return isClosed;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isClosed property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsClosed(Boolean value) {\r
+ this.isClosed = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isExecutable property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsExecutable() {\r
+ return isExecutable;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isExecutable property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsExecutable(Boolean value) {\r
+ this.isExecutable = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the definitionalCollaborationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getDefinitionalCollaborationRef() {\r
+ return definitionalCollaborationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the definitionalCollaborationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setDefinitionalCollaborationRef(QName value) {\r
+ this.definitionalCollaborationRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tProcessType.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="tProcessType">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="None"/>\r
+ * <enumeration value="Public"/>\r
+ * <enumeration value="Private"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "tProcessType")\r
+@XmlEnum\r
+public enum TProcessType {\r
+\r
+ @XmlEnumValue("None")\r
+ NONE("None"),\r
+ @XmlEnumValue("Public")\r
+ PUBLIC("Public"),\r
+ @XmlEnumValue("Private")\r
+ PRIVATE("Private");\r
+ private final String value;\r
+\r
+ TProcessType(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static TProcessType fromValue(String v) {\r
+ for (TProcessType c: TProcessType.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tProperty complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tProperty">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataState" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="itemSubjectRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tProperty", propOrder = {\r
+ "dataState"\r
+})\r
+public class TProperty\r
+ extends TBaseElement\r
+{\r
+\r
+ protected TDataState dataState;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "itemSubjectRef")\r
+ protected QName itemSubjectRef;\r
+\r
+ /**\r
+ * Gets the value of the dataState property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public TDataState getDataState() {\r
+ return dataState;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the dataState property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TDataState }\r
+ * \r
+ */\r
+ public void setDataState(TDataState value) {\r
+ this.dataState = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the itemSubjectRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getItemSubjectRef() {\r
+ return itemSubjectRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the itemSubjectRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setItemSubjectRef(QName value) {\r
+ this.itemSubjectRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tReceiveTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tReceiveTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tTask">\r
+ * <attribute name="implementation" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tImplementation" default="##WebService" />\r
+ * <attribute name="instantiate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <attribute name="messageRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="operationRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tReceiveTask")\r
+public class TReceiveTask\r
+ extends TTask\r
+{\r
+\r
+ @XmlAttribute(name = "implementation")\r
+ protected String implementation;\r
+ @XmlAttribute(name = "instantiate")\r
+ protected Boolean instantiate;\r
+ @XmlAttribute(name = "messageRef")\r
+ protected QName messageRef;\r
+ @XmlAttribute(name = "operationRef")\r
+ protected QName operationRef;\r
+\r
+ /**\r
+ * Gets the value of the implementation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getImplementation() {\r
+ if (implementation == null) {\r
+ return "##WebService";\r
+ } else {\r
+ return implementation;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the implementation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setImplementation(String value) {\r
+ this.implementation = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the instantiate property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isInstantiate() {\r
+ if (instantiate == null) {\r
+ return false;\r
+ } else {\r
+ return instantiate;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the instantiate property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setInstantiate(Boolean value) {\r
+ this.instantiate = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the messageRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getMessageRef() {\r
+ return messageRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the messageRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setMessageRef(QName value) {\r
+ this.messageRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the operationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOperationRef() {\r
+ return operationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the operationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOperationRef(QName value) {\r
+ this.operationRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tRelationship complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tRelationship">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element name="source" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded"/>\r
+ * <element name="target" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded"/>\r
+ * </sequence>\r
+ * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="direction" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRelationshipDirection" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tRelationship", propOrder = {\r
+ "source",\r
+ "target"\r
+})\r
+public class TRelationship\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElement(required = true)\r
+ protected List<QName> source;\r
+ @XmlElement(required = true)\r
+ protected List<QName> target;\r
+ @XmlAttribute(name = "type", required = true)\r
+ protected String type;\r
+ @XmlAttribute(name = "direction")\r
+ protected TRelationshipDirection direction;\r
+\r
+ /**\r
+ * Gets the value of the source property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the source property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getSource().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getSource() {\r
+ if (source == null) {\r
+ source = new ArrayList<QName>();\r
+ }\r
+ return this.source;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the target property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the target property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getTarget().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getTarget() {\r
+ if (target == null) {\r
+ target = new ArrayList<QName>();\r
+ }\r
+ return this.target;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the type property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getType() {\r
+ return type;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the type property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setType(String value) {\r
+ this.type = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the direction property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TRelationshipDirection }\r
+ * \r
+ */\r
+ public TRelationshipDirection getDirection() {\r
+ return direction;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the direction property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TRelationshipDirection }\r
+ * \r
+ */\r
+ public void setDirection(TRelationshipDirection value) {\r
+ this.direction = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlEnum;\r
+import javax.xml.bind.annotation.XmlEnumValue;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tRelationshipDirection.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * <p>\r
+ * <pre>\r
+ * <simpleType name="tRelationshipDirection">\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">\r
+ * <enumeration value="None"/>\r
+ * <enumeration value="Forward"/>\r
+ * <enumeration value="Backward"/>\r
+ * <enumeration value="Both"/>\r
+ * </restriction>\r
+ * </simpleType>\r
+ * </pre>\r
+ * \r
+ */\r
+@XmlType(name = "tRelationshipDirection")\r
+@XmlEnum\r
+public enum TRelationshipDirection {\r
+\r
+ @XmlEnumValue("None")\r
+ NONE("None"),\r
+ @XmlEnumValue("Forward")\r
+ FORWARD("Forward"),\r
+ @XmlEnumValue("Backward")\r
+ BACKWARD("Backward"),\r
+ @XmlEnumValue("Both")\r
+ BOTH("Both");\r
+ private final String value;\r
+\r
+ TRelationshipDirection(String v) {\r
+ value = v;\r
+ }\r
+\r
+ public String value() {\r
+ return value;\r
+ }\r
+\r
+ public static TRelationshipDirection fromValue(String v) {\r
+ for (TRelationshipDirection c: TRelationshipDirection.values()) {\r
+ if (c.value.equals(v)) {\r
+ return c;\r
+ }\r
+ }\r
+ throw new IllegalArgumentException(v);\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tRendering complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tRendering">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tRendering")\r
+public class TRendering\r
+ extends TBaseElement\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tResource complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tResource">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}resourceParameter" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tResource", propOrder = {\r
+ "resourceParameter"\r
+})\r
+public class TResource\r
+ extends TRootElement\r
+{\r
+\r
+ protected List<TResourceParameter> resourceParameter;\r
+ @XmlAttribute(name = "name", required = true)\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the resourceParameter property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the resourceParameter property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getResourceParameter().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TResourceParameter }\r
+ * \r
+ * \r
+ */\r
+ public List<TResourceParameter> getResourceParameter() {\r
+ if (resourceParameter == null) {\r
+ resourceParameter = new ArrayList<TResourceParameter>();\r
+ }\r
+ return this.resourceParameter;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tResourceAssignmentExpression complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tResourceAssignmentExpression">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}expression"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tResourceAssignmentExpression", propOrder = {\r
+ "expression"\r
+})\r
+public class TResourceAssignmentExpression\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElementRef(name = "expression", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected JAXBElement<? extends TExpression> expression;\r
+\r
+ /**\r
+ * Gets the value of the expression property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link JAXBElement }{@code <}{@link TExpression }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TFormalExpression }{@code >}\r
+ * \r
+ */\r
+ public JAXBElement<? extends TExpression> getExpression() {\r
+ return expression;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the expression property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link JAXBElement }{@code <}{@link TExpression }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TFormalExpression }{@code >}\r
+ * \r
+ */\r
+ public void setExpression(JAXBElement<? extends TExpression> value) {\r
+ this.expression = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tResourceParameter complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tResourceParameter">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="isRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tResourceParameter")\r
+public class TResourceParameter\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "type")\r
+ protected QName type;\r
+ @XmlAttribute(name = "isRequired")\r
+ protected Boolean isRequired;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the type property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getType() {\r
+ return type;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the type property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setType(QName value) {\r
+ this.type = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isRequired property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsRequired() {\r
+ return isRequired;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isRequired property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsRequired(Boolean value) {\r
+ this.isRequired = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tResourceParameterBinding complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tResourceParameterBinding">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}expression"/>\r
+ * </sequence>\r
+ * <attribute name="parameterRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tResourceParameterBinding", propOrder = {\r
+ "expression"\r
+})\r
+public class TResourceParameterBinding\r
+ extends TBaseElement\r
+{\r
+\r
+ @XmlElementRef(name = "expression", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected JAXBElement<? extends TExpression> expression;\r
+ @XmlAttribute(name = "parameterRef", required = true)\r
+ protected QName parameterRef;\r
+\r
+ /**\r
+ * Gets the value of the expression property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link JAXBElement }{@code <}{@link TExpression }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TFormalExpression }{@code >}\r
+ * \r
+ */\r
+ public JAXBElement<? extends TExpression> getExpression() {\r
+ return expression;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the expression property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link JAXBElement }{@code <}{@link TExpression }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TFormalExpression }{@code >}\r
+ * \r
+ */\r
+ public void setExpression(JAXBElement<? extends TExpression> value) {\r
+ this.expression = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the parameterRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getParameterRef() {\r
+ return parameterRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the parameterRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setParameterRef(QName value) {\r
+ this.parameterRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tResourceRole complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tResourceRole">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <choice>\r
+ * <sequence>\r
+ * <element name="resourceRef" type="{http://www.w3.org/2001/XMLSchema}QName"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}resourceParameterBinding" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}resourceAssignmentExpression" minOccurs="0"/>\r
+ * </choice>\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tResourceRole", propOrder = {\r
+ "resourceRef",\r
+ "resourceParameterBinding",\r
+ "resourceAssignmentExpression"\r
+})\r
+@XmlSeeAlso({\r
+ TPerformer.class\r
+})\r
+public class TResourceRole\r
+ extends TBaseElement\r
+{\r
+\r
+ protected QName resourceRef;\r
+ protected List<TResourceParameterBinding> resourceParameterBinding;\r
+ protected TResourceAssignmentExpression resourceAssignmentExpression;\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+\r
+ /**\r
+ * Gets the value of the resourceRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getResourceRef() {\r
+ return resourceRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the resourceRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setResourceRef(QName value) {\r
+ this.resourceRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the resourceParameterBinding property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the resourceParameterBinding property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getResourceParameterBinding().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TResourceParameterBinding }\r
+ * \r
+ * \r
+ */\r
+ public List<TResourceParameterBinding> getResourceParameterBinding() {\r
+ if (resourceParameterBinding == null) {\r
+ resourceParameterBinding = new ArrayList<TResourceParameterBinding>();\r
+ }\r
+ return this.resourceParameterBinding;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the resourceAssignmentExpression property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TResourceAssignmentExpression }\r
+ * \r
+ */\r
+ public TResourceAssignmentExpression getResourceAssignmentExpression() {\r
+ return resourceAssignmentExpression;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the resourceAssignmentExpression property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TResourceAssignmentExpression }\r
+ * \r
+ */\r
+ public void setResourceAssignmentExpression(TResourceAssignmentExpression value) {\r
+ this.resourceAssignmentExpression = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tRootElement complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tRootElement">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tBaseElement">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tRootElement")\r
+@XmlSeeAlso({\r
+ TItemDefinition.class,\r
+ TCategory.class,\r
+ TEndPoint.class,\r
+ TPartnerRole.class,\r
+ TPartnerEntity.class,\r
+ TCollaboration.class,\r
+ TSignal.class,\r
+ TEventDefinition.class,\r
+ TDataStore.class,\r
+ TError.class,\r
+ TResource.class,\r
+ TInterface.class,\r
+ TCorrelationProperty.class,\r
+ TMessage.class,\r
+ TCallableElement.class,\r
+ TEscalation.class\r
+})\r
+public abstract class TRootElement\r
+ extends TBaseElement\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAnyElement;\r
+import javax.xml.bind.annotation.XmlMixed;\r
+import javax.xml.bind.annotation.XmlType;\r
+import org.w3c.dom.Element;\r
+\r
+\r
+/**\r
+ * <p>Java class for tScript complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tScript">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <any processContents='lax' minOccurs="0"/>\r
+ * </sequence>\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tScript", propOrder = {\r
+ "content"\r
+})\r
+public class TScript {\r
+\r
+ @XmlMixed\r
+ @XmlAnyElement(lax = true)\r
+ protected List<Object> content;\r
+\r
+ /**\r
+ * Gets the value of the content property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the content property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getContent().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link Element }\r
+ * {@link Object }\r
+ * {@link String }\r
+ * \r
+ * \r
+ */\r
+ public List<Object> getContent() {\r
+ if (content == null) {\r
+ content = new ArrayList<Object>();\r
+ }\r
+ return this.content;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tScriptTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tScriptTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tTask">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}script" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="scriptFormat" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tScriptTask", propOrder = {\r
+ "script"\r
+})\r
+public class TScriptTask\r
+ extends TTask\r
+{\r
+\r
+ protected TScript script;\r
+ @XmlAttribute(name = "scriptFormat")\r
+ protected String scriptFormat;\r
+\r
+ /**\r
+ * Gets the value of the script property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TScript }\r
+ * \r
+ */\r
+ public TScript getScript() {\r
+ return script;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the script property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TScript }\r
+ * \r
+ */\r
+ public void setScript(TScript value) {\r
+ this.script = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the scriptFormat property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getScriptFormat() {\r
+ return scriptFormat;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the scriptFormat property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setScriptFormat(String value) {\r
+ this.scriptFormat = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tSendTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tSendTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tTask">\r
+ * <attribute name="implementation" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tImplementation" default="##WebService" />\r
+ * <attribute name="messageRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <attribute name="operationRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tSendTask")\r
+public class TSendTask\r
+ extends TTask\r
+{\r
+\r
+ @XmlAttribute(name = "implementation")\r
+ protected String implementation;\r
+ @XmlAttribute(name = "messageRef")\r
+ protected QName messageRef;\r
+ @XmlAttribute(name = "operationRef")\r
+ protected QName operationRef;\r
+\r
+ /**\r
+ * Gets the value of the implementation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getImplementation() {\r
+ if (implementation == null) {\r
+ return "##WebService";\r
+ } else {\r
+ return implementation;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the implementation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setImplementation(String value) {\r
+ this.implementation = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the messageRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getMessageRef() {\r
+ return messageRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the messageRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setMessageRef(QName value) {\r
+ this.messageRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the operationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOperationRef() {\r
+ return operationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the operationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOperationRef(QName value) {\r
+ this.operationRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlIDREF;\r
+import javax.xml.bind.annotation.XmlSchemaType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tSequenceFlow complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tSequenceFlow">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tFlowElement">\r
+ * <sequence>\r
+ * <element name="conditionExpression" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="sourceRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />\r
+ * <attribute name="targetRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />\r
+ * <attribute name="isImmediate" type="{http://www.w3.org/2001/XMLSchema}boolean" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tSequenceFlow", propOrder = {\r
+ "conditionExpression"\r
+})\r
+public class TSequenceFlow\r
+ extends TFlowElement\r
+{\r
+\r
+ protected TExpression conditionExpression;\r
+ @XmlAttribute(name = "sourceRef", required = true)\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object sourceRef;\r
+ @XmlAttribute(name = "targetRef", required = true)\r
+ @XmlIDREF\r
+ @XmlSchemaType(name = "IDREF")\r
+ protected Object targetRef;\r
+ @XmlAttribute(name = "isImmediate")\r
+ protected Boolean isImmediate;\r
+\r
+ /**\r
+ * Gets the value of the conditionExpression property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getConditionExpression() {\r
+ return conditionExpression;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the conditionExpression property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setConditionExpression(TExpression value) {\r
+ this.conditionExpression = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the sourceRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getSourceRef() {\r
+ return sourceRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the sourceRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setSourceRef(Object value) {\r
+ this.sourceRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the targetRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public Object getTargetRef() {\r
+ return targetRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the targetRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Object }\r
+ * \r
+ */\r
+ public void setTargetRef(Object value) {\r
+ this.targetRef = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the isImmediate property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public Boolean isIsImmediate() {\r
+ return isImmediate;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isImmediate property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsImmediate(Boolean value) {\r
+ this.isImmediate = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tServiceTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tServiceTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tTask">\r
+ * <attribute name="implementation" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tImplementation" default="##WebService" />\r
+ * <attribute name="operationRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tServiceTask")\r
+public class TServiceTask\r
+ extends TTask\r
+{\r
+\r
+ @XmlAttribute(name = "implementation")\r
+ protected String implementation;\r
+ @XmlAttribute(name = "operationRef")\r
+ protected QName operationRef;\r
+\r
+ /**\r
+ * Gets the value of the implementation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getImplementation() {\r
+ if (implementation == null) {\r
+ return "##WebService";\r
+ } else {\r
+ return implementation;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the implementation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setImplementation(String value) {\r
+ this.implementation = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the operationRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getOperationRef() {\r
+ return operationRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the operationRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setOperationRef(QName value) {\r
+ this.operationRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tSignal complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tSignal">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tRootElement">\r
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />\r
+ * <attribute name="structureRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tSignal")\r
+public class TSignal\r
+ extends TRootElement\r
+{\r
+\r
+ @XmlAttribute(name = "name")\r
+ protected String name;\r
+ @XmlAttribute(name = "structureRef")\r
+ protected QName structureRef;\r
+\r
+ /**\r
+ * Gets the value of the name property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the name property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setName(String value) {\r
+ this.name = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the structureRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getStructureRef() {\r
+ return structureRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the structureRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setStructureRef(QName value) {\r
+ this.structureRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tSignalEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tSignalEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <attribute name="signalRef" type="{http://www.w3.org/2001/XMLSchema}QName" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tSignalEventDefinition")\r
+public class TSignalEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+ @XmlAttribute(name = "signalRef")\r
+ protected QName signalRef;\r
+\r
+ /**\r
+ * Gets the value of the signalRef property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public QName getSignalRef() {\r
+ return signalRef;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the signalRef property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link QName }\r
+ * \r
+ */\r
+ public void setSignalRef(QName value) {\r
+ this.signalRef = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.math.BigInteger;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tStandardLoopCharacteristics complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tStandardLoopCharacteristics">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tLoopCharacteristics">\r
+ * <sequence>\r
+ * <element name="loopCondition" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="testBefore" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <attribute name="loopMaximum" type="{http://www.w3.org/2001/XMLSchema}integer" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tStandardLoopCharacteristics", propOrder = {\r
+ "loopCondition"\r
+})\r
+public class TStandardLoopCharacteristics\r
+ extends TLoopCharacteristics\r
+{\r
+\r
+ protected TExpression loopCondition;\r
+ @XmlAttribute(name = "testBefore")\r
+ protected Boolean testBefore;\r
+ @XmlAttribute(name = "loopMaximum")\r
+ protected BigInteger loopMaximum;\r
+\r
+ /**\r
+ * Gets the value of the loopCondition property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getLoopCondition() {\r
+ return loopCondition;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the loopCondition property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setLoopCondition(TExpression value) {\r
+ this.loopCondition = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the testBefore property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isTestBefore() {\r
+ if (testBefore == null) {\r
+ return false;\r
+ } else {\r
+ return testBefore;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the testBefore property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setTestBefore(Boolean value) {\r
+ this.testBefore = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the loopMaximum property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link BigInteger }\r
+ * \r
+ */\r
+ public BigInteger getLoopMaximum() {\r
+ return loopMaximum;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the loopMaximum property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link BigInteger }\r
+ * \r
+ */\r
+ public void setLoopMaximum(BigInteger value) {\r
+ this.loopMaximum = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tStartEvent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tStartEvent">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tCatchEvent">\r
+ * <attribute name="isInterrupting" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tStartEvent")\r
+public class TStartEvent\r
+ extends TCatchEvent\r
+{\r
+\r
+ @XmlAttribute(name = "isInterrupting")\r
+ protected Boolean isInterrupting;\r
+\r
+ /**\r
+ * Gets the value of the isInterrupting property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isIsInterrupting() {\r
+ if (isInterrupting == null) {\r
+ return true;\r
+ } else {\r
+ return isInterrupting;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the isInterrupting property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setIsInterrupting(Boolean value) {\r
+ this.isInterrupting = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tSubChoreography complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tSubChoreography">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tChoreographyActivity">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}flowElement" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}artifact" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tSubChoreography", propOrder = {\r
+ "flowElement",\r
+ "artifact"\r
+})\r
+public class TSubChoreography\r
+ extends TChoreographyActivity\r
+{\r
+\r
+ @XmlElementRef(name = "flowElement", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TFlowElement>> flowElement;\r
+ @XmlElementRef(name = "artifact", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TArtifact>> artifact;\r
+\r
+ /**\r
+ * Gets the value of the flowElement property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the flowElement property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getFlowElement().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TFlowElement }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TExclusiveGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEndEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TAdHocSubProcess }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataObjectReference }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TComplexGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TReceiveTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSequenceFlow }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataStoreReference }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSendTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallActivity }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TScriptTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TImplicitThrowEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTransaction }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TIntermediateCatchEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TStartEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSubChoreography }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataObject }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TUserTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TBusinessRuleTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TManualTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallChoreography }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TChoreographyTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TInclusiveGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TBoundaryEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEventBasedGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TIntermediateThrowEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSubProcess }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TParallelGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TServiceTask }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TFlowElement>> getFlowElement() {\r
+ if (flowElement == null) {\r
+ flowElement = new ArrayList<JAXBElement<? extends TFlowElement>>();\r
+ }\r
+ return this.flowElement;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the artifact property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the artifact property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getArtifact().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TArtifact }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGroup }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTextAnnotation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TAssociation }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TArtifact>> getArtifact() {\r
+ if (artifact == null) {\r
+ artifact = new ArrayList<JAXBElement<? extends TArtifact>>();\r
+ }\r
+ return this.artifact;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tSubConversation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tSubConversation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tConversationNode">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}conversationNode" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tSubConversation", propOrder = {\r
+ "conversationNode"\r
+})\r
+public class TSubConversation\r
+ extends TConversationNode\r
+{\r
+\r
+ @XmlElementRef(name = "conversationNode", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TConversationNode>> conversationNode;\r
+\r
+ /**\r
+ * Gets the value of the conversationNode property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the conversationNode property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getConversationNode().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TSubConversation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TConversationNode }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TConversation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallConversation }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TConversationNode>> getConversationNode() {\r
+ if (conversationNode == null) {\r
+ conversationNode = new ArrayList<JAXBElement<? extends TConversationNode>>();\r
+ }\r
+ return this.conversationNode;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tSubProcess complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tSubProcess">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tActivity">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}laneSet" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}flowElement" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}artifact" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="triggeredByEvent" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tSubProcess", propOrder = {\r
+ "laneSet",\r
+ "flowElement",\r
+ "artifact"\r
+})\r
+@XmlSeeAlso({\r
+ TAdHocSubProcess.class,\r
+ TTransaction.class\r
+})\r
+public class TSubProcess\r
+ extends TActivity\r
+{\r
+\r
+ protected List<TLaneSet> laneSet;\r
+ @XmlElementRef(name = "flowElement", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TFlowElement>> flowElement;\r
+ @XmlElementRef(name = "artifact", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TArtifact>> artifact;\r
+ @XmlAttribute(name = "triggeredByEvent")\r
+ protected Boolean triggeredByEvent;\r
+\r
+ /**\r
+ * Gets the value of the laneSet property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the laneSet property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getLaneSet().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TLaneSet }\r
+ * \r
+ * \r
+ */\r
+ public List<TLaneSet> getLaneSet() {\r
+ if (laneSet == null) {\r
+ laneSet = new ArrayList<TLaneSet>();\r
+ }\r
+ return this.laneSet;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the flowElement property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the flowElement property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getFlowElement().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TFlowElement }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TExclusiveGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEndEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TAdHocSubProcess }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataObjectReference }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TComplexGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TReceiveTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSequenceFlow }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataStoreReference }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSendTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallActivity }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TScriptTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TImplicitThrowEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTransaction }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TIntermediateCatchEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TStartEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSubChoreography }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TDataObject }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TUserTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TBusinessRuleTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TManualTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCallChoreography }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TChoreographyTask }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TInclusiveGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TBoundaryEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEventBasedGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TIntermediateThrowEvent }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSubProcess }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TParallelGateway }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TServiceTask }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TFlowElement>> getFlowElement() {\r
+ if (flowElement == null) {\r
+ flowElement = new ArrayList<JAXBElement<? extends TFlowElement>>();\r
+ }\r
+ return this.flowElement;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the artifact property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the artifact property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getArtifact().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TArtifact }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TGroup }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTextAnnotation }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TAssociation }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TArtifact>> getArtifact() {\r
+ if (artifact == null) {\r
+ artifact = new ArrayList<JAXBElement<? extends TArtifact>>();\r
+ }\r
+ return this.artifact;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the triggeredByEvent property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public boolean isTriggeredByEvent() {\r
+ if (triggeredByEvent == null) {\r
+ return false;\r
+ } else {\r
+ return triggeredByEvent;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the triggeredByEvent property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link Boolean }\r
+ * \r
+ */\r
+ public void setTriggeredByEvent(Boolean value) {\r
+ this.triggeredByEvent = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tActivity">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tTask")\r
+@XmlSeeAlso({\r
+ TManualTask.class,\r
+ TServiceTask.class,\r
+ TScriptTask.class,\r
+ TReceiveTask.class,\r
+ TBusinessRuleTask.class,\r
+ TSendTask.class,\r
+ TUserTask.class\r
+})\r
+public class TTask\r
+ extends TActivity\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tTerminateEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tTerminateEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tTerminateEventDefinition")\r
+public class TTerminateEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAnyElement;\r
+import javax.xml.bind.annotation.XmlMixed;\r
+import javax.xml.bind.annotation.XmlType;\r
+import org.w3c.dom.Element;\r
+\r
+\r
+/**\r
+ * <p>Java class for tText complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tText">\r
+ * <complexContent>\r
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
+ * <sequence>\r
+ * <any processContents='lax' minOccurs="0"/>\r
+ * </sequence>\r
+ * </restriction>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tText", propOrder = {\r
+ "content"\r
+})\r
+public class TText {\r
+\r
+ @XmlMixed\r
+ @XmlAnyElement(lax = true)\r
+ protected List<Object> content;\r
+\r
+ /**\r
+ * Gets the value of the content property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the content property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getContent().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link Element }\r
+ * {@link Object }\r
+ * {@link String }\r
+ * \r
+ * \r
+ */\r
+ public List<Object> getContent() {\r
+ if (content == null) {\r
+ content = new ArrayList<Object>();\r
+ }\r
+ return this.content;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tTextAnnotation complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tTextAnnotation">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tArtifact">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}text" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="textFormat" type="{http://www.w3.org/2001/XMLSchema}string" default="text/plain" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tTextAnnotation", propOrder = {\r
+ "text"\r
+})\r
+public class TTextAnnotation\r
+ extends TArtifact\r
+{\r
+\r
+ protected TText text;\r
+ @XmlAttribute(name = "textFormat")\r
+ protected String textFormat;\r
+\r
+ /**\r
+ * Gets the value of the text property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TText }\r
+ * \r
+ */\r
+ public TText getText() {\r
+ return text;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the text property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TText }\r
+ * \r
+ */\r
+ public void setText(TText value) {\r
+ this.text = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the textFormat property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getTextFormat() {\r
+ if (textFormat == null) {\r
+ return "text/plain";\r
+ } else {\r
+ return textFormat;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the textFormat property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setTextFormat(String value) {\r
+ this.textFormat = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.JAXBElement;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElementRef;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.namespace.QName;\r
+\r
+\r
+/**\r
+ * <p>Java class for tThrowEvent complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tThrowEvent">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEvent">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataInput" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}dataInputAssociation" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}inputSet" minOccurs="0"/>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}eventDefinition" maxOccurs="unbounded" minOccurs="0"/>\r
+ * <element name="eventDefinitionRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tThrowEvent", propOrder = {\r
+ "dataInput",\r
+ "dataInputAssociation",\r
+ "inputSet",\r
+ "eventDefinition",\r
+ "eventDefinitionRef"\r
+})\r
+@XmlSeeAlso({\r
+ TIntermediateThrowEvent.class,\r
+ TImplicitThrowEvent.class,\r
+ TEndEvent.class\r
+})\r
+public abstract class TThrowEvent\r
+ extends TEvent\r
+{\r
+\r
+ protected List<TDataInput> dataInput;\r
+ protected List<TDataInputAssociation> dataInputAssociation;\r
+ protected TInputSet inputSet;\r
+ @XmlElementRef(name = "eventDefinition", namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", type = JAXBElement.class)\r
+ protected List<JAXBElement<? extends TEventDefinition>> eventDefinition;\r
+ protected List<QName> eventDefinitionRef;\r
+\r
+ /**\r
+ * Gets the value of the dataInput property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataInput property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataInput().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDataInput }\r
+ * \r
+ * \r
+ */\r
+ public List<TDataInput> getDataInput() {\r
+ if (dataInput == null) {\r
+ dataInput = new ArrayList<TDataInput>();\r
+ }\r
+ return this.dataInput;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the dataInputAssociation property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the dataInputAssociation property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getDataInputAssociation().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TDataInputAssociation }\r
+ * \r
+ * \r
+ */\r
+ public List<TDataInputAssociation> getDataInputAssociation() {\r
+ if (dataInputAssociation == null) {\r
+ dataInputAssociation = new ArrayList<TDataInputAssociation>();\r
+ }\r
+ return this.dataInputAssociation;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the inputSet property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TInputSet }\r
+ * \r
+ */\r
+ public TInputSet getInputSet() {\r
+ return inputSet;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the inputSet property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TInputSet }\r
+ * \r
+ */\r
+ public void setInputSet(TInputSet value) {\r
+ this.inputSet = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the eventDefinition property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the eventDefinition property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getEventDefinition().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link JAXBElement }{@code <}{@link TCancelEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTimerEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TSignalEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TLinkEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TMessageEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TCompensateEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TErrorEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEscalationEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TTerminateEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TConditionalEventDefinition }{@code >}\r
+ * {@link JAXBElement }{@code <}{@link TEventDefinition }{@code >}\r
+ * \r
+ * \r
+ */\r
+ public List<JAXBElement<? extends TEventDefinition>> getEventDefinition() {\r
+ if (eventDefinition == null) {\r
+ eventDefinition = new ArrayList<JAXBElement<? extends TEventDefinition>>();\r
+ }\r
+ return this.eventDefinition;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the eventDefinitionRef property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the eventDefinitionRef property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getEventDefinitionRef().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link QName }\r
+ * \r
+ * \r
+ */\r
+ public List<QName> getEventDefinitionRef() {\r
+ if (eventDefinitionRef == null) {\r
+ eventDefinitionRef = new ArrayList<QName>();\r
+ }\r
+ return this.eventDefinitionRef;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tTimerEventDefinition complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tTimerEventDefinition">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tEventDefinition">\r
+ * <choice>\r
+ * <element name="timeDate" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression" minOccurs="0"/>\r
+ * <element name="timeDuration" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression" minOccurs="0"/>\r
+ * <element name="timeCycle" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tExpression" minOccurs="0"/>\r
+ * </choice>\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tTimerEventDefinition", propOrder = {\r
+ "timeDate",\r
+ "timeDuration",\r
+ "timeCycle"\r
+})\r
+public class TTimerEventDefinition\r
+ extends TEventDefinition\r
+{\r
+\r
+ protected TExpression timeDate;\r
+ protected TExpression timeDuration;\r
+ protected TExpression timeCycle;\r
+\r
+ /**\r
+ * Gets the value of the timeDate property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getTimeDate() {\r
+ return timeDate;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the timeDate property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setTimeDate(TExpression value) {\r
+ this.timeDate = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the timeDuration property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getTimeDuration() {\r
+ return timeDuration;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the timeDuration property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setTimeDuration(TExpression value) {\r
+ this.timeDuration = value;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the timeCycle property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public TExpression getTimeCycle() {\r
+ return timeCycle;\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the timeCycle property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link TExpression }\r
+ * \r
+ */\r
+ public void setTimeCycle(TExpression value) {\r
+ this.timeCycle = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tTransaction complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tTransaction">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tSubProcess">\r
+ * <attribute name="method" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tTransactionMethod" default="##Compensate" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tTransaction")\r
+public class TTransaction\r
+ extends TSubProcess\r
+{\r
+\r
+ @XmlAttribute(name = "method")\r
+ protected String method;\r
+\r
+ /**\r
+ * Gets the value of the method property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getMethod() {\r
+ if (method == null) {\r
+ return "##Compensate";\r
+ } else {\r
+ return method;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the method property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setMethod(String value) {\r
+ this.method = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlAttribute;\r
+import javax.xml.bind.annotation.XmlType;\r
+\r
+\r
+/**\r
+ * <p>Java class for tUserTask complex type.\r
+ * \r
+ * <p>The following schema fragment specifies the expected content contained within this class.\r
+ * \r
+ * <pre>\r
+ * <complexType name="tUserTask">\r
+ * <complexContent>\r
+ * <extension base="{http://www.omg.org/spec/BPMN/20100524/MODEL}tTask">\r
+ * <sequence>\r
+ * <element ref="{http://www.omg.org/spec/BPMN/20100524/MODEL}rendering" maxOccurs="unbounded" minOccurs="0"/>\r
+ * </sequence>\r
+ * <attribute name="implementation" type="{http://www.omg.org/spec/BPMN/20100524/MODEL}tImplementation" default="##unspecified" />\r
+ * <anyAttribute processContents='lax' namespace='##other'/>\r
+ * </extension>\r
+ * </complexContent>\r
+ * </complexType>\r
+ * </pre>\r
+ * \r
+ * \r
+ */\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
+@XmlType(name = "tUserTask", propOrder = {\r
+ "rendering"\r
+})\r
+public class TUserTask\r
+ extends TTask\r
+{\r
+\r
+ protected List<TRendering> rendering;\r
+ @XmlAttribute(name = "implementation")\r
+ protected String implementation;\r
+\r
+ /**\r
+ * Gets the value of the rendering property.\r
+ * \r
+ * <p>\r
+ * This accessor method returns a reference to the live list,\r
+ * not a snapshot. Therefore any modification you make to the\r
+ * returned list will be present inside the JAXB object.\r
+ * This is why there is not a <CODE>set</CODE> method for the rendering property.\r
+ * \r
+ * <p>\r
+ * For example, to add a new item, do as follows:\r
+ * <pre>\r
+ * getRendering().add(newItem);\r
+ * </pre>\r
+ * \r
+ * \r
+ * <p>\r
+ * Objects of the following type(s) are allowed in the list\r
+ * {@link TRendering }\r
+ * \r
+ * \r
+ */\r
+ public List<TRendering> getRendering() {\r
+ if (rendering == null) {\r
+ rendering = new ArrayList<TRendering>();\r
+ }\r
+ return this.rendering;\r
+ }\r
+\r
+ /**\r
+ * Gets the value of the implementation property.\r
+ * \r
+ * @return\r
+ * possible object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public String getImplementation() {\r
+ if (implementation == null) {\r
+ return "##unspecified";\r
+ } else {\r
+ return implementation;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Sets the value of the implementation property.\r
+ * \r
+ * @param value\r
+ * allowed object is\r
+ * {@link String }\r
+ * \r
+ */\r
+ public void setImplementation(String value) {\r
+ this.implementation = value;\r
+ }\r
+\r
+}\r
--- /dev/null
+//\r
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 \r
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \r
+// Any modifications to this file will be lost upon recompilation of the source schema. \r
+// Generated on: 2014.08.21 at 03:38:57 PM EEST \r
+//\r
+\r
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)\r
+package org.simantics.sysdyn.modelImport.bpmn;\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+public abstract class Declaration {\r
+\r
+ private static final String CATEGORY = "\\*{56}\\s*\\.(.+)\\s*\\*{56}.*";\r
+ \r
+ protected static final String DECL_DELIM = "\\s*~\\s*";\r
+ protected static final String DECL_END = "\\s*\\|";\r
+ protected static final String DECL_UNIT = "([^~]*?)";\r
+ protected static final String DECL_DESC = "([^\\|]*?)";\r
+\r
+ protected static final String DECL_SUFFIX = \r
+ DECL_DELIM + DECL_UNIT + DECL_DELIM + DECL_DESC + DECL_END;\r
+ protected static final int declarationUnit = 1;\r
+ protected static final int declarationDescription = 2;\r
+ \r
+ private String name;\r
+ private MdlModel mdl;\r
+ \r
+ private String unit;\r
+ private String description;\r
+ \r
+ protected Declaration(String name, MdlModel mdl) {\r
+ this.name = name;\r
+ this.mdl = mdl;\r
+ }\r
+ \r
+ protected void parseSuffix(String suffix) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(DECL_SUFFIX).matcher(suffix);\r
+ if (!matcher.matches()) {\r
+ // this should not happen unless subclasses fail to construct their\r
+ // regular expressions properly\r
+ throw new Exception("could not parse declaration suffix "+suffix);\r
+ }\r
+ \r
+ unit = matcher.group(declarationUnit);\r
+ description = matcher.group(declarationDescription);\r
+ }\r
+ \r
+ public String getName() {\r
+ return name;\r
+ }\r
+ \r
+ public MdlModel getMdl() {\r
+ return mdl;\r
+ }\r
+ \r
+ public String getUnit() {\r
+ return unit;\r
+ }\r
+ \r
+ public String getDescription() {\r
+ return description;\r
+ }\r
+\r
+ public static String parseCategory(String line) {\r
+ Matcher matcher = Pattern.compile(CATEGORY).matcher(line);\r
+ return matcher.matches() ? matcher.group(1).trim() : null;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.MdlUtil;\r
+import org.simantics.sysdyn.modelImport.model.support.Function;\r
+\r
+public class Lookup extends Declaration {\r
+ \r
+ private static final String LOOKUP_RANGE =\r
+ "\\[\\("+MdlUtil.DBL_G+","+MdlUtil.DBL_G+"\\)-\\("+MdlUtil.DBL_G+","+MdlUtil.DBL_G+"\\)\\]";\r
+ private static final String LOOKUP_POINTS =\r
+ "(\\("+MdlUtil.DBL+","+MdlUtil.DBL+"\\)(?:,\\("+MdlUtil.DBL+","+MdlUtil.DBL+"\\))*)";\r
+ private static final String LOOKUP =\r
+ "("+MdlUtil.BASIC_NAME+")\\s*\\(\\s*"+LOOKUP_RANGE+","+LOOKUP_POINTS+"\\s*\\)";\r
+ \r
+ private static final String LOOKUP_DECL = \r
+ LOOKUP+"("+DECL_SUFFIX+")";\r
+ private static final int lookupName = 1;\r
+ private static final int lookupRangeXMin = 2;\r
+ private static final int lookupRangeYMin = 3;\r
+ private static final int lookupRangeXMax = 4;\r
+ private static final int lookupRangeYMax = 5;\r
+ private static final int lookupPoints = 6;\r
+ private static final int lookupSuffix = 7;\r
+ \r
+ private double xMin;\r
+ private double yMin;\r
+ private double xMax;\r
+ private double yMax;\r
+ private double[] points;\r
+ \r
+ private Function function;\r
+ \r
+ protected Lookup(String name, MdlModel mdl, \r
+ double xMin, double yMin, double xMax, double yMax, \r
+ double[] points) {\r
+ super(name, mdl);\r
+ this.xMin = xMin;\r
+ this.yMin = yMin;\r
+ this.xMax = xMax;\r
+ this.yMax = yMax;\r
+ this.points = points;\r
+ }\r
+ \r
+ public static Lookup getPossible(String line, MdlModel mdl) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(LOOKUP_DECL).matcher(line);\r
+ if (!matcher.matches()) {\r
+ return null;\r
+ }\r
+ \r
+ String name = matcher.group(lookupName).toUpperCase();\r
+ double xMin = Double.parseDouble(matcher.group(lookupRangeXMin));\r
+ double yMin = Double.parseDouble(matcher.group(lookupRangeYMin));\r
+ double xMax = Double.parseDouble(matcher.group(lookupRangeXMax));\r
+ double yMax = Double.parseDouble(matcher.group(lookupRangeYMax));\r
+ double[] points = parsePoints(matcher.group(lookupPoints));\r
+ \r
+ Lookup lookup = new Lookup(name, mdl, xMin, yMin, xMax, yMax, points);\r
+ lookup.parseSuffix(matcher.group(lookupSuffix));\r
+ return lookup;\r
+ }\r
+ \r
+ private static double[] parsePoints(String str) {\r
+ // a hack to remove the leading empty string otherwise produced by split()\r
+ str = str.replaceFirst("[(),]+", "");\r
+ String[] parts = str.split("[(),]+");\r
+ double[] points = new double[parts.length];\r
+ for (int i = 0; i < parts.length; i++) {\r
+ points[i] = Double.parseDouble(parts[i]);\r
+ }\r
+ return points;\r
+ }\r
+\r
+ public double getxMin() {\r
+ return xMin;\r
+ }\r
+\r
+ public double getyMin() {\r
+ return yMin;\r
+ }\r
+\r
+ public double getxMax() {\r
+ return xMax;\r
+ }\r
+\r
+ public double getyMax() {\r
+ return yMax;\r
+ }\r
+ \r
+ public double[] getPoints() {\r
+ return points;\r
+ }\r
+ \r
+ public Function getFunction() {\r
+ if (function != null) {\r
+ return function;\r
+ }\r
+ \r
+ StringBuilder body = new StringBuilder();\r
+ \r
+ // one input, one output\r
+ body.append("input Real i;\n");\r
+ body.append("output Real o;\n");\r
+ \r
+ // interpolate over the set of points\r
+ body.append("algorithm\n");\r
+ \r
+ body.append("o := interpolate(i, {");\r
+ for (int i = 0; i < points.length/2; i++) {\r
+ if (i > 0) {\r
+ body.append(',');\r
+ }\r
+ body.append('{').append(points[2*i]).append(',').append(points[2*i+1]).append('}');\r
+ }\r
+ body.append("});\n");\r
+ \r
+ function = new Function(getName().replaceAll("\\s+", ""), body.toString());\r
+ \r
+ return function;\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.Set;\r
+\r
+public class MdlModel {\r
+ \r
+ private String name;\r
+ \r
+ private Map<String, MdlVariable> variables;\r
+ private Map<String, ArrayList<MdlVariable>> groups;\r
+ private Map<String, Lookup> lookups;\r
+ private Map<String, Subscript> subscripts;\r
+ private List<Sketch> sketches;\r
+ \r
+ public MdlModel(String name) {\r
+ this.name = name;\r
+ \r
+ this.variables = new HashMap<String, MdlVariable>();\r
+ this.groups = new HashMap<String, ArrayList<MdlVariable>>();\r
+ this.lookups = new HashMap<String, Lookup>();\r
+ this.subscripts = new HashMap<String, Subscript>();\r
+ this.sketches = new ArrayList<Sketch>();\r
+ }\r
+ \r
+ public String getName() {\r
+ return name;\r
+ }\r
+ \r
+ public void addVariable(MdlVariable variable, String group) \r
+ throws Exception {\r
+ if (variables.get(variable.getName()) != null) {\r
+ throw new Exception("duplicate variable "+variable.getName());\r
+ }\r
+ \r
+ variables.put(variable.getName(), variable);\r
+ \r
+ if (group != null) {\r
+ if (groups.get(group) == null) {\r
+ groups.put(group, new ArrayList<MdlVariable>());\r
+ }\r
+ groups.get(group).add(variable);\r
+ }\r
+ }\r
+ \r
+ public void addSubscriptVariable(SubscriptVariable variable, String group) \r
+ throws Exception {\r
+ MdlVariable original = variables.get(variable.getName());\r
+ if (original != null) {\r
+ if (!(original instanceof SubscriptVariable)) {\r
+ throw new Exception("incompatible type for variable "+variable.getName());\r
+ }\r
+ ((SubscriptVariable)original).addSubscriptVariable(variable);\r
+ }\r
+ else {\r
+ addVariable(variable, group);\r
+ }\r
+ }\r
+ \r
+ public MdlVariable getVariable(String name) {\r
+ return variables.get(name);\r
+ }\r
+ \r
+ public Set<MdlVariable> getAllVariables() {\r
+ return new HashSet<MdlVariable>(variables.values());\r
+ }\r
+ \r
+ public void addLookup(Lookup lookup) \r
+ throws Exception {\r
+ if (lookups.get(lookup.getName()) != null) {\r
+ throw new Exception("duplicate lookup "+lookup.getName());\r
+ }\r
+ \r
+ lookups.put(lookup.getName(), lookup);\r
+ }\r
+ \r
+ public Lookup getLookup(String name) {\r
+ return lookups.get(name);\r
+ }\r
+ \r
+ public Set<Lookup> getAllLookups() {\r
+ return new HashSet<Lookup>(lookups.values());\r
+ }\r
+ \r
+ public void addSubscript(Subscript subscript) \r
+ throws Exception {\r
+ if (subscripts.get(subscript.getName()) != null) {\r
+ throw new Exception("duplicate subscript "+subscript.getName());\r
+ }\r
+ \r
+ subscripts.put(subscript.getName(), subscript);\r
+ }\r
+ \r
+ public Subscript getSubscript(String name) {\r
+ return subscripts.get(name);\r
+ }\r
+ \r
+ public Set<Subscript> getAllSubscripts() {\r
+ return new HashSet<Subscript>(subscripts.values());\r
+ }\r
+ \r
+ public Subscript resolveSubscript(Set<String> values) {\r
+ // if a value is actually a subscript, expand it to its values\r
+ Set<String> all = new HashSet<String>();\r
+ for (String value : values) {\r
+ Subscript potential = subscripts.get(value);\r
+ if (potential != null) {\r
+ all.addAll(potential.getValues());\r
+ }\r
+ else {\r
+ all.add(value);\r
+ }\r
+ }\r
+ \r
+ // find the subscript that contains exactly the given set of values.\r
+ // only consider original subscripts (ignore equivalent subscripts)\r
+ for (Subscript subscript : getAllSubscripts()) {\r
+ if (!subscript.isEquivalent() && \r
+ subscript.getValues().containsAll(all) && \r
+ all.containsAll(subscript.getValues())) {\r
+ return subscript;\r
+ }\r
+ }\r
+ \r
+ // if an exact match could not be found, return null\r
+ return null;\r
+ }\r
+ \r
+ public void addSketch(Sketch sketch) {\r
+ sketches.add(sketch);\r
+ }\r
+ \r
+ public List<Sketch> getSketches() {\r
+ return sketches;\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.ArrayList;\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.MdlUtil;\r
+import org.simantics.sysdyn.modelImport.model.Variable;\r
+import org.simantics.sysdyn.modelImport.model.expression.DelayExpression;\r
+import org.simantics.sysdyn.modelImport.model.expression.Expression;\r
+import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression;\r
+import org.simantics.sysdyn.modelImport.model.expression.NormalExpression;\r
+import org.simantics.sysdyn.modelImport.model.support.Range;\r
+\r
+public class MdlVariable extends Declaration {\r
+ \r
+ protected static final String EXPRESSION =\r
+ "(?:\\s*=\\s*([^~]*?(?:"+MdlUtil.SPECIAL_NAME+"[^~]*?)*))?";\r
+ \r
+ private static final String VARIABLE_DECL =\r
+ MdlUtil.VARIABLE+EXPRESSION+"("+DECL_SUFFIX+")";\r
+ private static final int variableName = 1;\r
+ private static final int variableExpression = 2;\r
+ private static final int variableSuffix = 3;\r
+ \r
+ private String expression;\r
+ \r
+ protected MdlVariable(String name, MdlModel mdl, String expression) {\r
+ super(name, mdl);\r
+ this.expression = expression;\r
+ }\r
+ \r
+ public static MdlVariable getPossible(String line, MdlModel mdl) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(VARIABLE_DECL).matcher(line);\r
+ if (!matcher.matches()) {\r
+ return null;\r
+ }\r
+ \r
+ String name = MdlUtil.normalize(matcher.group(variableName));\r
+ String expression = matcher.group(variableExpression);\r
+ if (expression != null)\r
+ expression = MdlUtil.normalize(expression);\r
+ \r
+ MdlVariable var = new MdlVariable(name, mdl, expression);\r
+ var.parseSuffix(matcher.group(variableSuffix));\r
+ return var;\r
+ }\r
+ \r
+ public String getExpressionString() {\r
+ return expression;\r
+ }\r
+ \r
+ public <T extends Variable> T initVariable(T variable) {\r
+ variable.setName(getName());\r
+ if (expression != null)\r
+ variable.setExpression(getExpression());\r
+ \r
+ String unit = getUnit();\r
+ Range range = parseRange(unit);\r
+ if (range != null)\r
+ unit = unit.substring(0, unit.indexOf('[')).trim();\r
+ \r
+ variable.setUnit(unit);\r
+ if (range != null)\r
+ variable.setRange(range);\r
+ variable.setDescription(getDescription());\r
+ \r
+ return variable;\r
+ }\r
+ \r
+ public Expression getExpression() {\r
+ if (expression == null) {\r
+ return null;\r
+ }\r
+ else {\r
+ return parseExpression(MdlUtil.finalize(expression, getMdl()));\r
+ }\r
+ }\r
+ \r
+ protected static Expression parseExpression(String expression) {\r
+ Matcher matcher = Pattern.compile(\r
+ MdlUtil.FUNCTION+"(.*)\\)"\r
+ ).matcher(expression);\r
+ if (!matcher.matches()) {\r
+ // the expression is not one of the special function calls\r
+ return new NormalExpression(expression);\r
+ }\r
+ \r
+ String function = matcher.group(1).toUpperCase();\r
+ String[] parameters = splitFunctionParameters(matcher.group(2));\r
+ \r
+ if (function.equals("INTEG")) {\r
+ // an integral expression\r
+ if (parameters.length != 2) {\r
+ System.err.println("malformed integral expression: "+expression);\r
+ return null;\r
+ }\r
+ return new IntegralExpression(parameters[0], parameters[1]);\r
+ }\r
+ else if (function.equals("INITIAL")) {\r
+ // as we do not have a proper replacement for Vensim "initial" \r
+ // function in sysdyn, replace it with a stock with no flows\r
+ if (parameters.length != 1) {\r
+ System.err.println("malformed initial expression: "+expression);\r
+ return null;\r
+ }\r
+ return new IntegralExpression("0", parameters[0]);\r
+ }\r
+ else if (function.equals("DELAY N")) {\r
+ // a delay expression\r
+ if (parameters.length != 4) {\r
+ System.err.println("malformed delay expression: "+expression);\r
+ return null;\r
+ }\r
+ return new DelayExpression(parameters[0], parameters[1], parameters[2], Integer.parseInt(parameters[3]));\r
+ }\r
+ else if (function.equals("SMOOTH3I")) {\r
+ if (parameters.length != 3) {\r
+ System.err.println("malformed smoothi expression: "+expression);\r
+ }\r
+ // what is the correct degree for smooth?\r
+ return new DelayExpression(parameters[0], parameters[1], parameters[2], 3);\r
+ }\r
+ else if (function.equals("SMOOTH3")) {\r
+ if (parameters.length != 2) {\r
+ System.err.println("malformed smooth expression: "+expression);\r
+ }\r
+ // what is the correct degree and initial value for smooth?\r
+ return new DelayExpression(parameters[0], parameters[1], parameters[0], 3);\r
+ }\r
+ else if (function.equals("SMOOTHI")) {\r
+ if (parameters.length != 3) {\r
+ System.err.println("malformed smoothi expression: "+expression);\r
+ }\r
+ // what is the correct degree for smooth?\r
+ return new DelayExpression(parameters[0], parameters[1], parameters[2], 1);\r
+ }\r
+ else if (function.equals("SMOOTH")) {\r
+ if (parameters.length != 2) {\r
+ System.err.println("malformed smooth expression: "+expression);\r
+ }\r
+ // what is the correct degree and initial value for smooth?\r
+ return new DelayExpression(parameters[0], parameters[1], parameters[0], 1);\r
+ }\r
+ else if (function.equals("GAME")) {\r
+ // a game expression, currently treated as a normal expression\r
+ if (parameters.length != 1) {\r
+ System.err.println("malformed game expression: "+expression);\r
+ return null;\r
+ }\r
+ return new NormalExpression(parameters[0]);\r
+ }\r
+ else {\r
+ return new NormalExpression(expression);\r
+ }\r
+ }\r
+ \r
+ private static Range parseRange(String unit) {\r
+ Matcher matcher = Pattern.compile(\r
+ "\\[(\\?|"+MdlUtil.DBL+"),(\\?|"+MdlUtil.DBL+")(,(\\?|"+MdlUtil.DBL+"))?\\]"\r
+ ).matcher(unit);\r
+ if (matcher.find()) {\r
+ Double start = null;\r
+ if (!matcher.group(1).equals("?")) {\r
+ start = Double.parseDouble(matcher.group(1));\r
+ }\r
+ Double end = null;\r
+ if (!matcher.group(2).equals("?")) {\r
+ end = Double.parseDouble(matcher.group(2));\r
+ }\r
+ Double step = null;\r
+ if (matcher.group(3) != null && !matcher.group(4).equals("?")) {\r
+ step = Double.parseDouble(matcher.group(4));\r
+ }\r
+ return new Range(start, end, step);\r
+ }\r
+ else {\r
+ return null;\r
+ }\r
+ }\r
+ \r
+ private static String[] splitFunctionParameters(String str) {\r
+ ArrayList<String> list = new ArrayList<String>();\r
+\r
+ int i;\r
+ int last = 0;\r
+ int level = 0;\r
+ boolean comment = false;\r
+ boolean brackets = false;\r
+\r
+ for (i = 0; i < str.length(); i++) {\r
+ char current = str.charAt(i);\r
+ if (current == '"')\r
+ // note that this does not currently support escaped quotation marks inside quoted variable names\r
+ comment = !comment;\r
+ else if (current == '[' && !comment)\r
+ brackets = true;\r
+ else if (current == ']' && !comment)\r
+ brackets = false;\r
+ else if (current == '(' && !comment && !brackets)\r
+ level++;\r
+ else if (current == ')' && !comment && !brackets)\r
+ level--;\r
+ else if (current == ',' && !comment && !brackets && level == 0) {\r
+ list.add(str.substring(last, i).trim());\r
+ last = i + 1;\r
+ }\r
+ }\r
+ if (last < i) {\r
+ list.add(str.substring(last, i).trim());\r
+ }\r
+\r
+ return list.toArray(new String[list.size()]);\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+\r
+public class Sketch {\r
+ \r
+ private MdlModel mdl;\r
+ private String name;\r
+ \r
+ private int xOffset = 0;\r
+ private int yOffset = 0;\r
+ \r
+ private boolean updateEdges;\r
+ private int topEdge = 0;\r
+ private int bottomEdge = 0;\r
+ private int leftEdge = 0;\r
+ private int rightEdge = 0;\r
+\r
+ private List<SketchComment> comments;\r
+ private List<SketchConnection> connections;\r
+ private List<SketchValve> valves;\r
+ private List<SketchVariable> variables;\r
+ \r
+ private HashMap<Integer, SketchObject> objects;\r
+ \r
+ public Sketch(MdlModel mdl) {\r
+ this.mdl = mdl;\r
+ \r
+ updateEdges = true;\r
+ \r
+ comments = new ArrayList<SketchComment>();\r
+ connections = new ArrayList<SketchConnection>();\r
+ valves = new ArrayList<SketchValve>();\r
+ variables = new ArrayList<SketchVariable>();\r
+ \r
+ objects = new HashMap<Integer, SketchObject>();\r
+ }\r
+ \r
+ public MdlModel getMdl() {\r
+ return mdl;\r
+ }\r
+ \r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public void setName(String name) {\r
+ this.name = name;\r
+ }\r
+ \r
+ private void updateEdges() {\r
+ if (updateEdges) {\r
+ boolean first = true;\r
+ for (SketchElement e : getAllElements()) {\r
+ topEdge = first ? e.getTop() : Math.min(topEdge, e.getTop() );\r
+ bottomEdge = first ? e.getBottom() : Math.max(bottomEdge, e.getBottom());\r
+ leftEdge = first ? e.getLeft() : Math.min(leftEdge, e.getLeft());\r
+ rightEdge = first ? e.getRight() : Math.max(rightEdge, e.getRight());\r
+ first = false;\r
+ }\r
+ updateEdges = false;\r
+ }\r
+ }\r
+ \r
+ public int getWidth() {\r
+ updateEdges();\r
+ return rightEdge - leftEdge;\r
+ }\r
+ \r
+ public int getHeight() {\r
+ updateEdges();\r
+ return bottomEdge - topEdge;\r
+ }\r
+ \r
+ // sets the relative location of this sketch in the diagram \r
+ public void setLocation(int x, int y) {\r
+ xOffset = x;\r
+ yOffset = y;\r
+ }\r
+ \r
+ public int getElementXOffset() {\r
+ updateEdges();\r
+ return -leftEdge + xOffset;\r
+ }\r
+ \r
+ public int getElementYOffset() {\r
+ updateEdges();\r
+ return -topEdge + yOffset;\r
+ }\r
+ \r
+ public void addComment(SketchComment comment) {\r
+ comments.add(comment);\r
+ objects.put(comment.getId(), comment);\r
+ updateEdges = true;\r
+ }\r
+ \r
+ public List<SketchComment> getComments() {\r
+ return comments;\r
+ }\r
+ \r
+ public void addConnection(SketchConnection connection) {\r
+ connections.add(connection);\r
+ objects.put(connection.getId(), connection);\r
+ }\r
+ \r
+ public List<SketchConnection> getConnections() {\r
+ return connections;\r
+ }\r
+ \r
+ public void addValve(SketchValve valve) {\r
+ valves.add(valve);\r
+ objects.put(valve.getId(), valve);\r
+ // replace the attached variable with the valve in order to redirect \r
+ // possible connections to the variable to the valve\r
+ objects.put(valve.getAttached().getId(), valve);\r
+ updateEdges = true;\r
+ }\r
+ \r
+ public List<SketchValve> getValves() {\r
+ return valves;\r
+ }\r
+ \r
+ public void addVariable(SketchVariable variable) {\r
+ variables.add(variable);\r
+ objects.put(variable.getId(), variable);\r
+ updateEdges = true;\r
+ }\r
+ \r
+ public List<SketchVariable> getVariables() {\r
+ return variables;\r
+ }\r
+ \r
+ public SketchObject getObject(int id) {\r
+ return objects.get(id);\r
+ }\r
+ \r
+ public List<SketchElement> getAllElements() {\r
+ ArrayList<SketchElement> list = new ArrayList<SketchElement>();\r
+ list.addAll(getComments());\r
+ list.addAll(getValves());\r
+ list.addAll(getVariables());\r
+ return list;\r
+ }\r
+ \r
+ public List<SketchVariable> getShadowVariables() {\r
+ List<SketchVariable> variables = new ArrayList<SketchVariable>();\r
+ for (SketchVariable var : getVariables()) {\r
+ if (!var.allowsIn()) {\r
+ variables.add(var);\r
+ }\r
+ }\r
+ return variables;\r
+ }\r
+ \r
+ public List<SketchVariable> getNonShadowVariables() {\r
+ List<SketchVariable> variables = new ArrayList<SketchVariable>();\r
+ variables.addAll(getVariables());\r
+ variables.removeAll(getShadowVariables());\r
+ return variables;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.model.Cloud;\r
+import org.simantics.sysdyn.modelImport.model.Comment;\r
+import org.simantics.sysdyn.modelImport.model.Symbol;\r
+\r
+public class SketchComment extends SketchElement {\r
+ \r
+ private static final String SKETCH_COMMENT =\r
+ "12,"+KEEP_I+KEEP_I+"("+ELEMENT_SUFFIX+")";\r
+ private static final int commentId = 1;\r
+ private static final int commentIcon = 2;\r
+ private static final int commentSuffix = 3;\r
+ \r
+ public enum CommentIcon {\r
+ CLOUD, OTHER\r
+ }\r
+ \r
+ private String text;\r
+ private CommentIcon icon;\r
+\r
+ protected SketchComment(int id, Sketch sketch, CommentIcon icon) {\r
+ super(id, sketch);\r
+ this.icon = icon;\r
+ }\r
+ \r
+ public static SketchComment getPossible(String line, Sketch sketch) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(SKETCH_COMMENT).matcher(line);\r
+ if (!matcher.matches()) {\r
+ return null;\r
+ }\r
+ \r
+ int id = Integer.parseInt(matcher.group(commentId));\r
+ \r
+ CommentIcon icon;\r
+ switch (Integer.parseInt(matcher.group(commentIcon))) {\r
+ case 48: icon = CommentIcon.CLOUD; break;\r
+ default: icon = CommentIcon.OTHER; break;\r
+ }\r
+ \r
+ SketchComment element = new SketchComment(id, sketch, icon);\r
+ element.parseSuffix(matcher.group(commentSuffix));\r
+ return element;\r
+ }\r
+\r
+ public String getText() {\r
+ return text;\r
+ }\r
+ \r
+ public void setText(String text) {\r
+ this.text = text;\r
+ }\r
+ \r
+ public CommentIcon getIcon() {\r
+ return icon;\r
+ }\r
+ \r
+ @Override\r
+ public Symbol getSymbol() {\r
+ if (isInputOutput())\r
+ return new Comment(getDimensions(), "I/O objects are not supported");\r
+ \r
+ switch(icon) {\r
+ case CLOUD: return new Cloud(getDimensions());\r
+ case OTHER: return new Comment(getDimensions(), text);\r
+ default: return null;\r
+ }\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.model.Connection;\r
+import org.simantics.sysdyn.modelImport.model.Dependency;\r
+import org.simantics.sysdyn.modelImport.model.Flow;\r
+import org.simantics.sysdyn.modelImport.model.Symbol;\r
+\r
+public class SketchConnection extends SketchObject {\r
+ \r
+ public enum ConnectionType {\r
+ ARROW, LINE_ARROW, LINE_SEGMENT, OTHER\r
+ }\r
+ \r
+ private static final String POINTS = "(\\d+\\|(?:\\(-?\\d+,-?\\d+\\)\\|)+)";\r
+ \r
+ // each sketch connection is declared with a string:\r
+ // 1,id,from,to,shape,hid,pol,thick,hasf,dtype,res,color,font,np|plist\r
+ \r
+ // the following regular expression matches a connection declaration and \r
+ // extracts the useful information from it\r
+ private static final String SKETCH_CONNECTION = \r
+ "1,"+KEEP_I+KEEP_I+KEEP_I+KEEP_I+SKIP_I+SKIP_I+SKIP_I+SKIP_I+SKIP_I+SKIP_I+SKIP_ANY+SKIP_ANY+POINTS;\r
+ // corresponding group indices\r
+ private static final int connectionId = 1;\r
+ private static final int connectionFrom = 2;\r
+ private static final int connectionTo = 3;\r
+ private static final int connectionShape = 4;\r
+ private static final int connectionPoints = 5;\r
+ \r
+ private static final String SAVE = "(-?\\d+),";\r
+ private static final String SKIP = "-?\\d+,";\r
+ \r
+ public static final String sketchConnection =\r
+ // 1, id, from,to, shape,hid, pol, thick,hasf,dtype,res, color,font,np|plist\r
+ "1,"+SAVE+SAVE+SAVE+SAVE+ SKIP+SKIP+SKIP+ SKIP+SKIP+ SKIP+"[^,]*,[^,]*,"+POINTS;\r
+\r
+ private int from;\r
+ private int to;\r
+ private ConnectionType type;\r
+ int[] points;\r
+\r
+ protected SketchConnection(int id, Sketch sketch, int from, int to, ConnectionType type, int[] points) {\r
+ super(id, sketch);\r
+ this.from = from;\r
+ this.to = to;\r
+ this.type = type;\r
+ this.points = points;\r
+ }\r
+ \r
+ public static SketchConnection getPossible(String line, Sketch sketch) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(SKETCH_CONNECTION).matcher(line);\r
+ if (!matcher.matches()) {\r
+ return null;\r
+ }\r
+ \r
+ int id = Integer.parseInt(matcher.group(connectionId));\r
+ int from = Integer.parseInt(matcher.group(connectionFrom));\r
+ int to = Integer.parseInt(matcher.group(connectionTo));\r
+ int connType = Integer.parseInt(matcher.group(connectionShape));\r
+ \r
+ ConnectionType type;\r
+ switch (Integer.parseInt(matcher.group(connectionShape))) {\r
+ case 0: \r
+ case 1: type = ConnectionType.ARROW; break;\r
+ case 4: type = ConnectionType.LINE_ARROW; break;\r
+ case 100: type = ConnectionType.LINE_SEGMENT; break;\r
+ default: \r
+ System.err.println("connection type "+connType+" not recognized"); \r
+ type = ConnectionType.OTHER; break;\r
+ }\r
+ \r
+ int[] points = parsePoints(matcher.group(connectionPoints));\r
+ \r
+ return new SketchConnection(id, sketch, from, to, type, points);\r
+ }\r
+ \r
+ private static int[] parsePoints(String str) {\r
+ int sep = str.indexOf('|');\r
+ int count = Integer.parseInt(str.substring(0, sep));\r
+ int[] points = new int[count*2];\r
+ for (int i = 0; i < count; i++) {\r
+ int start = sep + 1;\r
+ sep = str.indexOf('|', start);\r
+ String[] pair = str.substring(start+1, sep-1).split(",");\r
+ points[i*2] = Integer.parseInt(pair[0]);\r
+ points[i*2+1] = Integer.parseInt(pair[1]);\r
+ }\r
+ return points;\r
+ }\r
+\r
+ public int getFrom() {\r
+ return from;\r
+ }\r
+\r
+ public int getTo() {\r
+ return to;\r
+ }\r
+\r
+ public ConnectionType getType() {\r
+ return type;\r
+ }\r
+ \r
+ public int[] getPoints() {\r
+ return points;\r
+ }\r
+\r
+ public Connection getConnection() {\r
+ Symbol tail = (Symbol)getSketch().getObject(from).getModelObject();\r
+ if (tail == null) {\r
+ return null;\r
+ }\r
+ Symbol head = (Symbol)getSketch().getObject(to).getModelObject();\r
+ if (head == null) {\r
+ return null;\r
+ }\r
+ \r
+ switch (type) {\r
+ case ARROW: return new Dependency(tail, head, true, false, getAngle(getSketch()));\r
+ case LINE_ARROW: return new Flow(tail, head);\r
+ case LINE_SEGMENT: return new Flow(head, tail);\r
+ default: return null;\r
+ }\r
+ }\r
+\r
+ private double getAngle(Sketch sketch) {\r
+ if (points == null || points.length < 2) {\r
+ return 0;\r
+ }\r
+ \r
+ SketchElement tail = (SketchElement)sketch.getObject(from);\r
+ SketchElement head = (SketchElement)sketch.getObject(to);\r
+ \r
+ // 'from' element is in (x0, y0) and 'to' element is in (x2, y2)\r
+ double x0 = tail.getX();\r
+ double y0 = tail.getY();\r
+ double x2 = head.getX();\r
+ double y2 = head.getY();\r
+ \r
+ // treat the first points in points as the control point (x1, y1)\r
+ double x1 = (double)points[0];\r
+ double y1 = (double)points[1];\r
+ \r
+ //System.err.println("("+x0+","+y0+") -> ("+x1+","+y1+") -> ("+x2+","+y2+")");\r
+\r
+ double dx0 = x1 - x0;\r
+ double dy0 = y1 - y0;\r
+ double dx1 = x1 - x2;\r
+ double dy1 = y1 - y2;\r
+ double dx = x2 - x0;\r
+ double dy = y2 - y0;\r
+\r
+ // length of (p1-p0) x (p2-p0)\r
+ double dd = dx0*dy - dy0*dx; \r
+\r
+ if (Math.abs(dd) < 0.01) {\r
+ // Points are (almost) collinear\r
+ return 0;\r
+ }\r
+ else {\r
+ // (p1-p0) * (p1-p2) / dd\r
+ double offset = (dx0*dx1 + dy0*dy1) / dd;\r
+ double angle = Math.PI/2 - Math.atan(offset);\r
+ if (dd > 0)\r
+ angle = angle - Math.PI;\r
+ return angle;\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.MdlUtil;\r
+import org.simantics.sysdyn.modelImport.model.Symbol;\r
+import org.simantics.sysdyn.modelImport.model.Valve.TextPosition;\r
+\r
+public abstract class SketchElement extends SketchObject {\r
+ \r
+ // each sketch element is declared with a string:\r
+ // n,id,name,x,y,w,h,sh,bits,hid,hasf,tpos,bw,nav1,nav2(,box,fill,font)\r
+ \r
+ // n, id and name depend on the type of the sketch element, and some\r
+ // of the fields in the suffix do not contain useful information\r
+ \r
+ // the following regular expression matches the suffix of an element\r
+ // declaration and extracts the useful information from it\r
+ protected static final String ELEMENT_SUFFIX =\r
+ KEEP_I+KEEP_I+KEEP_I+KEEP_I+KEEP_I+KEEP_I+SKIP_I+SKIP_I+KEEP_I+".*";\r
+ // corresponding group indices\r
+ private static final int elementX = 1;\r
+ private static final int elementY = 2;\r
+ private static final int elementWidth = 3;\r
+ private static final int elementHeight = 4;\r
+ private static final int elementShape = 5;\r
+ private static final int elementBits = 6;\r
+ private static final int elementTextPos = 7;\r
+\r
+ private int x;\r
+ private int y;\r
+ private int width;\r
+ private int height;\r
+ private boolean attached;\r
+ private boolean allowsIn;\r
+ private boolean allowsOut;\r
+ private boolean inputOutput;\r
+ private boolean textLine;\r
+ private TextPosition textPosition;\r
+\r
+ protected SketchElement(int id, Sketch sketch) {\r
+ super(id, sketch);\r
+ }\r
+ \r
+ protected void parseSuffix(String suffix) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(ELEMENT_SUFFIX).matcher(suffix);\r
+ if (!matcher.matches()) {\r
+ // this should not happen unless subclasses fail to construct their\r
+ // regular expressions properly\r
+ throw new Exception("could not parse element suffix "+suffix);\r
+ }\r
+ \r
+ x = Integer.parseInt(matcher.group(elementX));\r
+ y = Integer.parseInt(matcher.group(elementY));\r
+ width = Integer.parseInt(matcher.group(elementWidth));\r
+ height = Integer.parseInt(matcher.group(elementHeight));\r
+ attached = (Integer.parseInt(matcher.group(elementShape)) & 1<<5) != 0;\r
+ allowsIn = (Integer.parseInt(matcher.group(elementBits)) & 1) != 0;\r
+ allowsOut = (Integer.parseInt(matcher.group(elementBits)) & 1<<1) != 0;\r
+ inputOutput = (Integer.parseInt(matcher.group(elementBits)) & 1<<3) != 0;\r
+ textLine = (Integer.parseInt(matcher.group(elementBits)) & 1<<2) != 0;\r
+ \r
+ switch (Integer.parseInt(matcher.group(elementTextPos))) {\r
+ case 0: textPosition = TextPosition.INSIDE; break;\r
+ case 1: textPosition = TextPosition.BELOW; break;\r
+ case 2: textPosition = TextPosition.LEFT; break;\r
+ case 3: textPosition = TextPosition.ABOVE; break;\r
+ case 4: textPosition = TextPosition.RIGHT; break;\r
+ default: textPosition = TextPosition.UNSET; break;\r
+ }\r
+ \r
+ }\r
+\r
+ public int getX() {\r
+ return x;\r
+ }\r
+ \r
+ public int getY() {\r
+ return y;\r
+ }\r
+ \r
+ public int getWidth() {\r
+ return width;\r
+ }\r
+\r
+ public int getHeight() {\r
+ return height;\r
+ }\r
+ \r
+ public int getTop() {\r
+ return getY() - getHeight();\r
+ }\r
+ \r
+ public int getBottom() {\r
+ return getY() + getHeight();\r
+ }\r
+ \r
+ public int getLeft() {\r
+ return getX() - getWidth();\r
+ }\r
+ \r
+ public int getRight() {\r
+ return getX() + getWidth();\r
+ }\r
+ \r
+ public boolean isAttached() {\r
+ return attached;\r
+ }\r
+\r
+ public boolean allowsIn() {\r
+ return allowsIn;\r
+ }\r
+\r
+ public boolean allowsOut() {\r
+ return allowsOut;\r
+ }\r
+\r
+ public boolean isInputOutput() {\r
+ return inputOutput;\r
+ }\r
+\r
+ public boolean hasTextLine() {\r
+ return textLine;\r
+ }\r
+ \r
+ public TextPosition getTextPosition() {\r
+ return textPosition;\r
+ }\r
+\r
+ public abstract Symbol getSymbol();\r
+ \r
+ // get sysdyn dimensions for element [x, y, width, height]\r
+ public double[] getDimensions() {\r
+ return MdlUtil.getSysdynDimensions(\r
+ getLeft() + getSketch().getElementXOffset(),\r
+ getTop() + getSketch().getElementYOffset(),\r
+ getWidth() * 2,\r
+ getHeight() * 2\r
+ );\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import org.simantics.sysdyn.modelImport.MdlUtil;\r
+import org.simantics.sysdyn.modelImport.model.IWriteableObject;\r
+\r
+public abstract class SketchObject {\r
+ \r
+ // some shorthands\r
+ protected static final String KEEP_I = MdlUtil.INT_G+",";\r
+ protected static final String SKIP_I = MdlUtil.INT+",";\r
+ protected static final String SKIP_ANY = "[^,]*,";\r
+\r
+ private int id;\r
+ private Sketch sketch;\r
+ \r
+ private IWriteableObject modelObject;\r
+ \r
+ protected SketchObject(int id, Sketch sketch) {\r
+ this.id = id;\r
+ this.sketch = sketch;\r
+ }\r
+ \r
+ public int getId() {\r
+ return id;\r
+ }\r
+ \r
+ public Sketch getSketch() {\r
+ return sketch;\r
+ }\r
+ \r
+ public void setModelObject(IWriteableObject modelObject) {\r
+ this.modelObject = modelObject;\r
+ }\r
+ \r
+ public IWriteableObject getModelObject() {\r
+ return modelObject;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.model.Valve;\r
+import org.simantics.sysdyn.modelImport.model.Valve.Orientation;\r
+\r
+public class SketchValve extends SketchElement {\r
+ \r
+ private static final String SKETCH_VALVE =\r
+ "11,"+KEEP_I+SKIP_I+"("+ELEMENT_SUFFIX+")";\r
+ private static final int valveId = 1;\r
+ private static final int valveSuffix = 2;\r
+ \r
+ private SketchVariable attached;\r
+ \r
+ protected SketchValve(int id, Sketch sketch) {\r
+ super(id, sketch);\r
+ }\r
+ \r
+ public static SketchValve getPossible(String line, Sketch sketch) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(SKETCH_VALVE).matcher(line);\r
+ if (!matcher.matches()) {\r
+ return null;\r
+ }\r
+ \r
+ int id = Integer.parseInt(matcher.group(valveId));\r
+ \r
+ SketchValve element = new SketchValve(id, sketch);\r
+ element.parseSuffix(matcher.group(valveSuffix));\r
+ return element;\r
+ }\r
+\r
+ public SketchVariable getAttached() {\r
+ return attached;\r
+ }\r
+\r
+ public void setAttached(SketchVariable attached) {\r
+ this.attached = attached;\r
+ }\r
+ \r
+ @Override\r
+ public Valve getSymbol() {\r
+ MdlVariable variable = getSketch().getMdl().getVariable(attached.getName());\r
+ if (variable == null) {\r
+ return null;\r
+ }\r
+ \r
+ Valve valve = new Valve(Orientation.HORIZONTAL, getTextPosition());\r
+ valve.setDimensions(getDimensions());\r
+ \r
+ return variable.initVariable(valve);\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.MdlUtil;\r
+import org.simantics.sysdyn.modelImport.model.Auxiliary;\r
+import org.simantics.sysdyn.modelImport.model.Variable;\r
+import org.simantics.sysdyn.modelImport.model.Stock;\r
+import org.simantics.sysdyn.modelImport.model.expression.Expression;\r
+\r
+public class SketchVariable extends SketchElement {\r
+ \r
+ private static final String SKETCH_VARIABLE =\r
+ "10,"+KEEP_I+MdlUtil.VARIABLE+",("+ELEMENT_SUFFIX+")";\r
+ private static final int variableId = 1;\r
+ private static final int variableName = 2;\r
+ private static final int variableSuffix = 3;\r
+ \r
+ private String name;\r
+\r
+ protected SketchVariable(int id, Sketch sketch, String name) {\r
+ super(id, sketch);\r
+ this.name = name;\r
+ }\r
+ \r
+ public static SketchVariable getPossible(String line, Sketch sketch) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(SKETCH_VARIABLE).matcher(line);\r
+ if (!matcher.matches()) {\r
+ return null;\r
+ }\r
+ \r
+ int id = Integer.parseInt(matcher.group(variableId));\r
+ String name = MdlUtil.normalize(matcher.group(variableName));\r
+ \r
+ SketchVariable element = new SketchVariable(id, sketch, name);\r
+ element.parseSuffix(matcher.group(variableSuffix));\r
+ return element;\r
+ }\r
+ \r
+ public String getName() {\r
+ return name;\r
+ }\r
+ \r
+ @Override\r
+ public Variable getSymbol() {\r
+ MdlVariable variable = getSketch().getMdl().getVariable(name);\r
+ if (variable == null) {\r
+ return null;\r
+ }\r
+ \r
+ Variable var;\r
+ \r
+ Expression expr = variable.getExpression();\r
+ if (expr != null && expr.getExpressionTypeString().equals("StockExpression"))\r
+ var = new Stock();\r
+ else\r
+ var = new Auxiliary();\r
+ \r
+ var.setDimensions(getDimensions());\r
+ \r
+ return variable.initVariable(var);\r
+ }\r
+ \r
+}
\ No newline at end of file
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.Arrays;\r
+import java.util.List;\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.MdlUtil;\r
+import org.simantics.sysdyn.modelImport.model.support.Enumeration;\r
+\r
+public class Subscript extends Declaration {\r
+ \r
+ private static final String SUBSCRIPT_DECL = \r
+ "("+MdlUtil.BASIC_NAME+")\\s*(:|<->)\\s*([^~]*?)("+DECL_SUFFIX+")";\r
+ private static final int subscriptName = 1;\r
+ private static final int subscriptType = 2;\r
+ private static final int subscriptExpression = 3;\r
+ private static final int subscriptSuffix = 4;\r
+ \r
+ private String original;\r
+ private List<String> values;\r
+ \r
+ private Enumeration enumeration;\r
+ \r
+ protected Subscript(String name, MdlModel mdl, List<String> values) {\r
+ super(name, mdl);\r
+ this.original = null;\r
+ this.values = values;\r
+ }\r
+ \r
+ protected Subscript(String name, MdlModel mdl, String original) {\r
+ super(name, mdl);\r
+ this.original = original;\r
+ this.values = null;\r
+ }\r
+ \r
+ public static Subscript getPossible(String line, MdlModel mdl) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(SUBSCRIPT_DECL).matcher(line); \r
+ if (!matcher.matches())\r
+ return null;\r
+ \r
+ String name = MdlUtil.normalize(matcher.group(subscriptName));\r
+ boolean equivalent = matcher.group(subscriptType).equals("<->");\r
+ String expression = MdlUtil.normalize(matcher.group(subscriptExpression));\r
+ \r
+ Subscript subscript;\r
+ if (equivalent)\r
+ subscript = new Subscript(name, mdl, expression);\r
+ else\r
+ subscript = new Subscript(name, mdl, Arrays.asList(expression.split(",")));\r
+ subscript.parseSuffix(matcher.group(subscriptSuffix));\r
+ return subscript;\r
+ }\r
+ \r
+ public String getOriginal() {\r
+ return original;\r
+ }\r
+ \r
+ public List<String> getValues() {\r
+ if (values != null)\r
+ return values;\r
+ else\r
+ return getMdl().getSubscript(original).getValues();\r
+ }\r
+ \r
+ public boolean isEquivalent() {\r
+ return original != null;\r
+ }\r
+ \r
+ public Enumeration getEnumeration() {\r
+ if (enumeration == null) {\r
+ enumeration = new Enumeration(getName(), getValues());\r
+ }\r
+ \r
+ return enumeration;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.mdl;\r
+\r
+import java.util.ArrayDeque;\r
+import java.util.ArrayList;\r
+import java.util.Arrays;\r
+import java.util.Deque;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.Set;\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.modelImport.MdlUtil;\r
+import org.simantics.sysdyn.modelImport.model.expression.EnumerationExpression;\r
+import org.simantics.sysdyn.modelImport.model.expression.NormalExpression;\r
+import org.simantics.sysdyn.modelImport.model.support.Enumeration;\r
+\r
+public class SubscriptVariable extends MdlVariable {\r
+ \r
+ // a subscript variable is a variable that has a different equation\r
+ // depending on the value of the subscript it references\r
+ private static final String SUBSCRIPT_VARIABLE_DECL = \r
+ MdlUtil.SUBSCRIPT+EXPRESSION+"("+DECL_SUFFIX+")";;\r
+ private static final int subscriptVariableName = 1;\r
+ private static final int subscriptVariableIndices = 2;\r
+ private static final int subscriptVariableExpression = 3;\r
+ private static final int subscriptVariableSuffix = 4;\r
+\r
+ private String[] indices;\r
+ private SubscriptVariable next;\r
+ \r
+ protected SubscriptVariable(String name, MdlModel mdl, String expression, String[] indices) {\r
+ super(name, mdl, expression);\r
+ this.indices = indices;\r
+ this.next = null;\r
+ }\r
+ \r
+ public static SubscriptVariable getPossible(String line, MdlModel mdl) \r
+ throws Exception {\r
+ Matcher matcher = Pattern.compile(SUBSCRIPT_VARIABLE_DECL).matcher(line);\r
+ if (!matcher.matches()) {\r
+ return null;\r
+ }\r
+ \r
+ String name = MdlUtil.normalize(matcher.group(subscriptVariableName));\r
+ String[] indices = MdlUtil.normalize(matcher.group(subscriptVariableIndices)).split(",");\r
+ String expression = matcher.group(subscriptVariableExpression);\r
+ if (expression != null)\r
+ expression = MdlUtil.normalize(expression);\r
+ \r
+ SubscriptVariable subVar = new SubscriptVariable(name, mdl, expression, indices);\r
+ subVar.parseSuffix(matcher.group(subscriptVariableSuffix));\r
+ return subVar;\r
+ }\r
+ \r
+ public String[] getIndices() {\r
+ return indices;\r
+ }\r
+ \r
+ private SubscriptVariable getNext() {\r
+ return next;\r
+ }\r
+ \r
+ private void setNext(SubscriptVariable next) {\r
+ this.next = next;\r
+ }\r
+ \r
+ public void addSubscriptVariable(SubscriptVariable variable) {\r
+ // find the last variable in the list and add the new variable after it\r
+ SubscriptVariable last = this;\r
+ while (last.getNext() != null)\r
+ last = last.getNext();\r
+ last.setNext(variable);\r
+ }\r
+ \r
+ @Override\r
+ public EnumerationExpression getExpression() {\r
+ SubscriptVariable var;\r
+ \r
+ // find out what subscripts the combined expression uses by collecting\r
+ // all subscript indices from individual expressions into a list of\r
+ // sets (one set for each "position" in the indices)\r
+ \r
+ List<Set<String>> subscripts = new ArrayList<Set<String>>();\r
+ for (int i = 0; i < indices.length; i++) {\r
+ subscripts.add(new HashSet<String>());\r
+ }\r
+ \r
+ var = this;\r
+ while (var != null) {\r
+ for (int i = 0; i < var.getIndices().length; i++) {\r
+ subscripts.get(i).add(var.getIndices()[i]);\r
+ }\r
+ \r
+ var = var.getNext();\r
+ }\r
+ \r
+ // turn the aforementioned list of sets into a list of enumeration\r
+ // by finding the enumerations that correspond to the sets of subscript\r
+ // indices\r
+ \r
+ List<Enumeration> enumerations = new ArrayList<Enumeration>();\r
+ for (Set<String> values : subscripts) {\r
+ Subscript potential = getMdl().resolveSubscript(values);\r
+ if (potential == null) {\r
+ System.err.println("subscript indices could not be resolved ");\r
+ return null;\r
+ }\r
+ enumerations.add(potential.getEnumeration());\r
+ }\r
+ \r
+ // first check if the expression is just a (either one or two \r
+ // dimensional) list of values and just parse it if this is\r
+ // the case (should only happen if there is only one expression)\r
+ \r
+ // let enum x = {a,b,c}\r
+ //\r
+ // expand subscript expression over x with equations defined as\r
+ //\r
+ // foo[x] = 1,2,3\r
+ // \r
+ // into\r
+ //\r
+ // bar[a] = 1\r
+ // bar[b] = 2\r
+ // bar[c] = 3\r
+ \r
+ // remove spaces, should maybe remove all whitespace\r
+ String exprstr = getExpressionString().replaceAll(" ", "");\r
+ \r
+ valuearray:\r
+ if (next == null) {\r
+ // number(,number)*\r
+ if (enumerations.size() == 1 && \r
+ Pattern.matches(MdlUtil.DBL+"(,"+MdlUtil.DBL+")*", exprstr)) {\r
+ EnumerationExpression expr = new EnumerationExpression(enumerations);\r
+ \r
+ String[] values = exprstr.split(",");\r
+ if (enumerations.get(0).getValues().size() != values.length) {\r
+ // could not find a value for each enumeration index, \r
+ // attempt to parse the equation normally\r
+ break valuearray;\r
+ }\r
+ for (int i = 0; i < values.length; i++) {\r
+ expr.addExpression(new NormalExpression(values[i]),\r
+ enumerations.get(0).getValues().get(i));\r
+ \r
+ }\r
+ \r
+ return expr;\r
+ }\r
+ // (number(,number)*;)*\r
+ else if (enumerations.size() == 2 && \r
+ Pattern.matches("("+MdlUtil.DBL+"(,"+MdlUtil.DBL+")*;)+", exprstr)) {\r
+ EnumerationExpression expr = new EnumerationExpression(enumerations);\r
+ \r
+ String[] rows = exprstr.split(";");\r
+ if (enumerations.get(0).getValues().size() != rows.length) {\r
+ // could not find a value for each enumeration index \r
+ // in the first enumeration, attempt to parse the equation \r
+ // normally\r
+ break valuearray;\r
+ }\r
+ for (int i = 0; i < rows.length; i++) {\r
+ String[] values = rows[i].split(",");\r
+ if (enumerations.get(1).getValues().size() != values.length) {\r
+ // could not find a value for each enumeration index\r
+ // in the second enumeration, attempt to parse the \r
+ // equation normally\r
+ break valuearray;\r
+ }\r
+ for (int j = 0; j < values.length; j++) {\r
+ expr.addExpression(new NormalExpression(values[j]),\r
+ enumerations.get(0).getValues().get(i),\r
+ enumerations.get(1).getValues().get(j));\r
+ }\r
+ }\r
+ \r
+ return expr;\r
+ }\r
+ }\r
+ \r
+ // expand the expressions to one expression for each combination of \r
+ // enumeration indices; this process must take into account the \r
+ // fact that some enumerations can be subsets of other enumerations \r
+ // and must be expanded accordingly\r
+ \r
+ // let enum x = {a,b,c} and enum y = {a,b}\r
+ //\r
+ // expand subscript expression over x with equations defined as\r
+ //\r
+ // foo[y] = bar[y]\r
+ // foo[c] = 10\r
+ //\r
+ // into:\r
+ //\r
+ // foo[a] = bar[a]\r
+ // foo[b] = bar[b]\r
+ // foo[c] = 10\r
+ \r
+ EnumerationExpression expr = new EnumerationExpression(enumerations);\r
+ \r
+ var = this;\r
+ while (var != null) {\r
+ \r
+ Deque<WorkExpression> workqueue = new ArrayDeque<WorkExpression>();\r
+ workqueue.add(new WorkExpression(var.getIndices(), var.getExpressionString()));\r
+ \r
+ for (int i = 0; i < var.getIndices().length; i++) {\r
+ int limit = workqueue.size();\r
+ for (int j = 0; j < limit; j++) {\r
+ WorkExpression current = workqueue.pollFirst();\r
+ Subscript potential = getMdl().getSubscript(current.indices[i]);\r
+ if (potential != null) {\r
+ for (String value : potential.getValues()) {\r
+ String[] newindices = Arrays.copyOf(current.indices, current.indices.length);\r
+ newindices[i] = value;\r
+ String newexpression = current.expression;\r
+ newexpression = MdlUtil.replaceSubscripts(newexpression, potential.getName(), value);\r
+ workqueue.addLast(new WorkExpression(newindices, newexpression));\r
+ }\r
+ }\r
+ else {\r
+ workqueue.addLast(current);\r
+ }\r
+ }\r
+ }\r
+ \r
+ for (WorkExpression we : workqueue) {\r
+ String expression = MdlUtil.finalize(we.expression, getMdl());\r
+ // TODO: is this check correct?\r
+ if (next == null) {\r
+ // Vensim allows comparison of subscript indices which\r
+ // is not a meaningful operation in sysdyn, so attempt\r
+ // to resolve and remove them here\r
+ expression = removeComparisons(expression, indices, we.indices);\r
+ }\r
+ expr.addExpression(parseExpression(expression), we.indices);\r
+ }\r
+ \r
+ var = var.getNext();\r
+ }\r
+ \r
+ return expr;\r
+ }\r
+ \r
+ private class WorkExpression {\r
+ String[] indices;\r
+ String expression;\r
+ \r
+ private WorkExpression(String[] indices, String expression) {\r
+ this.indices = indices;\r
+ this.expression = expression;\r
+ }\r
+ }\r
+ \r
+ private static String removeComparisons(String expression, String[] subscripts, String[] values) {\r
+ \r
+ if (!expression.contains("=")) {\r
+ return expression;\r
+ }\r
+ \r
+ for (int i = 0; i < subscripts.length; i++) {\r
+ for (int j = 0; j < subscripts.length; j++) {\r
+ StringBuilder result = new StringBuilder();\r
+ int offset = 0;\r
+ \r
+ Matcher matcher = Pattern.compile(subscripts[i]+"\\s*=\\s*"+subscripts[j]).matcher(expression);\r
+ while (matcher.find()) {\r
+ result.append(expression.substring(offset, matcher.start()));\r
+ \r
+ if (values[i].equals(values[j])) {\r
+ result.append("true");\r
+ }\r
+ else {\r
+ result.append("false");\r
+ }\r
+ \r
+ offset = matcher.end();\r
+ }\r
+ if (offset < expression.length()) {\r
+ result.append(expression.substring(offset));\r
+ }\r
+ \r
+ expression = result.toString();\r
+ }\r
+ }\r
+ \r
+ return expression;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.expression.Expression;\r
+import org.simantics.sysdyn.modelImport.model.support.Range;\r
+\r
+public class Auxiliary extends Variable {\r
+ \r
+ public Auxiliary() {\r
+ \r
+ }\r
+ \r
+ public Auxiliary(double[] dim, String name, Expression expression, Range range, String unit, String description) {\r
+ super(dim, name, expression, range, unit, description);\r
+ }\r
+ \r
+ @Override\r
+ public Resource getVariableType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).Auxiliary;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getSymbolType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).AuxiliarySymbol;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class Cloud extends Symbol {\r
+ \r
+ private Resource cloud;\r
+ \r
+ public Cloud() {\r
+ \r
+ }\r
+ \r
+ public Cloud(double[] dim) {\r
+ super(dim);\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ ModelingResources mr = ModelingResources.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ cloud = GraphUtils.create2(graph, sr.Cloud,\r
+ l0.HasName, context.getNextCloud(),\r
+ l0.PartOf, parent);\r
+ \r
+ Resource symbol = super.write(graph, parent, context);\r
+ graph.claim(symbol, mr.ElementToComponent, cloud);\r
+ \r
+ return cloud;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getSymbolType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).CloudSymbol;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getResource() {\r
+ return cloud;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.diagram.stubs.DiagramResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class Comment extends Symbol {\r
+ \r
+ private String text;\r
+ \r
+ public Comment() {\r
+ \r
+ }\r
+ \r
+ public Comment(String text) {\r
+ this.text = text;\r
+ }\r
+ \r
+ public Comment(double[] dim, String text) {\r
+ super(dim);\r
+ this.text = text;\r
+ }\r
+\r
+ public String getText() {\r
+ return text;\r
+ }\r
+\r
+ public void setText(String text) {\r
+ this.text = text;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ DiagramResource dr = DiagramResource.getInstance(graph);\r
+ \r
+ Resource symbol = super.write(graph, parent, context);\r
+ \r
+ graph.claimLiteral(symbol, dr.HasText, text, Bindings.STRING);\r
+ \r
+ return symbol;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getSymbolType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).AdditionalSymbols_MultilineText;\r
+ }\r
+\r
+ @Override\r
+ public Resource getResource() {\r
+ // comments only have diagram resources\r
+ return getDiagramResource();\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.utils.OrderedSetUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.diagram.stubs.DiagramResource;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public abstract class Connection implements IWriteableObject {\r
+\r
+ private Symbol head;\r
+ private Symbol tail;\r
+ \r
+ private Resource connection;\r
+ private Resource diagramConnection;\r
+ \r
+ public Connection() {\r
+ \r
+ }\r
+\r
+ public Connection(Symbol tail, Symbol head) {\r
+ this.tail = tail;\r
+ this.head = head;\r
+ }\r
+ \r
+ public Symbol getHead() {\r
+ return head;\r
+ }\r
+\r
+ public void setHead(Symbol head) {\r
+ this.head = head;\r
+ }\r
+\r
+ public Symbol getTail() {\r
+ return tail;\r
+ }\r
+\r
+ public void setTail(Symbol tail) {\r
+ this.tail = tail;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ DiagramResource dr = DiagramResource.getInstance(graph);\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ ModelingResources mr = ModelingResources.getInstance(graph);\r
+ StructuralResource2 sr2 = StructuralResource2.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ connection = GraphUtils.create2(graph, getConnectionType(graph),\r
+ sr.Variable_HasHead, head.getResource(),\r
+ sr.Variable_HasTail, tail.getResource(),\r
+ l0.PartOf, parent);\r
+ graph.claim(connection, mr.Mapped, connection);\r
+ \r
+ Resource diagram = graph.getSingleObject(parent, mr.CompositeToDiagram);\r
+ \r
+ Resource tailConnector = GraphUtils.create2(graph, dr.Connector,\r
+ sr.HasTailTerminal, tail.getDiagramResource());\r
+\r
+ Resource headConnector = GraphUtils.create2(graph, dr.Connector,\r
+ sr.HasHeadTerminal, head.getDiagramResource(),\r
+ dr.AreConnected, tailConnector);\r
+\r
+ diagramConnection = GraphUtils.create2(graph, getDiagramConnectionType(graph),\r
+ l0.HasName, context.getNextObject(),\r
+ l0.PartOf, diagram,\r
+ sr2.HasConnectionType, sr.SysdynConnectionType,\r
+ mr.DiagramConnectionToConnection, connection,\r
+ dr.HasArrowConnector, headConnector,\r
+ dr.HasPlainConnector, tailConnector);\r
+\r
+ OrderedSetUtils.add(graph, diagram, diagramConnection);\r
+ \r
+ return connection;\r
+ }\r
+ \r
+ public abstract Resource getConnectionType(ReadGraph graph);\r
+ public abstract Resource getDiagramConnectionType(ReadGraph graph);\r
+ \r
+ @Override\r
+ public Resource getResource() {\r
+ return connection;\r
+ }\r
+ \r
+ public Resource getDiagramResource() {\r
+ return diagramConnection;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class Dependency extends Connection {\r
+ \r
+ private boolean showArrow;\r
+ private boolean showDelay;\r
+ private double angle;\r
+ \r
+ public Dependency() {\r
+ \r
+ }\r
+ \r
+ public Dependency(boolean showArrow, boolean showDelay, double angle) {\r
+ this.showArrow = showArrow;\r
+ this.showDelay = showDelay;\r
+ this.angle = angle;\r
+ }\r
+ \r
+ public Dependency(Symbol tail, Symbol head, boolean showArrow, boolean showDelay, double angle) {\r
+ super(tail, head);\r
+ this.showArrow = showArrow;\r
+ this.showDelay = showDelay;\r
+ this.angle = angle;\r
+ }\r
+\r
+ public boolean isShowArrow() {\r
+ return showArrow;\r
+ }\r
+\r
+ public void setShowArrow(boolean showArrow) {\r
+ this.showArrow = showArrow;\r
+ }\r
+\r
+ public boolean isShowDelay() {\r
+ return showDelay;\r
+ }\r
+\r
+ public void setShowDelay(boolean showDelay) {\r
+ this.showDelay = showDelay;\r
+ }\r
+\r
+ public double getAngle() {\r
+ return angle;\r
+ }\r
+\r
+ public void setAngle(double angle) {\r
+ this.angle = angle;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ if (getHead() == null || getTail() == null) {\r
+ System.err.println("dependency missing head or tail");\r
+ return null;\r
+ }\r
+ \r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ Resource dependency = super.write(graph, parent, context);\r
+ graph.claimLiteral(dependency, l0.HasName, context.getNextDependency(), Bindings.STRING);\r
+ \r
+ graph.claimLiteral(getDiagramResource(), sr.Dependency_angle, angle, Bindings.DOUBLE);\r
+ \r
+ return dependency;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getConnectionType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).Dependency;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getDiagramConnectionType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).DependencyConnection;\r
+ }\r
+ \r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class Flow extends Connection {\r
+ \r
+ public Flow() {\r
+ \r
+ }\r
+ \r
+ public Flow(Symbol tail, Symbol head) {\r
+ super(tail, head);\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ if (getHead() == null || getTail() == null) {\r
+ System.err.println("flow missing head or tail");\r
+ return null;\r
+ }\r
+ \r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ \r
+ Resource flow = super.write(graph, parent, context);\r
+ graph.claimLiteral(flow, l0.HasName, context.getNextFlow(), Bindings.STRING);\r
+ \r
+ return flow;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getConnectionType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).Flow;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getDiagramConnectionType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).FlowConnection;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+public interface IWriteableObject {\r
+ \r
+ /**\r
+ * Write this object to the graph and return the corresponding resource.\r
+ * \r
+ * @param graph \r
+ * @param parent \r
+ * @param context\r
+ * @return Resource\r
+ * @throws DatabaseException \r
+ */\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException;\r
+ \r
+ /**\r
+ * Return the resource corresponding to this object or null if this object has not been written yet.\r
+ * \r
+ * @return Resource\r
+ */\r
+ public Resource getResource();\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.diagram.stubs.DiagramResource;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.support.Enumeration;\r
+import org.simantics.sysdyn.modelImport.model.support.Function;\r
+import org.simantics.sysdyn.utils.ModelUtils;\r
+\r
+public class Model implements IWriteableObject {\r
+ \r
+ private String name;\r
+ // necessary simulation parameters\r
+ private Double start, stop, step;\r
+ private String unit;\r
+ \r
+ // the structure of the model\r
+ private Map<String, Variable> variables;\r
+ private Map<String, Enumeration> enumerations;\r
+ private Map<String, Function> functions;\r
+ \r
+ private List<Symbol> symbols;\r
+ private List<Shadow> shadows;\r
+ private List<Connection> connections;\r
+ \r
+ private Resource model;\r
+ \r
+ public Model(String name) {\r
+ this.name = name;\r
+ \r
+ variables = new HashMap<String, Variable>();\r
+ enumerations = new HashMap<String, Enumeration>();\r
+ functions = new HashMap<String, Function>();\r
+ \r
+ symbols = new ArrayList<Symbol>();\r
+ shadows = new ArrayList<Shadow>();\r
+ connections = new ArrayList<Connection>();\r
+ }\r
+\r
+ public double getStartTime() {\r
+ return start;\r
+ }\r
+\r
+ public void setStartTime(double start) {\r
+ this.start = start;\r
+ }\r
+\r
+ public double getStopTime() {\r
+ return stop;\r
+ }\r
+\r
+ public void setStopTime(double stop) {\r
+ this.stop = stop;\r
+ }\r
+\r
+ public double getTimeStep() {\r
+ return step;\r
+ }\r
+\r
+ public void setTimeStep(double step) {\r
+ this.step = step;\r
+ }\r
+ \r
+ public String getTimeUnit() {\r
+ return unit;\r
+ }\r
+ \r
+ public void setTimeUnit(String unit) {\r
+ this.unit = unit;\r
+ }\r
+ \r
+ public void addVariable(Variable variable) {\r
+ if (variables.get(variable.getName()) != null) {\r
+ System.err.println("variable "+variable.getName()+" already defined");\r
+ return;\r
+ }\r
+ \r
+ variables.put(variable.getName(), variable);\r
+ \r
+ symbols.add(variable);\r
+ }\r
+ \r
+ public Variable getVariable(String name) {\r
+ return variables.get(name);\r
+ }\r
+ \r
+ public Collection<Variable> getVariables() {\r
+ return variables.values();\r
+ }\r
+ \r
+ public void addShadow(Shadow shadow) {\r
+ shadows.add(shadow);\r
+ }\r
+ \r
+ public void addSymbol(Symbol element) {\r
+ symbols.add(element);\r
+ }\r
+ \r
+ public void addConnection(Connection connection) {\r
+ // TODO: make sure connection head and tail exist\r
+ connections.add(connection);\r
+ }\r
+ \r
+ public void addEnumeration(Enumeration enumeration) {\r
+ if (enumerations.get(enumeration.getName()) != null) {\r
+ System.err.println("enumeration "+enumeration.getName()+" already defined");\r
+ return;\r
+ }\r
+ enumerations.put(enumeration.getName(), enumeration);\r
+ }\r
+ \r
+ public Enumeration getEnumeration(String name) {\r
+ return enumerations.get(name);\r
+ }\r
+ \r
+ public Collection<Enumeration> getEnumerations() {\r
+ return enumerations.values();\r
+ }\r
+ \r
+ public void addFunction(Function function) {\r
+ if (functions.get(function.getName()) != null) {\r
+ System.err.println("function "+function.getName()+" already defined");\r
+ return;\r
+ }\r
+ functions.put(function.getName(), function);\r
+ }\r
+ \r
+ public Function getEFunction(String name) {\r
+ return functions.get(name);\r
+ }\r
+ \r
+ public Collection<Function> getFunctions() {\r
+ return functions.values();\r
+ }\r
+ \r
+ public Resource write(WriteGraph graph, Resource project) throws DatabaseException {\r
+ return write(graph, project, new WriteContext());\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ DiagramResource dr = DiagramResource.getInstance(graph);\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ ModelingResources mr = ModelingResources.getInstance(graph);\r
+ SimulationResource sim = SimulationResource.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ model = ModelUtils.createModel(graph);\r
+ \r
+ Resource container = graph.getSingleObject(model, l0.PartOf);\r
+ String freshName = NameUtils.findFreshName(graph, name, container, l0.ConsistsOf, "%s%d");\r
+ graph.claimLiteral(model, l0.HasName, freshName, Bindings.STRING);\r
+ graph.claimLiteral(model, l0.HasLabel, freshName, Bindings.STRING);\r
+ \r
+ // TODO: this must be updated if/when simulation parameters are moved \r
+ // from model to experiment\r
+ if (start != null)\r
+ graph.claimLiteral(model, sr.SysdynModel_startTime, start, Bindings.DOUBLE);\r
+ if (stop != null)\r
+ graph.claimLiteral(model, sr.SysdynModel_stopTime, stop, Bindings.DOUBLE);\r
+ if (step != null)\r
+ graph.claimLiteral(model, sr.SysdynModel_simulationStepLength, step, Bindings.DOUBLE);\r
+ if (unit != null)\r
+ graph.claimLiteral(model, sr.SysdynModel_timeUnit, unit, Bindings.STRING);\r
+ \r
+ Resource configuration = graph.getSingleObject(model, sim.HasConfiguration);\r
+ \r
+ for (Enumeration e : getEnumerations()) {\r
+ e.write(graph, configuration, context);\r
+ }\r
+ \r
+ for (Function f : getFunctions()) {\r
+ f.write(graph, model, context);\r
+ }\r
+ \r
+ for (Symbol e : symbols) {\r
+ e.write(graph, configuration, context);\r
+ }\r
+ \r
+ for (Shadow s : shadows) {\r
+ s.write(graph, configuration, context);\r
+ }\r
+ \r
+ for (Connection c : connections) {\r
+ c.write(graph, configuration, context);\r
+ }\r
+ \r
+ Resource diagram = graph.getSingleObject(configuration, mr.CompositeToDiagram);\r
+ graph.claimLiteral(diagram, dr.HasModCount, context.getObjectCount(), Bindings.LONG);\r
+ \r
+ return model;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getResource() {\r
+ return model;\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class Shadow extends Symbol {\r
+\r
+ private Variable original;\r
+ \r
+ private Resource shadow;\r
+ \r
+ public Shadow() {\r
+ \r
+ }\r
+ \r
+ public Shadow(Variable original) {\r
+ this.original = original;\r
+ }\r
+ \r
+ public Shadow(double[] dim, Variable original) {\r
+ super(dim);\r
+ this.original = original;\r
+ }\r
+\r
+ public Variable getOriginal() {\r
+ return original;\r
+ }\r
+\r
+ public void setOriginal(Variable original) {\r
+ this.original = original;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ ModelingResources mr = ModelingResources.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ shadow = GraphUtils.create2(graph, sr.Shadow,\r
+ l0.HasName, context.getNextShadow(),\r
+ l0.PartOf, parent);\r
+ \r
+ graph.claim(shadow, sr.Shadow_original, original.getResource());\r
+ \r
+ Resource symbol = super.write(graph, parent, context);\r
+ graph.claim(symbol, mr.ElementToComponent, shadow);\r
+ \r
+ return shadow;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getSymbolType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).ShadowSymbol;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getResource() {\r
+ return shadow;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.expression.IntegralExpression;\r
+import org.simantics.sysdyn.modelImport.model.support.Range;\r
+\r
+public class Stock extends Variable {\r
+ \r
+ public Stock() {\r
+ \r
+ }\r
+ \r
+ public Stock(double[] dim, String name, IntegralExpression expression, Range range, String unit, String description) {\r
+ super(dim, name, expression, range, unit, description);\r
+ }\r
+ \r
+ @Override\r
+ public Resource getVariableType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).Stock;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getSymbolType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).StockSymbol;\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.utils.OrderedSetUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.diagram.stubs.DiagramResource;\r
+import org.simantics.diagram.stubs.G2DResource;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.modeling.ModelingResources;\r
+\r
+public abstract class Symbol implements IWriteableObject {\r
+ \r
+ private double x;\r
+ private double y;\r
+ private double width;\r
+ private double height;\r
+\r
+ private Resource symbol;\r
+ \r
+ public Symbol() {\r
+ \r
+ }\r
+\r
+ public Symbol(double[] dim) {\r
+ x = dim[0];\r
+ y = dim[1];\r
+ width = dim[2];\r
+ height = dim[3];\r
+ }\r
+ \r
+ public void setDimensions(double[] dim) {\r
+ x = dim[0];\r
+ y = dim[1];\r
+ width = dim[2];\r
+ height = dim[3];\r
+ }\r
+\r
+ public double getX() {\r
+ return x;\r
+ }\r
+\r
+ public void setX(double x) {\r
+ this.x = x;\r
+ }\r
+\r
+ public double getY() {\r
+ return y;\r
+ }\r
+\r
+ public void setY(double y) {\r
+ this.y = y;\r
+ }\r
+\r
+ public double getWidth() {\r
+ return width;\r
+ }\r
+\r
+ public void setWidth(double width) {\r
+ this.width = width;\r
+ }\r
+\r
+ public double getHeight() {\r
+ return height;\r
+ }\r
+\r
+ public void setHeight(double height) {\r
+ this.height = height;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ DiagramResource dr = DiagramResource.getInstance(graph);\r
+ G2DResource g2d = G2DResource.getInstance(graph);\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ ModelingResources mr = ModelingResources.getInstance(graph);\r
+\r
+ Resource diagram = graph.getSingleObject(parent, mr.CompositeToDiagram);\r
+ \r
+ symbol = GraphUtils.create2(graph, getSymbolType(graph),\r
+ l0.HasName, context.getNextObject(),\r
+ l0.PartOf, diagram);\r
+\r
+ double[] transform = { 1.0, 0.0, 0.0, 1.0, x, y };\r
+ graph.claimLiteral(symbol, dr.HasTransform, g2d.Transform, transform, Bindings.DOUBLE_ARRAY);\r
+\r
+ OrderedSetUtils.add(graph, diagram, symbol);\r
+ \r
+ return symbol;\r
+ }\r
+ \r
+ public abstract Resource getSymbolType(ReadGraph graph);\r
+ \r
+ public Resource getDiagramResource() {\r
+ return symbol;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.expression.Expression;\r
+import org.simantics.sysdyn.modelImport.model.support.Range;\r
+\r
+public class Valve extends Variable {\r
+ \r
+ public enum Orientation {\r
+ HORIZONTAL, VERTICAL\r
+ }\r
+ \r
+ public enum TextPosition {\r
+ INSIDE, BELOW, LEFT, ABOVE, RIGHT, UNSET\r
+ }\r
+ \r
+ private Orientation orientation;\r
+ private TextPosition position;\r
+ \r
+ public Valve() {\r
+ \r
+ }\r
+ \r
+ public Valve(Orientation orientation, TextPosition position) {\r
+ this.orientation = orientation;\r
+ this.position = position;\r
+ }\r
+ \r
+ public Valve(double[] dim, String name, Expression expression, Range range, String unit, String description, \r
+ Orientation orientation, TextPosition position) {\r
+ super(dim, name, expression, range, unit, description);\r
+ this.orientation = orientation;\r
+ this.position = position;\r
+ }\r
+\r
+ public Orientation getOrientation() {\r
+ return orientation;\r
+ }\r
+\r
+ public void setOrientation(Orientation orientation) {\r
+ this.orientation = orientation;\r
+ }\r
+\r
+ public TextPosition getPosition() {\r
+ return position;\r
+ }\r
+\r
+ public void setPosition(TextPosition position) {\r
+ this.position = position;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+\r
+ Resource location = null;\r
+ switch (position) {\r
+ case BELOW: location = sr.Bottom; break;\r
+ case LEFT: location = sr.Left; break;\r
+ case ABOVE: location = sr.Top; break;\r
+ case RIGHT: location = sr.Right; break;\r
+ case UNSET:\r
+ default: System.err.println("valve text location not set"); location = sr.Bottom; break;\r
+ }\r
+ \r
+ Resource valve = super.write(graph, parent, context);\r
+ \r
+ graph.claim(getDiagramResource(), sr.ValveSymbol_textLocation, location);\r
+ \r
+ return valve;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getVariableType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).Valve;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getSymbolType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).ValveSymbol;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.expression.Expression;\r
+import org.simantics.sysdyn.modelImport.model.support.Range;\r
+\r
+public abstract class Variable extends Symbol {\r
+\r
+ private String name;\r
+ private Expression expression;\r
+ private Range range;\r
+ private String unit;\r
+ private String description;\r
+ \r
+ private Resource variable;\r
+ \r
+ public Variable() {\r
+ \r
+ }\r
+ \r
+ public Variable(String name, Expression expression, Range range, String unit, String description) {\r
+ this.name = name;\r
+ this.expression = expression;\r
+ this.range = range;\r
+ this.unit = unit;\r
+ this.description = description;\r
+ }\r
+\r
+ public Variable(double[] dim, String name, Expression expression, Range range, String unit, String description) {\r
+ super(dim);\r
+ this.name = name;\r
+ this.expression = expression;\r
+ this.range = range;\r
+ this.unit = unit;\r
+ this.description = description;\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public void setName(String name) {\r
+ this.name = name;\r
+ }\r
+\r
+ public Expression getExpression() {\r
+ return expression;\r
+ }\r
+\r
+ public void setExpression(Expression expression) {\r
+ this.expression = expression;\r
+ }\r
+\r
+ public Range getRange() {\r
+ return range;\r
+ }\r
+\r
+ public void setRange(Range range) {\r
+ this.range = range;\r
+ }\r
+\r
+ public String getUnit() {\r
+ return unit;\r
+ }\r
+\r
+ public void setUnit(String unit) {\r
+ this.unit = unit;\r
+ }\r
+\r
+ public String getDescription() {\r
+ return description;\r
+ }\r
+\r
+ public void setDescription(String description) {\r
+ this.description = description;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ ModelingResources mr = ModelingResources.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+\r
+ variable = GraphUtils.create2(graph, getVariableType(graph), \r
+ l0.HasName, name,\r
+ l0.PartOf, parent);\r
+ graph.claim(variable, mr.Mapped, variable);\r
+ \r
+ // TODO: write references to enumerations here?\r
+ \r
+ if (expression != null) {\r
+ expression.write(graph, variable, context);\r
+ }\r
+ if (range != null) {\r
+ range.write(graph, variable, context);\r
+ }\r
+ if (unit != null && !unit.isEmpty()) {\r
+ graph.claimLiteral(variable, sr.Variable_unit, unit, Bindings.STRING);\r
+ }\r
+ if (description != null && !description.isEmpty()) {\r
+ graph.claimLiteral(variable, l0.HasDescription, description, Bindings.STRING);\r
+ }\r
+ \r
+ Resource symbol = super.write(graph, parent, context);\r
+ graph.claim(symbol, mr.ElementToComponent, variable);\r
+\r
+ return variable;\r
+ }\r
+ \r
+ public abstract Resource getVariableType(ReadGraph graph);\r
+ \r
+ @Override\r
+ public Resource getResource() {\r
+ return variable;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model;\r
+\r
+public class WriteContext {\r
+ \r
+ private long objectCount;\r
+ \r
+ private long cloudCount;\r
+ private long shadowCount;\r
+ private long dependencyCount;\r
+ private long flowCount;\r
+ \r
+ public WriteContext() {\r
+ objectCount = 0;\r
+ \r
+ cloudCount = 0;\r
+ shadowCount = 0;\r
+ dependencyCount = 0;\r
+ flowCount = 0;\r
+ }\r
+ \r
+ public String getNextObject() {\r
+ return Long.toString(objectCount++);\r
+ }\r
+ \r
+ public long getObjectCount() {\r
+ return objectCount;\r
+ }\r
+ \r
+ public String getNextCloud() {\r
+ return "Cloud" + cloudCount++;\r
+ }\r
+ \r
+ public String getNextShadow() {\r
+ return "Shadow" + shadowCount++;\r
+ }\r
+ \r
+ public String getNextDependency() {\r
+ return "Dependency" + dependencyCount++;\r
+ }\r
+ \r
+ public String getNextFlow() {\r
+ return "Flow" + flowCount++;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model.expression;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
+\r
+public class DelayExpression extends Expression {\r
+ \r
+ private String expression;\r
+ private String time;\r
+ private String initial;\r
+ private int order;\r
+ \r
+ public DelayExpression(String expression, String time, String initial, int order) {\r
+ this.expression = expression;\r
+ this.time = time;\r
+ this.initial = initial;\r
+ this.order = order;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ Resource expr = super.write(graph, parent, context);\r
+ \r
+ graph.claimLiteral(expr, sr.DelayExpression_expression, expression, Bindings.STRING);\r
+ graph.claimLiteral(expr, sr.DelayExpression_delayTime, time, Bindings.STRING);\r
+ graph.claimLiteral(expr, sr.DelayExpression_initialValue, initial, Bindings.STRING);\r
+ graph.claimLiteral(expr, sr.DelayExpression_order, order, Bindings.INTEGER);\r
+ \r
+ return expr;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getExpressionType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).DelayExpression;\r
+ }\r
+ \r
+ @Override\r
+ public String getExpressionTypeString() {\r
+ return "DelayExpression";\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model.expression;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
+import org.simantics.sysdyn.modelImport.model.support.Enumeration;\r
+\r
+public class EnumerationExpression extends Expression {\r
+ \r
+ private List<Enumeration> enumerations;\r
+ private List<EnumerationSubExpression> subExpressions;\r
+ \r
+ public EnumerationExpression(List<Enumeration> enumerations) {\r
+ this.enumerations = enumerations;\r
+ this.subExpressions = new ArrayList<EnumerationSubExpression>();\r
+ }\r
+ \r
+ public void addExpression(Expression expression, String...indices) {\r
+ subExpressions.add(new EnumerationSubExpression(expression, indices));\r
+ }\r
+ \r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ for (EnumerationSubExpression subexpr : subExpressions) {\r
+ StringBuilder range = new StringBuilder();\r
+ range.append('[');\r
+ for (int i = 0; i < subexpr.indices.length; i++) {\r
+ if (i > 0)\r
+ range.append(',');\r
+ range.append(subexpr.indices[i]);\r
+ }\r
+ range.append(']');\r
+ \r
+ Resource res = subexpr.expression.write(graph, parent, context);\r
+ \r
+ graph.claimLiteral(res, sr.Expression_arrayRange, range.toString(), Bindings.STRING);\r
+ }\r
+ \r
+ ArrayList<Resource> indexlist = new ArrayList<Resource>();\r
+ for (Enumeration enumeration : enumerations) {\r
+ indexlist.add(enumeration.getResource());\r
+ }\r
+ \r
+ // write array index list\r
+ graph.claim(parent, sr.Variable_arrayIndexesList, ListUtils.create(graph, indexlist));\r
+ \r
+ // TODO: set active expression?\r
+ \r
+ return getResource();\r
+ }\r
+\r
+ @Override\r
+ public Resource getExpressionType(ReadGraph graph) {\r
+ return subExpressions.get(0).expression.getExpressionType(graph);\r
+ }\r
+ \r
+ @Override\r
+ public String getExpressionTypeString() {\r
+ return subExpressions.get(0).expression.getExpressionTypeString();\r
+ }\r
+ \r
+ @Override\r
+ public Resource getResource() {\r
+ return subExpressions.get(0).expression.getResource();\r
+ }\r
+ \r
+ private class EnumerationSubExpression {\r
+ \r
+ Expression expression;\r
+ String[] indices;\r
+ \r
+ public EnumerationSubExpression(Expression expression, String...indices) {\r
+ this.expression = expression;\r
+ this.indices = indices;\r
+ }\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model.expression;\r
+\r
+import java.util.Arrays;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.IWriteableObject;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
+\r
+public abstract class Expression implements IWriteableObject {\r
+\r
+ private Resource expr;\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ expr = GraphUtils.create2(graph, getExpressionType(graph),\r
+ l0.PartOf, parent);\r
+\r
+ // insert the expression into the expression list of the variable \r
+ // (necessary because of enumeration expressions)\r
+ Resource list = graph.getPossibleObject(parent, sr.Variable_expressionList);\r
+ if (list != null) {\r
+ ListUtils.insertBack(graph, list, Arrays.asList(expr));\r
+ }\r
+ else {\r
+ graph.claim(parent, sr.Variable_expressionList, ListUtils.create(graph, Arrays.asList(expr)));\r
+ }\r
+ \r
+ return expr;\r
+ }\r
+ \r
+ public abstract Resource getExpressionType(ReadGraph graph);\r
+ \r
+ public abstract String getExpressionTypeString();\r
+\r
+ @Override\r
+ public Resource getResource() {\r
+ return expr;\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model.expression;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
+\r
+public class IntegralExpression extends Expression {\r
+ \r
+ private String integral;\r
+ private String initial;\r
+ \r
+ public IntegralExpression(String integral, String initial) {\r
+ this.integral = integral;\r
+ this.initial = initial;\r
+ }\r
+ \r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ Resource expr = super.write(graph, parent, context);\r
+ \r
+ graph.claimLiteral(expr, sr.StockExpression_integralEquation, integral, Bindings.STRING);\r
+ graph.claimLiteral(expr, sr.StockExpression_initialEquation, initial, Bindings.STRING);\r
+ graph.claim(expr, sr.StockExpression_useCustomIntegral, expr);\r
+ \r
+ return expr;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getExpressionType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).StockExpression;\r
+ }\r
+ \r
+ @Override\r
+ public String getExpressionTypeString() {\r
+ return "StockExpression";\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model.expression;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
+\r
+public class LookupExpression extends Expression {\r
+ \r
+ private String expression;\r
+ private double xMin;\r
+ private double yMin;\r
+ private double xMax;\r
+ private double yMax;\r
+ private double[] points;\r
+ \r
+ public LookupExpression(String expression, double xMin, double yMin, double xMax, double yMax, double[] points) {\r
+ this.expression = expression;\r
+ this.xMin = xMin;\r
+ this.yMin = yMin;\r
+ this.xMax = xMax;\r
+ this.yMax = yMax;\r
+ this.points = points;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ StringBuilder lookup = new StringBuilder();\r
+ lookup.append('{');\r
+ for (int i = 0; i < points.length / 2; i++) {\r
+ if (i > 0) {\r
+ lookup.append(',');\r
+ }\r
+ lookup.append('{').append(points[2*i]).append(',').append(points[2*i+1]).append('}');\r
+ }\r
+ lookup.append('}');\r
+ \r
+ Resource expr = super.write(graph, parent, context);\r
+ \r
+ // TODO: fix this\r
+ graph.claimLiteral(expr, sr.WithLookupExpression_expression, expression, Bindings.STRING);\r
+ graph.claimLiteral(expr, sr.WithLookupExpression_lookup, lookup.toString(), Bindings.STRING);\r
+ graph.claimLiteral(expr, sr.WithLookupExpression_minX, xMin, Bindings.DOUBLE);\r
+ graph.claimLiteral(expr, sr.WithLookupExpression_minY, yMin, Bindings.DOUBLE);\r
+ graph.claimLiteral(expr, sr.WithLookupExpression_maxX, xMax, Bindings.DOUBLE);\r
+ graph.claimLiteral(expr, sr.WithLookupExpression_maxY, yMax, Bindings.DOUBLE);\r
+ \r
+ return expr;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getExpressionType(ReadGraph graph) {\r
+ return SysdynResource.getInstance(graph).WithLookupExpression;\r
+ }\r
+ \r
+ @Override\r
+ public String getExpressionTypeString() {\r
+ return "WithLookupExpression";\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model.expression;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
+\r
+public class NormalExpression extends Expression {\r
+\r
+ private String expression;\r
+ \r
+ public NormalExpression(String expression) {\r
+ this.expression = expression;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ Resource expr = super.write(graph, parent, context);\r
+ \r
+ graph.claimLiteral(expr, sr.Expression_equation, expression, Bindings.STRING);\r
+ \r
+ return expr;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getExpressionType(ReadGraph graph) {\r
+ try {\r
+ Double.parseDouble(expression);\r
+ return SysdynResource.getInstance(graph).ParameterExpression;\r
+ }\r
+ catch (NumberFormatException e) {\r
+ return SysdynResource.getInstance(graph).NormalExpression;\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public String getExpressionTypeString() {\r
+ try {\r
+ Double.parseDouble(expression);\r
+ return "ParameterExpression";\r
+ }\r
+ catch (NumberFormatException e) {\r
+ return "NormalExpression";\r
+ }\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model.support;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.IWriteableObject;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
+\r
+public class Enumeration implements IWriteableObject {\r
+ \r
+ private String name;\r
+ private List<String> values;\r
+ \r
+ private Resource enumeration;\r
+ \r
+ public Enumeration(String name, List<String> values) {\r
+ this.name = name;\r
+ this.values = values;\r
+ }\r
+ \r
+ public String getName() {\r
+ return name;\r
+ }\r
+ \r
+ public List<String> getValues() {\r
+ return values;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context)\r
+ throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ enumeration = GraphUtils.create2(graph, sr.Enumeration,\r
+ l0.HasName, name,\r
+ l0.PartOf, parent);\r
+ \r
+ List<Resource> indices = new ArrayList<Resource>();\r
+ for (String index : values) {\r
+ indices.add(GraphUtils.create2(graph, sr.EnumerationIndex,\r
+ l0.HasName, index));\r
+ }\r
+ \r
+ graph.claim(enumeration, sr.Enumeration_enumerationIndexList, ListUtils.create(graph, indices));\r
+ \r
+ return enumeration;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getResource() {\r
+ return enumeration;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model.support;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelImport.model.IWriteableObject;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
+\r
+public class Function implements IWriteableObject {\r
+\r
+ private String name;\r
+ private String body;\r
+ private String description;\r
+ \r
+ private Resource function;\r
+ \r
+ public Function(String name, String body) {\r
+ this(name, body, null);\r
+ }\r
+ \r
+ public Function(String name, String body, String description) {\r
+ this.name = name;\r
+ this.body = body;\r
+ this.description = description;\r
+ }\r
+ \r
+ public String getName() {\r
+ return name;\r
+ }\r
+ \r
+ public String getBody() {\r
+ return body;\r
+ }\r
+ \r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource parent, WriteContext context) \r
+ throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ function = GraphUtils.create2(graph, sr.SysdynModelicaFunction, \r
+ l0.HasName, name,\r
+ l0.PartOf, parent);\r
+ \r
+ graph.claimLiteral(function, sr.SysdynModelicaFunction_modelicaFunctionCode, body, Bindings.STRING);\r
+ \r
+ if (description != null) {\r
+ graph.claimLiteral(function, l0.HasDescription, body, Bindings.STRING);\r
+ }\r
+ \r
+ // TODO: should alco handle inputs and outputs somehow\r
+ \r
+ return function;\r
+ }\r
+\r
+ @Override\r
+ public Resource getResource() {\r
+ return function;\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.modelImport.model.support;\r
+\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.modelImport.model.IWriteableObject;\r
+import org.simantics.sysdyn.modelImport.model.WriteContext;\r
+\r
+public class Range implements IWriteableObject {\r
+ \r
+ private Double start;\r
+ private Double end;\r
+ private Double step;\r
+ \r
+ private Resource resource;\r
+ \r
+ public Range(Double start, Double end, Double step) {\r
+ this.start = start;\r
+ this.end = end;\r
+ this.step = step;\r
+ }\r
+ \r
+ public Double getStart() {\r
+ return start;\r
+ }\r
+\r
+ public Double getEnd() {\r
+ return end;\r
+ }\r
+\r
+ public Double getStep() {\r
+ return step;\r
+ }\r
+\r
+ @Override\r
+ public Resource write(WriteGraph graph, Resource variable, WriteContext context) throws DatabaseException {\r
+ // TODO: implementation\r
+ return null;\r
+ }\r
+ \r
+ @Override\r
+ public Resource getResource() {\r
+ return resource;\r
+ }\r
+\r
+}\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. ModelParser.java */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+import java.util.ArrayList;\r
+\r
+@SuppressWarnings({"unused", "serial"})\r
+public class ModelParser implements ModelParserConstants {\r
+\r
+ private ArrayList<Parameter> inputs = new ArrayList<Parameter>();\r
+ private ArrayList<Parameter> outputs = new ArrayList<Parameter>();\r
+\r
+ private enum InterfaceVariableType\r
+ {\r
+ INPUT, OUTPUT, OTHER\r
+ }\r
+\r
+ public class Parameter\r
+ {\r
+ public String name;\r
+ public boolean optional;\r
+ public String description;\r
+ public String type;\r
+\r
+ public Parameter()\r
+ {\r
+ name = new String("");\r
+ optional = false;\r
+ description = null;\r
+ type = null;\r
+ }\r
+ }\r
+\r
+ public ArrayList<Parameter> getInputs()\r
+ {\r
+ return inputs;\r
+ }\r
+\r
+ public ArrayList<Parameter> getOutputs()\r
+ {\r
+ return outputs;\r
+ }\r
+\r
+/*** Parser ********************************************************/\r
+\r
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+ final public void parse() throws ParseException {\r
+ jj_input_stream.setTabSize(1);\r
+ stored_definition();\r
+ jj_consume_token(0);\r
+ }\r
+\r
+/*** Stored Definition - Within ************************************/\r
+ final public void stored_definition() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 53:\r
+ jj_consume_token(53);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ case IDENT:\r
+ name();\r
+ break;\r
+ default:\r
+ jj_la1[0] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(70);\r
+ break;\r
+ default:\r
+ jj_la1[1] = jj_gen;\r
+ ;\r
+ }\r
+ label_1:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 7:\r
+ case 11:\r
+ case 17:\r
+ case 24:\r
+ case 26:\r
+ case 30:\r
+ case 34:\r
+ case 37:\r
+ case 38:\r
+ case 44:\r
+ case 47:\r
+ case 50:\r
+ case 61:\r
+ case 94:\r
+ case 95:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[2] = jj_gen;\r
+ break label_1;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 11:\r
+ jj_consume_token(11);\r
+ break;\r
+ default:\r
+ jj_la1[3] = jj_gen;\r
+ ;\r
+ }\r
+ class_definition();\r
+ jj_consume_token(70);\r
+ }\r
+ }\r
+\r
+/*** Class Definition **********************************************/\r
+ final public void class_definition() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 30:\r
+ jj_consume_token(30);\r
+ break;\r
+ default:\r
+ jj_la1[4] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 47:\r
+ jj_consume_token(47);\r
+ break;\r
+ default:\r
+ jj_la1[5] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 34:\r
+ jj_consume_token(34);\r
+ break;\r
+ case 7:\r
+ jj_consume_token(7);\r
+ break;\r
+ case 61:\r
+ jj_consume_token(61);\r
+ break;\r
+ case 24:\r
+ jj_consume_token(24);\r
+ break;\r
+ case 44:\r
+ case 50:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 50:\r
+ jj_consume_token(50);\r
+ break;\r
+ default:\r
+ jj_la1[6] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(44);\r
+ break;\r
+ case 38:\r
+ jj_consume_token(38);\r
+ break;\r
+ case 37:\r
+ jj_consume_token(37);\r
+ break;\r
+ case 26:\r
+ jj_consume_token(26);\r
+ break;\r
+ case 17:\r
+ jj_consume_token(17);\r
+ break;\r
+ case 94:\r
+ jj_consume_token(94);\r
+ break;\r
+ case 95:\r
+ jj_consume_token(95);\r
+ break;\r
+ default:\r
+ jj_la1[7] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ class_specifier();\r
+ }\r
+\r
+ final public void class_specifier() throws ParseException {\r
+ if (jj_2_1(2)) {\r
+ jj_consume_token(IDENT);\r
+ string_comment();\r
+ composition();\r
+ jj_consume_token(35);\r
+ jj_consume_token(IDENT);\r
+ } else if (jj_2_2(2)) {\r
+ jj_consume_token(IDENT);\r
+ jj_consume_token(88);\r
+ base_prefix();\r
+ name();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 66:\r
+ array_subscripts();\r
+ break;\r
+ default:\r
+ jj_la1[8] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 62:\r
+ class_modification();\r
+ break;\r
+ default:\r
+ jj_la1[9] = jj_gen;\r
+ ;\r
+ }\r
+ comment();\r
+ } else if (jj_2_3(3)) {\r
+ jj_consume_token(IDENT);\r
+ jj_consume_token(88);\r
+ jj_consume_token(40);\r
+ jj_consume_token(62);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case IDENT:\r
+ enum_list();\r
+ break;\r
+ default:\r
+ jj_la1[10] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(63);\r
+ comment();\r
+ } else if (jj_2_4(3)) {\r
+ jj_consume_token(IDENT);\r
+ jj_consume_token(88);\r
+ jj_consume_token(58);\r
+ jj_consume_token(62);\r
+ name();\r
+ jj_consume_token(71);\r
+ jj_consume_token(IDENT);\r
+ label_2:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[11] = jj_gen;\r
+ break label_2;\r
+ }\r
+ jj_consume_token(71);\r
+ jj_consume_token(IDENT);\r
+ }\r
+ jj_consume_token(63);\r
+ comment();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 55:\r
+ jj_consume_token(55);\r
+ jj_consume_token(IDENT);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 62:\r
+ class_modification();\r
+ break;\r
+ default:\r
+ jj_la1[12] = jj_gen;\r
+ ;\r
+ }\r
+ string_comment();\r
+ composition();\r
+ jj_consume_token(35);\r
+ jj_consume_token(IDENT);\r
+ break;\r
+ default:\r
+ jj_la1[13] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void base_prefix() throws ParseException {\r
+ type_prefix();\r
+ }\r
+\r
+ final public void enum_list() throws ParseException {\r
+ enumeration_literal();\r
+ label_3:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[14] = jj_gen;\r
+ break label_3;\r
+ }\r
+ jj_consume_token(71);\r
+ enumeration_literal();\r
+ }\r
+ }\r
+\r
+ final public void enumeration_literal() throws ParseException {\r
+ jj_consume_token(IDENT);\r
+ comment();\r
+ }\r
+\r
+ final public void parse_composition() throws ParseException {\r
+ composition();\r
+ jj_consume_token(0);\r
+ }\r
+\r
+ final public void composition() throws ParseException {\r
+ element_list();\r
+ label_4:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 4:\r
+ case 45:\r
+ case 46:\r
+ case 52:\r
+ case 57:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[15] = jj_gen;\r
+ break label_4;\r
+ }\r
+ if (jj_2_5(2)) {\r
+ jj_consume_token(57);\r
+ element_list();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 52:\r
+ jj_consume_token(52);\r
+ element_list();\r
+ break;\r
+ case 45:\r
+ case 46:\r
+ equation_section();\r
+ break;\r
+ case 4:\r
+ algorithm_section();\r
+ break;\r
+ default:\r
+ jj_la1[16] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 59:\r
+ jj_consume_token(59);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case STRING:\r
+ language_specification();\r
+ break;\r
+ default:\r
+ jj_la1[17] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ case IDENT:\r
+ external_function_call();\r
+ break;\r
+ default:\r
+ jj_la1[18] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 14:\r
+ annotation();\r
+ break;\r
+ default:\r
+ jj_la1[19] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(70);\r
+ break;\r
+ default:\r
+ jj_la1[20] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 14:\r
+ annotation();\r
+ jj_consume_token(70);\r
+ break;\r
+ default:\r
+ jj_la1[21] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void language_specification() throws ParseException {\r
+ jj_consume_token(STRING);\r
+ }\r
+\r
+ final public void external_function_call() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ case IDENT:\r
+ component_reference();\r
+ jj_consume_token(88);\r
+ break;\r
+ default:\r
+ jj_la1[22] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(IDENT);\r
+ jj_consume_token(62);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression_list();\r
+ break;\r
+ default:\r
+ jj_la1[23] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(63);\r
+ }\r
+\r
+ final public void element_list() throws ParseException {\r
+ label_5:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 5:\r
+ case 7:\r
+ case 8:\r
+ case 11:\r
+ case 13:\r
+ case 16:\r
+ case 17:\r
+ case 23:\r
+ case 24:\r
+ case 26:\r
+ case 27:\r
+ case 30:\r
+ case 32:\r
+ case 34:\r
+ case 36:\r
+ case 37:\r
+ case 38:\r
+ case 42:\r
+ case 44:\r
+ case 47:\r
+ case 49:\r
+ case 50:\r
+ case 51:\r
+ case 55:\r
+ case 56:\r
+ case 61:\r
+ case 68:\r
+ case IDENT:\r
+ case 94:\r
+ case 95:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[24] = jj_gen;\r
+ break label_5;\r
+ }\r
+ element();\r
+ jj_consume_token(70);\r
+ }\r
+ }\r
+\r
+ final public void element() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 36:\r
+ import_clause();\r
+ break;\r
+ case 55:\r
+ extends_clause();\r
+ break;\r
+ case 5:\r
+ case 7:\r
+ case 8:\r
+ case 11:\r
+ case 13:\r
+ case 16:\r
+ case 17:\r
+ case 23:\r
+ case 24:\r
+ case 26:\r
+ case 27:\r
+ case 30:\r
+ case 32:\r
+ case 34:\r
+ case 37:\r
+ case 38:\r
+ case 42:\r
+ case 44:\r
+ case 47:\r
+ case 49:\r
+ case 50:\r
+ case 51:\r
+ case 56:\r
+ case 61:\r
+ case 68:\r
+ case IDENT:\r
+ case 94:\r
+ case 95:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 8:\r
+ jj_consume_token(8);\r
+ break;\r
+ default:\r
+ jj_la1[25] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 11:\r
+ jj_consume_token(11);\r
+ break;\r
+ default:\r
+ jj_la1[26] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 51:\r
+ jj_consume_token(51);\r
+ break;\r
+ default:\r
+ jj_la1[27] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 27:\r
+ jj_consume_token(27);\r
+ break;\r
+ default:\r
+ jj_la1[28] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 5:\r
+ case 7:\r
+ case 16:\r
+ case 17:\r
+ case 23:\r
+ case 24:\r
+ case 26:\r
+ case 30:\r
+ case 32:\r
+ case 34:\r
+ case 37:\r
+ case 38:\r
+ case 42:\r
+ case 44:\r
+ case 47:\r
+ case 49:\r
+ case 50:\r
+ case 56:\r
+ case 61:\r
+ case 68:\r
+ case IDENT:\r
+ case 94:\r
+ case 95:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 7:\r
+ case 17:\r
+ case 24:\r
+ case 26:\r
+ case 30:\r
+ case 34:\r
+ case 37:\r
+ case 38:\r
+ case 44:\r
+ case 47:\r
+ case 50:\r
+ case 61:\r
+ case 94:\r
+ case 95:\r
+ class_definition();\r
+ break;\r
+ case 5:\r
+ case 16:\r
+ case 23:\r
+ case 32:\r
+ case 42:\r
+ case 49:\r
+ case 56:\r
+ case 68:\r
+ case IDENT:\r
+ component_clause();\r
+ break;\r
+ default:\r
+ jj_la1[29] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ case 13:\r
+ jj_consume_token(13);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 7:\r
+ case 17:\r
+ case 24:\r
+ case 26:\r
+ case 30:\r
+ case 34:\r
+ case 37:\r
+ case 38:\r
+ case 44:\r
+ case 47:\r
+ case 50:\r
+ case 61:\r
+ case 94:\r
+ case 95:\r
+ class_definition();\r
+ break;\r
+ case 5:\r
+ case 16:\r
+ case 23:\r
+ case 32:\r
+ case 42:\r
+ case 49:\r
+ case 56:\r
+ case 68:\r
+ case IDENT:\r
+ component_clause();\r
+ break;\r
+ default:\r
+ jj_la1[30] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 54:\r
+ constraining_clause();\r
+ comment();\r
+ break;\r
+ default:\r
+ jj_la1[31] = jj_gen;\r
+ ;\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[32] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[33] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void import_clause() throws ParseException {\r
+ jj_consume_token(36);\r
+ if (jj_2_6(2)) {\r
+ jj_consume_token(IDENT);\r
+ jj_consume_token(88);\r
+ name();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ case IDENT:\r
+ name();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ jj_consume_token(68);\r
+ jj_consume_token(82);\r
+ break;\r
+ default:\r
+ jj_la1[34] = jj_gen;\r
+ ;\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[35] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ comment();\r
+ }\r
+\r
+/*** Extends *******************************************************/\r
+ final public void extends_clause() throws ParseException {\r
+ jj_consume_token(55);\r
+ name();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 62:\r
+ class_modification();\r
+ break;\r
+ default:\r
+ jj_la1[36] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 14:\r
+ annotation();\r
+ break;\r
+ default:\r
+ jj_la1[37] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void constraining_clause() throws ParseException {\r
+ jj_consume_token(54);\r
+ name();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 62:\r
+ class_modification();\r
+ break;\r
+ default:\r
+ jj_la1[38] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+/*** Component Clause **********************************************/\r
+ final public void component_clause() throws ParseException {\r
+ InterfaceVariableType ioType = InterfaceVariableType.OTHER;\r
+ String typeSpecifier = "";\r
+ //String arraySubscripts = null;\r
+ ArrayList<Parameter> componentList = new ArrayList<Parameter>();\r
+ ioType = type_prefix();\r
+ typeSpecifier = type_specifier();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 66:\r
+ array_subscripts();\r
+ break;\r
+ default:\r
+ jj_la1[39] = jj_gen;\r
+ ;\r
+ }\r
+ componentList = component_list();\r
+ if (ioType == InterfaceVariableType.INPUT) {\r
+ for (Parameter input : componentList) {\r
+ input.type = typeSpecifier;\r
+ inputs.add(input);\r
+ }\r
+ } else if (ioType == InterfaceVariableType.OUTPUT) {\r
+ for (Parameter output : componentList) {\r
+ output.type = typeSpecifier;\r
+ outputs.add(output);\r
+ }\r
+ }\r
+ }\r
+\r
+ final public InterfaceVariableType type_prefix() throws ParseException {\r
+ InterfaceVariableType type = InterfaceVariableType.OTHER;\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 16:\r
+ case 23:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 16:\r
+ jj_consume_token(16);\r
+ break;\r
+ case 23:\r
+ jj_consume_token(23);\r
+ break;\r
+ default:\r
+ jj_la1[40] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[41] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 5:\r
+ case 42:\r
+ case 49:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 5:\r
+ jj_consume_token(5);\r
+ break;\r
+ case 42:\r
+ jj_consume_token(42);\r
+ break;\r
+ case 49:\r
+ jj_consume_token(49);\r
+ break;\r
+ default:\r
+ jj_la1[42] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[43] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 32:\r
+ case 56:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 32:\r
+ jj_consume_token(32);\r
+ type = InterfaceVariableType.OUTPUT;\r
+ break;\r
+ case 56:\r
+ jj_consume_token(56);\r
+ type = InterfaceVariableType.INPUT;\r
+ break;\r
+ default:\r
+ jj_la1[44] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[45] = jj_gen;\r
+ ;\r
+ }\r
+ {if (true) return type;}\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public String type_specifier() throws ParseException {\r
+ String ret = new String("");\r
+ ret = name();\r
+ {if (true) return ret;}\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public ArrayList<Parameter> component_list() throws ParseException {\r
+ ArrayList<Parameter> ret = new ArrayList<Parameter>();\r
+ Parameter temp;\r
+ // component_declaration { "," component_declaration }\r
+ temp = component_declaration();\r
+ ret.add(temp);\r
+ label_6:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[46] = jj_gen;\r
+ break label_6;\r
+ }\r
+ jj_consume_token(71);\r
+ temp = component_declaration();\r
+ ret.add(temp);\r
+ }\r
+ {if (true) return ret;}\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public Parameter component_declaration() throws ParseException {\r
+ Parameter ret;\r
+ String temp = "";\r
+ // declaration [ conditional_attribute ] comment\r
+ ret = declaration();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 31:\r
+ conditional_attribute();\r
+ break;\r
+ default:\r
+ jj_la1[47] = jj_gen;\r
+ ;\r
+ }\r
+ ret.description = comment();\r
+ {if (true) return ret;}\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public void conditional_attribute() throws ParseException {\r
+ jj_consume_token(31);\r
+ expression();\r
+ }\r
+\r
+ final public Parameter declaration() throws ParseException {\r
+ // Parameter here without comment yet.\r
+ Parameter ret = new Parameter();\r
+ jj_consume_token(IDENT);\r
+ ret.name = new String(token.image);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 66:\r
+ array_subscripts();\r
+ break;\r
+ default:\r
+ jj_la1[48] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 62:\r
+ case 88:\r
+ case 89:\r
+ ret.optional = modification();\r
+ break;\r
+ default:\r
+ jj_la1[49] = jj_gen;\r
+ ;\r
+ }\r
+ {if (true) return ret;}\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+/*** Modification **********************************************/\r
+ final public boolean modification() throws ParseException {\r
+ boolean optional = false;\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 62:\r
+ class_modification();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 88:\r
+ jj_consume_token(88);\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[50] = jj_gen;\r
+ ;\r
+ }\r
+ break;\r
+ case 88:\r
+ jj_consume_token(88);\r
+ expression();\r
+ optional = true;\r
+ break;\r
+ case 89:\r
+ jj_consume_token(89);\r
+ expression();\r
+ optional = true;\r
+ break;\r
+ default:\r
+ jj_la1[51] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ {if (true) return optional;}\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public void class_modification() throws ParseException {\r
+ jj_consume_token(62);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 8:\r
+ case 10:\r
+ case 11:\r
+ case 13:\r
+ case 68:\r
+ case IDENT:\r
+ argument_list();\r
+ break;\r
+ default:\r
+ jj_la1[52] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(63);\r
+ }\r
+\r
+ final public void argument_list() throws ParseException {\r
+ argument();\r
+ label_7:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[53] = jj_gen;\r
+ break label_7;\r
+ }\r
+ jj_consume_token(71);\r
+ argument();\r
+ }\r
+ }\r
+\r
+ final public void argument() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 10:\r
+ case 11:\r
+ case 13:\r
+ case 68:\r
+ case IDENT:\r
+ element_modification_or_replaceable();\r
+ break;\r
+ case 8:\r
+ element_redeclaration();\r
+ break;\r
+ default:\r
+ jj_la1[54] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void element_modification_or_replaceable() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 10:\r
+ jj_consume_token(10);\r
+ break;\r
+ default:\r
+ jj_la1[55] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 11:\r
+ jj_consume_token(11);\r
+ break;\r
+ default:\r
+ jj_la1[56] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ case IDENT:\r
+ element_modification();\r
+ break;\r
+ case 13:\r
+ element_replaceable();\r
+ break;\r
+ default:\r
+ jj_la1[57] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void element_modification() throws ParseException {\r
+ name();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 62:\r
+ case 88:\r
+ case 89:\r
+ modification();\r
+ break;\r
+ default:\r
+ jj_la1[58] = jj_gen;\r
+ ;\r
+ }\r
+ string_comment();\r
+ }\r
+\r
+ final public void element_redeclaration() throws ParseException {\r
+ jj_consume_token(8);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 10:\r
+ jj_consume_token(10);\r
+ break;\r
+ default:\r
+ jj_la1[59] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 11:\r
+ jj_consume_token(11);\r
+ break;\r
+ default:\r
+ jj_la1[60] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 5:\r
+ case 7:\r
+ case 16:\r
+ case 17:\r
+ case 23:\r
+ case 24:\r
+ case 26:\r
+ case 30:\r
+ case 32:\r
+ case 34:\r
+ case 37:\r
+ case 38:\r
+ case 42:\r
+ case 44:\r
+ case 47:\r
+ case 49:\r
+ case 50:\r
+ case 56:\r
+ case 61:\r
+ case 68:\r
+ case IDENT:\r
+ case 94:\r
+ case 95:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 7:\r
+ case 17:\r
+ case 24:\r
+ case 26:\r
+ case 30:\r
+ case 34:\r
+ case 37:\r
+ case 38:\r
+ case 44:\r
+ case 47:\r
+ case 50:\r
+ case 61:\r
+ case 94:\r
+ case 95:\r
+ class_definition();\r
+ break;\r
+ case 5:\r
+ case 16:\r
+ case 23:\r
+ case 32:\r
+ case 42:\r
+ case 49:\r
+ case 56:\r
+ case 68:\r
+ case IDENT:\r
+ component_clause1();\r
+ break;\r
+ default:\r
+ jj_la1[61] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ case 13:\r
+ element_replaceable();\r
+ break;\r
+ default:\r
+ jj_la1[62] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void element_replaceable() throws ParseException {\r
+ jj_consume_token(13);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 7:\r
+ case 17:\r
+ case 24:\r
+ case 26:\r
+ case 30:\r
+ case 34:\r
+ case 37:\r
+ case 38:\r
+ case 44:\r
+ case 47:\r
+ case 50:\r
+ case 61:\r
+ case 94:\r
+ case 95:\r
+ class_definition();\r
+ break;\r
+ case 5:\r
+ case 16:\r
+ case 23:\r
+ case 32:\r
+ case 42:\r
+ case 49:\r
+ case 56:\r
+ case 68:\r
+ case IDENT:\r
+ component_clause1();\r
+ break;\r
+ default:\r
+ jj_la1[63] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 54:\r
+ constraining_clause();\r
+ break;\r
+ default:\r
+ jj_la1[64] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void component_clause1() throws ParseException {\r
+ type_prefix();\r
+ type_specifier();\r
+ component_declaration1();\r
+ }\r
+\r
+ final public void component_declaration1() throws ParseException {\r
+ declaration();\r
+ comment();\r
+ }\r
+\r
+/*** Equations *************************************************/\r
+ final public void equation_section() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 46:\r
+ jj_consume_token(46);\r
+ break;\r
+ default:\r
+ jj_la1[65] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(45);\r
+ label_8:\r
+ while (true) {\r
+ if (jj_2_7(2)) {\r
+ ;\r
+ } else {\r
+ break label_8;\r
+ }\r
+ equation();\r
+ jj_consume_token(70);\r
+ }\r
+ }\r
+\r
+ final public void algorithm_section() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 46:\r
+ jj_consume_token(46);\r
+ break;\r
+ default:\r
+ jj_la1[66] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(4);\r
+ label_9:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 18:\r
+ case 21:\r
+ case 29:\r
+ case 31:\r
+ case 43:\r
+ case 48:\r
+ case 62:\r
+ case 68:\r
+ case IDENT:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[67] = jj_gen;\r
+ break label_9;\r
+ }\r
+ statement();\r
+ jj_consume_token(70);\r
+ }\r
+ }\r
+\r
+ final public void equation() throws ParseException {\r
+ if (jj_2_8(3)) {\r
+ simple_expression();\r
+ jj_consume_token(88);\r
+ expression();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 31:\r
+ if_equation();\r
+ break;\r
+ case 21:\r
+ for_equation();\r
+ break;\r
+ case 39:\r
+ connect_clause();\r
+ break;\r
+ case 43:\r
+ when_equation();\r
+ break;\r
+ case IDENT:\r
+ jj_consume_token(IDENT);\r
+ function_call_args();\r
+ break;\r
+ default:\r
+ jj_la1[68] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ comment();\r
+ }\r
+\r
+ final public void statement() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ case IDENT:\r
+ component_reference();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 89:\r
+ jj_consume_token(89);\r
+ expression();\r
+ break;\r
+ case 62:\r
+ function_call_args();\r
+ break;\r
+ default:\r
+ jj_la1[69] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ case 62:\r
+ jj_consume_token(62);\r
+ output_expression_list();\r
+ jj_consume_token(63);\r
+ jj_consume_token(89);\r
+ component_reference();\r
+ function_call_args();\r
+ break;\r
+ case 29:\r
+ jj_consume_token(29);\r
+ break;\r
+ case 18:\r
+ jj_consume_token(18);\r
+ break;\r
+ case 31:\r
+ if_statement();\r
+ break;\r
+ case 21:\r
+ for_statement();\r
+ break;\r
+ case 48:\r
+ while_statement();\r
+ break;\r
+ case 43:\r
+ when_statement();\r
+ break;\r
+ default:\r
+ jj_la1[70] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ comment();\r
+ }\r
+\r
+ final public void if_equation() throws ParseException {\r
+ jj_consume_token(31);\r
+ expression();\r
+ jj_consume_token(28);\r
+ label_10:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 21:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 39:\r
+ case 43:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[71] = jj_gen;\r
+ break label_10;\r
+ }\r
+ equation();\r
+ jj_consume_token(70);\r
+ }\r
+ label_11:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 20:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[72] = jj_gen;\r
+ break label_11;\r
+ }\r
+ jj_consume_token(20);\r
+ expression();\r
+ jj_consume_token(28);\r
+ label_12:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 21:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 39:\r
+ case 43:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[73] = jj_gen;\r
+ break label_12;\r
+ }\r
+ equation();\r
+ jj_consume_token(70);\r
+ }\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 15:\r
+ jj_consume_token(15);\r
+ label_13:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 21:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 39:\r
+ case 43:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[74] = jj_gen;\r
+ break label_13;\r
+ }\r
+ equation();\r
+ jj_consume_token(70);\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[75] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(35);\r
+ jj_consume_token(31);\r
+ }\r
+\r
+ final public void if_statement() throws ParseException {\r
+ jj_consume_token(31);\r
+ expression();\r
+ jj_consume_token(28);\r
+ label_14:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 18:\r
+ case 21:\r
+ case 29:\r
+ case 31:\r
+ case 43:\r
+ case 48:\r
+ case 62:\r
+ case 68:\r
+ case IDENT:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[76] = jj_gen;\r
+ break label_14;\r
+ }\r
+ statement();\r
+ jj_consume_token(70);\r
+ }\r
+ label_15:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 20:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[77] = jj_gen;\r
+ break label_15;\r
+ }\r
+ jj_consume_token(20);\r
+ expression();\r
+ jj_consume_token(28);\r
+ label_16:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 18:\r
+ case 21:\r
+ case 29:\r
+ case 31:\r
+ case 43:\r
+ case 48:\r
+ case 62:\r
+ case 68:\r
+ case IDENT:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[78] = jj_gen;\r
+ break label_16;\r
+ }\r
+ statement();\r
+ jj_consume_token(70);\r
+ }\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 15:\r
+ jj_consume_token(15);\r
+ label_17:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 18:\r
+ case 21:\r
+ case 29:\r
+ case 31:\r
+ case 43:\r
+ case 48:\r
+ case 62:\r
+ case 68:\r
+ case IDENT:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[79] = jj_gen;\r
+ break label_17;\r
+ }\r
+ statement();\r
+ jj_consume_token(70);\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[80] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(35);\r
+ jj_consume_token(31);\r
+ }\r
+\r
+ final public void for_equation() throws ParseException {\r
+ jj_consume_token(21);\r
+ for_indices();\r
+ jj_consume_token(60);\r
+ label_18:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 21:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 39:\r
+ case 43:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[81] = jj_gen;\r
+ break label_18;\r
+ }\r
+ equation();\r
+ jj_consume_token(70);\r
+ }\r
+ jj_consume_token(35);\r
+ jj_consume_token(21);\r
+ }\r
+\r
+ final public void for_statement() throws ParseException {\r
+ jj_consume_token(21);\r
+ for_indices();\r
+ jj_consume_token(60);\r
+ label_19:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 18:\r
+ case 21:\r
+ case 29:\r
+ case 31:\r
+ case 43:\r
+ case 48:\r
+ case 62:\r
+ case 68:\r
+ case IDENT:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[82] = jj_gen;\r
+ break label_19;\r
+ }\r
+ statement();\r
+ jj_consume_token(70);\r
+ }\r
+ jj_consume_token(35);\r
+ jj_consume_token(21);\r
+ }\r
+\r
+ final public void for_indices() throws ParseException {\r
+ for_index();\r
+ label_20:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[83] = jj_gen;\r
+ break label_20;\r
+ }\r
+ jj_consume_token(71);\r
+ for_index();\r
+ }\r
+ }\r
+\r
+ final public void for_index() throws ParseException {\r
+ jj_consume_token(IDENT);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 41:\r
+ jj_consume_token(41);\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[84] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void while_statement() throws ParseException {\r
+ jj_consume_token(48);\r
+ expression();\r
+ jj_consume_token(60);\r
+ label_21:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 18:\r
+ case 21:\r
+ case 29:\r
+ case 31:\r
+ case 43:\r
+ case 48:\r
+ case 62:\r
+ case 68:\r
+ case IDENT:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[85] = jj_gen;\r
+ break label_21;\r
+ }\r
+ statement();\r
+ jj_consume_token(70);\r
+ }\r
+ jj_consume_token(35);\r
+ jj_consume_token(48);\r
+ }\r
+\r
+ final public void when_equation() throws ParseException {\r
+ jj_consume_token(43);\r
+ expression();\r
+ jj_consume_token(28);\r
+ label_22:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 21:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 39:\r
+ case 43:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[86] = jj_gen;\r
+ break label_22;\r
+ }\r
+ equation();\r
+ jj_consume_token(70);\r
+ }\r
+ label_23:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 25:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[87] = jj_gen;\r
+ break label_23;\r
+ }\r
+ jj_consume_token(25);\r
+ expression();\r
+ jj_consume_token(28);\r
+ label_24:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 21:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 39:\r
+ case 43:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[88] = jj_gen;\r
+ break label_24;\r
+ }\r
+ equation();\r
+ jj_consume_token(70);\r
+ }\r
+ }\r
+ jj_consume_token(35);\r
+ jj_consume_token(43);\r
+ }\r
+\r
+ final public void when_statement() throws ParseException {\r
+ jj_consume_token(43);\r
+ expression();\r
+ jj_consume_token(28);\r
+ label_25:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 18:\r
+ case 21:\r
+ case 29:\r
+ case 31:\r
+ case 43:\r
+ case 48:\r
+ case 62:\r
+ case 68:\r
+ case IDENT:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[89] = jj_gen;\r
+ break label_25;\r
+ }\r
+ statement();\r
+ jj_consume_token(70);\r
+ }\r
+ label_26:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 25:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[90] = jj_gen;\r
+ break label_26;\r
+ }\r
+ jj_consume_token(25);\r
+ expression();\r
+ jj_consume_token(28);\r
+ label_27:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 18:\r
+ case 21:\r
+ case 29:\r
+ case 31:\r
+ case 43:\r
+ case 48:\r
+ case 62:\r
+ case 68:\r
+ case IDENT:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[91] = jj_gen;\r
+ break label_27;\r
+ }\r
+ statement();\r
+ jj_consume_token(70);\r
+ }\r
+ }\r
+ jj_consume_token(35);\r
+ jj_consume_token(43);\r
+ }\r
+\r
+ final public void connect_clause() throws ParseException {\r
+ jj_consume_token(39);\r
+ jj_consume_token(62);\r
+ component_reference();\r
+ jj_consume_token(71);\r
+ component_reference();\r
+ jj_consume_token(63);\r
+ }\r
+\r
+/*** Expressions ***************************************************/\r
+ final public void expr() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 33:\r
+ case 35:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ simple_expression();\r
+ jj_consume_token(0);\r
+ break;\r
+ case 31:\r
+ jj_consume_token(31);\r
+ expression();\r
+ jj_consume_token(28);\r
+ expression();\r
+ label_28:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 20:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[92] = jj_gen;\r
+ break label_28;\r
+ }\r
+ jj_consume_token(20);\r
+ expression();\r
+ jj_consume_token(28);\r
+ expression();\r
+ }\r
+ jj_consume_token(15);\r
+ expression();\r
+ jj_consume_token(0);\r
+ break;\r
+ default:\r
+ jj_la1[93] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void expression() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 33:\r
+ case 35:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ simple_expression();\r
+ break;\r
+ case 31:\r
+ jj_consume_token(31);\r
+ expression();\r
+ jj_consume_token(28);\r
+ expression();\r
+ label_29:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 20:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[94] = jj_gen;\r
+ break label_29;\r
+ }\r
+ jj_consume_token(20);\r
+ expression();\r
+ jj_consume_token(28);\r
+ expression();\r
+ }\r
+ jj_consume_token(15);\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[95] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void simple_expression() throws ParseException {\r
+ logical_expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ jj_consume_token(69);\r
+ logical_expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ jj_consume_token(69);\r
+ logical_expression();\r
+ break;\r
+ default:\r
+ jj_la1[96] = jj_gen;\r
+ ;\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[97] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void logical_expression() throws ParseException {\r
+ logical_term();\r
+ label_30:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 22:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[98] = jj_gen;\r
+ break label_30;\r
+ }\r
+ jj_consume_token(22);\r
+ logical_term();\r
+ }\r
+ }\r
+\r
+ final public void logical_term() throws ParseException {\r
+ logical_factor();\r
+ label_31:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 9:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[99] = jj_gen;\r
+ break label_31;\r
+ }\r
+ jj_consume_token(9);\r
+ logical_factor();\r
+ }\r
+ }\r
+\r
+ final public void logical_factor() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 12:\r
+ jj_consume_token(12);\r
+ break;\r
+ default:\r
+ jj_la1[100] = jj_gen;\r
+ ;\r
+ }\r
+ relation();\r
+ }\r
+\r
+ final public void relation() throws ParseException {\r
+ arithmetic_expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 72:\r
+ case 73:\r
+ case 74:\r
+ case 75:\r
+ case 76:\r
+ case 77:\r
+ rel_op();\r
+ arithmetic_expression();\r
+ break;\r
+ default:\r
+ jj_la1[101] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void rel_op() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 72:\r
+ jj_consume_token(72);\r
+ break;\r
+ case 73:\r
+ jj_consume_token(73);\r
+ break;\r
+ case 74:\r
+ jj_consume_token(74);\r
+ break;\r
+ case 75:\r
+ jj_consume_token(75);\r
+ break;\r
+ case 76:\r
+ jj_consume_token(76);\r
+ break;\r
+ case 77:\r
+ jj_consume_token(77);\r
+ break;\r
+ default:\r
+ jj_la1[102] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void arithmetic_expression() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ add_op();\r
+ break;\r
+ default:\r
+ jj_la1[103] = jj_gen;\r
+ ;\r
+ }\r
+ term();\r
+ label_32:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[104] = jj_gen;\r
+ break label_32;\r
+ }\r
+ add_op();\r
+ term();\r
+ }\r
+ }\r
+\r
+ final public void add_op() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 78:\r
+ jj_consume_token(78);\r
+ break;\r
+ case 79:\r
+ jj_consume_token(79);\r
+ break;\r
+ case 80:\r
+ jj_consume_token(80);\r
+ break;\r
+ case 81:\r
+ jj_consume_token(81);\r
+ break;\r
+ default:\r
+ jj_la1[105] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void term() throws ParseException {\r
+ factor();\r
+ label_33:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 82:\r
+ case 83:\r
+ case 84:\r
+ case 85:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[106] = jj_gen;\r
+ break label_33;\r
+ }\r
+ mul_op();\r
+ factor();\r
+ }\r
+ }\r
+\r
+ final public void mul_op() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 82:\r
+ jj_consume_token(82);\r
+ break;\r
+ case 83:\r
+ jj_consume_token(83);\r
+ break;\r
+ case 84:\r
+ jj_consume_token(84);\r
+ break;\r
+ case 85:\r
+ jj_consume_token(85);\r
+ break;\r
+ default:\r
+ jj_la1[107] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public void factor() throws ParseException {\r
+ primary();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 86:\r
+ case 87:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 86:\r
+ jj_consume_token(86);\r
+ break;\r
+ case 87:\r
+ jj_consume_token(87);\r
+ break;\r
+ default:\r
+ jj_la1[108] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ primary();\r
+ break;\r
+ default:\r
+ jj_la1[109] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void primary() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case UNSIGNED_NUMBER:\r
+ jj_consume_token(UNSIGNED_NUMBER);\r
+ break;\r
+ case UNSIGNED_INTEGER:\r
+ jj_consume_token(UNSIGNED_INTEGER);\r
+ break;\r
+ case STRING:\r
+ jj_consume_token(STRING);\r
+ break;\r
+ case 6:\r
+ jj_consume_token(6);\r
+ break;\r
+ case 33:\r
+ jj_consume_token(33);\r
+ break;\r
+ default:\r
+ jj_la1[112] = jj_gen;\r
+ if (jj_2_9(2147483647)) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ case IDENT:\r
+ name();\r
+ break;\r
+ case 58:\r
+ jj_consume_token(58);\r
+ break;\r
+ case 46:\r
+ jj_consume_token(46);\r
+ break;\r
+ default:\r
+ jj_la1[110] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ function_call_args();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ case IDENT:\r
+ component_reference();\r
+ break;\r
+ case 62:\r
+ jj_consume_token(62);\r
+ expression();\r
+ jj_consume_token(63);\r
+ break;\r
+ case 66:\r
+ jj_consume_token(66);\r
+ expression_list();\r
+ label_34:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 70:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[111] = jj_gen;\r
+ break label_34;\r
+ }\r
+ jj_consume_token(70);\r
+ expression_list();\r
+ }\r
+ jj_consume_token(67);\r
+ break;\r
+ case 64:\r
+ jj_consume_token(64);\r
+ function_arguments();\r
+ jj_consume_token(65);\r
+ break;\r
+ case 35:\r
+ jj_consume_token(35);\r
+ break;\r
+ default:\r
+ jj_la1[113] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ final public String name() throws ParseException {\r
+ String ret = new String("");\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ jj_consume_token(68);\r
+ ret += ".";\r
+ break;\r
+ default:\r
+ jj_la1[114] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(IDENT);\r
+ ret += token.image;\r
+ label_35:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[115] = jj_gen;\r
+ break label_35;\r
+ }\r
+ jj_consume_token(68);\r
+ ret += ".";\r
+ jj_consume_token(IDENT);\r
+ ret += token.image;\r
+ }\r
+ {if (true) return ret;}\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public void component_reference() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ jj_consume_token(68);\r
+ break;\r
+ default:\r
+ jj_la1[116] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(IDENT);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 66:\r
+ array_subscripts();\r
+ break;\r
+ default:\r
+ jj_la1[117] = jj_gen;\r
+ ;\r
+ }\r
+ label_36:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[118] = jj_gen;\r
+ break label_36;\r
+ }\r
+ jj_consume_token(68);\r
+ jj_consume_token(IDENT);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 66:\r
+ array_subscripts();\r
+ break;\r
+ default:\r
+ jj_la1[119] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void function_call_args() throws ParseException {\r
+ jj_consume_token(62);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ function_arguments();\r
+ break;\r
+ default:\r
+ jj_la1[120] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(63);\r
+ }\r
+\r
+ final public void function_arguments() throws ParseException {\r
+ if (jj_2_10(2)) {\r
+ expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 21:\r
+ case 71:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ jj_consume_token(71);\r
+ function_arguments();\r
+ break;\r
+ case 21:\r
+ jj_consume_token(21);\r
+ for_indices();\r
+ break;\r
+ default:\r
+ jj_la1[121] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[122] = jj_gen;\r
+ ;\r
+ }\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case IDENT:\r
+ named_arguments();\r
+ break;\r
+ default:\r
+ jj_la1[123] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void named_arguments() throws ParseException {\r
+ named_argument();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ jj_consume_token(71);\r
+ named_arguments();\r
+ break;\r
+ default:\r
+ jj_la1[124] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+\r
+ final public void named_argument() throws ParseException {\r
+ jj_consume_token(IDENT);\r
+ jj_consume_token(88);\r
+ expression();\r
+ }\r
+\r
+ final public void output_expression_list() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[125] = jj_gen;\r
+ ;\r
+ }\r
+ label_37:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[126] = jj_gen;\r
+ break label_37;\r
+ }\r
+ jj_consume_token(71);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[127] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void expression_list() throws ParseException {\r
+ expression();\r
+ label_38:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[128] = jj_gen;\r
+ break label_38;\r
+ }\r
+ jj_consume_token(71);\r
+ expression();\r
+ }\r
+ }\r
+\r
+ final public void array_subscripts() throws ParseException {\r
+ jj_consume_token(66);\r
+ subscript();\r
+ label_39:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[129] = jj_gen;\r
+ break label_39;\r
+ }\r
+ jj_consume_token(71);\r
+ subscript();\r
+ }\r
+ jj_consume_token(67);\r
+ }\r
+\r
+ final public void subscript() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ jj_consume_token(69);\r
+ break;\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 46:\r
+ case 58:\r
+ case 62:\r
+ case 64:\r
+ case 66:\r
+ case 68:\r
+ case 78:\r
+ case 79:\r
+ case 80:\r
+ case 81:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[130] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ final public String comment() throws ParseException {\r
+ String ret;\r
+ // string_comment [ annotation ]\r
+ ret = string_comment();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 14:\r
+ annotation();\r
+ break;\r
+ default:\r
+ jj_la1[131] = jj_gen;\r
+ ;\r
+ }\r
+ {if (true) return ret;}\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public String string_comment() throws ParseException {\r
+ String ret = null;\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case STRING:\r
+ jj_consume_token(STRING);\r
+ ret = new String(token.image);\r
+ label_40:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 78:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[132] = jj_gen;\r
+ break label_40;\r
+ }\r
+ jj_consume_token(78);\r
+ ret += "+";\r
+ jj_consume_token(STRING);\r
+ ret += token.image;\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[133] = jj_gen;\r
+ ;\r
+ }\r
+ {if (true) return ret;}\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public void annotation() throws ParseException {\r
+ jj_consume_token(14);\r
+ class_modification();\r
+ }\r
+\r
+ private boolean jj_2_1(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_1(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(0, xla); }\r
+ }\r
+\r
+ private boolean jj_2_2(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_2(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(1, xla); }\r
+ }\r
+\r
+ private boolean jj_2_3(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_3(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(2, xla); }\r
+ }\r
+\r
+ private boolean jj_2_4(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_4(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(3, xla); }\r
+ }\r
+\r
+ private boolean jj_2_5(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_5(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(4, xla); }\r
+ }\r
+\r
+ private boolean jj_2_6(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_6(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(5, xla); }\r
+ }\r
+\r
+ private boolean jj_2_7(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_7(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(6, xla); }\r
+ }\r
+\r
+ private boolean jj_2_8(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_8(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(7, xla); }\r
+ }\r
+\r
+ private boolean jj_2_9(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_9(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(8, xla); }\r
+ }\r
+\r
+ private boolean jj_2_10(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_10(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(9, xla); }\r
+ }\r
+\r
+ private boolean jj_3R_50() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3_5()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_66()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_67()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_68()) return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_5() {\r
+ if (jj_scan_token(57)) return true;\r
+ if (jj_3R_43()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_42() {\r
+ if (jj_3R_43()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_50()) { jj_scanpos = xsp; break; }\r
+ }\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_51()) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_52()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_74() {\r
+ if (jj_scan_token(43)) return true;\r
+ if (jj_3R_46()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_137() {\r
+ if (jj_3R_46()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_135() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(69)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_137()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_131() {\r
+ if (jj_scan_token(71)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_104() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(50)) jj_scanpos = xsp;\r
+ if (jj_scan_token(44)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_133() {\r
+ if (jj_scan_token(66)) return true;\r
+ if (jj_3R_135()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_130() {\r
+ if (jj_scan_token(68)) return true;\r
+ if (jj_scan_token(IDENT)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_64() {\r
+ if (jj_scan_token(71)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_48() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_64()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_65()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_92() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_125() {\r
+ if (jj_3R_46()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_131()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_85() {\r
+ if (jj_3R_92()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_136() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ if (jj_scan_token(88)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_4() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ if (jj_scan_token(88)) return true;\r
+ if (jj_scan_token(58)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_3() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ if (jj_scan_token(88)) return true;\r
+ if (jj_scan_token(40)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_2() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ if (jj_scan_token(88)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_1() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ if (jj_3R_41()) return true;\r
+ if (jj_3R_42()) return true;\r
+ if (jj_scan_token(35)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_134() {\r
+ if (jj_3R_136()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_129() {\r
+ if (jj_3R_133()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_132() {\r
+ if (jj_3R_134()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_123() {\r
+ if (jj_3R_63()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_127() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3_10()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_132()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_72() {\r
+ if (jj_scan_token(21)) return true;\r
+ if (jj_3R_85()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_10() {\r
+ if (jj_3R_46()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_48()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_128() {\r
+ if (jj_3R_127()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_75() {\r
+ if (jj_scan_token(62)) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_128()) jj_scanpos = xsp;\r
+ if (jj_scan_token(63)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_98() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(30)) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(47)) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(34)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(7)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(61)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(24)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_104()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(38)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(37)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(26)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(17)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(94)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(95)) return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_124() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(68)) jj_scanpos = xsp;\r
+ if (jj_scan_token(IDENT)) return true;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_129()) jj_scanpos = xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_130()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_126() {\r
+ if (jj_scan_token(70)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_79() {\r
+ if (jj_scan_token(68)) return true;\r
+ if (jj_scan_token(IDENT)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_78() {\r
+ if (jj_scan_token(68)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_63() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_78()) jj_scanpos = xsp;\r
+ if (jj_scan_token(IDENT)) return true;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_79()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_47() {\r
+ if (jj_3R_63()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_9() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_47()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(58)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(46)) return true;\r
+ }\r
+ }\r
+ if (jj_scan_token(62)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_106() {\r
+ if (jj_3R_63()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_114() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(86)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(87)) return true;\r
+ }\r
+ if (jj_3R_113()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_71() {\r
+ if (jj_scan_token(31)) return true;\r
+ if (jj_3R_46()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_122() {\r
+ if (jj_scan_token(64)) return true;\r
+ if (jj_3R_127()) return true;\r
+ if (jj_scan_token(65)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_121() {\r
+ if (jj_scan_token(66)) return true;\r
+ if (jj_3R_125()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_126()) { jj_scanpos = xsp; break; }\r
+ }\r
+ if (jj_scan_token(67)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_117() {\r
+ if (jj_scan_token(56)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_120() {\r
+ if (jj_scan_token(62)) return true;\r
+ if (jj_3R_46()) return true;\r
+ if (jj_scan_token(63)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_118() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_123()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(58)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(46)) return true;\r
+ }\r
+ }\r
+ if (jj_3R_75()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_119() {\r
+ if (jj_3R_124()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_116() {\r
+ if (jj_scan_token(32)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_113() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(93)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(92)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(91)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(6)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(33)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_118()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_119()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_120()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_121()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_122()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(35)) return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_112() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_116()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_117()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_111() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(5)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(42)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(49)) return true;\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_110() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(16)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(23)) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_105() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_110()) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_111()) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_112()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_108() {\r
+ if (jj_3R_113()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_114()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_109() {\r
+ if (jj_3R_115()) return true;\r
+ if (jj_3R_108()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_68() {\r
+ if (jj_3R_81()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_102() {\r
+ if (jj_3R_107()) return true;\r
+ if (jj_3R_101()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_97() {\r
+ if (jj_3R_103()) return true;\r
+ if (jj_3R_96()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_115() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(82)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(83)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(84)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(85)) return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_101() {\r
+ if (jj_3R_108()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_109()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_58() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ if (jj_3R_75()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_57() {\r
+ if (jj_3R_74()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_56() {\r
+ if (jj_3R_73()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_107() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(78)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(79)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(80)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(81)) return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_55() {\r
+ if (jj_3R_72()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_54() {\r
+ if (jj_3R_71()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_7() {\r
+ if (jj_3R_44()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_87() {\r
+ if (jj_scan_token(9)) return true;\r
+ if (jj_3R_86()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_99() {\r
+ if (jj_3R_105()) return true;\r
+ if (jj_3R_106()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_100() {\r
+ if (jj_3R_107()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_67() {\r
+ if (jj_3R_80()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_96() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_100()) jj_scanpos = xsp;\r
+ if (jj_3R_101()) return true;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_102()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_103() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(72)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(73)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(74)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(75)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(76)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(77)) return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_60() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_59()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_77() {\r
+ if (jj_scan_token(22)) return true;\r
+ if (jj_3R_76()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_8() {\r
+ if (jj_3R_45()) return true;\r
+ if (jj_scan_token(88)) return true;\r
+ if (jj_3R_46()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_93() {\r
+ if (jj_3R_96()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_97()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_44() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3_8()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_54()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_55()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_56()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_57()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_58()) return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_95() {\r
+ if (jj_3R_99()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_86() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(12)) jj_scanpos = xsp;\r
+ if (jj_3R_93()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_6() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ if (jj_scan_token(88)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_76() {\r
+ if (jj_3R_86()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_87()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_89() {\r
+ if (jj_scan_token(55)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_81() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(46)) jj_scanpos = xsp;\r
+ if (jj_scan_token(4)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_59() {\r
+ if (jj_3R_76()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_77()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_88() {\r
+ if (jj_scan_token(36)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_80() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(46)) jj_scanpos = xsp;\r
+ if (jj_scan_token(45)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_45() {\r
+ if (jj_3R_59()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_60()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_91() {\r
+ if (jj_scan_token(13)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_66() {\r
+ if (jj_scan_token(52)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_94() {\r
+ if (jj_3R_98()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_90() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_94()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_95()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_62() {\r
+ if (jj_scan_token(31)) return true;\r
+ if (jj_3R_46()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_61() {\r
+ if (jj_3R_45()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_46() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_61()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_62()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_84() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(8)) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(11)) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(51)) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(27)) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_90()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_91()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_83() {\r
+ if (jj_3R_89()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_70() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_82()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_83()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_84()) return true;\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_82() {\r
+ if (jj_3R_88()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_73() {\r
+ if (jj_scan_token(39)) return true;\r
+ if (jj_scan_token(62)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_53() {\r
+ if (jj_3R_70()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_43() {\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_53()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_69() {\r
+ if (jj_scan_token(14)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_65() {\r
+ if (jj_scan_token(21)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_49() {\r
+ if (jj_scan_token(STRING)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_41() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_49()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_52() {\r
+ if (jj_3R_69()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_51() {\r
+ if (jj_scan_token(59)) return true;\r
+ return false;\r
+ }\r
+\r
+ /** Generated Token Manager. */\r
+ public ModelParserTokenManager token_source;\r
+ SimpleCharStream jj_input_stream;\r
+ /** Current token. */\r
+ public Token token;\r
+ /** Next token. */\r
+ public Token jj_nt;\r
+ private int jj_ntk;\r
+ private Token jj_scanpos, jj_lastpos;\r
+ private int jj_la;\r
+ private int jj_gen;\r
+ final private int[] jj_la1 = new int[134];\r
+ static private int[] jj_la1_0;\r
+ static private int[] jj_la1_1;\r
+ static private int[] jj_la1_2;\r
+ static {\r
+ jj_la1_init_0();\r
+ jj_la1_init_1();\r
+ jj_la1_init_2();\r
+ }\r
+ private static void jj_la1_init_0() {\r
+ jj_la1_0 = new int[] {0x0,0x0,0x45020880,0x800,0x40000000,0x0,0x0,0x5020080,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x10,0x0,0x0,0x4000,0x0,0x4000,0x0,0x80001040,0x4d8329a0,0x100,0x800,0x0,0x8000000,0x458300a0,0x458300a0,0x0,0x458320a0,0x4d8329a0,0x0,0x0,0x0,0x4000,0x0,0x0,0x810000,0x810000,0x20,0x20,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x2d00,0x0,0x2d00,0x400,0x800,0x2000,0x0,0x400,0x800,0x458300a0,0x458320a0,0x458300a0,0x0,0x0,0x0,0xa0240000,0x80200000,0x0,0xa0240000,0x80201040,0x100000,0x80201040,0x80201040,0x8000,0xa0240000,0x100000,0xa0240000,0xa0240000,0x8000,0x80201040,0xa0240000,0x0,0x0,0xa0240000,0x80201040,0x2000000,0x80201040,0xa0240000,0x2000000,0xa0240000,0x100000,0x80001040,0x100000,0x80001040,0x0,0x0,0x400000,0x200,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80001040,0x200000,0x200000,0x0,0x0,0x80001040,0x0,0x80001040,0x0,0x0,0x80001040,0x4000,0x0,0x0,};\r
+ }\r
+ private static void jj_la1_init_1() {\r
+ jj_la1_1 = new int[] {0x0,0x200000,0x20049064,0x0,0x0,0x8000,0x40000,0x20041064,0x0,0x40000000,0x0,0x0,0x40000000,0x800000,0x0,0x2106000,0x106000,0x0,0x0,0x0,0x8000000,0x0,0x0,0x4400400a,0x218e9475,0x0,0x0,0x80000,0x0,0x21069465,0x21069465,0x400000,0x21069465,0x218e9475,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x20400,0x20400,0x1000001,0x1000001,0x0,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x40000000,0x0,0x0,0x21069465,0x21069465,0x21069465,0x400000,0x4000,0x4000,0x40010800,0x880,0x40000000,0x40010800,0x4400488a,0x0,0x4400488a,0x4400488a,0x0,0x40010800,0x0,0x40010800,0x40010800,0x0,0x4400488a,0x40010800,0x0,0x200,0x40010800,0x4400488a,0x0,0x4400488a,0x40010800,0x0,0x40010800,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4004000,0x0,0x2,0x40000008,0x0,0x0,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x4400400a,0x0,0x0,0x0,};\r
+ }\r
+ private static void jj_la1_init_2() {\r
+ jj_la1_2 = new int[] {0x4000010,0x0,0xc0000000,0x0,0x0,0x0,0x0,0xc0000000,0x4,0x0,0x4000000,0x80,0x0,0x0,0x80,0x0,0x0,0x8000000,0x4000010,0x0,0x0,0x0,0x4000010,0x3c03c015,0xc4000010,0x0,0x0,0x0,0x0,0xc4000010,0xc4000010,0x0,0xc4000010,0xc4000010,0x10,0x4000010,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x4,0x3000000,0x1000000,0x3000000,0x4000010,0x80,0x4000010,0x0,0x0,0x4000010,0x3000000,0x0,0x0,0xc4000010,0xc4000010,0xc4000010,0x0,0x0,0x0,0x4000010,0x4000000,0x2000000,0x4000010,0x3c03c015,0x0,0x3c03c015,0x3c03c015,0x0,0x4000010,0x0,0x4000010,0x4000010,0x0,0x3c03c015,0x4000010,0x80,0x0,0x4000010,0x3c03c015,0x0,0x3c03c015,0x4000010,0x0,0x4000010,0x0,0x3c03c015,0x0,0x3c03c015,0x20,0x20,0x0,0x0,0x0,0x3f00,0x3f00,0x3c000,0x3c000,0x3c000,0x3c0000,0x3c0000,0xc00000,0xc00000,0x4000010,0x40,0x38000000,0x4000015,0x10,0x10,0x10,0x4,0x10,0x4,0x3c03c015,0x80,0x80,0x4000000,0x80,0x3c03c015,0x80,0x3c03c015,0x80,0x80,0x3c03c035,0x0,0x4000,0x8000000,};\r
+ }\r
+ final private JJCalls[] jj_2_rtns = new JJCalls[10];\r
+ private boolean jj_rescan = false;\r
+ private int jj_gc = 0;\r
+\r
+ /** Constructor with InputStream. */\r
+ public ModelParser(java.io.InputStream stream) {\r
+ this(stream, null);\r
+ }\r
+ /** Constructor with InputStream and supplied encoding */\r
+ public ModelParser(java.io.InputStream stream, String encoding) {\r
+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+ token_source = new ModelParserTokenManager(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 134; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream stream) {\r
+ ReInit(stream, null);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream stream, String encoding) {\r
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+ token_source.ReInit(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 134; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Constructor. */\r
+ public ModelParser(java.io.Reader stream) {\r
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);\r
+ token_source = new ModelParserTokenManager(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 134; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader stream) {\r
+ jj_input_stream.ReInit(stream, 1, 1);\r
+ token_source.ReInit(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 134; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Constructor with generated Token Manager. */\r
+ public ModelParser(ModelParserTokenManager tm) {\r
+ token_source = tm;\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 134; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(ModelParserTokenManager tm) {\r
+ token_source = tm;\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 134; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ private Token jj_consume_token(int kind) throws ParseException {\r
+ Token oldToken;\r
+ if ((oldToken = token).next != null) token = token.next;\r
+ else token = token.next = token_source.getNextToken();\r
+ jj_ntk = -1;\r
+ if (token.kind == kind) {\r
+ jj_gen++;\r
+ if (++jj_gc > 100) {\r
+ jj_gc = 0;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) {\r
+ JJCalls c = jj_2_rtns[i];\r
+ while (c != null) {\r
+ if (c.gen < jj_gen) c.first = null;\r
+ c = c.next;\r
+ }\r
+ }\r
+ }\r
+ return token;\r
+ }\r
+ token = oldToken;\r
+ jj_kind = kind;\r
+ throw generateParseException();\r
+ }\r
+\r
+ static private final class LookaheadSuccess extends java.lang.Error { }\r
+ final private LookaheadSuccess jj_ls = new LookaheadSuccess();\r
+ private boolean jj_scan_token(int kind) {\r
+ if (jj_scanpos == jj_lastpos) {\r
+ jj_la--;\r
+ if (jj_scanpos.next == null) {\r
+ jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();\r
+ } else {\r
+ jj_lastpos = jj_scanpos = jj_scanpos.next;\r
+ }\r
+ } else {\r
+ jj_scanpos = jj_scanpos.next;\r
+ }\r
+ if (jj_rescan) {\r
+ int i = 0; Token tok = token;\r
+ while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }\r
+ if (tok != null) jj_add_error_token(kind, i);\r
+ }\r
+ if (jj_scanpos.kind != kind) return true;\r
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;\r
+ return false;\r
+ }\r
+\r
+\r
+/** Get the next Token. */\r
+ final public Token getNextToken() {\r
+ if (token.next != null) token = token.next;\r
+ else token = token.next = token_source.getNextToken();\r
+ jj_ntk = -1;\r
+ jj_gen++;\r
+ return token;\r
+ }\r
+\r
+/** Get the specific Token. */\r
+ final public Token getToken(int index) {\r
+ Token t = token;\r
+ for (int i = 0; i < index; i++) {\r
+ if (t.next != null) t = t.next;\r
+ else t = t.next = token_source.getNextToken();\r
+ }\r
+ return t;\r
+ }\r
+\r
+ private int jj_ntk() {\r
+ if ((jj_nt=token.next) == null)\r
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);\r
+ else\r
+ return (jj_ntk = jj_nt.kind);\r
+ }\r
+\r
+ private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();\r
+ private int[] jj_expentry;\r
+ private int jj_kind = -1;\r
+ private int[] jj_lasttokens = new int[100];\r
+ private int jj_endpos;\r
+\r
+ private void jj_add_error_token(int kind, int pos) {\r
+ if (pos >= 100) return;\r
+ if (pos == jj_endpos + 1) {\r
+ jj_lasttokens[jj_endpos++] = kind;\r
+ } else if (jj_endpos != 0) {\r
+ jj_expentry = new int[jj_endpos];\r
+ for (int i = 0; i < jj_endpos; i++) {\r
+ jj_expentry[i] = jj_lasttokens[i];\r
+ }\r
+ jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) {\r
+ int[] oldentry = (int[])(it.next());\r
+ if (oldentry.length == jj_expentry.length) {\r
+ for (int i = 0; i < jj_expentry.length; i++) {\r
+ if (oldentry[i] != jj_expentry[i]) {\r
+ continue jj_entries_loop;\r
+ }\r
+ }\r
+ jj_expentries.add(jj_expentry);\r
+ break jj_entries_loop;\r
+ }\r
+ }\r
+ if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;\r
+ }\r
+ }\r
+\r
+ /** Generate ParseException. */\r
+ public ParseException generateParseException() {\r
+ jj_expentries.clear();\r
+ boolean[] la1tokens = new boolean[96];\r
+ if (jj_kind >= 0) {\r
+ la1tokens[jj_kind] = true;\r
+ jj_kind = -1;\r
+ }\r
+ for (int i = 0; i < 134; i++) {\r
+ if (jj_la1[i] == jj_gen) {\r
+ for (int j = 0; j < 32; j++) {\r
+ if ((jj_la1_0[i] & (1<<j)) != 0) {\r
+ la1tokens[j] = true;\r
+ }\r
+ if ((jj_la1_1[i] & (1<<j)) != 0) {\r
+ la1tokens[32+j] = true;\r
+ }\r
+ if ((jj_la1_2[i] & (1<<j)) != 0) {\r
+ la1tokens[64+j] = true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ for (int i = 0; i < 96; i++) {\r
+ if (la1tokens[i]) {\r
+ jj_expentry = new int[1];\r
+ jj_expentry[0] = i;\r
+ jj_expentries.add(jj_expentry);\r
+ }\r
+ }\r
+ jj_endpos = 0;\r
+ jj_rescan_token();\r
+ jj_add_error_token(0, 0);\r
+ int[][] exptokseq = new int[jj_expentries.size()][];\r
+ for (int i = 0; i < jj_expentries.size(); i++) {\r
+ exptokseq[i] = jj_expentries.get(i);\r
+ }\r
+ return new ParseException(token, exptokseq, tokenImage);\r
+ }\r
+\r
+ /** Enable tracing. */\r
+ final public void enable_tracing() {\r
+ }\r
+\r
+ /** Disable tracing. */\r
+ final public void disable_tracing() {\r
+ }\r
+\r
+ private void jj_rescan_token() {\r
+ jj_rescan = true;\r
+ for (int i = 0; i < 10; i++) {\r
+ try {\r
+ JJCalls p = jj_2_rtns[i];\r
+ do {\r
+ if (p.gen > jj_gen) {\r
+ jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;\r
+ switch (i) {\r
+ case 0: jj_3_1(); break;\r
+ case 1: jj_3_2(); break;\r
+ case 2: jj_3_3(); break;\r
+ case 3: jj_3_4(); break;\r
+ case 4: jj_3_5(); break;\r
+ case 5: jj_3_6(); break;\r
+ case 6: jj_3_7(); break;\r
+ case 7: jj_3_8(); break;\r
+ case 8: jj_3_9(); break;\r
+ case 9: jj_3_10(); break;\r
+ }\r
+ }\r
+ p = p.next;\r
+ } while (p != null);\r
+ } catch(LookaheadSuccess ls) { }\r
+ }\r
+ jj_rescan = false;\r
+ }\r
+\r
+ private void jj_save(int index, int xla) {\r
+ JJCalls p = jj_2_rtns[index];\r
+ while (p.gen > jj_gen) {\r
+ if (p.next == null) { p = p.next = new JJCalls(); break; }\r
+ p = p.next;\r
+ }\r
+ p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;\r
+ }\r
+\r
+ static final class JJCalls {\r
+ int gen;\r
+ Token first;\r
+ int arg;\r
+ JJCalls next;\r
+ }\r
+\r
+}\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. ModelParserConstants.java */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+\r
+/**\r
+ * Token literal values and constants.\r
+ * Generated by org.javacc.parser.OtherFilesGen#start()\r
+ */\r
+public interface ModelParserConstants {\r
+\r
+ /** End of File. */\r
+ int EOF = 0;\r
+ /** RegularExpression Id. */\r
+ int WHITESPACE = 1;\r
+ /** RegularExpression Id. */\r
+ int COMMENT1 = 2;\r
+ /** RegularExpression Id. */\r
+ int COMMENT2 = 3;\r
+ /** RegularExpression Id. */\r
+ int IDENT = 90;\r
+ /** RegularExpression Id. */\r
+ int STRING = 91;\r
+ /** RegularExpression Id. */\r
+ int UNSIGNED_INTEGER = 92;\r
+ /** RegularExpression Id. */\r
+ int UNSIGNED_NUMBER = 93;\r
+\r
+ /** Lexical state. */\r
+ int DEFAULT = 0;\r
+\r
+ /** Literal token values. */\r
+ String[] tokenImage = {\r
+ "<EOF>",\r
+ "<WHITESPACE>",\r
+ "<COMMENT1>",\r
+ "<COMMENT2>",\r
+ "\"algorithm\"",\r
+ "\"discrete\"",\r
+ "\"false\"",\r
+ "\"model\"",\r
+ "\"redeclare\"",\r
+ "\"and\"",\r
+ "\"each\"",\r
+ "\"final\"",\r
+ "\"not\"",\r
+ "\"replaceable\"",\r
+ "\"annotation\"",\r
+ "\"else\"",\r
+ "\"flow\"",\r
+ "\"operator\"",\r
+ "\"return\"",\r
+ "\"assert\"",\r
+ "\"elseif\"",\r
+ "\"for\"",\r
+ "\"or\"",\r
+ "\"stream\"",\r
+ "\"block\"",\r
+ "\"elsewhen\"",\r
+ "\"function\"",\r
+ "\"outer\"",\r
+ "\"then\"",\r
+ "\"break\"",\r
+ "\"encapsulated\"",\r
+ "\"if\"",\r
+ "\"output\"",\r
+ "\"true\"",\r
+ "\"class\"",\r
+ "\"end\"",\r
+ "\"import\"",\r
+ "\"package\"",\r
+ "\"type\"",\r
+ "\"connect\"",\r
+ "\"enumeration\"",\r
+ "\"in\"",\r
+ "\"parameter\"",\r
+ "\"when\"",\r
+ "\"connector\"",\r
+ "\"equation\"",\r
+ "\"initial\"",\r
+ "\"partial\"",\r
+ "\"while\"",\r
+ "\"constant\"",\r
+ "\"expandable\"",\r
+ "\"inner\"",\r
+ "\"protected\"",\r
+ "\"within\"",\r
+ "\"constrainedby\"",\r
+ "\"extends\"",\r
+ "\"input\"",\r
+ "\"public\"",\r
+ "\"der\"",\r
+ "\"external\"",\r
+ "\"loop\"",\r
+ "\"record\"",\r
+ "\"(\"",\r
+ "\")\"",\r
+ "\"{\"",\r
+ "\"}\"",\r
+ "\"[\"",\r
+ "\"]\"",\r
+ "\".\"",\r
+ "\":\"",\r
+ "\";\"",\r
+ "\",\"",\r
+ "\"<\"",\r
+ "\"<=\"",\r
+ "\">\"",\r
+ "\">=\"",\r
+ "\"==\"",\r
+ "\"<>\"",\r
+ "\"+\"",\r
+ "\"-\"",\r
+ "\".+\"",\r
+ "\".-\"",\r
+ "\"*\"",\r
+ "\"/\"",\r
+ "\".*\"",\r
+ "\"./\"",\r
+ "\"^\"",\r
+ "\".^\"",\r
+ "\"=\"",\r
+ "\":=\"",\r
+ "<IDENT>",\r
+ "<STRING>",\r
+ "<UNSIGNED_INTEGER>",\r
+ "<UNSIGNED_NUMBER>",\r
+ "\"operator function\"",\r
+ "\"operator record\"",\r
+ };\r
+\r
+}\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. ModelParserTokenManager.java */\r
+package org.simantics.sysdyn.modelParser;\r
+import java.util.ArrayList;\r
+\r
+/** Token Manager. */\r
+public class ModelParserTokenManager implements ModelParserConstants\r
+{\r
+\r
+ /** Debug output. */\r
+ public java.io.PrintStream debugStream = System.out;\r
+ /** Set debug output. */\r
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }\r
+private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
+{\r
+ switch (pos)
+ {\r
+ case 0:\r
+ if ((active1 & 0x80000L) != 0L)\r
+ return 14;\r
+ if ((active0 & 0x3ffffffffffffff0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ return 2;\r
+ }\r
+ if ((active1 & 0xb30010L) != 0L)\r
+ return 9;\r
+ return -1;\r
+ case 1:\r
+ if ((active0 & 0x108420080400000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x3ef7bdff7fbffff0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 1)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 1;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 2:\r
+ if ((active0 & 0x400000800201200L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x3bfffdf77f9fedf0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 2;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 3:\r
+ if ((active0 & 0x1000084212118400L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x2bfff5b56d8e69f0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 3)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 3;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 4:\r
+ if ((active0 & 0x1090004290008c0L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x2af6f5b1469e6130L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 4;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 5:\r
+ if ((active0 & 0x22200011009c0000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x8d6f5a046026130L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 5;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 6:\r
+ if ((active0 & 0x80d0a000000000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x856250046026130L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 6)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 6;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 7:\r
+ if ((active0 & 0x54150040006110L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 7)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 7;\r
+ }\r
+ return 2;\r
+ }\r
+ if ((active0 & 0x802200006020020L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+ return 2;\r
+ return -1;\r
+ case 8:\r
+ if ((active0 & 0x10140000000110L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x44010040006000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 8;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 9:\r
+ if ((active0 & 0x40010040002000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 9;\r
+ return 2;\r
+ }\r
+ if ((active0 & 0x4000000004000L) != 0L)\r
+ return 2;\r
+ return -1;\r
+ case 10:\r
+ if ((active0 & 0x10000002000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x40000040000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 10;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 11:\r
+ if ((active0 & 0x40000000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x40000000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 11;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 12:\r
+ if ((active0 & 0x40000000000000L) != 0L)\r
+ return 2;\r
+ return -1;\r
+ default :\r
+ return -1;\r
+ }\r
+}\r
+private final int jjStartNfa_0(int pos, long active0, long active1)
+{\r
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);\r
+}\r
+private int jjStopAtPos(int pos, int kind)\r
+{\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = pos;\r
+ return pos + 1;\r
+}\r
+private int jjMoveStringLiteralDfa0_0()\r
+{\r
+ switch(curChar)\r
+ {\r
+ case 40:\r
+ return jjStopAtPos(0, 62);\r
+ case 41:\r
+ return jjStopAtPos(0, 63);\r
+ case 42:\r
+ return jjStopAtPos(0, 82);\r
+ case 43:\r
+ return jjStopAtPos(0, 78);\r
+ case 44:\r
+ return jjStopAtPos(0, 71);\r
+ case 45:\r
+ return jjStopAtPos(0, 79);\r
+ case 46:\r
+ jjmatchedKind = 68;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0xb30000L);\r
+ case 47:\r
+ return jjStartNfaWithStates_0(0, 83, 14);\r
+ case 58:\r
+ jjmatchedKind = 69;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L);\r
+ case 59:\r
+ return jjStopAtPos(0, 70);\r
+ case 60:\r
+ jjmatchedKind = 72;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x2200L);\r
+ case 61:\r
+ jjmatchedKind = 88;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x1000L);\r
+ case 62:\r
+ jjmatchedKind = 74;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x800L);\r
+ case 91:\r
+ return jjStopAtPos(0, 66);\r
+ case 93:\r
+ return jjStopAtPos(0, 67);\r
+ case 94:\r
+ return jjStopAtPos(0, 86);\r
+ case 97:\r
+ return jjMoveStringLiteralDfa1_0(0x84210L, 0x0L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa1_0(0x21000000L, 0x0L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa1_0(0x42108400000000L, 0x0L);\r
+ case 100:\r
+ return jjMoveStringLiteralDfa1_0(0x400000000000020L, 0x0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa1_0(0x884210842108400L, 0x0L);\r
+ case 102:\r
+ return jjMoveStringLiteralDfa1_0(0x4210840L, 0x0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa1_0(0x108421080000000L, 0x0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa1_0(0x1000000000000000L, 0x0L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa1_0(0x80L, 0x0L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa1_0(0x1000L, 0x0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa1_0(0x108420000L, 0xc0000000L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa1_0(0x210842000000000L, 0x0L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa1_0(0x2000000000042100L, 0x0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa1_0(0x800000L, 0x0L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa1_0(0x4210000000L, 0x0L);\r
+ case 119:\r
+ return jjMoveStringLiteralDfa1_0(0x21080000000000L, 0x0L);\r
+ case 123:\r
+ return jjStopAtPos(0, 64);\r
+ case 125:\r
+ return jjStopAtPos(0, 65);\r
+ default :\r
+ return jjMoveNfa_0(0, 0);\r
+ }\r
+}\r
+private int jjMoveStringLiteralDfa1_0(long active0, long active1)\r
+{\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(0, active0, active1);\r
+ return 1;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 42:\r
+ if ((active1 & 0x100000L) != 0L)\r
+ return jjStopAtPos(1, 84);\r
+ break;\r
+ case 43:\r
+ if ((active1 & 0x10000L) != 0L)\r
+ return jjStopAtPos(1, 80);\r
+ break;\r
+ case 45:\r
+ if ((active1 & 0x20000L) != 0L)\r
+ return jjStopAtPos(1, 81);\r
+ break;\r
+ case 47:\r
+ if ((active1 & 0x200000L) != 0L)\r
+ return jjStopAtPos(1, 85);\r
+ break;\r
+ case 61:\r
+ if ((active1 & 0x200L) != 0L)\r
+ return jjStopAtPos(1, 73);\r
+ else if ((active1 & 0x800L) != 0L)\r
+ return jjStopAtPos(1, 75);\r
+ else if ((active1 & 0x1000L) != 0L)\r
+ return jjStopAtPos(1, 76);\r
+ else if ((active1 & 0x2000000L) != 0L)\r
+ return jjStopAtPos(1, 89);\r
+ break;\r
+ case 62:\r
+ if ((active1 & 0x2000L) != 0L)\r
+ return jjStopAtPos(1, 77);\r
+ break;\r
+ case 94:\r
+ if ((active1 & 0x800000L) != 0L)\r
+ return jjStopAtPos(1, 87);\r
+ break;\r
+ case 97:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x842000000440L, active1, 0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x2400000000042100L, active1, 0L);\r
+ case 102:\r
+ if ((active0 & 0x80000000L) != 0L)\r
+ return jjStartNfaWithStates_0(1, 31, 2);\r
+ break;\r
+ case 104:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x1080010000000L, active1, 0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000000000820L, active1, 0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x403118010L, active1, 0L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L, active1, 0L);\r
+ case 110:\r
+ if ((active0 & 0x20000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 41;\r
+ jjmatchedPos = 1;\r
+ }\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x108410840004200L, active1, 0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x1042108000201080L, active1, 0L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000L, active1, 0xc0000000L);\r
+ case 113:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L);\r
+ case 114:\r
+ if ((active0 & 0x400000L) != 0L)\r
+ return jjStartNfaWithStates_0(1, 22, 2);\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x10000220000000L, active1, 0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x80000L, active1, 0L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x800000L, active1, 0L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000010c000000L, active1, 0L);\r
+ case 120:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x884000000000000L, active1, 0L);\r
+ case 121:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x4000000000L, active1, 0L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(0, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(0, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(1, active0, active1);\r
+ return 2;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x400000000L, active1, 0L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x200000000000000L, active1, 0L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x2000002040000400L, active1, 0L);\r
+ case 100:\r
+ if ((active0 & 0x200L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 9, 2);\r
+ else if ((active0 & 0x800000000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 35, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x180L, active1, 0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x80030020000L, active1, 0xc0000000L);\r
+ case 103:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x10L, active1, 0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x1400000000000L, active1, 0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x40L, active1, 0L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x4a108004004800L, active1, 0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x1010000001010000L, active1, 0L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x104005000002000L, active1, 0L);\r
+ case 114:\r
+ if ((active0 & 0x200000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 21, 2);\r
+ else if ((active0 & 0x400000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 58, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x840000800000L, active1, 0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x2188020L, active1, 0L);\r
+ case 116:\r
+ if ((active0 & 0x1000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 12, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x8a0000108040000L, active1, 0L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x210200000000L, active1, 0L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(1, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(1, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(2, active0, active1);\r
+ return 3;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x4240060000800L, active1, 0L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x5000020L, active1, 0L);\r
+ case 101:\r
+ if ((active0 & 0x8000L) != 0L)\r
+ {\r
+ jjmatchedKind = 15;\r
+ jjmatchedPos = 3;\r
+ }\r
+ else if ((active0 & 0x200000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 33, 2);\r
+ else if ((active0 & 0x4000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 38, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x88800000a980180L, active1, 0L);\r
+ case 104:\r
+ if ((active0 & 0x400L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 10, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000000000000L, active1, 0L);\r
+ case 107:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000000000L, active1, 0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x201000000002000L, active1, 0L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L, active1, 0L);\r
+ case 110:\r
+ if ((active0 & 0x10000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 28, 2);\r
+ else if ((active0 & 0x80000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 43, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x108000000000L, active1, 0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000001000004010L, active1, 0L);\r
+ case 112:\r
+ if ((active0 & 0x1000000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 60, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x100000000L, active1, 0L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000L, active1, 0xc0000000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x42000400000040L, active1, 0L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x10c00000000000L, active1, 0L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x100000000040000L, active1, 0L);\r
+ case 119:\r
+ if ((active0 & 0x10000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 16, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(2, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(2, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(3, active0, active1);\r
+ return 4;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000822000L, active1, 0xc0000000L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x100L, active1, 0L);\r
+ case 101:\r
+ if ((active0 & 0x40L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 6, 2);\r
+ else if ((active0 & 0x1000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 48, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x10118000000000L, active1, 0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x220c00000100000L, active1, 0L);\r
+ case 107:\r
+ if ((active0 & 0x1000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 24, 2);\r
+ else if ((active0 & 0x20000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 29, 2);\r
+ break;\r
+ case 108:\r
+ if ((active0 & 0x80L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 7, 2);\r
+ else if ((active0 & 0x800L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 11, 2);\r
+ break;\r
+ case 109:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x84000000000000L, active1, 0L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000000L, active1, 0L);\r
+ case 114:\r
+ if ((active0 & 0x8000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 27, 2);\r
+ else if ((active0 & 0x8000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 51, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x28000010000c0030L, active1, 0L);\r
+ case 115:\r
+ if ((active0 & 0x400000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 34, 2);\r
+ break;\r
+ case 116:\r
+ if ((active0 & 0x100000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 56, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x42200004004000L, active1, 0L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x100000000L, active1, 0L);\r
+ case 119:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000000L, active1, 0L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(3, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(3, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(4, active0, active1);\r
+ return 5;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2c00000004000L, active1, 0L);\r
+ case 99:\r
+ if ((active0 & 0x200000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 57, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x10108000002000L, active1, 0L);\r
+ case 100:\r
+ if ((active0 & 0x2000000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 61, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x84000000000000L, active1, 0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40000000020L, active1, 0L);\r
+ case 102:\r
+ if ((active0 & 0x100000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 20, 2);\r
+ break;\r
+ case 103:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000000L, active1, 0L);\r
+ case 104:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000L, active1, 0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x200004000010L, active1, 0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x100L, active1, 0L);\r
+ case 109:\r
+ if ((active0 & 0x800000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 23, 2);\r
+ break;\r
+ case 110:\r
+ if ((active0 & 0x40000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 18, 2);\r
+ else if ((active0 & 0x20000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 53, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x800000000000000L, active1, 0L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40010000000000L, active1, 0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40000000L, active1, 0L);\r
+ case 116:\r
+ if ((active0 & 0x80000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 19, 2);\r
+ else if ((active0 & 0x100000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 32, 2);\r
+ else if ((active0 & 0x1000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 36, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x20000L, active1, 0xc0000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(4, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(4, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(5, active0, active1);\r
+ return 6;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x844010000000100L, active1, 0L);\r
+ case 101:\r
+ if ((active0 & 0x2000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 37, 2);\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x2002000L, active1, 0L);\r
+ case 108:\r
+ if ((active0 & 0x400000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 46, 2);\r
+ else if ((active0 & 0x800000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 47, 2);\r
+ break;\r
+ case 110:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000L, active1, 0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x200004020000L, active1, 0xc0000000L);\r
+ case 115:\r
+ if ((active0 & 0x80000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 55, 2);\r
+ break;\r
+ case 116:\r
+ if ((active0 & 0x8000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 39;\r
+ jjmatchedPos = 6;\r
+ }\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x10140000004030L, active1, 0L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x40000000L, active1, 0L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(5, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(5, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(6, active0, active1);\r
+ return 7;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x2000L, active1, 0L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x4000000000000L, active1, 0L);\r
+ case 101:\r
+ if ((active0 & 0x20L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 5, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10040000000000L, active1, 0L);\r
+ case 104:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10L, active1, 0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x40000000004000L, active1, 0L);\r
+ case 108:\r
+ if ((active0 & 0x800000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 59, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x40000000L, active1, 0L);\r
+ case 110:\r
+ if ((active0 & 0x2000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 25, 2);\r
+ else if ((active0 & 0x4000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 26, 2);\r
+ else if ((active0 & 0x200000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 45, 2);\r
+ break;\r
+ case 111:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x100000000000L, active1, 0L);\r
+ case 114:\r
+ if ((active0 & 0x20000L) != 0L)\r
+ {\r
+ jjmatchedKind = 17;\r
+ jjmatchedPos = 7;\r
+ }\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x100L, active1, 0xc0000000L);\r
+ case 116:\r
+ if ((active0 & 0x2000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 49, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L, active1, 0L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(6, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(6, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(7, active0, active1);\r
+ return 8;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 32:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0xc0000000L);\r
+ case 97:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x40000000L, active1, 0L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x2000L, active1, 0L);\r
+ case 100:\r
+ if ((active0 & 0x10000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 52, 2);\r
+ break;\r
+ case 101:\r
+ if ((active0 & 0x100L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 8, 2);\r
+ break;\r
+ case 105:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x10000000000L, active1, 0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x4000000000000L, active1, 0L);\r
+ case 109:\r
+ if ((active0 & 0x10L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 4, 2);\r
+ break;\r
+ case 110:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x40000000000000L, active1, 0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x4000L, active1, 0L);\r
+ case 114:\r
+ if ((active0 & 0x40000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 42, 2);\r
+ else if ((active0 & 0x100000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 44, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(7, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa9_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(7, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(8, active0, active1);\r
+ return 9;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 101:\r
+ if ((active0 & 0x4000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(9, 50, 2);\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x40000000000000L, active1, 0L);\r
+ case 102:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x40000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x2000L, active1, 0L);\r
+ case 110:\r
+ if ((active0 & 0x4000L) != 0L)\r
+ return jjStartNfaWithStates_0(9, 14, 2);\r
+ break;\r
+ case 111:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x10000000000L, active1, 0L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x80000000L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x40000000L, active1, 0L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(8, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa10_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(8, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(9, active0, active1);\r
+ return 10;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 100:\r
+ return jjMoveStringLiteralDfa11_0(active0, 0x40000000000000L, active1, 0L);\r
+ case 101:\r
+ if ((active0 & 0x2000L) != 0L)\r
+ return jjStartNfaWithStates_0(10, 13, 2);\r
+ return jjMoveStringLiteralDfa11_0(active0, 0x40000000L, active1, 0x80000000L);\r
+ case 110:\r
+ if ((active0 & 0x10000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(10, 40, 2);\r
+ break;\r
+ case 117:\r
+ return jjMoveStringLiteralDfa11_0(active0, 0L, active1, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(9, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa11_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(9, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(10, active0, active1);\r
+ return 11;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 98:\r
+ return jjMoveStringLiteralDfa12_0(active0, 0x40000000000000L, active1, 0L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x80000000L);\r
+ case 100:\r
+ if ((active0 & 0x40000000L) != 0L)\r
+ return jjStartNfaWithStates_0(11, 30, 2);\r
+ break;\r
+ case 110:\r
+ return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(10, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa12_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(10, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(11, active0, active1);\r
+ return 12;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 99:\r
+ return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x40000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x80000000L);\r
+ case 121:\r
+ if ((active0 & 0x40000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(12, 54, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(11, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa13_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(11, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(12, 0L, active1);\r
+ return 13;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 114:\r
+ return jjMoveStringLiteralDfa14_0(active1, 0x80000000L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa14_0(active1, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(12, 0L, active1);\r
+}\r
+private int jjMoveStringLiteralDfa14_0(long old1, long active1)\r
+{\r
+ if (((active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(12, 0L, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(13, 0L, active1);\r
+ return 14;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 100:\r
+ if ((active1 & 0x80000000L) != 0L)\r
+ return jjStopAtPos(14, 95);\r
+ break;\r
+ case 105:\r
+ return jjMoveStringLiteralDfa15_0(active1, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(13, 0L, active1);\r
+}\r
+private int jjMoveStringLiteralDfa15_0(long old1, long active1)\r
+{\r
+ if (((active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(13, 0L, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(14, 0L, active1);\r
+ return 15;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 111:\r
+ return jjMoveStringLiteralDfa16_0(active1, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(14, 0L, active1);\r
+}\r
+private int jjMoveStringLiteralDfa16_0(long old1, long active1)\r
+{\r
+ if (((active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(14, 0L, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(15, 0L, active1);\r
+ return 16;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 110:\r
+ if ((active1 & 0x40000000L) != 0L)\r
+ return jjStopAtPos(16, 94);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(15, 0L, active1);\r
+}\r
+private int jjStartNfaWithStates_0(int pos, int kind, int state)\r
+{\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = pos;\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) { return pos + 1; }\r
+ return jjMoveNfa_0(state, pos + 1);\r
+}\r
+static final long[] jjbitVec0 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};\r
+private int jjMoveNfa_0(int startState, int curPos)\r
+{\r
+ int startsAt = 0;\r
+ jjnewStateCnt = 34;\r
+ int i = 1;\r
+ jjstateSet[0] = startState;\r
+ int kind = 0x7fffffff;\r
+ for (;;)\r
+ {\r
+ if (++jjround == 0x7fffffff)\r
+ ReInitRounds();\r
+ if (curChar < 64)\r
+ {\r
+ long l = 1L << curChar;\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 14:\r
+ if (curChar == 47)\r
+ {\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(21);\r
+ }\r
+ else if (curChar == 42)\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 0:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ {\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAddStates(3, 7);\r
+ }\r
+ else if ((0x100002600L & l) != 0L)\r
+ {\r
+ if (kind > 1)\r
+ kind = 1;\r
+ }\r
+ else if (curChar == 47)\r
+ jjAddStates(8, 9);\r
+ else if (curChar == 46)\r
+ jjCheckNAdd(9);\r
+ else if (curChar == 34)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 2:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjstateSet[jjnewStateCnt++] = 2;\r
+ break;\r
+ case 3:\r
+ if (curChar == 34)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 4:\r
+ if ((0xfffffffbfffffbffL & l) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 6:\r
+ if ((0xfffffffffffffbffL & l) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 7:\r
+ if (curChar == 34 && kind > 91)\r
+ kind = 91;\r
+ break;\r
+ case 8:\r
+ if (curChar == 46)\r
+ jjCheckNAdd(9);\r
+ break;\r
+ case 9:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAddTwoStates(9, 10);\r
+ break;\r
+ case 11:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(12);\r
+ break;\r
+ case 12:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAdd(12);\r
+ break;\r
+ case 13:\r
+ if (curChar == 47)\r
+ jjAddStates(8, 9);\r
+ break;\r
+ case 15:\r
+ if ((0xfffffbffffffffffL & l) != 0L)\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 16:\r
+ if (curChar == 42)\r
+ jjstateSet[jjnewStateCnt++] = 17;\r
+ break;\r
+ case 17:\r
+ if ((0xffff7fffffffffffL & l) != 0L)\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 18:\r
+ if (curChar == 47 && kind > 2)\r
+ kind = 2;\r
+ break;\r
+ case 19:\r
+ if (curChar == 42)\r
+ jjstateSet[jjnewStateCnt++] = 18;\r
+ break;\r
+ case 20:\r
+ if (curChar != 47)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(21);\r
+ break;\r
+ case 21:\r
+ if ((0xfffffffffffffbffL & l) == 0L)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(21);\r
+ break;\r
+ case 22:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAddStates(3, 7);\r
+ break;\r
+ case 23:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAdd(23);\r
+ break;\r
+ case 24:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(24, 25);\r
+ break;\r
+ case 25:\r
+ if (curChar != 46)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAddTwoStates(26, 27);\r
+ break;\r
+ case 26:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAddTwoStates(26, 27);\r
+ break;\r
+ case 28:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(29);\r
+ break;\r
+ case 29:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAdd(29);\r
+ break;\r
+ case 30:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(30, 31);\r
+ break;\r
+ case 32:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(33);\r
+ break;\r
+ case 33:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAdd(33);\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ else if (curChar < 128)\r
+ {\r
+ long l = 1L << (curChar & 077);\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 0:\r
+ case 2:\r
+ if ((0x7fffffe87fffffeL & l) == 0L)\r
+ break;\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjCheckNAdd(2);\r
+ break;\r
+ case 4:\r
+ if ((0xffffffffefffffffL & l) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 5:\r
+ if (curChar == 92)\r
+ jjstateSet[jjnewStateCnt++] = 6;\r
+ break;\r
+ case 6:\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 10:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(13, 14);\r
+ break;\r
+ case 15:\r
+ case 17:\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 21:\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjstateSet[jjnewStateCnt++] = 21;\r
+ break;\r
+ case 27:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(15, 16);\r
+ break;\r
+ case 31:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(17, 18);\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ else\r
+ {\r
+ int i2 = (curChar & 0xff) >> 6;\r
+ long l2 = 1L << (curChar & 077);\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 4:\r
+ case 6:\r
+ if ((jjbitVec0[i2] & l2) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 15:\r
+ case 17:\r
+ if ((jjbitVec0[i2] & l2) != 0L)\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 21:\r
+ if ((jjbitVec0[i2] & l2) == 0L)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjstateSet[jjnewStateCnt++] = 21;\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ if (kind != 0x7fffffff)\r
+ {\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = curPos;\r
+ kind = 0x7fffffff;\r
+ }\r
+ ++curPos;\r
+ if ((i = jjnewStateCnt) == (startsAt = 34 - (jjnewStateCnt = startsAt)))\r
+ return curPos;\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) { return curPos; }\r
+ }\r
+}\r
+static final int[] jjnextStates = {
+ 15, 16, 19, 23, 24, 25, 30, 31, 14, 20, 4, 5, 7, 11, 12, 28,
+ 29, 32, 33,
+};\r
+\r
+/** Token literal values. */\r
+public static final String[] jjstrLiteralImages = {\r
+"", null, null, null, "\141\154\147\157\162\151\164\150\155", \r
+"\144\151\163\143\162\145\164\145", "\146\141\154\163\145", "\155\157\144\145\154", \r
+"\162\145\144\145\143\154\141\162\145", "\141\156\144", "\145\141\143\150", "\146\151\156\141\154", "\156\157\164", \r
+"\162\145\160\154\141\143\145\141\142\154\145", "\141\156\156\157\164\141\164\151\157\156", "\145\154\163\145", \r
+"\146\154\157\167", "\157\160\145\162\141\164\157\162", "\162\145\164\165\162\156", \r
+"\141\163\163\145\162\164", "\145\154\163\145\151\146", "\146\157\162", "\157\162", \r
+"\163\164\162\145\141\155", "\142\154\157\143\153", "\145\154\163\145\167\150\145\156", \r
+"\146\165\156\143\164\151\157\156", "\157\165\164\145\162", "\164\150\145\156", "\142\162\145\141\153", \r
+"\145\156\143\141\160\163\165\154\141\164\145\144", "\151\146", "\157\165\164\160\165\164", "\164\162\165\145", \r
+"\143\154\141\163\163", "\145\156\144", "\151\155\160\157\162\164", "\160\141\143\153\141\147\145", \r
+"\164\171\160\145", "\143\157\156\156\145\143\164", \r
+"\145\156\165\155\145\162\141\164\151\157\156", "\151\156", "\160\141\162\141\155\145\164\145\162", "\167\150\145\156", \r
+"\143\157\156\156\145\143\164\157\162", "\145\161\165\141\164\151\157\156", "\151\156\151\164\151\141\154", \r
+"\160\141\162\164\151\141\154", "\167\150\151\154\145", "\143\157\156\163\164\141\156\164", \r
+"\145\170\160\141\156\144\141\142\154\145", "\151\156\156\145\162", "\160\162\157\164\145\143\164\145\144", \r
+"\167\151\164\150\151\156", "\143\157\156\163\164\162\141\151\156\145\144\142\171", \r
+"\145\170\164\145\156\144\163", "\151\156\160\165\164", "\160\165\142\154\151\143", "\144\145\162", \r
+"\145\170\164\145\162\156\141\154", "\154\157\157\160", "\162\145\143\157\162\144", "\50", "\51", "\173", "\175", \r
+"\133", "\135", "\56", "\72", "\73", "\54", "\74", "\74\75", "\76", "\76\75", \r
+"\75\75", "\74\76", "\53", "\55", "\56\53", "\56\55", "\52", "\57", "\56\52", "\56\57", \r
+"\136", "\56\136", "\75", "\72\75", null, null, null, null, \r
+"\157\160\145\162\141\164\157\162\40\146\165\156\143\164\151\157\156", "\157\160\145\162\141\164\157\162\40\162\145\143\157\162\144", };\r
+\r
+/** Lexer state names. */\r
+public static final String[] lexStateNames = {\r
+ "DEFAULT",\r
+};\r
+static final long[] jjtoToken = {
+ 0xfffffffffffffff1L, 0xffffffffL,
+};\r
+static final long[] jjtoSkip = {
+ 0xeL, 0x0L,
+};\r
+protected SimpleCharStream input_stream;\r
+private final int[] jjrounds = new int[34];\r
+private final int[] jjstateSet = new int[68];\r
+private final StringBuilder jjimage = new StringBuilder();\r
+private StringBuilder image = jjimage;\r
+private int jjimageLen;\r
+private int lengthOfMatch;\r
+protected char curChar;\r
+/** Constructor. */\r
+public ModelParserTokenManager(SimpleCharStream stream){\r
+ if (SimpleCharStream.staticFlag)\r
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");\r
+ input_stream = stream;\r
+}\r
+\r
+/** Constructor. */\r
+public ModelParserTokenManager(SimpleCharStream stream, int lexState){\r
+ this(stream);\r
+ SwitchTo(lexState);\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream)\r
+{\r
+ jjmatchedPos = jjnewStateCnt = 0;\r
+ curLexState = defaultLexState;\r
+ input_stream = stream;\r
+ ReInitRounds();\r
+}\r
+private void ReInitRounds()\r
+{\r
+ int i;\r
+ jjround = 0x80000001;\r
+ for (i = 34; i-- > 0;)\r
+ jjrounds[i] = 0x80000000;\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream, int lexState)\r
+{\r
+ ReInit(stream);\r
+ SwitchTo(lexState);\r
+}\r
+\r
+/** Switch to specified lex state. */\r
+public void SwitchTo(int lexState)\r
+{\r
+ if (lexState >= 1 || lexState < 0)\r
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);\r
+ else\r
+ curLexState = lexState;\r
+}\r
+\r
+protected Token jjFillToken()\r
+{\r
+ final Token t;\r
+ final String curTokenImage;\r
+ final int beginLine;\r
+ final int endLine;\r
+ final int beginColumn;\r
+ final int endColumn;\r
+ String im = jjstrLiteralImages[jjmatchedKind];\r
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;\r
+ beginLine = input_stream.getBeginLine();\r
+ beginColumn = input_stream.getBeginColumn();\r
+ endLine = input_stream.getEndLine();\r
+ endColumn = input_stream.getEndColumn();\r
+ t = Token.newToken(jjmatchedKind, curTokenImage);\r
+\r
+ t.beginLine = beginLine;\r
+ t.endLine = endLine;\r
+ t.beginColumn = beginColumn;\r
+ t.endColumn = endColumn;\r
+\r
+ return t;\r
+}\r
+\r
+int curLexState = 0;\r
+int defaultLexState = 0;\r
+int jjnewStateCnt;\r
+int jjround;\r
+int jjmatchedPos;\r
+int jjmatchedKind;\r
+\r
+/** Get the next Token. */\r
+public Token getNextToken() \r
+{\r
+ Token matchedToken;\r
+ int curPos = 0;\r
+\r
+ EOFLoop :
+ for (;;)\r
+ {\r
+ try\r
+ {\r
+ curChar = input_stream.BeginToken();\r
+ }\r
+ catch(java.io.IOException e)\r
+ {\r
+ jjmatchedKind = 0;\r
+ matchedToken = jjFillToken();\r
+ return matchedToken;\r
+ }\r
+ image = jjimage;\r
+ image.setLength(0);\r
+ jjimageLen = 0;\r
+\r
+ jjmatchedKind = 0x7fffffff;\r
+ jjmatchedPos = 0;\r
+ curPos = jjMoveStringLiteralDfa0_0();\r
+ if (jjmatchedKind != 0x7fffffff)\r
+ {\r
+ if (jjmatchedPos + 1 < curPos)\r
+ input_stream.backup(curPos - jjmatchedPos - 1);\r
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\r
+ {\r
+ matchedToken = jjFillToken();\r
+ TokenLexicalActions(matchedToken);\r
+ return matchedToken;\r
+ }\r
+ else\r
+ {\r
+ continue EOFLoop;\r
+ }\r
+ }\r
+ int error_line = input_stream.getEndLine();\r
+ int error_column = input_stream.getEndColumn();\r
+ String error_after = null;\r
+ boolean EOFSeen = false;\r
+ try { input_stream.readChar(); input_stream.backup(1); }\r
+ catch (java.io.IOException e1) {\r
+ EOFSeen = true;\r
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+ if (curChar == '\n' || curChar == '\r') {\r
+ error_line++;\r
+ error_column = 0;\r
+ }\r
+ else\r
+ error_column++;\r
+ }\r
+ if (!EOFSeen) {\r
+ input_stream.backup(1);\r
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+ }\r
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\r
+ }\r
+}\r
+\r
+void TokenLexicalActions(Token matchedToken)\r
+{\r
+ switch(jjmatchedKind)\r
+ {\r
+ case 91 :\r
+ image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));\r
+ matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+}\r
+private void jjCheckNAdd(int state)\r
+{\r
+ if (jjrounds[state] != jjround)\r
+ {\r
+ jjstateSet[jjnewStateCnt++] = state;\r
+ jjrounds[state] = jjround;\r
+ }\r
+}\r
+private void jjAddStates(int start, int end)\r
+{\r
+ do {\r
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];\r
+ } while (start++ != end);\r
+}\r
+private void jjCheckNAddTwoStates(int state1, int state2)\r
+{\r
+ jjCheckNAdd(state1);\r
+ jjCheckNAdd(state2);\r
+}\r
+\r
+private void jjCheckNAddStates(int start, int end)\r
+{\r
+ do {\r
+ jjCheckNAdd(jjnextStates[start]);\r
+ } while (start++ != end);\r
+}\r
+\r
+}\r
--- /dev/null
+options {\r
+ JDK_VERSION = "1.6";\r
+ STATIC = false;\r
+}\r
+\r
+PARSER_BEGIN(ModelParser)\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+import java.util.ArrayList;\r
+\r
+@SuppressWarnings({"unused", "serial"})\r
+public class ModelParser {\r
+\r
+ private ArrayList<Parameter> inputs = new ArrayList<Parameter>();\r
+ private ArrayList<Parameter> outputs = new ArrayList<Parameter>();\r
+ \r
+ private enum InterfaceVariableType\r {\r INPUT, OUTPUT, OTHER\r
+ }\r
+\r
+ public class Parameter\r {\r
+ public String name;\r
+ public boolean optional;\r
+ public String description;\r
+ public String type;\r
+ \r
+ public Parameter()\r {\r
+ name = new String("");\r
+ optional = false;\r
+ description = null;\r
+ type = null;\r
+ }\r }\r
+\r
+ public ArrayList<Parameter> getInputs()\r
+ {\r
+ return inputs;\r
+ }\r
+ \r
+ public ArrayList<Parameter> getOutputs()\r
+ {\r
+ return outputs;\r
+ }\r
+ \r
+}\r
+\r
+PARSER_END(ModelParser)\r
+\r
+/*** Lexer *********************************************************/\r
+\r
+SKIP:\r
+{ <WHITESPACE: " " | "\n" | "\r" | "\t" > \r
+| <COMMENT1: "/*" (~["*"] | "*" ~["/"])* "*/" > \r
+| <COMMENT2: "//" (~["\n"])* >\r
+}\r
+\r
+TOKEN:\r
+{\r
+"algorithm" | "discrete" | "false" | "model" | "redeclare"\r
+| "and" | "each" | "final" | "not" | "replaceable"\r
+| "annotation" | "else" | "flow" | "operator" | "return"\r
+|"assert" | "elseif" | "for" | "or" | "stream"\r
+| "block" | "elsewhen" | "function" | "outer" | "then"\r
+| "break" | "encapsulated" | "if" | "output" | "true"\r
+| "class" | "end" | "import" | "package" | "type"\r
+| "connect" | "enumeration" | "in" | "parameter" | "when"\r
+| "connector" | "equation" | "initial" | "partial" | "while"\r
+| "constant" | "expandable" | "inner" | "protected" | "within"\r
+| "constrainedby" | "extends" | "input" | "public"\r
+| "der" | "external" | "loop" | "record"\r
+| "(" | ")" | "{" | "}" | "[" | "]" | "." | ":" | ";" | ","\r
+| "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+| "+" | "-" | ".+" | ".-"\r
+| "*" | "/" | ".*" | "./"\r
+| "^" | ".^"\r
+| "=" | ":=" \r
+| <IDENT: ["a"-"z","A"-"Z","_"] (["a"-"z","A"-"Z","_","0"-"9"])* >\r
+| <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
+ { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
+| <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
+| <UNSIGNED_NUMBER: \r
+ ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | "." <UNSIGNED_INTEGER> (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | <UNSIGNED_INTEGER> ["e","E"] (["+","-"])? <UNSIGNED_INTEGER>\r
+ ) >\r
+}\r
+\r
+/*** Parser ********************************************************/\r
+\r
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+\r
+void parse() : {\r
+ jj_input_stream.setTabSize(1);\r
+} {\r
+ stored_definition() <EOF>\r
+}\r
+\r
+/*** Stored Definition - Within ************************************/\r
+\r
+void stored_definition() : {\r
+} {\r
+// stored_definition:\r
+// [ within [ name ] ";" ]\r
+// { [ final ] class_definition ";" }\r
+ ( "within" ( name() )? ";" )?\r
+ ( ( "final" )? class_definition() ";" )*\r
+}\r
+\r
+/*** Class Definition **********************************************/\r
+ \r
+void class_definition() : {\r
+} {\r
+// class_definition :\r
+// [ encapsulated ]\r
+// [ partial\r
+// ] ( class modelrecordblock expandableconnectortype\r
+// | | | | [ ] | | package | function | operator | operator function | operator record )\r
+// class_specifier\r
+ ( "encapsulated" )?\r
+ ( "partial" )?\r
+ ( "class" | "model" | "record" | "block" | ( "expandable" )? "connector" | "type" |\r
+ "package" | "function" | "operator" | "operator function" | "operator record" )\r
+ class_specifier()\r
+}\r
+\r
+\r
+void class_specifier() : {\r
+} {\r
+// class_specifier :\r
+// IDENT string_comment composition end IDENT\r
+// | IDENT "=" base_prefix name [ array_subscripts ]\r
+// [ class_modification ] comment\r
+// | IDENT "=" enumeration "(" ( [enum_list] | ":" ) ")" comment\r
+// | IDENT "=" der "(" name "," IDENT { "," IDENT } ")" comment\r
+// | extends IDENT [ class_modification ] string_comment composition\r
+// end IDENT \r
+ LOOKAHEAD(2) <IDENT> string_comment() composition() "end" <IDENT>\r
+ | LOOKAHEAD(2) <IDENT> "=" base_prefix() name() ( array_subscripts() )? ( class_modification() )? comment()\r
+ | LOOKAHEAD(3) <IDENT> "=" "enumeration" "(" ( ( enum_list() )? | ":" ) ")" comment()\r
+ |LOOKAHEAD(3) <IDENT> "=" "der" "(" name() "," <IDENT> ( "," <IDENT> )* ")" comment()\r
+ | "extends" <IDENT> ( class_modification() )? string_comment() composition() "end" <IDENT> \r
+}\r
+\r
+void base_prefix() : {\r
+} {\r
+ type_prefix()\r
+}\r
+\r
+void enum_list() : {\r
+} {\r
+// enumeration_literal { "," enumeration_literal}\r
+ enumeration_literal() ( "," enumeration_literal() )* \r
+}\r
+\r
+void enumeration_literal() : {\r
+} {\r
+ <IDENT> comment()\r
+}\r
+\r
+void parse_composition() : {\r
+} {\r
+ composition() <EOF>\r
+}\r
+\r
+void composition() : {\r
+} {\r
+// element_list\r
+// { public element_list |\r
+// protected element_list |\r
+// equation_section |\r
+// algorithm_section\r
+// }\r
+// [ external [ language_specification ]\r
+// [ external_function_call ] [ annotation ] ";" ]\r
+// [ annotation ";" ]\r
+ element_list()\r
+ ( LOOKAHEAD(2) "public" element_list() | "protected" element_list() | equation_section() | algorithm_section() )*\r
+ ( "external" ( language_specification() )? ( external_function_call() )? ( annotation() )? ";" )?\r
+ ( annotation() ";" )?\r
+}\r
+\r
+void language_specification() : {\r
+} {\r
+ <STRING>\r
+}\r
+\r
+void external_function_call() : {\r
+} {\r
+// [ component_reference "=" ]\r
+// IDENT "(" [ expression_list ] ")"\r
+ ( component_reference() "=" )?\r
+ <IDENT> "(" ( expression_list() )? ")"\r
+}\r
+\r
+void element_list() : {\r
+} {\r
+ ( element() ";" )*\r
+}\r
+\r
+void element() : {\r
+} {\r
+// import_clause |\r
+// extends_clause |\r
+// [ redeclare ]\r
+// [ final ]\r
+// [ inner ] [ outer ]\r
+// ( ( class_definition | component_clause) |\r
+// replaceable ( class_definition | component_clause)\r
+// [constraining_clause comment])\r
+ import_clause() |\r
+ extends_clause() |\r
+ ( "redeclare" )?\r
+ ( "final" )?\r
+ ( "inner" )? ( "outer" )?\r
+ ( (class_definition() | component_clause()) |\r
+ "replaceable" (class_definition() | component_clause())\r
+ (constraining_clause() comment())?)\r
+}\r
+\r
+void import_clause() : {\r
+} {\r
+// import ( IDENT "=" name | name ["." "*"] ) comment\r
+ "import" (LOOKAHEAD(2) <IDENT> "=" name() | name() ("." "*")? ) comment()\r
+}\r
+\r
+/*** Extends *******************************************************/\r
+void extends_clause() : {\r
+} {\r
+// extends name [ class_modification ] [annotation]\r
+ "extends" name() ( class_modification() )? ( annotation() )?\r
+}\r
+\r
+void constraining_clause() : {\r
+} {\r
+// constrainedby name [ class_modification ]\r
+ "constrainedby" name() ( class_modification() )?\r
+}\r
+\r
+/*** Component Clause **********************************************/\r
+void component_clause() : {\r
+ InterfaceVariableType ioType = InterfaceVariableType.OTHER;\r
+ String typeSpecifier = "";\r
+ //String arraySubscripts = null;\r
+ ArrayList<Parameter> componentList = new ArrayList<Parameter>();\r
+} {\r
+ \r
+// type_prefix type_specifier [ array_subscripts ] component_list\r
+ ( ioType = type_prefix() )\r
+ ( typeSpecifier = type_specifier() )\r
+ ( /*arraySubscripts =*/ array_subscripts() )?\r
+ ( componentList = component_list() )\r
+ {\r
+ if (ioType == InterfaceVariableType.INPUT) {\r
+ for (Parameter input : componentList) {\r
+ input.type = typeSpecifier;\r
+ inputs.add(input);\r }\r
+ } else if (ioType == InterfaceVariableType.OUTPUT) {\r
+ for (Parameter output : componentList) {\r
+ output.type = typeSpecifier; \r
+ outputs.add(output);\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+InterfaceVariableType type_prefix() : {\r
+ InterfaceVariableType type = InterfaceVariableType.OTHER;\r
+} {\r
+// [ flow | stream ]\r
+// [ discrete | parameter | constant ] [ input | output ]\r
+ ( "flow" | "stream" )?\r
+ ( "discrete" | "parameter" | "constant" )?\r
+ ( "output" { type = InterfaceVariableType.OUTPUT; }\r
+ | "input" { type = InterfaceVariableType.INPUT; }\r
+ )?\r
+ {\r
+ return type;\r
+ }\r
+}\r
+String type_specifier() : {\r
+ String ret = new String("");\r
+} {\r
+ ret = name()\r
+ {\r return ret;\r
+ }\r
+}\r
+\r
+ArrayList<Parameter> component_list() : {\r
+ ArrayList<Parameter> ret = new ArrayList<Parameter>();\r
+ Parameter temp;\r
+} {\r
+// component_declaration { "," component_declaration }\r
+ temp = component_declaration() { ret.add(temp); }\r ( "," temp = component_declaration() { ret.add(temp); } )*\r
+ {\r return ret;\r
+ }\r
+}\r
+\r
+Parameter component_declaration() : {\r
+ Parameter ret;\r
+ String temp = "";\r
+} {\r
+// declaration [ conditional_attribute ] comment\r
+ ret = declaration() ( conditional_attribute() )? ret.description = comment()\r
+ {\r
+ return ret;\r
+ }\r
+}\r
+\r
+void conditional_attribute() : {\r
+} {\r
+ "if" expression()\r
+}\r
+\r
+Parameter declaration() : {\r
+ // Parameter here without comment yet.\r
+ Parameter ret = new Parameter();\r
+} {\r
+// IDENT [ array_subscripts ] [ modification ]\r
+ <IDENT> { ret.name = new String(token.image); }\r
+ ( array_subscripts() )?\r
+ ( ret.optional = modification() )?\r
+ {\r return ret;\r }\r
+}\r
+\r
+/*** Modification **********************************************/\r
+boolean modification() : {\r
+ boolean optional = false;\r
+} {\r
+// class_modification [ "=" expression ]\r
+// | "=" expression\r
+// | ":=" expression\r
+ ( class_modification() ( "=" expression() )?\r
+ | "=" expression() { optional = true; }\r
+ | ":=" expression() { optional = true; } )\r
+ {\r return optional;\r
+ } \r
+}\r
+\r
+void class_modification() : {\r
+} {\r
+// "(" [ argument_list ] ")"\r
+ "(" ( argument_list() )? ")"\r
+}\r
+\r
+void argument_list() : {\r
+} {\r
+// argument { "," argument }\r
+ argument() ( "," argument() )*\r
+}\r
+\r
+void argument() : {\r
+} {\r
+// element_modification_or_replaceable\r
+// | element_redeclaration\r
+ element_modification_or_replaceable() |\r
+ element_redeclaration()\r
+}\r
+\r
+void element_modification_or_replaceable() : {\r
+} {\r
+// [ each ] [ final ] ( element_modification | element_replaceable)\r
+ ( "each" )? ( "final" )? ( element_modification() | element_replaceable() )\r}\r
+\r
+void element_modification() : {\r
+} {\r
+// name [ modification ] string_comment\r
+ name() ( modification() )? string_comment()\r
+}\r
+\r
+void element_redeclaration() : {\r
+} {\r
+// redeclare [ each ] [ final ]\r
+// ( ( class_definition | component_clause1) | element_replaceable )\r
+ "redeclare" ( "each" )? ( "final" )?\r
+ ( ( class_definition() | component_clause1() ) | element_replaceable() )\r}\r
+\r
+void element_replaceable() : {\r
+} {\r
+// replaceable ( class_definition | component_clause1)\r
+// [constraining_clause]\r
+ "replaceable" ( class_definition() | component_clause1() ) ( constraining_clause() )?\r
+}\r
+\r
+void component_clause1() : {\r
+} {\r
+// type_prefix type_specifier component_declaration1\r
+ type_prefix() type_specifier() component_declaration1()\r
+}\r
+\r
+void component_declaration1() : {\r
+} {\r
+ declaration() comment()\r
+}\r
+\r
+\r
+/*** Equations *************************************************/\r
+void equation_section() : {\r
+} {\r
+// [ initial ] equation { equation ";" }\r
+ ( "initial" )? "equation" ( LOOKAHEAD(2) equation() ";" )*\r
+}\r
+\r
+void algorithm_section() : {\r
+} {\r
+// [ initial ] algorithm { statement ";" }\r
+ ( "initial" )? "algorithm" ( statement() ";" )*\r}\r
+\r
+void equation() : {\r
+} {\r
+// ( simple_expression "=" expression\r
+// | if_equation\r
+// | for_equation\r
+// | connect_clause\r
+// | when_equation\r
+// | IDENT function_call_args )\r
+// comment\r
+ ( LOOKAHEAD(3) simple_expression() "=" expression()\r
+ | if_equation()\r
+ | for_equation()\r
+ | connect_clause()\r
+ | when_equation()\r
+ | <IDENT> function_call_args() )\r
+ comment()\r}\r
+\r
+void statement() : {\r
+} {\r
+// ( component_reference ( ":=" expression | function_call_args )\r
+// | "(" output_expression_list ")" ":=" component_reference function_call_args\r
+// | break\r
+// | return\r
+// | if_statement\r
+// | for_statement\r
+// | while_statement\r
+// | when_statement )\r
+// comment\r
+ ( component_reference() ( ":=" expression() | function_call_args() )\r
+ | "(" output_expression_list() ")" ":=" component_reference() function_call_args()\r
+ | "break"\r
+ | "return"\r
+ | if_statement()\r
+ | for_statement()\r
+ | while_statement()\r
+ | when_statement() )\r
+ comment() \r \r
+}\r
+\r
+void if_equation() : {\r
+} {\r
+// if expression then\r
+// { equation ";" }\r
+// { elseif expression then\r
+// { equation ";" }\r
+// }\r
+// [ else\r
+// { equation ";" }\r
+// ]\r
+// end if\r
+ "if" expression() "then"\r
+ ( equation() ";" )*\r
+ ( "elseif" expression() "then"\r
+ ( equation() ";" )*\r
+ )*\r
+ ( "else"\r
+ ( equation() ";" )*\r
+ )?\r
+ "end" "if"\r}\r
+\r
+void if_statement() : {\r
+} {\r
+// if expression then\r
+// { statement ";" }\r
+// { elseif expression then\r
+// { statement ";" }\r
+// }\r
+// [ else\r
+// { statement ";" }\r
+// ]\r
+// end if\r
+ "if" expression() "then"\r
+ ( statement() ";" )*\r
+ ( "elseif" expression() "then"\r
+ ( statement() ";" )*\r
+ )*\r
+ ( "else"\r
+ ( statement() ";" )*\r
+ )?\r
+ "end" "if"\r}\r
+\r
+void for_equation() : {\r
+} {\r
+// for for_indices loop\r
+// { equation ";" }\r
+// end for\r
+ "for" for_indices() "loop"\r
+ ( equation() ";" )*\r
+ "end" "for"\r}\r
+\r
+void for_statement() : {\r
+} {\r
+// for for_indices loop\r
+// { equation ";" }\r
+// end for\r
+ "for" for_indices() "loop"\r
+ ( statement() ";" )*\r
+ "end" "for"\r}\r
+\r
+void for_indices() : {\r
+} {\r
+ //for_index {"," for_index}\r
+ for_index() ("," for_index())*\r
+}\r
+\r
+void for_index() : {\r
+} {\r
+ //IDENT [ in expression ]\r
+ <IDENT> ( "in" expression() )?\r
+}\r
+\r
+void while_statement() : {\r
+} {\r
+// while expression loop\r
+// { statement ";" }\r
+// end while\r
+ "while" expression() "loop"\r
+ ( statement() ";" )*\r
+ "end" "while"\r}\r
+\r
+void when_equation() : {\r
+} {\r
+// when expression then\r
+// { equation ";" }\r
+// { elsewhen expression then\r
+// { equation ";" } }\r
+// end when\r
+ "when" expression() "then"\r
+ ( equation() ";" )*\r
+ ( "elsewhen" expression() "then"\r
+ ( equation() ";" )*\r
+ )*\r
+ "end" "when"\r}\r
+\r
+void when_statement() : {\r
+} {\r
+// when expression then\r
+// { statement ";" }\r
+// { elsewhen expression then\r
+// { statement ";" } }\r
+// end when\r
+ "when" expression() "then"\r
+ ( statement() ";" )*\r
+ ( "elsewhen" expression() "then"\r
+ ( statement() ";" )*\r
+ )*\r
+ "end" "when"\r}\r
+\r
+void connect_clause() : {\r
+} {\r
+// connect "(" component_reference "," component_reference ")"\r
+ "connect" "(" component_reference() "," component_reference() ")"\r
+}\r
+\r
+/*** Expressions ***************************************************/\r
+void expr() : {\r
+} {\r
+ simple_expression() <EOF>\r
+ |\r
+ "if" expression() "then" expression() ( "elseif" expression() "then" expression() )*\r
+ "else" expression() <EOF>\r
+}\r
+\r
+void expression() : {\r
+} {\r
+ simple_expression()\r
+ | "if" expression() "then" expression() ( "elseif" expression() "then" expression() )*\r
+ "else" expression()\r
+}\r
+\r
+void simple_expression() : {\r
+} {\r
+ logical_expression() ( ":" logical_expression() ( ":" logical_expression() )? )?\r
+} \r
+\r
+void logical_expression() : {\r
+} {\r
+ logical_term() ( "or" logical_term() )*\r
+} \r
+\r
+void logical_term() : {\r
+} {\r
+ logical_factor() ( "and" logical_factor() )*\r
+}\r
+\r
+void logical_factor() : {\r
+} {\r
+ ( "not" )? relation()\r
+}\r
+\r
+void relation() : {\r
+} {\r
+ arithmetic_expression() ( rel_op() arithmetic_expression() )?\r
+}\r
+\r
+void rel_op() : {\r
+} {\r
+ "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+}\r
+\r
+void arithmetic_expression() : {\r
+} {\r
+ (add_op())? term() (add_op() term())*\r
+}\r
+\r
+void add_op() : {\r
+} {\r
+ "+" | "-" | ".+" | ".-"\r
+}\r
+\r
+void term() : {\r
+} {\r
+ factor() ( mul_op() factor() )*\r
+}\r
+\r
+void mul_op() : {\r
+} {\r
+ "*" | "/" | ".*" | "./"\r
+}\r
+\r
+void factor() : {\r
+} {\r
+ primary() ( ( "^" | ".^" ) primary() )?\r
+}\r
+\r
+void primary() : {\r
+} {\r
+ <UNSIGNED_NUMBER>\r
+ | <UNSIGNED_INTEGER>\r
+ | <STRING>\r
+ | "false"\r
+ | "true"\r
+ | LOOKAHEAD( (name()|"der"|"initial") "(" ) (name()|"der"|"initial") function_call_args()\r
+ | component_reference()\r
+ /* | "(" output_expression_list() ")" */ // Not needed, replaced with following:\r
+ | "(" expression() ")"\r
+ | "[" expression_list() ( ";" expression_list() )* "]"\r
+ | "{" function_arguments() "}"\r
+ | "end"\r
+}\r
+\r
+String name() : {\r
+ String ret = new String("");\r
+} {\r
+// [ "." ] IDENT { "." IDENT }\r
+ ( "." { ret += "."; } )?\r
+ <IDENT> { ret += token.image; }\r
+ ( "." { ret += "."; }\r
+ <IDENT> { ret += token.image; }\r
+ )*\r
+ {\r return ret;\r
+ }\r
+}\r
+\r
+void component_reference() : {\r
+} {\r
+// [ "." ] IDENT [ array_subscripts ] { "." IDENT [ array_subscripts ] }\r
+ ( "." )? <IDENT> ( array_subscripts() )? ( "." <IDENT> ( array_subscripts() )? )*\r
+}\r
+\r
+void function_call_args() : {\r
+} {\r
+// "(" [ function_arguments ] ")"\r
+ "(" ( function_arguments() )? ")"\r
+}\r
+\r
+void function_arguments() : {\r
+} {\r
+ //expression [ "," function_arguments | for for_indices ]\r
+ //| named_arguments\r
+ LOOKAHEAD(2) expression() ( "," function_arguments() | "for" for_indices() )?\r
+ | named_arguments()\r
+}\r
+\r
+void named_arguments() : {\r
+} {\r
+// named_argument [ "," named_arguments ] \r
+ named_argument() ( "," named_arguments() )?\r
+}\r
+\r
+void named_argument() : {\r
+} { \r
+ <IDENT> "=" expression()\r
+}\r
+\r
+void output_expression_list() : {\r
+} {\r
+// [ expression ] { "," [ expression ] } \r
+ ( expression() )? ( "," ( expression() )? )*\r
+}\r
+\r
+void expression_list() : {\r
+} {\r
+// expression { "," expression }\r
+ expression() ( "," expression() )*\r
+}\r
+\r
+void array_subscripts() : {\r
+} {\r
+// "[" subscript { "," subscript } "]" \r
+ "[" subscript() ( "," subscript() )* "]"\r
+}\r
+\r
+void subscript() : {\r
+} {\r
+// ":" | expression \r ":" | expression() \r
+}\r
+\r
+String comment() : {\r
+ String ret;\r} {\r// string_comment [ annotation ]\r
+ ret = string_comment() ( annotation() )?\r
+ {\r return ret;\r
+ }\r
+}\r
+\r
+String string_comment() : {\r
+ String ret = null;\r
+} {\r
+// [ STRING { "+" STRING } ] \r
+ ( <STRING> { ret = new String(token.image); }\r
+ ( "+" { ret += "+"; }\r
+ <STRING> { ret += token.image; }\r
+ )*\r
+ )?\r
+ {\r return ret;\r
+ } \r}\r
+\r
+void annotation() : {\r
+} {\r
+// annotation class_modification\r
+ "annotation" class_modification() \r
+}\r \r
+\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */\r
+/* JavaCCOptions:KEEP_LINE_COL=null */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+/**\r
+ * This exception is thrown when parse errors are encountered.\r
+ * You can explicitly create objects of this exception type by\r
+ * calling the method generateParseException in the generated\r
+ * parser.\r
+ *\r
+ * You can modify this class to customize your error reporting\r
+ * mechanisms so long as you retain the public fields.\r
+ */\r
+public class ParseException extends Exception {\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /**\r
+ * This constructor is used by the method "generateParseException"\r
+ * in the generated parser. Calling this constructor generates\r
+ * a new object of this type with the fields "currentToken",\r
+ * "expectedTokenSequences", and "tokenImage" set.\r
+ */\r
+ public ParseException(Token currentTokenVal,\r
+ int[][] expectedTokenSequencesVal,\r
+ String[] tokenImageVal\r
+ )\r
+ {\r
+ super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));\r
+ currentToken = currentTokenVal;\r
+ expectedTokenSequences = expectedTokenSequencesVal;\r
+ tokenImage = tokenImageVal;\r
+ }\r
+\r
+ /**\r
+ * The following constructors are for use by you for whatever\r
+ * purpose you can think of. Constructing the exception in this\r
+ * manner makes the exception behave in the normal way - i.e., as\r
+ * documented in the class "Throwable". The fields "errorToken",\r
+ * "expectedTokenSequences", and "tokenImage" do not contain\r
+ * relevant information. The JavaCC generated code does not use\r
+ * these constructors.\r
+ */\r
+\r
+ public ParseException() {\r
+ super();\r
+ }\r
+\r
+ /** Constructor with message. */\r
+ public ParseException(String message) {\r
+ super(message);\r
+ }\r
+\r
+\r
+ /**\r
+ * This is the last token that has been consumed successfully. If\r
+ * this object has been created due to a parse error, the token\r
+ * followng this token will (therefore) be the first error token.\r
+ */\r
+ public Token currentToken;\r
+\r
+ /**\r
+ * Each entry in this array is an array of integers. Each array\r
+ * of integers represents a sequence of tokens (by their ordinal\r
+ * values) that is expected at this point of the parse.\r
+ */\r
+ public int[][] expectedTokenSequences;\r
+\r
+ /**\r
+ * This is a reference to the "tokenImage" array of the generated\r
+ * parser within which the parse error occurred. This array is\r
+ * defined in the generated ...Constants interface.\r
+ */\r
+ public String[] tokenImage;\r
+\r
+ /**\r
+ * It uses "currentToken" and "expectedTokenSequences" to generate a parse\r
+ * error message and returns it. If this object has been created\r
+ * due to a parse error, and you do not catch it (it gets thrown\r
+ * from the parser) the correct error message\r
+ * gets displayed.\r
+ */\r
+ private static String initialise(Token currentToken,\r
+ int[][] expectedTokenSequences,\r
+ String[] tokenImage) {\r
+ String eol = System.getProperty("line.separator", "\n");\r
+ StringBuffer expected = new StringBuffer();\r
+ int maxSize = 0;\r
+ for (int i = 0; i < expectedTokenSequences.length; i++) {\r
+ if (maxSize < expectedTokenSequences[i].length) {\r
+ maxSize = expectedTokenSequences[i].length;\r
+ }\r
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {\r
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');\r
+ }\r
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {\r
+ expected.append("...");\r
+ }\r
+ expected.append(eol).append(" ");\r
+ }\r
+ String retval = "Encountered \"";\r
+ Token tok = currentToken.next;\r
+ for (int i = 0; i < maxSize; i++) {\r
+ if (i != 0) retval += " ";\r
+ if (tok.kind == 0) {\r
+ retval += tokenImage[0];\r
+ break;\r
+ }\r
+ retval += " " + tokenImage[tok.kind];\r
+ retval += " \"";\r
+ retval += add_escapes(tok.image);\r
+ retval += " \"";\r
+ tok = tok.next;\r
+ }\r
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;\r
+ retval += "." + eol;\r
+ if (expectedTokenSequences.length == 1) {\r
+ retval += "Was expecting:" + eol + " ";\r
+ } else {\r
+ retval += "Was expecting one of:" + eol + " ";\r
+ }\r
+ retval += expected.toString();\r
+ return retval;\r
+ }\r
+\r
+ /**\r
+ * The end of line string for this machine.\r
+ */\r
+ protected String eol = System.getProperty("line.separator", "\n");\r
+\r
+ /**\r
+ * Used to convert raw characters to their escaped version\r
+ * when these raw version cannot be used as part of an ASCII\r
+ * string literal.\r
+ */\r
+ static String add_escapes(String str) {\r
+ StringBuffer retval = new StringBuffer();\r
+ char ch;\r
+ for (int i = 0; i < str.length(); i++) {\r
+ switch (str.charAt(i))\r
+ {\r
+ case 0 :\r
+ continue;\r
+ case '\b':\r
+ retval.append("\\b");\r
+ continue;\r
+ case '\t':\r
+ retval.append("\\t");\r
+ continue;\r
+ case '\n':\r
+ retval.append("\\n");\r
+ continue;\r
+ case '\f':\r
+ retval.append("\\f");\r
+ continue;\r
+ case '\r':\r
+ retval.append("\\r");\r
+ continue;\r
+ case '\"':\r
+ retval.append("\\\"");\r
+ continue;\r
+ case '\'':\r
+ retval.append("\\\'");\r
+ continue;\r
+ case '\\':\r
+ retval.append("\\\\");\r
+ continue;\r
+ default:\r
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+ String s = "0000" + Integer.toString(ch, 16);\r
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+ } else {\r
+ retval.append(ch);\r
+ }\r
+ continue;\r
+ }\r
+ }\r
+ return retval.toString();\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=e46c56bfa832359193465f81e8a2147e (do not edit this line) */\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */\r
+/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+/**\r
+ * An implementation of interface CharStream, where the stream is assumed to\r
+ * contain only ASCII characters (without unicode processing).\r
+ */\r
+\r
+public class SimpleCharStream\r
+{\r
+/** Whether parser is static. */\r
+ public static final boolean staticFlag = false;\r
+ int bufsize;\r
+ int available;\r
+ int tokenBegin;\r
+/** Position in buffer. */\r
+ public int bufpos = -1;\r
+ protected int bufline[];\r
+ protected int bufcolumn[];\r
+\r
+ protected int column = 0;\r
+ protected int line = 1;\r
+\r
+ protected boolean prevCharIsCR = false;\r
+ protected boolean prevCharIsLF = false;\r
+\r
+ protected java.io.Reader inputStream;\r
+\r
+ protected char[] buffer;\r
+ protected int maxNextCharInd = 0;\r
+ protected int inBuf = 0;\r
+ protected int tabSize = 8;\r
+\r
+ protected void setTabSize(int i) { tabSize = i; }\r
+ protected int getTabSize(int i) { return tabSize; }\r
+\r
+\r
+ protected void ExpandBuff(boolean wrapAround)\r
+ {\r
+ char[] newbuffer = new char[bufsize + 2048];\r
+ int newbufline[] = new int[bufsize + 2048];\r
+ int newbufcolumn[] = new int[bufsize + 2048];\r
+\r
+ try\r
+ {\r
+ if (wrapAround)\r
+ {\r
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+ System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);\r
+ buffer = newbuffer;\r
+\r
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);\r
+ bufline = newbufline;\r
+\r
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);\r
+ bufcolumn = newbufcolumn;\r
+\r
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));\r
+ }\r
+ else\r
+ {\r
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+ buffer = newbuffer;\r
+\r
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+ bufline = newbufline;\r
+\r
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+ bufcolumn = newbufcolumn;\r
+\r
+ maxNextCharInd = (bufpos -= tokenBegin);\r
+ }\r
+ }\r
+ catch (Throwable t)\r
+ {\r
+ throw new Error(t.getMessage());\r
+ }\r
+\r
+\r
+ bufsize += 2048;\r
+ available = bufsize;\r
+ tokenBegin = 0;\r
+ }\r
+\r
+ protected void FillBuff() throws java.io.IOException\r
+ {\r
+ if (maxNextCharInd == available)\r
+ {\r
+ if (available == bufsize)\r
+ {\r
+ if (tokenBegin > 2048)\r
+ {\r
+ bufpos = maxNextCharInd = 0;\r
+ available = tokenBegin;\r
+ }\r
+ else if (tokenBegin < 0)\r
+ bufpos = maxNextCharInd = 0;\r
+ else\r
+ ExpandBuff(false);\r
+ }\r
+ else if (available > tokenBegin)\r
+ available = bufsize;\r
+ else if ((tokenBegin - available) < 2048)\r
+ ExpandBuff(true);\r
+ else\r
+ available = tokenBegin;\r
+ }\r
+\r
+ int i;\r
+ try {\r
+ if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)\r
+ {\r
+ inputStream.close();\r
+ throw new java.io.IOException();\r
+ }\r
+ else\r
+ maxNextCharInd += i;\r
+ return;\r
+ }\r
+ catch(java.io.IOException e) {\r
+ --bufpos;\r
+ backup(0);\r
+ if (tokenBegin == -1)\r
+ tokenBegin = bufpos;\r
+ throw e;\r
+ }\r
+ }\r
+\r
+/** Start. */\r
+ public char BeginToken() throws java.io.IOException\r
+ {\r
+ tokenBegin = -1;\r
+ char c = readChar();\r
+ tokenBegin = bufpos;\r
+\r
+ return c;\r
+ }\r
+\r
+ protected void UpdateLineColumn(char c)\r
+ {\r
+ column++;\r
+\r
+ if (prevCharIsLF)\r
+ {\r
+ prevCharIsLF = false;\r
+ line += (column = 1);\r
+ }\r
+ else if (prevCharIsCR)\r
+ {\r
+ prevCharIsCR = false;\r
+ if (c == '\n')\r
+ {\r
+ prevCharIsLF = true;\r
+ }\r
+ else\r
+ line += (column = 1);\r
+ }\r
+\r
+ switch (c)\r
+ {\r
+ case '\r' :\r
+ prevCharIsCR = true;\r
+ break;\r
+ case '\n' :\r
+ prevCharIsLF = true;\r
+ break;\r
+ case '\t' :\r
+ column--;\r
+ column += (tabSize - (column % tabSize));\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+\r
+ bufline[bufpos] = line;\r
+ bufcolumn[bufpos] = column;\r
+ }\r
+\r
+/** Read a character. */\r
+ public char readChar() throws java.io.IOException\r
+ {\r
+ if (inBuf > 0)\r
+ {\r
+ --inBuf;\r
+\r
+ if (++bufpos == bufsize)\r
+ bufpos = 0;\r
+\r
+ return buffer[bufpos];\r
+ }\r
+\r
+ if (++bufpos >= maxNextCharInd)\r
+ FillBuff();\r
+\r
+ char c = buffer[bufpos];\r
+\r
+ UpdateLineColumn(c);\r
+ return c;\r
+ }\r
+\r
+ @Deprecated\r
+ /**\r
+ * @deprecated\r
+ * @see #getEndColumn\r
+ */\r
+\r
+ public int getColumn() {\r
+ return bufcolumn[bufpos];\r
+ }\r
+\r
+ @Deprecated\r
+ /**\r
+ * @deprecated\r
+ * @see #getEndLine\r
+ */\r
+\r
+ public int getLine() {\r
+ return bufline[bufpos];\r
+ }\r
+\r
+ /** Get token end column number. */\r
+ public int getEndColumn() {\r
+ return bufcolumn[bufpos];\r
+ }\r
+\r
+ /** Get token end line number. */\r
+ public int getEndLine() {\r
+ return bufline[bufpos];\r
+ }\r
+\r
+ /** Get token beginning column number. */\r
+ public int getBeginColumn() {\r
+ return bufcolumn[tokenBegin];\r
+ }\r
+\r
+ /** Get token beginning line number. */\r
+ public int getBeginLine() {\r
+ return bufline[tokenBegin];\r
+ }\r
+\r
+/** Backup a number of characters. */\r
+ public void backup(int amount) {\r
+\r
+ inBuf += amount;\r
+ if ((bufpos -= amount) < 0)\r
+ bufpos += bufsize;\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ inputStream = dstream;\r
+ line = startline;\r
+ column = startcolumn - 1;\r
+\r
+ available = bufsize = buffersize;\r
+ buffer = new char[buffersize];\r
+ bufline = new int[buffersize];\r
+ bufcolumn = new int[buffersize];\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ this(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream)\r
+ {\r
+ this(dstream, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ inputStream = dstream;\r
+ line = startline;\r
+ column = startcolumn - 1;\r
+\r
+ if (buffer == null || buffersize != buffer.length)\r
+ {\r
+ available = bufsize = buffersize;\r
+ buffer = new char[buffersize];\r
+ bufline = new int[buffersize];\r
+ bufcolumn = new int[buffersize];\r
+ }\r
+ prevCharIsLF = prevCharIsCR = false;\r
+ tokenBegin = inBuf = maxNextCharInd = 0;\r
+ bufpos = -1;\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ ReInit(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream)\r
+ {\r
+ ReInit(dstream, 1, 1, 4096);\r
+ }\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(dstream, encoding, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ this(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(dstream, encoding, 1, 1, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream)\r
+ {\r
+ this(dstream, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(dstream, encoding, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream)\r
+ {\r
+ ReInit(dstream, 1, 1, 4096);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(dstream, encoding, startline, startcolumn, 4096);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ ReInit(dstream, startline, startcolumn, 4096);\r
+ }\r
+ /** Get token literal value. */\r
+ public String GetImage()\r
+ {\r
+ if (bufpos >= tokenBegin)\r
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);\r
+ else\r
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +\r
+ new String(buffer, 0, bufpos + 1);\r
+ }\r
+\r
+ /** Get the suffix. */\r
+ public char[] GetSuffix(int len)\r
+ {\r
+ char[] ret = new char[len];\r
+\r
+ if ((bufpos + 1) >= len)\r
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);\r
+ else\r
+ {\r
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,\r
+ len - bufpos - 1);\r
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);\r
+ }\r
+\r
+ return ret;\r
+ }\r
+\r
+ /** Reset buffer when finished. */\r
+ public void Done()\r
+ {\r
+ buffer = null;\r
+ bufline = null;\r
+ bufcolumn = null;\r
+ }\r
+\r
+ /**\r
+ * Method to adjust line and column numbers for the start of a token.\r
+ */\r
+ public void adjustBeginLineColumn(int newLine, int newCol)\r
+ {\r
+ int start = tokenBegin;\r
+ int len;\r
+\r
+ if (bufpos >= tokenBegin)\r
+ {\r
+ len = bufpos - tokenBegin + inBuf + 1;\r
+ }\r
+ else\r
+ {\r
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;\r
+ }\r
+\r
+ int i = 0, j = 0, k = 0;\r
+ int nextColDiff = 0, columnDiff = 0;\r
+\r
+ while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])\r
+ {\r
+ bufline[j] = newLine;\r
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];\r
+ bufcolumn[j] = newCol + columnDiff;\r
+ columnDiff = nextColDiff;\r
+ i++;\r
+ }\r
+\r
+ if (i < len)\r
+ {\r
+ bufline[j] = newLine++;\r
+ bufcolumn[j] = newCol + columnDiff;\r
+\r
+ while (i++ < len)\r
+ {\r
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])\r
+ bufline[j] = newLine++;\r
+ else\r
+ bufline[j] = newLine;\r
+ }\r
+ }\r
+\r
+ line = bufline[j];\r
+ column = bufcolumn[j];\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=7ab7faca15b64bda32c7a4effb209066 (do not edit this line) */\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */\r
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+/**\r
+ * Describes the input token stream.\r
+ */\r
+\r
+public class Token implements java.io.Serializable {\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /**\r
+ * An integer that describes the kind of this token. This numbering\r
+ * system is determined by JavaCCParser, and a table of these numbers is\r
+ * stored in the file ...Constants.java.\r
+ */\r
+ public int kind;\r
+\r
+ /** The line number of the first character of this Token. */\r
+ public int beginLine;\r
+ /** The column number of the first character of this Token. */\r
+ public int beginColumn;\r
+ /** The line number of the last character of this Token. */\r
+ public int endLine;\r
+ /** The column number of the last character of this Token. */\r
+ public int endColumn;\r
+\r
+ /**\r
+ * The string image of the token.\r
+ */\r
+ public String image;\r
+\r
+ /**\r
+ * A reference to the next regular (non-special) token from the input\r
+ * stream. If this is the last token from the input stream, or if the\r
+ * token manager has not read tokens beyond this one, this field is\r
+ * set to null. This is true only if this token is also a regular\r
+ * token. Otherwise, see below for a description of the contents of\r
+ * this field.\r
+ */\r
+ public Token next;\r
+\r
+ /**\r
+ * This field is used to access special tokens that occur prior to this\r
+ * token, but after the immediately preceding regular (non-special) token.\r
+ * If there are no such special tokens, this field is set to null.\r
+ * When there are more than one such special token, this field refers\r
+ * to the last of these special tokens, which in turn refers to the next\r
+ * previous special token through its specialToken field, and so on\r
+ * until the first special token (whose specialToken field is null).\r
+ * The next fields of special tokens refer to other special tokens that\r
+ * immediately follow it (without an intervening regular token). If there\r
+ * is no such token, this field is null.\r
+ */\r
+ public Token specialToken;\r
+\r
+ /**\r
+ * An optional attribute value of the Token.\r
+ * Tokens which are not used as syntactic sugar will often contain\r
+ * meaningful values that will be used later on by the compiler or\r
+ * interpreter. This attribute value is often different from the image.\r
+ * Any subclass of Token that actually wants to return a non-null value can\r
+ * override this method as appropriate.\r
+ */\r
+ public Object getValue() {\r
+ return null;\r
+ }\r
+\r
+ /**\r
+ * No-argument constructor\r
+ */\r
+ public Token() {}\r
+\r
+ /**\r
+ * Constructs a new token for the specified Image.\r
+ */\r
+ public Token(int kind)\r
+ {\r
+ this(kind, null);\r
+ }\r
+\r
+ /**\r
+ * Constructs a new token for the specified Image and Kind.\r
+ */\r
+ public Token(int kind, String image)\r
+ {\r
+ this.kind = kind;\r
+ this.image = image;\r
+ }\r
+\r
+ /**\r
+ * Returns the image.\r
+ */\r
+ public String toString()\r
+ {\r
+ return image;\r
+ }\r
+\r
+ /**\r
+ * Returns a new Token object, by default. However, if you want, you\r
+ * can create and return subclass objects based on the value of ofKind.\r
+ * Simply add the cases to the switch for all those special cases.\r
+ * For example, if you have a subclass of Token called IDToken that\r
+ * you want to create if ofKind is ID, simply add something like :\r
+ *\r
+ * case MyParserConstants.ID : return new IDToken(ofKind, image);\r
+ *\r
+ * to the following switch statement. Then you can cast matchedToken\r
+ * variable to the appropriate type and use sit in your lexical actions.\r
+ */\r
+ public static Token newToken(int ofKind, String image)\r
+ {\r
+ switch(ofKind)\r
+ {\r
+ default : return new Token(ofKind, image);\r
+ }\r
+ }\r
+\r
+ public static Token newToken(int ofKind)\r
+ {\r
+ return newToken(ofKind, null);\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=8584b8a0988c627589640a007dbfe0bb (do not edit this line) */\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */\r
+/* JavaCCOptions: */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+/** Token Manager Error. */\r
+public class TokenMgrError extends Error\r
+{\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /*\r
+ * Ordinals for various reasons why an Error of this type can be thrown.\r
+ */\r
+\r
+ /**\r
+ * Lexical error occurred.\r
+ */\r
+ static final int LEXICAL_ERROR = 0;\r
+\r
+ /**\r
+ * An attempt was made to create a second instance of a static token manager.\r
+ */\r
+ static final int STATIC_LEXER_ERROR = 1;\r
+\r
+ /**\r
+ * Tried to change to an invalid lexical state.\r
+ */\r
+ static final int INVALID_LEXICAL_STATE = 2;\r
+\r
+ /**\r
+ * Detected (and bailed out of) an infinite loop in the token manager.\r
+ */\r
+ static final int LOOP_DETECTED = 3;\r
+\r
+ /**\r
+ * Indicates the reason why the exception is thrown. It will have\r
+ * one of the above 4 values.\r
+ */\r
+ int errorCode;\r
+\r
+ /**\r
+ * Replaces unprintable characters by their escaped (or unicode escaped)\r
+ * equivalents in the given string\r
+ */\r
+ protected static final String addEscapes(String str) {\r
+ StringBuffer retval = new StringBuffer();\r
+ char ch;\r
+ for (int i = 0; i < str.length(); i++) {\r
+ switch (str.charAt(i))\r
+ {\r
+ case 0 :\r
+ continue;\r
+ case '\b':\r
+ retval.append("\\b");\r
+ continue;\r
+ case '\t':\r
+ retval.append("\\t");\r
+ continue;\r
+ case '\n':\r
+ retval.append("\\n");\r
+ continue;\r
+ case '\f':\r
+ retval.append("\\f");\r
+ continue;\r
+ case '\r':\r
+ retval.append("\\r");\r
+ continue;\r
+ case '\"':\r
+ retval.append("\\\"");\r
+ continue;\r
+ case '\'':\r
+ retval.append("\\\'");\r
+ continue;\r
+ case '\\':\r
+ retval.append("\\\\");\r
+ continue;\r
+ default:\r
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+ String s = "0000" + Integer.toString(ch, 16);\r
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+ } else {\r
+ retval.append(ch);\r
+ }\r
+ continue;\r
+ }\r
+ }\r
+ return retval.toString();\r
+ }\r
+\r
+ /**\r
+ * Returns a detailed message for the Error when it is thrown by the\r
+ * token manager to indicate a lexical error.\r
+ * Parameters :\r
+ * EOFSeen : indicates if EOF caused the lexical error\r
+ * curLexState : lexical state in which this error occurred\r
+ * errorLine : line number when the error occurred\r
+ * errorColumn : column number when the error occurred\r
+ * errorAfter : prefix that was seen before this error occurred\r
+ * curchar : the offending character\r
+ * Note: You can customize the lexical error message by modifying this method.\r
+ */\r
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {\r
+ return("Lexical error at line " +\r
+ errorLine + ", column " +\r
+ errorColumn + ". Encountered: " +\r
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +\r
+ "after : \"" + addEscapes(errorAfter) + "\"");\r
+ }\r
+\r
+ /**\r
+ * You can also modify the body of this method to customize your error messages.\r
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not\r
+ * of end-users concern, so you can return something like :\r
+ *\r
+ * "Internal Error : Please file a bug report .... "\r
+ *\r
+ * from this method for such cases in the release version of your parser.\r
+ */\r
+ public String getMessage() {\r
+ return super.getMessage();\r
+ }\r
+\r
+ /*\r
+ * Constructors of various flavors follow.\r
+ */\r
+\r
+ /** No arg constructor. */\r
+ public TokenMgrError() {\r
+ }\r
+\r
+ /** Constructor with message and reason. */\r
+ public TokenMgrError(String message, int reason) {\r
+ super(message);\r
+ errorCode = reason;\r
+ }\r
+\r
+ /** Full Constructor. */\r
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {\r
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);\r
+ }\r
+}\r
+/* JavaCC - OriginalChecksum=d047fc9c0c00c40e4d34a354929bb60c (do not edit this line) */\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012, 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.modelica;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+import java.util.Comparator;\r
+import java.util.HashMap;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+\r
+import org.simantics.sysdyn.representation.Book;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.Dependency;\r
+import org.simantics.sysdyn.representation.Enumeration;\r
+import org.simantics.sysdyn.representation.IElement;\r
+import org.simantics.sysdyn.representation.IndependentVariable;\r
+import org.simantics.sysdyn.representation.Input;\r
+import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.ModuleType;\r
+import org.simantics.sysdyn.representation.Sheet;\r
+import org.simantics.sysdyn.representation.Stock;\r
+import org.simantics.sysdyn.representation.Variable;\r
+import org.simantics.sysdyn.representation.expressions.DelayExpression;\r
+import org.simantics.sysdyn.representation.expressions.IExpression;\r
+\r
+/**\r
+ * ModelicaWriter writes Sysdyn model representations (objmap) into Modelica code.\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class ModelicaWriter {\r
+\r
+ /**\r
+ * Write a collection of configurations into a single Modelica code\r
+ * @param isGame \r
+ * \r
+ * @param Configurations Configurations, one main configuration and possible modules\r
+ * @return Complete Modelica code of a model\r
+ */\r
+ public static String write(Collection<Configuration> _configurations, double startTime, boolean isGame, String omVersion) {\r
+\r
+ ArrayList<Configuration> configurations = new ArrayList<Configuration>(_configurations);\r
+ Collections.sort(configurations, new Comparator<Configuration>() {\r
+\r
+ boolean uses(Configuration o1, Configuration o2) {\r
+ ModuleType type = o2.getModuleType();\r
+ if(type == null) return false;\r
+ for(IElement e : o1.getElements()) {\r
+ if(e instanceof Module) {\r
+ Module m = (Module)e;\r
+ if(m.getType().equals(type)) {\r
+ return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ @Override\r
+ public int compare(Configuration o1, Configuration o2) {\r
+ if(uses(o1, o2)) return 1;\r
+ else if(uses(o2, o1)) return -1;\r
+ else return 0;\r
+ }\r
+\r
+ });\r
+\r
+ Configuration modelConf = null;\r
+ for(Configuration conf : configurations) {\r
+ if(conf.getModel() != null) {\r
+ modelConf = conf;\r
+ }\r
+ }\r
+ StringBuilder b = new StringBuilder();\r
+\r
+ int spreadsheetlocation = b.length();\r
+\r
+ String modelName = modelConf.getLabel().replace(" ", "");\r
+ b.append("model " + modelName + "\n");\r
+\r
+ // Super class for enumerations\r
+ b.append("partial class Enumeration_class\n");\r
+ b.append(" parameter Integer size;\n");\r
+ b.append(" parameter Integer elements[:];\n");\r
+ b.append("end Enumeration_class;\n\n");\r
+\r
+ // find out which delays are used in the model and create the\r
+ // necessary classes\r
+ HashSet<Integer> delays = new HashSet<Integer>();\r
+ for (Configuration configuration : configurations) {\r
+ for (IElement element : configuration.getElements()) {\r
+ if (element instanceof IndependentVariable) {\r
+ for (IExpression expression : ((IndependentVariable)element).getExpressions()) {\r
+ if (expression instanceof DelayExpression) {\r
+ delays.add(((DelayExpression)expression).getOrder());\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ for (Integer i : delays) {\r
+ b.append(getDelayClass(i));\r
+ b.append("\n");\r
+ }\r
+\r
+ HashSet<String> sheetNames = new HashSet<String>();\r
+ for(Sheet sheet : getSpreadSheets(configurations))\r
+ sheetNames.add(sheet.getModelicaName());\r
+\r
+ // Write all module configurations to the declarations part (first)\r
+ for(Configuration conf : configurations) {\r
+ conf.setIsGameConfiguration(isGame);\r
+ if(!conf.equals(modelConf))\r
+ writeConfiguration(conf, sheetNames, startTime, b);\r
+ }\r
+\r
+ // Write model configuration last, so that equations-part does not contain module definitions\r
+ modelConf.setIsGameConfiguration(isGame);\r
+ writeConfiguration(modelConf, sheetNames, startTime, b);\r
+\r
+ b.append("end " + modelName + ";\n\n");\r
+\r
+ // Insert spreadsheets\r
+ if(omVersion != null && omVersion.startsWith("1.9")) {\r
+ b.insert(spreadsheetlocation, getGlobalSpreadSheets(configurations));\r
+ } else {\r
+ b.append(getGlobalSpreadSheets(configurations));\r
+ }\r
+\r
+ return b.toString();\r
+ }\r
+\r
+ /**\r
+ * Get all spreadsheets that are found in the model\r
+ * @param configurations\r
+ * @return\r
+ */\r
+ private static List<Sheet> getSpreadSheets(Collection<Configuration> configurations) {\r
+ for(Configuration conf : configurations) {\r
+ if(conf.getModel() != null) {\r
+ for(IElement e : conf.getElements()) {\r
+ if(e instanceof Book) {\r
+ return ((Book)e).getSheets();\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return Collections.emptyList();\r
+ }\r
+\r
+ /**\r
+ * \r
+ */\r
+ private static String getGlobalSpreadSheets(Collection<Configuration> configurations) {\r
+ StringBuilder sheets = new StringBuilder();\r
+ for(Configuration conf : configurations) {\r
+ if(conf.getModel() != null) {\r
+ for(IElement e : conf.getElements()) {\r
+ if(e instanceof Book) {\r
+ return ((Book)e).getBook();\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return sheets.toString();\r
+ }\r
+\r
+ /**\r
+ * Write a single configuration to a given string builder\r
+ * \r
+ * @param configuration Model or module configuration\r
+ * @param b String builder\r
+ */\r
+ private static void writeConfiguration(Configuration configuration, HashSet<String> sheetNames, double startTime, StringBuilder b) {\r
+ boolean defTime = true;\r
+ String app;\r
+\r
+ // Lists for storing different configuration elements\r
+ ArrayList<IndependentVariable> variables = new ArrayList<IndependentVariable>();\r
+ ArrayList<Input> inputs = new ArrayList<Input>();\r
+ ArrayList<Module> modules = new ArrayList<Module>();\r
+ ArrayList<Stock> stocks = new ArrayList<Stock>();\r
+ ArrayList<Enumeration> enumerations = new ArrayList<Enumeration>();\r
+ ArrayList<Dependency> inputDependencies = new ArrayList<Dependency>();\r
+ ArrayList<Dependency> outputDependencies = new ArrayList<Dependency>();\r
+ HashMap<String, ArrayList<Input>> moduleInputs = new HashMap<String, ArrayList<Input>>();\r
+\r
+ // Initialize lists\r
+ for(IElement element : configuration.getElements()) {\r
+ if(element instanceof IndependentVariable) {\r
+ // Normal variable\r
+ variables.add((IndependentVariable)element);\r
+ if(element instanceof Stock)\r
+ // Stock\r
+ stocks.add((Stock)element);\r
+ } else if (element instanceof Module) {\r
+ // Module\r
+ Module m = (Module)element; \r
+ modules.add(m);\r
+ moduleInputs.put(m.getModelicaName(), new ArrayList<Input>());\r
+ for(IElement e : m.getType().getConfiguration().getElements())\r
+ // Inputs inside the module\r
+ if(e instanceof Input && !((Input)e).isHeadOfDependency()) {\r
+ moduleInputs.get(m.getModelicaName()).add((Input)e);\r
+ }\r
+ } else if (element instanceof Input) {\r
+ // Input variables\r
+ inputs.add((Input)element);\r
+ } else if (element instanceof Enumeration) {\r
+ // Enumerations\r
+ enumerations.add((Enumeration)element);\r
+ } else if (element instanceof Dependency) {\r
+ Dependency dependency = (Dependency)element;\r
+ if(dependency.getHead() instanceof Module) {\r
+ // References given to child modules\r
+ outputDependencies.add(dependency);\r
+ } else if(dependency.getTail() instanceof Module){\r
+ // References from child modules\r
+ inputDependencies.add(dependency);\r
+ }\r
+ }\r
+ }\r
+\r
+ // Setup input references. (Input, String reference to another variable)\r
+ HashMap<Input, String> inputReferences = new HashMap<Input, String>();\r
+ setupInputReferences(inputReferences, inputDependencies);\r
+\r
+\r
+ // If the configuration is model configuration, use model name. Otherwise, use configuration name.\r
+ ModuleType mt = configuration.getModuleType();\r
+\r
+ // className == null, if this is a model configuration. model configuration start and end are written in ModelicaWriter.write\r
+ String className = mt != null ? (mt.getModelicaName()) : null;\r
+\r
+ if(className != null)\r
+ b.append("class "+className+"\n");\r
+\r
+ // Add spreadsheets to all modules and model. Model is "inner" and modules "outer"\r
+ String globalStatus = mt != null ? "outer" : "inner";\r
+ for(String sheetName : sheetNames)\r
+ b.append(" " + globalStatus + " " + sheetName + "_class" + " "+ sheetName + ";\n");\r
+\r
+ if(!enumerations.isEmpty()) {\r
+ b.append("// Enumeration definitions\n");\r
+ for(Enumeration e : enumerations) {\r
+ b.append(e.getDeclaration());\r
+ }\r
+ }\r
+\r
+ b.append("// Variable definitions\n");\r
+ for(IndependentVariable variable : variables) {\r
+ app = variable.getDeclaration();\r
+ if (app != null) {\r
+ b.append(app);\r
+ }\r
+ }\r
+\r
+ if(defTime) {\r
+ // Time variable for FMU (game) simulations\r
+ if(configuration.isGameConfiguration()) {\r
+ if(configuration.getModel() != null)\r
+ // Parameter for model root. Values changed in FMU simulator\r
+ b.append(" parameter Real time = " + startTime + ";\n");\r
+ else\r
+ // Continuous variable for module instances\r
+ b.append(" Real time;\n");\r
+\r
+ }\r
+ }\r
+\r
+ if(!modules.isEmpty()) {\r
+ b.append("// Module definitions\n");\r
+ for(Module m : modules) {\r
+ b.append(m.getDeclaration());\r
+ }\r
+ }\r
+\r
+\r
+ // Input definitions\r
+ inputDefinitions(b, configuration, inputs, inputReferences);\r
+\r
+ boolean initialEquations = false;\r
+ for(Stock stock : stocks) {\r
+ app = stock.getInitialEquation();\r
+ if (app != null) {\r
+ if(initialEquations == false) {\r
+ initialEquations = true;\r
+ b.append("// Initial Equations\n");\r
+ b.append("initial equation\n");\r
+ }\r
+ b.append(app);\r
+ }\r
+ }\r
+\r
+ boolean equation = false;\r
+ b.append("// Equations\n");\r
+ for(IndependentVariable variable : variables) {\r
+ app = variable.getEquation();\r
+ if (app != null) {\r
+ if(!equation) {\r
+ b.append("equation\n");\r
+ equation = true;\r
+ }\r
+\r
+ b.append(app);\r
+ }\r
+ }\r
+\r
+ // If "equation" has not been added but there are still equations to be defined, add "equation"\r
+ if(!equation && (!inputReferences.isEmpty() || !outputDependencies.isEmpty() ||\r
+ !moduleInputs.isEmpty() || !modules.isEmpty()))\r
+ b.append("equation\n");\r
+\r
+ // Continuous input references\r
+ continuousInputReferences(b, inputReferences);\r
+\r
+ b.append("// Outputs\n");\r
+ for(Dependency dependency : outputDependencies) {\r
+ Variable variable = (Variable)dependency.getTail();\r
+ Module module = (Module)dependency.getHead();\r
+ Input reference = (Input)dependency.refersTo();\r
+ if(reference != null && reference.getName() != null && (reference.getVariability() == null || reference.getVariability().isEmpty())) {\r
+ b.append(" " + module.getModelicaName() + "." + reference.getModelicaName() + " = " + variable.getModelicaName() + ";\n");\r
+ moduleInputs.get(module.getModelicaName()).remove(reference);\r
+ }\r
+ }\r
+\r
+ b.append("// Default values for inputs in modules\n");\r
+ for(String moduleLabel : moduleInputs.keySet()) {\r
+ for(Input input : moduleInputs.get(moduleLabel)) {\r
+ if(input.getVariability() == null || input.getVariability().isEmpty())\r
+ b.append(" " + moduleLabel + "." + input.getModelicaName() + " = " + input.getDefaultInputValue(moduleLabel) + ";\n");\r
+ }\r
+ }\r
+\r
+ if(defTime) {\r
+ if(configuration.isGameConfiguration() && !modules.isEmpty()) {\r
+ b.append("// Time values for module\n");\r
+ for(Module m : modules) {\r
+ b.append(" " + m.getModelicaName() + ".time = time;\n");\r
+ }\r
+ }\r
+ }\r
+\r
+ if(className != null)\r
+ b.append("end ").append(className).append(";\n\n");\r
+\r
+ }\r
+\r
+ /**\r
+ * Define continuous input references\r
+ * @param b String builder\r
+ * @param inputReferences Input references\r
+ */\r
+ private static void continuousInputReferences(StringBuilder b, HashMap<Input, String> inputReferences) {\r
+ b.append("// Inputs\n");\r
+ for(Input i : inputReferences.keySet()) {\r
+ if(i.getVariability() == null || i.getVariability().isEmpty()) {\r
+ // Define only continuous variables here\r
+ b.append(" " + i.getModelicaName() + " = " + inputReferences.get(i));\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Setup input references for all inputs that are defined in child modules\r
+ * \r
+ * @param inputReferences Map containing the references\r
+ * @param inputDependencies List of input dependencies\r
+ */\r
+ private static void setupInputReferences(HashMap<Input, String> inputReferences, ArrayList<Dependency> inputDependencies) {\r
+ for(Dependency dependency : inputDependencies) {\r
+ Input input = (Input)dependency.getHead();\r
+ Module module = (Module)dependency.getTail();\r
+ Variable reference = (Variable)dependency.refersTo();\r
+ String expression;\r
+ // If reference exists, use reference name. Otherwise, use default value.\r
+ if(reference != null && reference.getName() != null)\r
+ expression = module.getModelicaName() + "." + reference.getModelicaName() + ";\n";\r
+\r
+ else\r
+ expression = input.getDefaultInputValue() + ";\n";\r
+\r
+ inputReferences.put(input, expression);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Build input definitions\r
+ * \r
+ * @param b String builder\r
+ * @param configuration Module configuration\r
+ * @param inputs All inputs of this module\r
+ * @param inputReferences \r
+ */\r
+ private static void inputDefinitions(StringBuilder b, Configuration configuration, ArrayList<Input> inputs, HashMap<Input, String> inputReferences) {\r
+ if(inputs.isEmpty())\r
+ return;\r
+\r
+ b.append("// Input definitions\n");\r
+ for(Input i : inputs) {\r
+ if(i.getVariability() != null && !i.getVariability().isEmpty()) {\r
+ // Input is NOT continuous\r
+ if(inputReferences.containsKey(i)) {\r
+ // Input is defined in a child module\r
+ String declaration = i.getDeclaration();\r
+ declaration = declaration.substring(0, declaration.length() - 2); // remove ";\n" from the end\r
+ b.append(declaration + " = " + inputReferences.get(i));\r
+ } else {\r
+ // Input is not defined in a child module, use default value\r
+ b.append(i.getDeclarationWithValue());\r
+ }\r
+ } else if(configuration.getModel() != null && !i.isHeadOfDependency()) {\r
+ /*\r
+ * Input is in the top of the hierarchy, \r
+ * and it does not get value from anywhere else.\r
+ * => Declare it wit its default value \r
+ */\r
+ b.append(i.getDeclarationWithValue());\r
+ } else {\r
+ // Continuous => Parent module takes care of declaring a value for the input\r
+ b.append(i.getDeclaration());\r
+ }\r
+ }\r
+ }\r
+\r
+ public String escape(String name) {\r
+ return name.replace(' ', '_');\r
+ }\r
+ \r
+ public static final String DELAY_TIME = "delayTime";\r
+ public static final String DELAY_INITIAL = "initialValue";\r
+\r
+ private static String getDelayClass(int order) {\r
+ StringBuilder buffer = new StringBuilder();\r
+\r
+ buffer.append("class " + getDelayName(order) + "\n");\r
+\r
+ // variable block\r
+\r
+ // (possibly) continuous auxiliary variable\r
+ buffer.append("\tReal DL;\n");\r
+ // (possibly) continuous delay time\r
+ buffer.append("\tReal " + DELAY_TIME + ";\n");\r
+ // (possibly) continuous initial value\r
+ buffer.append("\tReal " + DELAY_INITIAL + ";\n");\r
+\r
+ // first valve\r
+ buffer.append("\tReal " + getDelayValve(0) + ";\n");\r
+\r
+ // stocks and valves, valves are delayed values of the variable\r
+ for (int i = 1; i <= order; i++) {\r
+ buffer.append("\tReal LV"+i + "(fixed=false);\n");\r
+ buffer.append("\tReal "+ getDelayValve(i) + ";\n");\r
+ }\r
+\r
+ // initial equation block\r
+ buffer.append("initial equation\n");\r
+\r
+ // Each stock gets the same initial value\r
+ for (int i = 1; i <= order; i++) {\r
+ buffer.append("\tLV"+i + " = DL * " + DELAY_INITIAL + ";\n");\r
+ }\r
+\r
+ // equation block\r
+ buffer.append("equation\n");\r
+ \r
+ buffer.append("\tDL = " + DELAY_TIME + " / "+order+";\n");\r
+\r
+ // valves and stocks\r
+ for (int i = 1; i <= order; i++) {\r
+ buffer.append("\tder(LV"+i + ") = - " + getDelayValve(i) + " + " + getDelayValve(i-1) + ";\n");\r
+ buffer.append("\t"+ getDelayValve(i) + " = LV"+i + " / DL;\n");\r
+ }\r
+\r
+ buffer.append("end ");\r
+ buffer.append(getDelayName(order));\r
+ buffer.append(";\n");\r
+\r
+ return buffer.toString();\r
+ }\r
+\r
+ public static String getDelayName(int order) {\r
+ return "order_"+order+"_delay";\r
+ }\r
+ \r
+ public static String getDelayValve(int order) {\r
+ return "delay"+order;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.refactoring;\r
+\r
+import gnu.trove.set.hash.TIntHashSet;\r
+\r
+import java.io.BufferedReader;\r
+import java.io.File;\r
+import java.io.FileReader;\r
+import java.io.IOException;\r
+import java.net.URLDecoder;\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.databoard.container.DataContainer;\r
+import org.simantics.databoard.container.DataContainers;\r
+import org.simantics.graph.query.Path;\r
+import org.simantics.graph.query.TransferableGraphConversion;\r
+import org.simantics.graph.query.UriUtils;\r
+import org.simantics.graph.refactoring.GraphRefactoringUtils;\r
+import org.simantics.graph.refactoring.MappingSpecification;\r
+import org.simantics.graph.refactoring.MappingSpecification.MappingRule;\r
+import org.simantics.graph.representation.TransferableGraph1;\r
+import org.simantics.graph.store.IdentityStore;\r
+\r
+public class TGRefactoring {\r
+ \r
+ public static void main(String[] args) throws Exception {\r
+ // Select the directory where this file is\r
+ File dir = new File(URLDecoder.decode(TGRefactoring.class.getResource(".").getPath(), "UTF-8")).getAbsoluteFile();\r
+ System.out.println(dir);\r
+ \r
+ // Choose input and output files for refactoring. Files are relative to the selected directory.\r
+ File input = new File(dir, "ServiceModel_2012-08-28b.tg"); // use your own file names\r
+ File mappingSpec = new File(dir, "mappingSpec.txt");\r
+ File output = new File(dir, "ServiceModel_2012-08-28b-refactored.tg");\r
+\r
+ // Get a map containing the changed names \r
+ \r
+ // Read input file \r
+ DataContainer dc = DataContainers.readFile(input);\r
+ \r
+ // Get transferable graph from the input file\r
+ TransferableGraph1 tg1 = (TransferableGraph1) dc.content.getValue(TransferableGraph1.BINDING);\r
+ \r
+ MappingSpecification spec = readMappingSpec(mappingSpec);\r
+ boolean fixed = GraphRefactoringUtils.fixIncorrectRoot(tg1.identities);\r
+ IdentityStore idStore = TransferableGraphConversion.extractIdentities(tg1);\r
+ TIntHashSet parentsAffected = new TIntHashSet(); \r
+ GraphRefactoringUtils.refactor(tg1, idStore, spec, parentsAffected);\r
+ tg1.resourceCount = idStore.getResourceCount();\r
+ tg1.identities = idStore.toArray();\r
+// GraphRefactoringUtils.compactify(tg1, parentsAffected);\r
+ if(fixed)\r
+ GraphRefactoringUtils.unfixIncorrectRoot(tg1.identities);\r
+ \r
+ // Rewrite DataContainer content\r
+ dc.content = new Variant(TransferableGraph1.BINDING, tg1);\r
+ \r
+ // Write the refactored graph to output file\r
+ DataContainers.writeFile(output, dc);\r
+ }\r
+ \r
+ private static MappingSpecification readMappingSpec(File mappingSpec) throws IOException {\r
+ BufferedReader reader = new BufferedReader(new FileReader(mappingSpec));\r
+ ArrayList<MappingRule> rules = new ArrayList<MappingRule>();\r
+ while(true) {\r
+ String line = reader.readLine();\r
+ if(line == null)\r
+ break;\r
+ line = line.trim();\r
+ if(line.isEmpty())\r
+ continue;\r
+ String[] parts = line.trim().split(" ");\r
+ if(parts.length == 2) {\r
+ Path from = UriUtils.uriToPath(parts[0]);\r
+ Path to = UriUtils.uriToPath(parts[1]);\r
+ rules.add(new MappingRule(from, to));\r
+ } else {\r
+ if(line.trim().startsWith("//") || (line.trim().startsWith("/*") && line.trim().endsWith("/*"))) {\r
+ // Comment \r
+ } else {\r
+ reader.close();\r
+ throw new IOException("Invalid mapping spec format. Every non-empty line should contain two URIs or comment");\r
+ }\r
+ }\r
+ }\r
+ reader.close();\r
+ \r
+ return new MappingSpecification(rules);\r
+ }\r
+ \r
+}\r
--- /dev/null
+\r
+// 4.9.2012 ontology changes\r
+http://www.simantics.org/Layer0-1.0 http://www.simantics.org/Layer0-1.1\r
+http://www.simantics.org/Layer0X-1.0 http://www.simantics.org/Layer0X-1.1\r
+http://www.simantics.org/G2D-1.0 http://www.simantics.org/G2D-1.1\r
+http://www.simantics.org/Structural-1.0 http://www.simantics.org/Structural-1.2\r
+http://www.simantics.org/Diagram-2.1 http://www.simantics.org/Diagram-2.2\r
+http://www.simantics.org/Simulation-1.0 http://www.simantics.org/Simulation-1.1\r
+http://www.simantics.org/Modeling-1.1 http://www.simantics.org/Modeling-1.2\r
+http://www.simantics.org/Project-1.1 http://www.simantics.org/Project-1.2\r
+http://www.simantics.org/Spreadsheet-1.1 http://www.simantics.org/Spreadsheet-1.2\r
+http://www.simantics.org/Viewpoint-1.1 http://www.simantics.org/Viewpoint-1.2\r
+http://www.simantics.org/Image2-1.1 http://www.simantics.org/Image2-1.2\r
+http://www.simantics.org/Color-1.0 http://www.simantics.org/Color-1.1\r
+http://www.simantics.org/Action-1.0 http://www.simantics.org/Action-1.1\r
+http://www.simantics.org/Silk-1.0 http://www.simantics.org/Silk-1.1\r
+http://www.simantics.org/Issue-1.1 http://www.simantics.org/Issue-1.2\r
+http://www.simantics.org/User-1.0 http://www.simantics.org/User-1.1\r
+http://www.simantics.org/Documentation-1.0 http://www.simantics.org/Documentation-1.1\r
+http://www.simantics.org/Document-1.1 http://www.simantics.org/Document-1.2\r
+http://www.simantics.org/SelectionView-1.1 http://www.simantics.org/SelectionView-1.2\r
+\r
+// Spreadsheet changes\r
+http://www.simantics.org/Spreadsheet-1.2/HasContent http://www.simantics.org/Spreadsheet-1.2/Cell/content\r
+http://www.simantics.org/Spreadsheet-1.2/FitRows http://www.simantics.org/Spreadsheet-1.2/Dimensions/fitRows\r
+http://www.simantics.org/Spreadsheet-1.2/FitColumns http://www.simantics.org/Spreadsheet-1.2/Dimensions/fitColumns\r
+http://www.simantics.org/Spreadsheet-1.2/ColumnCount http://www.simantics.org/Spreadsheet-1.2/Dimensions/columnCount\r
+http://www.simantics.org/Spreadsheet-1.2/ColumnLabels http://www.simantics.org/Spreadsheet-1.2/Headers/columnLabels\r
+http://www.simantics.org/Spreadsheet-1.2/RowCount http://www.simantics.org/Spreadsheet-1.2/Dimensions/rowCount\r
+http://www.simantics.org/Spreadsheet-1.2/ColumnWidths http://www.simantics.org/Spreadsheet-1.2/Headers/columnWidths\r
+\r
+http://www.simantics.org/Spreadsheet-1.2/ContentOf http://www.simantics.org/Spreadsheet-1.2/Cell/content/Inverse \r
+http://www.simantics.org/Spreadsheet-1.2/FitRowsOf http://www.simantics.org/Spreadsheet-1.2/Dimensions/fitRows/Inverse\r
+http://www.simantics.org/Spreadsheet-1.2/FitColumnsOf http://www.simantics.org/Spreadsheet-1.2/Dimensions/fitColumns/Inverse\r
+http://www.simantics.org/Spreadsheet-1.2/ColumnCountOf http://www.simantics.org/Spreadsheet-1.2/Dimensions/columnCount/Inverse\r
+http://www.simantics.org/Spreadsheet-1.2/ColumnLabelsOf http://www.simantics.org/Spreadsheet-1.2/Headers/columnLabels/Inverse\r
+http://www.simantics.org/Spreadsheet-1.2/RowCountOf http://www.simantics.org/Spreadsheet-1.2/Dimensions/rowCount/Inverse\r
+http://www.simantics.org/Spreadsheet-1.2/ColumnWidthsOf http://www.simantics.org/Spreadsheet-1.2/Headers/columnWidths/Inverse
\ No newline at end of file
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(SysdynResource.URIs.Auxiliary)\r
+public class Auxiliary extends IndependentVariable {\r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this);\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElements;\r
+import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(SpreadsheetResource.URIs.Book)\r
+public class Book extends Variable {\r
+ \r
+ @RelatedElements(\r
+ value = Layer0.URIs.ConsistsOf,\r
+ composition = true)\r
+ private ArrayList<Sheet> sheets = new ArrayList<Sheet>();\r
+\r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this); \r
+ }\r
+ \r
+ public List<Sheet> getSheets() {\r
+ return sheets;\r
+ }\r
+ \r
+ public String markBook() {\r
+ return "BOOK " + this.getName();\r
+ }\r
+ \r
+ public String getBook() {\r
+ StringBuilder book = new StringBuilder();\r
+ \r
+// book.append("partial class SpreadSheetBook\n");\r
+ \r
+ for(Sheet sheet : sheets) \r
+ book.append(sheet.getStringRepresentation());\r
+ \r
+// book.append("end SpreadSheetBook;");\r
+ \r
+ return book.toString();\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(SysdynResource.URIs.Cloud)\r
+public class Cloud implements IElement {\r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this);\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.RelatedElements;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Representation of a model or module configuration \r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.Configuration)\r
+public class Configuration {\r
+ \r
+ @RelatedValue(Layer0.URIs.HasName)\r
+ private String name;\r
+\r
+ @RelatedValue(Layer0.URIs.HasLabel)\r
+ private String label;\r
+ \r
+ /**\r
+ * Not null if configuration of a module\r
+ */\r
+ @RelatedElement(StructuralResource2.URIs.Defines)\r
+ private ModuleType moduleType;\r
+\r
+ /**\r
+ * Not null if is configuration of a model\r
+ */\r
+ @RelatedElement(SimulationResource.URIs.IsConfigurationOf)\r
+ private Model model;\r
+ \r
+ @RelatedElements(\r
+ value = Layer0.URIs.ConsistsOf,\r
+ composition = true)\r
+ private ArrayList<IElement> elements = new ArrayList<IElement>();\r
+\r
+ private boolean isGameConfiguration = false;\r
+ \r
+ public void setIsGameConfiguration(boolean isGame) {\r
+ this.isGameConfiguration = isGame;\r
+ }\r
+ \r
+ public boolean isGameConfiguration() {\r
+ return this.isGameConfiguration;\r
+ }\r
+\r
+ /**\r
+ * Get all elements of this configuration. Also all sheets from books are included.\r
+ * @return\r
+ */\r
+ public ArrayList<IElement> getElements() {\r
+ ArrayList<IElement> elements = new ArrayList<IElement>();\r
+ elements.addAll(this.elements);\r
+ for(IElement e : this.elements) {\r
+ if(e instanceof Book) {\r
+ elements.addAll(((Book)e).getSheets());\r
+ }\r
+ }\r
+ return elements;\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public String getLabel() {\r
+ return label != null ? label : name;\r
+ }\r
+ \r
+ public ModuleType getModuleType() {\r
+ return moduleType;\r
+ }\r
+ \r
+ public Model getModel() {\r
+ return model;\r
+ }\r
+ \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(SysdynResource.URIs.Dependency)\r
+public class Dependency implements IElement {\r
+ @RelatedElement(SysdynResource.URIs.Variable_HasTail)\r
+ private IElement tail;\r
+ @RelatedElement(SysdynResource.URIs.Variable_HasHead)\r
+ private IElement head;\r
+ @RelatedElement(SysdynResource.URIs.Dependency_refersTo)\r
+ private IElement refersTo;\r
+ \r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this); \r
+ }\r
+ \r
+ public IElement getTail() {\r
+ return this.tail;\r
+ }\r
+ \r
+ public IElement getHead() {\r
+ return this.head;\r
+ }\r
+ \r
+ public IElement refersTo() {\r
+ return this.refersTo;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.diagram.stubs.DiagramResource;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(DiagramResource.URIs.DiagramContainer)\r
+public class DiagramContainerDummy implements IElement {\r
+ \r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this); \r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+/**\r
+ * Dummy class representing any entity.\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+@GraphType(Layer0.URIs.Entity)\r
+public class Entity implements IElement {\r
+\r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElements;\r
+import org.simantics.objmap.annotations.RelatedListElements;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(SysdynResource.URIs.Enumeration)\r
+public class Enumeration extends Variable {\r
+ \r
+ @RelatedListElements(SysdynResource.URIs.Enumeration_enumerationIndexList)\r
+ private ArrayList<EnumerationIndex> enumerationIndexes = new ArrayList<EnumerationIndex>();\r
+ \r
+ @RelatedValue(SysdynResource.URIs.Enumeration_isReplaceable)\r
+ private Boolean isReplaceable;\r
+ \r
+ @RelatedElements(\r
+ value = SysdynResource.URIs.Redeclaration_replacedEnumeration_Inverse,\r
+ composition = true)\r
+ private ArrayList<Redeclaration> redeclarations = new ArrayList<Redeclaration>();\r
+\r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this); \r
+ }\r
+ \r
+ public String getDeclaration() {\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append(getEnumerationClassDefinition());\r
+ sb.append(" ");\r
+ sb.append(getModelicaName() + "_class");\r
+ sb.append(" " + getModelicaName());\r
+ sb.append(";\n");\r
+ \r
+ sb.append(" parameter Integer " + getModelicaName() + "_size = " + getModelicaName() + ".size;\n");\r
+ sb.append(" parameter Integer " + getModelicaName() + "_elements[:] = " + getModelicaName() + ".elements;\n");\r
+ return sb.toString();\r
+ }\r
+ \r
+ public ArrayList<EnumerationIndex> getEnumerationIndexes() {\r
+ return enumerationIndexes;\r
+ }\r
+ \r
+ public boolean isReplaceable() {\r
+ return Boolean.TRUE.equals(isReplaceable);\r
+ }\r
+ \r
+ public String getEnumerationClassDefinition() {\r
+ \r
+ // Build indexes (one = 1, two = 2, etc..) and elements {1,2,3,..,size}\r
+ ArrayList<EnumerationIndex> indexes = getEnumerationIndexes();\r
+ StringBuilder elementsBuilder = new StringBuilder();\r
+ elementsBuilder.append("{");\r
+ StringBuilder indexesBuilder = new StringBuilder();\r
+ for(int i = 1; i <= indexes.size(); i++) {\r
+ indexesBuilder.append(" constant Integer ");\r
+ indexesBuilder.append(indexes.get(i - 1).getModelicaName());\r
+ indexesBuilder.append(" = " + i + ";\n");\r
+ \r
+ elementsBuilder.append(i);\r
+ if(i < indexes.size())\r
+ elementsBuilder.append(",");\r
+ }\r
+ elementsBuilder.append("}");\r
+ \r
+ /*\r
+ * class E_class\r
+ * extends Enumeration_class(size = n, elements = {1,2,3,..n});\r
+ * constant Integer index1 = 1;\r
+ * constant Integer index2 = 2;\r
+ * ....\r
+ * constant Integer indexn = n;\r
+ * end E_class;\r
+ */\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append(" class ");\r
+ sb.append(getModelicaName());\r
+ sb.append("_class\n");\r
+ sb.append(" extends Enumeration_class(size=");\r
+ sb.append(indexes.size());\r
+ sb.append(", elements=");\r
+ sb.append(elementsBuilder);\r
+ sb.append(");\n");\r
+ sb.append(indexesBuilder);\r
+ sb.append(" end ");\r
+ sb.append(getModelicaName());\r
+ sb.append("_class;\n");\r
+ \r
+ return sb.toString();\r
+ }\r
+ \r
+ public ArrayList<Redeclaration> getRedeclarations() {\r
+ return redeclarations;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+@GraphType(SysdynResource.URIs.EnumerationIndex)\r
+public class EnumerationIndex {\r
+\r
+ @RelatedValue(Layer0.URIs.HasName)\r
+ protected String name;\r
+ \r
+ public String getName() {\r
+ return this.name;\r
+ }\r
+ \r
+ /**\r
+ * Get Modelica compliant name\r
+ * @return The name of this variable with spaces (' ') replaced with \r
+ * underscore characters ('_')\r
+ */\r
+ public String getModelicaName() {\r
+ if (this.name == null)\r
+ return null;\r
+ return this.name.replace(' ', '_');\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(SysdynResource.URIs.Flow)\r
+public class Flow implements IElement {\r
+ @RelatedElement(SysdynResource.URIs.Variable_HasTail)\r
+ private IElement tail;\r
+ @RelatedElement(SysdynResource.URIs.Variable_HasHead)\r
+ private IElement head;\r
+ \r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this); \r
+ }\r
+ \r
+ public IElement getTail() {\r
+ return this.tail;\r
+ }\r
+ \r
+ public IElement getHead() {\r
+ return this.head;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.objmap.annotations.UpdateMethod;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Representation of a function\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.SysdynModelicaFunction)\r
+public class Function {\r
+\r
+ @RelatedValue(Layer0.URIs.HasName)\r
+ private String name;\r
+\r
+ @RelatedValue(SysdynResource.URIs.SysdynModelicaFunction_modelicaFunctionCode)\r
+ private String code;\r
+\r
+ private boolean hasTimeReference = false;\r
+\r
+ public String getCode() {\r
+ return \r
+ "function " + name + "\n" +\r
+ code +\r
+ "end " + name + ";\n";\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ /**\r
+ * Keep track if the function contains references to time. If there is a reference to time, \r
+ * the variables calling this function cannot be parameters or constants.\r
+ * \r
+ * @param g ReadGraph\r
+ * @param r Function resource\r
+ * @return\r
+ * @throws DatabaseException\r
+ */\r
+ @UpdateMethod\r
+ public boolean update(ReadGraph g, Resource r) throws DatabaseException {\r
+ hasTimeReference = false;\r
+\r
+ String code = g.getPossibleRelatedValue(r, SysdynResource.getInstance(g).SysdynModelicaFunction_modelicaFunctionCode);\r
+ if(code == null)\r
+ return true;\r
+ \r
+ String[] elements = code.split("[\\+\\-\\*\\/\\(\\)\\[\\]\\{\\}=;\\s]");\r
+ for(String element : elements) {\r
+ if("time".equals(element)) {\r
+ hasTimeReference = true;\r
+ break;\r
+ }\r
+ }\r
+ return true;\r
+ }\r
+\r
+ public boolean hasTimeReference() {\r
+ return hasTimeReference;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElements;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+/**\r
+ * Representation of a function library\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.SysdynModelicaFunctionLibrary)\r
+public class FunctionLibrary {\r
+ \r
+ @RelatedValue(Layer0.URIs.HasName)\r
+ private String name;\r
+\r
+ @RelatedElements(\r
+ value = Layer0.URIs.ConsistsOf,\r
+ composition = true)\r
+ private ArrayList<Object> elements = new ArrayList<Object>();\r
+\r
+ /**\r
+ * Get all functions inside this library. (sub-libraries excluded)\r
+ * @return\r
+ */\r
+ public ArrayList<Function> getFunctions() {\r
+ ArrayList<Function> functions = new ArrayList<Function>();\r
+ if(elements != null) {\r
+ for(Object element : elements) {\r
+ if(element instanceof Function)\r
+ functions.add((Function)element);\r
+ }\r
+ }\r
+ return functions;\r
+ }\r
+ \r
+ /**\r
+ * Get all function libraries included in this library\r
+ * @return All function libraries included in this library\r
+ */\r
+ public ArrayList<FunctionLibrary> getLibraries() {\r
+ ArrayList<FunctionLibrary> libraries = new ArrayList<FunctionLibrary>();\r
+ if(elements != null) {\r
+ for(Object element : elements) {\r
+ if(element instanceof FunctionLibrary)\r
+ libraries.add((FunctionLibrary)element);\r
+ }\r
+ }\r
+ return libraries;\r
+ }\r
+ \r
+ /**\r
+ * Get the name of this library\r
+ * @return The name of this library\r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+public interface IElement {\r
+ void accept(IElementVisitorVoid v);\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Iterator;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.objmap.annotations.RelatedElements;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.expressions.IExpression;\r
+import org.simantics.sysdyn.representation.expressions.ParameterExpression;\r
+import org.simantics.sysdyn.representation.expressions.StockExpression;\r
+import org.simantics.sysdyn.representation.utils.FormatUtils;\r
+\r
+/**\r
+ * Representation of an independent variable\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public abstract class IndependentVariable extends Variable {\r
+ \r
+ @RelatedElements(\r
+ value = SysdynResource.URIs.Variable_isHeadOf,\r
+ composition = true)\r
+ private ArrayList<IElement> isHeadOf = new ArrayList<IElement>();\r
+\r
+ /**\r
+ * Get the declaration of this variable\r
+ * @return Declaration of this variable\r
+ */\r
+ public String getDeclaration() {\r
+ Variability variability = Variability.getVariability(this);\r
+\r
+ // [variability] type name[range]\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append(" ");\r
+ sb.append(variability.getText().isEmpty() ? "" : variability.getText() + " ");\r
+ sb.append(getType() + " ");\r
+ sb.append(getModelicaName());\r
+ sb.append(getRange());\r
+\r
+ // [= expression]\r
+ if(variability == Variability.PARAMETER || variability == Variability.CONSTANT) {\r
+ // parameters and constants are guaranteed to have only one expression\r
+ String expression = getExpressions().get(0).getExpression();\r
+ expression = FormatUtils.replaceWhitespace(expression);\r
+ String equation = FormatUtils.formatExpressionForModelica(this, expression);\r
+ sb.append(" = " + equation);\r
+ }\r
+\r
+ // ;\n\r
+ sb.append(";\n");\r
+ \r
+ // Possible additions to expressions. e.g. helper classes and variables\r
+ if(getExpressions() != null) {\r
+ for(IExpression e : getExpressions()) {\r
+ String addition = e.getDeclarationAddition();\r
+ if(addition != null)\r
+ sb.append(addition);\r
+ }\r
+ }\r
+ \r
+ return sb.toString();\r
+ }\r
+\r
+ /**\r
+ * Get the range of this variable, if it is an array variable. \r
+ * <p>\r
+ * Format: [EnumerationName.size (, Enumeration2Name.size)*] \r
+ * @return Range of this variable, if it is an array variable. Empty string otherwise.\r
+ */\r
+ public String getRange() {\r
+ ArrayList<Enumeration> enumerations = getArrayIndexes();\r
+ String range = "";\r
+ if(enumerations != null && enumerations.size() > 0) {\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("[");\r
+ Iterator<Enumeration> iterator = enumerations.iterator();\r
+ while(iterator.hasNext()) {\r
+ sb.append(iterator.next().getModelicaName() + ".size");\r
+ if(iterator.hasNext()) {\r
+ sb.append(", ");\r
+ }\r
+ }\r
+ sb.append("]");\r
+ range = sb.toString();\r
+ }\r
+ return range;\r
+ }\r
+\r
+ /**\r
+ * Get all initial equations or null, if there are no initial equations.\r
+ * @return Initial equations as string or null.\r
+ */\r
+ public String getInitialEquation() {\r
+ StringBuilder sb = new StringBuilder(); \r
+\r
+ for(IExpression expression : getExpressions()) {\r
+ String initialEquation = expression.getInitialEquation();\r
+ if(initialEquation != null)\r
+ sb.append(initialEquation);\r
+ }\r
+ \r
+ String result = sb.toString();\r
+ return result.length() > 0 ? result : null;\r
+ }\r
+\r
+ /**\r
+ * Get the equation of this variable for equation block. Null is returned if this variable is not continuous.\r
+ * @return Equation or null\r
+ */\r
+ public String getEquation() {\r
+ if(Variability.getVariability(this) == Variability.CONTINUOUS) {\r
+ return getVariableEquation();\r
+ } else {\r
+ return null;\r
+ }\r
+\r
+ }\r
+\r
+ /**\r
+ * Combines all possible equations for this variable. Array variables can have multiple equations.\r
+ * @return equations or null\r
+ */\r
+ protected String getVariableEquation() {\r
+ if(this.expressions == null || this.expressions.isEmpty())\r
+ return null;\r
+ \r
+ ArrayList<IExpression> expressions = getExpressions();\r
+ ArrayList<Enumeration> enumerations = getArrayIndexes();\r
+ IExpression firstExpression = expressions.get(0);\r
+ if(enumerations == null || enumerations.size() < 1) {\r
+ if(firstExpression == null)\r
+ return null;\r
+ else\r
+ return firstExpression.getEquation();\r
+ } else {\r
+ // ARRAY variable. Create all equations for the variable\r
+ StringBuilder sb = new StringBuilder(); \r
+ for(IExpression expression : expressions) {\r
+ sb.append(expression.getEquation());\r
+ }\r
+ return sb.toString();\r
+ }\r
+ }\r
+ \r
+ public ArrayList<IElement> getIncomingDependencies() {\r
+ return isHeadOf;\r
+ }\r
+ \r
+ @Override\r
+ public String getDocumentationDefinition(ReadGraph graph) throws DatabaseException {\r
+ String declaration = getDeclaration();\r
+ String initialEquation = getInitialEquation();\r
+ \r
+ StringBuilder result = new StringBuilder();\r
+ \r
+ if(declaration != null && declaration.length() > 0 && declaration.contains("=")) {\r
+ result.append("<p>");\r
+ if(getExpressions().size() > 1)\r
+ result.append(formatForHTML(declaration));\r
+ if(this instanceof Stock)\r
+ result.append(formatForHTML(declaration.substring(declaration.indexOf("(") + 1, declaration.lastIndexOf(")"))));\r
+ else\r
+ result.append(formatForHTML(declaration.substring(declaration.indexOf("=") + 1)));\r
+ result.append("</p>");\r
+ }\r
+ \r
+ result.append("<p>");\r
+ for(IExpression exp : getExpressions()) {\r
+ String expression = exp.getDocumentationExpression(graph);\r
+ if(!(exp instanceof StockExpression))\r
+ expression = expression.substring(expression.indexOf("=") + 1);\r
+ if(!(exp instanceof ParameterExpression))\r
+ result.append(formatForHTML(expression));\r
+ }\r
+ result.append("</p>");\r
+ \r
+ if(initialEquation != null && initialEquation.length() > 0) {\r
+ result.append("<p><b>Initial value:</b></p><p>");\r
+ if(getExpressions().size() > 1)\r
+ result.append(formatForHTML(initialEquation));\r
+ else\r
+ result.append(formatForHTML(initialEquation.substring(initialEquation.indexOf("=") + 1)));\r
+ result.append("</p>");\r
+ }\r
+ \r
+ result.append(super.getDocumentationDefinition(graph));\r
+ \r
+ return result.toString();\r
+ }\r
+ \r
+ private String formatForHTML(String text) {\r
+ text= text.trim();\r
+ text = text.replaceAll("\\r\\n|\\r|\\n", "<br/>");\r
+ if(text.endsWith(";"))\r
+ text = text.substring(0, text.length() - 1);\r
+ text = text.replace("/* Actual value read from init file */", "");\r
+ return text;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Iterator;\r
+import java.util.List;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElements;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+/**\r
+ * Representation of an input variable \r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.Input)\r
+public class Input extends Variable {\r
+\r
+ @RelatedValue(SysdynResource.URIs.Input_defaultInputValue)\r
+ private Double defaultInputValue;\r
+ @RelatedElements(SysdynResource.URIs.Variable_isHeadOf)\r
+ private List<IElement> isHeadOf;\r
+ \r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this);\r
+ }\r
+\r
+ /**\r
+ * Get the default value for this input. Default values may be set in either \r
+ * inside input's own module or in its parent module. If the value is set in a \r
+ * parent module, give input module's instance name as inModule.\r
+ * \r
+ * @param inModule The name of the instance in which this variable is. \r
+ * Can be null, if default value is set inside the variable's own module.\r
+ * @return Default input value.\r
+ */\r
+ public String getDefaultInputValue(String inModule) {\r
+ if( getArrayIndexes() == null || getArrayIndexes().isEmpty()) {\r
+ return defaultInputValue.toString();\r
+ } else {\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("fill(");\r
+ sb.append(defaultInputValue);\r
+ sb.append(", ");\r
+ Iterator<Enumeration> i = getArrayIndexes().iterator();\r
+ while(i.hasNext()) {\r
+ Enumeration e = i.next();\r
+ sb.append((inModule != null && !inModule.isEmpty() ? inModule + "." : "") + e.getModelicaName() + ".size");\r
+ if(i.hasNext())\r
+ sb.append(", ");\r
+ }\r
+ sb.append(")");\r
+ return sb.toString();\r
+ }\r
+ }\r
+ \r
+ /**\r
+ * Get the default value for this input inside it's own module.\r
+ * @return Default value\r
+ */\r
+ public String getDefaultInputValue() {\r
+ return getDefaultInputValue(null);\r
+ }\r
+\r
+ /**\r
+ * Is there a connection to this input variable from a module. (i.e. does this input variable possibly get its value from a child module)\r
+ * @return\r
+ */\r
+ public boolean isHeadOfDependency() {\r
+ return !isHeadOf.isEmpty();\r
+ }\r
+ \r
+ /**\r
+ * Get the declaration of this input variable with its default value\r
+ * @return declaration of this input variable with its default value\r
+ */\r
+ public String getDeclarationWithValue() {\r
+ String declaration = getDeclaration();\r
+ declaration = declaration.substring(0, declaration.length() - 2); // remove ";\n"\r
+ declaration += " = " + getDefaultInputValue() + ";\n";\r
+ return declaration;\r
+ }\r
+ \r
+ /**\r
+ * Get the declaration of this input variable without a default value\r
+ * @return declaration of this input variable without a default value\r
+ */\r
+ public String getDeclaration() {\r
+ ArrayList<Enumeration> enumerations = getArrayIndexes();\r
+ String range = "";\r
+ if(enumerations != null && enumerations.size() > 0) {\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("[");\r
+ Iterator<Enumeration> iterator = enumerations.iterator();\r
+ while(iterator.hasNext()) {\r
+ sb.append(iterator.next().getModelicaName() + ".size");\r
+ if(iterator.hasNext()) {\r
+ sb.append(", ");\r
+ }\r
+ }\r
+ sb.append("]");\r
+ range = sb.toString();\r
+ }\r
+ \r
+ boolean continuous = variability == null || variability.isEmpty();\r
+ return " " + (continuous ? "" : variability + " ") + getType() + " " + getModelicaName() + range + ";\n";\r
+ }\r
+ \r
+ @Override\r
+ public String getDocumentationDefinition(ReadGraph graph) throws DatabaseException {\r
+ String expression = getDefaultInputValue() + " // Default value";\r
+\r
+ if(isHeadOf.size() > 0 && isHeadOf.get(0) instanceof Dependency) {\r
+ Dependency dependency = (Dependency) isHeadOf.get(0);\r
+ Module module = (Module)dependency.getTail();\r
+ Variable reference = (Variable)dependency.refersTo();\r
+ // If reference exists, use reference name. Otherwise, use default value.\r
+ if(reference != null && reference.getModelicaName() != null)\r
+ expression = "<b>Reference:</b><br/>" + module.getName() + "." + reference.getModelicaName() + ";\n";\r
+ }\r
+ \r
+ return expression + super.getDocumentationDefinition(graph);\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+/**\r
+ * A dummy variable representing any possible library\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+@GraphType(Layer0.URIs.Library)\r
+public class LibraryDummy implements IElement {\r
+ \r
+ @RelatedValue(Layer0.URIs.HasName)\r
+ private String name;\r
+ \r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this); \r
+ }\r
+ \r
+ /**\r
+ * Name of the library\r
+ * @return Name of the library\r
+ */\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.objmap.IMapping;\r
+import org.simantics.objmap.MappingException;\r
+import org.simantics.objmap.Mappings;\r
+import org.simantics.sysdyn.manager.SysdynConsole;\r
+\r
+public class LoadRepresentation {\r
+ \r
+ public static IMapping loadMappedMapping(Session session, final Resource configuration) throws DatabaseException {\r
+ return session.syncRequest(new Read<IMapping>() {\r
+\r
+ @Override\r
+ public IMapping perform(ReadGraph graph)\r
+ throws DatabaseException {\r
+ SysdynSchema schema = new SysdynSchema(graph);\r
+ IMapping mapping = Mappings.createWithoutListening(schema);\r
+ \r
+ try {\r
+ mapping.map(graph, configuration);\r
+ } catch (MappingException e) {\r
+ SysdynConsole.INSTANCE.message(\r
+ "Error: Mapping is broken! Find the problem, " +\r
+ "fix it and restart the program." +\r
+ "\nJava error message:\n" + \r
+ e.getMessage());\r
+ throw e;\r
+ }\r
+ \r
+ return mapping;\r
+ }\r
+ \r
+ });\r
+ }\r
+\r
+ public static Configuration loadConfiguration(Session session, final Resource configuration) throws DatabaseException {\r
+ return session.syncRequest(new Read<Configuration>() {\r
+\r
+ @Override\r
+ public Configuration perform(ReadGraph graph)\r
+ throws DatabaseException {\r
+ SysdynSchema schema = new SysdynSchema(graph);\r
+ IMapping mapping = Mappings.createWithoutListening(schema);\r
+ \r
+ try {\r
+ return (Configuration)mapping.map(graph, configuration); \r
+ } catch (MappingException e) {\r
+ SysdynConsole.INSTANCE.message(\r
+ "Error: Mapping is broken! Find the problem, " +\r
+ "fix it and restart the program." +\r
+ "\nJava error message:\n" + \r
+ e.getMessage());\r
+ throw e;\r
+ }\r
+ \r
+ }\r
+ \r
+ });\r
+ }\r
+ \r
+ public static IElement loadElement(Session session, final Resource element) throws DatabaseException {\r
+ return session.syncRequest(new Read<IElement>() {\r
+\r
+ @Override\r
+ public IElement perform(ReadGraph graph)\r
+ throws DatabaseException {\r
+ SysdynSchema schema = new SysdynSchema(graph);\r
+ IMapping mapping = Mappings.createWithoutListening(schema);\r
+ \r
+ try {\r
+ return (IElement)mapping.map(graph, element); \r
+ } catch (MappingException e) {\r
+ SysdynConsole.INSTANCE.message(\r
+ "Error: Mapping is broken! Find the problem, " +\r
+ "fix it and restart the program." +\r
+ "\nJava error message:\n" + \r
+ e.getMessage());\r
+ throw e;\r
+ }\r
+ \r
+ }\r
+ \r
+ });\r
+ }\r
+ \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.RelatedListElements;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+\r
+@GraphType(SysdynResource.URIs.Loop)\r
+public class Loop implements IElement {\r
+\r
+ @RelatedValue(Layer0.URIs.HasName)\r
+ protected String name;\r
+ \r
+ @RelatedElement(Layer0.URIs.PartOf)\r
+ protected Object parent;\r
+ \r
+ @RelatedValue(SysdynResource.URIs.LoopSymbol_Clockwise)\r
+ protected Boolean clockwise;\r
+ \r
+ @RelatedValue(SysdynResource.URIs.Loop_Comment)\r
+ protected String comment;\r
+ \r
+ @RelatedListElements(SysdynResource.URIs.Loop_Items)\r
+ protected ArrayList<Object> items = new ArrayList<Object>();\r
+ \r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this); \r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return The name of this loop\r
+ */\r
+ public String getName() {\r
+ return this.name;\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return The comment of this loop\r
+ */\r
+ public String getComment() {\r
+ return this.comment;\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return The variables and dependencies of this loop\r
+ */\r
+ public ArrayList<Object> getItems() {\r
+ return this.items;\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return true iff loop rotates clockwise.\r
+ */\r
+ public boolean isClockwise() {\r
+ return this.clockwise;\r
+ }\r
+ \r
+ /**\r
+ *\r
+ * @return Parent configuration of this loop (or null if something is wrong)\r
+ */\r
+ public Configuration getParentConfiguration() {\r
+ if(parent instanceof Configuration) {\r
+ return (Configuration)parent;\r
+ } else {\r
+ return null;\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.RelatedElements;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.annotations.BuiltinFunctions;\r
+\r
+/**\r
+ * Representation of a system dynamics model\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.SysdynModel)\r
+public class Model {\r
+\r
+ @RelatedValue(SysdynResource.URIs.SysdynModel_startTime)\r
+ private final Double startTime = 0.0;\r
+\r
+ @RelatedValue(SysdynResource.URIs.SysdynModel_stopTime)\r
+ private final Double stopTime = 10.0;\r
+\r
+ @RelatedValue(SysdynResource.URIs.SysdynModel_outputInterval)\r
+ private Double outputInterval;\r
+ \r
+ @RelatedValue(SysdynResource.URIs.SysdynModel_simulationStepLength)\r
+ private Double stepLength;\r
+\r
+ @RelatedValue(SysdynResource.URIs.SysdynModel_tolerance)\r
+ private Double tolerance;\r
+\r
+ @RelatedValue(SysdynResource.URIs.SysdynModel_solver)\r
+ private String solver;\r
+ \r
+ @RelatedValue(SysdynResource.URIs.SysdynModel_variableFilter)\r
+ private String variableFilter;\r
+ \r
+ @RelatedElement(SimulationResource.URIs.HasConfiguration)\r
+ private Configuration configuration;\r
+ \r
+ @RelatedValue(SysdynResource.URIs.SysdynModel_timeUnit)\r
+ private String timeUnit;\r
+ \r
+ @RelatedElements(\r
+ value = Layer0.URIs.ConsistsOf,\r
+ composition = true)\r
+ private final ArrayList<Object> consistsOf = new ArrayList<Object>();\r
+ \r
+ @RelatedElements(\r
+ value = Layer0.URIs.IsLinkedTo,\r
+ composition = true)\r
+ private final ArrayList<Object> linkedTo = new ArrayList<Object>();\r
+ \r
+ \r
+ @BuiltinFunctions\r
+ private FunctionLibrary builtins;\r
+\r
+ /**\r
+ * \r
+ * @return Simulation start time\r
+ */\r
+ public Double getStartTime() {\r
+ return startTime;\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return Simulation end time\r
+ */\r
+ public Double getStopTime() {\r
+ return stopTime;\r
+ }\r
+\r
+ /**\r
+ * Simulation output interval\r
+ * @return\r
+ */\r
+ public Double getOutputInterval() {\r
+ return outputInterval;\r
+ }\r
+\r
+ /**\r
+ * Simulation step length\r
+ * @return\r
+ */\r
+ public Double getSimulationStepLength() {\r
+ return stepLength;\r
+ }\r
+ /**\r
+ * \r
+ * @return Tolerance for simulation engine\r
+ */\r
+ public Double getTolerance() {\r
+ return tolerance;\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return Solver name\r
+ */\r
+ public String getSolver() {\r
+ return solver;\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return variableFilter or ".*" if null\r
+ */\r
+ public String getVariableFilter() {\r
+ if(variableFilter == null || variableFilter.isEmpty())\r
+ return ".*";\r
+ else\r
+ return variableFilter;\r
+ }\r
+\r
+ /**\r
+ * Get all functions that are linked to this model: built-in functions, model's own functions and shared function libraries\r
+ * @return all functions liked to this model\r
+ */\r
+ public HashMap<String, Function> getFunctions() {\r
+ HashMap<String, Function> functions = new HashMap<String, Function>();\r
+ if(consistsOf != null ) {\r
+ for(Object o : consistsOf) {\r
+ if(o instanceof Function) {\r
+ Function f = (Function) o;\r
+ functions.put(f.getName(), f);\r
+ } else if (o instanceof FunctionLibrary) {\r
+ addFunctions("", (FunctionLibrary)o, functions);\r
+ }\r
+ }\r
+ }\r
+ \r
+ if(linkedTo != null) {\r
+ for(Object o : linkedTo) {\r
+ if(o instanceof SharedFunctionLibrary) {\r
+ SharedFunctionLibrary fl = (SharedFunctionLibrary)o;\r
+ addFunctions(fl.getName(), fl, functions);\r
+ }\r
+ }\r
+ }\r
+ \r
+ if(builtins != null)\r
+ addBuiltinFunctions(builtins, functions);\r
+ \r
+ return functions;\r
+ }\r
+ \r
+ /**\r
+ * Determine if this Model consists of a certain ModuleType.\r
+ * @param moduleType The name of the ModuleType that is sought \r
+ * @return true iff this consists of moduleType\r
+ */\r
+ public boolean containsModuleType(String moduleType) {\r
+ if(consistsOf != null ) {\r
+ for(Object o : consistsOf) {\r
+ if(o instanceof ModuleType) {\r
+ ModuleType mt = (ModuleType)o;\r
+ if (mt.getName().equals(moduleType)) \r
+ return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+ \r
+ /**\r
+ * Determine if this Model consists of a certain Function or \r
+ * FunctionLibrary ON THE TOP LEVEL.\r
+ * @param elementName The name of the element that is sought \r
+ * @return true iff this consists of element\r
+ */\r
+ public boolean containsFunctionOrLibrary(String elementName) {\r
+ if(consistsOf != null ) {\r
+ for(Object o : consistsOf) {\r
+ if(o instanceof Function) {\r
+ Function f = (Function)o;\r
+ if (f.getName().equals(elementName)) \r
+ return true;\r
+ }\r
+ else if(o instanceof FunctionLibrary) {\r
+ FunctionLibrary fl = (FunctionLibrary)o;\r
+ if (fl.getName().equals(elementName)) \r
+ return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ /**\r
+ * Add built-in functions to functions map. Built-in functions do not have any library path.\r
+ * @param library Built-in function library\r
+ * @param functions Function map containing all functions\r
+ */\r
+ private void addBuiltinFunctions(FunctionLibrary library, HashMap<String, Function> functions) {\r
+ for(Function f : library.getFunctions())\r
+ functions.put(f.getName(), f);\r
+ for(FunctionLibrary fl : library.getLibraries())\r
+ addBuiltinFunctions(fl, functions);\r
+ }\r
+ \r
+ /**\r
+ * Add functions from a library to a library map\r
+ * @param path Path to the library\r
+ * @param library Function library\r
+ * @param functions Function map containing all functions\r
+ */\r
+ private void addFunctions(String path, FunctionLibrary library, HashMap<String, Function> functions) {\r
+ for(Function f : library.getFunctions())\r
+ functions.put(path + (path.isEmpty() ? "" : ".") + f.getName(), f);\r
+ for(FunctionLibrary fl : library.getLibraries())\r
+ addFunctions((path.isEmpty() ? "" : path + ".") + fl.getName(), fl, functions);\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return Built-in functions library\r
+ */\r
+ public FunctionLibrary getBuiltins() {\r
+ return builtins;\r
+ }\r
+ \r
+ \r
+ /**\r
+ * \r
+ * @return Configuration of this model\r
+ */\r
+ public Configuration getModelConfiguration() {\r
+ return configuration;\r
+ }\r
+ \r
+ \r
+ public String getTimeUnit() {\r
+ return timeUnit;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012, 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashSet;\r
+import java.util.Iterator;\r
+import java.util.List;\r
+import java.util.Set;\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.RelatedElements;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+import org.simantics.utils.datastructures.Pair;\r
+\r
+/**\r
+ * Representation of a module instance\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.Module)\r
+public class Module implements IElement {\r
+\r
+ @RelatedValue(Layer0.URIs.HasName)\r
+ private String name;\r
+\r
+ @RelatedElement(Layer0.URIs.PartOf)\r
+ private Configuration parentConfiguration;\r
+\r
+ @RelatedElement(Layer0.URIs.InstanceOf)\r
+ private ModuleType type;\r
+\r
+ @RelatedElements(SysdynResource.URIs.Module_redeclaration)\r
+ private List<Redeclaration> redeclarations;\r
+\r
+ @RelatedElements(Layer0.URIs.ConsistsOf)\r
+ private List<Entity> consistsOf;\r
+\r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this);\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+ \r
+ /**\r
+ * Get Modelica compliant name\r
+ * @return The name of this variable with spaces (' ') replaced with \r
+ * underscore characters ('_')\r
+ */\r
+ public String getModelicaName() {\r
+ if (this.name == null)\r
+ return null;\r
+ return this.name.replace(' ', '_');\r
+ }\r
+\r
+ public ModuleType getType() {\r
+ return type;\r
+ }\r
+\r
+ /**\r
+ * Returns the declaration of a module with possible redeclared enumerations and parameter assignments\r
+ *\r
+ * <p>\r
+ * Enumeration redeclaration:\r
+ * parameter Integer Enum__size = Enum.size; <br>\r
+ * parameter Integer Enum__elements[:] = Enum.elements; <br>\r
+ * ModuleType ModuleType1(Enum.size = Enum__size, Enum.elements = Enum__elements); <br>\r
+ * \r
+ * <p>\r
+ * Temporary parameter variables are needed to avoid name conflicts when redeclaring an \r
+ * enumeration with the same name.\r
+ * \r
+ * @return Declaration of a module instance\r
+ */\r
+ public String getDeclaration() {\r
+\r
+\r
+ String enumerationRedeclarations = getEnumerationRedeclarations();\r
+ Pair<String, String> inputRedeclarations = getInputRedeclarations();\r
+ String parameterOverrides = getParameterOverrideString();\r
+\r
+ StringBuilder redeclarations = new StringBuilder();\r
+\r
+ if(!enumerationRedeclarations.isEmpty() || !inputRedeclarations.first.isEmpty() || !parameterOverrides.isEmpty()) {\r
+ redeclarations.append("(");\r
+ redeclarations.append(enumerationRedeclarations);\r
+\r
+ String ir = inputRedeclarations.first;\r
+ if(enumerationRedeclarations.isEmpty() && !inputRedeclarations.first.isEmpty())\r
+ // remove first ", " if no enumeration redeclarations\r
+ ir = inputRedeclarations.first.substring(2); \r
+ redeclarations.append(ir);\r
+\r
+ if(!parameterOverrides.isEmpty()) {\r
+ if(redeclarations.length() > 1)\r
+ redeclarations.append(", ");\r
+ redeclarations.append(parameterOverrides);\r
+ }\r
+\r
+ redeclarations.append(")");\r
+ }\r
+\r
+ StringBuilder sb = new StringBuilder();\r
+\r
+ // Possible reference variables\r
+ if(inputRedeclarations.second != null && !inputRedeclarations.second.isEmpty()) {\r
+ sb.append(inputRedeclarations.second);\r
+ }\r
+\r
+ sb.append(" ");\r
+ sb.append(getType().getModelicaName());\r
+ sb.append(" ");\r
+ sb.append(getModelicaName());\r
+ sb.append(redeclarations.toString()); // possible redeclarations\r
+ sb.append(";\n");\r
+ return sb.toString();\r
+ }\r
+\r
+ /**\r
+ * Get possible enumeration redeclarations.\r
+ * @return enumeration redeclarations or empty string\r
+ */\r
+ private String getEnumerationRedeclarations() {\r
+ StringBuilder redeclarations = new StringBuilder();\r
+ if(!getRedeclarations().isEmpty()) {\r
+\r
+ boolean first = true;\r
+ Iterator<Redeclaration> i = getRedeclarations().iterator();\r
+ while(i.hasNext()) {\r
+ Redeclaration rd = i.next();\r
+ String redeclaration = rd.getRedeclaration();\r
+ if(redeclaration != null && !redeclaration.isEmpty()) {\r
+ if(!first) {\r
+ redeclarations.append(",");\r
+ } else {\r
+ first = false;\r
+ }\r
+ redeclarations.append(redeclaration);\r
+ }\r
+ }\r
+ }\r
+ return redeclarations.toString();\r
+ }\r
+\r
+ /**\r
+ * Get possible input redeclarations\r
+ * @return input redeclarations or empty string\r
+ */\r
+ private Pair<String, String> getInputRedeclarations() {\r
+ StringBuilder declarations = new StringBuilder();\r
+ StringBuilder references = new StringBuilder();\r
+\r
+ for(IElement element : parentConfiguration.getElements()) {\r
+ if (element instanceof Dependency) {\r
+ Dependency dependency = (Dependency)element;\r
+ if(dependency.getHead().equals(this)){\r
+ Input reference = (Input)dependency.refersTo();\r
+ Variable outputVariable = (Variable)dependency.getTail();\r
+ if(outputVariable instanceof Shadow)\r
+ outputVariable = ((Shadow) outputVariable).getOriginal();\r
+ \r
+ String name = outputVariable.getModelicaName();\r
+\r
+ Module module = (Module)dependency.getHead();\r
+\r
+ if(reference != null && reference.getName() != null) {\r
+ if(reference.getVariability() == null || reference.getVariability().isEmpty())\r
+ continue; // Only parameters and constants are redeclared\r
+\r
+ for(IElement e : module.getType().getConfiguration().getElements()) {\r
+ if(e instanceof Variable) {\r
+ Variable v = (Variable)e;\r
+\r
+ if(v.getName() != null && outputVariable.getName().equals(v.getName())) {\r
+ /*\r
+ * The target module contains a variable with the same name. Need to\r
+ * avoid Module(variable = variable) situations \r
+ */\r
+ String declaration;\r
+ if(outputVariable instanceof Input)\r
+ declaration = ((Input)outputVariable).getDeclaration();\r
+ else\r
+ declaration = ((IndependentVariable)outputVariable).getDeclaration();\r
+\r
+ if(declaration.contains("="))\r
+ declaration = declaration.substring(0, declaration.indexOf("=") - 1); // Break to "="\r
+ else\r
+ declaration = declaration.substring(0, declaration.length() - 2); // Remove ending ";\n" \r
+\r
+ name = outputVariable.getModelicaName() + "_reference";\r
+ declaration = declaration.replace(outputVariable.getModelicaName(), name);\r
+ declaration += " = " + outputVariable.getModelicaName() + " /* Reference value to avoid name conflicts in module instantiation */ ;\n";\r
+ references.append(declaration);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ declarations.append(", " + reference.getModelicaName() + " = " + name);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return new Pair<String, String>(declarations.toString(), references.toString());\r
+ }\r
+\r
+ public Configuration getParentConfiguration() {\r
+ return this.parentConfiguration;\r
+ }\r
+\r
+ /**\r
+ * Return the list of the defined redeclarations for this module instance.\r
+ * \r
+ * @return List of the defined redeclarations or an empty list if redeclarations have not been set \r
+ */\r
+ public List<Redeclaration> getRedeclarations() {\r
+ if(redeclarations == null) {\r
+ redeclarations = new ArrayList<Redeclaration>();\r
+ }\r
+ return redeclarations;\r
+ }\r
+\r
+\r
+ /**\r
+ * Get all parameter override elements for this module instance as a string "param = value, param2 = value2, ..."\r
+ * @return parameter overrides\r
+ */\r
+ public String getParameterOverrideString() {\r
+ String result = "";\r
+\r
+ for(ParameterOverride po : getParameterOverrides()) {\r
+ IndependentVariable var = po.getVariable();\r
+ if(!Variability.CONTINUOUS.equals(Variability.getVariability(var, false, parentConfiguration))) {\r
+ if(!result.isEmpty())\r
+ result += ", ";\r
+\r
+ result += po.getOverride();\r
+ }\r
+ }\r
+\r
+ return result;\r
+ }\r
+\r
+\r
+ /**\r
+ * Get all parameter overrides of this module instance\r
+ * @return\r
+ */\r
+ public Set<ParameterOverride> getParameterOverrides() {\r
+ HashSet<ParameterOverride> result = new HashSet<ParameterOverride>();\r
+ if(consistsOf != null) {\r
+ for(Entity e : consistsOf) {\r
+ if(e instanceof ParameterOverride) {\r
+ result.add( (ParameterOverride) e);\r
+ }\r
+ }\r
+ }\r
+ return result; \r
+ }\r
+\r
+\r
+ \r
+ public String getDocumentationDefinition() {\r
+ String enumerationRedeclarations = getEnumerationRedeclarations();\r
+ String parameterOverrides = getParameterOverrideString();\r
+ \r
+ StringBuilder result = new StringBuilder();\r
+ \r
+ String[] erecs = enumerationRedeclarations.split(",");\r
+ boolean first = true;\r
+ result.append("<p>");\r
+ for(String s : erecs) {\r
+ if(s.length() == 0)\r
+ continue;\r
+ \r
+ if(first) {\r
+ result.append("<b>Enumeration redeclarations:</b><br/>");\r
+ }\r
+ first = false;\r
+ result.append(s.trim());\r
+ result.append("<br/>");\r
+ }\r
+ result.append("</p>");\r
+\r
+ \r
+ \r
+ first = true;\r
+ result.append("<p>");\r
+\r
+ String[] poverrds = parameterOverrides.split(",");\r
+ for(String s : poverrds) {\r
+ if(s.length() == 0)\r
+ continue;\r
+\r
+ if(first) {\r
+ result.append("<b>Parameter overrides:</b><br/>");\r
+ }\r
+ first = false;\r
+ result.append(s.trim());\r
+ result.append("<br/>");\r
+ }\r
+ result.append("</p>");\r
+\r
+ ArrayList<Dependency> inputs = new ArrayList<Dependency>();\r
+ ArrayList<Dependency> outputs = new ArrayList<Dependency>();\r
+ for(IElement e : parentConfiguration.getElements()) {\r
+ if(e instanceof Dependency) {\r
+ Dependency d = (Dependency)e;\r
+ if(this.equals(d.getHead()) && d.refersTo() != null) {\r
+ inputs.add(d);\r
+ } else if(this.equals(d.getTail()) && d.refersTo() != null) {\r
+ outputs.add(d);\r
+ }\r
+ }\r
+ }\r
+ \r
+ first = true;\r
+ result.append("<p>");\r
+ for(Dependency d : inputs) {\r
+ if(first) {\r
+ result.append("<b>Inputs:</b><br/>");\r
+ }\r
+ first = false;\r
+ \r
+ result.append(getName() + "." + ((Variable)d.refersTo()).getModelicaName() + " = " + ((Variable)d.getTail()).getModelicaName());\r
+ result.append("<br/>");\r
+ }\r
+ result.append("</p>");\r
+ \r
+ first = true;\r
+ result.append("<p>");\r
+ for(Dependency d : outputs) {\r
+ if(first) {\r
+ result.append("<b>Outputs:</b><br/>");\r
+ }\r
+ first = false;\r
+ \r
+ result.append(((Variable)d.getHead()).getModelicaName() + " = " + getName() + "." + ((Variable)d.refersTo()).getModelicaName());\r
+ result.append("<br/>");\r
+ }\r
+ result.append("</p>");\r
+\r
+ \r
+ return result.toString();\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012, 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+/**\r
+ * Representation of a module type\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(StructuralResource2.URIs.ComponentType)\r
+public class ModuleType implements IElement {\r
+\r
+ @RelatedValue(Layer0.URIs.HasName)\r
+ private String name;\r
+ \r
+ @RelatedElement(StructuralResource2.URIs.IsDefinedBy)\r
+ private Object configuration;\r
+ \r
+ @RelatedElement(Layer0.URIs.PartOf)\r
+ protected Object parent;\r
+ \r
+ /**\r
+ * Get Modelica compliant name\r
+ * @return The name of this variable with spaces (' ') replaced with \r
+ * underscore characters ('_')\r
+ */\r
+ public String getModelicaName() {\r
+ if (this.name == null)\r
+ return null;\r
+ return this.name.replace(' ', '_');\r
+ }\r
+ \r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public Configuration getConfiguration() {\r
+ return configuration instanceof Configuration ? (Configuration)configuration : null;\r
+ }\r
+ \r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ }\r
+ \r
+ public Object getParent() {\r
+ return parent;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+\r
+/**\r
+ * Representation of a parameter override\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.Module_ParameterOverride)\r
+public class ParameterOverride extends Entity {\r
+ \r
+ @RelatedElement(SysdynResource.URIs.Module_ParameterOverride_overriddenParameter)\r
+ private IndependentVariable variable;\r
+ \r
+ @RelatedValue(SysdynResource.URIs.Module_ParameterOverride_overrideExpression)\r
+ private String expression;\r
+ \r
+ /**\r
+ * Get the parameter variable to be overridden\r
+ * @return parameter variable to be overridden\r
+ */\r
+ public IndependentVariable getVariable() {\r
+ return variable;\r
+ }\r
+ \r
+ /**\r
+ * Get the overriding expression\r
+ * @return overriding expression\r
+ */\r
+ public String getExpression() {\r
+ return expression;\r
+ }\r
+ \r
+ /**\r
+ * Get the complete override equation: "variable = overridingExpression"\r
+ * @return override equation\r
+ */\r
+ public String getOverride() {\r
+ return variable.getModelicaName() + " = " + expression;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+@GraphType(SysdynResource.URIs.Redeclaration)\r
+public class Redeclaration {\r
+ \r
+ @RelatedElement(SysdynResource.URIs.Redeclaration_replacedEnumeration)\r
+ private Enumeration replacedEnumeration;\r
+ \r
+ @RelatedElement(SysdynResource.URIs.Redeclaration_replacingEnumeration)\r
+ private Enumeration replacingEnumeration;\r
+ \r
+ public String getRedeclaration() {\r
+ if(replacedEnumeration == null || replacingEnumeration == null) {\r
+ return "";\r
+ }\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append(replacedEnumeration.getModelicaName());\r
+ sb.append(".size = ");\r
+ sb.append(replacingEnumeration.getModelicaName());\r
+ sb.append("_size, ");\r
+ sb.append(replacedEnumeration.getModelicaName());\r
+ sb.append(".elements = ");\r
+ sb.append(replacingEnumeration.getModelicaName());\r
+ sb.append("_elements");\r
+ \r
+ return sb.toString();\r
+ }\r
+\r
+ public Enumeration getReplacedEnumeration() {\r
+ return replacedEnumeration;\r
+ }\r
+\r
+ public Enumeration getReplacingEnumeration() {\r
+ return replacingEnumeration;\r
+ }\r
+ \r
+ \r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.expressions.IExpression;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(SysdynResource.URIs.Shadow)\r
+public class Shadow extends Variable {\r
+\r
+ @RelatedElement(SysdynResource.URIs.Shadow_original)\r
+ private Variable original;\r
+\r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ if(getOriginal() != null)\r
+ original.accept(v);\r
+ }\r
+\r
+ public Variable getOriginal() {\r
+ return original;\r
+ }\r
+\r
+ @Override\r
+ public String getName() {\r
+ if(getOriginal() != null)\r
+ return getOriginal().getName();\r
+ else\r
+ return super.getName();\r
+ }\r
+\r
+ @Override\r
+ public ArrayList<Enumeration> getArrayIndexes() {\r
+ if(getOriginal() != null)\r
+ return getOriginal().getArrayIndexes();\r
+ else\r
+ return super.getArrayIndexes();\r
+ }\r
+\r
+ @Override\r
+ public ArrayList<IExpression> getExpressions() {\r
+ if(getOriginal() != null)\r
+ return getOriginal().getExpressions();\r
+ else\r
+ return super.getExpressions();\r
+ }\r
+\r
+ @Override\r
+ public String getVariability() {\r
+ if(getOriginal() != null)\r
+ return getOriginal().getVariability();\r
+ else\r
+ return super.getVariability();\r
+ }\r
+\r
+ @Override\r
+ public String getType() {\r
+ if(getOriginal() != null)\r
+ return getOriginal().getType();\r
+ else\r
+ return super.getType();\r
+ }\r
+\r
+ @Override\r
+ public String getUnit() {\r
+ if(getOriginal() != null)\r
+ return getOriginal().getUnit();\r
+ else\r
+ return super.getUnit();\r
+ }\r
+\r
+ @Override\r
+ public String getDocumentationDefinition(ReadGraph graph) throws DatabaseException {\r
+ return null;\r
+ }\r
+ \r
+ @Override\r
+ public String getModelicaName() {\r
+ if(getOriginal() != null)\r
+ return getOriginal().getModelicaName();\r
+ else\r
+ return super.getModelicaName();\r
+ }\r
+ \r
+}\r
+\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Representation of a shared function library. See {@link FunctionLibrary} \r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.SharedFunctionOntology)\r
+public class SharedFunctionLibrary extends FunctionLibrary {\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import gnu.trove.map.hash.THashMap;\r
+import gnu.trove.set.hash.THashSet;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.HashMap;\r
+import java.util.HashSet;\r
+\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.databoard.primitives.MutableString;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.ReadRequest;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.exception.MissingVariableException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.UpdateMethod;\r
+import org.simantics.spreadsheet.Range;\r
+import org.simantics.spreadsheet.SheetVariables;\r
+import org.simantics.spreadsheet.common.exception.CellParseException;\r
+import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
+import org.simantics.spreadsheet.util.SpreadsheetUtils;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(SpreadsheetResource.URIs.Spreadsheet)\r
+public class Sheet extends org.simantics.sysdyn.representation.Variable {\r
+ \r
+ @RelatedElement(Layer0.URIs.PartOf)\r
+ protected Book book;\r
+ \r
+ THashMap<String, Object> cells = new THashMap<String, Object>();\r
+ THashSet<String> usedRanges = new THashSet<String>();\r
+ \r
+ Resource resource;\r
+\r
+ public String getSheet() {\r
+ return "Sheet";\r
+ }\r
+ \r
+ @UpdateMethod\r
+ public boolean updateCells(ReadGraph g, Resource r) throws DatabaseException {\r
+ if(g.hasStatement(r)) {\r
+ this.resource = r;\r
+ THashMap<String, Object> newCells = new THashMap<String, Object>();\r
+ \r
+ g.getObjects(r, Layer0.getInstance(g).ConsistsOf);\r
+ Variable v = g.adapt(r, Variable.class);\r
+ for(Variable child : v.getChildren(g)) {\r
+ String name = child.getName(g);\r
+ try {\r
+ SpreadsheetUtils.decodeCellAbsolute(name);\r
+ Object value = child.getPropertyValue(g, SheetVariables.CONTENT);\r
+ if(value instanceof Variant) {\r
+ newCells.put(name, ((Variant)value).getValue());\r
+ }\r
+ } catch (CellParseException e) {\r
+ } catch (MissingVariableException e) {\r
+ System.out.println("missing content for: " + name);\r
+ }\r
+ }\r
+ \r
+ boolean update = false;\r
+ if(newCells.size() == this.cells.size()) {\r
+ // Cells are the same size. There might not be changes. Next up: content\r
+ for(String key : this.cells.keySet()) {\r
+ if(!this.cells.get(key).equals(newCells.get(key))) {\r
+ update = true;\r
+ break;\r
+ }\r
+ }\r
+ } else {\r
+ update = true;\r
+ }\r
+ \r
+ if(update) {\r
+ this.cells = newCells;\r
+ this.usedRanges.clear();\r
+ return true;\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+ \r
+ public String getStringRepresentation() {\r
+ final StringBuilder clazz = new StringBuilder();\r
+ clazz.append("class " + getModelicaName() + "_class\n");\r
+ \r
+ try {\r
+ Simantics.getSession().syncRequest(new ReadRequest() {\r
+\r
+ @Override\r
+ public void run(ReadGraph graph) throws DatabaseException {\r
+ HashSet<String> possibleRanges = new HashSet<String>();\r
+ \r
+ // Write all doubles that have been used in expressions\r
+ final HashSet<String> usedCells = new HashSet<String>();\r
+ for(String key : usedRanges) {\r
+ if(cells.containsKey(key)) {\r
+ addRange(key, usedCells, clazz);\r
+ } else {\r
+ for(String range : getChildRanges(graph, key)) {\r
+ if(cells.containsKey(range))\r
+ addRange(range, usedCells, clazz);\r
+ }\r
+ possibleRanges.add(key);\r
+ }\r
+ }\r
+\r
+ // Get cell ranges. Add cell names that have not been used individually to usedCells set\r
+ // and use those names in ranges\r
+\r
+ Variable v = graph.adapt(resource, Variable.class);\r
+ for(String possibleRange : possibleRanges) {\r
+ String[] parts = possibleRange.split(":");\r
+ if(parts.length != 2 || !cells.containsKey(parts[0]) || !cells.containsKey(parts[1]))\r
+ continue;\r
+ Variable range = v.getChild(graph, possibleRange);\r
+ if(range == null)\r
+ continue;\r
+ String[][] rangeCells = range.getPropertyValue(graph, SheetVariables.RANGE_CELL_NAMES);\r
+ if(rangeCells == null)\r
+ continue;\r
+\r
+ if(rangeCells[0].length > 1) {\r
+ // Has two dimensions \r
+ clazz.append(" parameter Real[" + rangeCells.length + ", " + rangeCells[0].length + "] ");\r
+ clazz.append(possibleRange.replace(":", "_") + " = {");\r
+ for(int i = 0; i < rangeCells.length; i++) {\r
+ clazz.append("{");\r
+ for(int j = 0; j < rangeCells[i].length; j++) {\r
+ clazz.append(rangeCells[i][j]);\r
+ usedCells.add(rangeCells[i][j]); // Add the cell name to used cells\r
+ if(j < rangeCells[i].length - 1)\r
+ clazz.append(", ");\r
+ }\r
+ clazz.append("}");\r
+ if(i < rangeCells.length - 1)\r
+ clazz.append(", ");\r
+ }\r
+ clazz.append("};\n");\r
+ } else {\r
+ // Has one dimension\r
+ clazz.append(" parameter Real[" + rangeCells.length + "] ");\r
+ clazz.append(possibleRange.replace(":", "_") + " = {");\r
+ for(int i = 0; i < rangeCells.length; i++) {\r
+ clazz.append(rangeCells[i][0]);\r
+ usedCells.add(rangeCells[i][0]); // Add the cell name to used cells\r
+ if(i < rangeCells.length - 1)\r
+ clazz.append(", ");\r
+ }\r
+ clazz.append("};\n");\r
+ }\r
+ }\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ clazz.append("end " + getModelicaName() + "_class;\n");\r
+// clazz.append(" " + name + "_class " + name + ";\n");\r
+ return clazz.toString();\r
+ }\r
+ \r
+ private void addRange(String key, HashSet<String> usedCells, StringBuilder clazz) {\r
+ if(usedCells.add(key)) {\r
+ Object value = cells.get(key);\r
+ if(value instanceof String || value instanceof MutableString) {\r
+ try {\r
+ Double d = Double.parseDouble(value.toString());\r
+ value = d;\r
+ } catch (NumberFormatException e) {\r
+ }\r
+ } \r
+\r
+ if(value instanceof Double) {\r
+ Double d = (Double)value;\r
+ clazz.append(" parameter Real " + key + " = " + d + " /* Actual value read from init file */;\n");\r
+ }\r
+ }\r
+ }\r
+ \r
+ private ArrayList<String> getChildRanges(ReadGraph graph, String range) throws DatabaseException {\r
+ ArrayList<String> ranges = new ArrayList<String>();\r
+ if(range.contains(":")) {\r
+ // Get cell ranges. Add cell names that have not been used individually to usedCells set\r
+ // and use those names in ranges\r
+ Variable v = graph.adapt(resource, Variable.class);\r
+ String[] parts = range.split(":");\r
+ if(parts.length != 2 || !cells.containsKey(parts[0]) || !cells.containsKey(parts[1]))\r
+ return ranges;\r
+ Variable rangeVariable = v.getChild(graph, range);\r
+ if(rangeVariable == null)\r
+ return ranges;\r
+ String[][] rangeCells = rangeVariable.getPropertyValue(graph, SheetVariables.RANGE_CELL_NAMES);\r
+ if(rangeCells == null)\r
+ return ranges;\r
+\r
+ for(int i = 0; i < rangeCells.length; i++) {\r
+ for(int j = 0; j < rangeCells[i].length; j++) {\r
+ ranges.add(rangeCells[i][j]);\r
+ }\r
+ }\r
+ }\r
+ return ranges;\r
+ }\r
+\r
+ \r
+ public THashMap<String, Object> getCells() {\r
+ return cells;\r
+ }\r
+ \r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ \r
+ }\r
+ \r
+ /**\r
+ * Add a range that has been used for this sheet. \r
+ * \r
+ * Used ranges help to reduce code sent to Modelica.\r
+ * \r
+ * @param range range of cell/cells. (e.g. B2 or B4:B6)\r
+ */\r
+ public void use(final String usedRange) {\r
+ usedRanges.add(usedRange);\r
+ }\r
+\r
+ \r
+ @Override\r
+ public String getDocumentationDefinition(ReadGraph graph) throws DatabaseException {\r
+ Variable v = Variables.getVariable(graph, resource);\r
+ Collection<Variable> children = v.getChildren(graph);\r
+ HashMap<Variable, Range> map = new HashMap<Variable, Range>();\r
+ int minColumn = -1;\r
+ int maxColumn = -1;\r
+ int minRow = -1;\r
+ int maxRow = -1;\r
+ for(Variable child : children) {\r
+ Range range = SpreadsheetUtils.decodePossibleCellAbsolute(child.getName(graph));\r
+ if(range != null) {\r
+ Variant valueVariant = child.getPropertyValue(graph, SheetVariables.CONTENT, Bindings.VARIANT);\r
+ Object valueObject = valueVariant.getValue();\r
+ if(valueObject instanceof String) {\r
+ String value = (String) valueObject;\r
+ if(!value.isEmpty()) {\r
+ map.put(child, range);\r
+ if(minColumn < 0 || range.startColumn < minColumn)\r
+ minColumn = range.startColumn;\r
+ if(range.startColumn > maxColumn)\r
+ maxColumn = range.startColumn;\r
+ if(minRow < 0 || range.startRow < minRow)\r
+ minRow = range.startRow;\r
+ if(range.startRow > maxRow)\r
+ maxRow = range.startRow;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ int nColumns = maxColumn - minColumn + 1;\r
+ int nRows = maxRow - minRow + 1;\r
+ String[][] table = new String[nRows][nColumns];\r
+ for(int i = 0; i < nRows; i++) \r
+ for(int j = 0; j < nColumns; j++)\r
+ table[i][j] = "";\r
+ \r
+ for(Variable cell : map.keySet()) {\r
+ Range range = map.get(cell);\r
+ Variant valueVariant = cell.getPropertyValue(graph, SheetVariables.CONTENT, Bindings.VARIANT);\r
+ Object valueObject = valueVariant.getValue();\r
+ table[range.startRow - minRow][range.startColumn - minColumn] = valueObject.toString(); \r
+ }\r
+ \r
+ StringBuilder result = new StringBuilder();\r
+ result.append("<table style='border-collapse:collapse;'>");\r
+ for(int i = -1; i < nRows; i++) {\r
+ result.append("<tr>");\r
+ for(int j = -1; j < nColumns; j++) {\r
+ result.append("<td style='border: 1px solid black;'>");\r
+ if(i == -1 || j == -1)\r
+ result.insert(result.length() - 2, "background-color:#D3D3D3; text-align:center;");\r
+ if(i == -1 && j == -1) {\r
+ // Do nothing\r
+ } else if(i == -1) {\r
+ // First row, make column headers\r
+ result.append(SpreadsheetUtils.columnName(j + minColumn));\r
+ } else if(j == -1){\r
+ // First column, make row numbers. Rows start from 1\r
+ result.append(i + minRow + 1);\r
+ } else {\r
+ // Actual content\r
+ result.append(table[i][j]);\r
+ }\r
+ result.append("</td>");\r
+ }\r
+ result.append("</tr>");\r
+ }\r
+ result.append("</table>");\r
+\r
+ return result.toString();\r
+ }\r
+ \r
+ \r
+ public Resource getResource() {\r
+ return resource;\r
+ }\r
+\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElements;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.expressions.StockExpression;\r
+import org.simantics.sysdyn.representation.utils.SheetFormatUtils;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+/**\r
+ * Representation of a Stock variable\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.Stock)\r
+public class Stock extends IndependentVariable {\r
+\r
+ @RelatedElements(\r
+ value = SysdynResource.URIs.Variable_isHeadOf,\r
+ composition = true)\r
+ private ArrayList<IElement> incomingConnections = new ArrayList<IElement>();\r
+\r
+\r
+ @RelatedElements(\r
+ value = SysdynResource.URIs.Variable_isTailOf,\r
+ composition = true)\r
+ private ArrayList<IElement> outgoingConnections = new ArrayList<IElement>();\r
+\r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this); \r
+ }\r
+\r
+ @Override\r
+ public String getInitialEquation() {\r
+ if (Variability.getVariability(this) == Variability.CONTINUOUS) {\r
+ return super.getInitialEquation();\r
+ } else {\r
+ return null;\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public String getDeclaration() {\r
+ // is it really guaranteed that variability is the only necessary \r
+ // parameter to consider when deciding whether to use start=value \r
+ // notation or initial equations?\r
+ String each = (getArrayIndexes() != null && !getArrayIndexes().isEmpty()) ? "each " : "";\r
+ // each is required when a single value is used for all dimensions e.g. Stock[30](each start = 0) \r
+ if (Variability.getVariability(this) == Variability.CONTINUOUS) {\r
+ // start parameter is not used, everything needs to be fixed=false\r
+ return " " + getType() + " " + getModelicaName() + getRange() + "(" + each + "fixed=false);\n";\r
+ } else {\r
+ // Start parameter is used. Parameter guarantees that there is only one expression.\r
+ StockExpression e = (StockExpression)getExpressions().get(0);\r
+ String initialEquation = e.getModelicaExpression();\r
+ initialEquation = SheetFormatUtils.reformatSheetReferences(this, initialEquation);\r
+\r
+ return " " + \r
+ getType() + \r
+ " " + \r
+ getModelicaName() + \r
+ getRange() + \r
+ "(" + \r
+ "start=" + \r
+ initialEquation + \r
+ ", " + \r
+ each + \r
+ "fixed=true);\n";\r
+ }\r
+ }\r
+\r
+ public String getEquation() {\r
+ return getVariableEquation();\r
+ }\r
+\r
+\r
+ public ArrayList<Valve> getIncomingValves() {\r
+ ArrayList<Valve> valves = new ArrayList<Valve>();\r
+ for(IElement element : incomingConnections) {\r
+ if(element instanceof Flow) {\r
+ Flow flow = (Flow)element;\r
+ valves.add((Valve)flow.getTail());\r
+ }\r
+ }\r
+ return valves;\r
+ }\r
+\r
+ public ArrayList<Valve> getOutgoingValves() {\r
+ ArrayList<Valve> valves = new ArrayList<Valve>();\r
+ for(IElement element : outgoingConnections) {\r
+ if(element instanceof Flow) {\r
+ Flow flow = (Flow)element;\r
+ valves.add((Valve)flow.getHead());\r
+ }\r
+ }\r
+ return valves;\r
+ }\r
+\r
+\r
+}\r
+\r
+\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.objmap.schema.MappingSchemas;\r
+import org.simantics.objmap.schema.SimpleSchema;\r
+import org.simantics.sysdyn.representation.expressions.ConstantExpression;\r
+import org.simantics.sysdyn.representation.expressions.DelayExpression;\r
+import org.simantics.sysdyn.representation.expressions.LookupExpression;\r
+import org.simantics.sysdyn.representation.expressions.NormalExpression;\r
+import org.simantics.sysdyn.representation.expressions.ParameterExpression;\r
+import org.simantics.sysdyn.representation.expressions.StockExpression;\r
+import org.simantics.sysdyn.representation.expressions.WithLookupExpression;\r
+\r
+public class SysdynSchema extends SimpleSchema {\r
+ \r
+ public SysdynSchema(ReadGraph g) { \r
+ try {\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Auxiliary.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Cloud.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Configuration.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Dependency.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Flow.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Stock.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Valve.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Module.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Input.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, ModuleType.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Model.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Enumeration.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, EnumerationIndex.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, NormalExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, ParameterExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, StockExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, ConstantExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, WithLookupExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, LookupExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Redeclaration.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, LibraryDummy.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Book.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Sheet.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, DiagramContainerDummy.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, DelayExpression.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, FunctionLibrary.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, SharedFunctionLibrary.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Function.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Entity.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, ParameterOverride.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Shadow.class));\r
+ addLinkType(MappingSchemas.fromAnnotations(g, Loop.class));\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ } catch (InstantiationException e) {\r
+ e.printStackTrace();\r
+ } catch (IllegalAccessException e) {\r
+ e.printStackTrace();\r
+ } \r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.visitors.IElementVisitorVoid;\r
+\r
+@GraphType(SysdynResource.URIs.Valve)\r
+public class Valve extends IndependentVariable {\r
+ @Override\r
+ public void accept(IElementVisitorVoid v) {\r
+ v.visit(this);\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012, 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.io.StringReader;\r
+import java.util.ArrayList;\r
+import java.util.Arrays;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Set;\r
+\r
+import org.simantics.sysdyn.expressionParser.ExpressionParser;\r
+import org.simantics.sysdyn.expressionParser.ParseException;\r
+import org.simantics.sysdyn.expressionParser.Token;\r
+import org.simantics.sysdyn.representation.utils.FormatUtils;\r
+import org.simantics.sysdyn.representation.utils.RepresentationUtils;\r
+\r
+/**\r
+ * Variability of a variable in system dynamics models. \r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public enum Variability {\r
+\r
+ PARAMETER("parameter"),\r
+ CONSTANT("constant"),\r
+ CONTINUOUS("");\r
+ \r
+ \r
+ private static List<String> timeDependentFunctions = Arrays.asList(\r
+ "pre",\r
+ "delay"\r
+ );\r
+\r
+ private String text;\r
+\r
+ Variability(String text) {\r
+ this.text = text;\r
+ }\r
+\r
+ public String getText() {\r
+ return this.text;\r
+ }\r
+\r
+ /**\r
+ * Convert a textual representation to a Variability object. \r
+ * \r
+ * @param text Variability as text (parameter / constant / continuous)\r
+ * @return Variability or null\r
+ */\r
+ public static Variability fromString(String text) {\r
+ if (text != null) {\r
+ for (Variability v : Variability.values()) {\r
+ if (text.equalsIgnoreCase(v.text)) {\r
+ return v;\r
+ }\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+ /**\r
+ * Check if reference in a configuration is a parameter.\r
+ * @param variable \r
+ * @param configuration Configuration\r
+ * @param reference String reference to a variable\r
+ * @return is the reference a parameter\r
+ */\r
+ private static boolean isParameter(IndependentVariable variable, Configuration configuration, String reference, boolean allowVariables) {\r
+ // Check if references are references to sheets or enumerations. \r
+ // Sheet and Enumeration references are allowed, since sheets contain only constants / parameters\r
+ String r = reference.split("\\.")[0]; \r
+ for(IElement element : configuration.getElements()) {\r
+ if(element instanceof Module) {\r
+ Module m = (Module)element;\r
+ if(r.equals(m.getName())) {\r
+ if(!reference.contains(".")) {\r
+ // The reference contains only modules, implementation feature for the expression parser\r
+ return true;\r
+ }\r
+ Configuration moduleConfiguration = m.getType().getConfiguration();\r
+ return isParameter(variable, moduleConfiguration, reference.substring(reference.indexOf(".") + 1), allowVariables);\r
+ }\r
+ } else if(element instanceof Book) {\r
+ for(Sheet sheet : ((Book)element).getSheets()) {\r
+ if(r.equals(sheet.getName())) {\r
+ return true;\r
+ }\r
+ }\r
+ } else if(element instanceof Enumeration) {\r
+ Enumeration e = (Enumeration)element;\r
+ if(r.equals(e.getName())) {\r
+ String[] split = reference.split("\\.");\r
+ if(split.length == 1)\r
+ return true;\r
+ if(split.length == 2) {\r
+ if(split[1].equals("size") || split[1].equals("elements"))\r
+ return true;\r
+\r
+ for(EnumerationIndex ei : e.getEnumerationIndexes()) {\r
+ if(split[1].equals(ei.getName()))\r
+ return true;\r
+ }\r
+ }\r
+ }\r
+ } else if(allowVariables) {\r
+ // Only if variable references are allowed\r
+ if(element instanceof IndependentVariable && !(element instanceof Stock)) {\r
+ IndependentVariable v = (IndependentVariable)element;\r
+ if(r.equals(v.getName())) { \r
+ if(v.getName().equals(variable.getName())) // Reference to self. Can be used in pre(self)\r
+ return false;\r
+ else\r
+ return getVariability(v) != Variability.CONTINUOUS;\r
+ }\r
+ } else if(element instanceof Input) {\r
+ Input i = (Input)element;\r
+ if(r.equals(i.getName())) {\r
+ return i.getVariability() != null && !i.getVariability().equals(Variability.CONTINUOUS.getText());\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ // Try to find sheet in another way: this might be a module type configuration. Find the model configuration and its sheet\r
+ if(configuration.getModuleType() != null) {\r
+ Object parent = configuration.getModuleType().getParent();\r
+ if(parent != null && parent instanceof Model) {\r
+ configuration = ((Model)parent).getModelConfiguration();\r
+ for(IElement element : configuration.getElements()) {\r
+ if(element instanceof Book) {\r
+ for(Sheet sheet : ((Book)element).getSheets()) {\r
+ if(r.equals(sheet.getName())) {\r
+ return true;\r
+ }\r
+ }\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ \r
+ \r
+ // If there was no sheet for this reference name, or there was some other problem, return false\r
+ return false;\r
+ }\r
+ \r
+\r
+ /**\r
+ * Get variability of a variable. Allows references to other parameter variables in parameter expressions \r
+ * if game experiment is not active.\r
+ * @param variable Variable\r
+ * @return Variabilty of a variable\r
+ */\r
+ static public Variability getVariability(IndependentVariable variable) {\r
+ try {\r
+ if(RepresentationUtils.isPartOfGameExperiment(variable) && !(variable instanceof Stock)) {\r
+ \r
+ /* \r
+ * Game experiments cannot use as many parameter variables as normal experiments.\r
+ * If a parameter variable is changed, other parameter values depending on that \r
+ * parameter value are not automatically changed.\r
+ * \r
+ * Something of a hack: \r
+ * Allow variable references, if there are not incoming dependencies to the variable.\r
+ * This enables the use of derived variables for initial values of stocks.\r
+ */\r
+ if(variable.getIncomingDependencies() == null || variable.getIncomingDependencies().isEmpty())\r
+ return getVariability(variable, true, null);\r
+ else\r
+ return getVariability(variable, false, null);\r
+ } else {\r
+ return getVariability(variable, true, null);\r
+ }\r
+ } catch (StackOverflowError e) {\r
+ // For circular dependencies; selecting continuous for a good guess.\r
+ return Variability.CONTINUOUS;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Get variability of a variable\r
+ * @param variable Variable\r
+ * @param allowVariableReferences Allow references to other (parameter) variables in parameter expressions.\r
+ * @param configuration Configuration of the location for references. (null => variable.getParentConfiguration()) \r
+ * @return Variabilty of a variable\r
+ */\r
+ static public Variability getVariability(IndependentVariable variable, boolean allowVariableReferences, Configuration configuration) {\r
+ if(variable == null || variable.getExpressions() == null)\r
+ return Variability.CONTINUOUS;\r
+ \r
+ ArrayList<org.simantics.sysdyn.representation.expressions.IExpression> expressions = variable.getExpressions();\r
+\r
+ if(expressions.size() != 1)\r
+ return Variability.CONTINUOUS; // Cannot handle multiple expressions as parameters\r
+\r
+ org.simantics.sysdyn.representation.expressions.IExpression ie = expressions.get(0);\r
+\r
+ String expression = ie.getExpression();\r
+\r
+ return getVariability(variable, expression, allowVariableReferences, configuration);\r
+ }\r
+\r
+ /**\r
+ * Get the variability of an expression in a variable. Variables may have multiple expressions.\r
+ * Allows references to other (parameter) variables in parameter expressions.\r
+ * \r
+ * @param variable Variable\r
+ * @param expression Expression\r
+ * @return Variability of the expression\r
+ */\r
+ static public Variability getVariability(IndependentVariable variable, String expression) {\r
+ return getVariability(variable, expression, true, null);\r
+ }\r
+\r
+ /**\r
+ * Get the variability of an expression in a variable. Variables may have multiple expressions.\r
+ * \r
+ * @param variable Variable\r
+ * @param expression Expression\r
+ * @param allowVariableReferences Allow references to other (parameter) variables in parameter expressions\r
+ * @param configuration Configuration of the location for references. (null => variable.getParentConfiguration()) \r
+ * @return Variability of the expression\r
+ */\r
+ static public Variability getVariability(IndependentVariable variable, String expression, boolean allowVariableReferences, Configuration configuration) {\r
+ Configuration conf = configuration == null ? variable.getParentConfiguration() : configuration;\r
+ // If no variables are used in the equation, start value is used\r
+\r
+ HashMap<String, Function> functions = new HashMap<String, Function>();\r
+ if(conf != null) {\r
+ Model model = null;\r
+ if(conf.getModuleType() != null) {\r
+ ModuleType moduleType = conf.getModuleType();\r
+ if (moduleType.getParent() instanceof Model) {\r
+ model = (Model) moduleType.getParent();\r
+ }\r
+ } else {\r
+ model = conf.getModel();\r
+ }\r
+\r
+ if(model != null)\r
+ functions = model.getFunctions();\r
+ }\r
+\r
+ // First the equation is formatted and parsed\r
+ String equation = FormatUtils.formatExpressionForModelica(variable, expression, false);\r
+ ExpressionParser parser = new ExpressionParser(new StringReader(equation));\r
+ try {\r
+ parser.expr();\r
+ if(parser.getReferences().isEmpty() && parser.getFunctionCallReferences().isEmpty()) {\r
+ // if equation did not contain any references, start value is used\r
+ return Variability.PARAMETER;\r
+ } else {\r
+ Set<String> references = parser.getReferences().keySet();\r
+ \r
+ if(parser.getForIndices()!=null) {\r
+ for(Token t : parser.getForIndices().keySet()) {\r
+ references.remove(t.image);\r
+ }\r
+ }\r
+ \r
+ // Check used functions\r
+ for(String function : parser.getFunctionCallReferences().keySet()) {\r
+ if(functions.containsKey(function) && functions.get(function).hasTimeReference())\r
+ return Variability.CONTINUOUS;\r
+ else if (timeDependentFunctions.contains(function)) {\r
+ return Variability.CONTINUOUS;\r
+ }\r
+ }\r
+\r
+ // Go through each reference\r
+ for(String reference : references) {\r
+ if(!isParameter(variable, conf, reference, allowVariableReferences)) {\r
+ return Variability.CONTINUOUS;\r
+ }\r
+ }\r
+\r
+ // All found variables were sheets or non-continuous\r
+ return Variability.PARAMETER;\r
+ }\r
+ } catch (ParseException e) {\r
+ }\r
+\r
+ return Variability.CONTINUOUS;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation;\r
+\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.RelatedListElements;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.expressions.IExpression;\r
+\r
+/**\r
+ * Abstract class for representing a variable in system dynamics models \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public abstract class Variable implements IElement {\r
+ \r
+ @RelatedValue(SysdynResource.URIs.Variable_type)\r
+ protected String type;\r
+ \r
+ @RelatedValue(Layer0.URIs.HasName)\r
+ protected String name;\r
+ \r
+ @RelatedElement(Layer0.URIs.PartOf)\r
+ protected Object parent;\r
+ \r
+ @RelatedListElements(SysdynResource.URIs.Variable_arrayIndexesList)\r
+ protected ArrayList<Enumeration> arrayIndexes = new ArrayList<Enumeration>();\r
+ \r
+ @RelatedListElements(SysdynResource.URIs.Variable_expressionList)\r
+ protected ArrayList<IExpression> expressions = new ArrayList<IExpression>();\r
+ \r
+ @RelatedValue(SysdynResource.URIs.Variable_variability)\r
+ protected String variability;\r
+ \r
+ @RelatedValue(SysdynResource.URIs.Variable_unit)\r
+ protected String unit;\r
+ \r
+ @RelatedValue(Layer0.URIs.HasDescription)\r
+ protected String description;\r
+ \r
+ @RelatedElement(SysdynResource.URIs.IsOutput)\r
+ protected IElement isOutput; \r
+ \r
+ /**\r
+ * Return the variability of this variable (Used in practice only with Input variables)\r
+ * @return Variability\r
+ */\r
+ public String getVariability() {\r
+ return variability;\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return The name of this variable\r
+ */\r
+ public String getName() {\r
+ return this.name;\r
+ }\r
+ \r
+ /**\r
+ * Get Modelica compliant name\r
+ * @return The name of this variable with spaces (' ') replaced with \r
+ * underscore characters ('_')\r
+ */\r
+ public String getModelicaName() {\r
+ if (this.name == null)\r
+ return null;\r
+ return this.name.replace(' ', '_');\r
+ }\r
+ \r
+ /**\r
+ *\r
+ * @return Parent configuration of this variable (or null if something is wrong)\r
+ */\r
+ public Configuration getParentConfiguration() {\r
+ if(parent instanceof Configuration) {\r
+ return (Configuration)parent;\r
+ } else if(parent instanceof Book) {\r
+ return (Configuration)((Book)parent).getParentConfiguration();\r
+ } else {\r
+ return null;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return The type of this variable (<u>Real</u> / Boolean / ...) \r
+ */\r
+ public String getType() {\r
+ return this.type;\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return Array indexes for this variable\r
+ */\r
+ public ArrayList<Enumeration> getArrayIndexes() {\r
+ return this.arrayIndexes;\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return Expressions of this variable\r
+ */\r
+ public ArrayList<IExpression> getExpressions() {\r
+ return this.expressions;\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return Units of this variable\r
+ */\r
+ public String getUnit() {\r
+ return this.unit;\r
+ }\r
+ \r
+ /**\r
+ * Get description\r
+ * @return description\r
+ */\r
+ public String getDescription() {\r
+ if(description == null)\r
+ return "";\r
+ else \r
+ return description;\r
+ }\r
+ \r
+ public boolean isOutput() {\r
+ return !(isOutput == null);\r
+ }\r
+ \r
+ /**\r
+ * Get definition for documentation.\r
+ * \r
+ * For independent variables this is the equations\r
+ * For enumerations this is the indexes\r
+ * etc.\r
+ * @return\r
+ */\r
+ public String getDocumentationDefinition(ReadGraph graph) throws DatabaseException {\r
+ if(isOutput())\r
+ return "<br />Is output";\r
+ else\r
+ return "";\r
+ }\r
+ \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.annotations;\r
+\r
+import java.lang.annotation.ElementType;\r
+import java.lang.annotation.Retention;\r
+import java.lang.annotation.RetentionPolicy;\r
+import java.lang.annotation.Target;\r
+\r
+import org.simantics.objmap.annotations.meta.HasFieldRuleFactory;\r
+\r
+/**\r
+ * BuiltinFunctions -annotation returns the built-in functions function library \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+@Retention(RetentionPolicy.RUNTIME)\r
+@Target(ElementType.FIELD)\r
+@HasFieldRuleFactory(BuiltinFunctionsFactory.class)\r
+public @interface BuiltinFunctions {\r
+}\r
+\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+\r
+package org.simantics.sysdyn.representation.annotations;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.PossibleObjectWithType;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.MappingException;\r
+import org.simantics.objmap.rules.domain.IDomainAccessor;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Accesses the built-in functions in Sysdyn ontology\r
+ * \r
+ * @author Teemu Lempinen\r
+ */\r
+public class BuiltinFunctionsAccessor implements IDomainAccessor<Resource> {\r
+\r
+ \r
+ public BuiltinFunctionsAccessor() {\r
+ }\r
+\r
+ @Override\r
+ public Resource get(ReadGraph graph, Resource element) throws MappingException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ Resource builtinFunctions = null;\r
+ try {\r
+ Resource sysdyn = graph.getResource("http://www.simantics.org/Sysdyn-1.1");\r
+ builtinFunctions = graph.syncRequest(new PossibleObjectWithType(sysdyn, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary));\r
+ } catch (DatabaseException e) {\r
+ throw new MappingException(e);\r
+ }\r
+ return builtinFunctions;\r
+ }\r
+ \r
+ @Override\r
+ public boolean set(WriteGraph g, Resource element, Resource value)\r
+ throws MappingException {\r
+ // Built-in functions should not be set programmatically\r
+ return true; \r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.annotations;\r
+\r
+import java.lang.annotation.Annotation;\r
+import java.lang.reflect.Field;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.ResourceNotFoundException;\r
+import org.simantics.db.exception.ServiceException;\r
+import org.simantics.db.exception.ValidationException;\r
+import org.simantics.objmap.IMappingRule;\r
+import org.simantics.objmap.rules.MappedElementRule;\r
+import org.simantics.objmap.rules.factory.IFieldRuleFactory;\r
+import org.simantics.objmap.rules.range.FieldAccessor;\r
+\r
+public class BuiltinFunctionsFactory implements IFieldRuleFactory {\r
+\r
+ @Override\r
+ public IMappingRule create(ReadGraph g, Annotation _annotation, Field field) throws ResourceNotFoundException, ValidationException, ServiceException {\r
+ return new MappedElementRule(\r
+ new BuiltinFunctionsAccessor(),\r
+ new FieldAccessor<Object>(field)\r
+ );\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.utils.FormatUtils;\r
+\r
+/**\r
+ * Represents a constant expression\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.ConstantExpression)\r
+public class ConstantExpression extends Expression {\r
+\r
+ @RelatedValue(SysdynResource.URIs.Expression_equation)\r
+ private String equation;\r
+\r
+ @Override\r
+ public String getExpression() {\r
+ return equation;\r
+ } \r
+ \r
+ @Override\r
+ public String getModelicaExpression() {\r
+ return FormatUtils.replaceWhitespace(equation);\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.modelica.ModelicaWriter;\r
+import org.simantics.sysdyn.representation.utils.FormatUtils;\r
+import org.simantics.sysdyn.representation.utils.IndexUtils;\r
+import org.simantics.sysdyn.representation.utils.UnitUtils;\r
+\r
+/**\r
+ * Representation of a delay expression. The order of the \r
+ * delay can be 1-n.\r
+ * \r
+ * Delay with n = 3:\r
+ * \r
+ * DELAY3=LV3/DL\r
+ * LV3=INTEG(RT2-DELAY3,DL*input)\r
+ * RT2=LV2/DL\r
+ * LV2=INTEG(RT1-RT2,LV3)\r
+ * RT1=LV1/DL\r
+ * LV1=INTEG(input-RT1,LV3)\r
+ * DL=delay time/3\r
+ * \r
+ * DELAY3I=LV3/DL\r
+ * LV3=INTEG(RT2-DELAY3I,initial value*DL) \r
+ * RT2=LV2/DL\r
+ * LV2=INTEG(RT1-RT2,LV3)\r
+ * RT1=LV1/DL\r
+ * LV1=INTEG(input-RT1,LV3)\r
+ * DL=delay time/3\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.DelayExpression)\r
+public class DelayExpression extends Expression {\r
+\r
+ @RelatedValue(SysdynResource.URIs.DelayExpression_initialValue)\r
+ private String initialValue;\r
+\r
+ @RelatedValue(SysdynResource.URIs.DelayExpression_delayTime)\r
+ private String delayTime;\r
+\r
+ @RelatedValue(SysdynResource.URIs.DelayExpression_order)\r
+ private Integer order;\r
+\r
+ @RelatedValue(SysdynResource.URIs.DelayExpression_expression)\r
+ private String equation;\r
+\r
+ @Override\r
+ public String getDeclarationAddition() {\r
+ // instantiate the correct delay class for this expression\r
+ return "\t" + ModelicaWriter.getDelayName(order) + " " + instance() + ";\n";\r
+ }\r
+\r
+ @Override\r
+ public String getEquation() {\r
+ StringBuilder sb = new StringBuilder();\r
+\r
+ String equation = FormatUtils.replaceWhitespace(this.equation);\r
+ equation = FormatUtils.formatExpressionForModelica(parent, equation);\r
+ String delayTime = FormatUtils.replaceWhitespace(this.delayTime);\r
+ delayTime = FormatUtils.formatExpressionForModelica(parent, delayTime);\r
+ String initialValue = FormatUtils.replaceWhitespace(this.initialValue);\r
+ initialValue = FormatUtils.formatExpressionForModelica(parent, initialValue);\r
+\r
+ sb.append("\t" + instance() + "." + ModelicaWriter.getDelayValve(0) + " = " + equation + ";\n");\r
+\r
+ sb.append("\t" + instance() + "." + ModelicaWriter.DELAY_TIME + " = " + delayTime + ";\n");\r
+\r
+ sb.append("\t" + instance() + "." + ModelicaWriter.DELAY_INITIAL + " = ");\r
+ if (initialValue != null && !initialValue.isEmpty()) {\r
+ sb.append(initialValue);\r
+ } \r
+ else {\r
+ // if an initial value is not set, use the value of the first valve\r
+ sb.append(instance() + "." + ModelicaWriter.getDelayValve(0));\r
+ }\r
+ sb.append(";\n");\r
+\r
+ // set the value of the variable\r
+ String range = IndexUtils.rangeToIndexes(parent, getArrayRange());\r
+ // TODO: this variable name thing here (and in other expressions) is a hack and should be fixed\r
+ sb.append("\t" + parent.getModelicaName() + (range.equals("[:]") ? "" : range) + " = " + \r
+ instance() + "." + ModelicaWriter.getDelayValve(order) + ";\n");\r
+ \r
+ return sb.toString();\r
+ }\r
+\r
+ @Override\r
+ public String getExpression() {\r
+ return "This + is + not + a + parameter + at + any + time";\r
+ }\r
+\r
+ @Override\r
+ public String getModelicaExpression() {\r
+ return getExpression();\r
+ }\r
+\r
+ @Override\r
+ public String validateUnits(ReadGraph graph, SysdynModel model) {\r
+ if(parent.getUnit() == null)\r
+ return "Unit not defined for " + parent.getName();\r
+\r
+ String result = UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), parent.getUnit(), equation);\r
+ if(result == null)\r
+ result = UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), parent.getUnit(), initialValue);\r
+ if(result == null)\r
+ result = UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), UnitUtils.getTimeUnit(graph, model), delayTime);\r
+\r
+ return result;\r
+ }\r
+\r
+ public int getOrder() {\r
+ return order;\r
+ }\r
+\r
+ private String instance() {\r
+ // construct an identifier for this expression based on the array \r
+ // indices if necessary\r
+ String identifier;\r
+ if (getArrayRange() != null && !getArrayRange().isEmpty()) {\r
+ identifier = IndexUtils.rangeToIndexes(parent, getArrayRange()).replaceAll("[\\[\\]{},]", "_");\r
+ }\r
+ else {\r
+ identifier = "_";\r
+ }\r
+ return parent.getModelicaName() + identifier + "instance";\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.representation.IndependentVariable;\r
+import org.simantics.sysdyn.representation.utils.UnitUtils;\r
+import org.simantics.sysdyn.unitParser.TokenMgrError;\r
+\r
+/**\r
+ * Abstract class for any expression\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public abstract class Expression implements IExpression {\r
+ \r
+ @RelatedValue(SysdynResource.URIs.Expression_arrayRange)\r
+ private String range;\r
+ \r
+ @RelatedElement(Layer0.URIs.PartOf)\r
+ protected IndependentVariable parent;\r
+\r
+ @Override\r
+ public String getEquation() {\r
+ return null;\r
+ }\r
+ \r
+ @Override\r
+ public String getInitialEquation() {\r
+ return null;\r
+ }\r
+ \r
+ @Override\r
+ public String getDeclarationAddition() {\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public String getExpression() {\r
+ return null;\r
+ }\r
+ \r
+ /**\r
+ * Get Modelica compliant expression\r
+ * @return The expression with spaces (' ') replaced with \r
+ * underscore characters ('_')\r
+ */\r
+ public String getModelicaExpression() {\r
+ return null;\r
+ }\r
+ \r
+ @Override\r
+ public String getArrayRange() {\r
+ if(range == null)\r
+ return "";\r
+ else\r
+ return range;\r
+ }\r
+\r
+ @Override\r
+ public String validateUnits() {\r
+ return validateUnits(null, null);\r
+ }\r
+ \r
+ @Override\r
+ public String validateUnits(ReadGraph graph, SysdynModel model) {\r
+ return UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), parent.getUnit(), getExpression());\r
+ }\r
+ \r
+ @Override\r
+ public IndependentVariable getParent() {\r
+ return parent;\r
+ }\r
+ \r
+ @Override\r
+ public String getDocumentationExpression(ReadGraph graph) throws DatabaseException {\r
+ return getEquation();\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.representation.IndependentVariable;\r
+\r
+\r
+/**\r
+ * Interface for all expressions in System Dynamics models\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public interface IExpression {\r
+\r
+ /**\r
+ * Get any possible additions to variable declaration.\r
+ * @return additions or null\r
+ */\r
+ String getDeclarationAddition();\r
+ \r
+ /**\r
+ * Initial value for this variable and expression\r
+ * @return initial value or null\r
+ */\r
+ String getInitialEquation();\r
+ \r
+ /**\r
+ * Get the actual equation of this expression\r
+ * @return equation or null\r
+ */\r
+ String getEquation();\r
+ \r
+ /**\r
+ * Get the range of this expression\r
+ * @return Range or null if not multidimensional\r
+ */\r
+ String getArrayRange();\r
+ \r
+ /**\r
+ * Get the plain (possibly unformatted) expression from this expression. (type variable = EXPRESSION ;\n)\r
+ * @return \r
+ */\r
+ String getExpression();\r
+ \r
+ \r
+ /**\r
+ * Match the units of this expression to units of its variable\r
+ * @return null if match, Error message otherwise\r
+ */\r
+ String validateUnits();\r
+ \r
+ /**\r
+ * Match the units of this expression to units of its variable. \r
+ * \r
+ * Requests units of referred variables for request listening\r
+ * @param graph ReadGraph\r
+ * @param model SysdynModel (with mapping)\r
+ * @return null if match, ERror message otherwise\r
+ */\r
+ String validateUnits(ReadGraph graph, SysdynModel model);\r
+ \r
+ /**\r
+ * Get the owner of this expression\r
+ * @return owner of this expression\r
+ */\r
+ IndependentVariable getParent();\r
+ \r
+ \r
+ /**\r
+ * Get the representation of this expression to web documentation\r
+ * @return\r
+ */\r
+ String getDocumentationExpression(ReadGraph graph) throws DatabaseException;\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+@GraphType(SysdynResource.URIs.LookupExpression)\r
+public class LookupExpression extends Expression {\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.utils.FormatUtils;\r
+import org.simantics.sysdyn.representation.utils.IndexUtils;\r
+\r
+/**\r
+ * Representation of a normal (auxiliary) expression\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.NormalExpression)\r
+public class NormalExpression extends Expression {\r
+\r
+ @RelatedValue(SysdynResource.URIs.Expression_equation)\r
+ private String equation;\r
+ \r
+ @Override\r
+ public String getExpression() {\r
+ return equation;\r
+ }\r
+ \r
+ @Override\r
+ public String getModelicaExpression() {\r
+ return FormatUtils.replaceWhitespace(getExpression());\r
+ }\r
+ \r
+ @Override\r
+ public String getEquation() {\r
+ String equation = FormatUtils.replaceWhitespace(this.equation);\r
+ equation = FormatUtils.formatExpressionForModelica(parent, equation);\r
+ String range = IndexUtils.rangeToIndexes(parent, this.getArrayRange());\r
+ return " " + parent.getModelicaName() + (range.equals("[:]") ? "" : range) + " = " + equation + ";\n";\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.representation.utils.FormatUtils;\r
+import org.simantics.sysdyn.representation.utils.IndexUtils;\r
+\r
+/**\r
+ * Representation of a parameter expression\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.ParameterExpression)\r
+public class ParameterExpression extends Expression {\r
+ \r
+ @RelatedValue(SysdynResource.URIs.Expression_equation)\r
+ private String equation;\r
+ \r
+ @Override\r
+ public String getExpression() {\r
+ return equation + " /* Actual value read from init file */";\r
+ }\r
+ \r
+ @Override\r
+ public String getModelicaExpression() {\r
+ String equation = FormatUtils.replaceWhitespace(this.equation);\r
+ return equation + " /* Actual value read from init file */";\r
+ }\r
+\r
+ \r
+ /**\r
+ * Used when the expression is a part of an array variable. Then it is like a normal auxiliary.\r
+ */\r
+ @Override\r
+ public String getEquation() {\r
+ String equation = FormatUtils.replaceWhitespace(this.equation);\r
+ String range = IndexUtils.rangeToIndexes(parent, this.getArrayRange());\r
+ return " " + parent.getModelicaName() + (range.equals("[:]") ? "" : range) + " = " + equation + ";\n";\r
+ };\r
+ \r
+ public Double getValue() {\r
+ try {\r
+ return Double.parseDouble(equation);\r
+ } catch(NumberFormatException e) {\r
+ return null;\r
+ }\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.representation.Enumeration;\r
+import org.simantics.sysdyn.representation.Stock;\r
+import org.simantics.sysdyn.representation.Valve;\r
+import org.simantics.sysdyn.representation.utils.FormatUtils;\r
+import org.simantics.sysdyn.representation.utils.IndexUtils;\r
+import org.simantics.sysdyn.representation.utils.UnitUtils;\r
+\r
+/**\r
+ * Class representing a stock expression in a variable\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.StockExpression)\r
+public class StockExpression extends Expression {\r
+\r
+ @RelatedValue(SysdynResource.URIs.StockExpression_initialEquation)\r
+ private String initialEquation;\r
+\r
+ @RelatedValue(SysdynResource.URIs.StockExpression_integralEquation)\r
+ private String integralEquation;\r
+\r
+ @Override\r
+ public String getExpression() {\r
+ return initialEquation;\r
+ }\r
+\r
+ @Override\r
+ public String getModelicaExpression() {\r
+ return FormatUtils.replaceWhitespace(initialEquation);\r
+ }\r
+ \r
+ @Override\r
+ public String getEquation() {\r
+ return getEquation(true);\r
+ }\r
+ \r
+ private String getEquation(boolean modelicaEquation) {\r
+ \r
+ // Build range e.g. Stock[2,3]\r
+ String range = IndexUtils.rangeToIndexes(parent, this.getArrayRange());\r
+ \r
+ // Stock equation is always der(Stock)\r
+ StringBuilder b = new StringBuilder();\r
+ b.append(" der(")\r
+ .append(parent.getModelicaName() + (range.equals("[:]") ? "" : range))\r
+ .append(") = ");\r
+ \r
+ if (integralEquation != null) {\r
+ if (modelicaEquation) {\r
+ String equation = FormatUtils.replaceWhitespace(this.integralEquation);\r
+ equation = FormatUtils.formatExpressionForModelica(parent, equation);\r
+ b.append(equation).append(";\n");\r
+ } else {\r
+ b.append(integralEquation).append(";\n");\r
+ }\r
+ } else {\r
+ // Stock equation is formed automatically using incoming and outgoing flows (actually the nearest valves in those flows)\r
+ ArrayList<Valve> incoming = ((Stock)parent).getIncomingValves();\r
+ ArrayList<Valve> outgoing = ((Stock)parent).getOutgoingValves();\r
+ if(incoming.isEmpty() && outgoing.isEmpty()) {\r
+ // No connections, add 0 for each array index if any.\r
+ ArrayList<Enumeration> enumerations = parent.getArrayIndexes();\r
+ if(enumerations == null || enumerations.isEmpty()) {\r
+ b.append(" 0.0");\r
+ } else {\r
+ b.append(" zeros(");\r
+ for(int i = 0; i < enumerations.size(); i++) {\r
+ b.append(modelicaEquation ? enumerations.get(i).getModelicaName() : enumerations.get(i).getName() + ".size");\r
+ if(i != enumerations.size() - 1)\r
+ b.append(", ");\r
+ }\r
+ b.append(")");\r
+ }\r
+ \r
+ } else {\r
+ // incoming valves add and outgoing valves reduce the stock\r
+ for(Valve valve : outgoing)\r
+ b.append("\n - ").append(modelicaEquation ? valve.getModelicaName() : valve.getName() + range);\r
+ for(Valve valve : incoming)\r
+ b.append("\n + ").append(modelicaEquation ? valve.getModelicaName() : valve.getName() + range);\r
+ }\r
+ b.append(";\n");\r
+ }\r
+ return b.toString();\r
+ }\r
+ @Override\r
+ public String getInitialEquation() {\r
+ String initialEquation = FormatUtils.replaceWhitespace(this.initialEquation);\r
+ // format the initial equation for modelica execution \r
+ String equation = FormatUtils.formatExpressionForModelica(parent, initialEquation, false);\r
+ String range = IndexUtils.rangeToIndexes(parent, this.getArrayRange());\r
+ return " " + parent.getModelicaName() + (range != null ? range : "") + " = " + equation + ";\n";\r
+ }\r
+ \r
+ \r
+ /**\r
+ * Return Double representation of the initial equation for given variable\r
+ * \r
+ * @param variable\r
+ * @return Double representing the initial equation or null if initial equation is not a double\r
+ */\r
+ public Double getStartValue() {\r
+ Double value = null;\r
+ ArrayList<IExpression> expressions = parent.getExpressions();\r
+ if(expressions.size() == 1) {\r
+ IExpression e = expressions.get(0);\r
+ if(e.getInitialEquation() == null) {\r
+ try {\r
+ value = Double.parseDouble(initialEquation);\r
+ } catch(NumberFormatException e1) {\r
+ return null;\r
+ }\r
+ }\r
+ }\r
+ return value;\r
+ }\r
+\r
+ \r
+ @Override\r
+ public String validateUnits(ReadGraph graph, SysdynModel model) {\r
+ String result = UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), parent.getUnit(), initialEquation);\r
+ if(result == null) {\r
+ String integralEquation = getEquation(false);\r
+ if(integralEquation.contains("="))\r
+ result = UnitUtils.matchUnits(\r
+ graph, \r
+ model, \r
+ parent.getParentConfiguration(), \r
+ parent.getUnit(), \r
+ "(" + integralEquation.substring(integralEquation.indexOf("=") + 1, integralEquation.lastIndexOf(";")) +") * time");\r
+ }\r
+ \r
+ return result;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.expressions;\r
+\r
+import java.awt.geom.Rectangle2D;\r
+import java.io.IOException;\r
+import java.io.StringWriter;\r
+\r
+import org.jfree.chart.ChartFactory;\r
+import org.jfree.chart.JFreeChart;\r
+import org.jfree.chart.plot.PlotOrientation;\r
+import org.jfree.data.xy.DefaultXYDataset;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.jfreechart.chart.ChartUtils;\r
+import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedValue;\r
+import org.simantics.spreadsheet.Range;\r
+import org.simantics.spreadsheet.SheetVariables;\r
+import org.simantics.spreadsheet.util.SpreadsheetUtils;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.IElement;\r
+import org.simantics.sysdyn.representation.IndependentVariable;\r
+import org.simantics.sysdyn.representation.Model;\r
+import org.simantics.sysdyn.representation.Sheet;\r
+import org.simantics.sysdyn.representation.utils.FormatUtils;\r
+import org.simantics.sysdyn.representation.utils.IndexUtils;\r
+import org.simantics.sysdyn.representation.utils.SheetFormatUtils;\r
+import org.simantics.sysdyn.representation.utils.UnitUtils;\r
+\r
+/**\r
+ * Representation of a withlookup expression\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+@GraphType(SysdynResource.URIs.WithLookupExpression)\r
+public class WithLookupExpression extends Expression {\r
+\r
+ @RelatedValue(SysdynResource.URIs.WithLookupExpression_lookup)\r
+ private String lookupTable;\r
+ @RelatedValue(SysdynResource.URIs.WithLookupExpression_expression)\r
+ private String equation;\r
+\r
+ @Override\r
+ public String getEquation() {\r
+ String equation = FormatUtils.replaceWhitespace(this.equation);\r
+ equation = FormatUtils.formatExpressionForModelica(parent, equation);\r
+ String range = IndexUtils.rangeToIndexes(parent, this.getArrayRange());\r
+\r
+ return \r
+ " " + parent.getModelicaName() + (range.equals("[:]") ? "" : range) + " = interpolate(" + equation + ", " + SheetFormatUtils.reformatSheetReferences(parent, lookupTable) + ");\n";\r
+ }\r
+\r
+ @Override\r
+ public String getModelicaExpression() {\r
+ return "interpolate(" + FormatUtils.replaceWhitespace(equation) + ", " + lookupTable + ")";\r
+ }\r
+ \r
+ @Override\r
+ public String getExpression() {\r
+ return "interpolate(" + equation + ", " + lookupTable + ")";\r
+ }\r
+\r
+ @Override\r
+ public String validateUnits(ReadGraph graph, SysdynModel model) {\r
+ if(parent.getUnit() == null)\r
+ return "Unit not defined for " + parent.getName();\r
+\r
+ String result = UnitUtils.expressionUnitsValid(graph, model, parent.getParentConfiguration(), equation);\r
+ if(result == null) {\r
+ result = UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), parent.getUnit(), lookupTable);\r
+ }\r
+\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public String getDocumentationExpression(ReadGraph graph) throws DatabaseException {\r
+ String expression = super.getDocumentationExpression(graph);\r
+\r
+ // assume lookup table has format: {{1,2},{3,4}}\r
+ String table = lookupTable;\r
+\r
+ Sheet sheet = null;\r
+ if(table.matches("[a-zA-Z0-9]*\\([a-zA-Z0-9:]*\\)")) {\r
+ // try if it is a sheet reference\r
+ String name = table.substring(0, table.indexOf("("));\r
+ String range = table.substring(table.indexOf("(") + 1, table.indexOf(")"));\r
+ IndependentVariable independentVariable = getParent();\r
+ Configuration conf = independentVariable.getParentConfiguration();\r
+ Model model = conf.getModel();\r
+\r
+ if(model == null) {\r
+ Object parent = conf.getModuleType().getParent();\r
+ if(parent instanceof Model) {\r
+ model = (Model)parent;\r
+ }\r
+ }\r
+ \r
+ if(model != null) {\r
+ for(IElement e : model.getModelConfiguration().getElements()) {\r
+ if(e instanceof Sheet && name.equals(((Sheet)e).getName())) {\r
+ sheet = (Sheet)e;\r
+ Variable v = Variables.getVariable(graph, sheet.getResource());\r
+ Variable rangeVariable = v.getChild(graph, range);\r
+ Range r = SpreadsheetUtils.decodeRange(range);\r
+ if(r.endColumn - r.startColumn == 1) {\r
+ String[][] rangeCells = rangeVariable.getPropertyValue(graph, SheetVariables.RANGE_CELL_NAMES);\r
+ StringBuilder sb = new StringBuilder();\r
+ boolean firstRow = true;\r
+ for(int i = 0; i < rangeCells.length; i++) {\r
+ if(!firstRow)\r
+ sb.append(",");\r
+ firstRow = false;\r
+\r
+ boolean firstColumn = true;\r
+ for(int j = 0; j < rangeCells[i].length; j++) {\r
+ if(!firstColumn)\r
+ sb.append(",");\r
+ firstColumn = false;\r
+ sb.append(sheet.getCells().get(rangeCells[i][j]));\r
+ }\r
+ }\r
+ table = sb.toString();\r
+\r
+ }\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ if(sheet != null) {\r
+\r
+ }\r
+ }\r
+\r
+ table = table.replace("{", "");\r
+ table = table.replace("}", "");\r
+ String[] split = table.split(",");\r
+ double[] x = new double[split.length / 2];\r
+ double[] y = new double[split.length / 2];\r
+\r
+ try {\r
+ for(int i = 0; i < split.length / 2; i++) {\r
+ x[i] = Double.parseDouble(split[i*2]);\r
+ y[i] = Double.parseDouble(split[i*2+1]);\r
+ }\r
+\r
+ DefaultXYDataset dataset = new DefaultXYDataset();\r
+ dataset.addSeries("lookup", new double[][] {y, x});\r
+ JFreeChart chart = ChartFactory.createXYLineChart(\r
+ "", // chart title\r
+ "", // domain axis label\r
+ "", // range axis label\r
+ dataset, // data\r
+ PlotOrientation.HORIZONTAL, // Orientation\r
+ false, // include legend\r
+ false, // tooltips\r
+ false // urls\r
+ );\r
+\r
+ StringWriter writer = new StringWriter();\r
+ ChartUtils.writeSVG(chart, new Rectangle2D.Double(0, 0, 200, 100), writer);\r
+ writer.flush();\r
+ String svg = writer.toString();\r
+ writer.close();\r
+ svg = svg.substring(svg.indexOf("<svg"));\r
+ svg = svg.replaceAll("[\r\n]+", "");\r
+ expression = expression + "<div>" + svg + "</div>";\r
+ } catch (NumberFormatException e) {\r
+\r
+ } catch (IOException e) {\r
+ }\r
+\r
+ return expression;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.utils;\r
+\r
+import java.io.StringReader;\r
+import java.util.ArrayList;\r
+\r
+import org.simantics.sysdyn.expressionParser.ExpressionParser;\r
+import org.simantics.sysdyn.expressionParser.ParseException;\r
+import org.simantics.sysdyn.representation.Enumeration;\r
+import org.simantics.sysdyn.representation.IndependentVariable;\r
+import org.simantics.sysdyn.representation.Variability;\r
+import org.simantics.sysdyn.representation.Variable;\r
+\r
+public class FormatUtils {\r
+\r
+ /**\r
+ * Formats expressions for OpenModelica. Indexes are changed into numbers.\r
+ * @param variable Variable\r
+ * @param expression Expression\r
+ * @return Formatted expression\r
+ */\r
+ public static String formatExpressionForModelica(Variable variable, String expression) {\r
+ return formatExpressionForModelica(variable, expression, true);\r
+ }\r
+\r
+ /**\r
+ * Formats expressions for OpenModelica. Indexes are changed into numbers.\r
+ * \r
+ * @param variable Variable\r
+ * @param expression Expression\r
+ * @param gameAdditions Add game hacks?\r
+ * @return Formatted expression\r
+ */\r
+ public static String formatExpressionForModelica(Variable variable, String expression, boolean gameAdditions) {\r
+ String modified = expression;\r
+ if(gameAdditions) \r
+ // FIXME: A hack. This is needed for fmu simulation to notice changes in parameters.\r
+ // OpenModelica supports FMI 1.0, which does not support tunable variables. Problem should be fixed with FMI 2.0\r
+ modified = addGameExperimentAdditions(variable, modified);\r
+ modified = IndexUtils.equationRangesToIndexes(variable, modified);\r
+ modified = SheetFormatUtils.reformatSheetReferences(variable, modified);\r
+ return modified;\r
+ }\r
+\r
+\r
+ /**\r
+ * Adds hacks for variables to work with game experiments.\r
+ * <p>\r
+ * The hack is as follows. If the expression contains a reference to a parameter, add the following around the \r
+ * expression: \r
+ * <p><b>\r
+ * if initial() or parameter < 0 or parameter >= 0 then EXPRESSION else pre(variable)\r
+ * </b><p>\r
+ * The hack is added only if there is a reference to a parameter.\r
+ * \r
+ * @param variable Variable\r
+ * @param expression Expression\r
+ * @return Expression with added hacks for game experiments\r
+ */\r
+ private static String addGameExperimentAdditions(Variable variable, String expression) {\r
+ if(variable == null || !(variable instanceof IndependentVariable))\r
+ return expression;\r
+ if(!RepresentationUtils.isPartOfGameExperiment(variable))\r
+ return expression;\r
+\r
+ if(Variability.getVariability((IndependentVariable)variable).equals(Variability.CONTINUOUS)) {\r
+ Variable reference = RepresentationUtils.getFirstGameVariableReference(variable, expression);\r
+ if(reference != null) {\r
+ String condition;\r
+ \r
+ boolean array = reference.getArrayIndexes() != null && \r
+ reference.getArrayIndexes() != null &&\r
+ !reference.getArrayIndexes().isEmpty();\r
+ \r
+ String refName = reference.getModelicaName();\r
+ if(reference.getType().equals("Boolean")) {\r
+ condition= "if initial() or " + refName + " or not " +\r
+ refName + " then (";\r
+ } else {\r
+ if(array)\r
+ refName = "sum(" + refName + ")";\r
+ condition= "if " + refName + " < 0 or " +\r
+ refName + " >= 0 then (";\r
+ }\r
+ \r
+ String conditionEnd = ") else " + getZeros(variable);\r
+ expression = condition + expression + conditionEnd;\r
+ }\r
+\r
+ }\r
+ return expression;\r
+ } \r
+\r
+ private static String getZeros(Variable variable) {\r
+ ArrayList<Enumeration> enumerations = variable.getArrayIndexes();\r
+ if(enumerations == null || enumerations.size() == 0)\r
+ return "0";\r
+ else {\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("zeros(");\r
+ boolean first = true;\r
+ for(Enumeration e : enumerations) {\r
+ if(!first)\r
+ sb.append(", ");\r
+ first = false;\r
+ sb.append(e.getModelicaName() + ".size");\r
+ }\r
+ sb.append(")");\r
+ return sb.toString();\r
+ }\r
+ }\r
+ \r
+ /**\r
+ * Replaces each whitespace sequence with a single underscore character ('_').\r
+ * @param app String of which whitespace are replaced\r
+ * @return a new String with whitespace replaced\r
+ */\r
+ public static String replaceWhitespace(String app) {\r
+ String equation = app;\r
+ //String equation = FormatUtils.formatExpressionForModelica(variable, app, false);\r
+ ExpressionParser parser = new ExpressionParser(new StringReader(equation));\r
+ String modifiedEquation = new String(equation);\r
+\r
+ try {\r
+ parser.expr();\r
+ } catch (ParseException e) {\r
+ // TODO Auto-generated catch block\r
+ e.printStackTrace();\r
+ }\r
+\r
+ // Collect all references\r
+ ArrayList<String> allReferences = new ArrayList<String>();\r
+ allReferences.addAll(parser.getReferences().keySet());\r
+ allReferences.addAll(parser.getFunctionCallReferences().keySet());\r
+ allReferences.addAll(parser.getEnumerationReferences().keySet());\r
+ \r
+ // Replace whitespace sequences with underscore characters\r
+ for (String reference : allReferences) {\r
+ String regex = reference.replaceAll(" ", "(_|\\\\s+)");\r
+ String replacement = reference.replaceAll(" ", "_");\r
+ modifiedEquation = modifiedEquation.replaceAll(regex, replacement);\r
+ }\r
+ \r
+ return modifiedEquation;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011, 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.utils;\r
+\r
+import java.io.StringReader;\r
+import java.util.ArrayList;\r
+import java.util.StringTokenizer;\r
+\r
+import org.simantics.sysdyn.expressionParser.ExpressionParser;\r
+import org.simantics.sysdyn.expressionParser.ExpressionParser.ForRange;\r
+import org.simantics.sysdyn.expressionParser.ParseException;\r
+import org.simantics.sysdyn.expressionParser.Token;\r
+import org.simantics.sysdyn.representation.Enumeration;\r
+import org.simantics.sysdyn.representation.EnumerationIndex;\r
+import org.simantics.sysdyn.representation.Variable;\r
+\r
+public class IndexUtils {\r
+\r
+ public static int indexOf(Enumeration enumeration, String index) {\r
+ int result = -1;\r
+ ArrayList<EnumerationIndex> indexes = enumeration.getEnumerationIndexes();\r
+ for(int i = 0; i < indexes.size(); i++) {\r
+ if(indexes.get(i).getName().equals(index)) {\r
+ result = i +1;\r
+ break;\r
+ }\r
+ }\r
+ return result;\r
+ }\r
+\r
+\r
+ public static String rangeToIndexes(Variable variable, String range) {\r
+ if(variable == null)\r
+ return range;\r
+ StringBuilder sb = new StringBuilder();\r
+ if(variable.getArrayIndexes() == null || range == null)\r
+ return "";\r
+ ArrayList<Enumeration> enumerations = variable.getArrayIndexes();\r
+ StringTokenizer st = new StringTokenizer(range, "{}[]:,", true);\r
+ int index = 0;\r
+ boolean insideCurlyBrackets = false;\r
+ while(st.hasMoreTokens()) {\r
+ String rangeToken = st.nextToken().trim();\r
+ if(rangeToken.matches("[\\[\\]:]")) {\r
+ sb.append(rangeToken);\r
+ } else if(rangeToken.matches("[\\{]")) {\r
+ sb.append(rangeToken);\r
+ insideCurlyBrackets = true;\r
+ } else if(rangeToken.matches("[\\}]")) {\r
+ sb.append(rangeToken);\r
+ insideCurlyBrackets = false;\r
+ } else if (rangeToken.equals(",")) {\r
+ sb.append(rangeToken);\r
+ if (!insideCurlyBrackets) {\r
+ index++;\r
+ }\r
+ } else if(index < enumerations.size()) {\r
+ if(rangeToken.equals(enumerations.get(index).getName())) {\r
+ sb.append(":");\r
+ } else {\r
+ int i = indexOf(enumerations.get(index), rangeToken);\r
+ if(i >= 0)\r
+ sb.append(i);\r
+ else\r
+ sb.append(rangeToken);\r
+ }\r
+ } else {\r
+ sb.append(rangeToken);\r
+ }\r
+ }\r
+ return sb.toString();\r
+ }\r
+\r
+ private static String fixForRangeEnumerations(Variable variable, String equation) {\r
+ ExpressionParser parser = new ExpressionParser(new StringReader(equation));\r
+ try {\r
+ parser.expr();\r
+ for(ForRange forRange : parser.getForRanges()) {\r
+ // Concat the tokens that form the range, this is\r
+ // necessary for names that have whitespace.\r
+ String rangeString = new String(forRange.start.image);\r
+ Token temp = forRange.start;\r
+ while (!temp.equals(forRange.end)) {\r
+ temp = temp.next;\r
+ rangeString += " " + temp.image;\r
+ }\r
+ Variable v = RepresentationUtils.getVariable(variable.getParentConfiguration(), rangeString);\r
+ if(v instanceof Enumeration) {\r
+ equation = equation.replaceAll("in[\\s]*" + rangeString + "($|[^\\.])", \r
+ "in " + rangeString.replaceAll(" ", "_") + ".elements$1");\r
+ }\r
+ }\r
+ } catch (ParseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ return equation;\r
+ }\r
+\r
+ public static String equationRangesToIndexes(Variable variable, String equation) {\r
+ if(equation == null) return equation;\r
+\r
+ if(equation.contains("[")) {\r
+ StringBuilder result = new StringBuilder();\r
+ String delimiters = "+-*/(){}[],. ";\r
+ StringTokenizer st = new StringTokenizer(equation, delimiters, true);\r
+ String prevToken = st.nextToken();\r
+ result.append(prevToken);\r
+ while (st.hasMoreTokens()) {\r
+ String nextToken = st.nextToken();\r
+ if (nextToken.equals("[")) {\r
+ StringBuilder range = new StringBuilder();\r
+ range.append("[");\r
+ String rangeToken = st.nextToken();\r
+ while(!rangeToken.equals("]")) {\r
+ range.append(rangeToken);\r
+ rangeToken = st.nextToken();\r
+ }\r
+ range.append("]");\r
+\r
+ Variable prevVar = RepresentationUtils.getVariable(variable.getParentConfiguration(), prevToken.trim());\r
+ result.append(rangeToIndexes(prevVar, range.toString()));\r
+ } else {\r
+ result.append(nextToken);\r
+ }\r
+ prevToken = nextToken;\r
+ }\r
+ equation = fixForRangeEnumerations(variable, result.toString());\r
+ } else if(equation.contains("{")){\r
+ // Cases where there are {something for i in Enum} without [] brackets\r
+ equation = fixForRangeEnumerations(variable, equation);\r
+ }\r
+\r
+ return equation;\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.utils;\r
+\r
+import java.io.StringReader;\r
+import java.util.Set;\r
+\r
+import org.simantics.Simantics;\r
+import org.simantics.project.IProject;\r
+import org.simantics.simulation.experiment.IExperiment;\r
+import org.simantics.simulation.project.IExperimentManager;\r
+import org.simantics.sysdyn.expressionParser.ExpressionParser;\r
+import org.simantics.sysdyn.expressionParser.ParseException;\r
+import org.simantics.sysdyn.manager.SysdynGameExperimentBase;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.IElement;\r
+import org.simantics.sysdyn.representation.IndependentVariable;\r
+import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.Stock;\r
+import org.simantics.sysdyn.representation.Variability;\r
+import org.simantics.sysdyn.representation.Variable;\r
+\r
+public class RepresentationUtils {\r
+\r
+ /**\r
+ * Returns true, if there is an active experiment and the active experiment\r
+ * is a game experiment\r
+ * @return true, if there is an active experiment and the active experiment\r
+ * is a game experiment\r
+ */\r
+ public static boolean isGameExperimentActive() {\r
+ // Find active experiment\r
+ IProject project = Simantics.peekProject();\r
+ if (project == null)\r
+ return false;\r
+\r
+ IExperimentManager manager = project.getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);\r
+\r
+ IExperiment active = manager.getActiveExperiment();\r
+ if (active instanceof SysdynGameExperimentBase)\r
+ return true;\r
+ else\r
+ return false;\r
+ }\r
+\r
+ /**\r
+ * Find out if a variable is part of a game configuration. (This means that the variable is a \r
+ * part of a game experiment)\r
+ * @param variable\r
+ * @return\r
+ */\r
+ public static boolean isPartOfGameExperiment(Variable variable) {\r
+ Configuration conf = variable.getParentConfiguration();\r
+ if(conf != null)\r
+ return conf.isGameConfiguration();\r
+ else\r
+ return false;\r
+ }\r
+\r
+ /**\r
+ * Find out if a module is part of a game configuration. (This means that the module is a \r
+ * part of a game experiment)\r
+ * @param variable\r
+ * @return\r
+ */\r
+ public static boolean isPartOfGameExperiment(Module module) {\r
+ Configuration conf = module.getParentConfiguration();\r
+ if(conf != null)\r
+ return conf.isGameConfiguration();\r
+ else\r
+ return false;\r
+ }\r
+\r
+\r
+ /**\r
+ * Retrieves the first reference to a game variable (parameter variable) in the given\r
+ * expression or null if there is no reference to a game variable.\r
+ * <p>\r
+ * Current requirements for a game variable: Variable contains only one parameter expression.\r
+ * @param variable Variable that has the expression\r
+ * @param expression Expression\r
+ * @return The name of the first referred game variable or null if there is no such reference\r
+ */\r
+ public static Variable getFirstGameVariableReference(Variable variable, String expression) {\r
+ String equation = FormatUtils.formatExpressionForModelica(variable, expression, false);\r
+ ExpressionParser parser = new ExpressionParser(new StringReader(equation));\r
+ Variable result = null;\r
+ try {\r
+ parser.expr();\r
+ if(!parser.getReferences().isEmpty()) {\r
+ Set<String> references = parser.getReferences().keySet();\r
+ // Go through each reference\r
+ for(String reference : references) {\r
+ if((result = getGameVariableReference(variable, variable.getParentConfiguration(), reference)) != null) {\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ } catch (ParseException e) {\r
+ }\r
+ return result;\r
+ }\r
+\r
+ /**\r
+ * Test if a given reference is a game variable\r
+ * @param variable Variable that contains the reference\r
+ * @param configuration Configuration where the reference is searched in\r
+ * @param reference Reference variable name\r
+ * @return true if reference is a game variable, false otherwise\r
+ */\r
+ private static Variable getGameVariableReference(Variable variable, Configuration configuration, String reference) {\r
+\r
+ String r = reference.split("\\.")[0]; \r
+ for(IElement element : configuration.getElements()) {\r
+ if(element instanceof Module) {\r
+ Module m = (Module)element;\r
+ if(r.equals(m.getName())) {\r
+ if(!reference.contains(".")) {\r
+ // The reference contains only modules, implementation feature for the expression parser\r
+ return null;\r
+ }\r
+ Configuration moduleConfiguration = m.getType().getConfiguration();\r
+ return getGameVariableReference(variable, moduleConfiguration, reference.substring(reference.indexOf(".") + 1));\r
+ }\r
+ } else if(element instanceof IndependentVariable && !(element instanceof Stock)) {\r
+ IndependentVariable v = (IndependentVariable)element;\r
+ if(r.equals(v.getName())) { \r
+ if(v.getName().equals(variable.getName())) {\r
+ return null;// Reference to self.\r
+ } else {\r
+ if(Variability.PARAMETER.equals(Variability.getVariability(v, false, null))) {\r
+ return v;\r
+ } else {\r
+ return null;\r
+ }\r
+\r
+ /*\r
+ if(v.getExpressions() == null || v.getExpressions().getExpressions().size() > 1)\r
+ return null;\r
+\r
+ IExpression e = v.getExpressions().getExpressions().get(0);\r
+\r
+ if(e instanceof ParameterExpression)\r
+ return v;\r
+ */\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+\r
+ public static Variable getVariable(Configuration configuration, String name) {\r
+ Configuration conf = configuration;\r
+ // This function seems to be used with both whitespaced and\r
+ // underscored versions of the variable name.\r
+ String whitespacedName = name.replace('_', ' ');\r
+ String[] components = whitespacedName.split("\\.");\r
+\r
+ for(String component : components) {\r
+\r
+ Configuration newConf = null;\r
+\r
+ for(IElement element : conf.getElements()) {\r
+ if(element instanceof Variable) {\r
+ Variable variable = (Variable) element;\r
+ if(variable.getName().equals(component)) {\r
+ return variable;\r
+ }\r
+ } else if(element instanceof Module) {\r
+ Module m = (Module)element;\r
+ if(m.getName().equals(component)) {\r
+ newConf = m.getType().getConfiguration();\r
+ }\r
+ }\r
+ }\r
+\r
+ // If variable or configuration has not been found, return null\r
+ if(newConf == null)\r
+ return null;\r
+ }\r
+\r
+ return null;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.utils;\r
+\r
+import java.io.StringReader;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.simantics.sysdyn.expressionParser.ExpressionParser;\r
+import org.simantics.sysdyn.expressionParser.ParseException;\r
+import org.simantics.sysdyn.expressionParser.Token;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.IElement;\r
+import org.simantics.sysdyn.representation.Model;\r
+import org.simantics.sysdyn.representation.ModuleType;\r
+import org.simantics.sysdyn.representation.Sheet;\r
+import org.simantics.sysdyn.representation.Variable;\r
+\r
+public class SheetFormatUtils {\r
+ \r
+ public static String reformatSheetReferences(Variable v, String expression) {\r
+ if(expression == null || !expression.contains("("))\r
+ return expression;\r
+ ExpressionParser parser = new ExpressionParser(new StringReader(expression));\r
+ try {\r
+ parser.expr();\r
+\r
+ HashMap<String, List<Token>> functionCalls = parser.getFunctionCallReferences();\r
+ for(String key : functionCalls.keySet()) {\r
+ String[] parts = key.split("\\.");\r
+ Object current = v.getParentConfiguration();\r
+ \r
+ // Hack. Sheets can currently exist only in models, not in module types.\r
+ ModuleType moduleType= ((Configuration)current).getModuleType();\r
+ if(moduleType != null) {\r
+ if(moduleType.getParent() != null && moduleType.getParent() instanceof Model)\r
+ current = ((Model)moduleType.getParent()).getModelConfiguration();\r
+ }\r
+ // end Hack.\r
+ \r
+ Object found = null;\r
+ for(int i = 0; i < parts.length && current != null; i++) {\r
+ found = null;\r
+ if(current instanceof Configuration) {\r
+ for(IElement e : ((Configuration)current).getElements()) {\r
+ if(e instanceof Configuration &&\r
+ ((Variable)e).getName().equals(parts[i])) {\r
+ found = e;\r
+ break;\r
+ } else if(e instanceof Variable &&\r
+ ((Variable)e).getName().equals(parts[i])) {\r
+ found = e;\r
+ break;\r
+ } \r
+ }\r
+ }\r
+ current = found;\r
+ }\r
+ \r
+ if(current != null && current instanceof Sheet) {\r
+ \r
+ String tmp = "";\r
+ int start = 0, end = 0, call = 0;\r
+ String cellOrRange = null;\r
+ while((call = expression.indexOf(key + "(", end)) >= 0) {\r
+ start = expression.indexOf("(", call);\r
+ \r
+ tmp += expression.substring(end, start);\r
+ \r
+ end = expression.indexOf(")", start) + 1;\r
+ if(start < 0 || end < 0 || end < start) {\r
+ break;\r
+ }\r
+ cellOrRange = expression.substring(start, end);\r
+ cellOrRange = cellOrRange.substring(1, cellOrRange.length() - 1);\r
+ cellOrRange = cellOrRange.trim();\r
+ cellOrRange = cellOrRange.replace(" ", "");\r
+ \r
+ Pattern p = Pattern.compile("[-\\+\\*\\/\\(\\)\\{\\}\\[\\],\\.\\t\\n\\r\\f]");\r
+ Matcher m = p.matcher(cellOrRange);\r
+ if (m.find() || cellOrRange.split(":").length > 2 || cellOrRange.length() == 0) {\r
+ continue;\r
+ }\r
+ \r
+ // Use the cell or range in the sheet.\r
+ ((Sheet)current).use(cellOrRange);\r
+ \r
+ cellOrRange = cellOrRange.replace(":", "_");\r
+ \r
+ tmp += "." + cellOrRange;\r
+ }\r
+ tmp += expression.substring(end, expression.length());\r
+ expression = tmp;\r
+ }\r
+ }\r
+\r
+ } catch (ParseException e) {\r
+ }\r
+ return expression;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.utils;\r
+\r
+import java.io.StringReader;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.HashSet;\r
+import java.util.Set;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.PossibleObjectWithType;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.exception.ManyObjectsForFunctionalRelationException;\r
+import org.simantics.db.exception.ServiceException;\r
+import org.simantics.db.layer0.request.PossibleModel;\r
+import org.simantics.operation.Layer0X;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.IElement;\r
+import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.Shadow;\r
+import org.simantics.sysdyn.representation.Variable;\r
+import org.simantics.sysdyn.unitParser.ParseException;\r
+import org.simantics.sysdyn.unitParser.TokenMgrError;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.UnitParser;\r
+import org.simantics.sysdyn.unitParser.nodes.ComponentReferenceFull;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+public class UnitUtils {\r
+ \r
+ public static String expressionUnitsValid(ReadGraph graph, SysdynModel model, Configuration configuration, String expression) {\r
+ try {\r
+ StringReader reader = new StringReader(expression);\r
+ UnitParser parser = new UnitParser(reader);\r
+ System.out.println("expression " + expression);\r
+ UnitCheckingNode node = (UnitCheckingNode) parser.expr();\r
+ reader.close();\r
+ Set<String> components = UnitUtils.findComponents(node);\r
+ HashMap<String, String> units = UnitUtils.findUnits(graph, model, configuration, components);\r
+ \r
+ try {\r
+ node.getUnits(units, Function.getAllBuiltInFunctions(graph), allowEquivalents(graph, model));\r
+ } catch (UnitCheckingException e) {\r
+ return e.getMessage();\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ } catch (ParseException e) {\r
+ return "Cannot validate units: Syntax error in expression.";\r
+ }\r
+ return null;\r
+ }\r
+ \r
+ /**\r
+ * Determine if the Unit Equivalents checkbox is selected \r
+ * @param graph\r
+ * @param model SysdynModel of which configuration is queried\r
+ * @return true iff equivalent units are allowed\r
+ * @throws DatabaseException\r
+ */\r
+ public static boolean allowEquivalents(ReadGraph graph, SysdynModel model) throws DatabaseException {\r
+ Resource modelResource = graph.syncRequest(new PossibleModel(model.getConfigurationResource()));\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Resource unitIssueSource = graph.syncRequest(\r
+ new PossibleObjectWithType(modelResource, \r
+ Layer0X.getInstance(graph).Activates, \r
+ sr.Validations_Units_UnitIssueSource));\r
+ if(unitIssueSource == null)\r
+ return false;\r
+ \r
+ Boolean result = graph.getPossibleRelatedValue(unitIssueSource, sr.Validations_Units_UnitIssueSource_allowEquivalents, Bindings.BOOLEAN);\r
+ if(result == null)\r
+ result = false;\r
+ \r
+ return result;\r
+ }\r
+ \r
+ public static String matchUnits(ReadGraph graph, SysdynModel model, Configuration configuration, String unit, String expression) {\r
+ if(unit == null)\r
+ return "Unit not defined";\r
+ if (expression == null)\r
+ return "Expression not defined";\r
+ try {\r
+ StringReader rightReader = new StringReader(expression);\r
+ UnitParser rightParser = new UnitParser(rightReader);\r
+ UnitCheckingNode right = (UnitCheckingNode) rightParser.expr();\r
+ rightReader.close();\r
+ Set<String> components = findComponents(right);\r
+ HashMap<String, String> units = findUnits(graph, model, configuration, components);\r
+ \r
+ try {\r
+ StringReader leftReader = new StringReader(unit);\r
+ UnitParser leftParser = new UnitParser(leftReader);\r
+ UnitCheckingNode left = (UnitCheckingNode) leftParser.expr();\r
+ leftReader.close();\r
+ \r
+ try {\r
+ ArrayList<Function> functions = Function.getAllBuiltInFunctions(graph);\r
+ boolean allowEquivalents = allowEquivalents(graph, model);\r
+ UnitResult rightUnits = right.getUnits(units, functions, allowEquivalents);\r
+ UnitResult leftUnits = left.getUnits(null, functions, allowEquivalents);\r
+ \r
+ if(!rightUnits.equals(leftUnits))\r
+ return leftUnits.getCleanFullUnit() + " != " + rightUnits.getCleanFullUnit();\r
+ } catch (UnitCheckingException e) {\r
+ return e.getMessage();\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ } catch (ParseException e) {\r
+ return "Syntax error in defined unit.";\r
+ }\r
+ } catch (ParseException e) {\r
+ return "Cannot validate units: Syntax error in expression.";\r
+ } catch (TokenMgrError e) {\r
+ return "Cannot validate units: Syntax error in expression.";\r
+ }\r
+ return null;\r
+ }\r
+ \r
+ \r
+ public static HashMap<String, String> findUnits(ReadGraph graph, SysdynModel model, Configuration configuration, Set<String> components) {\r
+ HashMap<String, String> units = new HashMap<String, String>();\r
+ for(String component : components) {\r
+ Variable var = getElement(configuration, component);\r
+ if(var != null) {\r
+ \r
+ // Support listening, if graph and mapping exists\r
+ if(graph != null && model != null) {\r
+ if (var instanceof Shadow)\r
+ var = ((Shadow)var).getOriginal();\r
+ Resource varResource = model.getMapping().inverseGet(var);\r
+ if(varResource != null) {\r
+ try {\r
+ String unit = graph.getPossibleRelatedValue(varResource, SysdynResource.getInstance(graph).Variable_unit);\r
+ if(unit != null) {\r
+ units.put(component, unit);\r
+ }\r
+ } catch (ManyObjectsForFunctionalRelationException e) {\r
+ e.printStackTrace();\r
+ } catch (ServiceException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ units.put("time", getTimeUnit(graph, model));\r
+ \r
+ return units;\r
+ }\r
+ \r
+ public static String getTimeUnit(ReadGraph graph, SysdynModel model) {\r
+ try {\r
+ Resource modelResource = graph.syncRequest(new PossibleModel(model.getConfigurationResource()));\r
+ if(modelResource != null) {\r
+ String timeUnit = graph.getPossibleRelatedValue(modelResource, SysdynResource.getInstance(graph).SysdynModel_timeUnit);\r
+ if(timeUnit == null)\r
+ timeUnit = "month";\r
+ return timeUnit;\r
+ }\r
+ } catch (ManyObjectsForFunctionalRelationException e) {\r
+ e.printStackTrace();\r
+ } catch (ServiceException e) {\r
+ e.printStackTrace();\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+ return null;\r
+ }\r
+ \r
+ private static Variable getElement(Configuration configuration, String name) {\r
+ String[] elements = name.split("\\.");\r
+ String element = elements[0];\r
+ for(IElement e : configuration.getElements()) {\r
+ if(e instanceof Variable) {\r
+ Variable var = (Variable)e;\r
+ try {\r
+ if (element.equals(var.getName()))\r
+ return var;\r
+ } catch (NullPointerException npe) {\r
+ npe.printStackTrace();\r
+ System.out.println("See UnitUtils");\r
+ return null;\r
+ }\r
+ } else if(e instanceof Module && elements.length > 1) {\r
+ Module mod = (Module)e;\r
+ if(mod.getName().equals(element)) {\r
+ return getElement(mod.getType().getConfiguration(), name.substring(name.indexOf(".") + 1));\r
+ }\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+ \r
+ public static Set<String> findComponents(UnitCheckingNode node) {\r
+ HashSet<String> components = new HashSet<String>();\r
+ addComponents(node, components);\r
+ return components;\r
+ \r
+ }\r
+ \r
+ private static void addComponents(UnitCheckingNode node, HashSet<String> components) {\r
+ if(node instanceof ComponentReferenceFull) {\r
+ components.add(node.printNode());\r
+ } else {\r
+ for(int i = 0; i < node.jjtGetNumChildren(); i++) {\r
+ addComponents((UnitCheckingNode)node.jjtGetChild(i), components);\r
+ }\r
+ }\r
+ }\r
+ \r
+ \r
+ public static String matchUnits(String left, String right, ArrayList<Function> functions, boolean allowEquivalents) throws DatabaseException {\r
+ if(left == null || right == null || left.isEmpty() || right.isEmpty())\r
+ return "No unit defined";\r
+ \r
+ try {\r
+ StringReader leftReader = new StringReader(left);\r
+ UnitParser leftParser = new UnitParser(leftReader);\r
+ UnitCheckingNode leftNode = (UnitCheckingNode) leftParser.expr();\r
+ leftReader.close();\r
+ try {\r
+ StringReader rightReader = new StringReader(right);\r
+ UnitParser rightParser = new UnitParser(rightReader);\r
+ UnitCheckingNode rightNode = (UnitCheckingNode) rightParser.expr();\r
+ rightReader.close();\r
+ \r
+ try {\r
+ UnitResult leftUnits = leftNode.getUnits(null, functions, allowEquivalents);\r
+ UnitResult rightUnits = rightNode.getUnits(null, functions, allowEquivalents);\r
+ \r
+ if(!rightUnits.equals(leftUnits))\r
+ return leftUnits.getCleanFullUnit() + " != " + rightUnits.getCleanFullUnit();\r
+ } catch (UnitCheckingException e) {\r
+ return e.getMessage();\r
+ }\r
+ } catch (ParseException e) {\r
+ return "Cannot validate units: Syntax error in expression.";\r
+ }\r
+ } catch (ParseException e) {\r
+ return "Syntax error in defined unit.";\r
+ }\r
+ return null;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.visitors;\r
+\r
+import org.simantics.sysdyn.representation.Auxiliary;\r
+import org.simantics.sysdyn.representation.Book;\r
+import org.simantics.sysdyn.representation.Cloud;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.Dependency;\r
+import org.simantics.sysdyn.representation.DiagramContainerDummy;\r
+import org.simantics.sysdyn.representation.Enumeration;\r
+import org.simantics.sysdyn.representation.Flow;\r
+import org.simantics.sysdyn.representation.Input;\r
+import org.simantics.sysdyn.representation.LibraryDummy;\r
+import org.simantics.sysdyn.representation.Loop;\r
+import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.Stock;\r
+import org.simantics.sysdyn.representation.Valve;\r
+import org.simantics.sysdyn.representation.Variable;\r
+\r
+public class ElementVisitorVoidAdapter implements IElementVisitorVoid {\r
+\r
+ @Override\r
+ public void visit(Auxiliary auxiliary) {\r
+ }\r
+\r
+ @Override\r
+ public void visit(Stock stock) {\r
+ }\r
+\r
+ @Override\r
+ public void visit(Valve valve) {\r
+ }\r
+\r
+ @Override\r
+ public void visit(Cloud cloud) {\r
+ }\r
+\r
+ @Override\r
+ public void visit(Input input) {\r
+ }\r
+\r
+ @Override\r
+ public void visit(Dependency dependency) {\r
+ }\r
+\r
+ @Override\r
+ public void visit(Flow flow) {\r
+ }\r
+ \r
+ @Override\r
+ public void visit(Module module) {\r
+ }\r
+\r
+ @Override\r
+ public void visit(Configuration configuration) {\r
+ }\r
+ \r
+ @Override\r
+ public void visit(Enumeration enumeration) {\r
+ }\r
+ \r
+ @Override\r
+ public void visit(LibraryDummy libraryDummy) {\r
+ }\r
+ \r
+ @Override\r
+ public void visit(Book sheet) {\r
+ }\r
+ \r
+ @Override\r
+ public void visit(DiagramContainerDummy container) {\r
+ }\r
+ \r
+ @Override\r
+ public void visit(Variable variable) {\r
+ }\r
+ \r
+ @Override\r
+ public void visit(Loop loop) {\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.representation.visitors;\r
+\r
+import org.simantics.sysdyn.representation.Auxiliary;\r
+import org.simantics.sysdyn.representation.Book;\r
+import org.simantics.sysdyn.representation.Cloud;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.Dependency;\r
+import org.simantics.sysdyn.representation.DiagramContainerDummy;\r
+import org.simantics.sysdyn.representation.Enumeration;\r
+import org.simantics.sysdyn.representation.Flow;\r
+import org.simantics.sysdyn.representation.Input;\r
+import org.simantics.sysdyn.representation.LibraryDummy;\r
+import org.simantics.sysdyn.representation.Loop;\r
+import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.Stock;\r
+import org.simantics.sysdyn.representation.Valve;\r
+import org.simantics.sysdyn.representation.Variable;\r
+\r
+public interface IElementVisitorVoid {\r
+\r
+ void visit(Auxiliary auxiliary);\r
+ void visit(Stock stock);\r
+ void visit(Valve valve);\r
+ void visit(Cloud cloud);\r
+ void visit(Input input);\r
+ void visit(Dependency dependency);\r
+ void visit(Flow flow); \r
+ void visit(Module module);\r
+ void visit(Configuration configuration);\r
+ void visit(Enumeration enumeration);\r
+ void visit(LibraryDummy libraryDummy);\r
+ void visit(Book sheet);\r
+ void visit(DiagramContainerDummy container);\r
+ void visit(Variable variable);\r
+ void visit(Loop loop);\r
+ \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010, 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.simulation;\r
+\r
+import java.text.SimpleDateFormat;\r
+import java.util.Calendar;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Status;\r
+import org.eclipse.core.runtime.jobs.Job;\r
+import org.eclipse.ui.PlatformUI;\r
+import org.simantics.modelica.IModelicaMonitor;\r
+import org.simantics.sysdyn.manager.OldSysdynExperiment;\r
+import org.simantics.sysdyn.manager.SysdynConsole;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+\r
+public class SimulationJob extends Job {\r
+\r
+ private SysdynModel model;\r
+ private OldSysdynExperiment experiment;\r
+ private IModelicaMonitor monitor;\r
+ \r
+ public SimulationJob(SysdynModel model, OldSysdynExperiment experiment) {\r
+ super("Simulate " + model.getConfiguration().getLabel());\r
+ this.model = model;\r
+ this.experiment = experiment;\r
+ if(PlatformUI.isWorkbenchRunning()) {\r
+ this.monitor = SysdynConsole.INSTANCE;\r
+ } else {\r
+ // Fallback to headless\r
+ this.monitor = new HeadlessModelicaMonitor();\r
+ }\r
+ }\r
+\r
+ @Override\r
+ protected IStatus run(IProgressMonitor monitor) {\r
+ monitor.beginTask("Simulate " + model.getConfiguration().getLabel(), experiment.numberOfSimulationRunSteps()); \r
+ try {\r
+ model.update();\r
+ if(experiment instanceof OldSysdynExperiment) {\r
+ ((OldSysdynExperiment)experiment).simulate(this.monitor, monitor, model.getConfiguration().getLabel());\r
+ model.setStructureModified(false);\r
+ }\r
+ } catch (Exception e) {\r
+ e.printStackTrace();\r
+ this.monitor.showConsole();\r
+ return new Status(\r
+ Status.ERROR, \r
+ "org.simantics.sysdyn.ui", \r
+ "Simulation failed: \n" + e.getMessage());\r
+ } \r
+ this.monitor.message("\n");\r
+ monitor.done(); \r
+ return Status.OK_STATUS;\r
+ }\r
+\r
+ @Override\r
+ public boolean belongsTo(Object family) {\r
+ return "SimulationJob".equals(family);\r
+ }\r
+\r
+ public static class HeadlessModelicaMonitor implements IModelicaMonitor {\r
+ public HeadlessModelicaMonitor() {\r
+ }\r
+\r
+ @Override\r
+ public void message(String message) {\r
+ message(message, "hh:mm:ss");\r
+ }\r
+\r
+ /**\r
+ * Print message to a console with a specified time stamp format\r
+ * \r
+ * @param message the message to be printed\r
+ * @param timeStampFormat simpledateformat timestamp format. null if no timestamp wanted\r
+ */\r
+ public void message(String message, String timeStampFormat) {\r
+ Calendar cal = Calendar.getInstance();\r
+ SimpleDateFormat sdf = new SimpleDateFormat(timeStampFormat);\r
+ String time = sdf.format(cal.getTime());\r
+\r
+ System.out.println("[" + time +"] " + message);\r
+ }\r
+\r
+ public void clearConsole() {\r
+ }\r
+\r
+ public void showConsole() {\r
+ }\r
+\r
+ }\r
+\r
+ @Override\r
+ protected void canceling() {\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.simulation;\r
+\r
+import org.simantics.sysdyn.manager.OldSysdynExperiment;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+\r
+public class SimulationScheduler {\r
+ SysdynModel model;\r
+ OldSysdynExperiment experiment;\r
+ SimulationJob job;\r
+ \r
+ private SimulationScheduler(SysdynModel model, OldSysdynExperiment experiment) { \r
+ this.model = model;\r
+ this.experiment = experiment;\r
+ this.job = new SimulationJob(model, experiment);\r
+ }\r
+ \r
+ private void start() {\r
+ job.schedule();\r
+ }\r
+\r
+ public static synchronized SimulationScheduler start(SysdynModel model, OldSysdynExperiment experiment) {\r
+ SimulationScheduler scheduler = model.getService(SimulationScheduler.class);\r
+ if(scheduler == null || !scheduler.experiment.equals(experiment)) {\r
+ scheduler = new SimulationScheduler(model, experiment);\r
+ model.addService(SimulationScheduler.class, scheduler);\r
+ scheduler.start();\r
+ } else {\r
+ scheduler.start();\r
+ }\r
+ return scheduler;\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.solver;\r
+\r
+import org.simantics.sysdyn.solver.SolverSettings.SolverType;\r
+\r
+public interface ISolver {\r
+ \r
+ public void initialize() throws Exception;\r
+ public void buildModel() throws Exception;\r
+ public void runSolver() throws Exception;\r
+ public void updateResults() throws Exception;\r
+ public SolverType getType();\r
+ \r
+ public double[] getSubscribedResults(double[] array);\r
+ \r
+ public void prepareToStep() throws Exception;\r
+ public void simulateStep() throws Exception ;\r
+ \r
+ public void setStepLength(double length) throws Exception ;\r
+ public double getTime();\r
+ \r
+ public void setRealValue(String name, double value) throws Exception ;\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.solver;\r
+\r
+import org.simantics.modelica.IModelicaMonitor;\r
+\r
+public interface ISolverMonitor extends IModelicaMonitor {\r
+ public void message(String message);\r
+ public void clearConsole();\r
+ public void showConsole();\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.solver;\r
+\r
+import java.io.File;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.modelica.ModelicaManager;\r
+import org.simantics.modelica.SimulationLocation;\r
+import org.simantics.sysdyn.manager.FunctionUtils;\r
+import org.simantics.sysdyn.manager.SysdynDataSet;\r
+import org.simantics.sysdyn.manager.SysdynExperiment;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.modelica.ModelicaWriter;\r
+import org.simantics.sysdyn.representation.Model;\r
+import org.simantics.sysdyn.solver.SolverSettings.SolverType;\r
+import org.simantics.utils.FileUtils;\r
+\r
+import fi.semantum.sysdyn.solver.Solver;\r
+\r
+public class InternalSolver implements ISolver {\r
+\r
+ public static final boolean PRINT_CODE = false;\r
+ \r
+ private SysdynExperiment experiment;\r
+ private SysdynModel model;\r
+ private ISolverMonitor monitor;\r
+ public Solver solver;\r
+ \r
+ private double start;\r
+ private double stop;\r
+ private double step;\r
+ private double interval;\r
+ \r
+ private final boolean isGame;\r
+ \r
+ private SimulationLocation location;\r
+\r
+ private HashMap<String, SysdynDataSet> results;\r
+\r
+ public InternalSolver(SysdynExperiment experiment, SysdynModel model, boolean isGame, ISolverMonitor monitor) {\r
+ this.experiment = experiment;\r
+ this.model = model;\r
+ this.monitor = monitor;\r
+ this.isGame = isGame;\r
+ \r
+ solver = new Solver();\r
+ \r
+ // default values\r
+ start = 0;\r
+ stop = 500;\r
+ step = 0.1;\r
+ interval = step;\r
+ }\r
+\r
+ @Override\r
+ public void initialize() throws Exception {\r
+ \r
+ // set solver parameters\r
+ Model representation = model.getConfiguration().getModel();\r
+ // TODO: should probably check that the values actually make sense\r
+ // i.e. start and stop >= 0, start <= stop, stop - start >= step\r
+ if (representation.getStartTime() != null)\r
+ start = representation.getStartTime();\r
+ if (representation.getStopTime() != null)\r
+ stop = representation.getStopTime();\r
+ \r
+// String omVersion = ModelicaManager.getDefaultOMVersion();\r
+ String modelContent = ModelicaWriter.write(model.getModules(), start, isGame, "1.9");\r
+\r
+ // update some stuff\r
+ FunctionUtils.updateFunctionFilesForExperiment(experiment);\r
+\r
+ location = ModelicaManager.createSimulationLocation(experiment.getExperimentDir(), \r
+ model.getConfiguration().getLabel(), modelContent, null, false);\r
+ \r
+ if (representation.getSimulationStepLength() != null)\r
+ step = representation.getSimulationStepLength();\r
+ else\r
+ step = (stop - start) / 500;\r
+ \r
+ if (representation.getOutputInterval() != null)\r
+ interval = representation.getOutputInterval();\r
+ else\r
+ interval = step;\r
+ \r
+ solver.setStep(step);\r
+ solver.setStart(start);\r
+ }\r
+\r
+ @Override\r
+ public void buildModel() throws Exception {\r
+ \r
+// String flat = ModelicaManager.getFlatModelText(location, monitor, FunctionUtils.getLibraryPathsForModelica(experiment));\r
+// System.err.println("=== FLAT ===");\r
+// System.err.println(flat);\r
+// System.err.println("=== FLAT ENDS ===");\r
+ \r
+ StringBuilder code = new StringBuilder();\r
+ for(String path : FunctionUtils.getLibraryPathsForModelica(experiment)) {\r
+ File f = new File(location.modelFile.getParentFile(), path);\r
+ code.append(FileUtils.getContents(f));\r
+ }\r
+ code.append(FileUtils.getContents(location.modelFile));\r
+ \r
+ if(PRINT_CODE) {\r
+ System.err.println("=== CODE === ");\r
+ System.err.println(code.toString());\r
+ System.err.println("=== CODE ENDS ===");\r
+ }\r
+\r
+ solver.prepare(code.toString());\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void runSolver() throws Exception {\r
+ \r
+ long startTime = System.nanoTime();\r
+ \r
+ // the number of result intervals in the simulation (account for initial values)\r
+ int count = (int)((stop - start) / interval) + 1;\r
+ // the number of steps in one result interval\r
+ int steps = (int)(interval / step);\r
+ \r
+ // an array containing an accurate time stamp for each interval\r
+ double[] times = new double[count];\r
+ // a map containing values of all variables for each interval\r
+\r
+ String[] keys = solver.keys();\r
+\r
+ double[][] values = new double[keys.length][];\r
+ \r
+// HashMap<String, double[]> values = new HashMap<String, double[]>();\r
+ // initialize the temporary data structures\r
+ times[0] = start;\r
+ \r
+ double[] valueArray = solver.values();\r
+// HashMap<String, Double> tmp = solver.values();\r
+// String[] keys = new ArrayList<String>(tmp.keySet()).toArray(new String[tmp.size()]);\r
+\r
+ for(int i=0;i<keys.length;i++) {\r
+ values[i] = new double[count];\r
+ values[i][0] = valueArray[i];\r
+ }\r
+ \r
+ // run the simulation\r
+ for (int interval = 1; interval < count; interval++) {\r
+ for (int i = 0; i < steps; i++) {\r
+ solver.step();\r
+ }\r
+ times[interval] = times[interval-1] + steps * step;\r
+\r
+ valueArray = solver.values();\r
+ for(int i=0;i<keys.length;i++) {\r
+ values[i][interval] = valueArray[i];\r
+ }\r
+ \r
+ }\r
+\r
+ results = new HashMap<String, SysdynDataSet>();\r
+ for(int i=0;i<keys.length;i++) {\r
+ String name = keys[i];\r
+ double[] arr = values[i];\r
+ results.put(name, new SysdynDataSet(name, null, times, arr));\r
+ }\r
+\r
+// for (String name : values.keySet()) {\r
+// results.put(name, new SysdynDataSet(name, null, times, values.get(name)));\r
+// }\r
+ \r
+ long endTime = System.nanoTime();\r
+ \r
+ System.err.println("ran simulation in " + 1e-6*(endTime-startTime) + "ms.");\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void updateResults() throws Exception {\r
+ InternalSolverResult result = new InternalSolverResult(null, results);\r
+ experiment.setCurrentResult(result);\r
+ experiment.resultsChanged();\r
+ }\r
+\r
+ @Override\r
+ public SolverType getType() {\r
+ return SolverType.INTERNAL;\r
+ }\r
+ \r
+ @Override\r
+ public double[] getSubscribedResults(double[] array) {\r
+ return solver.values();\r
+ }\r
+ \r
+ @Override\r
+ public double getTime() {\r
+ return solver.getTime();\r
+ }\r
+ \r
+ @Override\r
+ public void prepareToStep() throws Exception {\r
+ solver.aboutToRun();\r
+ }\r
+ \r
+ @Override\r
+ public void setRealValue(String name, double value) throws Exception {\r
+ solver.setValue(name, value);\r
+ }\r
+\r
+ @Override\r
+ public void simulateStep() throws Exception {\r
+ solver.step();\r
+ }\r
+\r
+ @Override\r
+ public void setStepLength(double length) throws Exception {\r
+ solver.setStep(length);\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.solver;\r
+\r
+import java.io.File;\r
+import java.util.HashMap;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.simantics.sysdyn.manager.SysdynDataSet;\r
+import org.simantics.sysdyn.manager.SysdynResult;\r
+\r
+public class InternalSolverResult extends SysdynResult {\r
+ \r
+ private HashMap<String, SysdynDataSet> results;\r
+\r
+ public InternalSolverResult(String resultName, HashMap<String, SysdynDataSet> results) {\r
+ super(resultName);\r
+ this.results = results;\r
+ }\r
+\r
+ @Override\r
+ public SysdynDataSet getDataSet(String variable) {\r
+ return results.get(variable);\r
+ }\r
+\r
+ @Override\r
+ public void saveToFile(File file, IProgressMonitor progressMonitor) {\r
+ // not implemented\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.solver;\r
+\r
+import org.simantics.fmu.FMUJNIException;\r
+import org.simantics.sysdyn.manager.SysdynGameExperiment;\r
+import org.simantics.sysdyn.solver.SolverSettings.SolverType;\r
+\r
+public class ModelicaSolver implements ISolver {\r
+ \r
+ SysdynGameExperiment exp;\r
+ \r
+ public ModelicaSolver(SysdynGameExperiment exp) {\r
+ this.exp = exp;\r
+ }\r
+ \r
+ @Override\r
+ public void initialize() throws Exception {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void buildModel() throws Exception {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void runSolver() throws Exception {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void updateResults() throws Exception {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public SolverType getType() {\r
+ // TODO Auto-generated method stub\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public double[] getSubscribedResults(double[] array) {\r
+ // TODO Auto-generated method stub\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public void prepareToStep() throws Exception {\r
+\r
+ // initialize if not initialized\r
+ if(!exp.control.isInitialized()) {\r
+ exp.control.setTime(exp.startTime);\r
+ exp.control.initializeSimulation();\r
+ exp.clearResults();\r
+ // getInitialResultValues();\r
+ }\r
+\r
+ exp.control.setStepLength(exp.stepLength); // Set step length each time in case there has been changes\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void simulateStep() throws Exception {\r
+ exp.control.simulateStep();\r
+ }\r
+\r
+ @Override\r
+ public void setStepLength(double length) throws Exception {\r
+ exp.control.setStepLength(length);\r
+ }\r
+\r
+ @Override\r
+ public double getTime() {\r
+ if(exp.control != null) {\r
+ try {\r
+ return exp.control.getTime();\r
+ } catch (FMUJNIException e) {\r
+ }\r
+ }\r
+ return 0.0;\r
+ }\r
+\r
+ @Override\r
+ public void setRealValue(String name, double value) throws Exception {\r
+ exp.control.setRealValue(name, value);\r
+ }\r
+\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.solver;\r
+\r
+public class SolverParameters {\r
+ public static final String START_VALUE = "startTime";\r
+ public static final String STOP_VALUE = "stopTime";\r
+ public static final String OUTPUT_FORMAT = "outputFormat";\r
+ public static final String STEP_VALUE = "stepSize";\r
+ public static final String NUMBER_OF_INTERVALS = "numberOfIntervals";\r
+ public static final String METHOD = "method";\r
+ public static final String TOLERANCE = "tolerance";\r
+ public static final String VARIABLE_FILTER = "variableFilter";\r
+ public static final String OUTPUT_INTERVAL = "outputInterval";\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.solver;\r
+\r
+import org.eclipse.core.runtime.Platform;\r
+\r
+public class SolverSettings {\r
+ \r
+ public enum SolverType {\r
+ INTERNAL, OPENMODELICA, UNKNOWN\r
+ }\r
+ \r
+ public static final String QUALIFIER = "org.simantics.sysdyn.solver.preferences";\r
+ \r
+ public static final String SOLVER_TYPE = "SOLVER_TYPE";\r
+ public static final String SOLVER_TYPE_INTERNAL = "INTERNAL";\r
+ public static final String SOLVER_TYPE_OPENMODELICA = "OPENMODELICA";\r
+ \r
+ public static SolverType getSelectedSolverType() {\r
+ String type = Platform.getPreferencesService().getString(QUALIFIER, SOLVER_TYPE, null, null);\r
+ \r
+ if (type == null) {\r
+ // solver type is not set, should not happen since the default \r
+ // value should be in plugin_customization.ini\r
+ return SolverType.OPENMODELICA;\r
+ }\r
+ if (SOLVER_TYPE_INTERNAL.equals(type)) {\r
+ return SolverType.INTERNAL;\r
+ }\r
+ else if (SOLVER_TYPE_OPENMODELICA.equals(type)) {\r
+ return SolverType.OPENMODELICA;\r
+ }\r
+ else {\r
+ return SolverType.UNKNOWN;\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.solver;\r
+\r
+import gnu.trove.map.TObjectIntMap;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Status;\r
+import org.eclipse.core.runtime.jobs.Job;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.Simantics;\r
+import org.simantics.issues.Severity;\r
+import org.simantics.issues.common.CountModelIssuesBySeverity;\r
+import org.simantics.sysdyn.manager.SysdynConsole;\r
+import org.simantics.sysdyn.manager.SysdynExperiment;\r
+import org.simantics.sysdyn.solver.SolverSettings.SolverType;\r
+\r
+public class SysdynSimulationJob extends Job {\r
+ \r
+ private static final String pluginId = "unknown";\r
+ \r
+ protected String name;\r
+ protected SysdynExperiment experiment;\r
+ protected ISolver solver;\r
+ protected ISolverMonitor solverMonitor;\r
+\r
+ public SysdynSimulationJob(String name, SysdynExperiment experiment) {\r
+ super(name);\r
+ this.name = name;\r
+ this.experiment = experiment;\r
+ this.solver = null;\r
+ this.solverMonitor = SysdynConsole.INSTANCE;\r
+ }\r
+\r
+ @Override\r
+ protected IStatus run(IProgressMonitor monitor) {\r
+ monitor.beginTask("Simulate " + name, 4);\r
+ \r
+ // model update is necessary as it upgrades the isStructureModifier \r
+ // flag, could possibly be done differently if avoiding the graph\r
+ // operation is desired\r
+ try {\r
+ experiment.sysdynModel.update();\r
+ }\r
+ catch (DatabaseException e) {\r
+ return new Status(Status.ERROR, pluginId, "Could not update model", e);\r
+ }\r
+ \r
+ // do not simulate if there are errors in the model\r
+ try {\r
+ TObjectIntMap<Severity> severeties = \r
+ Simantics.sync(new CountModelIssuesBySeverity(experiment.getModel(), true, Severity.ERROR));\r
+ if (severeties.get(Severity.ERROR) > 0) {\r
+ return new Status(Status.ERROR, pluginId, "There are unresolved errors in the model");\r
+ }\r
+ }\r
+ catch (DatabaseException e) {\r
+ return new Status(Status.ERROR, pluginId, "Could not obtain issue count from model", e);\r
+ }\r
+ \r
+ SolverType type = experiment.getSolverType();\r
+ // if the solver has not been created yet or the type of the solver \r
+ // has changed, a new solver must be created\r
+ if (solver == null || !solver.getType().equals(type)) {\r
+ if (SolverType.INTERNAL.equals(type)) {\r
+ solver = new InternalSolver(experiment, experiment.sysdynModel, false, solverMonitor);\r
+ }\r
+ else if (SolverType.OPENMODELICA.equals(type)) {\r
+ return new Status(Status.ERROR, pluginId, "The experiment should be reloaded");\r
+ }\r
+ }\r
+ \r
+ // TODO: this should be broken down\r
+ \r
+ try {\r
+ monitor.subTask("generating model...");\r
+ solver.initialize();\r
+ monitor.worked(1);\r
+ \r
+ monitor.subTask("building model...");\r
+ solver.buildModel();\r
+ monitor.worked(1);\r
+ \r
+ monitor.subTask("running solver...");\r
+ solver.runSolver();\r
+ monitor.worked(1);\r
+ \r
+ monitor.subTask("getting results...");\r
+ solver.updateResults();\r
+ monitor.worked(1);\r
+ }\r
+ catch (Exception e) {\r
+ return new Status(Status.ERROR, pluginId, "Simulation failed", e);\r
+ }\r
+ \r
+ monitor.done();\r
+ return Status.OK_STATUS;\r
+ }\r
+ \r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */\r
+/* JavaCCOptions:KEEP_LINE_COL=null */\r
+package org.simantics.sysdyn.tableParser;\r
+\r
+/**\r
+ * This exception is thrown when parse errors are encountered.\r
+ * You can explicitly create objects of this exception type by\r
+ * calling the method generateParseException in the generated\r
+ * parser.\r
+ *\r
+ * You can modify this class to customize your error reporting\r
+ * mechanisms so long as you retain the public fields.\r
+ */\r
+public class ParseException extends Exception {\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /**\r
+ * This constructor is used by the method "generateParseException"\r
+ * in the generated parser. Calling this constructor generates\r
+ * a new object of this type with the fields "currentToken",\r
+ * "expectedTokenSequences", and "tokenImage" set.\r
+ */\r
+ public ParseException(Token currentTokenVal,\r
+ int[][] expectedTokenSequencesVal,\r
+ String[] tokenImageVal\r
+ )\r
+ {\r
+ super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));\r
+ currentToken = currentTokenVal;\r
+ expectedTokenSequences = expectedTokenSequencesVal;\r
+ tokenImage = tokenImageVal;\r
+ }\r
+\r
+ /**\r
+ * The following constructors are for use by you for whatever\r
+ * purpose you can think of. Constructing the exception in this\r
+ * manner makes the exception behave in the normal way - i.e., as\r
+ * documented in the class "Throwable". The fields "errorToken",\r
+ * "expectedTokenSequences", and "tokenImage" do not contain\r
+ * relevant information. The JavaCC generated code does not use\r
+ * these constructors.\r
+ */\r
+\r
+ public ParseException() {\r
+ super();\r
+ }\r
+\r
+ /** Constructor with message. */\r
+ public ParseException(String message) {\r
+ super(message);\r
+ }\r
+\r
+\r
+ /**\r
+ * This is the last token that has been consumed successfully. If\r
+ * this object has been created due to a parse error, the token\r
+ * followng this token will (therefore) be the first error token.\r
+ */\r
+ public Token currentToken;\r
+\r
+ /**\r
+ * Each entry in this array is an array of integers. Each array\r
+ * of integers represents a sequence of tokens (by their ordinal\r
+ * values) that is expected at this point of the parse.\r
+ */\r
+ public int[][] expectedTokenSequences;\r
+\r
+ /**\r
+ * This is a reference to the "tokenImage" array of the generated\r
+ * parser within which the parse error occurred. This array is\r
+ * defined in the generated ...Constants interface.\r
+ */\r
+ public String[] tokenImage;\r
+\r
+ /**\r
+ * It uses "currentToken" and "expectedTokenSequences" to generate a parse\r
+ * error message and returns it. If this object has been created\r
+ * due to a parse error, and you do not catch it (it gets thrown\r
+ * from the parser) the correct error message\r
+ * gets displayed.\r
+ */\r
+ private static String initialise(Token currentToken,\r
+ int[][] expectedTokenSequences,\r
+ String[] tokenImage) {\r
+ String eol = System.getProperty("line.separator", "\n");\r
+ StringBuffer expected = new StringBuffer();\r
+ int maxSize = 0;\r
+ for (int i = 0; i < expectedTokenSequences.length; i++) {\r
+ if (maxSize < expectedTokenSequences[i].length) {\r
+ maxSize = expectedTokenSequences[i].length;\r
+ }\r
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {\r
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');\r
+ }\r
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {\r
+ expected.append("...");\r
+ }\r
+ expected.append(eol).append(" ");\r
+ }\r
+ String retval = "Encountered \"";\r
+ Token tok = currentToken.next;\r
+ for (int i = 0; i < maxSize; i++) {\r
+ if (i != 0) retval += " ";\r
+ if (tok.kind == 0) {\r
+ retval += tokenImage[0];\r
+ break;\r
+ }\r
+ retval += " " + tokenImage[tok.kind];\r
+ retval += " \"";\r
+ retval += add_escapes(tok.image);\r
+ retval += " \"";\r
+ tok = tok.next;\r
+ }\r
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;\r
+ retval += "." + eol;\r
+ if (expectedTokenSequences.length == 1) {\r
+ retval += "Was expecting:" + eol + " ";\r
+ } else {\r
+ retval += "Was expecting one of:" + eol + " ";\r
+ }\r
+ retval += expected.toString();\r
+ return retval;\r
+ }\r
+\r
+ /**\r
+ * The end of line string for this machine.\r
+ */\r
+ protected String eol = System.getProperty("line.separator", "\n");\r
+\r
+ /**\r
+ * Used to convert raw characters to their escaped version\r
+ * when these raw version cannot be used as part of an ASCII\r
+ * string literal.\r
+ */\r
+ static String add_escapes(String str) {\r
+ StringBuffer retval = new StringBuffer();\r
+ char ch;\r
+ for (int i = 0; i < str.length(); i++) {\r
+ switch (str.charAt(i))\r
+ {\r
+ case 0 :\r
+ continue;\r
+ case '\b':\r
+ retval.append("\\b");\r
+ continue;\r
+ case '\t':\r
+ retval.append("\\t");\r
+ continue;\r
+ case '\n':\r
+ retval.append("\\n");\r
+ continue;\r
+ case '\f':\r
+ retval.append("\\f");\r
+ continue;\r
+ case '\r':\r
+ retval.append("\\r");\r
+ continue;\r
+ case '\"':\r
+ retval.append("\\\"");\r
+ continue;\r
+ case '\'':\r
+ retval.append("\\\'");\r
+ continue;\r
+ case '\\':\r
+ retval.append("\\\\");\r
+ continue;\r
+ default:\r
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+ String s = "0000" + Integer.toString(ch, 16);\r
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+ } else {\r
+ retval.append(ch);\r
+ }\r
+ continue;\r
+ }\r
+ }\r
+ return retval.toString();\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=812397ddfc370286eccefa2f873e20e3 (do not edit this line) */\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */\r
+/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.tableParser;\r
+\r
+/**\r
+ * An implementation of interface CharStream, where the stream is assumed to\r
+ * contain only ASCII characters (without unicode processing).\r
+ */\r
+\r
+public class SimpleCharStream\r
+{\r
+/** Whether parser is static. */\r
+ public static final boolean staticFlag = false;\r
+ int bufsize;\r
+ int available;\r
+ int tokenBegin;\r
+/** Position in buffer. */\r
+ public int bufpos = -1;\r
+ protected int bufline[];\r
+ protected int bufcolumn[];\r
+\r
+ protected int column = 0;\r
+ protected int line = 1;\r
+\r
+ protected boolean prevCharIsCR = false;\r
+ protected boolean prevCharIsLF = false;\r
+\r
+ protected java.io.Reader inputStream;\r
+\r
+ protected char[] buffer;\r
+ protected int maxNextCharInd = 0;\r
+ protected int inBuf = 0;\r
+ protected int tabSize = 8;\r
+\r
+ protected void setTabSize(int i) { tabSize = i; }\r
+ protected int getTabSize(int i) { return tabSize; }\r
+\r
+\r
+ protected void ExpandBuff(boolean wrapAround)\r
+ {\r
+ char[] newbuffer = new char[bufsize + 2048];\r
+ int newbufline[] = new int[bufsize + 2048];\r
+ int newbufcolumn[] = new int[bufsize + 2048];\r
+\r
+ try\r
+ {\r
+ if (wrapAround)\r
+ {\r
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+ System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);\r
+ buffer = newbuffer;\r
+\r
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);\r
+ bufline = newbufline;\r
+\r
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);\r
+ bufcolumn = newbufcolumn;\r
+\r
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));\r
+ }\r
+ else\r
+ {\r
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+ buffer = newbuffer;\r
+\r
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+ bufline = newbufline;\r
+\r
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+ bufcolumn = newbufcolumn;\r
+\r
+ maxNextCharInd = (bufpos -= tokenBegin);\r
+ }\r
+ }\r
+ catch (Throwable t)\r
+ {\r
+ throw new Error(t.getMessage());\r
+ }\r
+\r
+\r
+ bufsize += 2048;\r
+ available = bufsize;\r
+ tokenBegin = 0;\r
+ }\r
+\r
+ protected void FillBuff() throws java.io.IOException\r
+ {\r
+ if (maxNextCharInd == available)\r
+ {\r
+ if (available == bufsize)\r
+ {\r
+ if (tokenBegin > 2048)\r
+ {\r
+ bufpos = maxNextCharInd = 0;\r
+ available = tokenBegin;\r
+ }\r
+ else if (tokenBegin < 0)\r
+ bufpos = maxNextCharInd = 0;\r
+ else\r
+ ExpandBuff(false);\r
+ }\r
+ else if (available > tokenBegin)\r
+ available = bufsize;\r
+ else if ((tokenBegin - available) < 2048)\r
+ ExpandBuff(true);\r
+ else\r
+ available = tokenBegin;\r
+ }\r
+\r
+ int i;\r
+ try {\r
+ if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)\r
+ {\r
+ inputStream.close();\r
+ throw new java.io.IOException();\r
+ }\r
+ else\r
+ maxNextCharInd += i;\r
+ return;\r
+ }\r
+ catch(java.io.IOException e) {\r
+ --bufpos;\r
+ backup(0);\r
+ if (tokenBegin == -1)\r
+ tokenBegin = bufpos;\r
+ throw e;\r
+ }\r
+ }\r
+\r
+/** Start. */\r
+ public char BeginToken() throws java.io.IOException\r
+ {\r
+ tokenBegin = -1;\r
+ char c = readChar();\r
+ tokenBegin = bufpos;\r
+\r
+ return c;\r
+ }\r
+\r
+ protected void UpdateLineColumn(char c)\r
+ {\r
+ column++;\r
+\r
+ if (prevCharIsLF)\r
+ {\r
+ prevCharIsLF = false;\r
+ line += (column = 1);\r
+ }\r
+ else if (prevCharIsCR)\r
+ {\r
+ prevCharIsCR = false;\r
+ if (c == '\n')\r
+ {\r
+ prevCharIsLF = true;\r
+ }\r
+ else\r
+ line += (column = 1);\r
+ }\r
+\r
+ switch (c)\r
+ {\r
+ case '\r' :\r
+ prevCharIsCR = true;\r
+ break;\r
+ case '\n' :\r
+ prevCharIsLF = true;\r
+ break;\r
+ case '\t' :\r
+ column--;\r
+ column += (tabSize - (column % tabSize));\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+\r
+ bufline[bufpos] = line;\r
+ bufcolumn[bufpos] = column;\r
+ }\r
+\r
+/** Read a character. */\r
+ public char readChar() throws java.io.IOException\r
+ {\r
+ if (inBuf > 0)\r
+ {\r
+ --inBuf;\r
+\r
+ if (++bufpos == bufsize)\r
+ bufpos = 0;\r
+\r
+ return buffer[bufpos];\r
+ }\r
+\r
+ if (++bufpos >= maxNextCharInd)\r
+ FillBuff();\r
+\r
+ char c = buffer[bufpos];\r
+\r
+ UpdateLineColumn(c);\r
+ return c;\r
+ }\r
+\r
+ @Deprecated\r
+ /**\r
+ * @deprecated\r
+ * @see #getEndColumn\r
+ */\r
+\r
+ public int getColumn() {\r
+ return bufcolumn[bufpos];\r
+ }\r
+\r
+ @Deprecated\r
+ /**\r
+ * @deprecated\r
+ * @see #getEndLine\r
+ */\r
+\r
+ public int getLine() {\r
+ return bufline[bufpos];\r
+ }\r
+\r
+ /** Get token end column number. */\r
+ public int getEndColumn() {\r
+ return bufcolumn[bufpos];\r
+ }\r
+\r
+ /** Get token end line number. */\r
+ public int getEndLine() {\r
+ return bufline[bufpos];\r
+ }\r
+\r
+ /** Get token beginning column number. */\r
+ public int getBeginColumn() {\r
+ return bufcolumn[tokenBegin];\r
+ }\r
+\r
+ /** Get token beginning line number. */\r
+ public int getBeginLine() {\r
+ return bufline[tokenBegin];\r
+ }\r
+\r
+/** Backup a number of characters. */\r
+ public void backup(int amount) {\r
+\r
+ inBuf += amount;\r
+ if ((bufpos -= amount) < 0)\r
+ bufpos += bufsize;\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ inputStream = dstream;\r
+ line = startline;\r
+ column = startcolumn - 1;\r
+\r
+ available = bufsize = buffersize;\r
+ buffer = new char[buffersize];\r
+ bufline = new int[buffersize];\r
+ bufcolumn = new int[buffersize];\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ this(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream)\r
+ {\r
+ this(dstream, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ inputStream = dstream;\r
+ line = startline;\r
+ column = startcolumn - 1;\r
+\r
+ if (buffer == null || buffersize != buffer.length)\r
+ {\r
+ available = bufsize = buffersize;\r
+ buffer = new char[buffersize];\r
+ bufline = new int[buffersize];\r
+ bufcolumn = new int[buffersize];\r
+ }\r
+ prevCharIsLF = prevCharIsCR = false;\r
+ tokenBegin = inBuf = maxNextCharInd = 0;\r
+ bufpos = -1;\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ ReInit(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream)\r
+ {\r
+ ReInit(dstream, 1, 1, 4096);\r
+ }\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(dstream, encoding, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ this(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(dstream, encoding, 1, 1, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream)\r
+ {\r
+ this(dstream, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(dstream, encoding, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream)\r
+ {\r
+ ReInit(dstream, 1, 1, 4096);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(dstream, encoding, startline, startcolumn, 4096);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ ReInit(dstream, startline, startcolumn, 4096);\r
+ }\r
+ /** Get token literal value. */\r
+ public String GetImage()\r
+ {\r
+ if (bufpos >= tokenBegin)\r
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);\r
+ else\r
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +\r
+ new String(buffer, 0, bufpos + 1);\r
+ }\r
+\r
+ /** Get the suffix. */\r
+ public char[] GetSuffix(int len)\r
+ {\r
+ char[] ret = new char[len];\r
+\r
+ if ((bufpos + 1) >= len)\r
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);\r
+ else\r
+ {\r
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,\r
+ len - bufpos - 1);\r
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);\r
+ }\r
+\r
+ return ret;\r
+ }\r
+\r
+ /** Reset buffer when finished. */\r
+ public void Done()\r
+ {\r
+ buffer = null;\r
+ bufline = null;\r
+ bufcolumn = null;\r
+ }\r
+\r
+ /**\r
+ * Method to adjust line and column numbers for the start of a token.\r
+ */\r
+ public void adjustBeginLineColumn(int newLine, int newCol)\r
+ {\r
+ int start = tokenBegin;\r
+ int len;\r
+\r
+ if (bufpos >= tokenBegin)\r
+ {\r
+ len = bufpos - tokenBegin + inBuf + 1;\r
+ }\r
+ else\r
+ {\r
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;\r
+ }\r
+\r
+ int i = 0, j = 0, k = 0;\r
+ int nextColDiff = 0, columnDiff = 0;\r
+\r
+ while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])\r
+ {\r
+ bufline[j] = newLine;\r
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];\r
+ bufcolumn[j] = newCol + columnDiff;\r
+ columnDiff = nextColDiff;\r
+ i++;\r
+ }\r
+\r
+ if (i < len)\r
+ {\r
+ bufline[j] = newLine++;\r
+ bufcolumn[j] = newCol + columnDiff;\r
+\r
+ while (i++ < len)\r
+ {\r
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])\r
+ bufline[j] = newLine++;\r
+ else\r
+ bufline[j] = newLine;\r
+ }\r
+ }\r
+\r
+ line = bufline[j];\r
+ column = bufcolumn[j];\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=6ae427b43f697d2e9732f56763450bf7 (do not edit this line) */\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. TableParser.java */\r
+package org.simantics.sysdyn.tableParser;\r
+\r
+import java.util.ArrayList;\r
+\r
+public class TableParser implements TableParserConstants {\r
+ ArrayList<Token> xTokens = new ArrayList<Token>();\r
+ ArrayList<Token> yTokens = new ArrayList<Token>();\r
+\r
+ public ArrayList<Token> getXTokens() {\r
+ return xTokens;\r
+ }\r
+\r
+ public ArrayList<Token> getYTokens() {\r
+ return yTokens;\r
+ }\r
+\r
+/*** Parser ********************************************************/\r
+ final public void table() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 64:\r
+ case 66:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 64:\r
+ curlyTable();\r
+ break;\r
+ case 66:\r
+ bracketTable();\r
+ break;\r
+ default:\r
+ jj_la1[0] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[1] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(0);\r
+ }\r
+\r
+ final public void curlyTable() throws ParseException {\r
+ jj_consume_token(64);\r
+ jj_consume_token(64);\r
+ table_element();\r
+ jj_consume_token(65);\r
+ label_1:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 71:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[2] = jj_gen;\r
+ break label_1;\r
+ }\r
+ jj_consume_token(71);\r
+ jj_consume_token(64);\r
+ table_element();\r
+ jj_consume_token(65);\r
+ }\r
+ jj_consume_token(65);\r
+ }\r
+\r
+ final public void bracketTable() throws ParseException {\r
+ jj_consume_token(66);\r
+ table_element();\r
+ label_2:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 70:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[3] = jj_gen;\r
+ break label_2;\r
+ }\r
+ jj_consume_token(70);\r
+ table_element();\r
+ }\r
+ jj_consume_token(67);\r
+ }\r
+\r
+ final public void table_element() throws ParseException {\r
+ x_value();\r
+ jj_consume_token(71);\r
+ y_value();\r
+ }\r
+\r
+ final public void x_value() throws ParseException {\r
+ signed_number();\r
+ xTokens.add(token);\r
+ }\r
+\r
+ final public void y_value() throws ParseException {\r
+ signed_number();\r
+ yTokens.add(token);\r
+ }\r
+\r
+ final public void signed_number() throws ParseException {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case UNSIGNED_INTEGER:\r
+ jj_consume_token(UNSIGNED_INTEGER);\r
+ break;\r
+ case UNSIGNED_NUMBER:\r
+ jj_consume_token(UNSIGNED_NUMBER);\r
+ break;\r
+ case SIGNED_NUMBER:\r
+ jj_consume_token(SIGNED_NUMBER);\r
+ break;\r
+ default:\r
+ jj_la1[4] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+\r
+ /** Generated Token Manager. */\r
+ public TableParserTokenManager token_source;\r
+ SimpleCharStream jj_input_stream;\r
+ /** Current token. */\r
+ public Token token;\r
+ /** Next token. */\r
+ public Token jj_nt;\r
+ private int jj_ntk;\r
+ private int jj_gen;\r
+ final private int[] jj_la1 = new int[5];\r
+ static private int[] jj_la1_0;\r
+ static private int[] jj_la1_1;\r
+ static private int[] jj_la1_2;\r
+ static {\r
+ jj_la1_init_0();\r
+ jj_la1_init_1();\r
+ jj_la1_init_2();\r
+ }\r
+ private static void jj_la1_init_0() {\r
+ jj_la1_0 = new int[] {0x0,0x0,0x0,0x0,0x0,};\r
+ }\r
+ private static void jj_la1_init_1() {\r
+ jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,};\r
+ }\r
+ private static void jj_la1_init_2() {\r
+ jj_la1_2 = new int[] {0x5,0x5,0x80,0x40,0x70000000,};\r
+ }\r
+\r
+ /** Constructor with InputStream. */\r
+ public TableParser(java.io.InputStream stream) {\r
+ this(stream, null);\r
+ }\r
+ /** Constructor with InputStream and supplied encoding */\r
+ public TableParser(java.io.InputStream stream, String encoding) {\r
+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+ token_source = new TableParserTokenManager(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 5; i++) jj_la1[i] = -1;\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream stream) {\r
+ ReInit(stream, null);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream stream, String encoding) {\r
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+ token_source.ReInit(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 5; i++) jj_la1[i] = -1;\r
+ }\r
+\r
+ /** Constructor. */\r
+ public TableParser(java.io.Reader stream) {\r
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);\r
+ token_source = new TableParserTokenManager(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 5; i++) jj_la1[i] = -1;\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader stream) {\r
+ jj_input_stream.ReInit(stream, 1, 1);\r
+ token_source.ReInit(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 5; i++) jj_la1[i] = -1;\r
+ }\r
+\r
+ /** Constructor with generated Token Manager. */\r
+ public TableParser(TableParserTokenManager tm) {\r
+ token_source = tm;\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 5; i++) jj_la1[i] = -1;\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(TableParserTokenManager tm) {\r
+ token_source = tm;\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 5; i++) jj_la1[i] = -1;\r
+ }\r
+\r
+ private Token jj_consume_token(int kind) throws ParseException {\r
+ Token oldToken;\r
+ if ((oldToken = token).next != null) token = token.next;\r
+ else token = token.next = token_source.getNextToken();\r
+ jj_ntk = -1;\r
+ if (token.kind == kind) {\r
+ jj_gen++;\r
+ return token;\r
+ }\r
+ token = oldToken;\r
+ jj_kind = kind;\r
+ throw generateParseException();\r
+ }\r
+\r
+\r
+/** Get the next Token. */\r
+ final public Token getNextToken() {\r
+ if (token.next != null) token = token.next;\r
+ else token = token.next = token_source.getNextToken();\r
+ jj_ntk = -1;\r
+ jj_gen++;\r
+ return token;\r
+ }\r
+\r
+/** Get the specific Token. */\r
+ final public Token getToken(int index) {\r
+ Token t = token;\r
+ for (int i = 0; i < index; i++) {\r
+ if (t.next != null) t = t.next;\r
+ else t = t.next = token_source.getNextToken();\r
+ }\r
+ return t;\r
+ }\r
+\r
+ private int jj_ntk() {\r
+ if ((jj_nt=token.next) == null)\r
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);\r
+ else\r
+ return (jj_ntk = jj_nt.kind);\r
+ }\r
+\r
+ private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();\r
+ private int[] jj_expentry;\r
+ private int jj_kind = -1;\r
+\r
+ /** Generate ParseException. */\r
+ public ParseException generateParseException() {\r
+ jj_expentries.clear();\r
+ boolean[] la1tokens = new boolean[95];\r
+ if (jj_kind >= 0) {\r
+ la1tokens[jj_kind] = true;\r
+ jj_kind = -1;\r
+ }\r
+ for (int i = 0; i < 5; i++) {\r
+ if (jj_la1[i] == jj_gen) {\r
+ for (int j = 0; j < 32; j++) {\r
+ if ((jj_la1_0[i] & (1<<j)) != 0) {\r
+ la1tokens[j] = true;\r
+ }\r
+ if ((jj_la1_1[i] & (1<<j)) != 0) {\r
+ la1tokens[32+j] = true;\r
+ }\r
+ if ((jj_la1_2[i] & (1<<j)) != 0) {\r
+ la1tokens[64+j] = true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ for (int i = 0; i < 95; i++) {\r
+ if (la1tokens[i]) {\r
+ jj_expentry = new int[1];\r
+ jj_expentry[0] = i;\r
+ jj_expentries.add(jj_expentry);\r
+ }\r
+ }\r
+ int[][] exptokseq = new int[jj_expentries.size()][];\r
+ for (int i = 0; i < jj_expentries.size(); i++) {\r
+ exptokseq[i] = jj_expentries.get(i);\r
+ }\r
+ return new ParseException(token, exptokseq, tokenImage);\r
+ }\r
+\r
+ /** Enable tracing. */\r
+ final public void enable_tracing() {\r
+ }\r
+\r
+ /** Disable tracing. */\r
+ final public void disable_tracing() {\r
+ }\r
+\r
+}\r
--- /dev/null
+options {\r
+ JDK_VERSION = "1.6";\r
+ STATIC = false;\r
+}\r
+\r
+PARSER_BEGIN(TableParser)\r
+package org.simantics.sysdyn.tableParser;\r
+\r
+import java.util.ArrayList;\r
+\r
+public class TableParser {\r
+ ArrayList<Token> xTokens = new ArrayList<Token>();\r
+ ArrayList<Token> yTokens = new ArrayList<Token>();\r
+ \r
+ public ArrayList<Token> getXTokens() {\r
+ return xTokens;\r
+ }\r
+ \r
+ public ArrayList<Token> getYTokens() {\r
+ return yTokens;\r
+ }\r
+ \r
+ \r
+}\r
+PARSER_END(TableParser)\r
+\r
+/*** Lexer *********************************************************/\r
+\r
+SKIP:\r
+{ <WHITESPACE: " " | "\n" | "\r" | "\t" > \r
+| <COMMENT1: "/*" (~["*"] | "*" ~["/"])* "*/" > \r
+| <COMMENT2: "//" (~["\n"])* >\r
+}\r
+\r
+TOKEN:\r
+{\r
+"algorithm" | "discrete" | "false" | "model" | "redeclare"\r
+| "and" | "each" | "final" | "not" | "replaceable"\r
+| "annotation" | "else" | "flow" | "operator" | "return"\r
+|"assert" | "elseif" | "for" | "or" | "stream"\r
+| "block" | "elsewhen" | "function" | "outer" | "then"\r
+| "break" | "encapsulated" | "if" | "output" | "true"\r
+| "class" | "end" | "import" | "package" | "type"\r
+| "connect" | "enumeration" | "in" | "parameter" | "when"\r
+| "connector" | "equation" | "initial" | "partial" | "while"\r
+| "constant" | "expandable" | "inner" | "protected" | "within"\r
+| "constrainedby" | "extends" | "input" | "public"\r
+| "der" | "external" | "loop" | "record"\r
+| "(" | ")" | "{" | "}" | "[" | "]" | "." | ":" | ";" | ","\r
+| "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+| "+" | "-" | ".+" | ".-"\r
+| "*" | "/" | ".*" | "./"\r
+| "^" | ".^"\r
+| "=" | ":=" \r
+| <IDENT: ["a"-"z","A"-"Z","_"] (["a"-"z","A"-"Z","_","0"-"9"])* >\r
+| <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
+ { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
+| <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
+| <UNSIGNED_NUMBER: \r
+ ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | "." <UNSIGNED_INTEGER> (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | <UNSIGNED_INTEGER> ["e","E"] (["+","-"])? <UNSIGNED_INTEGER>\r
+ ) >\r
+| <SIGNED_NUMBER : (("-")? ( <UNSIGNED_NUMBER> | <UNSIGNED_INTEGER> ))>\r
+}\r
+\r
+/*** Parser ********************************************************/\r
+\r
+void table() : {\r
+} {\r
+ ( curlyTable() | bracketTable())? <EOF>\r
+}\r
+\r
+void curlyTable() : {\r} {\r
+ ( "{" "{" table_element() "}" ( "," "{" table_element() "}" )* "}" )\r
+} \r\r
+void bracketTable() : {\r} {\r
+ ( "[" table_element() ( ";" table_element() )* "]" )\r
+}\r \r
+\r
+void table_element() : {\r
+} {\r
+ (x_value() "," y_value())\r
+} \r
+\r
+void x_value() : {\r
+} { \r
+ \r
+ signed_number() {\r
+ xTokens.add(token);\r
+ }\r
+}\r
+\r
+void y_value() : {\r
+} { \r
+ signed_number() {\r
+ yTokens.add(token);\r
+ }\r
+}\r
+\r
+void signed_number() : {\r
+} {\r
+ ( <UNSIGNED_INTEGER> | <UNSIGNED_NUMBER> | <SIGNED_NUMBER> )\r
+}
\ No newline at end of file
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. TableParserConstants.java */\r
+package org.simantics.sysdyn.tableParser;\r
+\r
+\r
+/**\r
+ * Token literal values and constants.\r
+ * Generated by org.javacc.parser.OtherFilesGen#start()\r
+ */\r
+public interface TableParserConstants {\r
+\r
+ /** End of File. */\r
+ int EOF = 0;\r
+ /** RegularExpression Id. */\r
+ int WHITESPACE = 1;\r
+ /** RegularExpression Id. */\r
+ int COMMENT1 = 2;\r
+ /** RegularExpression Id. */\r
+ int COMMENT2 = 3;\r
+ /** RegularExpression Id. */\r
+ int IDENT = 90;\r
+ /** RegularExpression Id. */\r
+ int STRING = 91;\r
+ /** RegularExpression Id. */\r
+ int UNSIGNED_INTEGER = 92;\r
+ /** RegularExpression Id. */\r
+ int UNSIGNED_NUMBER = 93;\r
+ /** RegularExpression Id. */\r
+ int SIGNED_NUMBER = 94;\r
+\r
+ /** Lexical state. */\r
+ int DEFAULT = 0;\r
+\r
+ /** Literal token values. */\r
+ String[] tokenImage = {\r
+ "<EOF>",\r
+ "<WHITESPACE>",\r
+ "<COMMENT1>",\r
+ "<COMMENT2>",\r
+ "\"algorithm\"",\r
+ "\"discrete\"",\r
+ "\"false\"",\r
+ "\"model\"",\r
+ "\"redeclare\"",\r
+ "\"and\"",\r
+ "\"each\"",\r
+ "\"final\"",\r
+ "\"not\"",\r
+ "\"replaceable\"",\r
+ "\"annotation\"",\r
+ "\"else\"",\r
+ "\"flow\"",\r
+ "\"operator\"",\r
+ "\"return\"",\r
+ "\"assert\"",\r
+ "\"elseif\"",\r
+ "\"for\"",\r
+ "\"or\"",\r
+ "\"stream\"",\r
+ "\"block\"",\r
+ "\"elsewhen\"",\r
+ "\"function\"",\r
+ "\"outer\"",\r
+ "\"then\"",\r
+ "\"break\"",\r
+ "\"encapsulated\"",\r
+ "\"if\"",\r
+ "\"output\"",\r
+ "\"true\"",\r
+ "\"class\"",\r
+ "\"end\"",\r
+ "\"import\"",\r
+ "\"package\"",\r
+ "\"type\"",\r
+ "\"connect\"",\r
+ "\"enumeration\"",\r
+ "\"in\"",\r
+ "\"parameter\"",\r
+ "\"when\"",\r
+ "\"connector\"",\r
+ "\"equation\"",\r
+ "\"initial\"",\r
+ "\"partial\"",\r
+ "\"while\"",\r
+ "\"constant\"",\r
+ "\"expandable\"",\r
+ "\"inner\"",\r
+ "\"protected\"",\r
+ "\"within\"",\r
+ "\"constrainedby\"",\r
+ "\"extends\"",\r
+ "\"input\"",\r
+ "\"public\"",\r
+ "\"der\"",\r
+ "\"external\"",\r
+ "\"loop\"",\r
+ "\"record\"",\r
+ "\"(\"",\r
+ "\")\"",\r
+ "\"{\"",\r
+ "\"}\"",\r
+ "\"[\"",\r
+ "\"]\"",\r
+ "\".\"",\r
+ "\":\"",\r
+ "\";\"",\r
+ "\",\"",\r
+ "\"<\"",\r
+ "\"<=\"",\r
+ "\">\"",\r
+ "\">=\"",\r
+ "\"==\"",\r
+ "\"<>\"",\r
+ "\"+\"",\r
+ "\"-\"",\r
+ "\".+\"",\r
+ "\".-\"",\r
+ "\"*\"",\r
+ "\"/\"",\r
+ "\".*\"",\r
+ "\"./\"",\r
+ "\"^\"",\r
+ "\".^\"",\r
+ "\"=\"",\r
+ "\":=\"",\r
+ "<IDENT>",\r
+ "<STRING>",\r
+ "<UNSIGNED_INTEGER>",\r
+ "<UNSIGNED_NUMBER>",\r
+ "<SIGNED_NUMBER>",\r
+ };\r
+\r
+}\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. TableParserTokenManager.java */\r
+package org.simantics.sysdyn.tableParser;\r
+import java.util.ArrayList;\r
+\r
+/** Token Manager. */\r
+public class TableParserTokenManager implements TableParserConstants\r
+{\r
+\r
+ /** Debug output. */\r
+ public java.io.PrintStream debugStream = System.out;\r
+ /** Set debug output. */\r
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }\r
+private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
+{\r
+ switch (pos)
+ {\r
+ case 0:\r
+ if ((active0 & 0x3ffffffffffffff0L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ return 2;\r
+ }\r
+ if ((active1 & 0x8000L) != 0L)\r
+ return 9;\r
+ if ((active1 & 0xb30010L) != 0L)\r
+ return 52;\r
+ if ((active1 & 0x80000L) != 0L)\r
+ return 27;\r
+ return -1;\r
+ case 1:\r
+ if ((active0 & 0x108420080400000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x3ef7bdff7fbffff0L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 1)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 1;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 2:\r
+ if ((active0 & 0x400000800201200L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x3bfffdf77f9fedf0L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 2;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 3:\r
+ if ((active0 & 0x1000084212118400L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x2bfff5b56d8e69f0L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 3)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 3;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 4:\r
+ if ((active0 & 0x1090004290008c0L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x2af6f5b1469e6130L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 4;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 5:\r
+ if ((active0 & 0x22200011009c0000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x8d6f5a046026130L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 5;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 6:\r
+ if ((active0 & 0x80d0a000000000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x856250046026130L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 6)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 6;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 7:\r
+ if ((active0 & 0x54150040006110L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 7;\r
+ return 2;\r
+ }\r
+ if ((active0 & 0x802200006020020L) != 0L)\r
+ return 2;\r
+ return -1;\r
+ case 8:\r
+ if ((active0 & 0x10140000000110L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x44010040006000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 8;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 9:\r
+ if ((active0 & 0x40010040002000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 9;\r
+ return 2;\r
+ }\r
+ if ((active0 & 0x4000000004000L) != 0L)\r
+ return 2;\r
+ return -1;\r
+ case 10:\r
+ if ((active0 & 0x10000002000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x40000040000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 10;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 11:\r
+ if ((active0 & 0x40000000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x40000000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 90;\r
+ jjmatchedPos = 11;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ default :\r
+ return -1;\r
+ }\r
+}\r
+private final int jjStartNfa_0(int pos, long active0, long active1)
+{\r
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);\r
+}\r
+private int jjStopAtPos(int pos, int kind)\r
+{\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = pos;\r
+ return pos + 1;\r
+}\r
+private int jjMoveStringLiteralDfa0_0()\r
+{\r
+ switch(curChar)\r
+ {\r
+ case 40:\r
+ return jjStopAtPos(0, 62);\r
+ case 41:\r
+ return jjStopAtPos(0, 63);\r
+ case 42:\r
+ return jjStopAtPos(0, 82);\r
+ case 43:\r
+ return jjStopAtPos(0, 78);\r
+ case 44:\r
+ return jjStopAtPos(0, 71);\r
+ case 45:\r
+ return jjStartNfaWithStates_0(0, 79, 9);\r
+ case 46:\r
+ jjmatchedKind = 68;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0xb30000L);\r
+ case 47:\r
+ return jjStartNfaWithStates_0(0, 83, 27);\r
+ case 58:\r
+ jjmatchedKind = 69;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L);\r
+ case 59:\r
+ return jjStopAtPos(0, 70);\r
+ case 60:\r
+ jjmatchedKind = 72;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x2200L);\r
+ case 61:\r
+ jjmatchedKind = 88;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x1000L);\r
+ case 62:\r
+ jjmatchedKind = 74;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x800L);\r
+ case 91:\r
+ return jjStopAtPos(0, 66);\r
+ case 93:\r
+ return jjStopAtPos(0, 67);\r
+ case 94:\r
+ return jjStopAtPos(0, 86);\r
+ case 97:\r
+ return jjMoveStringLiteralDfa1_0(0x84210L, 0x0L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa1_0(0x21000000L, 0x0L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa1_0(0x42108400000000L, 0x0L);\r
+ case 100:\r
+ return jjMoveStringLiteralDfa1_0(0x400000000000020L, 0x0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa1_0(0x884210842108400L, 0x0L);\r
+ case 102:\r
+ return jjMoveStringLiteralDfa1_0(0x4210840L, 0x0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa1_0(0x108421080000000L, 0x0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa1_0(0x1000000000000000L, 0x0L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa1_0(0x80L, 0x0L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa1_0(0x1000L, 0x0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa1_0(0x108420000L, 0x0L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa1_0(0x210842000000000L, 0x0L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa1_0(0x2000000000042100L, 0x0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa1_0(0x800000L, 0x0L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa1_0(0x4210000000L, 0x0L);\r
+ case 119:\r
+ return jjMoveStringLiteralDfa1_0(0x21080000000000L, 0x0L);\r
+ case 123:\r
+ return jjStopAtPos(0, 64);\r
+ case 125:\r
+ return jjStopAtPos(0, 65);\r
+ default :\r
+ return jjMoveNfa_0(0, 0);\r
+ }\r
+}\r
+private int jjMoveStringLiteralDfa1_0(long active0, long active1)\r
+{\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(0, active0, active1);\r
+ return 1;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 42:\r
+ if ((active1 & 0x100000L) != 0L)\r
+ return jjStopAtPos(1, 84);\r
+ break;\r
+ case 43:\r
+ if ((active1 & 0x10000L) != 0L)\r
+ return jjStopAtPos(1, 80);\r
+ break;\r
+ case 45:\r
+ if ((active1 & 0x20000L) != 0L)\r
+ return jjStopAtPos(1, 81);\r
+ break;\r
+ case 47:\r
+ if ((active1 & 0x200000L) != 0L)\r
+ return jjStopAtPos(1, 85);\r
+ break;\r
+ case 61:\r
+ if ((active1 & 0x200L) != 0L)\r
+ return jjStopAtPos(1, 73);\r
+ else if ((active1 & 0x800L) != 0L)\r
+ return jjStopAtPos(1, 75);\r
+ else if ((active1 & 0x1000L) != 0L)\r
+ return jjStopAtPos(1, 76);\r
+ else if ((active1 & 0x2000000L) != 0L)\r
+ return jjStopAtPos(1, 89);\r
+ break;\r
+ case 62:\r
+ if ((active1 & 0x2000L) != 0L)\r
+ return jjStopAtPos(1, 77);\r
+ break;\r
+ case 94:\r
+ if ((active1 & 0x800000L) != 0L)\r
+ return jjStopAtPos(1, 87);\r
+ break;\r
+ case 97:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x842000000440L, active1, 0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x2400000000042100L, active1, 0L);\r
+ case 102:\r
+ if ((active0 & 0x80000000L) != 0L)\r
+ return jjStartNfaWithStates_0(1, 31, 2);\r
+ break;\r
+ case 104:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x1080010000000L, active1, 0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000000000820L, active1, 0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x403118010L, active1, 0L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L, active1, 0L);\r
+ case 110:\r
+ if ((active0 & 0x20000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 41;\r
+ jjmatchedPos = 1;\r
+ }\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x108410840004200L, active1, 0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x1042108000201080L, active1, 0L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000L, active1, 0L);\r
+ case 113:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L);\r
+ case 114:\r
+ if ((active0 & 0x400000L) != 0L)\r
+ return jjStartNfaWithStates_0(1, 22, 2);\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x10000220000000L, active1, 0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x80000L, active1, 0L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x800000L, active1, 0L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000010c000000L, active1, 0L);\r
+ case 120:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x884000000000000L, active1, 0L);\r
+ case 121:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x4000000000L, active1, 0L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(0, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(0, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(1, active0, 0L);\r
+ return 2;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x400000000L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x200000000000000L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x2000002040000400L);\r
+ case 100:\r
+ if ((active0 & 0x200L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 9, 2);\r
+ else if ((active0 & 0x800000000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 35, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x180L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x80030020000L);\r
+ case 103:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x10L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x1400000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x40L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x4a108004004800L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x1010000001010000L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x104005000002000L);\r
+ case 114:\r
+ if ((active0 & 0x200000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 21, 2);\r
+ else if ((active0 & 0x400000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 58, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x840000800000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x2188020L);\r
+ case 116:\r
+ if ((active0 & 0x1000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 12, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x8a0000108040000L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x210200000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(1, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa3_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(1, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(2, active0, 0L);\r
+ return 3;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x4240060000800L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x5000020L);\r
+ case 101:\r
+ if ((active0 & 0x8000L) != 0L)\r
+ {\r
+ jjmatchedKind = 15;\r
+ jjmatchedPos = 3;\r
+ }\r
+ else if ((active0 & 0x200000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 33, 2);\r
+ else if ((active0 & 0x4000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 38, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x88800000a980180L);\r
+ case 104:\r
+ if ((active0 & 0x400L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 10, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000000000000L);\r
+ case 107:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x201000000002000L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L);\r
+ case 110:\r
+ if ((active0 & 0x10000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 28, 2);\r
+ else if ((active0 & 0x80000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 43, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x108000000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000001000004010L);\r
+ case 112:\r
+ if ((active0 & 0x1000000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 60, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x100000000L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x42000400000040L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x10c00000000000L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x100000000040000L);\r
+ case 119:\r
+ if ((active0 & 0x10000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 16, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(2, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa4_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(2, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(3, active0, 0L);\r
+ return 4;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000822000L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x100L);\r
+ case 101:\r
+ if ((active0 & 0x40L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 6, 2);\r
+ else if ((active0 & 0x1000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 48, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x10118000000000L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x220c00000100000L);\r
+ case 107:\r
+ if ((active0 & 0x1000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 24, 2);\r
+ else if ((active0 & 0x20000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 29, 2);\r
+ break;\r
+ case 108:\r
+ if ((active0 & 0x80L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 7, 2);\r
+ else if ((active0 & 0x800L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 11, 2);\r
+ break;\r
+ case 109:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x84000000000000L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000000L);\r
+ case 114:\r
+ if ((active0 & 0x8000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 27, 2);\r
+ else if ((active0 & 0x8000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 51, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x28000010000c0030L);\r
+ case 115:\r
+ if ((active0 & 0x400000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 34, 2);\r
+ break;\r
+ case 116:\r
+ if ((active0 & 0x100000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 56, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x42200004004000L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x100000000L);\r
+ case 119:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(3, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa5_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(3, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(4, active0, 0L);\r
+ return 5;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2c00000004000L);\r
+ case 99:\r
+ if ((active0 & 0x200000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 57, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x10108000002000L);\r
+ case 100:\r
+ if ((active0 & 0x2000000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 61, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x84000000000000L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40000000020L);\r
+ case 102:\r
+ if ((active0 & 0x100000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 20, 2);\r
+ break;\r
+ case 103:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000000L);\r
+ case 104:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x200004000010L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x100L);\r
+ case 109:\r
+ if ((active0 & 0x800000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 23, 2);\r
+ break;\r
+ case 110:\r
+ if ((active0 & 0x40000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 18, 2);\r
+ else if ((active0 & 0x20000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 53, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x800000000000000L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40010000000000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40000000L);\r
+ case 116:\r
+ if ((active0 & 0x80000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 19, 2);\r
+ else if ((active0 & 0x100000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 32, 2);\r
+ else if ((active0 & 0x1000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 36, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x20000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(4, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa6_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(4, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(5, active0, 0L);\r
+ return 6;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x844010000000100L);\r
+ case 101:\r
+ if ((active0 & 0x2000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 37, 2);\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x2002000L);\r
+ case 108:\r
+ if ((active0 & 0x400000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 46, 2);\r
+ else if ((active0 & 0x800000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 47, 2);\r
+ break;\r
+ case 110:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x200004020000L);\r
+ case 115:\r
+ if ((active0 & 0x80000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 55, 2);\r
+ break;\r
+ case 116:\r
+ if ((active0 & 0x8000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 39;\r
+ jjmatchedPos = 6;\r
+ }\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x10140000004030L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(5, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa7_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(5, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(6, active0, 0L);\r
+ return 7;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x2000L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x4000000000000L);\r
+ case 101:\r
+ if ((active0 & 0x20L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 5, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10040000000000L);\r
+ case 104:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x40000000004000L);\r
+ case 108:\r
+ if ((active0 & 0x800000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 59, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x40000000L);\r
+ case 110:\r
+ if ((active0 & 0x2000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 25, 2);\r
+ else if ((active0 & 0x4000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 26, 2);\r
+ else if ((active0 & 0x200000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 45, 2);\r
+ break;\r
+ case 111:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x100000000000L);\r
+ case 114:\r
+ if ((active0 & 0x20000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 17, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x100L);\r
+ case 116:\r
+ if ((active0 & 0x2000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 49, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(6, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa8_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(6, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(7, active0, 0L);\r
+ return 8;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x40000000L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x2000L);\r
+ case 100:\r
+ if ((active0 & 0x10000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 52, 2);\r
+ break;\r
+ case 101:\r
+ if ((active0 & 0x100L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 8, 2);\r
+ break;\r
+ case 105:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x10000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x4000000000000L);\r
+ case 109:\r
+ if ((active0 & 0x10L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 4, 2);\r
+ break;\r
+ case 110:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x40000000000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x4000L);\r
+ case 114:\r
+ if ((active0 & 0x40000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 42, 2);\r
+ else if ((active0 & 0x100000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 44, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(7, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa9_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(7, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(8, active0, 0L);\r
+ return 9;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 101:\r
+ if ((active0 & 0x4000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(9, 50, 2);\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x40000000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x2000L);\r
+ case 110:\r
+ if ((active0 & 0x4000L) != 0L)\r
+ return jjStartNfaWithStates_0(9, 14, 2);\r
+ break;\r
+ case 111:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x10000000000L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(8, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa10_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(8, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(9, active0, 0L);\r
+ return 10;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 100:\r
+ return jjMoveStringLiteralDfa11_0(active0, 0x40000000000000L);\r
+ case 101:\r
+ if ((active0 & 0x2000L) != 0L)\r
+ return jjStartNfaWithStates_0(10, 13, 2);\r
+ return jjMoveStringLiteralDfa11_0(active0, 0x40000000L);\r
+ case 110:\r
+ if ((active0 & 0x10000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(10, 40, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(9, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa11_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(9, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(10, active0, 0L);\r
+ return 11;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 98:\r
+ return jjMoveStringLiteralDfa12_0(active0, 0x40000000000000L);\r
+ case 100:\r
+ if ((active0 & 0x40000000L) != 0L)\r
+ return jjStartNfaWithStates_0(11, 30, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(10, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa12_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(10, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(11, active0, 0L);\r
+ return 12;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 121:\r
+ if ((active0 & 0x40000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(12, 54, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(11, active0, 0L);\r
+}\r
+private int jjStartNfaWithStates_0(int pos, int kind, int state)\r
+{\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = pos;\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) { return pos + 1; }\r
+ return jjMoveNfa_0(state, pos + 1);\r
+}\r
+static final long[] jjbitVec0 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};\r
+private int jjMoveNfa_0(int startState, int curPos)\r
+{\r
+ int startsAt = 0;\r
+ jjnewStateCnt = 52;\r
+ int i = 1;\r
+ jjstateSet[0] = startState;\r
+ int kind = 0x7fffffff;\r
+ for (;;)\r
+ {\r
+ if (++jjround == 0x7fffffff)\r
+ ReInitRounds();\r
+ if (curChar < 64)\r
+ {\r
+ long l = 1L << curChar;\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 52:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ {\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAddTwoStates(10, 11);\r
+ }\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ {\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAddTwoStates(48, 49);\r
+ }\r
+ break;\r
+ case 9:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ {\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAddStates(0, 4);\r
+ }\r
+ else if (curChar == 46)\r
+ jjCheckNAdd(10);\r
+ break;\r
+ case 0:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ {\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAddStates(5, 14);\r
+ }\r
+ else if ((0x100002600L & l) != 0L)\r
+ {\r
+ if (kind > 1)\r
+ kind = 1;\r
+ }\r
+ else if (curChar == 46)\r
+ jjCheckNAddTwoStates(48, 10);\r
+ else if (curChar == 47)\r
+ jjAddStates(15, 16);\r
+ else if (curChar == 45)\r
+ jjAddStates(17, 18);\r
+ else if (curChar == 34)\r
+ jjCheckNAddStates(19, 21);\r
+ break;\r
+ case 27:\r
+ if (curChar == 47)\r
+ {\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(34);\r
+ }\r
+ else if (curChar == 42)\r
+ jjCheckNAddStates(22, 24);\r
+ break;\r
+ case 2:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjstateSet[jjnewStateCnt++] = 2;\r
+ break;\r
+ case 3:\r
+ if (curChar == 34)\r
+ jjCheckNAddStates(19, 21);\r
+ break;\r
+ case 4:\r
+ if ((0xfffffffbfffffbffL & l) != 0L)\r
+ jjCheckNAddStates(19, 21);\r
+ break;\r
+ case 6:\r
+ if ((0xfffffffffffffbffL & l) != 0L)\r
+ jjCheckNAddStates(19, 21);\r
+ break;\r
+ case 7:\r
+ if (curChar == 34 && kind > 91)\r
+ kind = 91;\r
+ break;\r
+ case 8:\r
+ if (curChar == 45)\r
+ jjAddStates(17, 18);\r
+ break;\r
+ case 10:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAddTwoStates(10, 11);\r
+ break;\r
+ case 12:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(13);\r
+ break;\r
+ case 13:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAdd(13);\r
+ break;\r
+ case 14:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAddStates(0, 4);\r
+ break;\r
+ case 15:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAdd(15);\r
+ break;\r
+ case 16:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(16, 17);\r
+ break;\r
+ case 18:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(19);\r
+ break;\r
+ case 19:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAdd(19);\r
+ break;\r
+ case 20:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(20, 21);\r
+ break;\r
+ case 21:\r
+ if (curChar != 46)\r
+ break;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAddTwoStates(22, 23);\r
+ break;\r
+ case 22:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAddTwoStates(22, 23);\r
+ break;\r
+ case 24:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(25);\r
+ break;\r
+ case 25:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 94)\r
+ kind = 94;\r
+ jjCheckNAdd(25);\r
+ break;\r
+ case 26:\r
+ if (curChar == 47)\r
+ jjAddStates(15, 16);\r
+ break;\r
+ case 28:\r
+ if ((0xfffffbffffffffffL & l) != 0L)\r
+ jjCheckNAddStates(22, 24);\r
+ break;\r
+ case 29:\r
+ if (curChar == 42)\r
+ jjstateSet[jjnewStateCnt++] = 30;\r
+ break;\r
+ case 30:\r
+ if ((0xffff7fffffffffffL & l) != 0L)\r
+ jjCheckNAddStates(22, 24);\r
+ break;\r
+ case 31:\r
+ if (curChar == 47 && kind > 2)\r
+ kind = 2;\r
+ break;\r
+ case 32:\r
+ if (curChar == 42)\r
+ jjstateSet[jjnewStateCnt++] = 31;\r
+ break;\r
+ case 33:\r
+ if (curChar != 47)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(34);\r
+ break;\r
+ case 34:\r
+ if ((0xfffffffffffffbffL & l) == 0L)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(34);\r
+ break;\r
+ case 35:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAddStates(5, 14);\r
+ break;\r
+ case 36:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 92)\r
+ kind = 92;\r
+ jjCheckNAdd(36);\r
+ break;\r
+ case 37:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(37, 38);\r
+ break;\r
+ case 38:\r
+ if (curChar != 46)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAddTwoStates(39, 40);\r
+ break;\r
+ case 39:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAddTwoStates(39, 40);\r
+ break;\r
+ case 41:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(42);\r
+ break;\r
+ case 42:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAdd(42);\r
+ break;\r
+ case 43:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(43, 44);\r
+ break;\r
+ case 45:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(46);\r
+ break;\r
+ case 46:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAdd(46);\r
+ break;\r
+ case 47:\r
+ if (curChar == 46)\r
+ jjCheckNAddTwoStates(48, 10);\r
+ break;\r
+ case 48:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAddTwoStates(48, 49);\r
+ break;\r
+ case 50:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(51);\r
+ break;\r
+ case 51:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 93)\r
+ kind = 93;\r
+ jjCheckNAdd(51);\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ else if (curChar < 128)\r
+ {\r
+ long l = 1L << (curChar & 077);\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 0:\r
+ case 2:\r
+ if ((0x7fffffe87fffffeL & l) == 0L)\r
+ break;\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjCheckNAdd(2);\r
+ break;\r
+ case 4:\r
+ if ((0xffffffffefffffffL & l) != 0L)\r
+ jjCheckNAddStates(19, 21);\r
+ break;\r
+ case 5:\r
+ if (curChar == 92)\r
+ jjstateSet[jjnewStateCnt++] = 6;\r
+ break;\r
+ case 6:\r
+ jjCheckNAddStates(19, 21);\r
+ break;\r
+ case 11:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(25, 26);\r
+ break;\r
+ case 17:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(27, 28);\r
+ break;\r
+ case 23:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(29, 30);\r
+ break;\r
+ case 28:\r
+ case 30:\r
+ jjCheckNAddStates(22, 24);\r
+ break;\r
+ case 34:\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjstateSet[jjnewStateCnt++] = 34;\r
+ break;\r
+ case 40:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(31, 32);\r
+ break;\r
+ case 44:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(33, 34);\r
+ break;\r
+ case 49:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(35, 36);\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ else\r
+ {\r
+ int i2 = (curChar & 0xff) >> 6;\r
+ long l2 = 1L << (curChar & 077);\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 4:\r
+ case 6:\r
+ if ((jjbitVec0[i2] & l2) != 0L)\r
+ jjCheckNAddStates(19, 21);\r
+ break;\r
+ case 28:\r
+ case 30:\r
+ if ((jjbitVec0[i2] & l2) != 0L)\r
+ jjCheckNAddStates(22, 24);\r
+ break;\r
+ case 34:\r
+ if ((jjbitVec0[i2] & l2) == 0L)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjstateSet[jjnewStateCnt++] = 34;\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ if (kind != 0x7fffffff)\r
+ {\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = curPos;\r
+ kind = 0x7fffffff;\r
+ }\r
+ ++curPos;\r
+ if ((i = jjnewStateCnt) == (startsAt = 52 - (jjnewStateCnt = startsAt)))\r
+ return curPos;\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) { return curPos; }\r
+ }\r
+}\r
+static final int[] jjnextStates = {
+ 15, 16, 17, 20, 21, 36, 37, 38, 43, 44, 15, 16, 17, 20, 21, 27,
+ 33, 9, 14, 4, 5, 7, 28, 29, 32, 12, 13, 18, 19, 24, 25, 41,
+ 42, 45, 46, 50, 51,
+};\r
+\r
+/** Token literal values. */\r
+public static final String[] jjstrLiteralImages = {\r
+"", null, null, null, "\141\154\147\157\162\151\164\150\155", \r
+"\144\151\163\143\162\145\164\145", "\146\141\154\163\145", "\155\157\144\145\154", \r
+"\162\145\144\145\143\154\141\162\145", "\141\156\144", "\145\141\143\150", "\146\151\156\141\154", "\156\157\164", \r
+"\162\145\160\154\141\143\145\141\142\154\145", "\141\156\156\157\164\141\164\151\157\156", "\145\154\163\145", \r
+"\146\154\157\167", "\157\160\145\162\141\164\157\162", "\162\145\164\165\162\156", \r
+"\141\163\163\145\162\164", "\145\154\163\145\151\146", "\146\157\162", "\157\162", \r
+"\163\164\162\145\141\155", "\142\154\157\143\153", "\145\154\163\145\167\150\145\156", \r
+"\146\165\156\143\164\151\157\156", "\157\165\164\145\162", "\164\150\145\156", "\142\162\145\141\153", \r
+"\145\156\143\141\160\163\165\154\141\164\145\144", "\151\146", "\157\165\164\160\165\164", "\164\162\165\145", \r
+"\143\154\141\163\163", "\145\156\144", "\151\155\160\157\162\164", "\160\141\143\153\141\147\145", \r
+"\164\171\160\145", "\143\157\156\156\145\143\164", \r
+"\145\156\165\155\145\162\141\164\151\157\156", "\151\156", "\160\141\162\141\155\145\164\145\162", "\167\150\145\156", \r
+"\143\157\156\156\145\143\164\157\162", "\145\161\165\141\164\151\157\156", "\151\156\151\164\151\141\154", \r
+"\160\141\162\164\151\141\154", "\167\150\151\154\145", "\143\157\156\163\164\141\156\164", \r
+"\145\170\160\141\156\144\141\142\154\145", "\151\156\156\145\162", "\160\162\157\164\145\143\164\145\144", \r
+"\167\151\164\150\151\156", "\143\157\156\163\164\162\141\151\156\145\144\142\171", \r
+"\145\170\164\145\156\144\163", "\151\156\160\165\164", "\160\165\142\154\151\143", "\144\145\162", \r
+"\145\170\164\145\162\156\141\154", "\154\157\157\160", "\162\145\143\157\162\144", "\50", "\51", "\173", "\175", \r
+"\133", "\135", "\56", "\72", "\73", "\54", "\74", "\74\75", "\76", "\76\75", \r
+"\75\75", "\74\76", "\53", "\55", "\56\53", "\56\55", "\52", "\57", "\56\52", "\56\57", \r
+"\136", "\56\136", "\75", "\72\75", null, null, null, null, null, };\r
+\r
+/** Lexer state names. */\r
+public static final String[] lexStateNames = {\r
+ "DEFAULT",\r
+};\r
+static final long[] jjtoToken = {
+ 0xfffffffffffffff1L, 0x7fffffffL,
+};\r
+static final long[] jjtoSkip = {
+ 0xeL, 0x0L,
+};\r
+protected SimpleCharStream input_stream;\r
+private final int[] jjrounds = new int[52];\r
+private final int[] jjstateSet = new int[104];\r
+private final StringBuilder jjimage = new StringBuilder();\r
+private StringBuilder image = jjimage;\r
+private int jjimageLen;\r
+private int lengthOfMatch;\r
+protected char curChar;\r
+/** Constructor. */\r
+public TableParserTokenManager(SimpleCharStream stream){\r
+ if (SimpleCharStream.staticFlag)\r
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");\r
+ input_stream = stream;\r
+}\r
+\r
+/** Constructor. */\r
+public TableParserTokenManager(SimpleCharStream stream, int lexState){\r
+ this(stream);\r
+ SwitchTo(lexState);\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream)\r
+{\r
+ jjmatchedPos = jjnewStateCnt = 0;\r
+ curLexState = defaultLexState;\r
+ input_stream = stream;\r
+ ReInitRounds();\r
+}\r
+private void ReInitRounds()\r
+{\r
+ int i;\r
+ jjround = 0x80000001;\r
+ for (i = 52; i-- > 0;)\r
+ jjrounds[i] = 0x80000000;\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream, int lexState)\r
+{\r
+ ReInit(stream);\r
+ SwitchTo(lexState);\r
+}\r
+\r
+/** Switch to specified lex state. */\r
+public void SwitchTo(int lexState)\r
+{\r
+ if (lexState >= 1 || lexState < 0)\r
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);\r
+ else\r
+ curLexState = lexState;\r
+}\r
+\r
+protected Token jjFillToken()\r
+{\r
+ final Token t;\r
+ final String curTokenImage;\r
+ final int beginLine;\r
+ final int endLine;\r
+ final int beginColumn;\r
+ final int endColumn;\r
+ String im = jjstrLiteralImages[jjmatchedKind];\r
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;\r
+ beginLine = input_stream.getBeginLine();\r
+ beginColumn = input_stream.getBeginColumn();\r
+ endLine = input_stream.getEndLine();\r
+ endColumn = input_stream.getEndColumn();\r
+ t = Token.newToken(jjmatchedKind, curTokenImage);\r
+\r
+ t.beginLine = beginLine;\r
+ t.endLine = endLine;\r
+ t.beginColumn = beginColumn;\r
+ t.endColumn = endColumn;\r
+\r
+ return t;\r
+}\r
+\r
+int curLexState = 0;\r
+int defaultLexState = 0;\r
+int jjnewStateCnt;\r
+int jjround;\r
+int jjmatchedPos;\r
+int jjmatchedKind;\r
+\r
+/** Get the next Token. */\r
+public Token getNextToken() \r
+{\r
+ Token matchedToken;\r
+ int curPos = 0;\r
+\r
+ EOFLoop :
+ for (;;)\r
+ {\r
+ try\r
+ {\r
+ curChar = input_stream.BeginToken();\r
+ }\r
+ catch(java.io.IOException e)\r
+ {\r
+ jjmatchedKind = 0;\r
+ matchedToken = jjFillToken();\r
+ return matchedToken;\r
+ }\r
+ image = jjimage;\r
+ image.setLength(0);\r
+ jjimageLen = 0;\r
+\r
+ jjmatchedKind = 0x7fffffff;\r
+ jjmatchedPos = 0;\r
+ curPos = jjMoveStringLiteralDfa0_0();\r
+ if (jjmatchedKind != 0x7fffffff)\r
+ {\r
+ if (jjmatchedPos + 1 < curPos)\r
+ input_stream.backup(curPos - jjmatchedPos - 1);\r
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\r
+ {\r
+ matchedToken = jjFillToken();\r
+ TokenLexicalActions(matchedToken);\r
+ return matchedToken;\r
+ }\r
+ else\r
+ {\r
+ continue EOFLoop;\r
+ }\r
+ }\r
+ int error_line = input_stream.getEndLine();\r
+ int error_column = input_stream.getEndColumn();\r
+ String error_after = null;\r
+ boolean EOFSeen = false;\r
+ try { input_stream.readChar(); input_stream.backup(1); }\r
+ catch (java.io.IOException e1) {\r
+ EOFSeen = true;\r
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+ if (curChar == '\n' || curChar == '\r') {\r
+ error_line++;\r
+ error_column = 0;\r
+ }\r
+ else\r
+ error_column++;\r
+ }\r
+ if (!EOFSeen) {\r
+ input_stream.backup(1);\r
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+ }\r
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\r
+ }\r
+}\r
+\r
+void TokenLexicalActions(Token matchedToken)\r
+{\r
+ switch(jjmatchedKind)\r
+ {\r
+ case 91 :\r
+ image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));\r
+ matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+}\r
+private void jjCheckNAdd(int state)\r
+{\r
+ if (jjrounds[state] != jjround)\r
+ {\r
+ jjstateSet[jjnewStateCnt++] = state;\r
+ jjrounds[state] = jjround;\r
+ }\r
+}\r
+private void jjAddStates(int start, int end)\r
+{\r
+ do {\r
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];\r
+ } while (start++ != end);\r
+}\r
+private void jjCheckNAddTwoStates(int state1, int state2)\r
+{\r
+ jjCheckNAdd(state1);\r
+ jjCheckNAdd(state2);\r
+}\r
+\r
+private void jjCheckNAddStates(int start, int end)\r
+{\r
+ do {\r
+ jjCheckNAdd(jjnextStates[start]);\r
+ } while (start++ != end);\r
+}\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */\r
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.tableParser;\r
+\r
+/**\r
+ * Describes the input token stream.\r
+ */\r
+\r
+public class Token implements java.io.Serializable {\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /**\r
+ * An integer that describes the kind of this token. This numbering\r
+ * system is determined by JavaCCParser, and a table of these numbers is\r
+ * stored in the file ...Constants.java.\r
+ */\r
+ public int kind;\r
+\r
+ /** The line number of the first character of this Token. */\r
+ public int beginLine;\r
+ /** The column number of the first character of this Token. */\r
+ public int beginColumn;\r
+ /** The line number of the last character of this Token. */\r
+ public int endLine;\r
+ /** The column number of the last character of this Token. */\r
+ public int endColumn;\r
+\r
+ /**\r
+ * The string image of the token.\r
+ */\r
+ public String image;\r
+\r
+ /**\r
+ * A reference to the next regular (non-special) token from the input\r
+ * stream. If this is the last token from the input stream, or if the\r
+ * token manager has not read tokens beyond this one, this field is\r
+ * set to null. This is true only if this token is also a regular\r
+ * token. Otherwise, see below for a description of the contents of\r
+ * this field.\r
+ */\r
+ public Token next;\r
+\r
+ /**\r
+ * This field is used to access special tokens that occur prior to this\r
+ * token, but after the immediately preceding regular (non-special) token.\r
+ * If there are no such special tokens, this field is set to null.\r
+ * When there are more than one such special token, this field refers\r
+ * to the last of these special tokens, which in turn refers to the next\r
+ * previous special token through its specialToken field, and so on\r
+ * until the first special token (whose specialToken field is null).\r
+ * The next fields of special tokens refer to other special tokens that\r
+ * immediately follow it (without an intervening regular token). If there\r
+ * is no such token, this field is null.\r
+ */\r
+ public Token specialToken;\r
+\r
+ /**\r
+ * An optional attribute value of the Token.\r
+ * Tokens which are not used as syntactic sugar will often contain\r
+ * meaningful values that will be used later on by the compiler or\r
+ * interpreter. This attribute value is often different from the image.\r
+ * Any subclass of Token that actually wants to return a non-null value can\r
+ * override this method as appropriate.\r
+ */\r
+ public Object getValue() {\r
+ return null;\r
+ }\r
+\r
+ /**\r
+ * No-argument constructor\r
+ */\r
+ public Token() {}\r
+\r
+ /**\r
+ * Constructs a new token for the specified Image.\r
+ */\r
+ public Token(int kind)\r
+ {\r
+ this(kind, null);\r
+ }\r
+\r
+ /**\r
+ * Constructs a new token for the specified Image and Kind.\r
+ */\r
+ public Token(int kind, String image)\r
+ {\r
+ this.kind = kind;\r
+ this.image = image;\r
+ }\r
+\r
+ /**\r
+ * Returns the image.\r
+ */\r
+ public String toString()\r
+ {\r
+ return image;\r
+ }\r
+\r
+ /**\r
+ * Returns a new Token object, by default. However, if you want, you\r
+ * can create and return subclass objects based on the value of ofKind.\r
+ * Simply add the cases to the switch for all those special cases.\r
+ * For example, if you have a subclass of Token called IDToken that\r
+ * you want to create if ofKind is ID, simply add something like :\r
+ *\r
+ * case MyParserConstants.ID : return new IDToken(ofKind, image);\r
+ *\r
+ * to the following switch statement. Then you can cast matchedToken\r
+ * variable to the appropriate type and use sit in your lexical actions.\r
+ */\r
+ public static Token newToken(int ofKind, String image)\r
+ {\r
+ switch(ofKind)\r
+ {\r
+ default : return new Token(ofKind, image);\r
+ }\r
+ }\r
+\r
+ public static Token newToken(int ofKind)\r
+ {\r
+ return newToken(ofKind, null);\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=d63d0e2011f8ce7fbf4f8ee6fd4e3986 (do not edit this line) */\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */\r
+/* JavaCCOptions: */\r
+package org.simantics.sysdyn.tableParser;\r
+\r
+/** Token Manager Error. */\r
+public class TokenMgrError extends Error\r
+{\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /*\r
+ * Ordinals for various reasons why an Error of this type can be thrown.\r
+ */\r
+\r
+ /**\r
+ * Lexical error occurred.\r
+ */\r
+ static final int LEXICAL_ERROR = 0;\r
+\r
+ /**\r
+ * An attempt was made to create a second instance of a static token manager.\r
+ */\r
+ static final int STATIC_LEXER_ERROR = 1;\r
+\r
+ /**\r
+ * Tried to change to an invalid lexical state.\r
+ */\r
+ static final int INVALID_LEXICAL_STATE = 2;\r
+\r
+ /**\r
+ * Detected (and bailed out of) an infinite loop in the token manager.\r
+ */\r
+ static final int LOOP_DETECTED = 3;\r
+\r
+ /**\r
+ * Indicates the reason why the exception is thrown. It will have\r
+ * one of the above 4 values.\r
+ */\r
+ int errorCode;\r
+\r
+ /**\r
+ * Replaces unprintable characters by their escaped (or unicode escaped)\r
+ * equivalents in the given string\r
+ */\r
+ protected static final String addEscapes(String str) {\r
+ StringBuffer retval = new StringBuffer();\r
+ char ch;\r
+ for (int i = 0; i < str.length(); i++) {\r
+ switch (str.charAt(i))\r
+ {\r
+ case 0 :\r
+ continue;\r
+ case '\b':\r
+ retval.append("\\b");\r
+ continue;\r
+ case '\t':\r
+ retval.append("\\t");\r
+ continue;\r
+ case '\n':\r
+ retval.append("\\n");\r
+ continue;\r
+ case '\f':\r
+ retval.append("\\f");\r
+ continue;\r
+ case '\r':\r
+ retval.append("\\r");\r
+ continue;\r
+ case '\"':\r
+ retval.append("\\\"");\r
+ continue;\r
+ case '\'':\r
+ retval.append("\\\'");\r
+ continue;\r
+ case '\\':\r
+ retval.append("\\\\");\r
+ continue;\r
+ default:\r
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+ String s = "0000" + Integer.toString(ch, 16);\r
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+ } else {\r
+ retval.append(ch);\r
+ }\r
+ continue;\r
+ }\r
+ }\r
+ return retval.toString();\r
+ }\r
+\r
+ /**\r
+ * Returns a detailed message for the Error when it is thrown by the\r
+ * token manager to indicate a lexical error.\r
+ * Parameters :\r
+ * EOFSeen : indicates if EOF caused the lexical error\r
+ * curLexState : lexical state in which this error occurred\r
+ * errorLine : line number when the error occurred\r
+ * errorColumn : column number when the error occurred\r
+ * errorAfter : prefix that was seen before this error occurred\r
+ * curchar : the offending character\r
+ * Note: You can customize the lexical error message by modifying this method.\r
+ */\r
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {\r
+ return("Lexical error at line " +\r
+ errorLine + ", column " +\r
+ errorColumn + ". Encountered: " +\r
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +\r
+ "after : \"" + addEscapes(errorAfter) + "\"");\r
+ }\r
+\r
+ /**\r
+ * You can also modify the body of this method to customize your error messages.\r
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not\r
+ * of end-users concern, so you can return something like :\r
+ *\r
+ * "Internal Error : Please file a bug report .... "\r
+ *\r
+ * from this method for such cases in the release version of your parser.\r
+ */\r
+ public String getMessage() {\r
+ return super.getMessage();\r
+ }\r
+\r
+ /*\r
+ * Constructors of various flavors follow.\r
+ */\r
+\r
+ /** No arg constructor. */\r
+ public TokenMgrError() {\r
+ }\r
+\r
+ /** Constructor with message and reason. */\r
+ public TokenMgrError(String message, int reason) {\r
+ super(message);\r
+ errorCode = reason;\r
+ }\r
+\r
+ /** Full Constructor. */\r
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {\r
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);\r
+ }\r
+}\r
+/* JavaCC - OriginalChecksum=abb0cd060e347479552118d1e61a7e46 (do not edit this line) */\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. JJTUnitParserState.java Version 5.0 */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+public class JJTUnitParserState {\r
+ private java.util.List<Node> nodes;\r
+ private java.util.List<Integer> marks;\r
+\r
+ private int sp; // number of nodes on stack\r
+ private int mk; // current mark\r
+ private boolean node_created;\r
+\r
+ public JJTUnitParserState() {\r
+ nodes = new java.util.ArrayList<Node>();\r
+ marks = new java.util.ArrayList<Integer>();\r
+ sp = 0;\r
+ mk = 0;\r
+ }\r
+\r
+ /* Determines whether the current node was actually closed and\r
+ pushed. This should only be called in the final user action of a\r
+ node scope. */\r
+ public boolean nodeCreated() {\r
+ return node_created;\r
+ }\r
+\r
+ /* Call this to reinitialize the node stack. It is called\r
+ automatically by the parser's ReInit() method. */\r
+ public void reset() {\r
+ nodes.clear();\r
+ marks.clear();\r
+ sp = 0;\r
+ mk = 0;\r
+ }\r
+\r
+ /* Returns the root node of the AST. It only makes sense to call\r
+ this after a successful parse. */\r
+ public Node rootNode() {\r
+ return nodes.get(0);\r
+ }\r
+\r
+ /* Pushes a node on to the stack. */\r
+ public void pushNode(Node n) {\r
+ nodes.add(n);\r
+ ++sp;\r
+ }\r
+\r
+ /* Returns the node on the top of the stack, and remove it from the\r
+ stack. */\r
+ public Node popNode() {\r
+ if (--sp < mk) {\r
+ mk = marks.remove(marks.size()-1);\r
+ }\r
+ return nodes.remove(nodes.size()-1);\r
+ }\r
+\r
+ /* Returns the node currently on the top of the stack. */\r
+ public Node peekNode() {\r
+ return nodes.get(nodes.size()-1);\r
+ }\r
+\r
+ /* Returns the number of children on the stack in the current node\r
+ scope. */\r
+ public int nodeArity() {\r
+ return sp - mk;\r
+ }\r
+\r
+\r
+ public void clearNodeScope(Node n) {\r
+ while (sp > mk) {\r
+ popNode();\r
+ }\r
+ mk = marks.remove(marks.size()-1);\r
+ }\r
+\r
+\r
+ public void openNodeScope(Node n) {\r
+ marks.add(mk);\r
+ mk = sp;\r
+ n.jjtOpen();\r
+ }\r
+\r
+\r
+ /* A definite node is constructed from a specified number of\r
+ children. That number of nodes are popped from the stack and\r
+ made the children of the definite node. Then the definite node\r
+ is pushed on to the stack. */\r
+ public void closeNodeScope(Node n, int num) {\r
+ mk = marks.remove(marks.size()-1);\r
+ while (num-- > 0) {\r
+ Node c = popNode();\r
+ c.jjtSetParent(n);\r
+ n.jjtAddChild(c, num);\r
+ }\r
+ n.jjtClose();\r
+ pushNode(n);\r
+ node_created = true;\r
+ }\r
+\r
+\r
+ /* A conditional node is constructed if its condition is true. All\r
+ the nodes that have been pushed since the node was opened are\r
+ made children of the conditional node, which is then pushed\r
+ on to the stack. If the condition is false the node is not\r
+ constructed and they are left on the stack. */\r
+ public void closeNodeScope(Node n, boolean condition) {\r
+ if (condition) {\r
+ int a = nodeArity();\r
+ mk = marks.remove(marks.size()-1);\r
+ while (a-- > 0) {\r
+ Node c = popNode();\r
+ c.jjtSetParent(n);\r
+ n.jjtAddChild(c, a);\r
+ }\r
+ n.jjtClose();\r
+ pushNode(n);\r
+ node_created = true;\r
+ } else {\r
+ mk = marks.remove(marks.size()-1);\r
+ node_created = false;\r
+ }\r
+ }\r
+}\r
+/* JavaCC - OriginalChecksum=d0c8ac05372006e3b61e33c0a234ef07 (do not edit this line) */\r
--- /dev/null
+/* Generated By:JJTree: Do not edit this line. Node.java Version 4.3 */\r
+/* JavaCCOptions:MULTI=false,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=UnitCheckingNodeFactory,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+/* All AST nodes must implement this interface. It provides basic\r
+ machinery for constructing the parent and child relationships\r
+ between nodes. */\r
+\r
+public\r
+interface Node {\r
+\r
+ /** This method is called after the node has been made the current\r
+ node. It indicates that child nodes can now be added to it. */\r
+ public void jjtOpen();\r
+\r
+ /** This method is called after all the child nodes have been\r
+ added. */\r
+ public void jjtClose();\r
+\r
+ /** This pair of methods are used to inform the node of its\r
+ parent. */\r
+ public void jjtSetParent(Node n);\r
+ public Node jjtGetParent();\r
+\r
+ /** This method tells the node to add its argument to the node's\r
+ list of children. */\r
+ public void jjtAddChild(Node n, int i);\r
+\r
+ /** This method returns a child node. The children are numbered\r
+ from zero, left to right. */\r
+ public Node jjtGetChild(int i);\r
+\r
+ /** Return the number of children the node has. */\r
+ public int jjtGetNumChildren();\r
+}\r
+/* JavaCC - OriginalChecksum=851e4a7b403fad4367cc9f6859ec9c32 (do not edit this line) */\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */\r
+/* JavaCCOptions:KEEP_LINE_COL=null */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+/**\r
+ * This exception is thrown when parse errors are encountered.\r
+ * You can explicitly create objects of this exception type by\r
+ * calling the method generateParseException in the generated\r
+ * parser.\r
+ *\r
+ * You can modify this class to customize your error reporting\r
+ * mechanisms so long as you retain the public fields.\r
+ */\r
+public class ParseException extends Exception {\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /**\r
+ * This constructor is used by the method "generateParseException"\r
+ * in the generated parser. Calling this constructor generates\r
+ * a new object of this type with the fields "currentToken",\r
+ * "expectedTokenSequences", and "tokenImage" set.\r
+ */\r
+ public ParseException(Token currentTokenVal,\r
+ int[][] expectedTokenSequencesVal,\r
+ String[] tokenImageVal\r
+ )\r
+ {\r
+ super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));\r
+ currentToken = currentTokenVal;\r
+ expectedTokenSequences = expectedTokenSequencesVal;\r
+ tokenImage = tokenImageVal;\r
+ }\r
+\r
+ /**\r
+ * The following constructors are for use by you for whatever\r
+ * purpose you can think of. Constructing the exception in this\r
+ * manner makes the exception behave in the normal way - i.e., as\r
+ * documented in the class "Throwable". The fields "errorToken",\r
+ * "expectedTokenSequences", and "tokenImage" do not contain\r
+ * relevant information. The JavaCC generated code does not use\r
+ * these constructors.\r
+ */\r
+\r
+ public ParseException() {\r
+ super();\r
+ }\r
+\r
+ /** Constructor with message. */\r
+ public ParseException(String message) {\r
+ super(message);\r
+ }\r
+\r
+\r
+ /**\r
+ * This is the last token that has been consumed successfully. If\r
+ * this object has been created due to a parse error, the token\r
+ * followng this token will (therefore) be the first error token.\r
+ */\r
+ public Token currentToken;\r
+\r
+ /**\r
+ * Each entry in this array is an array of integers. Each array\r
+ * of integers represents a sequence of tokens (by their ordinal\r
+ * values) that is expected at this point of the parse.\r
+ */\r
+ public int[][] expectedTokenSequences;\r
+\r
+ /**\r
+ * This is a reference to the "tokenImage" array of the generated\r
+ * parser within which the parse error occurred. This array is\r
+ * defined in the generated ...Constants interface.\r
+ */\r
+ public String[] tokenImage;\r
+\r
+ /**\r
+ * It uses "currentToken" and "expectedTokenSequences" to generate a parse\r
+ * error message and returns it. If this object has been created\r
+ * due to a parse error, and you do not catch it (it gets thrown\r
+ * from the parser) the correct error message\r
+ * gets displayed.\r
+ */\r
+ private static String initialise(Token currentToken,\r
+ int[][] expectedTokenSequences,\r
+ String[] tokenImage) {\r
+ String eol = System.getProperty("line.separator", "\n");\r
+ StringBuffer expected = new StringBuffer();\r
+ int maxSize = 0;\r
+ for (int i = 0; i < expectedTokenSequences.length; i++) {\r
+ if (maxSize < expectedTokenSequences[i].length) {\r
+ maxSize = expectedTokenSequences[i].length;\r
+ }\r
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {\r
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');\r
+ }\r
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {\r
+ expected.append("...");\r
+ }\r
+ expected.append(eol).append(" ");\r
+ }\r
+ String retval = "Encountered \"";\r
+ Token tok = currentToken.next;\r
+ for (int i = 0; i < maxSize; i++) {\r
+ if (i != 0) retval += " ";\r
+ if (tok.kind == 0) {\r
+ retval += tokenImage[0];\r
+ break;\r
+ }\r
+ retval += " " + tokenImage[tok.kind];\r
+ retval += " \"";\r
+ retval += add_escapes(tok.image);\r
+ retval += " \"";\r
+ tok = tok.next;\r
+ }\r
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;\r
+ retval += "." + eol;\r
+ if (expectedTokenSequences.length == 1) {\r
+ retval += "Was expecting:" + eol + " ";\r
+ } else {\r
+ retval += "Was expecting one of:" + eol + " ";\r
+ }\r
+ retval += expected.toString();\r
+ return retval;\r
+ }\r
+\r
+ /**\r
+ * The end of line string for this machine.\r
+ */\r
+ protected String eol = System.getProperty("line.separator", "\n");\r
+\r
+ /**\r
+ * Used to convert raw characters to their escaped version\r
+ * when these raw version cannot be used as part of an ASCII\r
+ * string literal.\r
+ */\r
+ static String add_escapes(String str) {\r
+ StringBuffer retval = new StringBuffer();\r
+ char ch;\r
+ for (int i = 0; i < str.length(); i++) {\r
+ switch (str.charAt(i))\r
+ {\r
+ case 0 :\r
+ continue;\r
+ case '\b':\r
+ retval.append("\\b");\r
+ continue;\r
+ case '\t':\r
+ retval.append("\\t");\r
+ continue;\r
+ case '\n':\r
+ retval.append("\\n");\r
+ continue;\r
+ case '\f':\r
+ retval.append("\\f");\r
+ continue;\r
+ case '\r':\r
+ retval.append("\\r");\r
+ continue;\r
+ case '\"':\r
+ retval.append("\\\"");\r
+ continue;\r
+ case '\'':\r
+ retval.append("\\\'");\r
+ continue;\r
+ case '\\':\r
+ retval.append("\\\\");\r
+ continue;\r
+ default:\r
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+ String s = "0000" + Integer.toString(ch, 16);\r
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+ } else {\r
+ retval.append(ch);\r
+ }\r
+ continue;\r
+ }\r
+ }\r
+ return retval.toString();\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=4af9901dc6c68e7e4e08ab85f10baa96 (do not edit this line) */\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */\r
+/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+/**\r
+ * An implementation of interface CharStream, where the stream is assumed to\r
+ * contain only ASCII characters (without unicode processing).\r
+ */\r
+\r
+public class SimpleCharStream\r
+{\r
+/** Whether parser is static. */\r
+ public static final boolean staticFlag = false;\r
+ int bufsize;\r
+ int available;\r
+ int tokenBegin;\r
+/** Position in buffer. */\r
+ public int bufpos = -1;\r
+ protected int bufline[];\r
+ protected int bufcolumn[];\r
+\r
+ protected int column = 0;\r
+ protected int line = 1;\r
+\r
+ protected boolean prevCharIsCR = false;\r
+ protected boolean prevCharIsLF = false;\r
+\r
+ protected java.io.Reader inputStream;\r
+\r
+ protected char[] buffer;\r
+ protected int maxNextCharInd = 0;\r
+ protected int inBuf = 0;\r
+ protected int tabSize = 8;\r
+\r
+ protected void setTabSize(int i) { tabSize = i; }\r
+ protected int getTabSize(int i) { return tabSize; }\r
+\r
+\r
+ protected void ExpandBuff(boolean wrapAround)\r
+ {\r
+ char[] newbuffer = new char[bufsize + 2048];\r
+ int newbufline[] = new int[bufsize + 2048];\r
+ int newbufcolumn[] = new int[bufsize + 2048];\r
+\r
+ try\r
+ {\r
+ if (wrapAround)\r
+ {\r
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+ System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);\r
+ buffer = newbuffer;\r
+\r
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);\r
+ bufline = newbufline;\r
+\r
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);\r
+ bufcolumn = newbufcolumn;\r
+\r
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));\r
+ }\r
+ else\r
+ {\r
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+ buffer = newbuffer;\r
+\r
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+ bufline = newbufline;\r
+\r
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+ bufcolumn = newbufcolumn;\r
+\r
+ maxNextCharInd = (bufpos -= tokenBegin);\r
+ }\r
+ }\r
+ catch (Throwable t)\r
+ {\r
+ throw new Error(t.getMessage());\r
+ }\r
+\r
+\r
+ bufsize += 2048;\r
+ available = bufsize;\r
+ tokenBegin = 0;\r
+ }\r
+\r
+ protected void FillBuff() throws java.io.IOException\r
+ {\r
+ if (maxNextCharInd == available)\r
+ {\r
+ if (available == bufsize)\r
+ {\r
+ if (tokenBegin > 2048)\r
+ {\r
+ bufpos = maxNextCharInd = 0;\r
+ available = tokenBegin;\r
+ }\r
+ else if (tokenBegin < 0)\r
+ bufpos = maxNextCharInd = 0;\r
+ else\r
+ ExpandBuff(false);\r
+ }\r
+ else if (available > tokenBegin)\r
+ available = bufsize;\r
+ else if ((tokenBegin - available) < 2048)\r
+ ExpandBuff(true);\r
+ else\r
+ available = tokenBegin;\r
+ }\r
+\r
+ int i;\r
+ try {\r
+ if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)\r
+ {\r
+ inputStream.close();\r
+ throw new java.io.IOException();\r
+ }\r
+ else\r
+ maxNextCharInd += i;\r
+ return;\r
+ }\r
+ catch(java.io.IOException e) {\r
+ --bufpos;\r
+ backup(0);\r
+ if (tokenBegin == -1)\r
+ tokenBegin = bufpos;\r
+ throw e;\r
+ }\r
+ }\r
+\r
+/** Start. */\r
+ public char BeginToken() throws java.io.IOException\r
+ {\r
+ tokenBegin = -1;\r
+ char c = readChar();\r
+ tokenBegin = bufpos;\r
+\r
+ return c;\r
+ }\r
+\r
+ protected void UpdateLineColumn(char c)\r
+ {\r
+ column++;\r
+\r
+ if (prevCharIsLF)\r
+ {\r
+ prevCharIsLF = false;\r
+ line += (column = 1);\r
+ }\r
+ else if (prevCharIsCR)\r
+ {\r
+ prevCharIsCR = false;\r
+ if (c == '\n')\r
+ {\r
+ prevCharIsLF = true;\r
+ }\r
+ else\r
+ line += (column = 1);\r
+ }\r
+\r
+ switch (c)\r
+ {\r
+ case '\r' :\r
+ prevCharIsCR = true;\r
+ break;\r
+ case '\n' :\r
+ prevCharIsLF = true;\r
+ break;\r
+ case '\t' :\r
+ column--;\r
+ column += (tabSize - (column % tabSize));\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+\r
+ bufline[bufpos] = line;\r
+ bufcolumn[bufpos] = column;\r
+ }\r
+\r
+/** Read a character. */\r
+ public char readChar() throws java.io.IOException\r
+ {\r
+ if (inBuf > 0)\r
+ {\r
+ --inBuf;\r
+\r
+ if (++bufpos == bufsize)\r
+ bufpos = 0;\r
+\r
+ return buffer[bufpos];\r
+ }\r
+\r
+ if (++bufpos >= maxNextCharInd)\r
+ FillBuff();\r
+\r
+ char c = buffer[bufpos];\r
+\r
+ UpdateLineColumn(c);\r
+ return c;\r
+ }\r
+\r
+ @Deprecated\r
+ /**\r
+ * @deprecated\r
+ * @see #getEndColumn\r
+ */\r
+\r
+ public int getColumn() {\r
+ return bufcolumn[bufpos];\r
+ }\r
+\r
+ @Deprecated\r
+ /**\r
+ * @deprecated\r
+ * @see #getEndLine\r
+ */\r
+\r
+ public int getLine() {\r
+ return bufline[bufpos];\r
+ }\r
+\r
+ /** Get token end column number. */\r
+ public int getEndColumn() {\r
+ return bufcolumn[bufpos];\r
+ }\r
+\r
+ /** Get token end line number. */\r
+ public int getEndLine() {\r
+ return bufline[bufpos];\r
+ }\r
+\r
+ /** Get token beginning column number. */\r
+ public int getBeginColumn() {\r
+ return bufcolumn[tokenBegin];\r
+ }\r
+\r
+ /** Get token beginning line number. */\r
+ public int getBeginLine() {\r
+ return bufline[tokenBegin];\r
+ }\r
+\r
+/** Backup a number of characters. */\r
+ public void backup(int amount) {\r
+\r
+ inBuf += amount;\r
+ if ((bufpos -= amount) < 0)\r
+ bufpos += bufsize;\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ inputStream = dstream;\r
+ line = startline;\r
+ column = startcolumn - 1;\r
+\r
+ available = bufsize = buffersize;\r
+ buffer = new char[buffersize];\r
+ bufline = new int[buffersize];\r
+ bufcolumn = new int[buffersize];\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ this(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.Reader dstream)\r
+ {\r
+ this(dstream, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ inputStream = dstream;\r
+ line = startline;\r
+ column = startcolumn - 1;\r
+\r
+ if (buffer == null || buffersize != buffer.length)\r
+ {\r
+ available = bufsize = buffersize;\r
+ buffer = new char[buffersize];\r
+ bufline = new int[buffersize];\r
+ bufcolumn = new int[buffersize];\r
+ }\r
+ prevCharIsLF = prevCharIsCR = false;\r
+ tokenBegin = inBuf = maxNextCharInd = 0;\r
+ bufpos = -1;\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ ReInit(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader dstream)\r
+ {\r
+ ReInit(dstream, 1, 1, 4096);\r
+ }\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(dstream, encoding, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ this(dstream, startline, startcolumn, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+ {\r
+ this(dstream, encoding, 1, 1, 4096);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SimpleCharStream(java.io.InputStream dstream)\r
+ {\r
+ this(dstream, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, int startline,\r
+ int startcolumn, int buffersize)\r
+ {\r
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(dstream, encoding, 1, 1, 4096);\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream)\r
+ {\r
+ ReInit(dstream, 1, 1, 4096);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+ int startcolumn) throws java.io.UnsupportedEncodingException\r
+ {\r
+ ReInit(dstream, encoding, startline, startcolumn, 4096);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream dstream, int startline,\r
+ int startcolumn)\r
+ {\r
+ ReInit(dstream, startline, startcolumn, 4096);\r
+ }\r
+ /** Get token literal value. */\r
+ public String GetImage()\r
+ {\r
+ if (bufpos >= tokenBegin)\r
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);\r
+ else\r
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +\r
+ new String(buffer, 0, bufpos + 1);\r
+ }\r
+\r
+ /** Get the suffix. */\r
+ public char[] GetSuffix(int len)\r
+ {\r
+ char[] ret = new char[len];\r
+\r
+ if ((bufpos + 1) >= len)\r
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);\r
+ else\r
+ {\r
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,\r
+ len - bufpos - 1);\r
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);\r
+ }\r
+\r
+ return ret;\r
+ }\r
+\r
+ /** Reset buffer when finished. */\r
+ public void Done()\r
+ {\r
+ buffer = null;\r
+ bufline = null;\r
+ bufcolumn = null;\r
+ }\r
+\r
+ /**\r
+ * Method to adjust line and column numbers for the start of a token.\r
+ */\r
+ public void adjustBeginLineColumn(int newLine, int newCol)\r
+ {\r
+ int start = tokenBegin;\r
+ int len;\r
+\r
+ if (bufpos >= tokenBegin)\r
+ {\r
+ len = bufpos - tokenBegin + inBuf + 1;\r
+ }\r
+ else\r
+ {\r
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;\r
+ }\r
+\r
+ int i = 0, j = 0, k = 0;\r
+ int nextColDiff = 0, columnDiff = 0;\r
+\r
+ while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])\r
+ {\r
+ bufline[j] = newLine;\r
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];\r
+ bufcolumn[j] = newCol + columnDiff;\r
+ columnDiff = nextColDiff;\r
+ i++;\r
+ }\r
+\r
+ if (i < len)\r
+ {\r
+ bufline[j] = newLine++;\r
+ bufcolumn[j] = newCol + columnDiff;\r
+\r
+ while (i++ < len)\r
+ {\r
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])\r
+ bufline[j] = newLine++;\r
+ else\r
+ bufline[j] = newLine;\r
+ }\r
+ }\r
+\r
+ line = bufline[j];\r
+ column = bufcolumn[j];\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=e3053baa4fc0756909ee8daa9c548c97 (do not edit this line) */\r
--- /dev/null
+/* Generated By:JJTree: Do not edit this line. SimpleNode.java Version 4.3 */\r
+/* JavaCCOptions:MULTI=false,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=UnitCheckingNodeFactory,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+public\r
+class SimpleNode implements Node {\r
+\r
+ protected Node parent;\r
+ protected Node[] children;\r
+ protected int id;\r
+ protected Object value;\r
+ protected UnitParser parser;\r
+ protected Token firstToken;\r
+ protected Token lastToken;\r
+\r
+ public SimpleNode(int i) {\r
+ id = i;\r
+ }\r
+\r
+ public SimpleNode(UnitParser p, int i) {\r
+ this(i);\r
+ parser = p;\r
+ }\r
+\r
+ public static Node jjtCreate(int id) {\r
+ return new SimpleNode(id);\r
+ }\r
+\r
+ public static Node jjtCreate(UnitParser p, int id) {\r
+ return new SimpleNode(p, id);\r
+ }\r
+\r
+ public void jjtOpen() {\r
+ }\r
+\r
+ public void jjtClose() {\r
+ }\r
+\r
+ public void jjtSetParent(Node n) { parent = n; }\r
+ public Node jjtGetParent() { return parent; }\r
+\r
+ public void jjtAddChild(Node n, int i) {\r
+ if (children == null) {\r
+ children = new Node[i + 1];\r
+ } else if (i >= children.length) {\r
+ Node c[] = new Node[i + 1];\r
+ System.arraycopy(children, 0, c, 0, children.length);\r
+ children = c;\r
+ }\r
+ children[i] = n;\r
+ }\r
+\r
+ public Node jjtGetChild(int i) {\r
+ return children[i];\r
+ }\r
+\r
+ public int jjtGetNumChildren() {\r
+ return (children == null) ? 0 : children.length;\r
+ }\r
+\r
+ public void jjtSetValue(Object value) { this.value = value; }\r
+ public Object jjtGetValue() { return value; }\r
+\r
+ public Token jjtGetFirstToken() { return firstToken; }\r
+ public void jjtSetFirstToken(Token token) { this.firstToken = token; }\r
+ public Token jjtGetLastToken() { return lastToken; }\r
+ public void jjtSetLastToken(Token token) { this.lastToken = token; }\r
+\r
+ /* You can override these two methods in subclasses of SimpleNode to\r
+ customize the way the node appears when the tree is dumped. If\r
+ your output uses more than one line you should override\r
+ toString(String), otherwise overriding toString() is probably all\r
+ you need to do. */\r
+\r
+ public String toString() { return UnitParserTreeConstants.jjtNodeName[id]; }\r
+ public String toString(String prefix) { return prefix + toString(); }\r
+\r
+ /* Override this method if you want to customize how the node dumps\r
+ out its children. */\r
+\r
+ public void dump(String prefix) {\r
+ System.out.println(toString(prefix));\r
+ if (children != null) {\r
+ for (int i = 0; i < children.length; ++i) {\r
+ SimpleNode n = (SimpleNode)children[i];\r
+ if (n != null) {\r
+ n.dump(prefix + " ");\r
+ }\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+/* JavaCC - OriginalChecksum=97c0294de1ef3976f0b09baf888d3564 (do not edit this line) */\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */\r
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+/**\r
+ * Describes the input token stream.\r
+ */\r
+\r
+public class Token implements java.io.Serializable {\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /**\r
+ * An integer that describes the kind of this token. This numbering\r
+ * system is determined by JavaCCParser, and a table of these numbers is\r
+ * stored in the file ...Constants.java.\r
+ */\r
+ public int kind;\r
+\r
+ /** The line number of the first character of this Token. */\r
+ public int beginLine;\r
+ /** The column number of the first character of this Token. */\r
+ public int beginColumn;\r
+ /** The line number of the last character of this Token. */\r
+ public int endLine;\r
+ /** The column number of the last character of this Token. */\r
+ public int endColumn;\r
+\r
+ /**\r
+ * The string image of the token.\r
+ */\r
+ public String image;\r
+\r
+ /**\r
+ * A reference to the next regular (non-special) token from the input\r
+ * stream. If this is the last token from the input stream, or if the\r
+ * token manager has not read tokens beyond this one, this field is\r
+ * set to null. This is true only if this token is also a regular\r
+ * token. Otherwise, see below for a description of the contents of\r
+ * this field.\r
+ */\r
+ public Token next;\r
+\r
+ /**\r
+ * This field is used to access special tokens that occur prior to this\r
+ * token, but after the immediately preceding regular (non-special) token.\r
+ * If there are no such special tokens, this field is set to null.\r
+ * When there are more than one such special token, this field refers\r
+ * to the last of these special tokens, which in turn refers to the next\r
+ * previous special token through its specialToken field, and so on\r
+ * until the first special token (whose specialToken field is null).\r
+ * The next fields of special tokens refer to other special tokens that\r
+ * immediately follow it (without an intervening regular token). If there\r
+ * is no such token, this field is null.\r
+ */\r
+ public Token specialToken;\r
+\r
+ /**\r
+ * An optional attribute value of the Token.\r
+ * Tokens which are not used as syntactic sugar will often contain\r
+ * meaningful values that will be used later on by the compiler or\r
+ * interpreter. This attribute value is often different from the image.\r
+ * Any subclass of Token that actually wants to return a non-null value can\r
+ * override this method as appropriate.\r
+ */\r
+ public Object getValue() {\r
+ return null;\r
+ }\r
+\r
+ /**\r
+ * No-argument constructor\r
+ */\r
+ public Token() {}\r
+\r
+ /**\r
+ * Constructs a new token for the specified Image.\r
+ */\r
+ public Token(int kind)\r
+ {\r
+ this(kind, null);\r
+ }\r
+\r
+ /**\r
+ * Constructs a new token for the specified Image and Kind.\r
+ */\r
+ public Token(int kind, String image)\r
+ {\r
+ this.kind = kind;\r
+ this.image = image;\r
+ }\r
+\r
+ /**\r
+ * Returns the image.\r
+ */\r
+ public String toString()\r
+ {\r
+ return image;\r
+ }\r
+\r
+ /**\r
+ * Returns a new Token object, by default. However, if you want, you\r
+ * can create and return subclass objects based on the value of ofKind.\r
+ * Simply add the cases to the switch for all those special cases.\r
+ * For example, if you have a subclass of Token called IDToken that\r
+ * you want to create if ofKind is ID, simply add something like :\r
+ *\r
+ * case MyParserConstants.ID : return new IDToken(ofKind, image);\r
+ *\r
+ * to the following switch statement. Then you can cast matchedToken\r
+ * variable to the appropriate type and use sit in your lexical actions.\r
+ */\r
+ public static Token newToken(int ofKind, String image)\r
+ {\r
+ switch(ofKind)\r
+ {\r
+ default : return new Token(ofKind, image);\r
+ }\r
+ }\r
+\r
+ public static Token newToken(int ofKind)\r
+ {\r
+ return newToken(ofKind, null);\r
+ }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=61dd11be23a2b24c2ed31564a8c7855c (do not edit this line) */\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */\r
+/* JavaCCOptions: */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+/** Token Manager Error. */\r
+public class TokenMgrError extends Error\r
+{\r
+\r
+ /**\r
+ * The version identifier for this Serializable class.\r
+ * Increment only if the <i>serialized</i> form of the\r
+ * class changes.\r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ /*\r
+ * Ordinals for various reasons why an Error of this type can be thrown.\r
+ */\r
+\r
+ /**\r
+ * Lexical error occurred.\r
+ */\r
+ static final int LEXICAL_ERROR = 0;\r
+\r
+ /**\r
+ * An attempt was made to create a second instance of a static token manager.\r
+ */\r
+ static final int STATIC_LEXER_ERROR = 1;\r
+\r
+ /**\r
+ * Tried to change to an invalid lexical state.\r
+ */\r
+ static final int INVALID_LEXICAL_STATE = 2;\r
+\r
+ /**\r
+ * Detected (and bailed out of) an infinite loop in the token manager.\r
+ */\r
+ static final int LOOP_DETECTED = 3;\r
+\r
+ /**\r
+ * Indicates the reason why the exception is thrown. It will have\r
+ * one of the above 4 values.\r
+ */\r
+ int errorCode;\r
+\r
+ /**\r
+ * Replaces unprintable characters by their escaped (or unicode escaped)\r
+ * equivalents in the given string\r
+ */\r
+ protected static final String addEscapes(String str) {\r
+ StringBuffer retval = new StringBuffer();\r
+ char ch;\r
+ for (int i = 0; i < str.length(); i++) {\r
+ switch (str.charAt(i))\r
+ {\r
+ case 0 :\r
+ continue;\r
+ case '\b':\r
+ retval.append("\\b");\r
+ continue;\r
+ case '\t':\r
+ retval.append("\\t");\r
+ continue;\r
+ case '\n':\r
+ retval.append("\\n");\r
+ continue;\r
+ case '\f':\r
+ retval.append("\\f");\r
+ continue;\r
+ case '\r':\r
+ retval.append("\\r");\r
+ continue;\r
+ case '\"':\r
+ retval.append("\\\"");\r
+ continue;\r
+ case '\'':\r
+ retval.append("\\\'");\r
+ continue;\r
+ case '\\':\r
+ retval.append("\\\\");\r
+ continue;\r
+ default:\r
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+ String s = "0000" + Integer.toString(ch, 16);\r
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+ } else {\r
+ retval.append(ch);\r
+ }\r
+ continue;\r
+ }\r
+ }\r
+ return retval.toString();\r
+ }\r
+\r
+ /**\r
+ * Returns a detailed message for the Error when it is thrown by the\r
+ * token manager to indicate a lexical error.\r
+ * Parameters :\r
+ * EOFSeen : indicates if EOF caused the lexical error\r
+ * curLexState : lexical state in which this error occurred\r
+ * errorLine : line number when the error occurred\r
+ * errorColumn : column number when the error occurred\r
+ * errorAfter : prefix that was seen before this error occurred\r
+ * curchar : the offending character\r
+ * Note: You can customize the lexical error message by modifying this method.\r
+ */\r
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {\r
+ return("Lexical error at line " +\r
+ errorLine + ", column " +\r
+ errorColumn + ". Encountered: " +\r
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +\r
+ "after : \"" + addEscapes(errorAfter) + "\"");\r
+ }\r
+\r
+ /**\r
+ * You can also modify the body of this method to customize your error messages.\r
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not\r
+ * of end-users concern, so you can return something like :\r
+ *\r
+ * "Internal Error : Please file a bug report .... "\r
+ *\r
+ * from this method for such cases in the release version of your parser.\r
+ */\r
+ public String getMessage() {\r
+ return super.getMessage();\r
+ }\r
+\r
+ /*\r
+ * Constructors of various flavors follow.\r
+ */\r
+\r
+ /** No arg constructor. */\r
+ public TokenMgrError() {\r
+ }\r
+\r
+ /** Constructor with message and reason. */\r
+ public TokenMgrError(String message, int reason) {\r
+ super(message);\r
+ errorCode = reason;\r
+ }\r
+\r
+ /** Full Constructor. */\r
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {\r
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);\r
+ }\r
+}\r
+/* JavaCC - OriginalChecksum=1a840694e4f0cebfb591db26400a3167 (do not edit this line) */\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+public class UnitCheckingException extends Exception {\r
+ public UnitCheckingException(String string) {\r
+ super(string);\r
+ }\r
+\r
+ private static final long serialVersionUID = -5828012051088095625L;\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+\r
+public class UnitCheckingNode extends SimpleNode {\r
+\r
+ public UnitCheckingNode(int id) {\r
+ super(id);\r
+ }\r
+\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException{\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+\r
+ if(jjtGetNumChildren() == 0){\r
+ String node = printNode();\r
+ result.append(node);\r
+ } else {\r
+ for(int i = 0; i < jjtGetNumChildren(); i++) {\r
+ result.appendResult(((UnitCheckingNode)jjtGetChild(i)).getUnits(units, functions, allowEquivalents));\r
+ }\r
+ }\r
+ return result; \r
+ }\r
+ \r
+ public String printNode() {\r
+ StringBuilder sb = new StringBuilder();\r
+ Token token = jjtGetFirstToken();\r
+ sb.append(token.image);\r
+\r
+ while(token != null && !token.equals(jjtGetLastToken())) {\r
+ token = token.next;\r
+ sb.append(token.image);\r
+ }\r
+\r
+ return sb.toString();\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+import java.lang.reflect.InvocationTargetException;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.nodes.AddOp;\r
+import org.simantics.sysdyn.unitParser.nodes.Arithmetic;\r
+import org.simantics.sysdyn.unitParser.nodes.ArrayDefinition;\r
+import org.simantics.sysdyn.unitParser.nodes.ComponentIdentity;\r
+import org.simantics.sysdyn.unitParser.nodes.ComponentReference;\r
+import org.simantics.sysdyn.unitParser.nodes.ComponentReferenceFull;\r
+import org.simantics.sysdyn.unitParser.nodes.Condition;\r
+import org.simantics.sysdyn.unitParser.nodes.Divide;\r
+import org.simantics.sysdyn.unitParser.nodes.Expression;\r
+import org.simantics.sysdyn.unitParser.nodes.Factor;\r
+import org.simantics.sysdyn.unitParser.nodes.ForIndex;\r
+import org.simantics.sysdyn.unitParser.nodes.FunctionArguments;\r
+import org.simantics.sysdyn.unitParser.nodes.FunctionCall;\r
+import org.simantics.sysdyn.unitParser.nodes.IfThenElse;\r
+import org.simantics.sysdyn.unitParser.nodes.LogicalExpression;\r
+import org.simantics.sysdyn.unitParser.nodes.LogicalFactor;\r
+import org.simantics.sysdyn.unitParser.nodes.LogicalTerm;\r
+import org.simantics.sysdyn.unitParser.nodes.Multiplication;\r
+import org.simantics.sysdyn.unitParser.nodes.NamedArguments;\r
+import org.simantics.sysdyn.unitParser.nodes.ParenthesisExpression;\r
+import org.simantics.sysdyn.unitParser.nodes.Power;\r
+import org.simantics.sysdyn.unitParser.nodes.RelOp;\r
+import org.simantics.sysdyn.unitParser.nodes.Relation;\r
+import org.simantics.sysdyn.unitParser.nodes.Term;\r
+import org.simantics.sysdyn.unitParser.nodes.Value;\r
+\r
+public class UnitCheckingNodeFactory {\r
+ \r
+ private static HashMap<String, Class<?>> constructors = new HashMap<String, Class<?>>();\r
+ \r
+ static {\r
+ constructors.put("logical_expression", LogicalExpression.class);\r
+ constructors.put("logical_term", LogicalTerm.class);\r
+ constructors.put("logical_factor", LogicalFactor.class);\r
+ constructors.put("relation", Relation.class);\r
+ constructors.put("term", Term.class);\r
+ constructors.put("factor", Factor.class);\r
+ constructors.put("arithmetic_expression", Arithmetic.class);\r
+ constructors.put("ifthenelse", IfThenElse.class);\r
+ constructors.put("array_definition", ArrayDefinition.class);\r
+ \r
+ constructors.put("component_reference_full", ComponentReferenceFull.class);\r
+ constructors.put("value", Value.class);\r
+\r
+\r
+ constructors.put("power", Power.class);\r
+ constructors.put("divide", Divide.class);\r
+ constructors.put("multiplication", Multiplication.class);\r
+ constructors.put("add_op", AddOp.class);\r
+ constructors.put("rel_op", RelOp.class);\r
+\r
+ \r
+ \r
+ constructors.put("component_reference", ComponentReference.class);\r
+ constructors.put("component_identity", ComponentIdentity.class);\r
+ constructors.put("condition", Condition.class);\r
+ constructors.put("for_index", ForIndex.class);\r
+ constructors.put("parenthesis_expression", ParenthesisExpression.class);\r
+ constructors.put("function_call", FunctionCall.class);\r
+ constructors.put("function_arguments", FunctionArguments.class);\r
+ constructors.put("named_arguments", NamedArguments.class);\r
+ constructors.put("expression", Expression.class);\r
+\r
+ \r
+ }\r
+ \r
+ private static Class<?> getConstructor(int id) {\r
+ String name = UnitParserTreeConstants.jjtNodeName[id];\r
+ Class<?> constructor = constructors.get(name);\r
+ if(constructor == null)\r
+ return UnitCheckingNode.class;\r
+ else\r
+ return constructor;\r
+ }\r
+ \r
+ public static Node jjtCreate(int id) {\r
+ try {\r
+ return (Node) getConstructor(id).getConstructors()[0].newInstance(id);\r
+ } catch (IllegalArgumentException e) {\r
+ e.printStackTrace();\r
+ } catch (SecurityException e) {\r
+ e.printStackTrace();\r
+ } catch (InstantiationException e) {\r
+ e.printStackTrace();\r
+ } catch (IllegalAccessException e) {\r
+ e.printStackTrace();\r
+ } catch (InvocationTargetException e) {\r
+ e.printStackTrace();\r
+ }\r
+ return null;\r
+ }\r
+ \r
+}\r
--- /dev/null
+/* Generated By:JJTree&JavaCC: Do not edit this line. UnitParser.java */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants, UnitParserConstants {/*@bgen(jjtree)*/\r
+ protected JJTUnitParserState jjtree = new JJTUnitParserState();\r
+\r
+/*** Parser ********************************************************/\r
+\r
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+ final public SimpleNode expr() throws ParseException {\r
+ /*@bgen(jjtree) expr */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTEXPR);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 0:\r
+ case 6:\r
+ case 12:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ simple_expression();\r
+ break;\r
+ default:\r
+ jj_la1[0] = jj_gen;\r
+ ;\r
+ }\r
+ jj_consume_token(0);\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtc000 = false;\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ {if (true) return jjtn000;}\r
+ break;\r
+ case 31:\r
+ ifthenelse();\r
+ jj_consume_token(0);\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtc000 = false;\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ {if (true) return jjtn000;}\r
+ break;\r
+ default:\r
+ jj_la1[1] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ throw new Error("Missing return statement in function");\r
+ }\r
+\r
+ final public void expression() throws ParseException {\r
+ /*@bgen(jjtree) expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTEXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ simple_expression();\r
+ break;\r
+ case 31:\r
+ ifthenelse();\r
+ break;\r
+ default:\r
+ jj_la1[2] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void ifthenelse() throws ParseException {\r
+ /*@bgen(jjtree) ifthenelse */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTIFTHENELSE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ jj_consume_token(31);\r
+ condition();\r
+ jj_consume_token(28);\r
+ expression();\r
+ label_1:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 20:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[3] = jj_gen;\r
+ break label_1;\r
+ }\r
+ jj_consume_token(20);\r
+ condition();\r
+ jj_consume_token(28);\r
+ expression();\r
+ }\r
+ jj_consume_token(15);\r
+ expression();\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void condition() throws ParseException {\r
+ /*@bgen(jjtree) condition */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTCONDITION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ expression();\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void simple_expression() throws ParseException {\r
+ /*@bgen(jjtree) simple_expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTSIMPLE_EXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ logical_expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 67:\r
+ jj_consume_token(67);\r
+ logical_expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 67:\r
+ jj_consume_token(67);\r
+ logical_expression();\r
+ break;\r
+ default:\r
+ jj_la1[4] = jj_gen;\r
+ ;\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[5] = jj_gen;\r
+ ;\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void logical_expression() throws ParseException {\r
+ /*@bgen(jjtree) logical_expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTLOGICAL_EXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ logical_term();\r
+ label_2:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 22:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[6] = jj_gen;\r
+ break label_2;\r
+ }\r
+ jj_consume_token(22);\r
+ logical_term();\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void logical_term() throws ParseException {\r
+ /*@bgen(jjtree) logical_term */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTLOGICAL_TERM);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ logical_factor();\r
+ label_3:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 9:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[7] = jj_gen;\r
+ break label_3;\r
+ }\r
+ jj_consume_token(9);\r
+ logical_factor();\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void logical_factor() throws ParseException {\r
+ /*@bgen(jjtree) logical_factor */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTLOGICAL_FACTOR);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 12:\r
+ jj_consume_token(12);\r
+ break;\r
+ default:\r
+ jj_la1[8] = jj_gen;\r
+ ;\r
+ }\r
+ relation();\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void relation() throws ParseException {\r
+ /*@bgen(jjtree) relation */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTRELATION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ arithmetic_expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 70:\r
+ case 71:\r
+ case 72:\r
+ case 73:\r
+ case 74:\r
+ case 75:\r
+ rel_op();\r
+ arithmetic_expression();\r
+ break;\r
+ default:\r
+ jj_la1[9] = jj_gen;\r
+ ;\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void rel_op() throws ParseException {\r
+ /*@bgen(jjtree) rel_op */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTREL_OP);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 70:\r
+ jj_consume_token(70);\r
+ break;\r
+ case 71:\r
+ jj_consume_token(71);\r
+ break;\r
+ case 72:\r
+ jj_consume_token(72);\r
+ break;\r
+ case 73:\r
+ jj_consume_token(73);\r
+ break;\r
+ case 74:\r
+ jj_consume_token(74);\r
+ break;\r
+ case 75:\r
+ jj_consume_token(75);\r
+ break;\r
+ default:\r
+ jj_la1[10] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void arithmetic_expression() throws ParseException {\r
+ /*@bgen(jjtree) arithmetic_expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTARITHMETIC_EXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ add_op();\r
+ break;\r
+ default:\r
+ jj_la1[11] = jj_gen;\r
+ ;\r
+ }\r
+ term();\r
+ label_4:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[12] = jj_gen;\r
+ break label_4;\r
+ }\r
+ add_op();\r
+ term();\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void add_op() throws ParseException {\r
+ /*@bgen(jjtree) add_op */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTADD_OP);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 76:\r
+ jj_consume_token(76);\r
+ break;\r
+ case 77:\r
+ jj_consume_token(77);\r
+ break;\r
+ case 78:\r
+ jj_consume_token(78);\r
+ break;\r
+ case 79:\r
+ jj_consume_token(79);\r
+ break;\r
+ default:\r
+ jj_la1[13] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void term() throws ParseException {\r
+ /*@bgen(jjtree) term */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTTERM);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ if (jj_2_1(2147483647)) {\r
+ factor();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ primary();\r
+ break;\r
+ default:\r
+ jj_la1[14] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ label_5:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 80:\r
+ case 81:\r
+ case 82:\r
+ case 83:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[15] = jj_gen;\r
+ break label_5;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 80:\r
+ case 82:\r
+ multiplication();\r
+ break;\r
+ case 81:\r
+ case 83:\r
+ divide();\r
+ break;\r
+ default:\r
+ jj_la1[16] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ if (jj_2_2(2147483647)) {\r
+ factor();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ primary();\r
+ break;\r
+ default:\r
+ jj_la1[17] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void factor() throws ParseException {\r
+ /*@bgen(jjtree) factor */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFACTOR);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ primary();\r
+ power();\r
+ primary();\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void power() throws ParseException {\r
+ /*@bgen(jjtree) power */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPOWER);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 84:\r
+ jj_consume_token(84);\r
+ break;\r
+ case 85:\r
+ jj_consume_token(85);\r
+ break;\r
+ default:\r
+ jj_la1[18] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void multiplication() throws ParseException {\r
+ /*@bgen(jjtree) multiplication */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTMULTIPLICATION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 80:\r
+ jj_consume_token(80);\r
+ break;\r
+ case 82:\r
+ jj_consume_token(82);\r
+ break;\r
+ default:\r
+ jj_la1[19] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void divide() throws ParseException {\r
+ /*@bgen(jjtree) divide */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTDIVIDE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 81:\r
+ jj_consume_token(81);\r
+ break;\r
+ case 83:\r
+ jj_consume_token(83);\r
+ break;\r
+ default:\r
+ jj_la1[20] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void primary() throws ParseException {\r
+ /*@bgen(jjtree) primary */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPRIMARY);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 33:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ value();\r
+ break;\r
+ default:\r
+ jj_la1[22] = jj_gen;\r
+ if (jj_2_3(2147483647)) {\r
+ function_call();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case IDENT:\r
+ component_reference_full();\r
+ break;\r
+ case 60:\r
+ parenthesis_expression();\r
+ break;\r
+ case 64:\r
+ jj_consume_token(64);\r
+ expression_list();\r
+ label_6:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 68:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[21] = jj_gen;\r
+ break label_6;\r
+ }\r
+ jj_consume_token(68);\r
+ expression_list();\r
+ }\r
+ jj_consume_token(65);\r
+ break;\r
+ case 62:\r
+ array_definition();\r
+ break;\r
+ case 35:\r
+ jj_consume_token(35);\r
+ break;\r
+ default:\r
+ jj_la1[23] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void component_reference_full() throws ParseException {\r
+ /*@bgen(jjtree) component_reference_full */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTCOMPONENT_REFERENCE_FULL);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ component_reference();\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void array_definition() throws ParseException {\r
+ /*@bgen(jjtree) array_definition */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTARRAY_DEFINITION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ jj_consume_token(62);\r
+ function_arguments();\r
+ jj_consume_token(63);\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void function_call() throws ParseException {\r
+ /*@bgen(jjtree) function_call */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFUNCTION_CALL);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ name();\r
+ function_call_args();\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void parenthesis_expression() throws ParseException {\r
+ /*@bgen(jjtree) parenthesis_expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPARENTHESIS_EXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ parenthesis_open();\r
+ expression();\r
+ parenthesis_close();\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void value() throws ParseException {\r
+ /*@bgen(jjtree) value */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTVALUE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case UNSIGNED_NUMBER:\r
+ jj_consume_token(UNSIGNED_NUMBER);\r
+ break;\r
+ case UNSIGNED_INTEGER:\r
+ jj_consume_token(UNSIGNED_INTEGER);\r
+ break;\r
+ case STRING:\r
+ jj_consume_token(STRING);\r
+ break;\r
+ case 6:\r
+ jj_consume_token(6);\r
+ break;\r
+ case 33:\r
+ jj_consume_token(33);\r
+ break;\r
+ default:\r
+ jj_la1[24] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void parenthesis_open() throws ParseException {\r
+ /*@bgen(jjtree) parenthesis_open */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPARENTHESIS_OPEN);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ jj_consume_token(60);\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void parenthesis_close() throws ParseException {\r
+ /*@bgen(jjtree) parenthesis_close */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPARENTHESIS_CLOSE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ jj_consume_token(61);\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void name() throws ParseException {\r
+ /*@bgen(jjtree) name */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAME);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ jj_consume_token(IDENT);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 66:\r
+ jj_consume_token(66);\r
+ name();\r
+ break;\r
+ default:\r
+ jj_la1[25] = jj_gen;\r
+ ;\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void component_reference() throws ParseException {\r
+ /*@bgen(jjtree) component_reference */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTCOMPONENT_REFERENCE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ component_identity();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 64:\r
+ array_subscripts();\r
+ break;\r
+ default:\r
+ jj_la1[26] = jj_gen;\r
+ ;\r
+ }\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 66:\r
+ jj_consume_token(66);\r
+ component_reference();\r
+ break;\r
+ default:\r
+ jj_la1[27] = jj_gen;\r
+ ;\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void component_identity() throws ParseException {\r
+ /*@bgen(jjtree) component_identity */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTCOMPONENT_IDENTITY);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ jj_consume_token(IDENT);\r
+ label_7:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case IDENT:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[28] = jj_gen;\r
+ break label_7;\r
+ }\r
+ jj_consume_token(IDENT);\r
+ }\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void function_call_args() throws ParseException {\r
+ /*@bgen(jjtree) function_call_args */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFUNCTION_CALL_ARGS);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ parenthesis_open();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ function_arguments();\r
+ break;\r
+ default:\r
+ jj_la1[29] = jj_gen;\r
+ ;\r
+ }\r
+ parenthesis_close();\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void function_arguments() throws ParseException {\r
+ /*@bgen(jjtree) function_arguments */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFUNCTION_ARGUMENTS);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ if (jj_2_4(2)) {\r
+ named_arguments();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 21:\r
+ case 69:\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ jj_consume_token(69);\r
+ function_arguments();\r
+ break;\r
+ case 21:\r
+ jj_consume_token(21);\r
+ for_indices();\r
+ break;\r
+ default:\r
+ jj_la1[30] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[31] = jj_gen;\r
+ ;\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[32] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void for_indices() throws ParseException {\r
+ /*@bgen(jjtree) for_indices */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFOR_INDICES);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ for_index();\r
+ label_8:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[33] = jj_gen;\r
+ break label_8;\r
+ }\r
+ jj_consume_token(69);\r
+ for_index();\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void for_index() throws ParseException {\r
+ /*@bgen(jjtree) for_index */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFOR_INDEX);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ jj_consume_token(IDENT);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 41:\r
+ jj_consume_token(41);\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[34] = jj_gen;\r
+ ;\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void named_arguments() throws ParseException {\r
+ /*@bgen(jjtree) named_arguments */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAMED_ARGUMENTS);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ named_argument();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ jj_consume_token(69);\r
+ named_arguments();\r
+ break;\r
+ default:\r
+ jj_la1[35] = jj_gen;\r
+ ;\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void named_argument() throws ParseException {\r
+ /*@bgen(jjtree) named_argument */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAMED_ARGUMENT);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ jj_consume_token(IDENT);\r
+ jj_consume_token(86);\r
+ expression();\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void output_expression_list() throws ParseException {\r
+ /*@bgen(jjtree) output_expression_list */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTOUTPUT_EXPRESSION_LIST);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[36] = jj_gen;\r
+ ;\r
+ }\r
+ label_9:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[37] = jj_gen;\r
+ break label_9;\r
+ }\r
+ jj_consume_token(69);\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 6:\r
+ case 12:\r
+ case 31:\r
+ case 33:\r
+ case 35:\r
+ case 60:\r
+ case 62:\r
+ case 64:\r
+ case 76:\r
+ case 77:\r
+ case 78:\r
+ case 79:\r
+ case IDENT:\r
+ case STRING:\r
+ case UNSIGNED_INTEGER:\r
+ case UNSIGNED_NUMBER:\r
+ expression();\r
+ break;\r
+ default:\r
+ jj_la1[38] = jj_gen;\r
+ ;\r
+ }\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void expression_list() throws ParseException {\r
+ /*@bgen(jjtree) expression_list */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTEXPRESSION_LIST);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ expression();\r
+ label_10:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[39] = jj_gen;\r
+ break label_10;\r
+ }\r
+ jj_consume_token(69);\r
+ expression();\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void array_subscripts() throws ParseException {\r
+ /*@bgen(jjtree) array_subscripts */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTARRAY_SUBSCRIPTS);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ jj_consume_token(64);\r
+ subscript();\r
+ label_11:\r
+ while (true) {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 69:\r
+ ;\r
+ break;\r
+ default:\r
+ jj_la1[40] = jj_gen;\r
+ break label_11;\r
+ }\r
+ jj_consume_token(69);\r
+ subscript();\r
+ }\r
+ jj_consume_token(65);\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void subscript() throws ParseException {\r
+ /*@bgen(jjtree) subscript */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTSUBSCRIPT);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 67:\r
+ jj_consume_token(67);\r
+ break;\r
+ default:\r
+ jj_la1[42] = jj_gen;\r
+ if (jj_2_5(2147483647)) {\r
+ function_call();\r
+ } else {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case IDENT:\r
+ case UNSIGNED_INTEGER:\r
+ rangeIndex();\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case 67:\r
+ jj_consume_token(67);\r
+ rangeIndex();\r
+ break;\r
+ default:\r
+ jj_la1[41] = jj_gen;\r
+ ;\r
+ }\r
+ break;\r
+ default:\r
+ jj_la1[43] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ }\r
+ }\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ {if (true) throw (RuntimeException)jjte000;}\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ {if (true) throw (ParseException)jjte000;}\r
+ }\r
+ {if (true) throw (Error)jjte000;}\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ final public void rangeIndex() throws ParseException {\r
+ /*@bgen(jjtree) rangeIndex */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTRANGEINDEX);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+ try {\r
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+ case UNSIGNED_INTEGER:\r
+ jj_consume_token(UNSIGNED_INTEGER);\r
+ break;\r
+ case IDENT:\r
+ jj_consume_token(IDENT);\r
+ break;\r
+ default:\r
+ jj_la1[44] = jj_gen;\r
+ jj_consume_token(-1);\r
+ throw new ParseException();\r
+ }\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+ }\r
+\r
+ private boolean jj_2_1(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_1(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(0, xla); }\r
+ }\r
+\r
+ private boolean jj_2_2(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_2(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(1, xla); }\r
+ }\r
+\r
+ private boolean jj_2_3(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_3(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(2, xla); }\r
+ }\r
+\r
+ private boolean jj_2_4(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_4(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(3, xla); }\r
+ }\r
+\r
+ private boolean jj_2_5(int xla) {\r
+ jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+ try { return !jj_3_5(); }\r
+ catch(LookaheadSuccess ls) { return true; }\r
+ finally { jj_save(4, xla); }\r
+ }\r
+\r
+ private boolean jj_3R_80() {\r
+ if (jj_3R_12()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_31() {\r
+ if (jj_scan_token(62)) return true;\r
+ if (jj_3R_37()) return true;\r
+ if (jj_scan_token(63)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_27() {\r
+ if (jj_3R_33()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_3() {\r
+ if (jj_3R_14()) return true;\r
+ if (jj_3R_15()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_22() {\r
+ if (jj_3R_31()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_21() {\r
+ if (jj_scan_token(64)) return true;\r
+ if (jj_3R_29()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_30()) { jj_scanpos = xsp; break; }\r
+ }\r
+ if (jj_scan_token(65)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_20() {\r
+ if (jj_3R_28()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_19() {\r
+ if (jj_3R_27()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_18() {\r
+ if (jj_3R_26()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_12() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_17()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_18()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_19()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_20()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_21()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_22()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(35)) return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_17() {\r
+ if (jj_3R_25()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_88() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(81)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(83)) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_87() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(80)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(82)) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_13() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(84)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(85)) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_62() {\r
+ if (jj_scan_token(67)) return true;\r
+ if (jj_3R_51()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_1() {\r
+ if (jj_3R_12()) return true;\r
+ if (jj_3R_13()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_73() {\r
+ if (jj_3R_77()) return true;\r
+ if (jj_3R_72()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_76() {\r
+ if (jj_3R_78()) return true;\r
+ if (jj_3R_75()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_82() {\r
+ if (jj_3R_12()) return true;\r
+ if (jj_3R_13()) return true;\r
+ if (jj_3R_12()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_79() {\r
+ if (jj_3R_82()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_75() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_79()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_80()) return true;\r
+ }\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_81()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_78() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(76)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(77)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(78)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(79)) return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_67() {\r
+ if (jj_scan_token(9)) return true;\r
+ if (jj_3R_66()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_74() {\r
+ if (jj_3R_78()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_72() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_74()) jj_scanpos = xsp;\r
+ if (jj_3R_75()) return true;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_76()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_77() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(70)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(71)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(72)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(73)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(74)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(75)) return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_52() {\r
+ if (jj_scan_token(67)) return true;\r
+ if (jj_3R_51()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_62()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_61() {\r
+ if (jj_scan_token(22)) return true;\r
+ if (jj_3R_60()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_54() {\r
+ if (jj_scan_token(20)) return true;\r
+ if (jj_3R_53()) return true;\r
+ if (jj_scan_token(28)) return true;\r
+ if (jj_3R_34()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_70() {\r
+ if (jj_3R_72()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_73()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_66() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(12)) jj_scanpos = xsp;\r
+ if (jj_3R_70()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_65() {\r
+ if (jj_scan_token(67)) return true;\r
+ if (jj_3R_64()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_5() {\r
+ if (jj_3R_14()) return true;\r
+ if (jj_3R_15()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_60() {\r
+ if (jj_3R_66()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_67()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_50() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_49()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_51() {\r
+ if (jj_3R_60()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_61()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_64() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(90)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(88)) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_46() {\r
+ if (jj_3R_51()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_52()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_58() {\r
+ if (jj_3R_26()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_59() {\r
+ if (jj_3R_64()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_65()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_36() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_34()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_49() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(67)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_58()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_59()) return true;\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_57() {\r
+ if (jj_scan_token(21)) return true;\r
+ if (jj_3R_63()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_45() {\r
+ if (jj_scan_token(64)) return true;\r
+ if (jj_3R_49()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_50()) { jj_scanpos = xsp; break; }\r
+ }\r
+ if (jj_scan_token(65)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_55() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_16()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_53() {\r
+ if (jj_3R_34()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_43() {\r
+ if (jj_3R_47()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_34() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_42()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_43()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_42() {\r
+ if (jj_3R_46()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_47() {\r
+ if (jj_scan_token(31)) return true;\r
+ if (jj_3R_53()) return true;\r
+ if (jj_scan_token(28)) return true;\r
+ if (jj_3R_34()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_54()) { jj_scanpos = xsp; break; }\r
+ }\r
+ if (jj_scan_token(15)) return true;\r
+ if (jj_3R_34()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_29() {\r
+ if (jj_3R_34()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_36()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_41() {\r
+ if (jj_scan_token(66)) return true;\r
+ if (jj_3R_33()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_24() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ if (jj_scan_token(86)) return true;\r
+ if (jj_3R_34()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_71() {\r
+ if (jj_scan_token(41)) return true;\r
+ if (jj_3R_34()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_86() {\r
+ if (jj_3R_12()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_69() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_68()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_16() {\r
+ if (jj_3R_24()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_55()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_48() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_56()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_57()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_56() {\r
+ if (jj_scan_token(69)) return true;\r
+ if (jj_3R_37()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_38() {\r
+ if (jj_3R_37()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_68() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_71()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_63() {\r
+ if (jj_3R_68()) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_69()) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_40() {\r
+ if (jj_3R_45()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_44() {\r
+ if (jj_3R_34()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_48()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_4() {\r
+ if (jj_3R_16()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_37() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3_4()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_44()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_32() {\r
+ if (jj_3R_15()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_38()) jj_scanpos = xsp;\r
+ if (jj_3R_35()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3_2() {\r
+ if (jj_3R_12()) return true;\r
+ if (jj_3R_13()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_23() {\r
+ if (jj_scan_token(66)) return true;\r
+ if (jj_3R_14()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_85() {\r
+ if (jj_3R_82()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_39() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ Token xsp;\r
+ while (true) {\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(88)) { jj_scanpos = xsp; break; }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_33() {\r
+ if (jj_3R_39()) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_40()) jj_scanpos = xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_41()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_14() {\r
+ if (jj_scan_token(IDENT)) return true;\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_23()) jj_scanpos = xsp;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_84() {\r
+ if (jj_3R_88()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_35() {\r
+ if (jj_scan_token(61)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_15() {\r
+ if (jj_scan_token(60)) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_25() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_scan_token(91)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(90)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(89)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(6)) {\r
+ jj_scanpos = xsp;\r
+ if (jj_scan_token(33)) return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_83() {\r
+ if (jj_3R_87()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_81() {\r
+ Token xsp;\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_83()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_84()) return true;\r
+ }\r
+ xsp = jj_scanpos;\r
+ if (jj_3R_85()) {\r
+ jj_scanpos = xsp;\r
+ if (jj_3R_86()) return true;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_30() {\r
+ if (jj_scan_token(68)) return true;\r
+ if (jj_3R_29()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_28() {\r
+ if (jj_3R_15()) return true;\r
+ if (jj_3R_34()) return true;\r
+ if (jj_3R_35()) return true;\r
+ return false;\r
+ }\r
+\r
+ private boolean jj_3R_26() {\r
+ if (jj_3R_14()) return true;\r
+ if (jj_3R_32()) return true;\r
+ return false;\r
+ }\r
+\r
+ /** Generated Token Manager. */\r
+ public UnitParserTokenManager token_source;\r
+ SimpleCharStream jj_input_stream;\r
+ /** Current token. */\r
+ public Token token;\r
+ /** Next token. */\r
+ public Token jj_nt;\r
+ private int jj_ntk;\r
+ private Token jj_scanpos, jj_lastpos;\r
+ private int jj_la;\r
+ private int jj_gen;\r
+ final private int[] jj_la1 = new int[45];\r
+ static private int[] jj_la1_0;\r
+ static private int[] jj_la1_1;\r
+ static private int[] jj_la1_2;\r
+ static {\r
+ jj_la1_init_0();\r
+ jj_la1_init_1();\r
+ jj_la1_init_2();\r
+ }\r
+ private static void jj_la1_init_0() {\r
+ jj_la1_0 = new int[] {0x1040,0x80001041,0x80001040,0x100000,0x0,0x0,0x400000,0x200,0x1000,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x80001040,0x200000,0x200000,0x80001040,0x0,0x0,0x0,0x80001040,0x0,0x80001040,0x0,0x0,0x0,0x0,0x0,0x0,};\r
+ }\r
+ private static void jj_la1_init_1() {\r
+ jj_la1_1 = new int[] {0x5000000a,0x5000000a,0x5000000a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5000000a,0x0,0x0,0x5000000a,0x0,0x0,0x0,0x0,0x2,0x50000008,0x2,0x0,0x0,0x0,0x0,0x5000000a,0x0,0x0,0x5000000a,0x0,0x200,0x0,0x5000000a,0x0,0x5000000a,0x0,0x0,0x0,0x0,0x0,0x0,};\r
+ }\r
+ private static void jj_la1_init_2() {\r
+ jj_la1_2 = new int[] {0xf00f001,0xf00f001,0xf00f001,0x0,0x8,0x8,0x0,0x0,0x0,0xfc0,0xfc0,0xf000,0xf000,0xf000,0xf000001,0xf0000,0xf0000,0xf000001,0x300000,0x50000,0xa0000,0x10,0xe000000,0x1000001,0xe000000,0x4,0x1,0x4,0x1000000,0xf00f001,0x20,0x20,0xf00f001,0x20,0x0,0x20,0xf00f001,0x20,0xf00f001,0x20,0x20,0x8,0x8,0x5000000,0x5000000,};\r
+ }\r
+ final private JJCalls[] jj_2_rtns = new JJCalls[5];\r
+ private boolean jj_rescan = false;\r
+ private int jj_gc = 0;\r
+\r
+ /** Constructor with InputStream. */\r
+ public UnitParser(java.io.InputStream stream) {\r
+ this(stream, null);\r
+ }\r
+ /** Constructor with InputStream and supplied encoding */\r
+ public UnitParser(java.io.InputStream stream, String encoding) {\r
+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+ token_source = new UnitParserTokenManager(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 45; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream stream) {\r
+ ReInit(stream, null);\r
+ }\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.InputStream stream, String encoding) {\r
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+ token_source.ReInit(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jjtree.reset();\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 45; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Constructor. */\r
+ public UnitParser(java.io.Reader stream) {\r
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);\r
+ token_source = new UnitParserTokenManager(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 45; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(java.io.Reader stream) {\r
+ jj_input_stream.ReInit(stream, 1, 1);\r
+ token_source.ReInit(jj_input_stream);\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jjtree.reset();\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 45; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Constructor with generated Token Manager. */\r
+ public UnitParser(UnitParserTokenManager tm) {\r
+ token_source = tm;\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 45; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ /** Reinitialise. */\r
+ public void ReInit(UnitParserTokenManager tm) {\r
+ token_source = tm;\r
+ token = new Token();\r
+ jj_ntk = -1;\r
+ jjtree.reset();\r
+ jj_gen = 0;\r
+ for (int i = 0; i < 45; i++) jj_la1[i] = -1;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+ }\r
+\r
+ private Token jj_consume_token(int kind) throws ParseException {\r
+ Token oldToken;\r
+ if ((oldToken = token).next != null) token = token.next;\r
+ else token = token.next = token_source.getNextToken();\r
+ jj_ntk = -1;\r
+ if (token.kind == kind) {\r
+ jj_gen++;\r
+ if (++jj_gc > 100) {\r
+ jj_gc = 0;\r
+ for (int i = 0; i < jj_2_rtns.length; i++) {\r
+ JJCalls c = jj_2_rtns[i];\r
+ while (c != null) {\r
+ if (c.gen < jj_gen) c.first = null;\r
+ c = c.next;\r
+ }\r
+ }\r
+ }\r
+ return token;\r
+ }\r
+ token = oldToken;\r
+ jj_kind = kind;\r
+ throw generateParseException();\r
+ }\r
+\r
+ static private final class LookaheadSuccess extends java.lang.Error { }\r
+ final private LookaheadSuccess jj_ls = new LookaheadSuccess();\r
+ private boolean jj_scan_token(int kind) {\r
+ if (jj_scanpos == jj_lastpos) {\r
+ jj_la--;\r
+ if (jj_scanpos.next == null) {\r
+ jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();\r
+ } else {\r
+ jj_lastpos = jj_scanpos = jj_scanpos.next;\r
+ }\r
+ } else {\r
+ jj_scanpos = jj_scanpos.next;\r
+ }\r
+ if (jj_rescan) {\r
+ int i = 0; Token tok = token;\r
+ while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }\r
+ if (tok != null) jj_add_error_token(kind, i);\r
+ }\r
+ if (jj_scanpos.kind != kind) return true;\r
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;\r
+ return false;\r
+ }\r
+\r
+\r
+/** Get the next Token. */\r
+ final public Token getNextToken() {\r
+ if (token.next != null) token = token.next;\r
+ else token = token.next = token_source.getNextToken();\r
+ jj_ntk = -1;\r
+ jj_gen++;\r
+ return token;\r
+ }\r
+\r
+/** Get the specific Token. */\r
+ final public Token getToken(int index) {\r
+ Token t = token;\r
+ for (int i = 0; i < index; i++) {\r
+ if (t.next != null) t = t.next;\r
+ else t = t.next = token_source.getNextToken();\r
+ }\r
+ return t;\r
+ }\r
+\r
+ private int jj_ntk() {\r
+ if ((jj_nt=token.next) == null)\r
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);\r
+ else\r
+ return (jj_ntk = jj_nt.kind);\r
+ }\r
+\r
+ private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();\r
+ private int[] jj_expentry;\r
+ private int jj_kind = -1;\r
+ private int[] jj_lasttokens = new int[100];\r
+ private int jj_endpos;\r
+\r
+ private void jj_add_error_token(int kind, int pos) {\r
+ if (pos >= 100) return;\r
+ if (pos == jj_endpos + 1) {\r
+ jj_lasttokens[jj_endpos++] = kind;\r
+ } else if (jj_endpos != 0) {\r
+ jj_expentry = new int[jj_endpos];\r
+ for (int i = 0; i < jj_endpos; i++) {\r
+ jj_expentry[i] = jj_lasttokens[i];\r
+ }\r
+ jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) {\r
+ int[] oldentry = (int[])(it.next());\r
+ if (oldentry.length == jj_expentry.length) {\r
+ for (int i = 0; i < jj_expentry.length; i++) {\r
+ if (oldentry[i] != jj_expentry[i]) {\r
+ continue jj_entries_loop;\r
+ }\r
+ }\r
+ jj_expentries.add(jj_expentry);\r
+ break jj_entries_loop;\r
+ }\r
+ }\r
+ if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;\r
+ }\r
+ }\r
+\r
+ /** Generate ParseException. */\r
+ public ParseException generateParseException() {\r
+ jj_expentries.clear();\r
+ boolean[] la1tokens = new boolean[92];\r
+ if (jj_kind >= 0) {\r
+ la1tokens[jj_kind] = true;\r
+ jj_kind = -1;\r
+ }\r
+ for (int i = 0; i < 45; i++) {\r
+ if (jj_la1[i] == jj_gen) {\r
+ for (int j = 0; j < 32; j++) {\r
+ if ((jj_la1_0[i] & (1<<j)) != 0) {\r
+ la1tokens[j] = true;\r
+ }\r
+ if ((jj_la1_1[i] & (1<<j)) != 0) {\r
+ la1tokens[32+j] = true;\r
+ }\r
+ if ((jj_la1_2[i] & (1<<j)) != 0) {\r
+ la1tokens[64+j] = true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ for (int i = 0; i < 92; i++) {\r
+ if (la1tokens[i]) {\r
+ jj_expentry = new int[1];\r
+ jj_expentry[0] = i;\r
+ jj_expentries.add(jj_expentry);\r
+ }\r
+ }\r
+ jj_endpos = 0;\r
+ jj_rescan_token();\r
+ jj_add_error_token(0, 0);\r
+ int[][] exptokseq = new int[jj_expentries.size()][];\r
+ for (int i = 0; i < jj_expentries.size(); i++) {\r
+ exptokseq[i] = jj_expentries.get(i);\r
+ }\r
+ return new ParseException(token, exptokseq, tokenImage);\r
+ }\r
+\r
+ /** Enable tracing. */\r
+ final public void enable_tracing() {\r
+ }\r
+\r
+ /** Disable tracing. */\r
+ final public void disable_tracing() {\r
+ }\r
+\r
+ private void jj_rescan_token() {\r
+ jj_rescan = true;\r
+ for (int i = 0; i < 5; i++) {\r
+ try {\r
+ JJCalls p = jj_2_rtns[i];\r
+ do {\r
+ if (p.gen > jj_gen) {\r
+ jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;\r
+ switch (i) {\r
+ case 0: jj_3_1(); break;\r
+ case 1: jj_3_2(); break;\r
+ case 2: jj_3_3(); break;\r
+ case 3: jj_3_4(); break;\r
+ case 4: jj_3_5(); break;\r
+ }\r
+ }\r
+ p = p.next;\r
+ } while (p != null);\r
+ } catch(LookaheadSuccess ls) { }\r
+ }\r
+ jj_rescan = false;\r
+ }\r
+\r
+ private void jj_save(int index, int xla) {\r
+ JJCalls p = jj_2_rtns[index];\r
+ while (p.gen > jj_gen) {\r
+ if (p.next == null) { p = p.next = new JJCalls(); break; }\r
+ p = p.next;\r
+ }\r
+ p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;\r
+ }\r
+\r
+ static final class JJCalls {\r
+ int gen;\r
+ Token first;\r
+ int arg;\r
+ JJCalls next;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. UnitParser.jj */\r
+/*@egen*/options {\r
+ JDK_VERSION = "1.6";\r
+ STATIC = false;\r
+ \r
+ \r
+ \r
+}\r
+\r
+PARSER_BEGIN(UnitParser)\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+public class UnitParser/*@bgen(jjtree)*/implements UnitParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/\r
+ protected JJTUnitParserState jjtree = new JJTUnitParserState();\r
+\r
+/*@egen*/\r
+\r
+ \r
+ \r
+}\r
+PARSER_END(UnitParser)\r
+\r
+/*** Lexer *********************************************************/\r
+\r
+SKIP:\r
+{ <WHITESPACE: " " | "\n" | "\r" | "\t" > \r
+| <COMMENT1: "/*" (~["*"] | "*" ~["/"])* "*/" > \r
+| <COMMENT2: "//" (~["\n"])* >\r
+}\r
+\r
+TOKEN:\r
+{\r
+"algorithm" | "discrete" | "false" | "model" | "redeclare"\r
+| "and" | "each" | "final" | "not" | "replaceable"\r
+| "annotation" | "else" | "flow" | "operator" | "return"\r
+|"assert" | "elseif" | "for" | "or" | "stream"\r
+| "block" | "elsewhen" | "function" | "outer" | "then"\r
+| "break" | "encapsulated" | "if" | "output" | "true"\r
+| "class" | "end" | "import" | "package" | "type"\r
+| "connect" | "enumeration" | "in" | "parameter" | "when"\r
+| "connector" | "equation" | /*"initial" |*/ "partial" | "while"\r
+| "constant" | "expandable" | "inner" | "protected" | "within"\r
+| "constrainedby" | "extends" | "input" | "public"\r
+| /*"der" |*/ "external" | "loop" | "record"\r
+| "(" | ")" | "{" | "}" | "[" | "]" | "." | ":" | ";" | ","\r
+| "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+| "+" | "-" | ".+" | ".-"\r
+| "*" | "/" | ".*" | "./"\r
+| "^" | ".^"\r
+| "=" | ":=" \r
+| <IDENT: ["a"-"z","A"-"Z","_","\u20ac","$","\u00a3","%","\u0391"-"\u03c9","\u00b5"] (["a"-"z","A"-"Z","_","\u20ac","$","\u00a3","%","\u0391"-"\u03c9","\u00b5","0"-"9"])* >\r
+| <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
+ { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
+| <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
+| <UNSIGNED_NUMBER: \r
+ ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | "." <UNSIGNED_INTEGER> (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | <UNSIGNED_INTEGER> ["e","E"] (["+","-"])? <UNSIGNED_INTEGER>\r
+ ) >\r
+}\r
+\r
+/*** Parser ********************************************************/\r
+\r
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+\r
+SimpleNode expr() : {/*@bgen(jjtree) expr */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTEXPR);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) expr */\r
+ try {\r
+/*@egen*/\r
+ (simple_expression())? <EOF>/*@bgen(jjtree)*/\r
+ {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtc000 = false;\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+/*@egen*/\r
+ {\r
+ return jjtn000;\r
+ }\r
+ |\r
+ ifthenelse() <EOF>/*@bgen(jjtree)*/\r
+ {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtc000 = false;\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+/*@egen*/\r
+ {\r
+ return jjtn000;\r
+ }/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void expression() : {/*@bgen(jjtree) expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTEXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) expression */\r
+ try {\r
+/*@egen*/\r
+ simple_expression()\r
+ | ifthenelse()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void ifthenelse() : {/*@bgen(jjtree) ifthenelse */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTIFTHENELSE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r} {/*@bgen(jjtree) ifthenelse */\r
+ try {\r
+/*@egen*/\r
+ "if" condition() "then" expression() ( "elseif" condition() "then" expression() )* "else" expression()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r\r
+void condition() : {/*@bgen(jjtree) condition */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTCONDITION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) condition */\r
+ try {\r
+/*@egen*/\r
+ expression()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r \r \r
+\r
+void simple_expression() : {/*@bgen(jjtree) simple_expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTSIMPLE_EXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) simple_expression */\r
+ try {\r
+/*@egen*/\r
+ logical_expression() ( ":" logical_expression() ( ":" logical_expression() )? )?/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+} \r
+\r
+void logical_expression() : {/*@bgen(jjtree) logical_expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTLOGICAL_EXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) logical_expression */\r
+ try {\r
+/*@egen*/\r
+ logical_term() ( "or" logical_term() )*/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+} \r
+\r
+void logical_term() : {/*@bgen(jjtree) logical_term */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTLOGICAL_TERM);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) logical_term */\r
+ try {\r
+/*@egen*/\r
+ logical_factor() ( "and" logical_factor() )*/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void logical_factor() : {/*@bgen(jjtree) logical_factor */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTLOGICAL_FACTOR);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) logical_factor */\r
+ try {\r
+/*@egen*/\r
+ ( "not" )? relation()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void relation() : {/*@bgen(jjtree) relation */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTRELATION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) relation */\r
+ try {\r
+/*@egen*/\r
+ arithmetic_expression() ( rel_op() arithmetic_expression() )?/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void rel_op() : {/*@bgen(jjtree) rel_op */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTREL_OP);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) rel_op */\r
+ try {\r
+/*@egen*/\r
+ "<" | "<=" | ">" | ">=" | "==" | "<>"/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void arithmetic_expression() : {/*@bgen(jjtree) arithmetic_expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTARITHMETIC_EXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) arithmetic_expression */\r
+ try {\r
+/*@egen*/\r
+ (add_op())? term() (add_op() term())*/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void add_op() : {/*@bgen(jjtree) add_op */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTADD_OP);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) add_op */\r
+ try {\r
+/*@egen*/\r
+ "+" | "-" | ".+" | ".-"/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void term() : {/*@bgen(jjtree) term */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTTERM);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) term */\r
+ try {\r
+/*@egen*/\r
+ ( LOOKAHEAD(primary() power()) factor() | primary() ) ( (multiplication() | divide()) ( LOOKAHEAD(primary() power()) factor() | primary()) )*/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void factor() : {/*@bgen(jjtree) factor */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFACTOR);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) factor */\r
+ try {\r
+/*@egen*/\r
+ primary() power() primary()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void power() : {/*@bgen(jjtree) power */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPOWER);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) power */\r
+ try {\r
+/*@egen*/\r
+ "^" | ".^"/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r \r
+void multiplication() : {/*@bgen(jjtree) multiplication */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTMULTIPLICATION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) multiplication */\r
+ try {\r
+/*@egen*/\r
+ "*" | ".*"/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void divide() : {/*@bgen(jjtree) divide */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTDIVIDE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) divide */\r
+ try {\r
+/*@egen*/\r
+ "/" | "./"/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void primary() : {/*@bgen(jjtree) primary */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPRIMARY);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) primary */\r
+ try {\r
+/*@egen*/\r
+ value()\r
+ | LOOKAHEAD( name() parenthesis_open() ) function_call() \r
+ | component_reference_full()\r
+ /*| "(" output_expression_list() ")"*/ // Not needed, replaced with following:\r
+ | parenthesis_expression()\r
+ | "[" expression_list() ( ";" expression_list() )* "]"\r
+ | array_definition()\r
+ | "end"/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void component_reference_full() : {/*@bgen(jjtree) component_reference_full */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTCOMPONENT_REFERENCE_FULL);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) component_reference_full */\r
+ try {\r
+/*@egen*/\r
+ component_reference()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void array_definition() : {/*@bgen(jjtree) array_definition */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTARRAY_DEFINITION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) array_definition */\r
+ try {\r
+/*@egen*/\r
+ "{" function_arguments() "}"/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void function_call() : {/*@bgen(jjtree) function_call */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFUNCTION_CALL);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) function_call */\r
+ try {\r
+/*@egen*/\r
+ name() function_call_args()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void parenthesis_expression() : {/*@bgen(jjtree) parenthesis_expression */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPARENTHESIS_EXPRESSION);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r} {/*@bgen(jjtree) parenthesis_expression */\r
+ try {\r
+/*@egen*/\r parenthesis_open() expression() parenthesis_close()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void value() : {/*@bgen(jjtree) value */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTVALUE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r} {/*@bgen(jjtree) value */\r
+ try {\r
+/*@egen*/\r
+ <UNSIGNED_NUMBER>\r
+ | <UNSIGNED_INTEGER>\r
+ | <STRING>\r
+ | "false"\r
+ | "true"/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r \r
+\r
+void parenthesis_open() : {/*@bgen(jjtree) parenthesis_open */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPARENTHESIS_OPEN);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) parenthesis_open */\r
+ try {\r
+/*@egen*/\r
+ "("/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void parenthesis_close() : {/*@bgen(jjtree) parenthesis_close */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTPARENTHESIS_CLOSE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) parenthesis_close */\r
+ try {\r
+/*@egen*/\r
+ ")"/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void name() : {/*@bgen(jjtree) name */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAME);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) name */\r
+ try {\r
+/*@egen*/\r
+ <IDENT> ( "." name() )?/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void component_reference() : {/*@bgen(jjtree) component_reference */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTCOMPONENT_REFERENCE);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) component_reference */\r
+ try {\r
+/*@egen*/\r
+ //IDENT [ array_subscripts ] [ "." component_reference ]\r
+ component_identity() ( array_subscripts() )? ( "." component_reference() )?/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void component_identity() : {/*@bgen(jjtree) component_identity */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTCOMPONENT_IDENTITY);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) component_identity */\r
+ try {\r
+/*@egen*/\r <IDENT> (<IDENT>)*/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r \r
+\r
+void function_call_args() : {/*@bgen(jjtree) function_call_args */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFUNCTION_CALL_ARGS);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) function_call_args */\r
+ try {\r
+/*@egen*/\r
+ parenthesis_open() ( function_arguments() )? parenthesis_close()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void function_arguments() : {/*@bgen(jjtree) function_arguments */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFUNCTION_ARGUMENTS);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) function_arguments */\r
+ try {\r
+/*@egen*/\r
+ //expression [ "," function_arguments | for for_indices ]\r
+ //| named_arguments\r
+ LOOKAHEAD(2) named_arguments()\r
+ | expression() ( "," function_arguments() | "for" for_indices() )?/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+ \r
+}\r
+\r
+void for_indices() : {/*@bgen(jjtree) for_indices */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFOR_INDICES);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) for_indices */\r
+ try {\r
+/*@egen*/\r
+ //for_index {"," for_index}\r
+ for_index() ("," for_index())*/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void for_index() : {/*@bgen(jjtree) for_index */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTFOR_INDEX);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) for_index */\r
+ try {\r
+/*@egen*/\r
+ //IDENT [ in expression ]\r
+ <IDENT> ( "in" expression() )?/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void named_arguments() : {/*@bgen(jjtree) named_arguments */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAMED_ARGUMENTS);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) named_arguments */\r
+ try {\r
+/*@egen*/\r
+ named_argument() ( "," named_arguments() )?/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void named_argument() : {/*@bgen(jjtree) named_argument */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTNAMED_ARGUMENT);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) named_argument */\r
+ try {\r
+/*@egen*/ \r
+ <IDENT> "=" expression()/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void output_expression_list() : {/*@bgen(jjtree) output_expression_list */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTOUTPUT_EXPRESSION_LIST);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) output_expression_list */\r
+ try {\r
+/*@egen*/\r
+ ( expression() )? ( "," ( expression() )? )*/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+\r
+void expression_list() : {/*@bgen(jjtree) expression_list */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTEXPRESSION_LIST);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) expression_list */\r
+ try {\r
+/*@egen*/\r
+ expression() ( "," expression() )*/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void array_subscripts() : {/*@bgen(jjtree) array_subscripts */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTARRAY_SUBSCRIPTS);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) array_subscripts */\r
+ try {\r
+/*@egen*/\r
+ "[" subscript() ( "," subscript() )* "]"/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void subscript() : {/*@bgen(jjtree) subscript */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTSUBSCRIPT);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) subscript */\r
+ try {\r
+/*@egen*/\r ":"\r
+ | LOOKAHEAD( name() parenthesis_open() ) function_call()\r
+ | rangeIndex() ( ":" rangeIndex())?/*@bgen(jjtree)*/\r
+ } catch (Throwable jjte000) {\r
+ if (jjtc000) {\r
+ jjtree.clearNodeScope(jjtn000);\r
+ jjtc000 = false;\r
+ } else {\r
+ jjtree.popNode();\r
+ }\r
+ if (jjte000 instanceof RuntimeException) {\r
+ throw (RuntimeException)jjte000;\r
+ }\r
+ if (jjte000 instanceof ParseException) {\r
+ throw (ParseException)jjte000;\r
+ }\r
+ throw (Error)jjte000;\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r
+\r
+void rangeIndex() : {/*@bgen(jjtree) rangeIndex */\r
+ UnitCheckingNode jjtn000 = (UnitCheckingNode)UnitCheckingNodeFactory.jjtCreate(JJTRANGEINDEX);\r
+ boolean jjtc000 = true;\r
+ jjtree.openNodeScope(jjtn000);\r
+ jjtn000.jjtSetFirstToken(getToken(1));\r
+/*@egen*/\r
+} {/*@bgen(jjtree) rangeIndex */\r
+ try {\r
+/*@egen*/\r <UNSIGNED_INTEGER>\r
+ | <IDENT>/*@bgen(jjtree)*/\r
+ } finally {\r
+ if (jjtc000) {\r
+ jjtree.closeNodeScope(jjtn000, true);\r
+ jjtn000.jjtSetLastToken(getToken(0));\r
+ }\r
+ }\r
+/*@egen*/\r
+}\r \r
+\r
--- /dev/null
+options {\r
+ JDK_VERSION = "1.6";\r
+ STATIC = false;\r
+ TRACK_TOKENS=true;\r
+ NODE_CLASS="UnitCheckingNode";\r
+ NODE_FACTORY="UnitCheckingNodeFactory";\r
+}\r
+\r
+PARSER_BEGIN(UnitParser)\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+public class UnitParser {\r
+\r
+ \r
+ \r
+}\r
+PARSER_END(UnitParser)\r
+\r
+/*** Lexer *********************************************************/\r
+\r
+SKIP:\r
+{ <WHITESPACE: " " | "\n" | "\r" | "\t" > \r
+| <COMMENT1: "/*" (~["*"] | "*" ~["/"])* "*/" > \r
+| <COMMENT2: "//" (~["\n"])* >\r
+}\r
+\r
+TOKEN:\r
+{\r
+"algorithm" | "discrete" | "false" | "model" | "redeclare"\r
+| "and" | "each" | "final" | "not" | "replaceable"\r
+| "annotation" | "else" | "flow" | "operator" | "return"\r
+|"assert" | "elseif" | "for" | "or" | "stream"\r
+| "block" | "elsewhen" | "function" | "outer" | "then"\r
+| "break" | "encapsulated" | "if" | "output" | "true"\r
+| "class" | "end" | "import" | "package" | "type"\r
+| "connect" | "enumeration" | "in" | "parameter" | "when"\r
+| "connector" | "equation" | /*"initial" |*/ "partial" | "while"\r
+| "constant" | "expandable" | "inner" | "protected" | "within"\r
+| "constrainedby" | "extends" | "input" | "public"\r
+| /*"der" |*/ "external" | "loop" | "record"\r
+| "(" | ")" | "{" | "}" | "[" | "]" | "." | ":" | ";" | ","\r
+| "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+| "+" | "-" | ".+" | ".-"\r
+| "*" | "/" | ".*" | "./"\r
+| "^" | ".^"\r
+| "=" | ":=" \r
+| <IDENT: ["a"-"z","A"-"Z","_","\u20ac","$","£","%","\u0391"-"\u03c9","µ"] (["a"-"z","A"-"Z","_","\u20ac","$","£","%","\u0391"-"\u03c9","µ","0"-"9"])* >\r
+| <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
+ { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
+| <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
+| <UNSIGNED_NUMBER: \r
+ ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | "." <UNSIGNED_INTEGER> (["e","E"] (["+","-"])? <UNSIGNED_INTEGER>)?\r
+ | <UNSIGNED_INTEGER> ["e","E"] (["+","-"])? <UNSIGNED_INTEGER>\r
+ ) >\r
+}\r
+\r
+/*** Parser ********************************************************/\r
+\r
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+\r
+SimpleNode expr() : {\r
+} {\r
+ (simple_expression())? <EOF>\r
+ {\r
+ return jjtThis;\r
+ }\r
+ |\r
+ ifthenelse() <EOF>\r
+ {\r
+ return jjtThis;\r
+ }\r
+}\r
+\r
+void expression() : {\r
+} {\r
+ simple_expression()\r
+ | ifthenelse()\r
+}\r
+\r
+void ifthenelse() : {\r} {\r
+ "if" condition() "then" expression() ( "elseif" condition() "then" expression() )* "else" expression()\r
+}\r
+\r\r
+void condition() : {\r
+} {\r
+ expression()\r
+}\r \r \r
+\r
+void simple_expression() : {\r
+} {\r
+ logical_expression() ( ":" logical_expression() ( ":" logical_expression() )? )?\r
+} \r
+\r
+void logical_expression() : {\r
+} {\r
+ logical_term() ( "or" logical_term() )*\r
+} \r
+\r
+void logical_term() : {\r
+} {\r
+ logical_factor() ( "and" logical_factor() )*\r
+}\r
+\r
+void logical_factor() : {\r
+} {\r
+ ( "not" )? relation()\r
+}\r
+\r
+void relation() : {\r
+} {\r
+ arithmetic_expression() ( rel_op() arithmetic_expression() )?\r
+}\r
+\r
+void rel_op() : {\r
+} {\r
+ "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+}\r
+\r
+void arithmetic_expression() : {\r
+} {\r
+ (add_op())? term() (add_op() term())*\r
+}\r
+\r
+void add_op() : {\r
+} {\r
+ "+" | "-" | ".+" | ".-"\r
+}\r
+\r
+void term() : {\r
+} {\r
+ ( LOOKAHEAD(primary() power()) factor() | primary() ) ( (multiplication() | divide()) ( LOOKAHEAD(primary() power()) factor() | primary()) )*\r
+}\r
+\r
+void factor() : {\r
+} {\r
+ primary() power() primary()\r
+}\r
+\r
+void power() : {\r
+} {\r
+ "^" | ".^"\r
+}\r \r
+void multiplication() : {\r
+} {\r
+ "*" | ".*"\r
+}\r
+\r
+void divide() : {\r
+} {\r
+ "/" | "./"\r
+}\r
+\r
+void primary() : {\r
+} {\r
+ value()\r
+ | LOOKAHEAD( name() parenthesis_open() ) function_call() \r
+ | component_reference_full()\r
+ /*| "(" output_expression_list() ")"*/ // Not needed, replaced with following:\r
+ | parenthesis_expression()\r
+ | "[" expression_list() ( ";" expression_list() )* "]"\r
+ | array_definition()\r
+ | "end"\r
+}\r
+\r
+void component_reference_full() : {\r
+} {\r
+ component_reference()\r
+}\r
+\r
+void array_definition() : {\r
+} {\r
+ "{" function_arguments() "}"\r
+}\r
+\r
+void function_call() : {\r
+} {\r
+ name() function_call_args()\r
+}\r
+\r
+void parenthesis_expression() : {\r} {\r parenthesis_open() expression() parenthesis_close()\r
+}\r
+\r
+void value() : {\r} {\r
+ <UNSIGNED_NUMBER>\r
+ | <UNSIGNED_INTEGER>\r
+ | <STRING>\r
+ | "false"\r
+ | "true"\r
+}\r \r
+\r
+void parenthesis_open() : {\r
+} {\r
+ "("\r
+}\r
+\r
+void parenthesis_close() : {\r
+} {\r
+ ")"\r
+}\r
+\r
+void name() : {\r
+} {\r
+ <IDENT> ( "." name() )?\r
+}\r
+\r
+void component_reference() : {\r
+} {\r
+ //IDENT [ array_subscripts ] [ "." component_reference ]\r
+ component_identity() ( array_subscripts() )? ( "." component_reference() )?\r
+}\r
+\r
+void component_identity() : {\r
+} {\r <IDENT> (<IDENT>)*\r
+}\r \r
+\r
+void function_call_args() : {\r
+} {\r
+ parenthesis_open() ( function_arguments() )? parenthesis_close()\r
+}\r
+\r
+void function_arguments() : {\r
+} {\r
+ //expression [ "," function_arguments | for for_indices ]\r
+ //| named_arguments\r
+ LOOKAHEAD(2) named_arguments()\r
+ | expression() ( "," function_arguments() | "for" for_indices() )?\r
+ \r
+}\r
+\r
+void for_indices() : {\r
+} {\r
+ //for_index {"," for_index}\r
+ for_index() ("," for_index())*\r
+}\r
+\r
+void for_index() : {\r
+} {\r
+ //IDENT [ in expression ]\r
+ <IDENT> ( "in" expression() )?\r
+}\r
+\r
+void named_arguments() : {\r
+} {\r
+ named_argument() ( "," named_arguments() )?\r
+}\r
+\r
+void named_argument() : {\r
+} { \r
+ <IDENT> "=" expression()\r
+}\r
+\r
+void output_expression_list() : {\r
+} {\r
+ ( expression() )? ( "," ( expression() )? )*\r
+}\r
+\r
+\r
+void expression_list() : {\r
+} {\r
+ expression() ( "," expression() )*\r
+}\r
+\r
+void array_subscripts() : {\r
+} {\r
+ "[" subscript() ( "," subscript() )* "]"\r
+}\r
+\r
+void subscript() : {\r
+} {\r ":"\r
+ | LOOKAHEAD( name() parenthesis_open() ) function_call()\r
+ | rangeIndex() ( ":" rangeIndex())?\r
+}\r
+\r
+void rangeIndex() : {\r
+} {\r <UNSIGNED_INTEGER>\r
+ | <IDENT>\r
+}\r \r
+\r
--- /dev/null
+/* Generated By:JJTree&JavaCC: Do not edit this line. UnitParserConstants.java */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+\r
+/**\r
+ * Token literal values and constants.\r
+ * Generated by org.javacc.parser.OtherFilesGen#start()\r
+ */\r
+public interface UnitParserConstants {\r
+\r
+ /** End of File. */\r
+ int EOF = 0;\r
+ /** RegularExpression Id. */\r
+ int WHITESPACE = 1;\r
+ /** RegularExpression Id. */\r
+ int COMMENT1 = 2;\r
+ /** RegularExpression Id. */\r
+ int COMMENT2 = 3;\r
+ /** RegularExpression Id. */\r
+ int IDENT = 88;\r
+ /** RegularExpression Id. */\r
+ int STRING = 89;\r
+ /** RegularExpression Id. */\r
+ int UNSIGNED_INTEGER = 90;\r
+ /** RegularExpression Id. */\r
+ int UNSIGNED_NUMBER = 91;\r
+\r
+ /** Lexical state. */\r
+ int DEFAULT = 0;\r
+\r
+ /** Literal token values. */\r
+ String[] tokenImage = {\r
+ "<EOF>",\r
+ "<WHITESPACE>",\r
+ "<COMMENT1>",\r
+ "<COMMENT2>",\r
+ "\"algorithm\"",\r
+ "\"discrete\"",\r
+ "\"false\"",\r
+ "\"model\"",\r
+ "\"redeclare\"",\r
+ "\"and\"",\r
+ "\"each\"",\r
+ "\"final\"",\r
+ "\"not\"",\r
+ "\"replaceable\"",\r
+ "\"annotation\"",\r
+ "\"else\"",\r
+ "\"flow\"",\r
+ "\"operator\"",\r
+ "\"return\"",\r
+ "\"assert\"",\r
+ "\"elseif\"",\r
+ "\"for\"",\r
+ "\"or\"",\r
+ "\"stream\"",\r
+ "\"block\"",\r
+ "\"elsewhen\"",\r
+ "\"function\"",\r
+ "\"outer\"",\r
+ "\"then\"",\r
+ "\"break\"",\r
+ "\"encapsulated\"",\r
+ "\"if\"",\r
+ "\"output\"",\r
+ "\"true\"",\r
+ "\"class\"",\r
+ "\"end\"",\r
+ "\"import\"",\r
+ "\"package\"",\r
+ "\"type\"",\r
+ "\"connect\"",\r
+ "\"enumeration\"",\r
+ "\"in\"",\r
+ "\"parameter\"",\r
+ "\"when\"",\r
+ "\"connector\"",\r
+ "\"equation\"",\r
+ "\"partial\"",\r
+ "\"while\"",\r
+ "\"constant\"",\r
+ "\"expandable\"",\r
+ "\"inner\"",\r
+ "\"protected\"",\r
+ "\"within\"",\r
+ "\"constrainedby\"",\r
+ "\"extends\"",\r
+ "\"input\"",\r
+ "\"public\"",\r
+ "\"external\"",\r
+ "\"loop\"",\r
+ "\"record\"",\r
+ "\"(\"",\r
+ "\")\"",\r
+ "\"{\"",\r
+ "\"}\"",\r
+ "\"[\"",\r
+ "\"]\"",\r
+ "\".\"",\r
+ "\":\"",\r
+ "\";\"",\r
+ "\",\"",\r
+ "\"<\"",\r
+ "\"<=\"",\r
+ "\">\"",\r
+ "\">=\"",\r
+ "\"==\"",\r
+ "\"<>\"",\r
+ "\"+\"",\r
+ "\"-\"",\r
+ "\".+\"",\r
+ "\".-\"",\r
+ "\"*\"",\r
+ "\"/\"",\r
+ "\".*\"",\r
+ "\"./\"",\r
+ "\"^\"",\r
+ "\".^\"",\r
+ "\"=\"",\r
+ "\":=\"",\r
+ "<IDENT>",\r
+ "<STRING>",\r
+ "<UNSIGNED_INTEGER>",\r
+ "<UNSIGNED_NUMBER>",\r
+ };\r
+\r
+}\r
--- /dev/null
+/* Generated By:JJTree&JavaCC: Do not edit this line. UnitParserTokenManager.java */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+/** Token Manager. */\r
+public class UnitParserTokenManager implements UnitParserConstants\r
+{\r
+\r
+ /** Debug output. */\r
+ public java.io.PrintStream debugStream = System.out;\r
+ /** Set debug output. */\r
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }\r
+private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
+{\r
+ switch (pos)
+ {\r
+ case 0:\r
+ if ((active0 & 0xffffffffffffff0L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ return 2;\r
+ }\r
+ if ((active1 & 0x20000L) != 0L)\r
+ return 14;\r
+ if ((active1 & 0x2cc004L) != 0L)\r
+ return 9;\r
+ return -1;\r
+ case 1:\r
+ if ((active0 & 0x84020080400000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0xf7bfdff7fbffff0L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 1)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 1;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 2:\r
+ if ((active0 & 0x800201200L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0xffffdf77f9fedf0L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 2;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 3:\r
+ if ((active0 & 0x400084212118400L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0xbfff5b56d8e69f0L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 3)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 3;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 4:\r
+ if ((active0 & 0x848004290008c0L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0xb7b75b1469e6130L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 4;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 5:\r
+ if ((active0 & 0x9100011009c0000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x26b75a046026130L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 5;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 6:\r
+ if ((active0 & 0x4050a000000000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x22b250046026130L) != 0L)\r
+ {\r
+ if (jjmatchedPos != 6)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 6;\r
+ }\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 7:\r
+ if ((active0 & 0x201200006020020L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x2a150040006110L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 7;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 8:\r
+ if ((active0 & 0x22010040006000L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 8;\r
+ return 2;\r
+ }\r
+ if ((active0 & 0x8140000000110L) != 0L)\r
+ return 2;\r
+ return -1;\r
+ case 9:\r
+ if ((active0 & 0x2000000004000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x20010040002000L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 9;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 10:\r
+ if ((active0 & 0x10000002000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x20000040000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 10;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ case 11:\r
+ if ((active0 & 0x40000000L) != 0L)\r
+ return 2;\r
+ if ((active0 & 0x20000000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 88;\r
+ jjmatchedPos = 11;\r
+ return 2;\r
+ }\r
+ return -1;\r
+ default :\r
+ return -1;\r
+ }\r
+}\r
+private final int jjStartNfa_0(int pos, long active0, long active1)
+{\r
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);\r
+}\r
+private int jjStopAtPos(int pos, int kind)\r
+{\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = pos;\r
+ return pos + 1;\r
+}\r
+private int jjMoveStringLiteralDfa0_0()\r
+{\r
+ switch(curChar)\r
+ {\r
+ case 40:\r
+ return jjStopAtPos(0, 60);\r
+ case 41:\r
+ return jjStopAtPos(0, 61);\r
+ case 42:\r
+ return jjStopAtPos(0, 80);\r
+ case 43:\r
+ return jjStopAtPos(0, 76);\r
+ case 44:\r
+ return jjStopAtPos(0, 69);\r
+ case 45:\r
+ return jjStopAtPos(0, 77);\r
+ case 46:\r
+ jjmatchedKind = 66;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x2cc000L);\r
+ case 47:\r
+ return jjStartNfaWithStates_0(0, 81, 14);\r
+ case 58:\r
+ jjmatchedKind = 67;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x800000L);\r
+ case 59:\r
+ return jjStopAtPos(0, 68);\r
+ case 60:\r
+ jjmatchedKind = 70;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x880L);\r
+ case 61:\r
+ jjmatchedKind = 86;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x400L);\r
+ case 62:\r
+ jjmatchedKind = 72;\r
+ return jjMoveStringLiteralDfa1_0(0x0L, 0x200L);\r
+ case 91:\r
+ return jjStopAtPos(0, 64);\r
+ case 93:\r
+ return jjStopAtPos(0, 65);\r
+ case 94:\r
+ return jjStopAtPos(0, 84);\r
+ case 97:\r
+ return jjMoveStringLiteralDfa1_0(0x84210L, 0x0L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa1_0(0x21000000L, 0x0L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa1_0(0x21108400000000L, 0x0L);\r
+ case 100:\r
+ return jjMoveStringLiteralDfa1_0(0x20L, 0x0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa1_0(0x242210842108400L, 0x0L);\r
+ case 102:\r
+ return jjMoveStringLiteralDfa1_0(0x4210840L, 0x0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa1_0(0x84021080000000L, 0x0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa1_0(0x400000000000000L, 0x0L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa1_0(0x80L, 0x0L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa1_0(0x1000L, 0x0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa1_0(0x108420000L, 0x0L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa1_0(0x108442000000000L, 0x0L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa1_0(0x800000000042100L, 0x0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa1_0(0x800000L, 0x0L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa1_0(0x4210000000L, 0x0L);\r
+ case 119:\r
+ return jjMoveStringLiteralDfa1_0(0x10880000000000L, 0x0L);\r
+ case 123:\r
+ return jjStopAtPos(0, 62);\r
+ case 125:\r
+ return jjStopAtPos(0, 63);\r
+ default :\r
+ return jjMoveNfa_0(0, 0);\r
+ }\r
+}\r
+private int jjMoveStringLiteralDfa1_0(long active0, long active1)\r
+{\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(0, active0, active1);\r
+ return 1;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 42:\r
+ if ((active1 & 0x40000L) != 0L)\r
+ return jjStopAtPos(1, 82);\r
+ break;\r
+ case 43:\r
+ if ((active1 & 0x4000L) != 0L)\r
+ return jjStopAtPos(1, 78);\r
+ break;\r
+ case 45:\r
+ if ((active1 & 0x8000L) != 0L)\r
+ return jjStopAtPos(1, 79);\r
+ break;\r
+ case 47:\r
+ if ((active1 & 0x80000L) != 0L)\r
+ return jjStopAtPos(1, 83);\r
+ break;\r
+ case 61:\r
+ if ((active1 & 0x80L) != 0L)\r
+ return jjStopAtPos(1, 71);\r
+ else if ((active1 & 0x200L) != 0L)\r
+ return jjStopAtPos(1, 73);\r
+ else if ((active1 & 0x400L) != 0L)\r
+ return jjStopAtPos(1, 74);\r
+ else if ((active1 & 0x800000L) != 0L)\r
+ return jjStopAtPos(1, 87);\r
+ break;\r
+ case 62:\r
+ if ((active1 & 0x800L) != 0L)\r
+ return jjStopAtPos(1, 75);\r
+ break;\r
+ case 94:\r
+ if ((active1 & 0x200000L) != 0L)\r
+ return jjStopAtPos(1, 85);\r
+ break;\r
+ case 97:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x442000000440L, active1, 0L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x800000000042100L, active1, 0L);\r
+ case 102:\r
+ if ((active0 & 0x80000000L) != 0L)\r
+ return jjStartNfaWithStates_0(1, 31, 2);\r
+ break;\r
+ case 104:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x880010000000L, active1, 0L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x10000000000820L, active1, 0L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x403118010L, active1, 0L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L, active1, 0L);\r
+ case 110:\r
+ if ((active0 & 0x20000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 41;\r
+ jjmatchedPos = 1;\r
+ }\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x84010840004200L, active1, 0L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x421108000201080L, active1, 0L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x20000L, active1, 0L);\r
+ case 113:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L);\r
+ case 114:\r
+ if ((active0 & 0x400000L) != 0L)\r
+ return jjStartNfaWithStates_0(1, 22, 2);\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x8000220000000L, active1, 0L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x80000L, active1, 0L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x800000L, active1, 0L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x10000010c000000L, active1, 0L);\r
+ case 120:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x242000000000000L, active1, 0L);\r
+ case 121:\r
+ return jjMoveStringLiteralDfa2_0(active0, 0x4000000000L, active1, 0L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(0, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)\r
+{\r
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+ return jjStartNfa_0(0, old0, old1);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(1, active0, 0L);\r
+ return 2;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x400000000L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x100000000000000L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x800002040000400L);\r
+ case 100:\r
+ if ((active0 & 0x200L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 9, 2);\r
+ else if ((active0 & 0x800000000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 35, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x180L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x80030020000L);\r
+ case 103:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x10L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x800000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x40L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x25108004004800L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x408000001010000L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x82005000002000L);\r
+ case 114:\r
+ if ((active0 & 0x200000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 21, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x440000800000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x2188020L);\r
+ case 116:\r
+ if ((active0 & 0x1000L) != 0L)\r
+ return jjStartNfaWithStates_0(2, 12, 2);\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x250000108040000L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa3_0(active0, 0x210200000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(1, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa3_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(1, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(2, active0, 0L);\r
+ return 3;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x2240060000800L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x5000020L);\r
+ case 101:\r
+ if ((active0 & 0x8000L) != 0L)\r
+ {\r
+ jjmatchedKind = 15;\r
+ jjmatchedPos = 3;\r
+ }\r
+ else if ((active0 & 0x200000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 33, 2);\r
+ else if ((active0 & 0x4000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 38, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x24400000a980180L);\r
+ case 104:\r
+ if ((active0 & 0x400L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 10, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000000000000L);\r
+ case 107:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x2000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x100800000002000L);\r
+ case 109:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L);\r
+ case 110:\r
+ if ((active0 & 0x10000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 28, 2);\r
+ else if ((active0 & 0x80000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 43, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x108000000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x800001000004010L);\r
+ case 112:\r
+ if ((active0 & 0x400000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 58, 2);\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x100000000L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x20000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x21000400000040L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x8400000000000L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa4_0(active0, 0x80000000040000L);\r
+ case 119:\r
+ if ((active0 & 0x10000L) != 0L)\r
+ return jjStartNfaWithStates_0(3, 16, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(2, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa4_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(2, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(3, active0, 0L);\r
+ return 4;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000822000L);\r
+ case 99:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x100L);\r
+ case 101:\r
+ if ((active0 & 0x40L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 6, 2);\r
+ else if ((active0 & 0x800000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 47, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x8118000000000L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x110400000100000L);\r
+ case 107:\r
+ if ((active0 & 0x1000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 24, 2);\r
+ else if ((active0 & 0x20000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 29, 2);\r
+ break;\r
+ case 108:\r
+ if ((active0 & 0x80L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 7, 2);\r
+ else if ((active0 & 0x800L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 11, 2);\r
+ break;\r
+ case 109:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L);\r
+ case 110:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x42000000000000L);\r
+ case 112:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000000L);\r
+ case 114:\r
+ if ((active0 & 0x8000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 27, 2);\r
+ else if ((active0 & 0x4000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 50, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0xa000010000c0030L);\r
+ case 115:\r
+ if ((active0 & 0x400000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 34, 2);\r
+ break;\r
+ case 116:\r
+ if ((active0 & 0x80000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(4, 55, 2);\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x21200004004000L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x100000000L);\r
+ case 119:\r
+ return jjMoveStringLiteralDfa5_0(active0, 0x2000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(3, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa5_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(3, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(4, active0, 0L);\r
+ return 5;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x1400000004000L);\r
+ case 99:\r
+ if ((active0 & 0x100000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 56, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x8108000002000L);\r
+ case 100:\r
+ if ((active0 & 0x800000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 59, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x42000000000000L);\r
+ case 101:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40000000020L);\r
+ case 102:\r
+ if ((active0 & 0x100000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 20, 2);\r
+ break;\r
+ case 103:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000000L);\r
+ case 104:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x2000000L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x200004000010L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x100L);\r
+ case 109:\r
+ if ((active0 & 0x800000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 23, 2);\r
+ break;\r
+ case 110:\r
+ if ((active0 & 0x40000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 18, 2);\r
+ else if ((active0 & 0x10000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 52, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x200000000000000L);\r
+ case 114:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x20010000000000L);\r
+ case 115:\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x40000000L);\r
+ case 116:\r
+ if ((active0 & 0x80000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 19, 2);\r
+ else if ((active0 & 0x100000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 32, 2);\r
+ else if ((active0 & 0x1000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(5, 36, 2);\r
+ return jjMoveStringLiteralDfa6_0(active0, 0x20000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(4, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa6_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(4, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(5, active0, 0L);\r
+ return 6;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x222010000000100L);\r
+ case 101:\r
+ if ((active0 & 0x2000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 37, 2);\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x2002000L);\r
+ case 108:\r
+ if ((active0 & 0x400000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 46, 2);\r
+ break;\r
+ case 110:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x1000000000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x200004020000L);\r
+ case 115:\r
+ if ((active0 & 0x40000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(6, 54, 2);\r
+ break;\r
+ case 116:\r
+ if ((active0 & 0x8000000000L) != 0L)\r
+ {\r
+ jjmatchedKind = 39;\r
+ jjmatchedPos = 6;\r
+ }\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x8140000004030L);\r
+ case 117:\r
+ return jjMoveStringLiteralDfa7_0(active0, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(5, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa7_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(5, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(6, active0, 0L);\r
+ return 7;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x2000L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x2000000000000L);\r
+ case 101:\r
+ if ((active0 & 0x20L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 5, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x8040000000000L);\r
+ case 104:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10L);\r
+ case 105:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x20000000004000L);\r
+ case 108:\r
+ if ((active0 & 0x200000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 57, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x40000000L);\r
+ case 110:\r
+ if ((active0 & 0x2000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 25, 2);\r
+ else if ((active0 & 0x4000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 26, 2);\r
+ else if ((active0 & 0x200000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 45, 2);\r
+ break;\r
+ case 111:\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x100000000000L);\r
+ case 114:\r
+ if ((active0 & 0x20000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 17, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x100L);\r
+ case 116:\r
+ if ((active0 & 0x1000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(7, 48, 2);\r
+ return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(6, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa8_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(6, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(7, active0, 0L);\r
+ return 8;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 97:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x40000000L);\r
+ case 98:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x2000L);\r
+ case 100:\r
+ if ((active0 & 0x8000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 51, 2);\r
+ break;\r
+ case 101:\r
+ if ((active0 & 0x100L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 8, 2);\r
+ break;\r
+ case 105:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x10000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000L);\r
+ case 109:\r
+ if ((active0 & 0x10L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 4, 2);\r
+ break;\r
+ case 110:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x20000000000000L);\r
+ case 111:\r
+ return jjMoveStringLiteralDfa9_0(active0, 0x4000L);\r
+ case 114:\r
+ if ((active0 & 0x40000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 42, 2);\r
+ else if ((active0 & 0x100000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(8, 44, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(7, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa9_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(7, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(8, active0, 0L);\r
+ return 9;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 101:\r
+ if ((active0 & 0x2000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(9, 49, 2);\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x20000000000000L);\r
+ case 108:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x2000L);\r
+ case 110:\r
+ if ((active0 & 0x4000L) != 0L)\r
+ return jjStartNfaWithStates_0(9, 14, 2);\r
+ break;\r
+ case 111:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x10000000000L);\r
+ case 116:\r
+ return jjMoveStringLiteralDfa10_0(active0, 0x40000000L);\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(8, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa10_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(8, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(9, active0, 0L);\r
+ return 10;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 100:\r
+ return jjMoveStringLiteralDfa11_0(active0, 0x20000000000000L);\r
+ case 101:\r
+ if ((active0 & 0x2000L) != 0L)\r
+ return jjStartNfaWithStates_0(10, 13, 2);\r
+ return jjMoveStringLiteralDfa11_0(active0, 0x40000000L);\r
+ case 110:\r
+ if ((active0 & 0x10000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(10, 40, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(9, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa11_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(9, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(10, active0, 0L);\r
+ return 11;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 98:\r
+ return jjMoveStringLiteralDfa12_0(active0, 0x20000000000000L);\r
+ case 100:\r
+ if ((active0 & 0x40000000L) != 0L)\r
+ return jjStartNfaWithStates_0(11, 30, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(10, active0, 0L);\r
+}\r
+private int jjMoveStringLiteralDfa12_0(long old0, long active0)\r
+{\r
+ if (((active0 &= old0)) == 0L)\r
+ return jjStartNfa_0(10, old0, 0L);\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) {\r
+ jjStopStringLiteralDfa_0(11, active0, 0L);\r
+ return 12;\r
+ }\r
+ switch(curChar)\r
+ {\r
+ case 121:\r
+ if ((active0 & 0x20000000000000L) != 0L)\r
+ return jjStartNfaWithStates_0(12, 53, 2);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ return jjStartNfa_0(11, active0, 0L);\r
+}\r
+private int jjStartNfaWithStates_0(int pos, int kind, int state)\r
+{\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = pos;\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) { return pos + 1; }\r
+ return jjMoveNfa_0(state, pos + 1);\r
+}\r
+static final long[] jjbitVec0 = {
+ 0x0L, 0x0L, 0x20000800000000L, 0x0L
+};\r
+static final long[] jjbitVec1 = {
+ 0x0L, 0x0L, 0xfffffffffffe0000L, 0x3ffL
+};\r
+static final long[] jjbitVec2 = {
+ 0x0L, 0x0L, 0x100000000000L, 0x0L
+};\r
+static final long[] jjbitVec3 = {
+ 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};\r
+static final long[] jjbitVec5 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};\r
+private int jjMoveNfa_0(int startState, int curPos)\r
+{\r
+ int startsAt = 0;\r
+ jjnewStateCnt = 34;\r
+ int i = 1;\r
+ jjstateSet[0] = startState;\r
+ int kind = 0x7fffffff;\r
+ for (;;)\r
+ {\r
+ if (++jjround == 0x7fffffff)\r
+ ReInitRounds();\r
+ if (curChar < 64)\r
+ {\r
+ long l = 1L << curChar;\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 14:\r
+ if (curChar == 47)\r
+ {\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(21);\r
+ }\r
+ else if (curChar == 42)\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 0:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ {\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjCheckNAddStates(3, 7);\r
+ }\r
+ else if ((0x100002600L & l) != 0L)\r
+ {\r
+ if (kind > 1)\r
+ kind = 1;\r
+ }\r
+ else if ((0x3000000000L & l) != 0L)\r
+ {\r
+ if (kind > 88)\r
+ kind = 88;\r
+ jjCheckNAdd(2);\r
+ }\r
+ else if (curChar == 47)\r
+ jjAddStates(8, 9);\r
+ else if (curChar == 46)\r
+ jjCheckNAdd(9);\r
+ else if (curChar == 34)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 1:\r
+ if ((0x3000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 88)\r
+ kind = 88;\r
+ jjCheckNAdd(2);\r
+ break;\r
+ case 2:\r
+ if ((0x3ff003000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 88)\r
+ kind = 88;\r
+ jjCheckNAdd(2);\r
+ break;\r
+ case 3:\r
+ if (curChar == 34)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 4:\r
+ if ((0xfffffffbfffffbffL & l) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 6:\r
+ if ((0xfffffffffffffbffL & l) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 7:\r
+ if (curChar == 34 && kind > 89)\r
+ kind = 89;\r
+ break;\r
+ case 8:\r
+ if (curChar == 46)\r
+ jjCheckNAdd(9);\r
+ break;\r
+ case 9:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 91)\r
+ kind = 91;\r
+ jjCheckNAddTwoStates(9, 10);\r
+ break;\r
+ case 11:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(12);\r
+ break;\r
+ case 12:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 91)\r
+ kind = 91;\r
+ jjCheckNAdd(12);\r
+ break;\r
+ case 13:\r
+ if (curChar == 47)\r
+ jjAddStates(8, 9);\r
+ break;\r
+ case 15:\r
+ if ((0xfffffbffffffffffL & l) != 0L)\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 16:\r
+ if (curChar == 42)\r
+ jjstateSet[jjnewStateCnt++] = 17;\r
+ break;\r
+ case 17:\r
+ if ((0xffff7fffffffffffL & l) != 0L)\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 18:\r
+ if (curChar == 47 && kind > 2)\r
+ kind = 2;\r
+ break;\r
+ case 19:\r
+ if (curChar == 42)\r
+ jjstateSet[jjnewStateCnt++] = 18;\r
+ break;\r
+ case 20:\r
+ if (curChar != 47)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(21);\r
+ break;\r
+ case 21:\r
+ if ((0xfffffffffffffbffL & l) == 0L)\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjCheckNAdd(21);\r
+ break;\r
+ case 22:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjCheckNAddStates(3, 7);\r
+ break;\r
+ case 23:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 90)\r
+ kind = 90;\r
+ jjCheckNAdd(23);\r
+ break;\r
+ case 24:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(24, 25);\r
+ break;\r
+ case 25:\r
+ if (curChar != 46)\r
+ break;\r
+ if (kind > 91)\r
+ kind = 91;\r
+ jjCheckNAddTwoStates(26, 27);\r
+ break;\r
+ case 26:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 91)\r
+ kind = 91;\r
+ jjCheckNAddTwoStates(26, 27);\r
+ break;\r
+ case 28:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(29);\r
+ break;\r
+ case 29:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 91)\r
+ kind = 91;\r
+ jjCheckNAdd(29);\r
+ break;\r
+ case 30:\r
+ if ((0x3ff000000000000L & l) != 0L)\r
+ jjCheckNAddTwoStates(30, 31);\r
+ break;\r
+ case 32:\r
+ if ((0x280000000000L & l) != 0L)\r
+ jjCheckNAdd(33);\r
+ break;\r
+ case 33:\r
+ if ((0x3ff000000000000L & l) == 0L)\r
+ break;\r
+ if (kind > 91)\r
+ kind = 91;\r
+ jjCheckNAdd(33);\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ else if (curChar < 128)\r
+ {\r
+ long l = 1L << (curChar & 077);\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 0:\r
+ case 2:\r
+ if ((0x7fffffe87fffffeL & l) == 0L)\r
+ break;\r
+ if (kind > 88)\r
+ kind = 88;\r
+ jjCheckNAdd(2);\r
+ break;\r
+ case 4:\r
+ if ((0xffffffffefffffffL & l) != 0L)\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 5:\r
+ if (curChar == 92)\r
+ jjstateSet[jjnewStateCnt++] = 6;\r
+ break;\r
+ case 6:\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 10:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(13, 14);\r
+ break;\r
+ case 15:\r
+ case 17:\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 21:\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjstateSet[jjnewStateCnt++] = 21;\r
+ break;\r
+ case 27:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(15, 16);\r
+ break;\r
+ case 31:\r
+ if ((0x2000000020L & l) != 0L)\r
+ jjAddStates(17, 18);\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ else\r
+ {\r
+ int hiByte = (int)(curChar >> 8);\r
+ int i1 = hiByte >> 6;\r
+ long l1 = 1L << (hiByte & 077);\r
+ int i2 = (curChar & 0xff) >> 6;\r
+ long l2 = 1L << (curChar & 077);\r
+ do\r
+ {\r
+ switch(jjstateSet[--i])\r
+ {\r
+ case 0:\r
+ case 2:\r
+ if (!jjCanMove_0(hiByte, i1, i2, l1, l2))\r
+ break;\r
+ if (kind > 88)\r
+ kind = 88;\r
+ jjCheckNAdd(2);\r
+ break;\r
+ case 4:\r
+ case 6:\r
+ if (jjCanMove_1(hiByte, i1, i2, l1, l2))\r
+ jjCheckNAddStates(10, 12);\r
+ break;\r
+ case 15:\r
+ case 17:\r
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))\r
+ jjCheckNAddStates(0, 2);\r
+ break;\r
+ case 21:\r
+ if (!jjCanMove_2(hiByte, i1, i2, l1, l2))\r
+ break;\r
+ if (kind > 3)\r
+ kind = 3;\r
+ jjstateSet[jjnewStateCnt++] = 21;\r
+ break;\r
+ default : break;\r
+ }\r
+ } while(i != startsAt);\r
+ }\r
+ if (kind != 0x7fffffff)\r
+ {\r
+ jjmatchedKind = kind;\r
+ jjmatchedPos = curPos;\r
+ kind = 0x7fffffff;\r
+ }\r
+ ++curPos;\r
+ if ((i = jjnewStateCnt) == (startsAt = 34 - (jjnewStateCnt = startsAt)))\r
+ return curPos;\r
+ try { curChar = input_stream.readChar(); }\r
+ catch(java.io.IOException e) { return curPos; }\r
+ }\r
+}\r
+static final int[] jjnextStates = {
+ 15, 16, 19, 23, 24, 25, 30, 31, 14, 20, 4, 5, 7, 11, 12, 28,
+ 29, 32, 33,
+};\r
+private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)\r
+{\r
+ switch(hiByte)\r
+ {\r
+ case 0:\r
+ return ((jjbitVec0[i2] & l2) != 0L);\r
+ case 3:\r
+ return ((jjbitVec1[i2] & l2) != 0L);\r
+ case 32:\r
+ return ((jjbitVec2[i2] & l2) != 0L);\r
+ default :\r
+ return false;\r
+ }\r
+}\r
+private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)\r
+{\r
+ switch(hiByte)\r
+ {\r
+ case 0:\r
+ return ((jjbitVec5[i2] & l2) != 0L);\r
+ default :\r
+ if ((jjbitVec3[i1] & l1) != 0L)\r
+ return true;\r
+ return false;\r
+ }\r
+}\r
+private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2)\r
+{\r
+ switch(hiByte)\r
+ {\r
+ case 0:\r
+ return ((jjbitVec5[i2] & l2) != 0L);\r
+ default :\r
+ return false;\r
+ }\r
+}\r
+\r
+/** Token literal values. */\r
+public static final String[] jjstrLiteralImages = {\r
+"", null, null, null, "\141\154\147\157\162\151\164\150\155", \r
+"\144\151\163\143\162\145\164\145", "\146\141\154\163\145", "\155\157\144\145\154", \r
+"\162\145\144\145\143\154\141\162\145", "\141\156\144", "\145\141\143\150", "\146\151\156\141\154", "\156\157\164", \r
+"\162\145\160\154\141\143\145\141\142\154\145", "\141\156\156\157\164\141\164\151\157\156", "\145\154\163\145", \r
+"\146\154\157\167", "\157\160\145\162\141\164\157\162", "\162\145\164\165\162\156", \r
+"\141\163\163\145\162\164", "\145\154\163\145\151\146", "\146\157\162", "\157\162", \r
+"\163\164\162\145\141\155", "\142\154\157\143\153", "\145\154\163\145\167\150\145\156", \r
+"\146\165\156\143\164\151\157\156", "\157\165\164\145\162", "\164\150\145\156", "\142\162\145\141\153", \r
+"\145\156\143\141\160\163\165\154\141\164\145\144", "\151\146", "\157\165\164\160\165\164", "\164\162\165\145", \r
+"\143\154\141\163\163", "\145\156\144", "\151\155\160\157\162\164", "\160\141\143\153\141\147\145", \r
+"\164\171\160\145", "\143\157\156\156\145\143\164", \r
+"\145\156\165\155\145\162\141\164\151\157\156", "\151\156", "\160\141\162\141\155\145\164\145\162", "\167\150\145\156", \r
+"\143\157\156\156\145\143\164\157\162", "\145\161\165\141\164\151\157\156", "\160\141\162\164\151\141\154", \r
+"\167\150\151\154\145", "\143\157\156\163\164\141\156\164", \r
+"\145\170\160\141\156\144\141\142\154\145", "\151\156\156\145\162", "\160\162\157\164\145\143\164\145\144", \r
+"\167\151\164\150\151\156", "\143\157\156\163\164\162\141\151\156\145\144\142\171", \r
+"\145\170\164\145\156\144\163", "\151\156\160\165\164", "\160\165\142\154\151\143", \r
+"\145\170\164\145\162\156\141\154", "\154\157\157\160", "\162\145\143\157\162\144", "\50", "\51", "\173", "\175", \r
+"\133", "\135", "\56", "\72", "\73", "\54", "\74", "\74\75", "\76", "\76\75", \r
+"\75\75", "\74\76", "\53", "\55", "\56\53", "\56\55", "\52", "\57", "\56\52", "\56\57", \r
+"\136", "\56\136", "\75", "\72\75", null, null, null, null, };\r
+\r
+/** Lexer state names. */\r
+public static final String[] lexStateNames = {\r
+ "DEFAULT",\r
+};\r
+static final long[] jjtoToken = {
+ 0xfffffffffffffff1L, 0xfffffffL,
+};\r
+static final long[] jjtoSkip = {
+ 0xeL, 0x0L,
+};\r
+protected SimpleCharStream input_stream;\r
+private final int[] jjrounds = new int[34];\r
+private final int[] jjstateSet = new int[68];\r
+private final StringBuilder jjimage = new StringBuilder();\r
+private StringBuilder image = jjimage;\r
+private int jjimageLen;\r
+private int lengthOfMatch;\r
+protected char curChar;\r
+/** Constructor. */\r
+public UnitParserTokenManager(SimpleCharStream stream){\r
+ if (SimpleCharStream.staticFlag)\r
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");\r
+ input_stream = stream;\r
+}\r
+\r
+/** Constructor. */\r
+public UnitParserTokenManager(SimpleCharStream stream, int lexState){\r
+ this(stream);\r
+ SwitchTo(lexState);\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream)\r
+{\r
+ jjmatchedPos = jjnewStateCnt = 0;\r
+ curLexState = defaultLexState;\r
+ input_stream = stream;\r
+ ReInitRounds();\r
+}\r
+private void ReInitRounds()\r
+{\r
+ int i;\r
+ jjround = 0x80000001;\r
+ for (i = 34; i-- > 0;)\r
+ jjrounds[i] = 0x80000000;\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream, int lexState)\r
+{\r
+ ReInit(stream);\r
+ SwitchTo(lexState);\r
+}\r
+\r
+/** Switch to specified lex state. */\r
+public void SwitchTo(int lexState)\r
+{\r
+ if (lexState >= 1 || lexState < 0)\r
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);\r
+ else\r
+ curLexState = lexState;\r
+}\r
+\r
+protected Token jjFillToken()\r
+{\r
+ final Token t;\r
+ final String curTokenImage;\r
+ final int beginLine;\r
+ final int endLine;\r
+ final int beginColumn;\r
+ final int endColumn;\r
+ String im = jjstrLiteralImages[jjmatchedKind];\r
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;\r
+ beginLine = input_stream.getBeginLine();\r
+ beginColumn = input_stream.getBeginColumn();\r
+ endLine = input_stream.getEndLine();\r
+ endColumn = input_stream.getEndColumn();\r
+ t = Token.newToken(jjmatchedKind, curTokenImage);\r
+\r
+ t.beginLine = beginLine;\r
+ t.endLine = endLine;\r
+ t.beginColumn = beginColumn;\r
+ t.endColumn = endColumn;\r
+\r
+ return t;\r
+}\r
+\r
+int curLexState = 0;\r
+int defaultLexState = 0;\r
+int jjnewStateCnt;\r
+int jjround;\r
+int jjmatchedPos;\r
+int jjmatchedKind;\r
+\r
+/** Get the next Token. */\r
+public Token getNextToken() \r
+{\r
+ Token matchedToken;\r
+ int curPos = 0;\r
+\r
+ EOFLoop :
+ for (;;)\r
+ {\r
+ try\r
+ {\r
+ curChar = input_stream.BeginToken();\r
+ }\r
+ catch(java.io.IOException e)\r
+ {\r
+ jjmatchedKind = 0;\r
+ matchedToken = jjFillToken();\r
+ return matchedToken;\r
+ }\r
+ image = jjimage;\r
+ image.setLength(0);\r
+ jjimageLen = 0;\r
+\r
+ jjmatchedKind = 0x7fffffff;\r
+ jjmatchedPos = 0;\r
+ curPos = jjMoveStringLiteralDfa0_0();\r
+ if (jjmatchedKind != 0x7fffffff)\r
+ {\r
+ if (jjmatchedPos + 1 < curPos)\r
+ input_stream.backup(curPos - jjmatchedPos - 1);\r
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\r
+ {\r
+ matchedToken = jjFillToken();\r
+ TokenLexicalActions(matchedToken);\r
+ return matchedToken;\r
+ }\r
+ else\r
+ {\r
+ continue EOFLoop;\r
+ }\r
+ }\r
+ int error_line = input_stream.getEndLine();\r
+ int error_column = input_stream.getEndColumn();\r
+ String error_after = null;\r
+ boolean EOFSeen = false;\r
+ try { input_stream.readChar(); input_stream.backup(1); }\r
+ catch (java.io.IOException e1) {\r
+ EOFSeen = true;\r
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+ if (curChar == '\n' || curChar == '\r') {\r
+ error_line++;\r
+ error_column = 0;\r
+ }\r
+ else\r
+ error_column++;\r
+ }\r
+ if (!EOFSeen) {\r
+ input_stream.backup(1);\r
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+ }\r
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\r
+ }\r
+}\r
+\r
+void TokenLexicalActions(Token matchedToken)\r
+{\r
+ switch(jjmatchedKind)\r
+ {\r
+ case 89 :\r
+ image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));\r
+ matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1);\r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+}\r
+private void jjCheckNAdd(int state)\r
+{\r
+ if (jjrounds[state] != jjround)\r
+ {\r
+ jjstateSet[jjnewStateCnt++] = state;\r
+ jjrounds[state] = jjround;\r
+ }\r
+}\r
+private void jjAddStates(int start, int end)\r
+{\r
+ do {\r
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];\r
+ } while (start++ != end);\r
+}\r
+private void jjCheckNAddTwoStates(int state1, int state2)\r
+{\r
+ jjCheckNAdd(state1);\r
+ jjCheckNAdd(state2);\r
+}\r
+\r
+private void jjCheckNAddStates(int start, int end)\r
+{\r
+ do {\r
+ jjCheckNAdd(jjnextStates[start]);\r
+ } while (start++ != end);\r
+}\r
+\r
+}\r
--- /dev/null
+/* Generated By:JavaCC: Do not edit this line. UnitParserTreeConstants.java Version 5.0 */\r
+package org.simantics.sysdyn.unitParser;\r
+\r
+public interface UnitParserTreeConstants\r
+{\r
+ public int JJTEXPR = 0;\r
+ public int JJTEXPRESSION = 1;\r
+ public int JJTIFTHENELSE = 2;\r
+ public int JJTCONDITION = 3;\r
+ public int JJTSIMPLE_EXPRESSION = 4;\r
+ public int JJTLOGICAL_EXPRESSION = 5;\r
+ public int JJTLOGICAL_TERM = 6;\r
+ public int JJTLOGICAL_FACTOR = 7;\r
+ public int JJTRELATION = 8;\r
+ public int JJTREL_OP = 9;\r
+ public int JJTARITHMETIC_EXPRESSION = 10;\r
+ public int JJTADD_OP = 11;\r
+ public int JJTTERM = 12;\r
+ public int JJTFACTOR = 13;\r
+ public int JJTPOWER = 14;\r
+ public int JJTMULTIPLICATION = 15;\r
+ public int JJTDIVIDE = 16;\r
+ public int JJTPRIMARY = 17;\r
+ public int JJTCOMPONENT_REFERENCE_FULL = 18;\r
+ public int JJTARRAY_DEFINITION = 19;\r
+ public int JJTFUNCTION_CALL = 20;\r
+ public int JJTPARENTHESIS_EXPRESSION = 21;\r
+ public int JJTVALUE = 22;\r
+ public int JJTPARENTHESIS_OPEN = 23;\r
+ public int JJTPARENTHESIS_CLOSE = 24;\r
+ public int JJTNAME = 25;\r
+ public int JJTCOMPONENT_REFERENCE = 26;\r
+ public int JJTCOMPONENT_IDENTITY = 27;\r
+ public int JJTFUNCTION_CALL_ARGS = 28;\r
+ public int JJTFUNCTION_ARGUMENTS = 29;\r
+ public int JJTFOR_INDICES = 30;\r
+ public int JJTFOR_INDEX = 31;\r
+ public int JJTNAMED_ARGUMENTS = 32;\r
+ public int JJTNAMED_ARGUMENT = 33;\r
+ public int JJTOUTPUT_EXPRESSION_LIST = 34;\r
+ public int JJTEXPRESSION_LIST = 35;\r
+ public int JJTARRAY_SUBSCRIPTS = 36;\r
+ public int JJTSUBSCRIPT = 37;\r
+ public int JJTRANGEINDEX = 38;\r
+\r
+\r
+ public String[] jjtNodeName = {\r
+ "expr",\r
+ "expression",\r
+ "ifthenelse",\r
+ "condition",\r
+ "simple_expression",\r
+ "logical_expression",\r
+ "logical_term",\r
+ "logical_factor",\r
+ "relation",\r
+ "rel_op",\r
+ "arithmetic_expression",\r
+ "add_op",\r
+ "term",\r
+ "factor",\r
+ "power",\r
+ "multiplication",\r
+ "divide",\r
+ "primary",\r
+ "component_reference_full",\r
+ "array_definition",\r
+ "function_call",\r
+ "parenthesis_expression",\r
+ "value",\r
+ "parenthesis_open",\r
+ "parenthesis_close",\r
+ "name",\r
+ "component_reference",\r
+ "component_identity",\r
+ "function_call_args",\r
+ "function_arguments",\r
+ "for_indices",\r
+ "for_index",\r
+ "named_arguments",\r
+ "named_argument",\r
+ "output_expression_list",\r
+ "expression_list",\r
+ "array_subscripts",\r
+ "subscript",\r
+ "rangeIndex",\r
+ };\r
+}\r
+/* JavaCC - OriginalChecksum=55cc0533e9e24a32b3fbe9bcd56ca148 (do not edit this line) */\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class AddOp extends UnitCheckingNode {\r
+\r
+ public AddOp(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = super.getUnits(units, functions, allowEquivalents);\r
+ result.setUnitType(UnitType.OPERATOR);\r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class Arithmetic extends UnitCheckingNode {\r
+\r
+ public Arithmetic(int id) {\r
+ super(id);\r
+ }\r
+\r
+\r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+\r
+ UnitCheckingNode base = null;\r
+ UnitCheckingNode operator = null;\r
+ UnitCheckingNode candidateNode = null;\r
+\r
+ for(int i = 0; i < jjtGetNumChildren(); i++) {\r
+ candidateNode = ((UnitCheckingNode)jjtGetChild(i));\r
+ UnitResult candidateUnits = candidateNode.getUnits(units, functions, allowEquivalents);\r
+ if(candidateUnits.getUnitType() == UnitType.OPERATOR) {\r
+ continue;\r
+ } else if(base == null || result.getUnitType() == UnitType.SCALAR || result.getUnitType() == UnitType.ANY) {\r
+ base = ((UnitCheckingNode)jjtGetChild(i));\r
+ result.appendResult(base.getUnits(units, functions, allowEquivalents));\r
+ continue;\r
+ } else if(candidateUnits.getUnitType() == UnitType.SCALAR) {\r
+ continue;\r
+ } else {\r
+ operator = ((UnitCheckingNode)jjtGetChild(i-1));\r
+ if(!result.equals(candidateUnits)) {\r
+ throw new UnitCheckingException("Not equals exception: " +\r
+ base.printNode() + " [" + result.getCleanFullUnit() + "] " + operator.printNode() + " " +\r
+ candidateNode.printNode() + " [" + candidateUnits.getCleanFullUnit() + "]"\r
+ );\r
+ }\r
+ }\r
+ }\r
+// System.out.println("Arithmetic: " + printNode() + " [" + result.getFullUnit() + " : " + result.getUnitType() + "]");\r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class ArrayDefinition extends UnitCheckingNode {\r
+\r
+ public ArrayDefinition(int id) {\r
+ super(id);\r
+ }\r
+\r
+\r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+ result.setUnitType(UnitType.SCALAR);\r
+\r
+ UnitCheckingNode base = null;\r
+\r
+ if(jjtGetNumChildren() > 0 && jjtGetChild(0) instanceof FunctionArguments) {\r
+ FunctionArguments functionArguments = (FunctionArguments) jjtGetChild(0);\r
+\r
+ for(UnitCheckingNode candidateNode : gatherExpressions(functionArguments, new ArrayList<UnitCheckingNode>())) {\r
+ UnitResult candidateUnits = candidateNode.getUnits(units, functions, allowEquivalents);\r
+ if(candidateUnits.getUnitType() == UnitType.SCALAR) {\r
+ continue;\r
+ } else if(base == null) {\r
+ base = candidateNode;\r
+ UnitType oldUnitType = result.getUnitType();\r
+ result.appendResult(base.getUnits(units, functions, allowEquivalents));\r
+\r
+ /*\r
+ * Make sure unit type persist\r
+ * {Var1, Var2, 1} would result in UnitType.SCALAR even though it should be UnitType.NORMAL \r
+ * because the last element has UnitType.SCALAR \r
+ */\r
+ UnitType newUnitType = result.getUnitType();\r
+ if(newUnitType == UnitType.SCALAR || newUnitType == UnitType.ANY || newUnitType == UnitType.DMNL)\r
+ result.setUnitType(oldUnitType);\r
+ continue;\r
+ } else {\r
+ if(!result.equals(candidateUnits)) {\r
+ throw new UnitCheckingException("Array elements do not have same units: " +\r
+ base.printNode() + " [" + result.getCleanFullUnit() + "] =/= " +\r
+ candidateNode.printNode() + " [" + candidateUnits.getCleanFullUnit() + "]"\r
+ );\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ return result;\r
+ }\r
+\r
+ /**\r
+ * Gather all expressions of array definitions.\r
+ * \r
+ * void function_arguments() : {\r
+ * } {\r
+ * LOOKAHEAD(2) named_argument() ( "," function_arguments() )?\r
+ * | expression() ( "," function_arguments() | "for" for_indices() )?\r
+ * \r
+ * }\r
+ * @param functionArguments\r
+ * @param expressions\r
+ * @return\r
+ */\r
+ private ArrayList<UnitCheckingNode> gatherExpressions(UnitCheckingNode functionArguments, ArrayList<UnitCheckingNode> expressions) {\r
+ if(functionArguments.jjtGetNumChildren() > 0) {\r
+ if(functionArguments.jjtGetChild(0) instanceof Expression) {\r
+ expressions.add(((UnitCheckingNode)functionArguments.jjtGetChild(0)));\r
+ }\r
+ }\r
+\r
+ if(functionArguments.jjtGetNumChildren() > 1) {\r
+ gatherExpressions((UnitCheckingNode)functionArguments.jjtGetChild(1), expressions);\r
+ }\r
+\r
+ return expressions;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import org.simantics.sysdyn.unitParser.Token;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class ComponentIdentity extends UnitCheckingNode {\r
+\r
+ public ComponentIdentity(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public String printNode() {\r
+ StringBuilder sb = new StringBuilder();\r
+ Token token = jjtGetFirstToken();\r
+ sb.append(token.image);\r
+\r
+ while(token != null && !token.equals(jjtGetLastToken())) {\r
+ sb.append(" ");\r
+ token = token.next;\r
+ sb.append(token.image);\r
+ }\r
+ return sb.toString();\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class ComponentReference extends UnitCheckingNode {\r
+\r
+ public ComponentReference(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public String printNode() {\r
+ StringBuilder sb = new StringBuilder();\r
+ for(int i = 0; i < jjtGetNumChildren(); i++) {\r
+ UnitCheckingNode node = (UnitCheckingNode) jjtGetChild(i);\r
+ if(node instanceof ComponentIdentity || node instanceof ComponentReference) {\r
+ if(sb.length() > 0)\r
+ sb.append(".");\r
+ sb.append(node.printNode());\r
+ }\r
+ }\r
+ return sb.toString();\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.io.StringReader;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.ParseException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.UnitParser;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class ComponentReferenceFull extends UnitCheckingNode {\r
+\r
+ public ComponentReferenceFull(int id) {\r
+ super(id);\r
+ }\r
+\r
+ protected UnitResult parseUnits(String units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ StringReader sr = new StringReader(units);\r
+ UnitParser parser = new UnitParser(sr);\r
+ try {\r
+ UnitCheckingNode node = (UnitCheckingNode) parser.expr();\r
+ return node.getUnits(null, functions, allowEquivalents);\r
+ } catch (UnitCheckingException e) {\r
+ e.printStackTrace();\r
+ } catch (ParseException e) {\r
+ throw new UnitCheckingException("Cannot validate units: Syntax error in expression.");\r
+ }\r
+ return null;\r
+ }\r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ String node = printNode();\r
+ \r
+ if("dmnl".equals(node)) {\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+ result.setUnitType(UnitType.DMNL);\r
+ return result;\r
+ }\r
+ \r
+ if(units != null) {\r
+ if(!units.containsKey(node) || units.get(node) == null)\r
+ throw new UnitCheckingException("No units defined for " + node);\r
+ else {\r
+ return parseUnits(units.get(node), functions, allowEquivalents);\r
+ }\r
+ } else {\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+ result.addDivident(node);\r
+ result.append(node);\r
+ return result; \r
+ }\r
+ }\r
+\r
+ @Override\r
+ public String printNode() {\r
+ StringBuilder sb = new StringBuilder();\r
+ for(int i = 0; i < jjtGetNumChildren(); i++) {\r
+ UnitCheckingNode node = (UnitCheckingNode) jjtGetChild(i);\r
+ sb.append(node.printNode());\r
+ }\r
+ return sb.toString();\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class Condition extends UnitCheckingNode {\r
+\r
+ public Condition(int id) {\r
+ super(id);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class Divide extends UnitCheckingNode {\r
+\r
+ public Divide(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = super.getUnits(units, functions, allowEquivalents);\r
+ result.setUnitType(UnitType.OPERATOR);\r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class Expression extends UnitCheckingNode {\r
+\r
+ public Expression(int id) {\r
+ super(id);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.Token;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Tuomas Miettinen\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class Factor extends UnitCheckingNode {\r
+\r
+ public Factor(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+ \r
+ UnitCheckingNode current = null;\r
+ UnitCheckingNode operator = null;\r
+ UnitCheckingNode base = null;\r
+ \r
+ for(int i = 0; i < jjtGetNumChildren(); i++) {\r
+ current = ((UnitCheckingNode)jjtGetChild(i));\r
+ UnitResult currentUnits = current.getUnits(units, functions, allowEquivalents);\r
+\r
+ if(currentUnits.getUnitType() == UnitType.ANY) {\r
+ result = new UnitResult(allowEquivalents);\r
+ result.setUnitType(UnitType.ANY);\r
+ return result;\r
+ } else if(currentUnits.getUnitType() == UnitType.OPERATOR) {\r
+ continue;\r
+ } else if(base == null) {\r
+ base = current;\r
+ continue;\r
+ } else {\r
+ operator = ((UnitCheckingNode)jjtGetChild(i-1));\r
+\r
+ if(operator instanceof Power) {\r
+ UnitType unitType = currentUnits.getUnitType();\r
+ if(unitType == UnitType.SCALAR) {\r
+ int exponent;\r
+ UnitResult baseUnits = base.getUnits(units, functions, allowEquivalents);\r
+ try {\r
+ exponent = Integer.valueOf(currentUnits.getFullUnit());\r
+ } catch (NumberFormatException e) {\r
+ exponent = 1; /* It's a bit of a corner case if someone want's to use\r
+ an arithmetic expression other than a constant in the exponent. */\r
+ }\r
+ \r
+ if (exponent < 0) {\r
+ for (int j = 0; j > exponent; --j) {\r
+ // Negative exponent turns the base number around.\r
+ result.addAllDividers(baseUnits.getDividents());\r
+ result.addAllDividents(baseUnits.getDividers());\r
+ result.append(operator.printNode());\r
+ result.append(baseUnits.getFullUnit());\r
+ }\r
+ result.setUnitType(baseUnits.getUnitType());\r
+ } else if (exponent > 0) {\r
+ result.appendResult(baseUnits);\r
+ for (int j = 1; j < exponent; ++j) {\r
+ result.addAllDividents(baseUnits.getDividents());\r
+ result.addAllDividers(baseUnits.getDividers());\r
+ result.append(operator.printNode());\r
+ result.append(baseUnits.getFullUnit());\r
+ }\r
+ result.setUnitType(baseUnits.getUnitType());\r
+ } // 0 is a corner case\r
+ }\r
+ }\r
+ }\r
+ }\r
+// System.out.println("Term: " + printNode() + " [" + result.getFullUnit() + " : " + result.getUnitType() + "]");\r
+ return result;\r
+ }\r
+ \r
+ @Override\r
+ public String printNode() {\r
+ StringBuilder sb = new StringBuilder();\r
+ Token token = jjtGetFirstToken();\r
+ sb.append(token.image);\r
+\r
+ Token prevToken = null;\r
+ while(token != null && !token.equals(jjtGetLastToken())) {\r
+ prevToken = token;\r
+ token = token.next;\r
+ if(!token.image.equals("[") \r
+ && !token.image.equals("]")\r
+ && !prevToken.image.equals("[")\r
+ && !prevToken.image.equals("]")\r
+ && !token.image.equals(".")\r
+ && !prevToken.image.equals("."))\r
+ sb.append(" ");\r
+ sb.append(token.image);\r
+ }\r
+ return sb.toString();\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class ForIndex extends UnitCheckingNode {\r
+\r
+ public ForIndex(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ return new UnitResult(allowEquivalents);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class FunctionArguments extends UnitCheckingNode {\r
+\r
+ public FunctionArguments(int id) {\r
+ super(id);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+import org.simantics.sysdyn.utils.Function.Input;\r
+import org.simantics.sysdyn.utils.Function.Output;\r
+import org.simantics.utils.datastructures.Pair;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class FunctionCall extends UnitCheckingNode {\r
+\r
+ public FunctionCall(int id) {\r
+ super(id);\r
+ }\r
+\r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitCheckingNode functionLabelNode = ((UnitCheckingNode)jjtGetChild(0));\r
+ String functionLabel = functionLabelNode.printNode();\r
+ \r
+ UnitCheckingNode functionArgumentsWithParenthesisNode = ((UnitCheckingNode)jjtGetChild(1));\r
+ UnitCheckingNode functionArgumentsNode = ((UnitCheckingNode)functionArgumentsWithParenthesisNode.jjtGetChild(1));\r
+ \r
+ UnitCheckingException u = null;\r
+ \r
+ for (Function f : functions) {\r
+ if (f.getName().equals(functionLabel)) {\r
+ // Get the expected inputs\r
+ ArrayList<Input> inputs = f.getInputList();\r
+ // Get arguments from parser.\r
+ ArrayList<Pair<UnitResult, String>> argumentUnits = getArgumentsOf(functionArgumentsNode, units, functions, allowEquivalents);\r
+ // Get correspondent actual units for unit templates in inputs.\r
+ HashMap<String, String> correspondences = getReplacementUnitCorrespondences(inputs, argumentUnits);\r
+\r
+ try {\r
+ // If the function input parameter units are OK, set the output unit accordingly. \r
+ if (f.areArgumentUnitsValid(argumentUnits, correspondences, functions, allowEquivalents, units)) {\r
+ Output o = f.getOutputList().get(0); // Support only single return value functions.\r
+ return o.getUnitResult(units, f, functions, allowEquivalents, correspondences);\r
+ }\r
+ \r
+ // Create the exception when we first time arrive here, since the functions\r
+ // are sorted so that scalar functions are before vector ones and there are\r
+ // a few duplicates, so this way the exception message is more likely useful.\r
+ if (u == null)\r
+ u = getException(functionLabelNode, inputs, argumentUnits);\r
+ // There may be similarly named functions, so if one doesn't succeed, go through the rest of the list anyway.\r
+ } catch (UnitCheckingException e) {\r
+ u = e; // Override the general exception with a more specific one.\r
+ }\r
+ }\r
+ }\r
+ \r
+ if (u == null) {\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+ result.setUnitType(UnitType.ANY); // The function was not found.\r
+ return result;\r
+ }\r
+ \r
+ throw u;\r
+ }\r
+\r
+ private static HashMap<String, String> getReplacementUnitCorrespondences(\r
+ ArrayList<Input> inputs, ArrayList<Pair<UnitResult, String>> argumentUnits) {\r
+ // TODO: General case. Currently each 'p, 'q etc. must exist as an atomic unit.\r
+ HashMap<String, String> correspondences = new HashMap<String, String>();\r
+ for (int i = 0; i < argumentUnits.size(); ++i) {\r
+ if (argumentUnits.get(i).second != null) { // named arguments\r
+ for (Input input : inputs) {\r
+ if (input.name.equals(argumentUnits.get(i).second)) {\r
+ addPossibleCorrespondence(correspondences, input, argumentUnits.get(i).first);\r
+ }\r
+ }\r
+ } else if (inputs.size() > i) {\r
+ addPossibleCorrespondence(correspondences, inputs.get(i), argumentUnits.get(i).first);\r
+ }\r
+ }\r
+ // If there is no mapping between the actual and defined inputs (e.g. 'p refers to both m and s),\r
+ // then return the latest correspondence. The users of this functions currently assume such behavior.\r
+ return correspondences;\r
+ }\r
+\r
+ private static void addPossibleCorrespondence(HashMap<String, String> correspondences,\r
+ Input input, UnitResult argumentUnit) {\r
+ if (correspondences.containsKey(input.unit)\r
+ && argumentUnit.getUnitType() == UnitType.SCALAR) {\r
+ // Don't overwrite if the correspondence already exists and the new argument is scalar. \r
+ return;\r
+ }\r
+ if (input.unit.matches("'[a-zA-Z]")) {\r
+ String fullUnit = argumentUnit.getCleanFullUnit();\r
+ if ("".equals(fullUnit))\r
+ fullUnit = "1";\r
+ correspondences.put(input.unit, fullUnit);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Get the exception (text) shown to user.\r
+ * @param functionLabelNode\r
+ * @param inputs\r
+ * @param argumentUnits\r
+ * @return\r
+ */\r
+ private static UnitCheckingException getException(UnitCheckingNode functionLabelNode, \r
+ ArrayList<Input> inputs, \r
+ ArrayList<Pair<UnitResult, String>> argumentUnits) {\r
+ String exception = new String("Function arguments do not have correct units. Expected " + functionLabelNode.printNode() + "(");\r
+ \r
+ for (int i = 0; i < inputs.size(); ++i) {\r
+ Input input = inputs.get(i);\r
+ if (i == 0)\r
+ exception += " ";\r
+ exception += "[" + input.unit + "]";\r
+ if (input.variableLength) {\r
+ exception += "... ";\r
+ }\r
+ \r
+ if (i != inputs.size() - 1)\r
+ exception += ", ";\r
+ }\r
+ exception += " ), got " + functionLabelNode.printNode() + "(";\r
+ for (int i = 0; i < argumentUnits.size(); ++i) {\r
+ UnitResult argumentUnit = argumentUnits.get(i).first;\r
+ if (i == 0)\r
+ exception += " ";\r
+ exception += "[" + argumentUnit.getCleanFullUnit() + "]";\r
+ \r
+ if (i != argumentUnits.size() - 1)\r
+ exception += ", ";\r
+ \r
+ }\r
+ exception += " ).";\r
+ \r
+ return new UnitCheckingException(exception);\r
+ }\r
+\r
+ private static ArrayList<Pair<UnitResult, String>> getArgumentsOf(\r
+ UnitCheckingNode functionArgumentsNode, \r
+ HashMap<String, String> units, \r
+ ArrayList<Function> functions, \r
+ boolean allowEquivalents) throws UnitCheckingException {\r
+ // Arguments are defined recursively in OpenModelica\r
+ ArrayList<Pair<UnitResult, String>> argumentUnits = new ArrayList<Pair<UnitResult, String>>();\r
+ if (functionArgumentsNode instanceof FunctionArguments) {\r
+ UnitCheckingNode firstArg = ((UnitCheckingNode) functionArgumentsNode.jjtGetChild(0));\r
+ if (firstArg instanceof NamedArguments) {\r
+ // Found all position arguments, continue with named arguments\r
+ argumentUnits.addAll(getNamedArgumentsOf(firstArg, units, functions, allowEquivalents));\r
+ } else {\r
+ argumentUnits.add(new Pair<UnitResult, String>(firstArg.getUnits(units, functions, allowEquivalents), null));\r
+ if (functionArgumentsNode.jjtGetNumChildren() > 1) {\r
+ // Continue to the next argument (within the following function_arguments)\r
+ UnitCheckingNode next = ((UnitCheckingNode) functionArgumentsNode.jjtGetChild(1));\r
+ argumentUnits.addAll(getArgumentsOf(next, units, functions, allowEquivalents));\r
+ }\r
+ }\r
+ }\r
+ return argumentUnits;\r
+ }\r
+\r
+ private static ArrayList<Pair<UnitResult, String>> getNamedArgumentsOf(\r
+ UnitCheckingNode namedArgumentsNode, \r
+ HashMap<String, String> units, \r
+ ArrayList<Function> functions, \r
+ boolean allowEquivalents) throws UnitCheckingException {\r
+ // Named arguments are defined recursively in OpenModelica\r
+ ArrayList<Pair<UnitResult, String>> argumentUnits = new ArrayList<Pair<UnitResult, String>>();\r
+ if (namedArgumentsNode instanceof NamedArguments) {\r
+ UnitCheckingNode firstArg = ((UnitCheckingNode) namedArgumentsNode.jjtGetChild(0));\r
+ String argumentName = firstArg.jjtGetFirstToken().image;\r
+ argumentUnits.add(new Pair<UnitResult, String>(firstArg.getUnits(units, functions, allowEquivalents), argumentName));\r
+ if (namedArgumentsNode.jjtGetNumChildren() > 1) {\r
+ // Continue to the next argument (within the following function_arguments)\r
+ UnitCheckingNode next = ((UnitCheckingNode) namedArgumentsNode.jjtGetChild(1));\r
+ argumentUnits.addAll(getNamedArgumentsOf(next, units, functions, allowEquivalents));\r
+ }\r
+ }\r
+ return argumentUnits;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class IfThenElse extends UnitCheckingNode {\r
+\r
+ public IfThenElse(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult base = null;\r
+ UnitCheckingNode baseNode = null;\r
+ UnitCheckingNode candidateNode = null;\r
+ \r
+ for(int i = 0; i < jjtGetNumChildren(); i++) {\r
+ candidateNode = ((UnitCheckingNode)jjtGetChild(i));\r
+ UnitResult candidateUnits = candidateNode.getUnits(units, functions, allowEquivalents);\r
+ \r
+ if(!(candidateNode instanceof Condition)) {\r
+ \r
+ if(base == null) {\r
+ base = candidateUnits;\r
+ baseNode = candidateNode;\r
+ } else {\r
+ if(!base.equals(candidateUnits)) {\r
+ base.equals(candidateUnits);\r
+ throw new UnitCheckingException("Conditional results do not have same units: " +\r
+ printNode() + " -> " + \r
+ baseNode.printNode() + " [" + base.getFullUnit() + "] <-> " +\r
+ candidateNode.printNode() + " [" + candidateUnits.getFullUnit() + "]"\r
+ );\r
+ }\r
+ }\r
+ }\r
+\r
+\r
+ }\r
+ \r
+ return base;\r
+ }\r
+\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class LogicalExpression extends UnitCheckingNode {\r
+\r
+ public LogicalExpression(int id) {\r
+ super(id);\r
+ }\r
+\r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result;\r
+ \r
+ if (jjtGetNumChildren() == 1) {\r
+ result = ((UnitCheckingNode)jjtGetChild(0)).getUnits(units, functions, allowEquivalents);\r
+ } else {\r
+ // If the logical expression is of type logical_term or logical_term, allow\r
+ // all units as input and output unit is scalar\r
+ result = new UnitResult(allowEquivalents);\r
+ result.setUnitType(UnitType.SCALAR);\r
+ }\r
+ \r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class LogicalFactor extends UnitCheckingNode {\r
+\r
+ public LogicalFactor(int id) {\r
+ super(id);\r
+ }\r
+\r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result;\r
+ \r
+ if (jjtGetNumChildren() == 1) {\r
+ result = ((UnitCheckingNode)jjtGetChild(0)).getUnits(units, functions, allowEquivalents);\r
+ } else {\r
+ // If the logical factor is of type not relation, allow\r
+ // all units as input and output unit is scalar\r
+ result = new UnitResult(allowEquivalents);\r
+ result.setUnitType(UnitType.SCALAR);\r
+ }\r
+ \r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class LogicalTerm extends UnitCheckingNode {\r
+\r
+ public LogicalTerm(int id) {\r
+ super(id);\r
+ }\r
+\r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result;\r
+ \r
+ if (jjtGetNumChildren() == 1) {\r
+ result = ((UnitCheckingNode)jjtGetChild(0)).getUnits(units, functions, allowEquivalents);\r
+ } else {\r
+ // If the logical term is of type logical_factor and logical_factor, allow\r
+ // all units as input and output unit is scalar\r
+ result = new UnitResult(allowEquivalents);\r
+ result.setUnitType(UnitType.SCALAR);\r
+ }\r
+ \r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class Multiplication extends UnitCheckingNode {\r
+\r
+ public Multiplication(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = super.getUnits(units, functions, allowEquivalents);\r
+ result.setUnitType(UnitType.OPERATOR);\r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class NamedArguments extends UnitCheckingNode {\r
+\r
+ public NamedArguments(int id) {\r
+ super(id);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class ParenthesisExpression extends UnitCheckingNode {\r
+\r
+ public ParenthesisExpression(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException{\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+ // Get the Expression between the parenthesis.\r
+ result.appendResult(((UnitCheckingNode)jjtGetChild(1)).getUnits(units, functions, allowEquivalents));\r
+ return result; \r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class Power extends UnitCheckingNode {\r
+\r
+ public Power(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = super.getUnits(units, functions, allowEquivalents);\r
+ result.setUnitType(UnitType.OPERATOR);\r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class RelOp extends UnitCheckingNode {\r
+\r
+ public RelOp(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = super.getUnits(units, functions, allowEquivalents);\r
+ result.setUnitType(UnitType.OPERATOR);\r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class Relation extends UnitCheckingNode {\r
+\r
+ public Relation(int id) {\r
+ super(id);\r
+ }\r
+\r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+ \r
+ UnitCheckingNode base = null;\r
+ UnitCheckingNode operator = null;\r
+ UnitCheckingNode candidateNode = null;\r
+ \r
+ base = ((UnitCheckingNode)jjtGetChild(0));\r
+ if(!(base instanceof Arithmetic) && jjtGetNumChildren() > 1) {\r
+ base = ((UnitCheckingNode)jjtGetChild(1));\r
+ }\r
+ \r
+ if(base instanceof Arithmetic) {\r
+ result.appendResult(base.getUnits(units, functions, allowEquivalents));\r
+\r
+ for(int i = 2; i < jjtGetNumChildren(); i = i + 2) {\r
+ candidateNode = ((UnitCheckingNode)jjtGetChild(i));\r
+\r
+ if(!(candidateNode instanceof Value)) {\r
+ operator = ((UnitCheckingNode)jjtGetChild(i-1));\r
+ UnitResult candidateUnits = candidateNode.getUnits(units, functions, allowEquivalents);\r
+ if(!result.equals(candidateUnits)) {\r
+ throw new UnitCheckingException("Not equals exception: " +\r
+ base.printNode() + " [" + result.getFullUnit() + "] " + operator.printNode() + " " +\r
+ candidateNode.printNode() + " [" + candidateUnits.getFullUnit() + "]"\r
+ );\r
+ }\r
+ }\r
+ }\r
+ \r
+ if (jjtGetNumChildren() > 1) {\r
+ // If there is an actual relation (e.g. a > b), the output\r
+ // unit is a scalar.\r
+ result = new UnitResult(allowEquivalents);\r
+ result.setUnitType(UnitType.SCALAR);\r
+ }\r
+\r
+ }\r
+ \r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.Token;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class Term extends UnitCheckingNode {\r
+\r
+ public Term(int id) {\r
+ super(id);\r
+ }\r
+ \r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+ \r
+ UnitCheckingNode current = null;\r
+ UnitCheckingNode operator = null;\r
+ UnitCheckingNode base = null;\r
+ \r
+ for(int i = 0; i < jjtGetNumChildren(); i++) {\r
+ current = ((UnitCheckingNode)jjtGetChild(i));\r
+ UnitResult currentUnits = current.getUnits(units, functions, allowEquivalents);\r
+\r
+ if(currentUnits.getUnitType() == UnitType.ANY) {\r
+ result = new UnitResult(allowEquivalents);\r
+ result.setUnitType(UnitType.ANY);\r
+ return result;\r
+ } else if(currentUnits.getUnitType() == UnitType.OPERATOR) {\r
+ continue;\r
+ } else if(base == null) {\r
+ base = current;\r
+ result.appendResult(currentUnits);\r
+ continue;\r
+ } else {\r
+ operator = ((UnitCheckingNode)jjtGetChild(i-1));\r
+\r
+ if(operator instanceof Multiplication) {\r
+ UnitType unitType = currentUnits.getUnitType();\r
+ if(unitType != UnitType.SCALAR && unitType != UnitType.DMNL) {\r
+ result.append(operator.printNode());\r
+ result.appendResult(currentUnits);\r
+ }\r
+ } else if(operator instanceof Divide) {\r
+ result.append(operator.printNode());\r
+ result.addAllDividents(currentUnits.getDividers());\r
+ result.addAllDividers(currentUnits.getDividents());\r
+ UnitType unitType = currentUnits.getUnitType();\r
+ if(unitType == UnitType.SCALAR || unitType == UnitType.DMNL) {\r
+ result.append("1");\r
+ } else {\r
+ result.append(currentUnits.getFullUnit());\r
+ result.setUnitType(unitType);\r
+ }\r
+ }\r
+ }\r
+ }\r
+// System.out.println("Term: " + printNode() + " [" + result.getFullUnit() + " : " + result.getUnitType() + "]");\r
+ return result;\r
+ }\r
+ \r
+ @Override\r
+ public String printNode() {\r
+ StringBuilder sb = new StringBuilder();\r
+ Token token = jjtGetFirstToken();\r
+ sb.append(token.image);\r
+\r
+ Token prevToken = null;\r
+ while(token != null && !token.equals(jjtGetLastToken())) {\r
+ prevToken = token;\r
+ token = token.next;\r
+ if(!token.image.equals("[") \r
+ && !token.image.equals("]")\r
+ && !prevToken.image.equals("[")\r
+ && !prevToken.image.equals("]")\r
+ && !token.image.equals(".")\r
+ && !prevToken.image.equals("."))\r
+ sb.append(" ");\r
+ sb.append(token.image);\r
+ }\r
+ return sb.toString();\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ ********************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.Iterator;\r
+\r
+/**\r
+ * Result of getUnits() request for Unit Parser nodes. \r
+ * \r
+ * Result is built of dividers and dividents. ( divident / divider )\r
+ * \r
+ * UnitType may provide information for handling this unit result\r
+ * \r
+ * fullUnit is the print of this unit in the order it is created.\r
+ * \r
+ * getCleanFullUnit reduces all unnecessary units and provides the most\r
+ * clean representation of the unit. ( e.g. m * s / m -> s )\r
+ * \r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class UnitResult {\r
+ \r
+ public enum UnitType {NORMAL, ANY, DMNL, OPERATOR, SCALAR};\r
+ \r
+ private ArrayList<String> dividers = new ArrayList<String>();\r
+ private ArrayList<String> dividents = new ArrayList<String>();\r
+ private StringBuilder fullUnit = new StringBuilder();\r
+ private UnitType unitType;\r
+ \r
+ // Equivalent forms of units:\r
+ private final Equivalent[] EQUIVALENTS = {\r
+ new Equivalent("$","$s","dollar","dollars","usd"),\r
+ new Equivalent("\u20ac","\u20acs","eur","euro","euros","e","ecu"),\r
+ new Equivalent("£","£s","pound","pounds","gbp"),\r
+ new Equivalent("unit","units"),\r
+ new Equivalent("person","people","persons"),\r
+ new Equivalent("second","seconds","sec","s"),\r
+ new Equivalent("minute","minutes","min"),\r
+ new Equivalent("hour","hours","h","hr"),\r
+ new Equivalent("day","days","d"),\r
+ new Equivalent("month","months","mon","mth","mo","mos"),\r
+ new Equivalent("year","years","a","y","yr")\r
+ };\r
+ private boolean allowEquivalents;\r
+ \r
+ private class Equivalent {\r
+ public ArrayList<String> forms;\r
+ \r
+ Equivalent(String ... forms) {\r
+ this.forms = new ArrayList<String>();\r
+ for (String f : forms)\r
+ this.forms.add(f);\r
+ }\r
+ \r
+ public boolean contains(String form) {\r
+ for (String f : forms)\r
+ if (f.equalsIgnoreCase(form))\r
+ return true;\r
+ return false;\r
+ }\r
+ \r
+ public String getDefault() {\r
+ if (forms.size() > 0)\r
+ return forms.get(0);\r
+ else return null;\r
+ }\r
+ }\r
+ \r
+ public UnitResult(boolean allowEquivalents) {\r
+ this.allowEquivalents = allowEquivalents;\r
+ setUnitType(UnitType.NORMAL);\r
+ }\r
+ \r
+ public void appendResult(UnitResult result) {\r
+ addAllDividents(result.getDividents());\r
+ addAllDividers(result.getDividers());\r
+ append(result.getFullUnit());\r
+ setUnitType(result.getUnitType());\r
+ }\r
+ \r
+ public void addDivider(String divider) {\r
+ this.dividers.add(divider);\r
+ Collections.sort(this.dividers);\r
+ }\r
+ \r
+ public void addAllDividers(ArrayList<String> dividers) {\r
+ this.dividers.addAll(dividers);\r
+ Collections.sort(this.dividers);\r
+ }\r
+ \r
+ public void addDivident(String divident) {\r
+ this.dividents.add(divident);\r
+ Collections.sort(this.dividents);\r
+ }\r
+ \r
+ public void addAllDividents(ArrayList<String> dividents) {\r
+ this.dividents.addAll(dividents);\r
+ Collections.sort(this.dividents);\r
+ }\r
+ \r
+ public void append(String text) {\r
+ this.fullUnit.append(text);\r
+ }\r
+ \r
+ public ArrayList<String> getDividers() {\r
+ return this.dividers;\r
+ }\r
+ \r
+ public ArrayList<String> getDividents() {\r
+ return this.dividents;\r
+ }\r
+ \r
+ public String getFullUnit() {\r
+ return fullUnit.toString();\r
+ }\r
+ \r
+ \r
+ /**\r
+ * Get clean representation of this unit. All redundant \r
+ * units are cleanend out and the unit is represented\r
+ * with max one '/' character.\r
+ * @return\r
+ */\r
+ public String getCleanFullUnit() {\r
+ if(dividers.size() == 0 && dividents.size() == 0)\r
+ return "";\r
+ \r
+ if(dividers.size() > 0 && dividents.size() == 0)\r
+ dividents.add("1");\r
+ \r
+ ArrayList<String> copyDividers1 = new ArrayList<String>(dividers);\r
+ ArrayList<String> copyDividents1 = new ArrayList<String>(dividents);\r
+ reduceUnitLists(dividents, copyDividents1, copyDividers1, allowEquivalents);\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ Iterator<String> iterator = copyDividents1.iterator();\r
+ while(iterator.hasNext()) {\r
+ String s = iterator.next();\r
+ sb.append(s);\r
+ if(iterator.hasNext())\r
+ sb.append("*");\r
+ }\r
+ \r
+ if(copyDividers1.size() > 0) {\r
+ sb.append("/");\r
+ if(copyDividers1.size() > 1)\r
+ sb.append("(");\r
+ \r
+ iterator = copyDividers1.iterator();\r
+ while(iterator.hasNext()) {\r
+ String s = iterator.next();\r
+ sb.append(s);\r
+ if(iterator.hasNext())\r
+ sb.append("*");\r
+ }\r
+ \r
+ if(copyDividers1.size() > 1)\r
+ sb.append(")");\r
+ }\r
+ \r
+ return sb.toString();\r
+ }\r
+ \r
+ @Override\r
+ public boolean equals(Object obj) {\r
+ if(!(obj instanceof UnitResult))\r
+ return false;\r
+ \r
+ UnitResult other = (UnitResult)obj;\r
+ \r
+ if(getUnitType() == UnitType.ANY || other.getUnitType() == UnitType.ANY)\r
+ return true;\r
+ \r
+ if(getUnitType() != other.getUnitType())\r
+ return true;\r
+ \r
+ ArrayList<String> copyDividers1 = new ArrayList<String>(dividers);\r
+ ArrayList<String> copyDividents1 = new ArrayList<String>(dividents);\r
+ reduceUnitLists(dividents, copyDividents1, copyDividers1, allowEquivalents);\r
+\r
+ ArrayList<String> copyDividers2 = new ArrayList<String>(other.dividers);\r
+ ArrayList<String> copyDividents2 = new ArrayList<String>(other.dividents); \r
+ reduceUnitLists(other.dividents, copyDividents2, copyDividers2, allowEquivalents);\r
+\r
+ if(copyDividents1.size() != copyDividents2.size())\r
+ return false;\r
+ if(copyDividers1.size() != copyDividers2.size())\r
+ return false;\r
+ \r
+ if (allowEquivalents) {\r
+ // Replace and sort all once again.\r
+ for(int i = 0; i < copyDividents1.size(); i++) {\r
+ copyDividents1.set(i, getDefaultForm(copyDividents1.get(i)));\r
+ copyDividents2.set(i, getDefaultForm(copyDividents2.get(i)));\r
+ Collections.sort(copyDividents1);\r
+ Collections.sort(copyDividents2);\r
+ }\r
+ for(int i = 0; i < copyDividers1.size(); i++) {\r
+ copyDividers1.set(i, getDefaultForm(copyDividers1.get(i)));\r
+ copyDividers2.set(i, getDefaultForm(copyDividers2.get(i)));\r
+ Collections.sort(copyDividers1);\r
+ Collections.sort(copyDividers2);\r
+ }\r
+ }\r
+ \r
+ for(int i = 0; i < copyDividents1.size(); i++) {\r
+ String a = copyDividents1.get(i);\r
+ String b = copyDividents2.get(i);\r
+ if(!a.equals(b)) {\r
+ return false;\r
+ }\r
+ }\r
+ for(int i = 0; i < copyDividers1.size(); i++) {\r
+ String a = copyDividers1.get(i);\r
+ String b = copyDividers2.get(i);\r
+ if(!a.equals(b)) {\r
+ return false;\r
+ }\r
+ }\r
+ \r
+ return true;\r
+ }\r
+ \r
+ /**\r
+ * Get the default form of a unit (e.g. dollars -> $).\r
+ * @param unit\r
+ * @return default form of unit\r
+ */\r
+ private String getDefaultForm(String unit) {\r
+ for (Equivalent e : EQUIVALENTS)\r
+ if (e.contains(unit))\r
+ return e.getDefault();\r
+ return unit;\r
+ }\r
+\r
+ public void reduceUnitLists(\r
+ ArrayList<String> originalDividents, \r
+ ArrayList<String> copyDividents,\r
+ ArrayList<String> copyDividers,\r
+ boolean allowEquivalents) {\r
+ if (allowEquivalents) {\r
+ // Replace equivalents\r
+ for(int i = 0; i < originalDividents.size(); i++) {\r
+ copyDividents.set(i, getDefaultForm(copyDividents.get(i)));\r
+ }\r
+ for(int i = 0; i < copyDividers.size(); i++) {\r
+ copyDividers.set(i, getDefaultForm(copyDividers.get(i)));\r
+ }\r
+ }\r
+ \r
+ for(String s : originalDividents) {\r
+ String equiv = allowEquivalents ? getDefaultForm(s) : s;\r
+ if(copyDividers.contains(equiv)) {\r
+ copyDividers.remove(equiv);\r
+ copyDividents.remove(equiv);\r
+ }\r
+ }\r
+ \r
+ if(copyDividents.isEmpty())\r
+ copyDividents.add("1");\r
+ }\r
+\r
+ public UnitType getUnitType() {\r
+ return unitType;\r
+ }\r
+\r
+ public void setUnitType(UnitType unitType) {\r
+ this.unitType = unitType;\r
+ }\r
+ \r
+ @Override\r
+ public String toString() {\r
+ return getCleanFullUnit();\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013-2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ * VTT Technical Research Centre of Finland\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.unitParser.nodes;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.sysdyn.utils.Function;\r
+\r
+/**\r
+ * See UnitCheckingNodeFactory for mapping\r
+ * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class Value extends UnitCheckingNode {\r
+\r
+ public Value(int id) {\r
+ super(id);\r
+ }\r
+\r
+ @Override\r
+ public UnitResult getUnits(HashMap<String, String> units, ArrayList<Function> functions, boolean allowEquivalents) throws UnitCheckingException {\r
+ UnitResult result = super.getUnits(units, functions, allowEquivalents);\r
+ result.setUnitType(UnitType.SCALAR);\r
+ return result;\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.utils;\r
+\r
+import java.text.DateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.Comparator;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.concurrent.TimeUnit;\r
+import java.util.regex.Matcher;\r
+import java.util.regex.Pattern;\r
+\r
+import org.eclipse.core.runtime.NullProgressMonitor;\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.util.Base64;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.BinaryRead;\r
+import org.simantics.db.common.request.ObjectsWithSupertype;\r
+import org.simantics.db.common.request.UniqueRead;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.exception.MissingVariableException;\r
+import org.simantics.db.layer0.util.EvaluatingListener;\r
+import org.simantics.db.layer0.util.EvaluatingListener.Criterion;\r
+import org.simantics.db.layer0.util.EvaluatingListener.Evaluation;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.scl.runtime.function.FunctionImpl1;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.adapter.ValueIndexVariable;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.manager.SysdynModelManager;\r
+import org.simantics.sysdyn.representation.Book;\r
+import org.simantics.sysdyn.representation.Enumeration;\r
+import org.simantics.sysdyn.representation.IElement;\r
+import org.simantics.sysdyn.representation.IndependentVariable;\r
+import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.Shadow;\r
+import org.simantics.sysdyn.representation.Stock;\r
+import org.simantics.sysdyn.representation.Variability;\r
+import org.simantics.sysdyn.representation.Variable;\r
+import org.simantics.sysdyn.utils.imports.ImportUtils;\r
+import org.simantics.utils.DataContainer;\r
+import org.simantics.utils.datastructures.Pair;\r
+\r
+public class DocumentationUtils {\r
+ \r
+ public static List<Resource> getModules(ReadGraph graph, org.simantics.db.layer0.variable.Variable model) throws DatabaseException {\r
+ if(model == null)\r
+ return Collections.emptyList();\r
+ \r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ Resource modelResource = model.getRepresents(graph);\r
+ \r
+ ArrayList<Resource> result = new ArrayList<Resource>();\r
+ \r
+ if(graph.isInstanceOf(modelResource, SR.SysdynModel)) {\r
+ result.add(modelResource);\r
+ result.addAll(graph.syncRequest(new ObjectsWithSupertype(modelResource, Layer0.getInstance(graph).ConsistsOf, SR.Module))); \r
+ }\r
+ \r
+ return result;\r
+ }\r
+ \r
+ public static List<org.simantics.db.layer0.variable.Variable> getExperimentVariables(ReadGraph graph, org.simantics.db.layer0.variable.Variable model) throws DatabaseException {\r
+ if(model == null)\r
+ return Collections.emptyList();\r
+ \r
+ ModelingResources MR = ModelingResources.getInstance(graph);\r
+ if (model == null || !graph.isInstanceOf(model.getRepresents(graph), MR.StructuralModel)) {\r
+ return Collections.emptyList();\r
+ }\r
+\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+ ArrayList<org.simantics.db.layer0.variable.Variable> result = new ArrayList<org.simantics.db.layer0.variable.Variable>();\r
+ for (Resource config : graph.getObjects(model.getRepresents(graph), L0.ConsistsOf)) {\r
+ if (graph.isInstanceOf(config, SIMU.Experiment)) {\r
+ for (Resource run : graph.getObjects(config, L0.ConsistsOf)) {\r
+ if (graph.isInstanceOf(run, SIMU.Run)) {\r
+ if (graph.hasStatement(run, SIMU.IsActive)) {\r
+ org.simantics.db.layer0.variable.Variable runVar = Variables.getPossibleVariable(graph, run);\r
+ if(runVar != null)\r
+ result.add(runVar);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ return result;\r
+ }\r
+ \r
+ public static List<org.simantics.db.layer0.variable.Variable> getRoleVariables(ReadGraph graph, org.simantics.db.layer0.variable.Variable experiment) throws DatabaseException {\r
+ if(experiment == null)\r
+ return Collections.emptyList();\r
+ \r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+ \r
+ if(graph.isInstanceOf(experiment.getRepresents(graph), SIMU.Run))\r
+ experiment = experiment.getParent(graph);\r
+\r
+ if(!graph.isInstanceOf(experiment.getRepresents(graph), SIMU.Experiment))\r
+ return Collections.emptyList();\r
+\r
+ Resource roleType = graph.getPossibleResource("http://www.semantum.fi/Simupedia-1.0/Role");\r
+ if(roleType == null)\r
+ return Collections.emptyList();\r
+ \r
+ ArrayList<org.simantics.db.layer0.variable.Variable> result = new ArrayList<org.simantics.db.layer0.variable.Variable>();\r
+ for(org.simantics.db.layer0.variable.Variable part : experiment.getChildren(graph)) {\r
+ if(graph.isInstanceOf(part.getRepresents(graph), roleType)) {\r
+ result.add(part);\r
+ }\r
+ }\r
+\r
+ return result;\r
+ }\r
+ \r
+ public static List<org.simantics.db.layer0.variable.Variable> getDocumentVariables(ReadGraph graph, org.simantics.db.layer0.variable.Variable model) throws DatabaseException {\r
+ if(model == null)\r
+ return Collections.emptyList();\r
+ \r
+ Resource documentType = graph.getPossibleResource("http://www.simantics.org/Documentation-1.2/Document");\r
+ if(documentType == null)\r
+ return Collections.emptyList();\r
+ \r
+ ArrayList<org.simantics.db.layer0.variable.Variable> result = new ArrayList<org.simantics.db.layer0.variable.Variable>();\r
+ for(org.simantics.db.layer0.variable.Variable part : model.getChildren(graph)) {\r
+ if(graph.isInstanceOf(part.getRepresents(graph), documentType)) {\r
+ result.add(part);\r
+ }\r
+ }\r
+\r
+ return result;\r
+ }\r
+ \r
+ public static List<org.simantics.db.layer0.variable.Variable> getResultVariables(ReadGraph graph, org.simantics.db.layer0.variable.Variable model) throws DatabaseException {\r
+ if(model == null)\r
+ return Collections.emptyList();\r
+ \r
+ org.simantics.db.layer0.variable.Variable library = model.getPossibleChild(graph, "PDFLibrary");\r
+ if(library == null)\r
+ return Collections.emptyList();\r
+ \r
+ \r
+ return new ArrayList<org.simantics.db.layer0.variable.Variable>(library.getChildren(graph));\r
+ }\r
+ \r
+ public static List<org.simantics.db.layer0.variable.Variable> getIndexDocuments(ReadGraph graph, org.simantics.db.layer0.variable.Variable project) throws DatabaseException {\r
+ Resource indexRelation = graph.getPossibleResource("http://www.semantum.fi/Simupedia-1.0/indexDocument");\r
+\r
+ if(indexRelation == null)\r
+ return Collections.emptyList();\r
+ \r
+ ArrayList<org.simantics.db.layer0.variable.Variable> result = new ArrayList<org.simantics.db.layer0.variable.Variable>();\r
+ for(org.simantics.db.layer0.variable.Variable model : project.getChildren(graph)) {\r
+ Resource modelResource = model.getRepresents(graph);\r
+ if(modelResource == null)\r
+ continue;\r
+ \r
+ Resource indexDocumentResource = graph.getPossibleObject(modelResource, indexRelation);\r
+ if(indexDocumentResource != null) {\r
+ org.simantics.db.layer0.variable.Variable indexDoc = Variables.getVariable(graph, indexDocumentResource);\r
+ result.add(indexDoc);\r
+ } \r
+ }\r
+ return result;\r
+ }\r
+ \r
+ public static Resource getConfiguration(ReadGraph graph, Resource module) throws DatabaseException {\r
+ if(module == null)\r
+ return null;\r
+ \r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ \r
+ if(graph.isInstanceOf(module, SR.SysdynModel)) {\r
+ return graph.getSingleObject(module, SimulationResource.getInstance(graph).HasConfiguration);\r
+ } else if(graph.isInheritedFrom(module, SR.Module)) {\r
+ return graph.getSingleObject(module, StructuralResource2.getInstance(graph).IsDefinedBy);\r
+ } else {\r
+ return null;\r
+ }\r
+ }\r
+ \r
+ public static List<Resource> getConfigurationVariables(ReadGraph graph, Resource configuration) throws DatabaseException {\r
+ if(configuration == null)\r
+ return Collections.emptyList();\r
+ \r
+ SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r
+ SysdynModel sm = smm.getModel(graph, configuration);\r
+ \r
+ ArrayList<IElement> elements = new ArrayList<IElement>();\r
+\r
+ for(IElement element : sm.getConfiguration().getElements()) {\r
+ if((element instanceof Variable || element instanceof Module) && !(element instanceof Book) && !(element instanceof Shadow)) {\r
+ elements.add(element);\r
+ }\r
+ }\r
+ \r
+ Collections.sort(elements, new Comparator<IElement>() {\r
+\r
+ @Override\r
+ public int compare(IElement o1, IElement o2) {\r
+ if(!isApplied(o1) || !isApplied(o2))\r
+ return 0;\r
+ else {\r
+ String name1 = getName(o1);\r
+ String name2 = getName(o2);\r
+ return name1.compareTo(name2);\r
+ }\r
+ }\r
+ \r
+ private boolean isApplied(IElement element) {\r
+ if((element instanceof Variable || element instanceof Module) && !(element instanceof Book)) {\r
+ return true;\r
+ } else {\r
+ return false;\r
+ }\r
+\r
+ }\r
+ \r
+ private String getName(IElement element) {\r
+ if(element instanceof Variable)\r
+ return ((Variable)element).getName();\r
+ else if(element instanceof Module)\r
+ return ((Module)element).getName();\r
+ else\r
+ return "";\r
+ }\r
+ \r
+ });\r
+ \r
+ ArrayList<Resource> result = new ArrayList<Resource>();\r
+ for(IElement e : elements)\r
+ result.add(sm.getMapping().inverseGet(e));\r
+ \r
+ return result;\r
+ }\r
+ \r
+ public static String getName(ReadGraph graph, Resource variable) throws DatabaseException {\r
+ if(variable == null)\r
+ return null;\r
+ \r
+ SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r
+ Resource configuration = graph.syncRequest(new GetConfigurationRequest(variable));\r
+ SysdynModel sm = smm.getModel(graph,configuration);\r
+ \r
+ IElement element = sm.getElement(variable);\r
+ \r
+ if(element instanceof Variable) {\r
+ Variable v = (Variable) element;\r
+ \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append(v.getModelicaName());\r
+ \r
+ \r
+ if(v.getArrayIndexes() != null && v.getArrayIndexes().size() > 0) {\r
+ sb.append("[");\r
+ boolean first = true;\r
+ for(Enumeration e : v.getArrayIndexes()) {\r
+ if(!first)\r
+ sb.append(", ");\r
+ first = false;\r
+ sb.append(e.getModelicaName());\r
+ }\r
+ \r
+ sb.append("]");\r
+ }\r
+ \r
+ return sb.toString();\r
+ } \r
+ \r
+ if(element instanceof Module) {\r
+ Module m = (Module) element;\r
+ return m.getName();\r
+ }\r
+ \r
+ return "";\r
+ }\r
+ \r
+ public static String getType(ReadGraph graph, Resource variable) throws DatabaseException {\r
+ if(variable == null)\r
+ return null;\r
+ \r
+ SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r
+ Resource configuration = graph.syncRequest(new GetConfigurationRequest(variable));\r
+ SysdynModel sm = smm.getModel(graph,configuration);\r
+ \r
+ IElement element = sm.getElement(variable);\r
+ \r
+ if(element instanceof Variable) {\r
+ String result = ((Variable)element).getType();\r
+ if(result == null)\r
+ return "";\r
+ else\r
+ return element.getClass().getSimpleName() + " " + result;\r
+ }\r
+ \r
+ if(element instanceof Module) {\r
+ Module m = (Module) element;\r
+ return"Module " + m.getType().getName();\r
+ }\r
+ \r
+ return "";\r
+ }\r
+ \r
+ public static String getUnit(ReadGraph graph, Resource variable) throws DatabaseException {\r
+ if(variable == null)\r
+ return null;\r
+ \r
+ SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r
+ Resource configuration = graph.syncRequest(new GetConfigurationRequest(variable));\r
+ SysdynModel sm = smm.getModel(graph,configuration);\r
+ \r
+ IElement element = sm.getElement(variable);\r
+ \r
+ if(element instanceof Variable) {\r
+ String result = ((Variable)element).getUnit();\r
+ if(result == null)\r
+ return "";\r
+ else\r
+ return result;\r
+ }\r
+ \r
+ return "";\r
+ }\r
+ \r
+ \r
+ public static String getVariability(ReadGraph graph, Resource variable) throws DatabaseException {\r
+ if(variable == null)\r
+ return null;\r
+ \r
+ SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r
+ Resource configuration = graph.syncRequest(new GetConfigurationRequest(variable));\r
+ SysdynModel sm = smm.getModel(graph,configuration);\r
+ \r
+ IElement element = sm.getElement(variable);\r
+ \r
+ if(element instanceof Stock)\r
+ return "";\r
+ \r
+ if(element instanceof IndependentVariable) {\r
+ Variability variability = Variability.getVariability((IndependentVariable)element);\r
+ if(variability == Variability.CONTINUOUS)\r
+ return "";\r
+ return variability.toString().toLowerCase();\r
+ }\r
+ if(element instanceof Variable) {\r
+ String result = ((Variable)element).getVariability();\r
+ if(result == null)\r
+ return "";\r
+ else {\r
+ return result;\r
+ }\r
+ }\r
+ \r
+ return "";\r
+ }\r
+ \r
+ public static String getDescription(ReadGraph graph, Resource variable) throws DatabaseException {\r
+ if(variable == null)\r
+ return null;\r
+ \r
+ SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r
+ Resource configuration = graph.syncRequest(new GetConfigurationRequest(variable));\r
+ SysdynModel sm = smm.getModel(graph,configuration);\r
+ \r
+ IElement element = sm.getElement(variable);\r
+ \r
+ if(element instanceof Variable) {\r
+ String result = ((Variable)element).getDescription();\r
+ if(result == null)\r
+ return "";\r
+ else\r
+ return result;\r
+ }\r
+ \r
+ return "";\r
+ }\r
+ \r
+ \r
+ public static String getDocumentationDefinition(ReadGraph graph, Resource variable) throws DatabaseException {\r
+ if(variable == null)\r
+ return null;\r
+\r
+ SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r
+ Resource configuration = graph.syncRequest(new GetConfigurationRequest(variable));\r
+ SysdynModel sm = smm.getModel(graph,configuration);\r
+ \r
+ IElement element = sm.getElement(variable);\r
+ \r
+ if(element instanceof Variable) {\r
+ Variable v = (Variable) element;\r
+ String result = v.getDocumentationDefinition(graph);\r
+ if(result == null)\r
+ return "";\r
+ else\r
+ return result;\r
+ }\r
+ \r
+ if(element instanceof Module) {\r
+ Module m = (Module) element;\r
+ return m.getDocumentationDefinition();\r
+ // Print interface variables and parameter overrides\r
+ }\r
+ \r
+ return "";\r
+ \r
+ }\r
+ \r
+ \r
+ public static int numberOfVariables(ReadGraph graph, Resource configuration, boolean recursive) throws DatabaseException {\r
+ return graph.syncRequest(new ModuleSummaryRequest(configuration, recursive)).getVariables();\r
+ }\r
+ \r
+ public static int totalNumberOfVariables(ReadGraph graph, Resource configuration, boolean recursive) throws DatabaseException {\r
+ return graph.syncRequest(new ModuleSummaryRequest(configuration, recursive)).getTotalVariables();\r
+ } \r
+ \r
+ public static int numberOfStocks(ReadGraph graph, Resource configuration, boolean recursive) throws DatabaseException {\r
+ return graph.syncRequest(new ModuleSummaryRequest(configuration, recursive)).getStocks();\r
+ }\r
+ \r
+ public static int numberOfValves(ReadGraph graph, Resource configuration, boolean recursive) throws DatabaseException {\r
+ return graph.syncRequest(new ModuleSummaryRequest(configuration, recursive)).getValves();\r
+ }\r
+ \r
+ public static int numberOfInputs(ReadGraph graph, Resource configuration, boolean recursive) throws DatabaseException {\r
+ return graph.syncRequest(new ModuleSummaryRequest(configuration, recursive)).getInputs();\r
+ }\r
+ \r
+ public static int numberOfShadows(ReadGraph graph, Resource configuration, boolean recursive) throws DatabaseException {\r
+ return graph.syncRequest(new ModuleSummaryRequest(configuration, recursive)).getShadows();\r
+ }\r
+\r
+ public static int numberOfAuxiliaries(ReadGraph graph, Resource configuration, boolean recursive) throws DatabaseException {\r
+ return graph.syncRequest(new ModuleSummaryRequest(configuration, recursive)).getAuxiliaries();\r
+ }\r
+ \r
+ public static int numberOfModules(ReadGraph graph, Resource configuration, boolean recursive) throws DatabaseException {\r
+ return graph.syncRequest(new ModuleSummaryRequest(configuration, recursive)).getModules();\r
+ }\r
+ \r
+ public static int numberOfSheets(ReadGraph graph, Resource configuration, boolean recursive) throws DatabaseException {\r
+ return graph.syncRequest(new ModuleSummaryRequest(configuration, recursive)).getSheets();\r
+ }\r
+ \r
+ public static int numberOfModuleTypes(ReadGraph graph, org.simantics.db.layer0.variable.Variable model) throws DatabaseException {\r
+ if(model == null)\r
+ return 0;\r
+ \r
+ Resource modelResource = model.getRepresents(graph);\r
+ return graph.syncRequest(new ObjectsWithSupertype(\r
+ modelResource, \r
+ Layer0.getInstance(graph).ConsistsOf, \r
+ SysdynResource.getInstance(graph).Module))\r
+ .size();\r
+ }\r
+ \r
+ public static String base64Encode(ReadGraph graph, org.simantics.db.layer0.variable.Variable variable, String property) throws DatabaseException {\r
+ byte[] fileBArray = variable.getPossiblePropertyValue(graph, property, Bindings.BYTE_ARRAY);\r
+ if(fileBArray != null)\r
+ return Base64.encode(fileBArray);\r
+ else\r
+ return "";\r
+ }\r
+ \r
+ public static String formatDate(long timeMillis) {\r
+ Date date = new Date(timeMillis);\r
+ String result = DateFormat.getDateInstance().format(date);\r
+ return result;\r
+ }\r
+ \r
+ /**\r
+ * Supports importing Sysdyn models into the current project from TG files\r
+ * in SCL.\r
+ * \r
+ * @param path\r
+ */\r
+ public static Resource importModel(String path) {\r
+ final DataContainer<Resource> m = new DataContainer<Resource>();\r
+ try {\r
+ ImportUtils.importModelFile(path, new NullProgressMonitor(), new FunctionImpl1<Resource,WriteRequest>() {\r
+\r
+ @Override\r
+ public WriteRequest apply(Resource model) {\r
+ m.set(model);\r
+ return null;\r
+ }\r
+ \r
+ });\r
+ } catch (Exception e) {\r
+ e.printStackTrace();\r
+ }\r
+ return m.get();\r
+ }\r
+\r
+ public static boolean isParameter(ReadGraph graph, org.simantics.db.layer0.variable.Variable variable) throws DatabaseException {\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ Resource represents = variable.getPossibleRepresents(graph);\r
+ System.out.println(graph.getURI(represents));\r
+ if(represents == null || !graph.isInstanceOf(represents, SR.IndependentVariable))\r
+ return false;\r
+ \r
+ Resource expressionList = graph.getPossibleObject(represents, SR.Variable_expressionList);\r
+ \r
+ if(expressionList == null)\r
+ return false;\r
+ \r
+ List<Resource> expressions = ListUtils.toList(graph, expressionList);\r
+ if(expressions == null || expressions.size() != 1)\r
+ return false;\r
+ \r
+ Resource expression = expressions.get(0);\r
+ return graph.isInstanceOf(expression, SR.ParameterExpression);\r
+ }\r
+ \r
+ public static double lastValue(final Resource experiment, final String runId, final String path) throws DatabaseException {\r
+ \r
+ try {\r
+ double[] values = EvaluatingListener.<double[]>trySyncRequest(Simantics.getSession(),\r
+ \r
+ new UniqueRead<double[]>(){\r
+ @Override\r
+ public double[] perform(ReadGraph graph) throws DatabaseException{\r
+ \r
+ org.simantics.db.layer0.variable.Variable var = Variables.getVariable(graph, experiment);\r
+ if(var == null) return null;\r
+ org.simantics.db.layer0.variable.Variable run = var.getPossibleChild(graph, runId);\r
+ if(run == null) return null;\r
+ org.simantics.db.layer0.variable.Variable v = run.browsePossible(graph, path + "#value#");\r
+ if(v == null) return null;\r
+ return v.getPossibleValue(graph);\r
+ \r
+ } \r
+ }, \r
+ new Criterion<double[]>() {\r
+\r
+ @Override\r
+ public Evaluation evaluate(double[] result) {\r
+ if(result == null) return Evaluation.DISCARD;\r
+ return (result != ValueIndexVariable.UNRESOLVED) ? Evaluation.ACCEPT : Evaluation.IGNORE;\r
+ }\r
+ \r
+ },\r
+ 15, TimeUnit.SECONDS);\r
+ return values[0];\r
+ } catch (InterruptedException e) {\r
+ e.printStackTrace();\r
+ return Double.NaN;\r
+ }\r
+ \r
+ }\r
+\r
+ public static org.simantics.db.layer0.variable.Variable lastValue2(ReadGraph graph, org.simantics.db.layer0.variable.Variable input, String path) throws DatabaseException {\r
+ \r
+ if(input == null) return null;\r
+ \r
+ org.simantics.db.layer0.variable.Variable context = Variables.getPossibleContext(graph, input);\r
+ if(context == null) {\r
+ context = Variables.getConfigurationContext(graph, input);\r
+ if(context == null) return null;\r
+ }\r
+\r
+ org.simantics.db.layer0.variable.Variable v = context.browsePossible(graph, "/" + path);\r
+ if(v == null) return null;\r
+\r
+ org.simantics.db.layer0.variable.Variable p = v.browsePossible(graph, "#value#$0");\r
+ if(p == null) return null;\r
+ \r
+ return p;\r
+ \r
+ }\r
+\r
+ public static org.simantics.db.layer0.variable.Variable currentValue(ReadGraph graph, org.simantics.db.layer0.variable.Variable input, String path) throws DatabaseException {\r
+ \r
+ if(input == null) return null;\r
+ \r
+ org.simantics.db.layer0.variable.Variable context = Variables.getPossibleContext(graph, input);\r
+ if(context == null) {\r
+ context = Variables.getConfigurationContext(graph, input);\r
+ if(context == null) return null;\r
+ }\r
+\r
+ org.simantics.db.layer0.variable.Variable v = context.browsePossible(graph, "/" + path);\r
+ if(v == null) return null;\r
+\r
+ org.simantics.db.layer0.variable.Variable p = v.browsePossible(graph, "#value#$0");\r
+ if(p == null) return null;\r
+ \r
+ return p;\r
+ \r
+ }\r
+ \r
+ /**\r
+ * Splits indexed variable reference into name and indices part.\r
+ * \r
+ * @param path\r
+ */\r
+ public static Pair<String, String> splitToNameAndIndices(String reference) {\r
+ final Pattern indexPattern = Pattern.compile("^([^\\[]*)\\[([^\\]]*)]$");\r
+ Matcher m = indexPattern.matcher(reference);\r
+ \r
+ if (m.matches()) {\r
+ String name = m.group(1);\r
+ String indices = m.group(2).trim().replaceAll("\\s*,\\s*", ",");\r
+ return Pair.make(name, indices);\r
+ } else {\r
+ return Pair.make(reference, "");\r
+ }\r
+\r
+ }\r
+ \r
+ public static class LastValueIndexed extends BinaryRead<Resource, String, org.simantics.db.layer0.variable.Variable> {\r
+\r
+ public LastValueIndexed(Resource resource, String path) {\r
+ super(resource, path);\r
+ }\r
+\r
+ @Override\r
+ public org.simantics.db.layer0.variable.Variable perform(ReadGraph graph) throws DatabaseException {\r
+ \r
+ org.simantics.db.layer0.variable.Variable run = Variables.getVariable(graph, parameter);\r
+ Pair<String, String> nameAndIndices = splitToNameAndIndices(parameter2);\r
+ org.simantics.db.layer0.variable.Variable v = run.browsePossible(graph, "/" + nameAndIndices.first + "#value#" + nameAndIndices.second);\r
+ if(v == null) throw new MissingVariableException("No variable for SysDyn reference path: " + parameter2);\r
+ return v;\r
+ }\r
+ }\r
+ \r
+ \r
+ public static org.simantics.db.layer0.variable.Variable lastValueIndexed(ReadGraph graph, org.simantics.db.layer0.variable.Variable run, String path) throws DatabaseException {\r
+ if(run == null) return null;\r
+ return graph.syncRequest(new LastValueIndexed(run.getRepresents(graph), path));\r
+ } \r
+ \r
+ public static org.simantics.db.layer0.variable.Variable equation(ReadGraph graph, org.simantics.db.layer0.variable.Variable input, String path) throws DatabaseException {\r
+\r
+ if(input == null) return null;\r
+ \r
+ org.simantics.db.layer0.variable.Variable context = Variables.getPossibleContext(graph, input);\r
+ if(context == null) {\r
+ context = Variables.getConfigurationContext(graph, input);\r
+ if(context == null) return null;\r
+ }\r
+ \r
+ org.simantics.db.layer0.variable.Variable v = context.browsePossible(graph, "/" + path);\r
+ if(v == null) return null;\r
+\r
+ org.simantics.db.layer0.variable.Variable p = v.browsePossible(graph, "#equation");\r
+ if(p == null) return null;\r
+ \r
+ return p;\r
+ \r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.simantics.sysdyn.utils;\r
+\r
+import java.io.StringReader;\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.HashMap;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.unitParser.ParseException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingException;\r
+import org.simantics.sysdyn.unitParser.UnitCheckingNode;\r
+import org.simantics.sysdyn.unitParser.UnitParser;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult;\r
+import org.simantics.sysdyn.unitParser.nodes.UnitResult.UnitType;\r
+import org.simantics.ui.SimanticsUI;\r
+import org.simantics.utils.datastructures.Pair;\r
+\r
+\r
+/**\r
+ * Class to store function name, type, and parameters. \r
+ * \r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class Function implements Comparable<Function>{\r
+\r
+ private final String name;\r
+ private final Type type;\r
+ private final ArrayList<Input> inputList;\r
+ private final ArrayList<Output> outputList;\r
+ private final String description;\r
+ \r
+ public static class Parameter {\r
+ public static final String ANY = "ANY";\r
+ public static final String TIME = "TIME";\r
+ public String name;\r
+ public String unit = ANY;\r
+ \r
+ public UnitResult getUnitResult(\r
+ HashMap<String, String> units, \r
+ Function f,\r
+ ArrayList<Function> functions,\r
+ boolean allowEquivalents,\r
+ HashMap<String, String> correspondences) throws UnitCheckingException {\r
+ \r
+ UnitResult result = new UnitResult(allowEquivalents);\r
+ if (Parameter.ANY.equals(this.unit)) {\r
+ result.setUnitType(UnitType.ANY);\r
+ } else if ("1".equals(this.unit)) { // TODO: see if this should be changed to something else\r
+ result.setUnitType(UnitType.SCALAR);\r
+ } else {\r
+ // Replace TIME with actual time unit.\r
+ String timeUnit = units.get("time");\r
+ String timeReplaced = this.unit.replace(Parameter.TIME, timeUnit);\r
+\r
+ // Replace 'p, 'q, etc. in output with units from actual inputs.\r
+ String correspondencesReplaced = replaceCorrespondences(f, timeReplaced, correspondences);\r
+\r
+ try {\r
+ StringReader outputReader = new StringReader(correspondencesReplaced);\r
+ UnitParser outputParser = new UnitParser(outputReader);\r
+ UnitCheckingNode output;\r
+ output = (UnitCheckingNode) outputParser.expr();\r
+ outputReader.close();\r
+ result.appendResult(output.getUnits(null, functions, allowEquivalents));\r
+ } catch (UnitCheckingException e) {\r
+ e.printStackTrace();\r
+ } catch (ParseException e) {\r
+ throw new UnitCheckingException("Cannot validate units: Syntax error in expression.");\r
+ }\r
+ }\r
+ \r
+ return result;\r
+ }\r
+ \r
+ private static String replaceCorrespondences(Function f, String original,\r
+ HashMap<String, String> correspondences) throws UnitCheckingException {\r
+ int index;\r
+ String ret = new String(original);\r
+ // Go through the unit as long as there are part of form 'p, 'q, etc. and replace them.\r
+ while ((index = ret.indexOf('\'')) >= 0) {\r
+ String replaced = ret.substring(index, index + 2); // The replaced units are always of length 2.\r
+ try {\r
+ ret = ret.replace(replaced, "(" + correspondences.get(replaced) + ")");\r
+ } catch (NullPointerException npe) {\r
+ throw new UnitCheckingException("Function " + f.getName() + " output unit could not be determined. Replacement unit " \r
+ + replaced + " not found in input unit definitions.");\r
+ }\r
+ }\r
+ return ret;\r
+ }\r
+ }\r
+\r
+ public static class Input extends Parameter {\r
+ public boolean variableLength = false;\r
+ public boolean optional = false;\r
+ public ArrayList<String> variableLengthLabels;\r
+ }\r
+ \r
+ public static class Output extends Parameter {\r
+ }\r
+ \r
+ public enum Type {\r
+ USER_DEFINED,\r
+ SHARED,\r
+ SYSDYN,\r
+ MODELICA, \r
+ MODELICA_ARRAY,\r
+ VENSIM\r
+ }\r
+ \r
+ public Function(\r
+ String name, \r
+ ArrayList<Input> inputList, \r
+ ArrayList<Output> outputList, \r
+ Type type, \r
+ String description){\r
+ \r
+ this.name = new String(name);\r
+ \r
+ this.type = type;\r
+ \r
+ if (inputList != null)\r
+ this.inputList = inputList;\r
+ else\r
+ this.inputList = new ArrayList<Input>();\r
+ \r
+ if (outputList != null)\r
+ this.outputList = outputList;\r
+ else\r
+ this.outputList = new ArrayList<Output>();\r
+ \r
+ if (description != null)\r
+ this.description = new String(description);\r
+ else\r
+ this.description = null;\r
+ }\r
+ \r
+ /**\r
+ * Convert list of Inputs to string\r
+ * @param inputList list of Inputs\r
+ * @return printable form of inputs (for function declaration)\r
+ */\r
+ public static String inputListToString(ArrayList<Input> inputList) {\r
+ String inputStr = null;\r
+ for (Input p : inputList) {\r
+ String pName;\r
+ // Variable length parameter list\r
+ if (p.variableLength) {\r
+ pName = "";\r
+ for (String label : p.variableLengthLabels) {\r
+ pName += label + ", ";\r
+ }\r
+ pName += "...";\r
+ } else {\r
+ pName = p.name;\r
+ }\r
+ \r
+ if (inputStr == null)\r
+ inputStr = new String(pName);\r
+ else\r
+ inputStr += ", " + pName;\r
+ }\r
+ return inputStr;\r
+ }\r
+ \r
+ public ArrayList<Input> getInputList() {\r
+ return inputList;\r
+ }\r
+ \r
+ public ArrayList<Output> getOutputList() {\r
+ return outputList;\r
+ }\r
+ \r
+ public String getName() {\r
+ return name;\r
+ }\r
+ \r
+ public Type getType() {\r
+ return type;\r
+ }\r
+ \r
+ public String getDescription() {\r
+ return description;\r
+ }\r
+ \r
+ @Override\r
+ public int compareTo(Function f) {\r
+ // Sorting is done first in the order of Types and then alphabetically.\r
+ int typeCompare = type.compareTo(f.getType());\r
+ return typeCompare != 0 ? typeCompare : name.compareTo(f.getName());\r
+ }\r
+ \r
+ /**\r
+ * Get Modelica function input parameters\r
+ * @param graph\r
+ * @param sr \r
+ * @param r Resource of the Modelica function\r
+ * @return ArrayList of Inputs\r
+ * @throws DatabaseException\r
+ */\r
+ public static ArrayList<Input> getFunctionInputs(ReadGraph graph, SysdynResource sr, Resource r) throws DatabaseException {\r
+ Resource inputs = graph.getPossibleObject(r, sr.SysdynModelicaFunction_inputs);\r
+ ArrayList<Input> inputParameters = new ArrayList<Input>();\r
+ if (inputs != null) {\r
+ for (Resource input : ListUtils.toList(graph, inputs)) {\r
+ // Convert the Resource into Parameter;\r
+ Input inputParameter = new Input();\r
+ inputParameter.name = NameUtils.getSafeName(graph, input);\r
+ inputParameter.optional = graph.getPossibleRelatedValue(\r
+ input, \r
+ sr.SysdynModelicaFunction_optional, \r
+ Bindings.BOOLEAN);\r
+ inputParameter.unit = graph.getPossibleRelatedValue(\r
+ input, \r
+ sr.SysdynModelicaFunction_unit, \r
+ Bindings.STRING);\r
+ if (graph.isInstanceOf(input, sr.SysdynModelicaFunction_VariableLengthInput)) {\r
+ inputParameter.variableLength = true;\r
+ Resource shownLabels = graph.getPossibleObject(\r
+ input, \r
+ sr.SysdynModelicaFunction_VariableLengthInput_shownLabels);\r
+ inputParameter.variableLengthLabels = new ArrayList<String>();\r
+ if (shownLabels != null) {\r
+ for (Resource label : ListUtils.toList(graph, shownLabels)) {\r
+ inputParameter.variableLengthLabels.add(NameUtils.getSafeName(graph, label));\r
+ }\r
+ }\r
+ }\r
+ \r
+ inputParameters.add(inputParameter);\r
+ }\r
+ }\r
+ return inputParameters;\r
+ }\r
+ \r
+ /**\r
+ * Get Modelica function outputs\r
+ * @param graph\r
+ * @param sr \r
+ * @param r Resource of the Modelica function\r
+ * @return ArrayList of Outputs\r
+ * @throws DatabaseException\r
+ */\r
+ protected static ArrayList<Output> getFunctionOutputs(ReadGraph graph,\r
+ SysdynResource sr, Resource r) throws DatabaseException {\r
+ Resource outputs = graph.getPossibleObject(r, sr.SysdynModelicaFunction_outputs);\r
+ ArrayList<Output> outputParameters = new ArrayList<Output>(1);\r
+ if (outputs != null) {\r
+ for (Resource output : ListUtils.toList(graph, outputs)) {\r
+ // Convert the Resource into Parameter;\r
+ Output outputParameter = new Output();\r
+ outputParameter.name = NameUtils.getSafeName(graph, output);\r
+ outputParameter.unit = graph.getPossibleRelatedValue(\r
+ output, \r
+ sr.SysdynModelicaFunction_unit, \r
+ Bindings.STRING);\r
+ outputParameters.add(outputParameter);\r
+ }\r
+ }\r
+ return outputParameters;\r
+ }\r
+\r
+ public static String getFunctionDescription(ReadGraph graph, Resource r) throws DatabaseException {\r
+ String descriptionStr = null;\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ Resource description = graph.getPossibleObject(r, l0.HasDescription);\r
+ if (description != null) {\r
+ descriptionStr = graph.getPossibleRelatedValue(r, l0.HasDescription, Bindings.STRING);\r
+ }\r
+ \r
+ return descriptionStr;\r
+ }\r
+ \r
+ private static ArrayList<Function> getFunctionsOfType(ReadGraph graph, String functionTypeUri, Type functionType) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ ArrayList<Function> functions = new ArrayList<Function>();\r
+ \r
+ // Add functions\r
+ Resource functionLibrary = graph.getPossibleResource(functionTypeUri);\r
+ for(Resource r : graph.syncRequest(new ObjectsWithType(functionLibrary, l0.ConsistsOf, sr.SysdynModelicaFunction))) {\r
+ String name = NameUtils.getSafeName(graph, r);\r
+ ArrayList<Input> inputs = getFunctionInputs(graph, sr, r);\r
+ ArrayList<Output> outputs = getFunctionOutputs(graph, sr, r);\r
+ String description = getFunctionDescription(graph, r);\r
+ functions.add(new Function(name, inputs, outputs, functionType, description));\r
+ }\r
+ return functions;\r
+ }\r
+ \r
+ /**\r
+ * Get all built-in Modelica functions.\r
+ * Should be used if called inside a transaction\r
+ * @return ArrayList containing all built-in functions.\r
+ */\r
+ public static ArrayList<Function> getAllBuiltInFunctions(ReadGraph graph) throws DatabaseException {\r
+ ArrayList<Function> functions = new ArrayList<Function>();\r
+ \r
+ // Add different types of functions.\r
+ functions.addAll(getFunctionsOfType(graph, SysdynResource.URIs.Built$in_Functions, Type.SYSDYN));\r
+ functions.addAll(getFunctionsOfType(graph, SysdynResource.URIs.Built$in_Functions_Vensim_Functions, Type.VENSIM));\r
+ functions.addAll(getFunctionsOfType(graph, SysdynResource.URIs.Built$in_Functions_Modelica_Functions, Type.MODELICA));\r
+ functions.addAll(getFunctionsOfType(graph, SysdynResource.URIs.Built$in_Functions_Modelica_Array_Functions, Type.MODELICA_ARRAY));\r
+ \r
+ return functions;\r
+ }\r
+ \r
+ /**\r
+ * Get all built-in Modelica functions.\r
+ * @return ArrayList containing all built-in functions.\r
+ */\r
+ public static ArrayList<Function> getAllBuiltInFunctions() {\r
+ ArrayList<Function> result = null;\r
+ \r
+ //Finding functions\r
+ try {\r
+ result = SimanticsUI.getSession().syncRequest(new Read<ArrayList<Function>>() {\r
+ @Override\r
+ public ArrayList<Function> perform(ReadGraph graph) throws DatabaseException {\r
+ return getAllBuiltInFunctions(graph);\r
+ }\r
+ });\r
+ }\r
+ catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+ return result;\r
+ }\r
+ \r
+ /**\r
+ * Get all shared Modelica functions.\r
+ * @param variable of which model is in question\r
+ * @return ArrayList containing all shared functions.\r
+ */\r
+ public static ArrayList<Function> getSharedFunctions(final Resource model) {\r
+ ArrayList<Function> functions = new ArrayList<Function>();\r
+ if (model == null) {\r
+ return functions;\r
+ }\r
+ \r
+ try {\r
+ functions = SimanticsUI.getSession().syncRequest(new Read<ArrayList<Function>>() {\r
+ \r
+ @Override\r
+ public ArrayList<Function> perform(ReadGraph graph) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ \r
+ // Full names of the collected functions\r
+ ArrayList<Function> sharedFunctions = new ArrayList<Function>();\r
+\r
+ Collection<Resource> linkedResources = graph.getObjects(model, l0.IsLinkedTo);\r
+ for (Resource r : linkedResources) {\r
+ // Find the "Shared functions" library \r
+ if (graph.isInstanceOf(r, sr.SharedFunctionOntology)) {\r
+ // Get all function resources under the Shared Functions "folder". \r
+ Collection<Resource> userFunctionResources = getFunctionsInside(graph, r);\r
+ for (Resource function : userFunctionResources) {\r
+ // Construct the Modelica name of the function\r
+ String fullName = NameUtils.getSafeName(graph, function);\r
+ Resource parent = function; // Parent is updated properly in the loop\r
+ do {\r
+ parent = graph.getPossibleObject(parent, l0.PartOf);\r
+ fullName = NameUtils.getSafeName(graph, parent) + "." + fullName;\r
+ } while (!graph.isInstanceOf(parent, l0.Ontology));\r
+ \r
+ // Create a Function object out of the Resource\r
+ Function sharedFunction = new Function(fullName, \r
+ Function.getFunctionInputs(graph, sr, function),\r
+ Function.getFunctionOutputs(graph, sr, function),\r
+ Type.SHARED, \r
+ Function.getFunctionDescription(graph, function));\r
+ sharedFunctions.add(sharedFunction);\r
+ }\r
+ }\r
+ }\r
+ return sharedFunctions;\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ return functions;\r
+ }\r
+ \r
+ /**\r
+ * Get all user defined Modelica functions.\r
+ * @param variable of which model is in question\r
+ * @return ArrayList containing all user defined functions.\r
+ */\r
+ public static ArrayList<Function> getUserDefinedFunctions(final Resource model) {\r
+ ArrayList<Function> functions = new ArrayList<Function>();\r
+ if (model == null) {\r
+ return functions;\r
+ }\r
+ \r
+ try {\r
+ functions = SimanticsUI.getSession().syncRequest(new Read<ArrayList<Function>>() {\r
+ \r
+ @Override\r
+ public ArrayList<Function> perform(ReadGraph graph) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+\r
+ // Full names of the collected functions\r
+ ArrayList<Function> userFunctions = new ArrayList<Function>();\r
+ \r
+ // Get all function resources under model recursively\r
+ Collection<Resource> userFunctionResources = getFunctionsInside(graph, model);\r
+ for (Resource function : userFunctionResources) {\r
+ // Construct the Modelica name of the function\r
+ String fullName = NameUtils.getSafeName(graph, function);\r
+ Resource parent = graph.getPossibleObject(function, l0.PartOf);\r
+ while (!graph.isInstanceOf(parent, sr.SysdynModel)) {\r
+ fullName = NameUtils.getSafeName(graph, parent) + "." + fullName;\r
+ parent = graph.getPossibleObject(parent, l0.PartOf);\r
+ }\r
+ \r
+ // Create a Function object out of the Resource\r
+ Function userFunction = new Function(fullName, \r
+ Function.getFunctionInputs(graph, sr, function),\r
+ Function.getFunctionOutputs(graph, sr, function),\r
+ Type.USER_DEFINED, \r
+ Function.getFunctionDescription(graph, function));\r
+ userFunctions.add(userFunction);\r
+ }\r
+ \r
+ return userFunctions;\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ return functions;\r
+ }\r
+ \r
+ /**\r
+ * Get functions inside a resource\r
+ * @param graph\r
+ * @param r Recource in which functions are sought\r
+ * @return found function Resources\r
+ * @throws DatabaseException\r
+ */\r
+ public static Collection<Resource> getFunctionsInside(ReadGraph graph, Resource r) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ ArrayList<Resource> functions = new ArrayList<Resource>();\r
+ functions.addAll(graph.syncRequest(new ObjectsWithType(\r
+ r, \r
+ l0.ConsistsOf, \r
+ sr.SysdynModelicaFunction)));\r
+ Collection<Resource> functionLibraries;\r
+ functionLibraries = graph.syncRequest(new ObjectsWithType(\r
+ r, \r
+ l0.ConsistsOf,\r
+ sr.SysdynModelicaFunctionLibrary));\r
+ for (Resource library : functionLibraries) {\r
+ functions.addAll(getFunctionsInside(graph, library));\r
+ }\r
+ return functions;\r
+ }\r
+ \r
+ /**\r
+ * Converts the description string to HTML-format\r
+ * @return HMTL-formatted description.\r
+ */\r
+ public String getDescriptionHTML() {\r
+ if (description == null)\r
+ return null;\r
+ return description.replaceAll("<", "<").replaceAll(">", ">").replaceAll("\n", "<BR>");\r
+ }\r
+\r
+ /**\r
+ * Determine if the units of the given arguments are valid\r
+ * @param argumentUnits validated arguments\r
+ * @param correspondences mapping from templates to actual arguments\r
+ * @param functions all functions available\r
+ * @param allowEquivalents true iff equivalent units are used (e.g. $ == dollar)\r
+ * @param units evm\r
+ * @return true iff argument units are valid\r
+ * @throws UnitCheckingException if \r
+ */\r
+ public boolean areArgumentUnitsValid(ArrayList<Pair<UnitResult, String>> argumentUnits, \r
+ HashMap<String, String> correspondences,\r
+ ArrayList<Function> functions, \r
+ boolean allowEquivalents, \r
+ HashMap<String, \r
+ String> units) throws UnitCheckingException {\r
+ ArrayList<Boolean> inputMatches = new ArrayList<Boolean>(); // Table for matching inputs.\r
+ for (int i = 0; i < inputList.size(); ++i)\r
+ inputMatches.add(Boolean.FALSE);\r
+ \r
+ for (int i = 0; i < argumentUnits.size(); ++i) { // Go through all _arguments_\r
+ if (inputList.size() == 0)\r
+ return false; // No inputs expected but got at least one\r
+ \r
+ if (argumentUnits.get(i).second != null) { // Named argument\r
+ boolean found = false;\r
+ for (int j = 0; j < inputList.size(); ++j) {\r
+ Input namedInput = inputList.get(j);\r
+ if (namedInput.name.equals(argumentUnits.get(i).second)) {\r
+ // Match input unit to argument unit\r
+ UnitResult inputUnit = namedInput.getUnitResult(units, this, functions, allowEquivalents, correspondences);\r
+ if (!inputUnit.equals(argumentUnits.get(i).first))\r
+ return false;\r
+ inputMatches.set(j, Boolean.TRUE);\r
+ found = true;\r
+ break;\r
+ }\r
+ }\r
+ if (!found) {\r
+ throw new UnitCheckingException("Undefined input argument " + argumentUnits.get(i).second \r
+ + " used in function " + this.getName() + ".");\r
+ }\r
+ } else { // Position argument\r
+ if (i >= inputList.size()) { // Test for variable length argument\r
+ // Assume there can be only one variable length input and its in the end.\r
+ // And that there cannot be any optional arguments before.\r
+ Input input = inputList.get(inputList.size() - 1);\r
+ if (input.variableLength) {\r
+ // Match input unit to argument unit\r
+ UnitResult inputUnit = input.getUnitResult(units, this, functions, allowEquivalents, correspondences);\r
+ if (!inputUnit.equals(argumentUnits.get(i).first))\r
+ return false;\r
+ // The corresponding _input_ has already been gone through, no need to set true.\r
+ } else {\r
+ return false;\r
+ }\r
+ } else {\r
+ // Match input unit to argument unit\r
+ UnitResult inputUnit = inputList.get(i).getUnitResult(units, this, functions, allowEquivalents, correspondences);\r
+ if (inputUnit.getUnitType() == UnitType.SCALAR\r
+ && !(argumentUnits.get(i).first.getUnitType() == UnitType.SCALAR))\r
+ return false; // Here we don't accept a "1" replaced with a NORMAL expression, there's "ANY" for that.\r
+ if (!inputUnit.equals(argumentUnits.get(i).first))\r
+ return false;\r
+ inputMatches.set(i, Boolean.TRUE);\r
+ }\r
+ }\r
+ }\r
+ \r
+ // See if some of the required inputs has not been defined. \r
+ for (int i = 0; i < inputList.size(); ++i) {\r
+ if (!inputMatches.get(i) && !inputList.get(i).optional) {\r
+ return false;\r
+ }\r
+ }\r
+ \r
+ return true;\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.utils;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class GetConfigurationRequest implements Read<Resource> {\r
+ \r
+ private Resource resource;\r
+ \r
+ public GetConfigurationRequest(Resource resource) {\r
+ this.resource = resource;\r
+ }\r
+\r
+ @Override\r
+ public Resource perform(ReadGraph graph) throws DatabaseException {\r
+ return getConfiguration(graph, resource);\r
+ }\r
+ \r
+ private Resource getConfiguration(ReadGraph graph, Resource resource) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ Resource parent = graph.getPossibleObject(resource, L0.PartOf);\r
+ if(parent == null)\r
+ return null;\r
+ \r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ if(graph.isInstanceOf(parent, SR.SysdynModel)) {\r
+ parent = graph.getPossibleObject(parent, SimulationResource.getInstance(graph).HasConfiguration);\r
+ }\r
+ \r
+ if(graph.isInstanceOf(parent, SR.Configuration)) {\r
+ return parent;\r
+ }\r
+ \r
+ else\r
+ return getConfiguration(graph, parent);\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.utils;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+import java.util.HashMap;\r
+import java.util.Iterator;\r
+import java.util.List;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.exception.NoSingleResultException;\r
+import org.simantics.db.exception.ServiceException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.elementaryCycles.ElementaryCyclesSearch;\r
+import org.simantics.ui.SimanticsUI;\r
+\r
+/**\r
+ * Utils for loops\r
+ * @author Tuomas Miettinen\r
+ *\r
+ */\r
+public class LoopUtils {\r
+\r
+ private static class ElementaryLoopItem {\r
+ public int mapping;\r
+ ArrayList<Resource> dependencies;\r
+ \r
+ public ElementaryLoopItem(int mapping, ArrayList<Resource> dependencies) {\r
+ this.mapping = mapping;\r
+ this.dependencies = dependencies;\r
+ }\r
+ }\r
+ \r
+ public enum LoopType {\r
+ REINFORCING,\r
+ BALANCING,\r
+ UNDEFINED\r
+ };\r
+ \r
+ /**\r
+ * Get all the loops within the diagram where the resource belongs to.\r
+ * @param r Resource that is studied\r
+ * @return List of loops; each loop is a list of resources in the same order in which\r
+ * they appear in the loop. The first item in the list can be any of the items in the\r
+ * loop. \r
+ */\r
+ public static List<List<Resource>> getLoops(final Resource r) {\r
+ List<List<Resource>> loops = Collections.emptyList();\r
+ try {\r
+ loops = SimanticsUI.getSession().syncRequest(new Read<List<List<Resource>>>() {\r
+\r
+ @Override\r
+ public List<List<Resource>> perform(ReadGraph graph)\r
+ throws DatabaseException {\r
+ return getLoops(graph, r);\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ return loops;\r
+ }\r
+ \r
+ @SuppressWarnings({ "rawtypes", "unchecked", "unused" })\r
+ public static List<List<Resource>> getLoops(ReadGraph g, Resource r) throws DatabaseException, ServiceException {\r
+ // Get all loops in the diagram.\r
+ List<List<Resource>> cycles = getAllLoopsInDiagram(g, r);\r
+ \r
+ // Collect all those loops in which the original resource exists.\r
+ List<List<Resource>> loops = new ArrayList<List<Resource>>();\r
+ for (Object o : cycles) {\r
+ if (o instanceof List) {\r
+ List loop = (List)o;\r
+ if (loop.contains(r))\r
+ loops.add(loop);\r
+ }\r
+ }\r
+ \r
+ // Debug print the result\r
+ if (false) {\r
+ System.out.println(cyclesToString(g, cycles));\r
+ }\r
+ \r
+ return loops;\r
+ }\r
+ \r
+ @SuppressWarnings({ "rawtypes", "unchecked" })\r
+ public static List<List<Resource>> getAllLoopsInDiagram(ReadGraph g, Resource r) throws DatabaseException, ServiceException {\r
+ Layer0 l0 = Layer0.getInstance(g);\r
+ SysdynResource sr = SysdynResource.getInstance(g);\r
+ Resource configuration = g.getPossibleObject(r, l0.PartOf);\r
+ if (configuration == null)\r
+ return Collections.emptyList();\r
+ \r
+ Collection<Resource> variables = g.getObjects(configuration, l0.ConsistsOf);\r
+ ArrayList<Resource> shadows = new ArrayList<Resource>();\r
+ \r
+ // Leave only independent variables and shadows (and modules)\r
+ Iterator<Resource> it = variables.iterator();\r
+ while (it.hasNext()) {\r
+ Resource v = it.next();\r
+ if (g.isInstanceOf(v, sr.IndependentVariable)) {\r
+ } else if (g.isInstanceOf(v, sr.Shadow)) {\r
+ shadows.add(v);\r
+ it.remove();\r
+ /*} else if (|| g.isInstanceOf(v, sr.Module)) {\r
+ */\r
+ } else {\r
+ it.remove();\r
+ }\r
+ }\r
+ \r
+ int variableCount = variables.size();\r
+ Resource nodes[] = new Resource[variableCount];\r
+ \r
+ // Add independent variables to map and array\r
+ int k = 0;\r
+ HashMap<Resource, ElementaryLoopItem> elementaryLoopItems = new HashMap<Resource, ElementaryLoopItem>();\r
+ for (Resource variable : variables) {\r
+ ArrayList<Resource> dependingVariables = new ArrayList<Resource>();\r
+ // Add forward dependencies and flows from valves.\r
+ Collection<Resource> dependencies = g.getObjects(variable, sr.Variable_isTailOf);\r
+ for (Resource dependency : dependencies) {\r
+ Resource head = g.getPossibleObject(dependency, sr.Variable_HasHead);\r
+ // Skip dependencies and flows to modules and clouds.\r
+ if (head == null \r
+ || g.isInstanceOf(head, sr.Module)\r
+ || g.isInstanceOf(head, sr.Cloud))\r
+ continue;\r
+ \r
+ if ((g.isInstanceOf(dependency, sr.Flow) && g.isInstanceOf(variable, sr.Valve))\r
+ || g.isInstanceOf(dependency, sr.Dependency)) {\r
+ // Add all dependencies\r
+ // Add (only) such flows that start from a valve.\r
+ dependingVariables.add(head);\r
+ }\r
+ }\r
+ // Add backward flows from stocks.\r
+ Collection<Resource> backwardFlows = g.getObjects(variable, sr.Variable_isHeadOf);\r
+ for (Resource flow : backwardFlows) {\r
+ if (g.isInstanceOf(flow, sr.Flow)) {\r
+ Resource tail = g.getPossibleObject(flow, sr.Variable_HasTail);\r
+ if (tail != null && g.isInstanceOf(tail, sr.Stock)) {\r
+ // Add (only) such flows that start from a stock.\r
+ dependingVariables.add(tail);\r
+ }\r
+ }\r
+ }\r
+ // Put the variable in the hash map.\r
+ elementaryLoopItems.put(variable, new ElementaryLoopItem(k, dependingVariables));\r
+ nodes[k++] = variable;\r
+ }\r
+ \r
+ // Add dependencies of shadow variables for their original variables\r
+ for (Resource shadow : shadows) {\r
+ Resource original = g.getPossibleObject(shadow, sr.Shadow_original);\r
+ ArrayList<Resource> dependingVariables = new ArrayList<Resource>();\r
+ Collection<Resource> dependencies = g.getObjects(shadow, sr.Variable_isTailOf);\r
+ for (Resource dependency : dependencies) {\r
+ Resource head = g.getPossibleObject(dependency, sr.Variable_HasHead);\r
+ if (!g.isInstanceOf(head, sr.Module)) {\r
+ dependingVariables.add(head);\r
+ }\r
+ }\r
+ ElementaryLoopItem el = elementaryLoopItems.get(original);\r
+ if (el != null)\r
+ el.dependencies.addAll(dependingVariables);\r
+ }\r
+ \r
+ // Fill the adjacent matrix\r
+ boolean adjMatrix[][] = new boolean[variableCount][variableCount];\r
+ for (int j = 0; j < nodes.length; ++j) {\r
+ ArrayList<Resource> dependingVariables = elementaryLoopItems.get(nodes[j]).dependencies;\r
+ for (Resource v : dependingVariables) {\r
+ adjMatrix[j][elementaryLoopItems.get(v).mapping] = true;\r
+ }\r
+ }\r
+ \r
+ // Get ALL nodes in the diagram.\r
+ ElementaryCyclesSearch ecs = new ElementaryCyclesSearch(adjMatrix, nodes);\r
+ List cycles = ecs.getElementaryCycles();\r
+ \r
+ return cycles;\r
+ }\r
+ \r
+ /**\r
+ * Get the String representation of cycles. \r
+ * @param g\r
+ * @param cycles List of Resource Lists of which names are returned.\r
+ * @return the String representation of cycles\r
+ * @throws DatabaseException\r
+ */\r
+ public static String cyclesToString(ReadGraph g, List<List<Resource>> cycles) throws DatabaseException {\r
+ StringBuilder sb = new StringBuilder("");\r
+ for (int i = 0; i < cycles.size(); i++) {\r
+ sb.append(cycleToString(g, cycles.get(i)));\r
+ sb.append("\n");\r
+ }\r
+ return sb.toString();\r
+ }\r
+ \r
+ /**\r
+ * Get the String representation of a cycle. \r
+ * @param g\r
+ * @param cycle List of Resources of which names are returned.\r
+ * @return the String representation of a cycle\r
+ * @throws DatabaseException\r
+ */\r
+ public static String cycleToString(ReadGraph g, List<Resource> cycle) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(g);\r
+ StringBuilder sb = new StringBuilder("");\r
+ for (int j = 0; j < cycle.size(); j++) {\r
+ Resource node = (Resource) cycle.get(j);\r
+ if (j < cycle.size() - 1) {\r
+ sb.append(g.getPossibleRelatedValue(node, l0.HasName, Bindings.STRING) + " -> ");\r
+ } else {\r
+ sb.append(g.getPossibleRelatedValue(node, l0.HasName, Bindings.STRING));\r
+ }\r
+ }\r
+ return sb.toString();\r
+ }\r
+ \r
+ /**\r
+ * Get the type of the loop, i.e. whether the loop is reinforcing or balancing.\r
+ * The type is determined based on the dependency arrows and flows on the diagram;\r
+ * the loop is balancing if there is odd number of dependencies with negative\r
+ * polarity (Polarity = "-"). Note:\r
+ * 1) each flow of which tail is a valve is considered a dependency with positive \r
+ * (+) polarity.\r
+ * 2) each flow of which tail is a stock is considered a dependency with negative \r
+ * (-) polarity which GOES TO THE OPPOSITE DIRECTION.\r
+ * 3) the polarity of a supplementary dependency arrow overrides a flow.\r
+ * 4) the loops are defined as a list of Resources. If the set of dependencies\r
+ * between is ambiguous, the implementation may choose any possible dependency. \r
+ * 5) empty and null polarity are considered positive (+) polarities. \r
+ * @param graph\r
+ * @param resource The loop component\r
+ * @return the type of the loop. If the type cannot be determined,\r
+ * LoopType.UNDEFINED is returned\r
+ * @throws DatabaseException\r
+ */\r
+ public static LoopType getLoopType(ReadGraph graph, Resource resource) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph); \r
+ ModelingResources mod = ModelingResources.getInstance(graph);\r
+ Resource loopResource = graph.getPossibleObject(resource, sr.Loop_Items);\r
+ \r
+ if (loopResource == null)\r
+ return LoopType.UNDEFINED;\r
+\r
+ boolean oddNumberOfNegativeCausalities = false;\r
+ List<Resource> loop = ListUtils.toPossibleList(graph, loopResource);\r
+ for (int i = 0; i < loop.size(); ++i) {\r
+ boolean skipBackwardFlows = false;\r
+ \r
+ // Go through forward dependencies and flows\r
+ Collection<Resource> forwardDependencies = graph.getObjects(loop.get(i), sr.Variable_isTailOf);\r
+ \r
+ // And also through the forward dependencies of possible shadows.\r
+ Collection<Resource> shadows = graph.getObjects(loop.get(i), sr.Shadow_original_Inverse);\r
+ for (Resource shadow : shadows)\r
+ forwardDependencies.addAll(graph.getObjects(shadow, sr.Variable_isTailOf));\r
+ \r
+ for (Resource dependency : forwardDependencies) {\r
+ Resource dependingVariable = graph.getSingleObject(dependency, sr.Variable_HasHead);\r
+ if (dependingVariable.equals(loop.get((i + 1) % loop.size()))) {\r
+ if (graph.isInstanceOf(dependency, sr.Flow)) {\r
+ /*\r
+ * Forward flows never affect the loop type. Allow dependency arrows \r
+ * override flows; thus don't touch skipBackwardFlows and continue.\r
+ * continue also because we may have a flow from stock, which\r
+ * is the wrong dependency and we need to keep searching.\r
+ */\r
+ continue;\r
+ }\r
+ skipBackwardFlows = true;\r
+ \r
+ Resource dependencyConnection;\r
+ try {\r
+ dependencyConnection = graph.getSingleObject(dependency, mod.ConnectionToDiagramConnection);\r
+ } catch (NoSingleResultException e) {\r
+ return LoopType.UNDEFINED;\r
+ }\r
+ String polarity = (String)graph.getPossibleRelatedValue(dependencyConnection, sr.DependencyConnection_polarity, Bindings.STRING);\r
+ if ("-".equals(polarity)) {\r
+ oddNumberOfNegativeCausalities = !oddNumberOfNegativeCausalities;\r
+ } else if (polarity != null \r
+ && !"".equals(polarity)\r
+ && !"+".equals(polarity)) {\r
+ // There's something other than + in one of the dependencies\r
+ return LoopType.UNDEFINED;\r
+ }\r
+ // "+" doesn't affect loop type, consider null and "" as a "+".\r
+ break;\r
+ }\r
+ }\r
+ \r
+ if (skipBackwardFlows)\r
+ continue;\r
+ \r
+ // Backward flows from stocks.\r
+ Collection<Resource> backwardFlows = graph.getObjects(loop.get(i), sr.Variable_isHeadOf);\r
+ for (Resource flow : backwardFlows) {\r
+ if (graph.isInstanceOf(flow, sr.Flow)) {\r
+ Resource dependingVariable = graph.getSingleObject(flow, sr.Variable_HasTail);\r
+ if (dependingVariable.equals(loop.get((i + 1) % loop.size()))) {\r
+ if (graph.isInstanceOf(dependingVariable, sr.Stock)) {\r
+ // Basically, we should always end up here since all other\r
+ // possibilities have already been gone through.\r
+ oddNumberOfNegativeCausalities = !oddNumberOfNegativeCausalities;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return oddNumberOfNegativeCausalities ? LoopType.BALANCING : LoopType.REINFORCING;\r
+ }\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.utils;\r
+\r
+import java.util.UUID;\r
+\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.utils.Logger;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.adapter.Template;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
+import org.simantics.document.DocumentResource;\r
+import org.simantics.issues.ontology.IssueResource;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.modeling.ModelingUtils;\r
+import org.simantics.operation.Layer0X;\r
+import org.simantics.project.ontology.ProjectResource;\r
+import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.manager.SysdynModelManager;\r
+import org.simantics.utils.datastructures.ArrayMap;\r
+\r
+public class ModelUtils {\r
+\r
+ /**\r
+ * Returns the SysdynModel where the given variable is located\r
+ * \r
+ * @param graph ReadGraph\r
+ * @param variable Variable whose model is wanted\r
+ * @return SysdynModel where variable is located\r
+ * @throws DatabaseException\r
+ */\r
+ public static SysdynModel getModel(ReadGraph graph, Resource variable) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ Resource configuration = graph.getPossibleObject(variable, l0.PartOf);\r
+ if(configuration == null)\r
+ return null;\r
+ SysdynModelManager sdm = SysdynModelManager.getInstance(Simantics.getSession());\r
+ SysdynModel model = sdm.getModel(graph, configuration);\r
+ try {\r
+ model.update(graph);\r
+ } catch (DatabaseException e1) {\r
+ e1.printStackTrace();\r
+ }\r
+ return model;\r
+ }\r
+\r
+ public static Resource createModel(WriteGraph graph) {\r
+ return createModelAt(graph, Simantics.getProject().get());\r
+ }\r
+\r
+ // TODO: remove this\r
+ public static Resource createModelAt(WriteGraph g, Resource library) {\r
+ \r
+ g.markUndoPoint();\r
+ try {\r
+ Layer0 l0 = Layer0.getInstance(g);\r
+ Layer0X L0X = Layer0X.getInstance(g);\r
+ SysdynResource sr = SysdynResource.getInstance(g);\r
+ SpreadsheetResource SHEET = SpreadsheetResource.getInstance(g);\r
+ ModelingUtils mu = new ModelingUtils(g);\r
+ DocumentResource DOC = DocumentResource.getInstance(g);\r
+\r
+ String modelName = NameUtils.findFreshName(g, "Model", library, l0.ConsistsOf, "%s%d");\r
+\r
+ Resource project = Simantics.getProject().get();\r
+ Resource model = GraphUtils.create2(g,\r
+ sr.SysdynModel,\r
+ l0.PartOf, project,\r
+ l0.HasName, modelName,\r
+ l0.HasLabel, modelName,\r
+ L0X.IsActivatedBy, project\r
+ );\r
+\r
+ GraphUtils.create2(g,\r
+ sr.Validations_Dependencies_MissingDependencyConnectionsIssueSource,\r
+ L0X.IsActivatedBy, model,\r
+ l0.PartOf, model\r
+ );\r
+\r
+ GraphUtils.create2(g,\r
+ sr.Validations_Dependencies_DependencyConnectionsIssueSource,\r
+ L0X.IsActivatedBy, model,\r
+ l0.PartOf, model\r
+ );\r
+ \r
+ GraphUtils.create2(g,\r
+ sr.Validations_Expressions_ExpressionIssueSource,\r
+ L0X.IsActivatedBy, model,\r
+ l0.PartOf, model\r
+ );\r
+ \r
+ GraphUtils.create2(g,\r
+ sr.Validations_Enumerations_EnumerationIssueSource,\r
+ L0X.IsActivatedBy, model,\r
+ l0.PartOf, model\r
+ ); \r
+ \r
+ GraphUtils.create2(g,\r
+ sr.Validations_Units_UnitIssueSource,\r
+ L0X.IsActivatedBy, model,\r
+ l0.PartOf, model,\r
+ IssueResource.getInstance(g).IssueSource_active, false\r
+ ); \r
+ \r
+ Resource conf = GraphUtils.create2(g,\r
+ sr.Configuration,\r
+ l0.PartOf, model,\r
+ L0X.IsBaseRealizationOf, model,\r
+ l0.HasName, modelName\r
+ );\r
+\r
+ Resource diagram = g.newResource();\r
+ g.adapt(sr.ConfigurationDiagramTemplate, Template.class).apply(g,\r
+ ArrayMap\r
+ .keys("", "diagram", "name")\r
+ .values(conf, diagram, "Diagrammi")\r
+ );\r
+\r
+ g.claim(model, mu.SIMU.HasConfiguration, conf);\r
+\r
+ Resource book = g.newResource();\r
+ g.claim(book, l0.InstanceOf, null, SHEET.Book);\r
+ g.addLiteral(book, l0.HasName, l0.NameOf, l0.String, "Book" + UUID.randomUUID().toString(), Bindings.STRING);\r
+ g.claim(conf, l0.ConsistsOf, l0.PartOf, book);\r
+\r
+ SheetUtils.createSheet(g, book, "Sheet1", new String[] { }, new int[] { 50 });\r
+\r
+\r
+\r
+ ModelingResources mr = ModelingResources.getInstance(g);\r
+ // Remove default mapping and add sysdyn mapping\r
+ for(Resource trigger : g.getObjects(diagram, L0X.HasTrigger)) {\r
+ if(g.isInstanceOf(trigger, mr.DiagramToCompositeMapping)) {\r
+ g.deny(diagram, L0X.HasTrigger, trigger);\r
+ }\r
+ }\r
+ Resource mapping = g.newResource();\r
+ g.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
+ g.claim(diagram, L0X.HasTrigger, mapping);\r
+\r
+ Resource report = GraphUtils.create2(g, DOC.Report, DOC.HasDocumentation, "===Report===");\r
+\r
+ GraphUtils.create2(g, sr.BasicExperiment,\r
+ l0.HasName, "Experiment",\r
+ l0.HasLabel, "Experiment",\r
+ DOC.HasReportFactory, report,\r
+ l0.PartOf, model);\r
+\r
+ Resource sheetExperiment = GraphUtils.create2(g, SHEET.Experiment,\r
+ l0.HasName, "SheetExperiment",\r
+ l0.HasLabel, "Sheet Experiment",\r
+ l0.PartOf, model);\r
+\r
+ Resource sheetRun = GraphUtils.create2(g, SHEET.Run,\r
+ l0.HasName, "Default",\r
+ l0.PartOf, sheetExperiment);\r
+\r
+ ProjectResource PROJ = ProjectResource.getInstance(g);\r
+ for(Resource dep : g.getObjects(library, l0.IsLinkedTo)) {\r
+ if(g.isInstanceOf(dep, PROJ.NamespaceRequirement)) {\r
+ for(Resource req : g.getObjects(dep, PROJ.RequiresNamespace)) {\r
+ String uri = g.getPossibleValue(req, Bindings.STRING);\r
+ if(uri != null) {\r
+ Resource target = g.getResource(uri);\r
+ if(target != null) {\r
+ g.claim(model, l0.IsLinkedTo, null, target);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ createSCLMain(g, model);\r
+ \r
+ ProfileEntries.createStandardProfiles(g, model);\r
+ \r
+ Layer0Utils.addCommentMetadata(g, "Created new Sysdyn Model '" + modelName + "' " + model.toString());\r
+ \r
+ return model;\r
+ \r
+ } catch (DatabaseException e ) {\r
+ Logger.defaultLogError(e);\r
+ }\r
+ \r
+ return null;\r
+ }\r
+ \r
+ public static void createSCLMain(WriteGraph graph, Resource model) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ Resource SCLModule = GraphUtils.create2(graph,\r
+ L0.SCLModule,\r
+ L0.PartOf, model,\r
+ L0.HasName, "SCLMain"\r
+ );\r
+\r
+ if(graph.hasStatement(SCLModule, L0.SCLModule_definition))\r
+ graph.deny(SCLModule, L0.SCLModule_definition);\r
+\r
+ graph.claimLiteral(SCLModule, L0.SCLModule_definition, "include \"Simantics/DB\"\n" +\r
+ "include \"Simantics/Variables\"\n" +\r
+ "include \"Simantics/Sysdyn\"\n" +\r
+ "include \"Simupedia/Sysdyn\" as SD\n" +\r
+ "include \"http://www.simantics.org/Documentation-1.2/Components\"\n" +\r
+ "include \"http://www.simantics.org/Documentation-1.2/Properties\" as Properties\n" +\r
+ "include \"http://www.simantics.org/Documentation-1.2/Relations\" as Relations\n" +\r
+ "include \"Simupedia/simupedia\"", Bindings.STRING);\r
+\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.utils;\r
+\r
+public class ModuleSummary {\r
+ \r
+ private int variables = 0;\r
+ private int totalVariables = 0;\r
+ private int auxiliaries = 0;\r
+ private int stocks = 0;\r
+ private int valves = 0;\r
+ private int inputs = 0;\r
+ private int shadows = 0;\r
+ private int modules = 0;\r
+ private int enumerations = 0;\r
+ private int sheets = 0;\r
+\r
+ \r
+ \r
+ public int getVariables() {\r
+ return variables;\r
+ }\r
+ public void setVariables(int variables) {\r
+ this.variables = variables;\r
+ }\r
+ public int getTotalVariables() {\r
+ return totalVariables;\r
+ }\r
+ public void setTotalVariables(int totalVariables) {\r
+ this.totalVariables = totalVariables;\r
+ } \r
+ public int getAuxiliaries() {\r
+ return auxiliaries;\r
+ }\r
+ public void setAuxiliaries(int auxiliaries) {\r
+ this.auxiliaries = auxiliaries;\r
+ }\r
+ public int getStocks() {\r
+ return stocks;\r
+ }\r
+ public void setStocks(int stocks) {\r
+ this.stocks = stocks;\r
+ }\r
+ public int getValves() {\r
+ return valves;\r
+ }\r
+ public void setValves(int valves) {\r
+ this.valves = valves;\r
+ }\r
+ public int getInputs() {\r
+ return inputs;\r
+ }\r
+ public void setInputs(int inputs) {\r
+ this.inputs = inputs;\r
+ }\r
+ public int getShadows() {\r
+ return shadows;\r
+ }\r
+ public void setShadows(int shadows) {\r
+ this.shadows = shadows;\r
+ }\r
+ public int getModules() {\r
+ return modules;\r
+ }\r
+ public void setModules(int modules) {\r
+ this.modules = modules;\r
+ }\r
+ public int getEnumerations() {\r
+ return enumerations;\r
+ }\r
+ public void setEnumerations(int enumerations) {\r
+ this.enumerations = enumerations;\r
+ }\r
+ public int getSheets() {\r
+ return sheets;\r
+ }\r
+ public void setSheets(int sheets) {\r
+ this.sheets = sheets;\r
+ }\r
+ \r
+ public void add(ModuleSummary otherSummary) {\r
+ setAuxiliaries(getAuxiliaries() + otherSummary.getAuxiliaries());\r
+ setEnumerations(getEnumerations() + otherSummary.getEnumerations());\r
+ setInputs(getInputs() + otherSummary.getInputs());\r
+ setModules(getModules() + otherSummary.getModules());\r
+ setShadows(getShadows() + otherSummary.getShadows());\r
+ setStocks(getStocks() + otherSummary.getStocks());\r
+ setValves(getValves() + otherSummary.getValves());\r
+ setVariables(getVariables() + otherSummary.getVariables());\r
+ setTotalVariables(getTotalVariables() + otherSummary.getTotalVariables());\r
+ setSheets(getSheets() + otherSummary.getSheets());\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.utils;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.manager.SysdynModel;\r
+import org.simantics.sysdyn.manager.SysdynModelManager;\r
+import org.simantics.sysdyn.representation.Auxiliary;\r
+import org.simantics.sysdyn.representation.Configuration;\r
+import org.simantics.sysdyn.representation.Enumeration;\r
+import org.simantics.sysdyn.representation.IElement;\r
+import org.simantics.sysdyn.representation.Input;\r
+import org.simantics.sysdyn.representation.Module;\r
+import org.simantics.sysdyn.representation.Redeclaration;\r
+import org.simantics.sysdyn.representation.Shadow;\r
+import org.simantics.sysdyn.representation.Sheet;\r
+import org.simantics.sysdyn.representation.Stock;\r
+import org.simantics.sysdyn.representation.Valve;\r
+import org.simantics.sysdyn.representation.Variable;\r
+\r
+public class ModuleSummaryRequest implements Read<ModuleSummary> {\r
+ \r
+ private Resource module;\r
+ private boolean recursive;\r
+ \r
+ public ModuleSummaryRequest(Resource module, boolean recursive) {\r
+ this.module = module;\r
+ this.recursive = recursive;\r
+ }\r
+\r
+ @Override\r
+ public ModuleSummary perform(ReadGraph graph) throws DatabaseException {\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+ StructuralResource2 SR2 = StructuralResource2.getInstance(graph);\r
+ \r
+ ModuleSummary result = new ModuleSummary();\r
+ \r
+ if(module == null)\r
+ return result;\r
+ \r
+ Resource configuration;\r
+ if(graph.isInstanceOf(module, SR.SysdynModel))\r
+ configuration = graph.getPossibleObject(module, SIMU.HasConfiguration);\r
+ else if(graph.isInheritedFrom(module, SR.Module))\r
+ configuration = graph.getPossibleObject(module, SR2.IsDefinedBy);\r
+ else\r
+ configuration = null;\r
+ \r
+ if(configuration == null)\r
+ return result;\r
+ \r
+ SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r
+ SysdynModel sm = smm.getModel(graph, configuration);\r
+ sm.update(graph);\r
+ \r
+ result.add(collectSummary(sm.getConfiguration(), recursive, new HashMap<String, Integer>()));\r
+ \r
+ return result;\r
+ }\r
+ \r
+ private ModuleSummary collectSummary(Configuration configuration, boolean recursive, Map<String, Integer> enumerationOverrides) {\r
+ ModuleSummary result = new ModuleSummary();\r
+ \r
+ for(IElement e : configuration.getElements()) {\r
+ if(e instanceof Input)\r
+ result.setInputs(result.getInputs() + 1);\r
+ \r
+ if(e instanceof Auxiliary)\r
+ result.setAuxiliaries(result.getAuxiliaries() + 1);\r
+ \r
+ if(e instanceof Stock)\r
+ result.setStocks(result.getStocks() + 1);\r
+ \r
+ if(e instanceof Shadow)\r
+ result.setShadows(result.getShadows() + 1);\r
+ \r
+ if(e instanceof Valve)\r
+ result.setValves(result.getValves() + 1);\r
+ \r
+ if(e instanceof Enumeration)\r
+ result.setEnumerations(result.getEnumerations() + 1);\r
+ \r
+ if(e instanceof Sheet)\r
+ result.setSheets(result.getSheets() + 1);\r
+ \r
+ if(e instanceof Variable && !(e instanceof Sheet)) {\r
+ result.setVariables(result.getVariables() + 1);\r
+ \r
+ int n = 1;\r
+ Variable var = (Variable) e;\r
+ if(var.getArrayIndexes() != null && var.getArrayIndexes().size() > 0) {\r
+ for(Enumeration enumeration : var.getArrayIndexes()) {\r
+ if(enumerationOverrides.containsKey(enumeration.getName())) {\r
+ n = n * enumerationOverrides.get(enumeration.getName());\r
+ } else {\r
+ n = n * enumeration.getEnumerationIndexes().size();\r
+ }\r
+ }\r
+ }\r
+ result.setTotalVariables(result.getTotalVariables() + n);\r
+ }\r
+ \r
+ if(e instanceof Module) {\r
+ result.setModules(result.getModules() + 1);\r
+ \r
+ if(recursive) {\r
+ Module m = (Module) e;\r
+ HashMap<String, Integer> redeclarations = new HashMap<String, Integer>();\r
+ for(Redeclaration redeclaration : m.getRedeclarations()) {\r
+ int n;\r
+ if(enumerationOverrides.containsKey(redeclaration.getReplacingEnumeration())) {\r
+ n = enumerationOverrides.get(redeclaration.getReplacingEnumeration());\r
+ } else {\r
+ n = redeclaration.getReplacingEnumeration().getEnumerationIndexes().size();\r
+ }\r
+ redeclarations.put(redeclaration.getReplacedEnumeration().getName(), n);\r
+ }\r
+ result.add(collectSummary(m.getType().getConfiguration(), recursive, redeclarations));\r
+ }\r
+ }\r
+ }\r
+ \r
+ \r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011, 2014 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.utils;\r
+\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.diagram.profile.Profiles;\r
+import org.simantics.diagram.stubs.DiagramResource;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+public class ProfileEntries {\r
+\r
+\r
+ public static void createStandardProfiles(WriteGraph graph, final Resource model) throws DatabaseException {\r
+\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+\r
+ DiagramResource DIA = DiagramResource.getInstance(graph);\r
+\r
+ Resource simulationPlaybackProfile = createProfile(graph, "Simulation Playback", sr.SimulationPlaybackProfile ,sr.Profiles_SimulationPlaybackColours);\r
+\r
+ Resource defaultProfile = createProfile(graph, "Default", sr.DefaultProfile, sr.Profiles_IssueWarnings, sr.Profiles_ShadowVisualizations);\r
+\r
+ //graph.claim(model, DIA.HasProfile, defaultProfile);\r
+ graph.claim(model, L0.ConsistsOf, simulationPlaybackProfile);\r
+ graph.claim(model, L0.ConsistsOf, defaultProfile);\r
+\r
+ // FIXME: add virtual graph write back once this is fixed: https://www.simulationsite.net/redmine/issues/3296\r
+// graph.sync(new WriteRequest(graph.getService(VirtualGraphSupport.class).getWorkspacePersistent("profiles")) {\r
+// @Override\r
+// public void perform(WriteGraph graph) throws DatabaseException {\r
+// DiagramResource DIA = DiagramResource.getInstance(graph);\r
+ graph.claim(model, DIA.HasActiveProfile, defaultProfile);\r
+ SimulationResource SIMU = SimulationResource.getInstance(graph);\r
+ graph.claim(defaultProfile, SIMU.IsActive, null, sr.Profiles_IssueWarnings);\r
+ graph.claim(defaultProfile, SIMU.IsActive, null, sr.Profiles_ShadowVisualizations);\r
+ graph.claim(simulationPlaybackProfile, SIMU.IsActive, null, sr.Profiles_SimulationPlaybackColours);\r
+ \r
+// }\r
+// });\r
+\r
+ }\r
+ \r
+ public static Resource createProfile(WriteGraph graph, String name, Resource type, Resource... entries) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ \r
+ Resource profile = Profiles.createProfile(graph, name,\r
+ entries);\r
+ \r
+ graph.deny(profile, L0.InstanceOf);\r
+ graph.claim(profile, L0.InstanceOf, null, type);\r
+ return profile;\r
+ }\r
+\r
+}\r
--- /dev/null
+package org.simantics.sysdyn.utils;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+/**\r
+ * @author Jani Simomaa\r
+ *\r
+ */\r
+public class SelectionUtils {\r
+\r
+ /**\r
+ * Checks whether <strong>resource</strong> can be edited\r
+ * \r
+ * @param graph\r
+ * @param resource\r
+ * @return\r
+ * @throws DatabaseException\r
+ */\r
+ public static boolean canEdit(ReadGraph graph, Resource resource) throws DatabaseException {\r
+ return !graph.isImmutable(resource);\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.utils;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.spreadsheet.SheetVariables;\r
+import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
+\r
+public class SheetUtils {\r
+\r
+ public static Resource createSheet(WriteGraph graph, Resource book, String name, String[] colNames, int[] colWidths) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SpreadsheetResource sr = SpreadsheetResource.getInstance(graph);\r
+\r
+ Resource result = graph.newResource();\r
+ graph.claim(result, L0.InstanceOf, null, sr.Spreadsheet);\r
+\r
+ if(name == null) {\r
+ name = NameUtils.findFreshEscapedName(graph, "Sheet", book, L0.ConsistsOf);\r
+ }\r
+ graph.claimLiteral(result, L0.HasName, L0.NameOf, L0.String, name, Bindings.STRING);\r
+ graph.claim(book, L0.ConsistsOf, L0.PartOf, result);\r
+\r
+ {\r
+ Resource newCell = graph.newResource();\r
+ graph.claim(newCell, L0.InstanceOf, null, sr.Dimensions);\r
+ graph.claimLiteral(newCell, L0.HasName, L0.NameOf, L0.String, "Dimensions", Bindings.STRING);\r
+ graph.addLiteral(newCell, sr.Dimensions_fitColumns, sr.Dimensions_fitColumns_Inverse, L0.Boolean, false, Bindings.BOOLEAN);\r
+ graph.addLiteral(newCell, sr.Dimensions_fitRows, sr.Dimensions_fitRows_Inverse, L0.Boolean, false, Bindings.BOOLEAN);\r
+ graph.addLiteral(newCell, sr.Dimensions_columnCount, sr.Dimensions_columnCount_Inverse, L0.Integer, 128, Bindings.INTEGER);\r
+ graph.addLiteral(newCell, sr.Dimensions_rowCount, sr.Dimensions_rowCount_Inverse, L0.Integer, 256, Bindings.INTEGER);\r
+ graph.claim(result, L0.ConsistsOf, L0.PartOf, newCell);\r
+ }\r
+\r
+ {\r
+ Resource newCell = graph.newResource();\r
+ graph.claim(newCell, L0.InstanceOf, null, sr.Headers);\r
+ graph.claimLiteral(newCell, L0.HasName, L0.NameOf, L0.String, "Headers", Bindings.STRING);\r
+ graph.addLiteral(newCell, sr.Headers_columnLabels, sr.Headers_columnLabels_Inverse, L0.StringArray, colNames, Bindings.STRING_ARRAY);\r
+ graph.addLiteral(newCell, sr.Headers_columnWidths, sr.Headers_columnWidths_Inverse, L0.IntegerArray, colWidths, Bindings.INT_ARRAY);\r
+ graph.claim(result, L0.ConsistsOf, L0.PartOf, newCell);\r
+ }\r
+\r
+// {\r
+// \r
+// double[] doubles = new double[10*2];\r
+// for(int i=0;i<10*2;i++) doubles[i] = i;\r
+// \r
+// Resource newCell = graph.newResource();\r
+// graph.claim(newCell, L0.InstanceOf, null, sr.DoubleArrayCell);\r
+// graph.addLiteral(newCell, sr.DoubleArrayCell_HasWidth, sr.DoubleArrayCell_HasWidth_Inverse, L0.Integer, 10, Bindings.INTEGER);\r
+// graph.addLiteral(newCell, sr.HasLocation, sr.HasLocation_Inverse, L0.String, "B2", Bindings.STRING);\r
+// graph.addLiteral(newCell, sr.DoubleArrayCell_HasDoubleArray, sr.DoubleArrayCell_HasDoubleArray_Inverse, L0.DoubleArray, doubles, Bindings.DOUBLE_ARRAY);\r
+// graph.claim(result, L0.HasChildVariables, L0.HasChildVariables_Inverse, newCell);\r
+// \r
+// }\r
+ return result;\r
+\r
+ }\r
+\r
+ public static String getStringRepresentation(ReadGraph graph, Resource model, String sheetName, String range) throws DatabaseException {\r
+ Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SpreadsheetResource SHEET = SpreadsheetResource.getInstance(graph);\r
+ Variable sheetVariable = null;\r
+ for(Resource book : graph.syncRequest(new ObjectsWithType(configuration, L0.ConsistsOf, SHEET.Book))) {\r
+ for(Resource sheet : graph.syncRequest(new ObjectsWithType(book, L0.ConsistsOf, SHEET.Spreadsheet))) {\r
+ if(sheetName.equals(NameUtils.getSafeName(graph, sheet))) {\r
+ sheetVariable = Variables.getVariable(graph, sheet);\r
+ }\r
+ }\r
+ }\r
+\r
+ if(sheetVariable == null)\r
+ return null;\r
+\r
+ Variable rangeVariable = sheetVariable.getChild(graph, range);\r
+\r
+\r
+ String[][] rangeCells = rangeVariable.getPropertyValue(graph, SheetVariables.RANGE_CELL_NAMES);\r
+ if(rangeCells == null || rangeCells[0].length <= 1)\r
+ return null;\r
+ else {\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("{");\r
+ for(int i = 0; i < rangeCells.length; i++) {\r
+ sb.append("{");\r
+ for(int j = 0; j < rangeCells[i].length; j++) {\r
+ String valueCell = rangeCells[i][j];\r
+ Variable cell = sheetVariable.getChild(graph, valueCell);\r
+ Variant valueVariant = cell.getPropertyValue(graph, SheetVariables.CONTENT, Bindings.VARIANT);\r
+ Object valueObject = valueVariant.getValue();\r
+ sb.append(valueObject.toString());\r
+ if(j < rangeCells[i].length - 1)\r
+ sb.append(", ");\r
+ }\r
+ sb.append("}");\r
+ if(i < rangeCells.length - 1)\r
+ sb.append(", ");\r
+ }\r
+ sb.append("}");\r
+\r
+ return sb.toString();\r
+ }\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ * Semantum Oy - Bug #4192\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.utils.imports;\r
+\r
+import java.io.File;\r
+import java.io.IOException;\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.Set;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Status;\r
+import org.eclipse.core.runtime.SubMonitor;\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.adapter.AdaptException;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.databoard.container.DataContainers;\r
+import org.simantics.databoard.container.DataFormatException;\r
+import org.simantics.databoard.container.FormatHandler;\r
+import org.simantics.db.Issue;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.primitiverequest.PossibleResource;\r
+import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.request.PossibleObjectWithType;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.common.request.WriteResultRequest;\r
+import org.simantics.db.common.utils.ListUtils;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.exception.ResourceNotFoundException;\r
+import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor;\r
+import org.simantics.db.layer0.migration.MigrationState;\r
+import org.simantics.db.layer0.migration.MigrationStateKeys;\r
+import org.simantics.db.layer0.migration.MigrationUtils;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
+import org.simantics.db.layer0.util.ModelDependenciesBean;\r
+import org.simantics.db.layer0.util.ModelDependency;\r
+import org.simantics.db.layer0.util.RemoverUtil;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.diagram.stubs.DiagramResource;\r
+import org.simantics.issues.common.AllBatchIssueSources;\r
+import org.simantics.issues.common.BatchIssueSource;\r
+import org.simantics.issues.ontology.IssueResource;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.layer0.utils.direct.GraphUtils;\r
+import org.simantics.modeling.utils.BatchValidations;\r
+import org.simantics.operation.Layer0X;\r
+import org.simantics.scl.runtime.function.Function1;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.Activator;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.utils.ModelUtils;\r
+\r
+/**\r
+ * Utilities for importing tg files: Models, Modules and Function libraries\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class ImportUtils {\r
+\r
+ /**\r
+ * Null-checked begin task for monitor\r
+ * @param monitor\r
+ * @param taskName\r
+ * @param totalWork\r
+ */\r
+ private static void beginTask(IProgressMonitor monitor, String taskName, int totalWork) {\r
+ if(monitor != null)\r
+ monitor.beginTask(taskName, totalWork);\r
+ }\r
+ \r
+ /**\r
+ * Null-checked sub task for monitor\r
+ * @param monitor\r
+ * @param taskName\r
+ */\r
+ private static void subTask(IProgressMonitor monitor, String taskName) {\r
+ if(monitor != null)\r
+ monitor.subTask(taskName);\r
+ }\r
+ \r
+ /**\r
+ * Null-checked worked command for monitor\r
+ * @param monitor\r
+ * @param work\r
+ */\r
+ private static void worked(IProgressMonitor monitor, int work) {\r
+ if(monitor != null)\r
+ monitor.worked(work);\r
+ }\r
+\r
+\r
+ /**\r
+ * Read a file from hard drive using handlers \r
+ * @param path\r
+ * @param handlers\r
+ * @return IStatus if import failed, otherwise the result is determined by handlers\r
+ */\r
+ public static Object readFile(String path, HashMap<String, FormatHandler<Object>> handlers) {\r
+ Object result = null;\r
+ try {\r
+ File file = new File(path);\r
+ if(!file.isFile()) {\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import failed: File " + path + " not found", null);\r
+ } else { \r
+ result = DataContainers.readFile(file, handlers);\r
+ }\r
+ } catch(DataFormatException e) {\r
+ e.printStackTrace();\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import failed", e); \r
+ } catch(IOException e) {\r
+ e.printStackTrace();\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import failed", e); \r
+ } catch(Exception e) {\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import failed", e); \r
+ }\r
+ return result;\r
+ }\r
+\r
+\r
+\r
+ /* ********************************* */\r
+ /* ******* IMPORT MODEL ********* */\r
+ /* ********************************* */\r
+ public static IStatus importModelFile(String path, final IProgressMonitor monitor) throws Exception {\r
+ return importModelFile(path, monitor, null);\r
+ }\r
+ public static IStatus importModelFile(String path, final IProgressMonitor monitor, Function1<Resource,WriteRequest> callback) throws Exception {\r
+ final Resource project = Simantics.getProject().get();\r
+ if(project == null) return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import model: project not found", null);\r
+\r
+ beginTask(monitor, "Import model", 10);\r
+ final File importFile = new File(path);\r
+ MigrationState state = MigrationUtils.newState();\r
+ state.setProperty(MigrationStateKeys.BASE_URI, SysdynResource.URIs.Migration);\r
+ state.setProperty(MigrationStateKeys.MODEL_FILE, importFile);\r
+ state.setProperty(MigrationStateKeys.UPDATE_DEPENDENCIES, Boolean.FALSE);\r
+\r
+ Session session = Simantics.getSession();\r
+ \r
+ //TODO\r
+ // With this empty write it is possible to group change sets nicely in undo view and make good undoable collection\r
+ session.syncRequest(new WriteRequest() {\r
+ \r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ graph.markUndoPoint();\r
+ Layer0Utils.addCommentMetadata(graph, "Imported Sysdyn model from " + importFile.getName());\r
+ }\r
+ });\r
+ \r
+ final ModelDependenciesBean dependenciesBean = getModelDependenciesBean(state);\r
+ if(dependenciesBean != null) {\r
+ for(ModelDependency dependency : dependenciesBean.dependencies) {\r
+ Resource existing = session.sync(new PossibleResource(dependency.uri));\r
+ if(existing == null) {\r
+ MigrationUtils.importSharedOntology(session, dependency.tg);\r
+ }\r
+ }\r
+ }\r
+ \r
+ Resource result = null;\r
+ try {\r
+ result = MigrationUtils.importMigrated(monitor, session, importFile, state, new DefaultPasteImportAdvisor(project), project);\r
+ } catch (Exception e1) {\r
+ e1.printStackTrace();\r
+ throw e1;\r
+ }\r
+\r
+ if(result == null || !(result instanceof Resource)) {\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import model failed: File could not be read.", null);\r
+ } else {\r
+ try {\r
+ final Resource ModelRoot = result;\r
+ IStatus status = Simantics.getSession().syncRequest(new WriteResultRequest<IStatus>() {\r
+\r
+ @Override\r
+ public IStatus perform(WriteGraph graph) throws DatabaseException {\r
+ if(!graph.isInstanceOf(ModelRoot, SysdynResource.getInstance(graph).SysdynModel)) {\r
+ // Imported model was not a SysdynModel, display error message.\r
+ Resource instanceOf = graph.getPossibleObject(ModelRoot, Layer0.getInstance(graph).InstanceOf);\r
+ String type = "...";\r
+ if(instanceOf != null)\r
+ type = NameUtils.getSafeName(graph, instanceOf);\r
+ else {\r
+ Resource inheritedFrom = graph.getPossibleObject(ModelRoot, Layer0.getInstance(graph).Inherits);\r
+ if(inheritedFrom != null)\r
+ type = NameUtils.getSafeName(graph, inheritedFrom);\r
+ }\r
+ final String ft = type; \r
+ graph.deny(ModelRoot, Layer0.getInstance(graph).PartOf);\r
+\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The imported file is not of type: System Dynamics Model (" + ft +")", null);\r
+ } else {\r
+ subTask(monitor, "Add required dependencies");\r
+ addDependencies(graph, ModelRoot);\r
+ worked(monitor, 1);\r
+ subTask(monitor, "Remove unnecessary issue sources");\r
+ removeIssueSourcesFromModules(graph, ModelRoot);\r
+ worked(monitor, 1);\r
+ subTask(monitor, "Add enumeration issue source");\r
+ addEnumerationIssueSource(graph, ModelRoot);\r
+ worked(monitor, 1);\r
+ subTask(monitor, "Add unit issue source");\r
+ addUnitIssueSource(graph, ModelRoot);\r
+ worked(monitor, 1);\r
+ subTask(monitor, "Add shadow profile");\r
+ addShadowProfile(graph, ModelRoot);\r
+ worked(monitor, 1); \r
+ subTask(monitor, "Add SCL Main");\r
+ addSCLMain(graph, ModelRoot);\r
+ worked(monitor, 1); \r
+ subTask(monitor, "Activate model");\r
+ activateModel(graph, ModelRoot);\r
+ worked(monitor, 1);\r
+ }\r
+ return null;\r
+\r
+ }\r
+\r
+\r
+ });\r
+\r
+ if(status != null)\r
+ return status;\r
+\r
+ subTask(monitor, "Validate model");\r
+ Collection<Resource> confs = Simantics.getSession().syncRequest(new Read<Collection<Resource>>() {\r
+\r
+ @Override\r
+ public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {\r
+ return findAllConfigurations(graph, ModelRoot);\r
+ }\r
+\r
+ });\r
+\r
+\r
+ // Batch validate all issue sources after import\r
+ try {\r
+ for(Resource conf : confs) {\r
+ /*\r
+ * This section is copied from BatchValidations.runAll. runAll did\r
+ * not find module types to validate.\r
+ */\r
+// BatchValidations.runAll(null, mod);\r
+\r
+ final Collection<BatchIssueSource> validations = session.sync( new AllBatchIssueSources(ModelRoot) );\r
+ SubMonitor progress = null;\r
+ if(monitor != null)\r
+ progress = SubMonitor.convert(monitor, "Validate Model", 100);\r
+ Collection<Resource> contexts = Collections.singletonList(conf);\r
+ for(BatchIssueSource bis : validations) {\r
+ Map<Resource, Set<Issue>> is = BatchValidations.validate(monitor != null ? progress.newChild(90, SubMonitor.SUPPRESS_NONE) : null, bis, contexts);\r
+ BatchValidations.store(monitor != null ? progress.newChild(10, SubMonitor.SUPPRESS_NONE) : null, bis.getResource(), is);\r
+ }\r
+ }\r
+ } catch(Throwable t) {\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Batch validate failed: Model could not be imported.", t);\r
+ } \r
+\r
+ worked(monitor, 1);\r
+\r
+ if(callback != null) {\r
+ WriteRequest userRequest = callback.apply(result);\r
+ if(userRequest != null)\r
+ Simantics.sync(userRequest);\r
+ }\r
+\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import model failed: Model could not be imported.", e);\r
+ }\r
+\r
+ return Status.OK_STATUS;\r
+ }\r
+ }\r
+\r
+ private static ModelDependenciesBean getModelDependenciesBean(MigrationState state) throws DatabaseException {\r
+ Map<String,Variant> extensions = state.getProperty(MigrationStateKeys.TG_EXTENSIONS);\r
+ final Variant variant = extensions.get(ModelDependenciesBean.EXTENSION_KEY);\r
+ if (variant != null) {\r
+ try {\r
+ return (ModelDependenciesBean) variant.getValue(ModelDependenciesBean.BINDING);\r
+ } catch (AdaptException e) {\r
+ e.printStackTrace();\r
+ //Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not get model dependencies bean.", e));\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+ protected static void addSCLMain(WriteGraph graph, Resource modelRoot) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ \r
+ Collection<Resource> SCLModules = graph.syncRequest(new ObjectsWithType(modelRoot, L0.ConsistsOf, L0.SCLModule));\r
+ \r
+ boolean hasIt = false;\r
+ \r
+ for(Resource r : SCLModules) {\r
+ if("SCLMain".equals(NameUtils.getSafeName(graph, r))) {\r
+ hasIt = true;\r
+ break;\r
+ }\r
+ }\r
+ \r
+ if(!hasIt) {\r
+ ModelUtils.createSCLMain(graph, modelRoot);\r
+ }\r
+ \r
+ }\r
+\r
+ private static void removeIssueSourcesFromModules(WriteGraph graph, Resource modelRoot) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ IssueResource ISSUE = IssueResource.getInstance(graph);\r
+\r
+ for(Resource m : findAllModelsAndModules(graph, modelRoot)) {\r
+ if(m.equals(modelRoot))\r
+ continue;\r
+\r
+ // Module may contain issue sources due to legacy reasons. Remove these. \r
+ for(Resource issueSource : graph.syncRequest(new ObjectsWithType(m, L0.ConsistsOf, ISSUE.IssueSource))) {\r
+ // Issues are created to virtual graphs, so they should not need to be removed. Just in case they are created, remove them first\r
+ for(Resource issue : graph.getObjects(issueSource, ISSUE.IssueSource_Manages)) {\r
+ RemoverUtil.remove(graph, issue);\r
+ }\r
+\r
+ // finally remove the issue source\r
+ RemoverUtil.remove(graph, issueSource);\r
+ }\r
+ }\r
+\r
+ }\r
+\r
+ private static void activateModel(WriteGraph graph, Resource modelRoot) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
+ if(!graph.hasStatement(modelRoot, L0X.IsActivatedBy)) {\r
+ Resource project = graph.getPossibleObject(modelRoot, L0.PartOf);\r
+ if(project != null) {\r
+ graph.claim(modelRoot, L0X.IsActivatedBy, project);\r
+ }\r
+ }\r
+ }\r
+\r
+ private static void addDependencies(WriteGraph graph, Resource modelRoot) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+\r
+ ArrayList<String> links = new ArrayList<String>();\r
+ for(Resource link : graph.getObjects(modelRoot, L0.IsLinkedTo))\r
+ links.add(graph.getURI(link));\r
+\r
+ if(!links.contains("http://www.semantum.fi/Simupedia-1.0")) {\r
+ Resource simupedia = graph.getPossibleResource("http://www.semantum.fi/Simupedia-1.0");\r
+ if(simupedia != null)\r
+ graph.claim(modelRoot, L0.IsLinkedTo, simupedia);\r
+ }\r
+\r
+ if(!links.contains("http://www.simantics.org/SelectionView-1.2")) {\r
+ Resource selectionView = graph.getPossibleResource("http://www.simantics.org/SelectionView-1.2");\r
+ if(selectionView != null)\r
+ graph.claim(modelRoot, L0.IsLinkedTo, selectionView);\r
+ }\r
+\r
+ if(!links.contains("http://www.semantum.fi/SimupediaWorkbench-1.0")) {\r
+ Resource simupediaWb = graph.getPossibleResource("http://www.semantum.fi/SimupediaWorkbench-1.0");\r
+ if(simupediaWb != null)\r
+ graph.claim(modelRoot, L0.IsLinkedTo, simupediaWb);\r
+ }\r
+ \r
+ if(!links.contains("http://www.simantics.org/Documentation-1.2")) {\r
+ Resource documentation = graph.getPossibleResource("http://www.simantics.org/Documentation-1.2");\r
+ if(documentation != null)\r
+ graph.claim(modelRoot, L0.IsLinkedTo, documentation);\r
+ }\r
+ }\r
+\r
+ private static void addEnumerationIssueSource(WriteGraph graph, Resource modelRoot) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph); \r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Collection<Resource> enumerationIssueSources = graph.syncRequest(new ObjectsWithType(modelRoot, L0.ConsistsOf, sr.Validations_Enumerations_EnumerationIssueSource));\r
+ if(enumerationIssueSources.isEmpty()) {\r
+ GraphUtils.create2(graph,\r
+ sr.Validations_Enumerations_EnumerationIssueSource,\r
+ L0X.IsActivatedBy, modelRoot,\r
+ L0.PartOf, modelRoot\r
+ ); \r
+ } \r
+ }\r
+ \r
+\r
+ private static void addUnitIssueSource(WriteGraph graph, Resource modelRoot) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph); \r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Collection<Resource> unitIssueSources = graph.syncRequest(new ObjectsWithType(modelRoot, L0.ConsistsOf, sr.Validations_Units_UnitIssueSource));\r
+ if(unitIssueSources.isEmpty()) {\r
+ GraphUtils.create2(graph,\r
+ sr.Validations_Units_UnitIssueSource,\r
+ L0X.IsActivatedBy, modelRoot,\r
+ L0.PartOf, modelRoot,\r
+ IssueResource.getInstance(graph).IssueSource_active, false\r
+ ); \r
+ } \r
+ }\r
+ \r
+ private static void addShadowProfile(WriteGraph graph, Resource modelRoot) throws DatabaseException {\r
+ DiagramResource DIA = DiagramResource.getInstance(graph);\r
+ SysdynResource SR = SysdynResource.getInstance(graph);\r
+ Resource defaultProfile = graph.syncRequest(new PossibleObjectWithType(modelRoot, Layer0.getInstance(graph).ConsistsOf, SR.DefaultProfile));\r
+ if(defaultProfile != null) {\r
+ Resource entryList = graph.getPossibleObject(defaultProfile, DIA.HasEntries);\r
+ if(entryList != null) {\r
+ List<Resource> entries = ListUtils.toList(graph, entryList);\r
+ if(entries != null && !entries.contains(SR.Profiles_ShadowVisualizations)) {\r
+ ListUtils.insertBack(graph, entryList, Collections.singletonList(SR.Profiles_ShadowVisualizations));\r
+ }\r
+ }\r
+ \r
+ }\r
+ }\r
+\r
+ private static Collection<Resource> findAllConfigurations(ReadGraph graph, Resource modelRoot) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ StructuralResource2 SR2 = StructuralResource2.getInstance(graph);\r
+ Collection<Resource> modulesAndModels = findAllModelsAndModules(graph, modelRoot);\r
+ Collection<Resource> configurations = new ArrayList<Resource>();\r
+\r
+ for(Resource r : modulesAndModels) {\r
+ if(graph.isInheritedFrom(r, sr.Module)) {\r
+ configurations.add(graph.getPossibleObject(r, SR2.IsDefinedBy));\r
+ } else if(graph.isInstanceOf(r, sr.SysdynModel)) {\r
+ configurations.add(graph.getPossibleObject(modelRoot, SimulationResource.getInstance(graph).HasConfiguration));\r
+ }\r
+ }\r
+\r
+ return configurations;\r
+ }\r
+\r
+ private static Collection<Resource> findAllModelsAndModules(ReadGraph graph, Resource modelRoot) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Collection<Resource> modelsAndModules = new ArrayList<Resource>();\r
+ modelsAndModules.add(modelRoot);\r
+\r
+ for(Resource r : graph.getObjects(modelRoot, L0.ConsistsOf)) {\r
+ if(graph.isInheritedFrom(r, sr.Module)) {\r
+ modelsAndModules.add(r);\r
+ }\r
+ }\r
+\r
+ return modelsAndModules;\r
+ }\r
+\r
+ /* ********************************* */\r
+ /* ******* IMPORT MODULE ********* */\r
+ /* ********************************* */\r
+ public static IStatus importModuleFile(final Resource model, String path, final IProgressMonitor monitor) {\r
+ beginTask(monitor, "Import Module", 3);\r
+\r
+ MigrationState state = MigrationUtils.newState();\r
+ state.setProperty(MigrationStateKeys.BASE_URI, SysdynResource.URIs.Migration);\r
+ state.setProperty(MigrationStateKeys.UPDATE_DEPENDENCIES, Boolean.FALSE);\r
+\r
+ Resource result = null;\r
+ try {\r
+ result = MigrationUtils.importMigrated(monitor, Simantics.getSession(), new File(path), state, new DefaultPasteImportAdvisor(model), model);\r
+ } catch (Exception e1) {\r
+ e1.printStackTrace();\r
+ }\r
+\r
+\r
+ if(result == null) {\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import module failed: Module could not be imported.", null);\r
+ } else {\r
+ final Resource ModuleRoot = result;\r
+ // Check that the imported file actually was a module. Display error message otherwise.\r
+ try {\r
+ subTask(monitor, "Validate model");\r
+ IStatus status = Simantics.getSession().syncRequest(new WriteResultRequest<IStatus>() {\r
+\r
+ @Override\r
+ public IStatus perform(WriteGraph graph) throws DatabaseException {\r
+ if(!graph.isInheritedFrom(ModuleRoot, SysdynResource.getInstance(graph).Module)) {\r
+ Resource instanceOf = graph.getPossibleObject(ModuleRoot, Layer0.getInstance(graph).InstanceOf);\r
+ String type = "...";\r
+ if(instanceOf != null)\r
+ type = NameUtils.getSafeName(graph, instanceOf);\r
+ else {\r
+ Resource inheritedFrom = graph.getPossibleObject(ModuleRoot, Layer0.getInstance(graph).Inherits);\r
+ if(inheritedFrom != null)\r
+ type = NameUtils.getSafeName(graph, inheritedFrom);\r
+ }\r
+ final String ft = type; \r
+ graph.deny(ModuleRoot, Layer0.getInstance(graph).PartOf);\r
+\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The imported file is not of type: System Dynamics Module (" + ft +")", null);\r
+ } \r
+ return null;\r
+ }\r
+ });\r
+\r
+ if(status != null)\r
+ return status;\r
+ worked(monitor, 1);\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ }\r
+\r
+ return Status.OK_STATUS;\r
+ }\r
+\r
+\r
+\r
+ /* ********************************* */\r
+ /* *** IMPORT FUNCTION LIBRARY *** */\r
+ /* ********************************* */\r
+\r
+ public static IStatus importFunctionLibrary(final Resource functionLibrary, final String path, final IProgressMonitor monitor) {\r
+ beginTask(monitor, "Import Module", 3);\r
+\r
+ // Ensure that shared functions ontology exists\r
+ ensureSharedOntologies();\r
+ \r
+ MigrationState state = MigrationUtils.newState();\r
+ state.setProperty(MigrationStateKeys.BASE_URI, SysdynResource.URIs.Migration);\r
+ state.setProperty(MigrationStateKeys.UPDATE_DEPENDENCIES, Boolean.FALSE);\r
+\r
+ Resource result = null;\r
+ try {\r
+ result = MigrationUtils.importMigrated(monitor, Simantics.getSession(), new File(path), state, new DefaultPasteImportAdvisor(functionLibrary), functionLibrary);\r
+ } catch (Exception e1) {\r
+ e1.printStackTrace();\r
+ }\r
+\r
+ if(result == null) {\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import Function library failed: Function library not be imported.", null);\r
+ } else {\r
+ final Resource FunctionLibraryRoot = (Resource) result;\r
+ // Link the imported library to the selected resource (functionLibrary)\r
+ try {\r
+ subTask(monitor, "Validate model");\r
+ IStatus status = Simantics.getSession().syncRequest(new WriteResultRequest<IStatus>() {\r
+\r
+ /**\r
+ * Link the imported library to the selected resource (functionLibrary)\r
+ * The imported library can be either SysdynModelicaFunctionLibrary or SysdynFunctionOntology\r
+ */\r
+ @Override\r
+ public IStatus perform(WriteGraph graph) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ // Case: SharedFunctionOntology. Link to SharedOntologies\r
+ if(graph.isInstanceOf(FunctionLibraryRoot, SysdynResource.getInstance(graph).SharedFunctionOntology)) {\r
+ Resource library = graph.getResource("http://SharedOntologies");\r
+ if(!graph.hasStatement(library, l0.ConsistsOf, FunctionLibraryRoot)) {\r
+ graph.claim(library, l0.ConsistsOf, FunctionLibraryRoot);\r
+ }\r
+\r
+ // Link model to the shared library\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+ Resource model = functionLibrary;\r
+ while(!graph.isInstanceOf(model, sr.SysdynModel) && graph.isInstanceOf(model, l0.Ontology))\r
+ model = graph.getSingleObject(model, l0.PartOf);\r
+ if(graph.isInstanceOf(model, sr.SysdynModel)) {\r
+ graph.claim(model, l0.IsLinkedTo, l0.IsLinkedTo_Inverse, FunctionLibraryRoot);\r
+ }\r
+\r
+ // Case: not SharedFunctionOntology or SysdynModelicaFunctionLibrary. \r
+ } else if(!graph.isInstanceOf(FunctionLibraryRoot, SysdynResource.getInstance(graph).SysdynModelicaFunctionLibrary)) {\r
+ Resource instanceOf = graph.getPossibleObject(FunctionLibraryRoot,l0.InstanceOf);\r
+ String type = "...";\r
+ if(instanceOf != null)\r
+ type = NameUtils.getSafeName(graph, instanceOf);\r
+ else {\r
+ Resource inheritedFrom = graph.getPossibleObject(FunctionLibraryRoot, l0.Inherits);\r
+ if(inheritedFrom != null)\r
+ type = NameUtils.getSafeName(graph, inheritedFrom);\r
+ }\r
+ final String ft = type; \r
+\r
+ // Remove the functionLibrary ConsistsOf root relation\r
+ graph.deny(FunctionLibraryRoot, l0.PartOf);\r
+\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The imported file is not of type: Function Library (" + ft +")", null);\r
+ }\r
+ return null;\r
+\r
+\r
+ }\r
+ });\r
+\r
+ if(status != null)\r
+ return status;\r
+ worked(monitor, 1);\r
+\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+\r
+ return Status.OK_STATUS;\r
+ }\r
+\r
+ private static void ensureSharedOntologies() {\r
+ // Make sure the "http://SharedOntologies resource exists\r
+ try {\r
+ Boolean hasSharedOntologies;\r
+ hasSharedOntologies = Simantics.getSession().syncRequest(new Read<Boolean>() {\r
+\r
+ @Override\r
+ public Boolean perform(ReadGraph graph) throws DatabaseException {\r
+ try {\r
+ graph.getResource("http://SharedOntologies");\r
+ } catch (ResourceNotFoundException e) {\r
+ return false;\r
+ } \r
+ return true;\r
+ }\r
+ });\r
+\r
+ if(!hasSharedOntologies) {\r
+ Simantics.getSession().syncRequest(new WriteRequest() {\r
+\r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ GraphUtils.create2(graph, l0.Library, \r
+ l0.HasName, "SharedOntologies",\r
+ l0.PartOf, graph.getResource("http:/"));\r
+ }\r
+ });\r
+\r
+ }\r
+ } catch (DatabaseException e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.utils.imports;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteOnlyGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.exception.ResourceNotFoundException;\r
+import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor;\r
+import org.simantics.graph.representation.Root;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.SysdynResource;\r
+\r
+/**\r
+ * Import advisor for importing function libraries to SysDyn\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class SysdynFunctionLibraryImportAdvisor extends DefaultPasteImportAdvisor {\r
+ \r
+ public SysdynFunctionLibraryImportAdvisor(Resource library) {\r
+ super(library);\r
+ }\r
+ \r
+ @Override\r
+ public void analyzeType(ReadGraph graph, Root root) throws DatabaseException {\r
+ // Change the library to http://SharedOntologies, if the imported library is of type SharedFunctionOntology\r
+ if(root.type.equals(SysdynResource.URIs.SharedFunctionOntology)) {\r
+ try {\r
+ library = graph.getResource("http://SharedOntologies");\r
+ } catch (ResourceNotFoundException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public Resource createRoot(WriteOnlyGraph graph, Root root) throws DatabaseException {\r
+ Layer0 l0 = graph.getService(Layer0.class);\r
+ this.root = graph.newResource();\r
+ graph.claim(library, l0.ConsistsOf, l0.PartOf, this.root);\r
+ String name = root.name;\r
+ String newName = nameMappings.get(name);\r
+ graph.addLiteral(this.root, l0.HasName, l0.NameOf, l0.String, newName, Bindings.STRING);\r
+ return this.root;\r
+\r
+ }\r
+ \r
+}
\ No newline at end of file
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.utils.imports;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Status;\r
+import org.simantics.Simantics;\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.container.DataContainer;\r
+import org.simantics.databoard.container.DataFormatException;\r
+import org.simantics.databoard.container.FormatHandler;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor;\r
+import org.simantics.db.layer0.migration.MigrationState;\r
+import org.simantics.db.layer0.migration.MigrationStateKeys;\r
+import org.simantics.db.layer0.migration.MigrationStep;\r
+import org.simantics.db.layer0.migration.MigrationUtils;\r
+import org.simantics.graph.representation.TransferableGraph1;\r
+import org.simantics.sysdyn.Activator;\r
+\r
+/**\r
+ * Handler for migrating a tg and importing it to database\r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
+public class SysdynImportFormatHandler implements FormatHandler<Object> {\r
+ \r
+ private final Resource parent;\r
+ private final IProgressMonitor monitor;\r
+ private final String migrationURI;\r
+ private final DefaultPasteImportAdvisor importAdvisor;\r
+ \r
+ /**\r
+ * Works 2 (2 * 1) in the monitor\r
+ * @param parent\r
+ * @param migrationURI\r
+ * @param monitor\r
+ */\r
+ public SysdynImportFormatHandler(Resource parent, String migrationURI, IProgressMonitor monitor) {\r
+ this(parent, migrationURI, monitor, null);\r
+ }\r
+ \r
+ public SysdynImportFormatHandler(Resource parent, String migrationURI, IProgressMonitor monitor,\r
+ DefaultPasteImportAdvisor importAdvisor) {\r
+ assert(parent != null);\r
+ assert(migrationURI != null);\r
+ this.parent = parent;\r
+ this.monitor = monitor;\r
+ this.migrationURI = migrationURI;\r
+ this.importAdvisor = importAdvisor;\r
+ }\r
+\r
+ private void subTask(String taskName) {\r
+ if(monitor != null)\r
+ monitor.subTask(taskName);\r
+ }\r
+ \r
+ private void worked(int work) {\r
+ if(monitor != null)\r
+ monitor.worked(work);\r
+ }\r
+ \r
+ @Override\r
+ public Binding getBinding() {\r
+ return TransferableGraph1.BINDING;\r
+ }\r
+\r
+ @Override\r
+ public Object process(DataContainer container) throws DataFormatException {\r
+ DefaultPasteImportAdvisor ia = importAdvisor != null ? importAdvisor : new DefaultPasteImportAdvisor(parent);\r
+ try {\r
+ subTask("Migrate");\r
+ Session session = Simantics.getSession();\r
+ TransferableGraph1 tg = (TransferableGraph1)container.content.getValue();\r
+\r
+ MigrationStep step = MigrationUtils.getStep(session, migrationURI);\r
+ MigrationState state = MigrationUtils.newState();\r
+ state.setProperty(MigrationStateKeys.CURRENT_TG, tg);\r
+ step.applyTo(monitor, session, state);\r
+// tg = state.getProperty(MigrationStateKeys.CURRENT_TG);\r
+\r
+ worked(1);\r
+ subTask("Import");\r
+ \r
+// DefaultPasteHandler.defaultExecute(tg, parent, ia);\r
+ MigrationUtils.importTo(monitor, session, state, parent, ia);\r
+ worked(1);\r
+ \r
+ Resource result = state.getProperty(MigrationStateKeys.CURRENT_RESOURCE);\r
+ if(result == null)\r
+ result = ia.getRoot();\r
+ \r
+ return result;\r
+\r
+ } catch (Exception e) {\r
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Import module failed", e);\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+The models in this folder are made by Sampsa Ruutu (openprod_demo), \r
+Tero Jokinen (MaintenanceModel, WorkModel), and Ossi Koivula \r
+(HealthModel). Health model and openprod_demo seem to be broken in \r
+newer versions of the tool. The models are not distributed with the \r
+installer, even though they're probably public.
\ No newline at end of file