aboutsummaryrefslogtreecommitdiffstats
path: root/modelica-parser-lalrpop/examples
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-12-17 18:34:47 -0800
committerbnewbold <bnewbold@robocracy.org>2016-12-17 18:34:47 -0800
commit9f82aceb9fbdb42f332d68f4a423123bd0788b2c (patch)
treec082b9795be8e9e9d286c8f8f1345d22f3ec1b59 /modelica-parser-lalrpop/examples
parentf6364ebcac0d0a88a3cc6812fd2120c97b42cc26 (diff)
downloadmodelthing-9f82aceb9fbdb42f332d68f4a423123bd0788b2c.tar.gz
modelthing-9f82aceb9fbdb42f332d68f4a423123bd0788b2c.zip
refactor modelica parser into separate crate
Diffstat (limited to 'modelica-parser-lalrpop/examples')
-rw-r--r--modelica-parser-lalrpop/examples/minimal.modelica6
-rw-r--r--modelica-parser-lalrpop/examples/minimal2.modelica8
-rw-r--r--modelica-parser-lalrpop/examples/minimal3.modelica8
3 files changed, 22 insertions, 0 deletions
diff --git a/modelica-parser-lalrpop/examples/minimal.modelica b/modelica-parser-lalrpop/examples/minimal.modelica
new file mode 100644
index 0000000..85335a5
--- /dev/null
+++ b/modelica-parser-lalrpop/examples/minimal.modelica
@@ -0,0 +1,6 @@
+model FirstOrder
+ parameter Real c;
+ Real x;
+equation
+ der(x) = -c*x;
+end FirstOrder;
diff --git a/modelica-parser-lalrpop/examples/minimal2.modelica b/modelica-parser-lalrpop/examples/minimal2.modelica
new file mode 100644
index 0000000..69790b0
--- /dev/null
+++ b/modelica-parser-lalrpop/examples/minimal2.modelica
@@ -0,0 +1,8 @@
+model FirstOrder
+ parameter Real c;
+ Real x;
+equation
+ connect(c, x);
+ 1 = c;
+ (5 + 4) = x;
+end FirstOrder;
diff --git a/modelica-parser-lalrpop/examples/minimal3.modelica b/modelica-parser-lalrpop/examples/minimal3.modelica
new file mode 100644
index 0000000..1e9a211
--- /dev/null
+++ b/modelica-parser-lalrpop/examples/minimal3.modelica
@@ -0,0 +1,8 @@
+model MinimalModel
+ parameter Real a;
+ Real b;
+equation
+ connect(a, b);
+ a = 1;
+ b = (abs(a) + 2) / 4;
+end FirstOrder;