diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2016-03-21 16:34:52 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2016-03-21 16:34:52 +0100 |
commit | b2cae2db744cfca2825bf1e7a1c1ed41ce105c3e (patch) | |
tree | 200a771e223ab99dac30db9708147406e1f5dc0f /ddl/out/java/LambdaCube | |
parent | 19ee05bdc20b43ee8d88eaee49c8ee6a8c38e3fb (diff) |
generate toJSON java code
Diffstat (limited to 'ddl/out/java/LambdaCube')
57 files changed, 2283 insertions, 57 deletions
diff --git a/ddl/out/java/LambdaCube/IR/AccumulationContext.java b/ddl/out/java/LambdaCube/IR/AccumulationContext.java index 47e92cc..b10b75e 100644 --- a/ddl/out/java/LambdaCube/IR/AccumulationContext.java +++ b/ddl/out/java/LambdaCube/IR/AccumulationContext.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/ArrayValue.java b/ddl/out/java/LambdaCube/IR/ArrayValue.java index df0d096..c4c9e04 100644 --- a/ddl/out/java/LambdaCube/IR/ArrayValue.java +++ b/ddl/out/java/LambdaCube/IR/ArrayValue.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/Backend.java b/ddl/out/java/LambdaCube/IR/Backend.java index 8a395af..ec22de1 100644 --- a/ddl/out/java/LambdaCube/IR/Backend.java +++ b/ddl/out/java/LambdaCube/IR/Backend.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/BlendEquation.java b/ddl/out/java/LambdaCube/IR/BlendEquation.java index c6712d3..d4a5565 100644 --- a/ddl/out/java/LambdaCube/IR/BlendEquation.java +++ b/ddl/out/java/LambdaCube/IR/BlendEquation.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/Blending.java b/ddl/out/java/LambdaCube/IR/Blending.java index f3e1e48..d1ad43a 100644 --- a/ddl/out/java/LambdaCube/IR/Blending.java +++ b/ddl/out/java/LambdaCube/IR/Blending.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/BlendingFactor.java b/ddl/out/java/LambdaCube/IR/BlendingFactor.java index b45483b..4819c5f 100644 --- a/ddl/out/java/LambdaCube/IR/BlendingFactor.java +++ b/ddl/out/java/LambdaCube/IR/BlendingFactor.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/ClearImage.java b/ddl/out/java/LambdaCube/IR/ClearImage.java index de88625..f90d03b 100644 --- a/ddl/out/java/LambdaCube/IR/ClearImage.java +++ b/ddl/out/java/LambdaCube/IR/ClearImage.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/ColorArity.java b/ddl/out/java/LambdaCube/IR/ColorArity.java index 1a89df1..5ff3d31 100644 --- a/ddl/out/java/LambdaCube/IR/ColorArity.java +++ b/ddl/out/java/LambdaCube/IR/ColorArity.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/Command.java b/ddl/out/java/LambdaCube/IR/Command.java index 4a1c915..6f390c5 100644 --- a/ddl/out/java/LambdaCube/IR/Command.java +++ b/ddl/out/java/LambdaCube/IR/Command.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/ComparisonFunction.java b/ddl/out/java/LambdaCube/IR/ComparisonFunction.java index d64cd26..34f1072 100644 --- a/ddl/out/java/LambdaCube/IR/ComparisonFunction.java +++ b/ddl/out/java/LambdaCube/IR/ComparisonFunction.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/CullMode.java b/ddl/out/java/LambdaCube/IR/CullMode.java index bd462ef..5f9a8ea 100644 --- a/ddl/out/java/LambdaCube/IR/CullMode.java +++ b/ddl/out/java/LambdaCube/IR/CullMode.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/EdgeMode.java b/ddl/out/java/LambdaCube/IR/EdgeMode.java index 280ed53..9ac7276 100644 --- a/ddl/out/java/LambdaCube/IR/EdgeMode.java +++ b/ddl/out/java/LambdaCube/IR/EdgeMode.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/FetchPrimitive.java b/ddl/out/java/LambdaCube/IR/FetchPrimitive.java index 89bc1a5..6543729 100644 --- a/ddl/out/java/LambdaCube/IR/FetchPrimitive.java +++ b/ddl/out/java/LambdaCube/IR/FetchPrimitive.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/Filter.java b/ddl/out/java/LambdaCube/IR/Filter.java index 19d9a39..7398a2e 100644 --- a/ddl/out/java/LambdaCube/IR/Filter.java +++ b/ddl/out/java/LambdaCube/IR/Filter.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/FragmentOperation.java b/ddl/out/java/LambdaCube/IR/FragmentOperation.java index 65d284f..c2e9290 100644 --- a/ddl/out/java/LambdaCube/IR/FragmentOperation.java +++ b/ddl/out/java/LambdaCube/IR/FragmentOperation.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/FrontFace.java b/ddl/out/java/LambdaCube/IR/FrontFace.java index 6d5323d..7897723 100644 --- a/ddl/out/java/LambdaCube/IR/FrontFace.java +++ b/ddl/out/java/LambdaCube/IR/FrontFace.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/ImageRef.java b/ddl/out/java/LambdaCube/IR/ImageRef.java index bc382bc..333947c 100644 --- a/ddl/out/java/LambdaCube/IR/ImageRef.java +++ b/ddl/out/java/LambdaCube/IR/ImageRef.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/ImageSemantic.java b/ddl/out/java/LambdaCube/IR/ImageSemantic.java index 4777479..fc31e36 100644 --- a/ddl/out/java/LambdaCube/IR/ImageSemantic.java +++ b/ddl/out/java/LambdaCube/IR/ImageSemantic.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/InputType.java b/ddl/out/java/LambdaCube/IR/InputType.java index 48d42c1..1c8578d 100644 --- a/ddl/out/java/LambdaCube/IR/InputType.java +++ b/ddl/out/java/LambdaCube/IR/InputType.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/JSON.java b/ddl/out/java/LambdaCube/IR/JSON.java index a25af3d..953f675 100644 --- a/ddl/out/java/LambdaCube/IR/JSON.java +++ b/ddl/out/java/LambdaCube/IR/JSON.java | |||
@@ -1,11 +1,12 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
6 | import java.util.ArrayList; | 6 | import java.util.ArrayList; |
7 | import java.util.HashMap; | 7 | import java.util.HashMap; |
8 | import java.util.Iterator; | 8 | import java.util.Iterator; |
9 | import java.util.Map; | ||
9 | import org.json.*; | 10 | import org.json.*; |
10 | import RT.*; | 11 | import RT.*; |
11 | 12 | ||
@@ -1564,4 +1565,1766 @@ public class JSON { | |||
1564 | } | 1565 | } |
1565 | throw new Exception("unknown type"); | 1566 | throw new Exception("unknown type"); |
1566 | } | 1567 | } |
1568 | |||
1569 | public static Object toJSON(Type type, Object rawObj) throws JSONException, Exception { | ||
1570 | switch (type) { | ||
1571 | case ArrayValue: { | ||
1572 | ArrayValue v = (ArrayValue)rawObj; | ||
1573 | JSONObject obj = new JSONObject(); | ||
1574 | switch (v.tag) { | ||
1575 | case VBoolArray: | ||
1576 | obj.put("tag", "VBoolArray"); | ||
1577 | { | ||
1578 | ArrayValue.VBoolArray_ tv = (ArrayValue.VBoolArray_)v; | ||
1579 | obj.put("arg0", toJSON(Type.Array_Bool,tv._0)); | ||
1580 | } | ||
1581 | break; | ||
1582 | case VIntArray: | ||
1583 | obj.put("tag", "VIntArray"); | ||
1584 | { | ||
1585 | ArrayValue.VIntArray_ tv = (ArrayValue.VIntArray_)v; | ||
1586 | obj.put("arg0", toJSON(Type.Array_Int32,tv._0)); | ||
1587 | } | ||
1588 | break; | ||
1589 | case VWordArray: | ||
1590 | obj.put("tag", "VWordArray"); | ||
1591 | { | ||
1592 | ArrayValue.VWordArray_ tv = (ArrayValue.VWordArray_)v; | ||
1593 | obj.put("arg0", toJSON(Type.Array_Word32,tv._0)); | ||
1594 | } | ||
1595 | break; | ||
1596 | case VFloatArray: | ||
1597 | obj.put("tag", "VFloatArray"); | ||
1598 | { | ||
1599 | ArrayValue.VFloatArray_ tv = (ArrayValue.VFloatArray_)v; | ||
1600 | obj.put("arg0", toJSON(Type.Array_Float,tv._0)); | ||
1601 | } | ||
1602 | break; | ||
1603 | } | ||
1604 | return obj; | ||
1605 | } | ||
1606 | case Value: { | ||
1607 | Value v = (Value)rawObj; | ||
1608 | JSONObject obj = new JSONObject(); | ||
1609 | switch (v.tag) { | ||
1610 | case VBool: | ||
1611 | obj.put("tag", "VBool"); | ||
1612 | { | ||
1613 | Value.VBool_ tv = (Value.VBool_)v; | ||
1614 | obj.put("arg0", toJSON(Type.Bool,tv._0)); | ||
1615 | } | ||
1616 | break; | ||
1617 | case VV2B: | ||
1618 | obj.put("tag", "VV2B"); | ||
1619 | { | ||
1620 | Value.VV2B_ tv = (Value.VV2B_)v; | ||
1621 | obj.put("arg0", toJSON(Type.V2_Bool,tv._0)); | ||
1622 | } | ||
1623 | break; | ||
1624 | case VV3B: | ||
1625 | obj.put("tag", "VV3B"); | ||
1626 | { | ||
1627 | Value.VV3B_ tv = (Value.VV3B_)v; | ||
1628 | obj.put("arg0", toJSON(Type.V3_Bool,tv._0)); | ||
1629 | } | ||
1630 | break; | ||
1631 | case VV4B: | ||
1632 | obj.put("tag", "VV4B"); | ||
1633 | { | ||
1634 | Value.VV4B_ tv = (Value.VV4B_)v; | ||
1635 | obj.put("arg0", toJSON(Type.V4_Bool,tv._0)); | ||
1636 | } | ||
1637 | break; | ||
1638 | case VWord: | ||
1639 | obj.put("tag", "VWord"); | ||
1640 | { | ||
1641 | Value.VWord_ tv = (Value.VWord_)v; | ||
1642 | obj.put("arg0", toJSON(Type.Word32,tv._0)); | ||
1643 | } | ||
1644 | break; | ||
1645 | case VV2U: | ||
1646 | obj.put("tag", "VV2U"); | ||
1647 | { | ||
1648 | Value.VV2U_ tv = (Value.VV2U_)v; | ||
1649 | obj.put("arg0", toJSON(Type.V2_Word,tv._0)); | ||
1650 | } | ||
1651 | break; | ||
1652 | case VV3U: | ||
1653 | obj.put("tag", "VV3U"); | ||
1654 | { | ||
1655 | Value.VV3U_ tv = (Value.VV3U_)v; | ||
1656 | obj.put("arg0", toJSON(Type.V3_Word,tv._0)); | ||
1657 | } | ||
1658 | break; | ||
1659 | case VV4U: | ||
1660 | obj.put("tag", "VV4U"); | ||
1661 | { | ||
1662 | Value.VV4U_ tv = (Value.VV4U_)v; | ||
1663 | obj.put("arg0", toJSON(Type.V4_Word,tv._0)); | ||
1664 | } | ||
1665 | break; | ||
1666 | case VInt: | ||
1667 | obj.put("tag", "VInt"); | ||
1668 | { | ||
1669 | Value.VInt_ tv = (Value.VInt_)v; | ||
1670 | obj.put("arg0", toJSON(Type.Int32,tv._0)); | ||
1671 | } | ||
1672 | break; | ||
1673 | case VV2I: | ||
1674 | obj.put("tag", "VV2I"); | ||
1675 | { | ||
1676 | Value.VV2I_ tv = (Value.VV2I_)v; | ||
1677 | obj.put("arg0", toJSON(Type.V2_Int,tv._0)); | ||
1678 | } | ||
1679 | break; | ||
1680 | case VV3I: | ||
1681 | obj.put("tag", "VV3I"); | ||
1682 | { | ||
1683 | Value.VV3I_ tv = (Value.VV3I_)v; | ||
1684 | obj.put("arg0", toJSON(Type.V3_Int,tv._0)); | ||
1685 | } | ||
1686 | break; | ||
1687 | case VV4I: | ||
1688 | obj.put("tag", "VV4I"); | ||
1689 | { | ||
1690 | Value.VV4I_ tv = (Value.VV4I_)v; | ||
1691 | obj.put("arg0", toJSON(Type.V4_Int,tv._0)); | ||
1692 | } | ||
1693 | break; | ||
1694 | case VFloat: | ||
1695 | obj.put("tag", "VFloat"); | ||
1696 | { | ||
1697 | Value.VFloat_ tv = (Value.VFloat_)v; | ||
1698 | obj.put("arg0", toJSON(Type.Float,tv._0)); | ||
1699 | } | ||
1700 | break; | ||
1701 | case VV2F: | ||
1702 | obj.put("tag", "VV2F"); | ||
1703 | { | ||
1704 | Value.VV2F_ tv = (Value.VV2F_)v; | ||
1705 | obj.put("arg0", toJSON(Type.V2_Float,tv._0)); | ||
1706 | } | ||
1707 | break; | ||
1708 | case VV3F: | ||
1709 | obj.put("tag", "VV3F"); | ||
1710 | { | ||
1711 | Value.VV3F_ tv = (Value.VV3F_)v; | ||
1712 | obj.put("arg0", toJSON(Type.V3_Float,tv._0)); | ||
1713 | } | ||
1714 | break; | ||
1715 | case VV4F: | ||
1716 | obj.put("tag", "VV4F"); | ||
1717 | { | ||
1718 | Value.VV4F_ tv = (Value.VV4F_)v; | ||
1719 | obj.put("arg0", toJSON(Type.V4_Float,tv._0)); | ||
1720 | } | ||
1721 | break; | ||
1722 | case VM22F: | ||
1723 | obj.put("tag", "VM22F"); | ||
1724 | { | ||
1725 | Value.VM22F_ tv = (Value.VM22F_)v; | ||
1726 | obj.put("arg0", toJSON(Type.V2_V2_Float,tv._0)); | ||
1727 | } | ||
1728 | break; | ||
1729 | case VM23F: | ||
1730 | obj.put("tag", "VM23F"); | ||
1731 | { | ||
1732 | Value.VM23F_ tv = (Value.VM23F_)v; | ||
1733 | obj.put("arg0", toJSON(Type.V3_V2_Float,tv._0)); | ||
1734 | } | ||
1735 | break; | ||
1736 | case VM24F: | ||
1737 | obj.put("tag", "VM24F"); | ||
1738 | { | ||
1739 | Value.VM24F_ tv = (Value.VM24F_)v; | ||
1740 | obj.put("arg0", toJSON(Type.V4_V2_Float,tv._0)); | ||
1741 | } | ||
1742 | break; | ||
1743 | case VM32F: | ||
1744 | obj.put("tag", "VM32F"); | ||
1745 | { | ||
1746 | Value.VM32F_ tv = (Value.VM32F_)v; | ||
1747 | obj.put("arg0", toJSON(Type.V2_V3_Float,tv._0)); | ||
1748 | } | ||
1749 | break; | ||
1750 | case VM33F: | ||
1751 | obj.put("tag", "VM33F"); | ||
1752 | { | ||
1753 | Value.VM33F_ tv = (Value.VM33F_)v; | ||
1754 | obj.put("arg0", toJSON(Type.V3_V3_Float,tv._0)); | ||
1755 | } | ||
1756 | break; | ||
1757 | case VM34F: | ||
1758 | obj.put("tag", "VM34F"); | ||
1759 | { | ||
1760 | Value.VM34F_ tv = (Value.VM34F_)v; | ||
1761 | obj.put("arg0", toJSON(Type.V4_V3_Float,tv._0)); | ||
1762 | } | ||
1763 | break; | ||
1764 | case VM42F: | ||
1765 | obj.put("tag", "VM42F"); | ||
1766 | { | ||
1767 | Value.VM42F_ tv = (Value.VM42F_)v; | ||
1768 | obj.put("arg0", toJSON(Type.V2_V4_Float,tv._0)); | ||
1769 | } | ||
1770 | break; | ||
1771 | case VM43F: | ||
1772 | obj.put("tag", "VM43F"); | ||
1773 | { | ||
1774 | Value.VM43F_ tv = (Value.VM43F_)v; | ||
1775 | obj.put("arg0", toJSON(Type.V3_V4_Float,tv._0)); | ||
1776 | } | ||
1777 | break; | ||
1778 | case VM44F: | ||
1779 | obj.put("tag", "VM44F"); | ||
1780 | { | ||
1781 | Value.VM44F_ tv = (Value.VM44F_)v; | ||
1782 | obj.put("arg0", toJSON(Type.V4_V4_Float,tv._0)); | ||
1783 | } | ||
1784 | break; | ||
1785 | } | ||
1786 | return obj; | ||
1787 | } | ||
1788 | case InputType: { | ||
1789 | InputType v = (InputType)rawObj; | ||
1790 | JSONObject obj = new JSONObject(); | ||
1791 | switch (v.tag) { | ||
1792 | case Bool: | ||
1793 | obj.put("tag", "Bool"); | ||
1794 | break; | ||
1795 | case V2B: | ||
1796 | obj.put("tag", "V2B"); | ||
1797 | break; | ||
1798 | case V3B: | ||
1799 | obj.put("tag", "V3B"); | ||
1800 | break; | ||
1801 | case V4B: | ||
1802 | obj.put("tag", "V4B"); | ||
1803 | break; | ||
1804 | case Word: | ||
1805 | obj.put("tag", "Word"); | ||
1806 | break; | ||
1807 | case V2U: | ||
1808 | obj.put("tag", "V2U"); | ||
1809 | break; | ||
1810 | case V3U: | ||
1811 | obj.put("tag", "V3U"); | ||
1812 | break; | ||
1813 | case V4U: | ||
1814 | obj.put("tag", "V4U"); | ||
1815 | break; | ||
1816 | case Int: | ||
1817 | obj.put("tag", "Int"); | ||
1818 | break; | ||
1819 | case V2I: | ||
1820 | obj.put("tag", "V2I"); | ||
1821 | break; | ||
1822 | case V3I: | ||
1823 | obj.put("tag", "V3I"); | ||
1824 | break; | ||
1825 | case V4I: | ||
1826 | obj.put("tag", "V4I"); | ||
1827 | break; | ||
1828 | case Float: | ||
1829 | obj.put("tag", "Float"); | ||
1830 | break; | ||
1831 | case V2F: | ||
1832 | obj.put("tag", "V2F"); | ||
1833 | break; | ||
1834 | case V3F: | ||
1835 | obj.put("tag", "V3F"); | ||
1836 | break; | ||
1837 | case V4F: | ||
1838 | obj.put("tag", "V4F"); | ||
1839 | break; | ||
1840 | case M22F: | ||
1841 | obj.put("tag", "M22F"); | ||
1842 | break; | ||
1843 | case M23F: | ||
1844 | obj.put("tag", "M23F"); | ||
1845 | break; | ||
1846 | case M24F: | ||
1847 | obj.put("tag", "M24F"); | ||
1848 | break; | ||
1849 | case M32F: | ||
1850 | obj.put("tag", "M32F"); | ||
1851 | break; | ||
1852 | case M33F: | ||
1853 | obj.put("tag", "M33F"); | ||
1854 | break; | ||
1855 | case M34F: | ||
1856 | obj.put("tag", "M34F"); | ||
1857 | break; | ||
1858 | case M42F: | ||
1859 | obj.put("tag", "M42F"); | ||
1860 | break; | ||
1861 | case M43F: | ||
1862 | obj.put("tag", "M43F"); | ||
1863 | break; | ||
1864 | case M44F: | ||
1865 | obj.put("tag", "M44F"); | ||
1866 | break; | ||
1867 | case STexture1D: | ||
1868 | obj.put("tag", "STexture1D"); | ||
1869 | break; | ||
1870 | case STexture2D: | ||
1871 | obj.put("tag", "STexture2D"); | ||
1872 | break; | ||
1873 | case STextureCube: | ||
1874 | obj.put("tag", "STextureCube"); | ||
1875 | break; | ||
1876 | case STexture1DArray: | ||
1877 | obj.put("tag", "STexture1DArray"); | ||
1878 | break; | ||
1879 | case STexture2DArray: | ||
1880 | obj.put("tag", "STexture2DArray"); | ||
1881 | break; | ||
1882 | case STexture2DRect: | ||
1883 | obj.put("tag", "STexture2DRect"); | ||
1884 | break; | ||
1885 | case FTexture1D: | ||
1886 | obj.put("tag", "FTexture1D"); | ||
1887 | break; | ||
1888 | case FTexture2D: | ||
1889 | obj.put("tag", "FTexture2D"); | ||
1890 | break; | ||
1891 | case FTexture3D: | ||
1892 | obj.put("tag", "FTexture3D"); | ||
1893 | break; | ||
1894 | case FTextureCube: | ||
1895 | obj.put("tag", "FTextureCube"); | ||
1896 | break; | ||
1897 | case FTexture1DArray: | ||
1898 | obj.put("tag", "FTexture1DArray"); | ||
1899 | break; | ||
1900 | case FTexture2DArray: | ||
1901 | obj.put("tag", "FTexture2DArray"); | ||
1902 | break; | ||
1903 | case FTexture2DMS: | ||
1904 | obj.put("tag", "FTexture2DMS"); | ||
1905 | break; | ||
1906 | case FTexture2DMSArray: | ||
1907 | obj.put("tag", "FTexture2DMSArray"); | ||
1908 | break; | ||
1909 | case FTextureBuffer: | ||
1910 | obj.put("tag", "FTextureBuffer"); | ||
1911 | break; | ||
1912 | case FTexture2DRect: | ||
1913 | obj.put("tag", "FTexture2DRect"); | ||
1914 | break; | ||
1915 | case ITexture1D: | ||
1916 | obj.put("tag", "ITexture1D"); | ||
1917 | break; | ||
1918 | case ITexture2D: | ||
1919 | obj.put("tag", "ITexture2D"); | ||
1920 | break; | ||
1921 | case ITexture3D: | ||
1922 | obj.put("tag", "ITexture3D"); | ||
1923 | break; | ||
1924 | case ITextureCube: | ||
1925 | obj.put("tag", "ITextureCube"); | ||
1926 | break; | ||
1927 | case ITexture1DArray: | ||
1928 | obj.put("tag", "ITexture1DArray"); | ||
1929 | break; | ||
1930 | case ITexture2DArray: | ||
1931 | obj.put("tag", "ITexture2DArray"); | ||
1932 | break; | ||
1933 | case ITexture2DMS: | ||
1934 | obj.put("tag", "ITexture2DMS"); | ||
1935 | break; | ||
1936 | case ITexture2DMSArray: | ||
1937 | obj.put("tag", "ITexture2DMSArray"); | ||
1938 | break; | ||
1939 | case ITextureBuffer: | ||
1940 | obj.put("tag", "ITextureBuffer"); | ||
1941 | break; | ||
1942 | case ITexture2DRect: | ||
1943 | obj.put("tag", "ITexture2DRect"); | ||
1944 | break; | ||
1945 | case UTexture1D: | ||
1946 | obj.put("tag", "UTexture1D"); | ||
1947 | break; | ||
1948 | case UTexture2D: | ||
1949 | obj.put("tag", "UTexture2D"); | ||
1950 | break; | ||
1951 | case UTexture3D: | ||
1952 | obj.put("tag", "UTexture3D"); | ||
1953 | break; | ||
1954 | case UTextureCube: | ||
1955 | obj.put("tag", "UTextureCube"); | ||
1956 | break; | ||
1957 | case UTexture1DArray: | ||
1958 | obj.put("tag", "UTexture1DArray"); | ||
1959 | break; | ||
1960 | case UTexture2DArray: | ||
1961 | obj.put("tag", "UTexture2DArray"); | ||
1962 | break; | ||
1963 | case UTexture2DMS: | ||
1964 | obj.put("tag", "UTexture2DMS"); | ||
1965 | break; | ||
1966 | case UTexture2DMSArray: | ||
1967 | obj.put("tag", "UTexture2DMSArray"); | ||
1968 | break; | ||
1969 | case UTextureBuffer: | ||
1970 | obj.put("tag", "UTextureBuffer"); | ||
1971 | break; | ||
1972 | case UTexture2DRect: | ||
1973 | obj.put("tag", "UTexture2DRect"); | ||
1974 | break; | ||
1975 | } | ||
1976 | return obj; | ||
1977 | } | ||
1978 | case PointSpriteCoordOrigin: { | ||
1979 | PointSpriteCoordOrigin v = (PointSpriteCoordOrigin)rawObj; | ||
1980 | JSONObject obj = new JSONObject(); | ||
1981 | switch (v.tag) { | ||
1982 | case LowerLeft: | ||
1983 | obj.put("tag", "LowerLeft"); | ||
1984 | break; | ||
1985 | case UpperLeft: | ||
1986 | obj.put("tag", "UpperLeft"); | ||
1987 | break; | ||
1988 | } | ||
1989 | return obj; | ||
1990 | } | ||
1991 | case PointSize: { | ||
1992 | PointSize v = (PointSize)rawObj; | ||
1993 | JSONObject obj = new JSONObject(); | ||
1994 | switch (v.tag) { | ||
1995 | case PointSize: | ||
1996 | obj.put("tag", "PointSize"); | ||
1997 | { | ||
1998 | PointSize.PointSize_ tv = (PointSize.PointSize_)v; | ||
1999 | obj.put("arg0", toJSON(Type.Float,tv._0)); | ||
2000 | } | ||
2001 | break; | ||
2002 | case ProgramPointSize: | ||
2003 | obj.put("tag", "ProgramPointSize"); | ||
2004 | break; | ||
2005 | } | ||
2006 | return obj; | ||
2007 | } | ||
2008 | case PolygonOffset: { | ||
2009 | PolygonOffset v = (PolygonOffset)rawObj; | ||
2010 | JSONObject obj = new JSONObject(); | ||
2011 | switch (v.tag) { | ||
2012 | case NoOffset: | ||
2013 | obj.put("tag", "NoOffset"); | ||
2014 | break; | ||
2015 | case Offset: | ||
2016 | obj.put("tag", "Offset"); | ||
2017 | { | ||
2018 | PolygonOffset.Offset_ tv = (PolygonOffset.Offset_)v; | ||
2019 | obj.put("arg0", toJSON(Type.Float,tv._0)); | ||
2020 | obj.put("arg1", toJSON(Type.Float,tv._1)); | ||
2021 | } | ||
2022 | break; | ||
2023 | } | ||
2024 | return obj; | ||
2025 | } | ||
2026 | case FrontFace: { | ||
2027 | FrontFace v = (FrontFace)rawObj; | ||
2028 | JSONObject obj = new JSONObject(); | ||
2029 | switch (v.tag) { | ||
2030 | case CCW: | ||
2031 | obj.put("tag", "CCW"); | ||
2032 | break; | ||
2033 | case CW: | ||
2034 | obj.put("tag", "CW"); | ||
2035 | break; | ||
2036 | } | ||
2037 | return obj; | ||
2038 | } | ||
2039 | case PolygonMode: { | ||
2040 | PolygonMode v = (PolygonMode)rawObj; | ||
2041 | JSONObject obj = new JSONObject(); | ||
2042 | switch (v.tag) { | ||
2043 | case PolygonPoint: | ||
2044 | obj.put("tag", "PolygonPoint"); | ||
2045 | { | ||
2046 | PolygonMode.PolygonPoint_ tv = (PolygonMode.PolygonPoint_)v; | ||
2047 | obj.put("arg0", toJSON(Type.PointSize,tv._0)); | ||
2048 | } | ||
2049 | break; | ||
2050 | case PolygonLine: | ||
2051 | obj.put("tag", "PolygonLine"); | ||
2052 | { | ||
2053 | PolygonMode.PolygonLine_ tv = (PolygonMode.PolygonLine_)v; | ||
2054 | obj.put("arg0", toJSON(Type.Float,tv._0)); | ||
2055 | } | ||
2056 | break; | ||
2057 | case PolygonFill: | ||
2058 | obj.put("tag", "PolygonFill"); | ||
2059 | break; | ||
2060 | } | ||
2061 | return obj; | ||
2062 | } | ||
2063 | case ProvokingVertex: { | ||
2064 | ProvokingVertex v = (ProvokingVertex)rawObj; | ||
2065 | JSONObject obj = new JSONObject(); | ||
2066 | switch (v.tag) { | ||
2067 | case FirstVertex: | ||
2068 | obj.put("tag", "FirstVertex"); | ||
2069 | break; | ||
2070 | case LastVertex: | ||
2071 | obj.put("tag", "LastVertex"); | ||
2072 | break; | ||
2073 | } | ||
2074 | return obj; | ||
2075 | } | ||
2076 | case CullMode: { | ||
2077 | CullMode v = (CullMode)rawObj; | ||
2078 | JSONObject obj = new JSONObject(); | ||
2079 | switch (v.tag) { | ||
2080 | case CullNone: | ||
2081 | obj.put("tag", "CullNone"); | ||
2082 | break; | ||
2083 | case CullFront: | ||
2084 | obj.put("tag", "CullFront"); | ||
2085 | { | ||
2086 | CullMode.CullFront_ tv = (CullMode.CullFront_)v; | ||
2087 | obj.put("arg0", toJSON(Type.FrontFace,tv._0)); | ||
2088 | } | ||
2089 | break; | ||
2090 | case CullBack: | ||
2091 | obj.put("tag", "CullBack"); | ||
2092 | { | ||
2093 | CullMode.CullBack_ tv = (CullMode.CullBack_)v; | ||
2094 | obj.put("arg0", toJSON(Type.FrontFace,tv._0)); | ||
2095 | } | ||
2096 | break; | ||
2097 | } | ||
2098 | return obj; | ||
2099 | } | ||
2100 | case ComparisonFunction: { | ||
2101 | ComparisonFunction v = (ComparisonFunction)rawObj; | ||
2102 | JSONObject obj = new JSONObject(); | ||
2103 | switch (v.tag) { | ||
2104 | case Never: | ||
2105 | obj.put("tag", "Never"); | ||
2106 | break; | ||
2107 | case Less: | ||
2108 | obj.put("tag", "Less"); | ||
2109 | break; | ||
2110 | case Equal: | ||
2111 | obj.put("tag", "Equal"); | ||
2112 | break; | ||
2113 | case Lequal: | ||
2114 | obj.put("tag", "Lequal"); | ||
2115 | break; | ||
2116 | case Greater: | ||
2117 | obj.put("tag", "Greater"); | ||
2118 | break; | ||
2119 | case Notequal: | ||
2120 | obj.put("tag", "Notequal"); | ||
2121 | break; | ||
2122 | case Gequal: | ||
2123 | obj.put("tag", "Gequal"); | ||
2124 | break; | ||
2125 | case Always: | ||
2126 | obj.put("tag", "Always"); | ||
2127 | break; | ||
2128 | } | ||
2129 | return obj; | ||
2130 | } | ||
2131 | case StencilOperation: { | ||
2132 | StencilOperation v = (StencilOperation)rawObj; | ||
2133 | JSONObject obj = new JSONObject(); | ||
2134 | switch (v.tag) { | ||
2135 | case OpZero: | ||
2136 | obj.put("tag", "OpZero"); | ||
2137 | break; | ||
2138 | case OpKeep: | ||
2139 | obj.put("tag", "OpKeep"); | ||
2140 | break; | ||
2141 | case OpReplace: | ||
2142 | obj.put("tag", "OpReplace"); | ||
2143 | break; | ||
2144 | case OpIncr: | ||
2145 | obj.put("tag", "OpIncr"); | ||
2146 | break; | ||
2147 | case OpIncrWrap: | ||
2148 | obj.put("tag", "OpIncrWrap"); | ||
2149 | break; | ||
2150 | case OpDecr: | ||
2151 | obj.put("tag", "OpDecr"); | ||
2152 | break; | ||
2153 | case OpDecrWrap: | ||
2154 | obj.put("tag", "OpDecrWrap"); | ||
2155 | break; | ||
2156 | case OpInvert: | ||
2157 | obj.put("tag", "OpInvert"); | ||
2158 | break; | ||
2159 | } | ||
2160 | return obj; | ||
2161 | } | ||
2162 | case BlendEquation: { | ||
2163 | BlendEquation v = (BlendEquation)rawObj; | ||
2164 | JSONObject obj = new JSONObject(); | ||
2165 | switch (v.tag) { | ||
2166 | case FuncAdd: | ||
2167 | obj.put("tag", "FuncAdd"); | ||
2168 | break; | ||
2169 | case FuncSubtract: | ||
2170 | obj.put("tag", "FuncSubtract"); | ||
2171 | break; | ||
2172 | case FuncReverseSubtract: | ||
2173 | obj.put("tag", "FuncReverseSubtract"); | ||
2174 | break; | ||
2175 | case Min: | ||
2176 | obj.put("tag", "Min"); | ||
2177 | break; | ||
2178 | case Max: | ||
2179 | obj.put("tag", "Max"); | ||
2180 | break; | ||
2181 | } | ||
2182 | return obj; | ||
2183 | } | ||
2184 | case BlendingFactor: { | ||
2185 | BlendingFactor v = (BlendingFactor)rawObj; | ||
2186 | JSONObject obj = new JSONObject(); | ||
2187 | switch (v.tag) { | ||
2188 | case Zero: | ||
2189 | obj.put("tag", "Zero"); | ||
2190 | break; | ||
2191 | case One: | ||
2192 | obj.put("tag", "One"); | ||
2193 | break; | ||
2194 | case SrcColor: | ||
2195 | obj.put("tag", "SrcColor"); | ||
2196 | break; | ||
2197 | case OneMinusSrcColor: | ||
2198 | obj.put("tag", "OneMinusSrcColor"); | ||
2199 | break; | ||
2200 | case DstColor: | ||
2201 | obj.put("tag", "DstColor"); | ||
2202 | break; | ||
2203 | case OneMinusDstColor: | ||
2204 | obj.put("tag", "OneMinusDstColor"); | ||
2205 | break; | ||
2206 | case SrcAlpha: | ||
2207 | obj.put("tag", "SrcAlpha"); | ||
2208 | break; | ||
2209 | case OneMinusSrcAlpha: | ||
2210 | obj.put("tag", "OneMinusSrcAlpha"); | ||
2211 | break; | ||
2212 | case DstAlpha: | ||
2213 | obj.put("tag", "DstAlpha"); | ||
2214 | break; | ||
2215 | case OneMinusDstAlpha: | ||
2216 | obj.put("tag", "OneMinusDstAlpha"); | ||
2217 | break; | ||
2218 | case ConstantColor: | ||
2219 | obj.put("tag", "ConstantColor"); | ||
2220 | break; | ||
2221 | case OneMinusConstantColor: | ||
2222 | obj.put("tag", "OneMinusConstantColor"); | ||
2223 | break; | ||
2224 | case ConstantAlpha: | ||
2225 | obj.put("tag", "ConstantAlpha"); | ||
2226 | break; | ||
2227 | case OneMinusConstantAlpha: | ||
2228 | obj.put("tag", "OneMinusConstantAlpha"); | ||
2229 | break; | ||
2230 | case SrcAlphaSaturate: | ||
2231 | obj.put("tag", "SrcAlphaSaturate"); | ||
2232 | break; | ||
2233 | } | ||
2234 | return obj; | ||
2235 | } | ||
2236 | case LogicOperation: { | ||
2237 | LogicOperation v = (LogicOperation)rawObj; | ||
2238 | JSONObject obj = new JSONObject(); | ||
2239 | switch (v.tag) { | ||
2240 | case Clear: | ||
2241 | obj.put("tag", "Clear"); | ||
2242 | break; | ||
2243 | case And: | ||
2244 | obj.put("tag", "And"); | ||
2245 | break; | ||
2246 | case AndReverse: | ||
2247 | obj.put("tag", "AndReverse"); | ||
2248 | break; | ||
2249 | case Copy: | ||
2250 | obj.put("tag", "Copy"); | ||
2251 | break; | ||
2252 | case AndInverted: | ||
2253 | obj.put("tag", "AndInverted"); | ||
2254 | break; | ||
2255 | case Noop: | ||
2256 | obj.put("tag", "Noop"); | ||
2257 | break; | ||
2258 | case Xor: | ||
2259 | obj.put("tag", "Xor"); | ||
2260 | break; | ||
2261 | case Or: | ||
2262 | obj.put("tag", "Or"); | ||
2263 | break; | ||
2264 | case Nor: | ||
2265 | obj.put("tag", "Nor"); | ||
2266 | break; | ||
2267 | case Equiv: | ||
2268 | obj.put("tag", "Equiv"); | ||
2269 | break; | ||
2270 | case Invert: | ||
2271 | obj.put("tag", "Invert"); | ||
2272 | break; | ||
2273 | case OrReverse: | ||
2274 | obj.put("tag", "OrReverse"); | ||
2275 | break; | ||
2276 | case CopyInverted: | ||
2277 | obj.put("tag", "CopyInverted"); | ||
2278 | break; | ||
2279 | case OrInverted: | ||
2280 | obj.put("tag", "OrInverted"); | ||
2281 | break; | ||
2282 | case Nand: | ||
2283 | obj.put("tag", "Nand"); | ||
2284 | break; | ||
2285 | case Set: | ||
2286 | obj.put("tag", "Set"); | ||
2287 | break; | ||
2288 | } | ||
2289 | return obj; | ||
2290 | } | ||
2291 | case StencilOps: { | ||
2292 | StencilOps v = (StencilOps)rawObj; | ||
2293 | JSONObject obj = new JSONObject(); | ||
2294 | switch (v.tag) { | ||
2295 | case StencilOps: | ||
2296 | obj.put("tag", "StencilOps"); | ||
2297 | { | ||
2298 | StencilOps.StencilOps_ tv = (StencilOps.StencilOps_)v; | ||
2299 | obj.put("frontStencilOp", toJSON(Type.StencilOperation,tv.frontStencilOp)); | ||
2300 | obj.put("backStencilOp", toJSON(Type.StencilOperation,tv.backStencilOp)); | ||
2301 | } | ||
2302 | break; | ||
2303 | } | ||
2304 | return obj; | ||
2305 | } | ||
2306 | case StencilTest: { | ||
2307 | StencilTest v = (StencilTest)rawObj; | ||
2308 | JSONObject obj = new JSONObject(); | ||
2309 | switch (v.tag) { | ||
2310 | case StencilTest: | ||
2311 | obj.put("tag", "StencilTest"); | ||
2312 | { | ||
2313 | StencilTest.StencilTest_ tv = (StencilTest.StencilTest_)v; | ||
2314 | obj.put("stencilComparision", toJSON(Type.ComparisonFunction,tv.stencilComparision)); | ||
2315 | obj.put("stencilReference", toJSON(Type.Int32,tv.stencilReference)); | ||
2316 | obj.put("stencilMask", toJSON(Type.Word32,tv.stencilMask)); | ||
2317 | } | ||
2318 | break; | ||
2319 | } | ||
2320 | return obj; | ||
2321 | } | ||
2322 | case StencilTests: { | ||
2323 | StencilTests v = (StencilTests)rawObj; | ||
2324 | JSONObject obj = new JSONObject(); | ||
2325 | switch (v.tag) { | ||
2326 | case StencilTests: | ||
2327 | obj.put("tag", "StencilTests"); | ||
2328 | { | ||
2329 | StencilTests.StencilTests_ tv = (StencilTests.StencilTests_)v; | ||
2330 | obj.put("arg0", toJSON(Type.StencilTest,tv._0)); | ||
2331 | obj.put("arg1", toJSON(Type.StencilTest,tv._1)); | ||
2332 | } | ||
2333 | break; | ||
2334 | } | ||
2335 | return obj; | ||
2336 | } | ||
2337 | case FetchPrimitive: { | ||
2338 | FetchPrimitive v = (FetchPrimitive)rawObj; | ||
2339 | JSONObject obj = new JSONObject(); | ||
2340 | switch (v.tag) { | ||
2341 | case Points: | ||
2342 | obj.put("tag", "Points"); | ||
2343 | break; | ||
2344 | case Lines: | ||
2345 | obj.put("tag", "Lines"); | ||
2346 | break; | ||
2347 | case Triangles: | ||
2348 | obj.put("tag", "Triangles"); | ||
2349 | break; | ||
2350 | case LinesAdjacency: | ||
2351 | obj.put("tag", "LinesAdjacency"); | ||
2352 | break; | ||
2353 | case TrianglesAdjacency: | ||
2354 | obj.put("tag", "TrianglesAdjacency"); | ||
2355 | break; | ||
2356 | } | ||
2357 | return obj; | ||
2358 | } | ||
2359 | case OutputPrimitive: { | ||
2360 | OutputPrimitive v = (OutputPrimitive)rawObj; | ||
2361 | JSONObject obj = new JSONObject(); | ||
2362 | switch (v.tag) { | ||
2363 | case TrianglesOutput: | ||
2364 | obj.put("tag", "TrianglesOutput"); | ||
2365 | break; | ||
2366 | case LinesOutput: | ||
2367 | obj.put("tag", "LinesOutput"); | ||
2368 | break; | ||
2369 | case PointsOutput: | ||
2370 | obj.put("tag", "PointsOutput"); | ||
2371 | break; | ||
2372 | } | ||
2373 | return obj; | ||
2374 | } | ||
2375 | case ColorArity: { | ||
2376 | ColorArity v = (ColorArity)rawObj; | ||
2377 | JSONObject obj = new JSONObject(); | ||
2378 | switch (v.tag) { | ||
2379 | case Red: | ||
2380 | obj.put("tag", "Red"); | ||
2381 | break; | ||
2382 | case RG: | ||
2383 | obj.put("tag", "RG"); | ||
2384 | break; | ||
2385 | case RGB: | ||
2386 | obj.put("tag", "RGB"); | ||
2387 | break; | ||
2388 | case RGBA: | ||
2389 | obj.put("tag", "RGBA"); | ||
2390 | break; | ||
2391 | } | ||
2392 | return obj; | ||
2393 | } | ||
2394 | case Blending: { | ||
2395 | Blending v = (Blending)rawObj; | ||
2396 | JSONObject obj = new JSONObject(); | ||
2397 | switch (v.tag) { | ||
2398 | case NoBlending: | ||
2399 | obj.put("tag", "NoBlending"); | ||
2400 | break; | ||
2401 | case BlendLogicOp: | ||
2402 | obj.put("tag", "BlendLogicOp"); | ||
2403 | { | ||
2404 | Blending.BlendLogicOp_ tv = (Blending.BlendLogicOp_)v; | ||
2405 | obj.put("arg0", toJSON(Type.LogicOperation,tv._0)); | ||
2406 | } | ||
2407 | break; | ||
2408 | case Blend: | ||
2409 | obj.put("tag", "Blend"); | ||
2410 | { | ||
2411 | Blending.Blend_ tv = (Blending.Blend_)v; | ||
2412 | obj.put("colorEqSrc", toJSON(Type.BlendEquation,tv.colorEqSrc)); | ||
2413 | obj.put("alphaEqSrc", toJSON(Type.BlendEquation,tv.alphaEqSrc)); | ||
2414 | obj.put("colorFSrc", toJSON(Type.BlendingFactor,tv.colorFSrc)); | ||
2415 | obj.put("colorFDst", toJSON(Type.BlendingFactor,tv.colorFDst)); | ||
2416 | obj.put("alphaFSrc", toJSON(Type.BlendingFactor,tv.alphaFSrc)); | ||
2417 | obj.put("alphaFDst", toJSON(Type.BlendingFactor,tv.alphaFDst)); | ||
2418 | obj.put("color", toJSON(Type.V4_Float,tv.color)); | ||
2419 | } | ||
2420 | break; | ||
2421 | } | ||
2422 | return obj; | ||
2423 | } | ||
2424 | case RasterContext: { | ||
2425 | RasterContext v = (RasterContext)rawObj; | ||
2426 | JSONObject obj = new JSONObject(); | ||
2427 | switch (v.tag) { | ||
2428 | case PointCtx: | ||
2429 | obj.put("tag", "PointCtx"); | ||
2430 | { | ||
2431 | RasterContext.PointCtx_ tv = (RasterContext.PointCtx_)v; | ||
2432 | obj.put("arg0", toJSON(Type.PointSize,tv._0)); | ||
2433 | obj.put("arg1", toJSON(Type.Float,tv._1)); | ||
2434 | obj.put("arg2", toJSON(Type.PointSpriteCoordOrigin,tv._2)); | ||
2435 | } | ||
2436 | break; | ||
2437 | case LineCtx: | ||
2438 | obj.put("tag", "LineCtx"); | ||
2439 | { | ||
2440 | RasterContext.LineCtx_ tv = (RasterContext.LineCtx_)v; | ||
2441 | obj.put("arg0", toJSON(Type.Float,tv._0)); | ||
2442 | obj.put("arg1", toJSON(Type.ProvokingVertex,tv._1)); | ||
2443 | } | ||
2444 | break; | ||
2445 | case TriangleCtx: | ||
2446 | obj.put("tag", "TriangleCtx"); | ||
2447 | { | ||
2448 | RasterContext.TriangleCtx_ tv = (RasterContext.TriangleCtx_)v; | ||
2449 | obj.put("arg0", toJSON(Type.CullMode,tv._0)); | ||
2450 | obj.put("arg1", toJSON(Type.PolygonMode,tv._1)); | ||
2451 | obj.put("arg2", toJSON(Type.PolygonOffset,tv._2)); | ||
2452 | obj.put("arg3", toJSON(Type.ProvokingVertex,tv._3)); | ||
2453 | } | ||
2454 | break; | ||
2455 | } | ||
2456 | return obj; | ||
2457 | } | ||
2458 | case FragmentOperation: { | ||
2459 | FragmentOperation v = (FragmentOperation)rawObj; | ||
2460 | JSONObject obj = new JSONObject(); | ||
2461 | switch (v.tag) { | ||
2462 | case DepthOp: | ||
2463 | obj.put("tag", "DepthOp"); | ||
2464 | { | ||
2465 | FragmentOperation.DepthOp_ tv = (FragmentOperation.DepthOp_)v; | ||
2466 | obj.put("arg0", toJSON(Type.ComparisonFunction,tv._0)); | ||
2467 | obj.put("arg1", toJSON(Type.Bool,tv._1)); | ||
2468 | } | ||
2469 | break; | ||
2470 | case StencilOp: | ||
2471 | obj.put("tag", "StencilOp"); | ||
2472 | { | ||
2473 | FragmentOperation.StencilOp_ tv = (FragmentOperation.StencilOp_)v; | ||
2474 | obj.put("arg0", toJSON(Type.StencilTests,tv._0)); | ||
2475 | obj.put("arg1", toJSON(Type.StencilOps,tv._1)); | ||
2476 | obj.put("arg2", toJSON(Type.StencilOps,tv._2)); | ||
2477 | } | ||
2478 | break; | ||
2479 | case ColorOp: | ||
2480 | obj.put("tag", "ColorOp"); | ||
2481 | { | ||
2482 | FragmentOperation.ColorOp_ tv = (FragmentOperation.ColorOp_)v; | ||
2483 | obj.put("arg0", toJSON(Type.Blending,tv._0)); | ||
2484 | obj.put("arg1", toJSON(Type.Value,tv._1)); | ||
2485 | } | ||
2486 | break; | ||
2487 | } | ||
2488 | return obj; | ||
2489 | } | ||
2490 | case AccumulationContext: { | ||
2491 | AccumulationContext v = (AccumulationContext)rawObj; | ||
2492 | JSONObject obj = new JSONObject(); | ||
2493 | switch (v.tag) { | ||
2494 | case AccumulationContext: | ||
2495 | obj.put("tag", "AccumulationContext"); | ||
2496 | { | ||
2497 | AccumulationContext.AccumulationContext_ tv = (AccumulationContext.AccumulationContext_)v; | ||
2498 | obj.put("accViewportName", toJSON(Type.Maybe_String,tv.accViewportName)); | ||
2499 | obj.put("accOperations", toJSON(Type.List_FragmentOperation,tv.accOperations)); | ||
2500 | } | ||
2501 | break; | ||
2502 | } | ||
2503 | return obj; | ||
2504 | } | ||
2505 | case TextureDataType: { | ||
2506 | TextureDataType v = (TextureDataType)rawObj; | ||
2507 | JSONObject obj = new JSONObject(); | ||
2508 | switch (v.tag) { | ||
2509 | case FloatT: | ||
2510 | obj.put("tag", "FloatT"); | ||
2511 | { | ||
2512 | TextureDataType.FloatT_ tv = (TextureDataType.FloatT_)v; | ||
2513 | obj.put("arg0", toJSON(Type.ColorArity,tv._0)); | ||
2514 | } | ||
2515 | break; | ||
2516 | case IntT: | ||
2517 | obj.put("tag", "IntT"); | ||
2518 | { | ||
2519 | TextureDataType.IntT_ tv = (TextureDataType.IntT_)v; | ||
2520 | obj.put("arg0", toJSON(Type.ColorArity,tv._0)); | ||
2521 | } | ||
2522 | break; | ||
2523 | case WordT: | ||
2524 | obj.put("tag", "WordT"); | ||
2525 | { | ||
2526 | TextureDataType.WordT_ tv = (TextureDataType.WordT_)v; | ||
2527 | obj.put("arg0", toJSON(Type.ColorArity,tv._0)); | ||
2528 | } | ||
2529 | break; | ||
2530 | case ShadowT: | ||
2531 | obj.put("tag", "ShadowT"); | ||
2532 | break; | ||
2533 | } | ||
2534 | return obj; | ||
2535 | } | ||
2536 | case TextureType: { | ||
2537 | TextureType v = (TextureType)rawObj; | ||
2538 | JSONObject obj = new JSONObject(); | ||
2539 | switch (v.tag) { | ||
2540 | case Texture1D: | ||
2541 | obj.put("tag", "Texture1D"); | ||
2542 | { | ||
2543 | TextureType.Texture1D_ tv = (TextureType.Texture1D_)v; | ||
2544 | obj.put("arg0", toJSON(Type.TextureDataType,tv._0)); | ||
2545 | obj.put("arg1", toJSON(Type.Int,tv._1)); | ||
2546 | } | ||
2547 | break; | ||
2548 | case Texture2D: | ||
2549 | obj.put("tag", "Texture2D"); | ||
2550 | { | ||
2551 | TextureType.Texture2D_ tv = (TextureType.Texture2D_)v; | ||
2552 | obj.put("arg0", toJSON(Type.TextureDataType,tv._0)); | ||
2553 | obj.put("arg1", toJSON(Type.Int,tv._1)); | ||
2554 | } | ||
2555 | break; | ||
2556 | case Texture3D: | ||
2557 | obj.put("tag", "Texture3D"); | ||
2558 | { | ||
2559 | TextureType.Texture3D_ tv = (TextureType.Texture3D_)v; | ||
2560 | obj.put("arg0", toJSON(Type.TextureDataType,tv._0)); | ||
2561 | } | ||
2562 | break; | ||
2563 | case TextureCube: | ||
2564 | obj.put("tag", "TextureCube"); | ||
2565 | { | ||
2566 | TextureType.TextureCube_ tv = (TextureType.TextureCube_)v; | ||
2567 | obj.put("arg0", toJSON(Type.TextureDataType,tv._0)); | ||
2568 | } | ||
2569 | break; | ||
2570 | case TextureRect: | ||
2571 | obj.put("tag", "TextureRect"); | ||
2572 | { | ||
2573 | TextureType.TextureRect_ tv = (TextureType.TextureRect_)v; | ||
2574 | obj.put("arg0", toJSON(Type.TextureDataType,tv._0)); | ||
2575 | } | ||
2576 | break; | ||
2577 | case Texture2DMS: | ||
2578 | obj.put("tag", "Texture2DMS"); | ||
2579 | { | ||
2580 | TextureType.Texture2DMS_ tv = (TextureType.Texture2DMS_)v; | ||
2581 | obj.put("arg0", toJSON(Type.TextureDataType,tv._0)); | ||
2582 | obj.put("arg1", toJSON(Type.Int,tv._1)); | ||
2583 | obj.put("arg2", toJSON(Type.Int,tv._2)); | ||
2584 | obj.put("arg3", toJSON(Type.Bool,tv._3)); | ||
2585 | } | ||
2586 | break; | ||
2587 | case TextureBuffer: | ||
2588 | obj.put("tag", "TextureBuffer"); | ||
2589 | { | ||
2590 | TextureType.TextureBuffer_ tv = (TextureType.TextureBuffer_)v; | ||
2591 | obj.put("arg0", toJSON(Type.TextureDataType,tv._0)); | ||
2592 | } | ||
2593 | break; | ||
2594 | } | ||
2595 | return obj; | ||
2596 | } | ||
2597 | case MipMap: { | ||
2598 | MipMap v = (MipMap)rawObj; | ||
2599 | JSONObject obj = new JSONObject(); | ||
2600 | switch (v.tag) { | ||
2601 | case Mip: | ||
2602 | obj.put("tag", "Mip"); | ||
2603 | { | ||
2604 | MipMap.Mip_ tv = (MipMap.Mip_)v; | ||
2605 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2606 | obj.put("arg1", toJSON(Type.Int,tv._1)); | ||
2607 | } | ||
2608 | break; | ||
2609 | case NoMip: | ||
2610 | obj.put("tag", "NoMip"); | ||
2611 | break; | ||
2612 | case AutoMip: | ||
2613 | obj.put("tag", "AutoMip"); | ||
2614 | { | ||
2615 | MipMap.AutoMip_ tv = (MipMap.AutoMip_)v; | ||
2616 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2617 | obj.put("arg1", toJSON(Type.Int,tv._1)); | ||
2618 | } | ||
2619 | break; | ||
2620 | } | ||
2621 | return obj; | ||
2622 | } | ||
2623 | case Filter: { | ||
2624 | Filter v = (Filter)rawObj; | ||
2625 | JSONObject obj = new JSONObject(); | ||
2626 | switch (v.tag) { | ||
2627 | case Nearest: | ||
2628 | obj.put("tag", "Nearest"); | ||
2629 | break; | ||
2630 | case Linear: | ||
2631 | obj.put("tag", "Linear"); | ||
2632 | break; | ||
2633 | case NearestMipmapNearest: | ||
2634 | obj.put("tag", "NearestMipmapNearest"); | ||
2635 | break; | ||
2636 | case NearestMipmapLinear: | ||
2637 | obj.put("tag", "NearestMipmapLinear"); | ||
2638 | break; | ||
2639 | case LinearMipmapNearest: | ||
2640 | obj.put("tag", "LinearMipmapNearest"); | ||
2641 | break; | ||
2642 | case LinearMipmapLinear: | ||
2643 | obj.put("tag", "LinearMipmapLinear"); | ||
2644 | break; | ||
2645 | } | ||
2646 | return obj; | ||
2647 | } | ||
2648 | case EdgeMode: { | ||
2649 | EdgeMode v = (EdgeMode)rawObj; | ||
2650 | JSONObject obj = new JSONObject(); | ||
2651 | switch (v.tag) { | ||
2652 | case Repeat: | ||
2653 | obj.put("tag", "Repeat"); | ||
2654 | break; | ||
2655 | case MirroredRepeat: | ||
2656 | obj.put("tag", "MirroredRepeat"); | ||
2657 | break; | ||
2658 | case ClampToEdge: | ||
2659 | obj.put("tag", "ClampToEdge"); | ||
2660 | break; | ||
2661 | case ClampToBorder: | ||
2662 | obj.put("tag", "ClampToBorder"); | ||
2663 | break; | ||
2664 | } | ||
2665 | return obj; | ||
2666 | } | ||
2667 | case ImageSemantic: { | ||
2668 | ImageSemantic v = (ImageSemantic)rawObj; | ||
2669 | JSONObject obj = new JSONObject(); | ||
2670 | switch (v.tag) { | ||
2671 | case Depth: | ||
2672 | obj.put("tag", "Depth"); | ||
2673 | break; | ||
2674 | case Stencil: | ||
2675 | obj.put("tag", "Stencil"); | ||
2676 | break; | ||
2677 | case Color: | ||
2678 | obj.put("tag", "Color"); | ||
2679 | break; | ||
2680 | } | ||
2681 | return obj; | ||
2682 | } | ||
2683 | case ImageRef: { | ||
2684 | ImageRef v = (ImageRef)rawObj; | ||
2685 | JSONObject obj = new JSONObject(); | ||
2686 | switch (v.tag) { | ||
2687 | case TextureImage: | ||
2688 | obj.put("tag", "TextureImage"); | ||
2689 | { | ||
2690 | ImageRef.TextureImage_ tv = (ImageRef.TextureImage_)v; | ||
2691 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2692 | obj.put("arg1", toJSON(Type.Int,tv._1)); | ||
2693 | obj.put("arg2", toJSON(Type.Maybe_Int,tv._2)); | ||
2694 | } | ||
2695 | break; | ||
2696 | case Framebuffer: | ||
2697 | obj.put("tag", "Framebuffer"); | ||
2698 | { | ||
2699 | ImageRef.Framebuffer_ tv = (ImageRef.Framebuffer_)v; | ||
2700 | obj.put("arg0", toJSON(Type.ImageSemantic,tv._0)); | ||
2701 | } | ||
2702 | break; | ||
2703 | } | ||
2704 | return obj; | ||
2705 | } | ||
2706 | case ClearImage: { | ||
2707 | ClearImage v = (ClearImage)rawObj; | ||
2708 | JSONObject obj = new JSONObject(); | ||
2709 | switch (v.tag) { | ||
2710 | case ClearImage: | ||
2711 | obj.put("tag", "ClearImage"); | ||
2712 | { | ||
2713 | ClearImage.ClearImage_ tv = (ClearImage.ClearImage_)v; | ||
2714 | obj.put("imageSemantic", toJSON(Type.ImageSemantic,tv.imageSemantic)); | ||
2715 | obj.put("clearValue", toJSON(Type.Value,tv.clearValue)); | ||
2716 | } | ||
2717 | break; | ||
2718 | } | ||
2719 | return obj; | ||
2720 | } | ||
2721 | case Command: { | ||
2722 | Command v = (Command)rawObj; | ||
2723 | JSONObject obj = new JSONObject(); | ||
2724 | switch (v.tag) { | ||
2725 | case SetRasterContext: | ||
2726 | obj.put("tag", "SetRasterContext"); | ||
2727 | { | ||
2728 | Command.SetRasterContext_ tv = (Command.SetRasterContext_)v; | ||
2729 | obj.put("arg0", toJSON(Type.RasterContext,tv._0)); | ||
2730 | } | ||
2731 | break; | ||
2732 | case SetAccumulationContext: | ||
2733 | obj.put("tag", "SetAccumulationContext"); | ||
2734 | { | ||
2735 | Command.SetAccumulationContext_ tv = (Command.SetAccumulationContext_)v; | ||
2736 | obj.put("arg0", toJSON(Type.AccumulationContext,tv._0)); | ||
2737 | } | ||
2738 | break; | ||
2739 | case SetRenderTarget: | ||
2740 | obj.put("tag", "SetRenderTarget"); | ||
2741 | { | ||
2742 | Command.SetRenderTarget_ tv = (Command.SetRenderTarget_)v; | ||
2743 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2744 | } | ||
2745 | break; | ||
2746 | case SetProgram: | ||
2747 | obj.put("tag", "SetProgram"); | ||
2748 | { | ||
2749 | Command.SetProgram_ tv = (Command.SetProgram_)v; | ||
2750 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2751 | } | ||
2752 | break; | ||
2753 | case SetSamplerUniform: | ||
2754 | obj.put("tag", "SetSamplerUniform"); | ||
2755 | { | ||
2756 | Command.SetSamplerUniform_ tv = (Command.SetSamplerUniform_)v; | ||
2757 | obj.put("arg0", toJSON(Type.String,tv._0)); | ||
2758 | obj.put("arg1", toJSON(Type.Int,tv._1)); | ||
2759 | } | ||
2760 | break; | ||
2761 | case SetTexture: | ||
2762 | obj.put("tag", "SetTexture"); | ||
2763 | { | ||
2764 | Command.SetTexture_ tv = (Command.SetTexture_)v; | ||
2765 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2766 | obj.put("arg1", toJSON(Type.Int,tv._1)); | ||
2767 | } | ||
2768 | break; | ||
2769 | case SetSampler: | ||
2770 | obj.put("tag", "SetSampler"); | ||
2771 | { | ||
2772 | Command.SetSampler_ tv = (Command.SetSampler_)v; | ||
2773 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2774 | obj.put("arg1", toJSON(Type.Maybe_Int,tv._1)); | ||
2775 | } | ||
2776 | break; | ||
2777 | case RenderSlot: | ||
2778 | obj.put("tag", "RenderSlot"); | ||
2779 | { | ||
2780 | Command.RenderSlot_ tv = (Command.RenderSlot_)v; | ||
2781 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2782 | } | ||
2783 | break; | ||
2784 | case RenderStream: | ||
2785 | obj.put("tag", "RenderStream"); | ||
2786 | { | ||
2787 | Command.RenderStream_ tv = (Command.RenderStream_)v; | ||
2788 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2789 | } | ||
2790 | break; | ||
2791 | case ClearRenderTarget: | ||
2792 | obj.put("tag", "ClearRenderTarget"); | ||
2793 | { | ||
2794 | Command.ClearRenderTarget_ tv = (Command.ClearRenderTarget_)v; | ||
2795 | obj.put("arg0", toJSON(Type.Array_ClearImage,tv._0)); | ||
2796 | } | ||
2797 | break; | ||
2798 | case GenerateMipMap: | ||
2799 | obj.put("tag", "GenerateMipMap"); | ||
2800 | { | ||
2801 | Command.GenerateMipMap_ tv = (Command.GenerateMipMap_)v; | ||
2802 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2803 | } | ||
2804 | break; | ||
2805 | case SaveImage: | ||
2806 | obj.put("tag", "SaveImage"); | ||
2807 | { | ||
2808 | Command.SaveImage_ tv = (Command.SaveImage_)v; | ||
2809 | obj.put("arg0", toJSON(Type.Int,tv._0)); | ||
2810 | obj.put("arg1", toJSON(Type.ImageRef,tv._1)); | ||
2811 | } | ||
2812 | break; | ||
2813 | case LoadImage: | ||
2814 | obj.put("tag", "LoadImage"); | ||
2815 | { | ||
2816 | Command.LoadImage_ tv = (Command.LoadImage_)v; | ||
2817 | obj.put("arg0", toJSON(Type.ImageRef,tv._0)); | ||
2818 | obj.put("arg1", toJSON(Type.Int,tv._1)); | ||
2819 | } | ||
2820 | break; | ||
2821 | } | ||
2822 | return obj; | ||
2823 | } | ||
2824 | case SamplerDescriptor: { | ||
2825 | SamplerDescriptor v = (SamplerDescriptor)rawObj; | ||
2826 | JSONObject obj = new JSONObject(); | ||
2827 | switch (v.tag) { | ||
2828 | case SamplerDescriptor: | ||
2829 | obj.put("tag", "SamplerDescriptor"); | ||
2830 | { | ||
2831 | SamplerDescriptor.SamplerDescriptor_ tv = (SamplerDescriptor.SamplerDescriptor_)v; | ||
2832 | obj.put("samplerWrapS", toJSON(Type.EdgeMode,tv.samplerWrapS)); | ||
2833 | obj.put("samplerWrapT", toJSON(Type.Maybe_EdgeMode,tv.samplerWrapT)); | ||
2834 | obj.put("samplerWrapR", toJSON(Type.Maybe_EdgeMode,tv.samplerWrapR)); | ||
2835 | obj.put("samplerMinFilter", toJSON(Type.Filter,tv.samplerMinFilter)); | ||
2836 | obj.put("samplerMagFilter", toJSON(Type.Filter,tv.samplerMagFilter)); | ||
2837 | obj.put("samplerBorderColor", toJSON(Type.Value,tv.samplerBorderColor)); | ||
2838 | obj.put("samplerMinLod", toJSON(Type.Maybe_Float,tv.samplerMinLod)); | ||
2839 | obj.put("samplerMaxLod", toJSON(Type.Maybe_Float,tv.samplerMaxLod)); | ||
2840 | obj.put("samplerLodBias", toJSON(Type.Float,tv.samplerLodBias)); | ||
2841 | obj.put("samplerCompareFunc", toJSON(Type.Maybe_ComparisonFunction,tv.samplerCompareFunc)); | ||
2842 | } | ||
2843 | break; | ||
2844 | } | ||
2845 | return obj; | ||
2846 | } | ||
2847 | case TextureDescriptor: { | ||
2848 | TextureDescriptor v = (TextureDescriptor)rawObj; | ||
2849 | JSONObject obj = new JSONObject(); | ||
2850 | switch (v.tag) { | ||
2851 | case TextureDescriptor: | ||
2852 | obj.put("tag", "TextureDescriptor"); | ||
2853 | { | ||
2854 | TextureDescriptor.TextureDescriptor_ tv = (TextureDescriptor.TextureDescriptor_)v; | ||
2855 | obj.put("textureType", toJSON(Type.TextureType,tv.textureType)); | ||
2856 | obj.put("textureSize", toJSON(Type.Value,tv.textureSize)); | ||
2857 | obj.put("textureSemantic", toJSON(Type.ImageSemantic,tv.textureSemantic)); | ||
2858 | obj.put("textureSampler", toJSON(Type.SamplerDescriptor,tv.textureSampler)); | ||
2859 | obj.put("textureBaseLevel", toJSON(Type.Int,tv.textureBaseLevel)); | ||
2860 | obj.put("textureMaxLevel", toJSON(Type.Int,tv.textureMaxLevel)); | ||
2861 | } | ||
2862 | break; | ||
2863 | } | ||
2864 | return obj; | ||
2865 | } | ||
2866 | case Parameter: { | ||
2867 | Parameter v = (Parameter)rawObj; | ||
2868 | JSONObject obj = new JSONObject(); | ||
2869 | switch (v.tag) { | ||
2870 | case Parameter: | ||
2871 | obj.put("tag", "Parameter"); | ||
2872 | { | ||
2873 | Parameter.Parameter_ tv = (Parameter.Parameter_)v; | ||
2874 | obj.put("name", toJSON(Type.String,tv.name)); | ||
2875 | obj.put("ty", toJSON(Type.InputType,tv.ty)); | ||
2876 | } | ||
2877 | break; | ||
2878 | } | ||
2879 | return obj; | ||
2880 | } | ||
2881 | case Program: { | ||
2882 | Program v = (Program)rawObj; | ||
2883 | JSONObject obj = new JSONObject(); | ||
2884 | switch (v.tag) { | ||
2885 | case Program: | ||
2886 | obj.put("tag", "Program"); | ||
2887 | { | ||
2888 | Program.Program_ tv = (Program.Program_)v; | ||
2889 | obj.put("programUniforms", toJSON(Type.Map_String_InputType,tv.programUniforms)); | ||
2890 | obj.put("programStreams", toJSON(Type.Map_String_Parameter,tv.programStreams)); | ||
2891 | obj.put("programInTextures", toJSON(Type.Map_String_InputType,tv.programInTextures)); | ||
2892 | obj.put("programOutput", toJSON(Type.Array_Parameter,tv.programOutput)); | ||
2893 | obj.put("vertexShader", toJSON(Type.String,tv.vertexShader)); | ||
2894 | obj.put("geometryShader", toJSON(Type.Maybe_String,tv.geometryShader)); | ||
2895 | obj.put("fragmentShader", toJSON(Type.String,tv.fragmentShader)); | ||
2896 | } | ||
2897 | break; | ||
2898 | } | ||
2899 | return obj; | ||
2900 | } | ||
2901 | case Slot: { | ||
2902 | Slot v = (Slot)rawObj; | ||
2903 | JSONObject obj = new JSONObject(); | ||
2904 | switch (v.tag) { | ||
2905 | case Slot: | ||
2906 | obj.put("tag", "Slot"); | ||
2907 | { | ||
2908 | Slot.Slot_ tv = (Slot.Slot_)v; | ||
2909 | obj.put("slotName", toJSON(Type.String,tv.slotName)); | ||
2910 | obj.put("slotStreams", toJSON(Type.Map_String_InputType,tv.slotStreams)); | ||
2911 | obj.put("slotUniforms", toJSON(Type.Map_String_InputType,tv.slotUniforms)); | ||
2912 | obj.put("slotPrimitive", toJSON(Type.FetchPrimitive,tv.slotPrimitive)); | ||
2913 | obj.put("slotPrograms", toJSON(Type.Array_Int,tv.slotPrograms)); | ||
2914 | } | ||
2915 | break; | ||
2916 | } | ||
2917 | return obj; | ||
2918 | } | ||
2919 | case StreamData: { | ||
2920 | StreamData v = (StreamData)rawObj; | ||
2921 | JSONObject obj = new JSONObject(); | ||
2922 | switch (v.tag) { | ||
2923 | case StreamData: | ||
2924 | obj.put("tag", "StreamData"); | ||
2925 | { | ||
2926 | StreamData.StreamData_ tv = (StreamData.StreamData_)v; | ||
2927 | obj.put("streamData", toJSON(Type.Map_String_ArrayValue,tv.streamData)); | ||
2928 | obj.put("streamType", toJSON(Type.Map_String_InputType,tv.streamType)); | ||
2929 | obj.put("streamPrimitive", toJSON(Type.FetchPrimitive,tv.streamPrimitive)); | ||
2930 | obj.put("streamPrograms", toJSON(Type.Array_Int,tv.streamPrograms)); | ||
2931 | } | ||
2932 | break; | ||
2933 | } | ||
2934 | return obj; | ||
2935 | } | ||
2936 | case TargetItem: { | ||
2937 | TargetItem v = (TargetItem)rawObj; | ||
2938 | JSONObject obj = new JSONObject(); | ||
2939 | switch (v.tag) { | ||
2940 | case TargetItem: | ||
2941 | obj.put("tag", "TargetItem"); | ||
2942 | { | ||
2943 | TargetItem.TargetItem_ tv = (TargetItem.TargetItem_)v; | ||
2944 | obj.put("targetSemantic", toJSON(Type.ImageSemantic,tv.targetSemantic)); | ||
2945 | obj.put("targetRef", toJSON(Type.Maybe_ImageRef,tv.targetRef)); | ||
2946 | } | ||
2947 | break; | ||
2948 | } | ||
2949 | return obj; | ||
2950 | } | ||
2951 | case RenderTarget: { | ||
2952 | RenderTarget v = (RenderTarget)rawObj; | ||
2953 | JSONObject obj = new JSONObject(); | ||
2954 | switch (v.tag) { | ||
2955 | case RenderTarget: | ||
2956 | obj.put("tag", "RenderTarget"); | ||
2957 | { | ||
2958 | RenderTarget.RenderTarget_ tv = (RenderTarget.RenderTarget_)v; | ||
2959 | obj.put("renderTargets", toJSON(Type.Array_TargetItem,tv.renderTargets)); | ||
2960 | } | ||
2961 | break; | ||
2962 | } | ||
2963 | return obj; | ||
2964 | } | ||
2965 | case Backend: { | ||
2966 | Backend v = (Backend)rawObj; | ||
2967 | JSONObject obj = new JSONObject(); | ||
2968 | switch (v.tag) { | ||
2969 | case WebGL1: | ||
2970 | obj.put("tag", "WebGL1"); | ||
2971 | break; | ||
2972 | case OpenGL33: | ||
2973 | obj.put("tag", "OpenGL33"); | ||
2974 | break; | ||
2975 | } | ||
2976 | return obj; | ||
2977 | } | ||
2978 | case Pipeline: { | ||
2979 | Pipeline v = (Pipeline)rawObj; | ||
2980 | JSONObject obj = new JSONObject(); | ||
2981 | switch (v.tag) { | ||
2982 | case Pipeline: | ||
2983 | obj.put("tag", "Pipeline"); | ||
2984 | { | ||
2985 | Pipeline.Pipeline_ tv = (Pipeline.Pipeline_)v; | ||
2986 | obj.put("info", toJSON(Type.String,tv.info)); | ||
2987 | obj.put("backend", toJSON(Type.Backend,tv.backend)); | ||
2988 | obj.put("textures", toJSON(Type.Array_TextureDescriptor,tv.textures)); | ||
2989 | obj.put("samplers", toJSON(Type.Array_SamplerDescriptor,tv.samplers)); | ||
2990 | obj.put("targets", toJSON(Type.Array_RenderTarget,tv.targets)); | ||
2991 | obj.put("programs", toJSON(Type.Array_Program,tv.programs)); | ||
2992 | obj.put("slots", toJSON(Type.Array_Slot,tv.slots)); | ||
2993 | obj.put("streams", toJSON(Type.Array_StreamData,tv.streams)); | ||
2994 | obj.put("commands", toJSON(Type.Array_Command,tv.commands)); | ||
2995 | } | ||
2996 | break; | ||
2997 | } | ||
2998 | return obj; | ||
2999 | } | ||
3000 | |||
3001 | case Word32: { return rawObj; } | ||
3002 | case Float: { return rawObj; } | ||
3003 | case Bool: { return rawObj; } | ||
3004 | case String: { return rawObj; } | ||
3005 | case V2_Word: { | ||
3006 | V2<Integer> v = (V2<Integer>)rawObj; | ||
3007 | JSONObject obj = new JSONObject(); | ||
3008 | obj.put("x", toJSON(Type.Word,v.x)); | ||
3009 | obj.put("y", toJSON(Type.Word,v.y)); | ||
3010 | return obj; | ||
3011 | } | ||
3012 | case V2_Float: { | ||
3013 | V2<Float> v = (V2<Float>)rawObj; | ||
3014 | JSONObject obj = new JSONObject(); | ||
3015 | obj.put("x", toJSON(Type.Float,v.x)); | ||
3016 | obj.put("y", toJSON(Type.Float,v.y)); | ||
3017 | return obj; | ||
3018 | } | ||
3019 | case V2_Bool: { | ||
3020 | V2<Boolean> v = (V2<Boolean>)rawObj; | ||
3021 | JSONObject obj = new JSONObject(); | ||
3022 | obj.put("x", toJSON(Type.Bool,v.x)); | ||
3023 | obj.put("y", toJSON(Type.Bool,v.y)); | ||
3024 | return obj; | ||
3025 | } | ||
3026 | case V2_V2_Float: { | ||
3027 | V2<V2<Float>> v = (V2<V2<Float>>)rawObj; | ||
3028 | JSONObject obj = new JSONObject(); | ||
3029 | obj.put("x", toJSON(Type.V2_Float,v.x)); | ||
3030 | obj.put("y", toJSON(Type.V2_Float,v.y)); | ||
3031 | return obj; | ||
3032 | } | ||
3033 | case V2_V3_Float: { | ||
3034 | V2<V3<Float>> v = (V2<V3<Float>>)rawObj; | ||
3035 | JSONObject obj = new JSONObject(); | ||
3036 | obj.put("x", toJSON(Type.V3_Float,v.x)); | ||
3037 | obj.put("y", toJSON(Type.V3_Float,v.y)); | ||
3038 | return obj; | ||
3039 | } | ||
3040 | case V2_V4_Float: { | ||
3041 | V2<V4<Float>> v = (V2<V4<Float>>)rawObj; | ||
3042 | JSONObject obj = new JSONObject(); | ||
3043 | obj.put("x", toJSON(Type.V4_Float,v.x)); | ||
3044 | obj.put("y", toJSON(Type.V4_Float,v.y)); | ||
3045 | return obj; | ||
3046 | } | ||
3047 | case V3_Word: { | ||
3048 | V3<Integer> v = (V3<Integer>)rawObj; | ||
3049 | JSONObject obj = new JSONObject(); | ||
3050 | obj.put("x", toJSON(Type.Word,v.x)); | ||
3051 | obj.put("y", toJSON(Type.Word,v.y)); | ||
3052 | obj.put("z", toJSON(Type.Word,v.z)); | ||
3053 | return obj; | ||
3054 | } | ||
3055 | case V3_Float: { | ||
3056 | V3<Float> v = (V3<Float>)rawObj; | ||
3057 | JSONObject obj = new JSONObject(); | ||
3058 | obj.put("x", toJSON(Type.Float,v.x)); | ||
3059 | obj.put("y", toJSON(Type.Float,v.y)); | ||
3060 | obj.put("z", toJSON(Type.Float,v.z)); | ||
3061 | return obj; | ||
3062 | } | ||
3063 | case V3_Bool: { | ||
3064 | V3<Boolean> v = (V3<Boolean>)rawObj; | ||
3065 | JSONObject obj = new JSONObject(); | ||
3066 | obj.put("x", toJSON(Type.Bool,v.x)); | ||
3067 | obj.put("y", toJSON(Type.Bool,v.y)); | ||
3068 | obj.put("z", toJSON(Type.Bool,v.z)); | ||
3069 | return obj; | ||
3070 | } | ||
3071 | case V3_V2_Float: { | ||
3072 | V3<V2<Float>> v = (V3<V2<Float>>)rawObj; | ||
3073 | JSONObject obj = new JSONObject(); | ||
3074 | obj.put("x", toJSON(Type.V2_Float,v.x)); | ||
3075 | obj.put("y", toJSON(Type.V2_Float,v.y)); | ||
3076 | obj.put("z", toJSON(Type.V2_Float,v.z)); | ||
3077 | return obj; | ||
3078 | } | ||
3079 | case V3_V3_Float: { | ||
3080 | V3<V3<Float>> v = (V3<V3<Float>>)rawObj; | ||
3081 | JSONObject obj = new JSONObject(); | ||
3082 | obj.put("x", toJSON(Type.V3_Float,v.x)); | ||
3083 | obj.put("y", toJSON(Type.V3_Float,v.y)); | ||
3084 | obj.put("z", toJSON(Type.V3_Float,v.z)); | ||
3085 | return obj; | ||
3086 | } | ||
3087 | case V3_V4_Float: { | ||
3088 | V3<V4<Float>> v = (V3<V4<Float>>)rawObj; | ||
3089 | JSONObject obj = new JSONObject(); | ||
3090 | obj.put("x", toJSON(Type.V4_Float,v.x)); | ||
3091 | obj.put("y", toJSON(Type.V4_Float,v.y)); | ||
3092 | obj.put("z", toJSON(Type.V4_Float,v.z)); | ||
3093 | return obj; | ||
3094 | } | ||
3095 | case V4_Word: { | ||
3096 | V4<Integer> v = (V4<Integer>)rawObj; | ||
3097 | JSONObject obj = new JSONObject(); | ||
3098 | obj.put("x", toJSON(Type.Word,v.x)); | ||
3099 | obj.put("y", toJSON(Type.Word,v.y)); | ||
3100 | obj.put("z", toJSON(Type.Word,v.z)); | ||
3101 | obj.put("w", toJSON(Type.Word,v.w)); | ||
3102 | return obj; | ||
3103 | } | ||
3104 | case V4_Float: { | ||
3105 | V4<Float> v = (V4<Float>)rawObj; | ||
3106 | JSONObject obj = new JSONObject(); | ||
3107 | obj.put("x", toJSON(Type.Float,v.x)); | ||
3108 | obj.put("y", toJSON(Type.Float,v.y)); | ||
3109 | obj.put("z", toJSON(Type.Float,v.z)); | ||
3110 | obj.put("w", toJSON(Type.Float,v.w)); | ||
3111 | return obj; | ||
3112 | } | ||
3113 | case V4_Bool: { | ||
3114 | V4<Boolean> v = (V4<Boolean>)rawObj; | ||
3115 | JSONObject obj = new JSONObject(); | ||
3116 | obj.put("x", toJSON(Type.Bool,v.x)); | ||
3117 | obj.put("y", toJSON(Type.Bool,v.y)); | ||
3118 | obj.put("z", toJSON(Type.Bool,v.z)); | ||
3119 | obj.put("w", toJSON(Type.Bool,v.w)); | ||
3120 | return obj; | ||
3121 | } | ||
3122 | case V4_V2_Float: { | ||
3123 | V4<V2<Float>> v = (V4<V2<Float>>)rawObj; | ||
3124 | JSONObject obj = new JSONObject(); | ||
3125 | obj.put("x", toJSON(Type.V2_Float,v.x)); | ||
3126 | obj.put("y", toJSON(Type.V2_Float,v.y)); | ||
3127 | obj.put("z", toJSON(Type.V2_Float,v.z)); | ||
3128 | obj.put("w", toJSON(Type.V2_Float,v.w)); | ||
3129 | return obj; | ||
3130 | } | ||
3131 | case V4_V3_Float: { | ||
3132 | V4<V3<Float>> v = (V4<V3<Float>>)rawObj; | ||
3133 | JSONObject obj = new JSONObject(); | ||
3134 | obj.put("x", toJSON(Type.V3_Float,v.x)); | ||
3135 | obj.put("y", toJSON(Type.V3_Float,v.y)); | ||
3136 | obj.put("z", toJSON(Type.V3_Float,v.z)); | ||
3137 | obj.put("w", toJSON(Type.V3_Float,v.w)); | ||
3138 | return obj; | ||
3139 | } | ||
3140 | case V4_V4_Float: { | ||
3141 | V4<V4<Float>> v = (V4<V4<Float>>)rawObj; | ||
3142 | JSONObject obj = new JSONObject(); | ||
3143 | obj.put("x", toJSON(Type.V4_Float,v.x)); | ||
3144 | obj.put("y", toJSON(Type.V4_Float,v.y)); | ||
3145 | obj.put("z", toJSON(Type.V4_Float,v.z)); | ||
3146 | obj.put("w", toJSON(Type.V4_Float,v.w)); | ||
3147 | return obj; | ||
3148 | } | ||
3149 | case Array_Word32: { | ||
3150 | ArrayList<Integer> v = (ArrayList<Integer>)rawObj; | ||
3151 | JSONArray obj = new JSONArray(); | ||
3152 | for(Integer i : v) { | ||
3153 | obj.put(toJSON(Type.Word32,i)); | ||
3154 | } | ||
3155 | return obj; | ||
3156 | } | ||
3157 | case Array_Float: { | ||
3158 | ArrayList<Float> v = (ArrayList<Float>)rawObj; | ||
3159 | JSONArray obj = new JSONArray(); | ||
3160 | for(Float i : v) { | ||
3161 | obj.put(toJSON(Type.Float,i)); | ||
3162 | } | ||
3163 | return obj; | ||
3164 | } | ||
3165 | case Array_Bool: { | ||
3166 | ArrayList<Boolean> v = (ArrayList<Boolean>)rawObj; | ||
3167 | JSONArray obj = new JSONArray(); | ||
3168 | for(Boolean i : v) { | ||
3169 | obj.put(toJSON(Type.Bool,i)); | ||
3170 | } | ||
3171 | return obj; | ||
3172 | } | ||
3173 | case Array_ClearImage: { | ||
3174 | ArrayList<ClearImage> v = (ArrayList<ClearImage>)rawObj; | ||
3175 | JSONArray obj = new JSONArray(); | ||
3176 | for(ClearImage i : v) { | ||
3177 | obj.put(toJSON(Type.ClearImage,i)); | ||
3178 | } | ||
3179 | return obj; | ||
3180 | } | ||
3181 | case Array_Command: { | ||
3182 | ArrayList<Command> v = (ArrayList<Command>)rawObj; | ||
3183 | JSONArray obj = new JSONArray(); | ||
3184 | for(Command i : v) { | ||
3185 | obj.put(toJSON(Type.Command,i)); | ||
3186 | } | ||
3187 | return obj; | ||
3188 | } | ||
3189 | case Array_Parameter: { | ||
3190 | ArrayList<Parameter> v = (ArrayList<Parameter>)rawObj; | ||
3191 | JSONArray obj = new JSONArray(); | ||
3192 | for(Parameter i : v) { | ||
3193 | obj.put(toJSON(Type.Parameter,i)); | ||
3194 | } | ||
3195 | return obj; | ||
3196 | } | ||
3197 | case Array_Program: { | ||
3198 | ArrayList<Program> v = (ArrayList<Program>)rawObj; | ||
3199 | JSONArray obj = new JSONArray(); | ||
3200 | for(Program i : v) { | ||
3201 | obj.put(toJSON(Type.Program,i)); | ||
3202 | } | ||
3203 | return obj; | ||
3204 | } | ||
3205 | case Array_RenderTarget: { | ||
3206 | ArrayList<RenderTarget> v = (ArrayList<RenderTarget>)rawObj; | ||
3207 | JSONArray obj = new JSONArray(); | ||
3208 | for(RenderTarget i : v) { | ||
3209 | obj.put(toJSON(Type.RenderTarget,i)); | ||
3210 | } | ||
3211 | return obj; | ||
3212 | } | ||
3213 | case Array_SamplerDescriptor: { | ||
3214 | ArrayList<SamplerDescriptor> v = (ArrayList<SamplerDescriptor>)rawObj; | ||
3215 | JSONArray obj = new JSONArray(); | ||
3216 | for(SamplerDescriptor i : v) { | ||
3217 | obj.put(toJSON(Type.SamplerDescriptor,i)); | ||
3218 | } | ||
3219 | return obj; | ||
3220 | } | ||
3221 | case Array_Slot: { | ||
3222 | ArrayList<Slot> v = (ArrayList<Slot>)rawObj; | ||
3223 | JSONArray obj = new JSONArray(); | ||
3224 | for(Slot i : v) { | ||
3225 | obj.put(toJSON(Type.Slot,i)); | ||
3226 | } | ||
3227 | return obj; | ||
3228 | } | ||
3229 | case Array_StreamData: { | ||
3230 | ArrayList<StreamData> v = (ArrayList<StreamData>)rawObj; | ||
3231 | JSONArray obj = new JSONArray(); | ||
3232 | for(StreamData i : v) { | ||
3233 | obj.put(toJSON(Type.StreamData,i)); | ||
3234 | } | ||
3235 | return obj; | ||
3236 | } | ||
3237 | case Array_TargetItem: { | ||
3238 | ArrayList<TargetItem> v = (ArrayList<TargetItem>)rawObj; | ||
3239 | JSONArray obj = new JSONArray(); | ||
3240 | for(TargetItem i : v) { | ||
3241 | obj.put(toJSON(Type.TargetItem,i)); | ||
3242 | } | ||
3243 | return obj; | ||
3244 | } | ||
3245 | case Array_TextureDescriptor: { | ||
3246 | ArrayList<TextureDescriptor> v = (ArrayList<TextureDescriptor>)rawObj; | ||
3247 | JSONArray obj = new JSONArray(); | ||
3248 | for(TextureDescriptor i : v) { | ||
3249 | obj.put(toJSON(Type.TextureDescriptor,i)); | ||
3250 | } | ||
3251 | return obj; | ||
3252 | } | ||
3253 | case List_FragmentOperation: { | ||
3254 | ArrayList<FragmentOperation> v = (ArrayList<FragmentOperation>)rawObj; | ||
3255 | JSONArray obj = new JSONArray(); | ||
3256 | for(FragmentOperation i : v) { | ||
3257 | obj.put(toJSON(Type.FragmentOperation,i)); | ||
3258 | } | ||
3259 | return obj; | ||
3260 | } | ||
3261 | case Maybe_Int: { | ||
3262 | Maybe<Integer> v = (Maybe<Integer>)rawObj; | ||
3263 | if (v.valid) { | ||
3264 | return toJSON(Type.Int,v.data); | ||
3265 | } | ||
3266 | return JSONObject.NULL; | ||
3267 | } | ||
3268 | case Maybe_Float: { | ||
3269 | Maybe<Float> v = (Maybe<Float>)rawObj; | ||
3270 | if (v.valid) { | ||
3271 | return toJSON(Type.Float,v.data); | ||
3272 | } | ||
3273 | return JSONObject.NULL; | ||
3274 | } | ||
3275 | case Maybe_String: { | ||
3276 | Maybe<String> v = (Maybe<String>)rawObj; | ||
3277 | if (v.valid) { | ||
3278 | return toJSON(Type.String,v.data); | ||
3279 | } | ||
3280 | return JSONObject.NULL; | ||
3281 | } | ||
3282 | case Maybe_ComparisonFunction: { | ||
3283 | Maybe<ComparisonFunction> v = (Maybe<ComparisonFunction>)rawObj; | ||
3284 | if (v.valid) { | ||
3285 | return toJSON(Type.ComparisonFunction,v.data); | ||
3286 | } | ||
3287 | return JSONObject.NULL; | ||
3288 | } | ||
3289 | case Maybe_EdgeMode: { | ||
3290 | Maybe<EdgeMode> v = (Maybe<EdgeMode>)rawObj; | ||
3291 | if (v.valid) { | ||
3292 | return toJSON(Type.EdgeMode,v.data); | ||
3293 | } | ||
3294 | return JSONObject.NULL; | ||
3295 | } | ||
3296 | case Maybe_ImageRef: { | ||
3297 | Maybe<ImageRef> v = (Maybe<ImageRef>)rawObj; | ||
3298 | if (v.valid) { | ||
3299 | return toJSON(Type.ImageRef,v.data); | ||
3300 | } | ||
3301 | return JSONObject.NULL; | ||
3302 | } | ||
3303 | case Map_String_ArrayValue: { | ||
3304 | HashMap<String, ArrayValue> v = (HashMap<String, ArrayValue>)rawObj; | ||
3305 | JSONObject obj = new JSONObject(); | ||
3306 | for (Map.Entry<String,ArrayValue> i : v.entrySet()) { | ||
3307 | obj.put(i.getKey(), toJSON(Type.ArrayValue,i.getValue())); | ||
3308 | } | ||
3309 | return obj; | ||
3310 | } | ||
3311 | case Map_String_InputType: { | ||
3312 | HashMap<String, InputType> v = (HashMap<String, InputType>)rawObj; | ||
3313 | JSONObject obj = new JSONObject(); | ||
3314 | for (Map.Entry<String,InputType> i : v.entrySet()) { | ||
3315 | obj.put(i.getKey(), toJSON(Type.InputType,i.getValue())); | ||
3316 | } | ||
3317 | return obj; | ||
3318 | } | ||
3319 | case Map_String_Parameter: { | ||
3320 | HashMap<String, Parameter> v = (HashMap<String, Parameter>)rawObj; | ||
3321 | JSONObject obj = new JSONObject(); | ||
3322 | for (Map.Entry<String,Parameter> i : v.entrySet()) { | ||
3323 | obj.put(i.getKey(), toJSON(Type.Parameter,i.getValue())); | ||
3324 | } | ||
3325 | return obj; | ||
3326 | } | ||
3327 | } | ||
3328 | return null; | ||
3329 | } | ||
1567 | } \ No newline at end of file | 3330 | } \ No newline at end of file |
diff --git a/ddl/out/java/LambdaCube/IR/LogicOperation.java b/ddl/out/java/LambdaCube/IR/LogicOperation.java index b7efcff..76ad5f0 100644 --- a/ddl/out/java/LambdaCube/IR/LogicOperation.java +++ b/ddl/out/java/LambdaCube/IR/LogicOperation.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/MipMap.java b/ddl/out/java/LambdaCube/IR/MipMap.java index 068c824..3f4dd83 100644 --- a/ddl/out/java/LambdaCube/IR/MipMap.java +++ b/ddl/out/java/LambdaCube/IR/MipMap.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/OutputPrimitive.java b/ddl/out/java/LambdaCube/IR/OutputPrimitive.java index 267ff8a..8573b52 100644 --- a/ddl/out/java/LambdaCube/IR/OutputPrimitive.java +++ b/ddl/out/java/LambdaCube/IR/OutputPrimitive.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/Parameter.java b/ddl/out/java/LambdaCube/IR/Parameter.java index 31b8701..c9bbb0e 100644 --- a/ddl/out/java/LambdaCube/IR/Parameter.java +++ b/ddl/out/java/LambdaCube/IR/Parameter.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/Pipeline.java b/ddl/out/java/LambdaCube/IR/Pipeline.java index b5c9a86..5ec9134 100644 --- a/ddl/out/java/LambdaCube/IR/Pipeline.java +++ b/ddl/out/java/LambdaCube/IR/Pipeline.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/PointSize.java b/ddl/out/java/LambdaCube/IR/PointSize.java index b1d4fe3..034b6ef 100644 --- a/ddl/out/java/LambdaCube/IR/PointSize.java +++ b/ddl/out/java/LambdaCube/IR/PointSize.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/PointSpriteCoordOrigin.java b/ddl/out/java/LambdaCube/IR/PointSpriteCoordOrigin.java index 7c387b8..0adea89 100644 --- a/ddl/out/java/LambdaCube/IR/PointSpriteCoordOrigin.java +++ b/ddl/out/java/LambdaCube/IR/PointSpriteCoordOrigin.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/PolygonMode.java b/ddl/out/java/LambdaCube/IR/PolygonMode.java index decf1e5..66ae75b 100644 --- a/ddl/out/java/LambdaCube/IR/PolygonMode.java +++ b/ddl/out/java/LambdaCube/IR/PolygonMode.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/PolygonOffset.java b/ddl/out/java/LambdaCube/IR/PolygonOffset.java index d25c57a..723902c 100644 --- a/ddl/out/java/LambdaCube/IR/PolygonOffset.java +++ b/ddl/out/java/LambdaCube/IR/PolygonOffset.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/Program.java b/ddl/out/java/LambdaCube/IR/Program.java index 520ad58..2a4d203 100644 --- a/ddl/out/java/LambdaCube/IR/Program.java +++ b/ddl/out/java/LambdaCube/IR/Program.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/ProvokingVertex.java b/ddl/out/java/LambdaCube/IR/ProvokingVertex.java index ebe5f5f..4f168a8 100644 --- a/ddl/out/java/LambdaCube/IR/ProvokingVertex.java +++ b/ddl/out/java/LambdaCube/IR/ProvokingVertex.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/RasterContext.java b/ddl/out/java/LambdaCube/IR/RasterContext.java index dc3c725..c3c96af 100644 --- a/ddl/out/java/LambdaCube/IR/RasterContext.java +++ b/ddl/out/java/LambdaCube/IR/RasterContext.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/RenderTarget.java b/ddl/out/java/LambdaCube/IR/RenderTarget.java index ea18e10..9634405 100644 --- a/ddl/out/java/LambdaCube/IR/RenderTarget.java +++ b/ddl/out/java/LambdaCube/IR/RenderTarget.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/SamplerDescriptor.java b/ddl/out/java/LambdaCube/IR/SamplerDescriptor.java index 1fceace..022b5f1 100644 --- a/ddl/out/java/LambdaCube/IR/SamplerDescriptor.java +++ b/ddl/out/java/LambdaCube/IR/SamplerDescriptor.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/Slot.java b/ddl/out/java/LambdaCube/IR/Slot.java index 970c79e..672f23f 100644 --- a/ddl/out/java/LambdaCube/IR/Slot.java +++ b/ddl/out/java/LambdaCube/IR/Slot.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/StencilOperation.java b/ddl/out/java/LambdaCube/IR/StencilOperation.java index 9a4156d..0c836a0 100644 --- a/ddl/out/java/LambdaCube/IR/StencilOperation.java +++ b/ddl/out/java/LambdaCube/IR/StencilOperation.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/StencilOps.java b/ddl/out/java/LambdaCube/IR/StencilOps.java index 5dff15d..4875480 100644 --- a/ddl/out/java/LambdaCube/IR/StencilOps.java +++ b/ddl/out/java/LambdaCube/IR/StencilOps.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/StencilTest.java b/ddl/out/java/LambdaCube/IR/StencilTest.java index 083c053..382f7e3 100644 --- a/ddl/out/java/LambdaCube/IR/StencilTest.java +++ b/ddl/out/java/LambdaCube/IR/StencilTest.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/StencilTests.java b/ddl/out/java/LambdaCube/IR/StencilTests.java index 7cf730c..48fabe3 100644 --- a/ddl/out/java/LambdaCube/IR/StencilTests.java +++ b/ddl/out/java/LambdaCube/IR/StencilTests.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/StreamData.java b/ddl/out/java/LambdaCube/IR/StreamData.java index 6a2f49d..2a29d66 100644 --- a/ddl/out/java/LambdaCube/IR/StreamData.java +++ b/ddl/out/java/LambdaCube/IR/StreamData.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/TargetItem.java b/ddl/out/java/LambdaCube/IR/TargetItem.java index 392a38c..65c3845 100644 --- a/ddl/out/java/LambdaCube/IR/TargetItem.java +++ b/ddl/out/java/LambdaCube/IR/TargetItem.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/TextureDataType.java b/ddl/out/java/LambdaCube/IR/TextureDataType.java index 2a7824d..8b39deb 100644 --- a/ddl/out/java/LambdaCube/IR/TextureDataType.java +++ b/ddl/out/java/LambdaCube/IR/TextureDataType.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/TextureDescriptor.java b/ddl/out/java/LambdaCube/IR/TextureDescriptor.java index 23dedde..6d9b259 100644 --- a/ddl/out/java/LambdaCube/IR/TextureDescriptor.java +++ b/ddl/out/java/LambdaCube/IR/TextureDescriptor.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/TextureType.java b/ddl/out/java/LambdaCube/IR/TextureType.java index bea424e..9321517 100644 --- a/ddl/out/java/LambdaCube/IR/TextureType.java +++ b/ddl/out/java/LambdaCube/IR/TextureType.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/IR/Value.java b/ddl/out/java/LambdaCube/IR/Value.java index fe9d0cd..980417b 100644 --- a/ddl/out/java/LambdaCube/IR/Value.java +++ b/ddl/out/java/LambdaCube/IR/Value.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:54.700322000000Z | 2 | // 2016-03-21T15:32:16.153401000000Z |
3 | 3 | ||
4 | package LambdaCube.IR; | 4 | package LambdaCube.IR; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/Mesh/JSON.java b/ddl/out/java/LambdaCube/Mesh/JSON.java index 9a1767e..2d65a3a 100644 --- a/ddl/out/java/LambdaCube/Mesh/JSON.java +++ b/ddl/out/java/LambdaCube/Mesh/JSON.java | |||
@@ -1,11 +1,12 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.404479000000Z | 2 | // 2016-03-21T15:32:17.804995000000Z |
3 | 3 | ||
4 | package LambdaCube.Mesh; | 4 | package LambdaCube.Mesh; |
5 | 5 | ||
6 | import java.util.ArrayList; | 6 | import java.util.ArrayList; |
7 | import java.util.HashMap; | 7 | import java.util.HashMap; |
8 | import java.util.Iterator; | 8 | import java.util.Iterator; |
9 | import java.util.Map; | ||
9 | import org.json.*; | 10 | import org.json.*; |
10 | import RT.*; | 11 | import RT.*; |
11 | 12 | ||
@@ -267,4 +268,249 @@ public class JSON { | |||
267 | } | 268 | } |
268 | throw new Exception("unknown type"); | 269 | throw new Exception("unknown type"); |
269 | } | 270 | } |
271 | |||
272 | public static Object toJSON(Type type, Object rawObj) throws JSONException, Exception { | ||
273 | switch (type) { | ||
274 | case MeshAttribute: { | ||
275 | MeshAttribute v = (MeshAttribute)rawObj; | ||
276 | JSONObject obj = new JSONObject(); | ||
277 | switch (v.tag) { | ||
278 | case A_Float: | ||
279 | obj.put("tag", "A_Float"); | ||
280 | { | ||
281 | MeshAttribute.A_Float_ tv = (MeshAttribute.A_Float_)v; | ||
282 | obj.put("arg0", toJSON(Type.Array_Float,tv._0)); | ||
283 | } | ||
284 | break; | ||
285 | case A_V2F: | ||
286 | obj.put("tag", "A_V2F"); | ||
287 | { | ||
288 | MeshAttribute.A_V2F_ tv = (MeshAttribute.A_V2F_)v; | ||
289 | obj.put("arg0", toJSON(Type.Array_V2_Float,tv._0)); | ||
290 | } | ||
291 | break; | ||
292 | case A_V3F: | ||
293 | obj.put("tag", "A_V3F"); | ||
294 | { | ||
295 | MeshAttribute.A_V3F_ tv = (MeshAttribute.A_V3F_)v; | ||
296 | obj.put("arg0", toJSON(Type.Array_V3_Float,tv._0)); | ||
297 | } | ||
298 | break; | ||
299 | case A_V4F: | ||
300 | obj.put("tag", "A_V4F"); | ||
301 | { | ||
302 | MeshAttribute.A_V4F_ tv = (MeshAttribute.A_V4F_)v; | ||
303 | obj.put("arg0", toJSON(Type.Array_V4_Float,tv._0)); | ||
304 | } | ||
305 | break; | ||
306 | case A_M22F: | ||
307 | obj.put("tag", "A_M22F"); | ||
308 | { | ||
309 | MeshAttribute.A_M22F_ tv = (MeshAttribute.A_M22F_)v; | ||
310 | obj.put("arg0", toJSON(Type.Array_V2_V2_Float,tv._0)); | ||
311 | } | ||
312 | break; | ||
313 | case A_M33F: | ||
314 | obj.put("tag", "A_M33F"); | ||
315 | { | ||
316 | MeshAttribute.A_M33F_ tv = (MeshAttribute.A_M33F_)v; | ||
317 | obj.put("arg0", toJSON(Type.Array_V3_V3_Float,tv._0)); | ||
318 | } | ||
319 | break; | ||
320 | case A_M44F: | ||
321 | obj.put("tag", "A_M44F"); | ||
322 | { | ||
323 | MeshAttribute.A_M44F_ tv = (MeshAttribute.A_M44F_)v; | ||
324 | obj.put("arg0", toJSON(Type.Array_V4_V4_Float,tv._0)); | ||
325 | } | ||
326 | break; | ||
327 | case A_Int: | ||
328 | obj.put("tag", "A_Int"); | ||
329 | { | ||
330 | MeshAttribute.A_Int_ tv = (MeshAttribute.A_Int_)v; | ||
331 | obj.put("arg0", toJSON(Type.Array_Int32,tv._0)); | ||
332 | } | ||
333 | break; | ||
334 | case A_Word: | ||
335 | obj.put("tag", "A_Word"); | ||
336 | { | ||
337 | MeshAttribute.A_Word_ tv = (MeshAttribute.A_Word_)v; | ||
338 | obj.put("arg0", toJSON(Type.Array_Word32,tv._0)); | ||
339 | } | ||
340 | break; | ||
341 | } | ||
342 | return obj; | ||
343 | } | ||
344 | case MeshPrimitive: { | ||
345 | MeshPrimitive v = (MeshPrimitive)rawObj; | ||
346 | JSONObject obj = new JSONObject(); | ||
347 | switch (v.tag) { | ||
348 | case P_Points: | ||
349 | obj.put("tag", "P_Points"); | ||
350 | break; | ||
351 | case P_TriangleStrip: | ||
352 | obj.put("tag", "P_TriangleStrip"); | ||
353 | break; | ||
354 | case P_Triangles: | ||
355 | obj.put("tag", "P_Triangles"); | ||
356 | break; | ||
357 | case P_TriangleStripI: | ||
358 | obj.put("tag", "P_TriangleStripI"); | ||
359 | { | ||
360 | MeshPrimitive.P_TriangleStripI_ tv = (MeshPrimitive.P_TriangleStripI_)v; | ||
361 | obj.put("arg0", toJSON(Type.Array_Int32,tv._0)); | ||
362 | } | ||
363 | break; | ||
364 | case P_TrianglesI: | ||
365 | obj.put("tag", "P_TrianglesI"); | ||
366 | { | ||
367 | MeshPrimitive.P_TrianglesI_ tv = (MeshPrimitive.P_TrianglesI_)v; | ||
368 | obj.put("arg0", toJSON(Type.Array_Int32,tv._0)); | ||
369 | } | ||
370 | break; | ||
371 | } | ||
372 | return obj; | ||
373 | } | ||
374 | case Mesh: { | ||
375 | Mesh v = (Mesh)rawObj; | ||
376 | JSONObject obj = new JSONObject(); | ||
377 | switch (v.tag) { | ||
378 | case Mesh: | ||
379 | obj.put("tag", "Mesh"); | ||
380 | { | ||
381 | Mesh.Mesh_ tv = (Mesh.Mesh_)v; | ||
382 | obj.put("mAttributes", toJSON(Type.Map_String_MeshAttribute,tv.mAttributes)); | ||
383 | obj.put("mPrimitive", toJSON(Type.MeshPrimitive,tv.mPrimitive)); | ||
384 | } | ||
385 | break; | ||
386 | } | ||
387 | return obj; | ||
388 | } | ||
389 | |||
390 | case Word32: { return rawObj; } | ||
391 | case Float: { return rawObj; } | ||
392 | case String: { return rawObj; } | ||
393 | case V2_Float: { | ||
394 | V2<Float> v = (V2<Float>)rawObj; | ||
395 | JSONObject obj = new JSONObject(); | ||
396 | obj.put("x", toJSON(Type.Float,v.x)); | ||
397 | obj.put("y", toJSON(Type.Float,v.y)); | ||
398 | return obj; | ||
399 | } | ||
400 | case V2_V2_Float: { | ||
401 | V2<V2<Float>> v = (V2<V2<Float>>)rawObj; | ||
402 | JSONObject obj = new JSONObject(); | ||
403 | obj.put("x", toJSON(Type.V2_Float,v.x)); | ||
404 | obj.put("y", toJSON(Type.V2_Float,v.y)); | ||
405 | return obj; | ||
406 | } | ||
407 | case V3_Float: { | ||
408 | V3<Float> v = (V3<Float>)rawObj; | ||
409 | JSONObject obj = new JSONObject(); | ||
410 | obj.put("x", toJSON(Type.Float,v.x)); | ||
411 | obj.put("y", toJSON(Type.Float,v.y)); | ||
412 | obj.put("z", toJSON(Type.Float,v.z)); | ||
413 | return obj; | ||
414 | } | ||
415 | case V3_V3_Float: { | ||
416 | V3<V3<Float>> v = (V3<V3<Float>>)rawObj; | ||
417 | JSONObject obj = new JSONObject(); | ||
418 | obj.put("x", toJSON(Type.V3_Float,v.x)); | ||
419 | obj.put("y", toJSON(Type.V3_Float,v.y)); | ||
420 | obj.put("z", toJSON(Type.V3_Float,v.z)); | ||
421 | return obj; | ||
422 | } | ||
423 | case V4_Float: { | ||
424 | V4<Float> v = (V4<Float>)rawObj; | ||
425 | JSONObject obj = new JSONObject(); | ||
426 | obj.put("x", toJSON(Type.Float,v.x)); | ||
427 | obj.put("y", toJSON(Type.Float,v.y)); | ||
428 | obj.put("z", toJSON(Type.Float,v.z)); | ||
429 | obj.put("w", toJSON(Type.Float,v.w)); | ||
430 | return obj; | ||
431 | } | ||
432 | case V4_V4_Float: { | ||
433 | V4<V4<Float>> v = (V4<V4<Float>>)rawObj; | ||
434 | JSONObject obj = new JSONObject(); | ||
435 | obj.put("x", toJSON(Type.V4_Float,v.x)); | ||
436 | obj.put("y", toJSON(Type.V4_Float,v.y)); | ||
437 | obj.put("z", toJSON(Type.V4_Float,v.z)); | ||
438 | obj.put("w", toJSON(Type.V4_Float,v.w)); | ||
439 | return obj; | ||
440 | } | ||
441 | case Array_Word32: { | ||
442 | ArrayList<Integer> v = (ArrayList<Integer>)rawObj; | ||
443 | JSONArray obj = new JSONArray(); | ||
444 | for(Integer i : v) { | ||
445 | obj.put(toJSON(Type.Word32,i)); | ||
446 | } | ||
447 | return obj; | ||
448 | } | ||
449 | case Array_Float: { | ||
450 | ArrayList<Float> v = (ArrayList<Float>)rawObj; | ||
451 | JSONArray obj = new JSONArray(); | ||
452 | for(Float i : v) { | ||
453 | obj.put(toJSON(Type.Float,i)); | ||
454 | } | ||
455 | return obj; | ||
456 | } | ||
457 | case Array_V2_Float: { | ||
458 | ArrayList<V2<Float>> v = (ArrayList<V2<Float>>)rawObj; | ||
459 | JSONArray obj = new JSONArray(); | ||
460 | for(V2<Float> i : v) { | ||
461 | obj.put(toJSON(Type.V2_Float,i)); | ||
462 | } | ||
463 | return obj; | ||
464 | } | ||
465 | case Array_V2_V2_Float: { | ||
466 | ArrayList<V2<V2<Float>>> v = (ArrayList<V2<V2<Float>>>)rawObj; | ||
467 | JSONArray obj = new JSONArray(); | ||
468 | for(V2<V2<Float>> i : v) { | ||
469 | obj.put(toJSON(Type.V2_V2_Float,i)); | ||
470 | } | ||
471 | return obj; | ||
472 | } | ||
473 | case Array_V3_Float: { | ||
474 | ArrayList<V3<Float>> v = (ArrayList<V3<Float>>)rawObj; | ||
475 | JSONArray obj = new JSONArray(); | ||
476 | for(V3<Float> i : v) { | ||
477 | obj.put(toJSON(Type.V3_Float,i)); | ||
478 | } | ||
479 | return obj; | ||
480 | } | ||
481 | case Array_V3_V3_Float: { | ||
482 | ArrayList<V3<V3<Float>>> v = (ArrayList<V3<V3<Float>>>)rawObj; | ||
483 | JSONArray obj = new JSONArray(); | ||
484 | for(V3<V3<Float>> i : v) { | ||
485 | obj.put(toJSON(Type.V3_V3_Float,i)); | ||
486 | } | ||
487 | return obj; | ||
488 | } | ||
489 | case Array_V4_Float: { | ||
490 | ArrayList<V4<Float>> v = (ArrayList<V4<Float>>)rawObj; | ||
491 | JSONArray obj = new JSONArray(); | ||
492 | for(V4<Float> i : v) { | ||
493 | obj.put(toJSON(Type.V4_Float,i)); | ||
494 | } | ||
495 | return obj; | ||
496 | } | ||
497 | case Array_V4_V4_Float: { | ||
498 | ArrayList<V4<V4<Float>>> v = (ArrayList<V4<V4<Float>>>)rawObj; | ||
499 | JSONArray obj = new JSONArray(); | ||
500 | for(V4<V4<Float>> i : v) { | ||
501 | obj.put(toJSON(Type.V4_V4_Float,i)); | ||
502 | } | ||
503 | return obj; | ||
504 | } | ||
505 | case Map_String_MeshAttribute: { | ||
506 | HashMap<String, MeshAttribute> v = (HashMap<String, MeshAttribute>)rawObj; | ||
507 | JSONObject obj = new JSONObject(); | ||
508 | for (Map.Entry<String,MeshAttribute> i : v.entrySet()) { | ||
509 | obj.put(i.getKey(), toJSON(Type.MeshAttribute,i.getValue())); | ||
510 | } | ||
511 | return obj; | ||
512 | } | ||
513 | } | ||
514 | return null; | ||
515 | } | ||
270 | } \ No newline at end of file | 516 | } \ No newline at end of file |
diff --git a/ddl/out/java/LambdaCube/Mesh/Mesh.java b/ddl/out/java/LambdaCube/Mesh/Mesh.java index 1eb05d2..02b872b 100644 --- a/ddl/out/java/LambdaCube/Mesh/Mesh.java +++ b/ddl/out/java/LambdaCube/Mesh/Mesh.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.404479000000Z | 2 | // 2016-03-21T15:32:17.804995000000Z |
3 | 3 | ||
4 | package LambdaCube.Mesh; | 4 | package LambdaCube.Mesh; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/Mesh/MeshAttribute.java b/ddl/out/java/LambdaCube/Mesh/MeshAttribute.java index dff2e02..61a9c79 100644 --- a/ddl/out/java/LambdaCube/Mesh/MeshAttribute.java +++ b/ddl/out/java/LambdaCube/Mesh/MeshAttribute.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.404479000000Z | 2 | // 2016-03-21T15:32:17.804995000000Z |
3 | 3 | ||
4 | package LambdaCube.Mesh; | 4 | package LambdaCube.Mesh; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/Mesh/MeshPrimitive.java b/ddl/out/java/LambdaCube/Mesh/MeshPrimitive.java index 7c25ae8..43de590 100644 --- a/ddl/out/java/LambdaCube/Mesh/MeshPrimitive.java +++ b/ddl/out/java/LambdaCube/Mesh/MeshPrimitive.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.404479000000Z | 2 | // 2016-03-21T15:32:17.804995000000Z |
3 | 3 | ||
4 | package LambdaCube.Mesh; | 4 | package LambdaCube.Mesh; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/PipelineSchema/JSON.java b/ddl/out/java/LambdaCube/PipelineSchema/JSON.java index 1fec7e8..1667518 100644 --- a/ddl/out/java/LambdaCube/PipelineSchema/JSON.java +++ b/ddl/out/java/LambdaCube/PipelineSchema/JSON.java | |||
@@ -1,11 +1,12 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.360355000000Z | 2 | // 2016-03-21T15:32:17.702608000000Z |
3 | 3 | ||
4 | package LambdaCube.PipelineSchema; | 4 | package LambdaCube.PipelineSchema; |
5 | 5 | ||
6 | import java.util.ArrayList; | 6 | import java.util.ArrayList; |
7 | import java.util.HashMap; | 7 | import java.util.HashMap; |
8 | import java.util.Iterator; | 8 | import java.util.Iterator; |
9 | import java.util.Map; | ||
9 | import org.json.*; | 10 | import org.json.*; |
10 | import RT.*; | 11 | import RT.*; |
11 | 12 | ||
@@ -120,4 +121,136 @@ public class JSON { | |||
120 | } | 121 | } |
121 | throw new Exception("unknown type"); | 122 | throw new Exception("unknown type"); |
122 | } | 123 | } |
124 | |||
125 | public static Object toJSON(Type type, Object rawObj) throws JSONException, Exception { | ||
126 | switch (type) { | ||
127 | case StreamType: { | ||
128 | StreamType v = (StreamType)rawObj; | ||
129 | JSONObject obj = new JSONObject(); | ||
130 | switch (v.tag) { | ||
131 | case Attribute_Word: | ||
132 | obj.put("tag", "Attribute_Word"); | ||
133 | break; | ||
134 | case Attribute_V2U: | ||
135 | obj.put("tag", "Attribute_V2U"); | ||
136 | break; | ||
137 | case Attribute_V3U: | ||
138 | obj.put("tag", "Attribute_V3U"); | ||
139 | break; | ||
140 | case Attribute_V4U: | ||
141 | obj.put("tag", "Attribute_V4U"); | ||
142 | break; | ||
143 | case Attribute_Int: | ||
144 | obj.put("tag", "Attribute_Int"); | ||
145 | break; | ||
146 | case Attribute_V2I: | ||
147 | obj.put("tag", "Attribute_V2I"); | ||
148 | break; | ||
149 | case Attribute_V3I: | ||
150 | obj.put("tag", "Attribute_V3I"); | ||
151 | break; | ||
152 | case Attribute_V4I: | ||
153 | obj.put("tag", "Attribute_V4I"); | ||
154 | break; | ||
155 | case Attribute_Float: | ||
156 | obj.put("tag", "Attribute_Float"); | ||
157 | break; | ||
158 | case Attribute_V2F: | ||
159 | obj.put("tag", "Attribute_V2F"); | ||
160 | break; | ||
161 | case Attribute_V3F: | ||
162 | obj.put("tag", "Attribute_V3F"); | ||
163 | break; | ||
164 | case Attribute_V4F: | ||
165 | obj.put("tag", "Attribute_V4F"); | ||
166 | break; | ||
167 | case Attribute_M22F: | ||
168 | obj.put("tag", "Attribute_M22F"); | ||
169 | break; | ||
170 | case Attribute_M23F: | ||
171 | obj.put("tag", "Attribute_M23F"); | ||
172 | break; | ||
173 | case Attribute_M24F: | ||
174 | obj.put("tag", "Attribute_M24F"); | ||
175 | break; | ||
176 | case Attribute_M32F: | ||
177 | obj.put("tag", "Attribute_M32F"); | ||
178 | break; | ||
179 | case Attribute_M33F: | ||
180 | obj.put("tag", "Attribute_M33F"); | ||
181 | break; | ||
182 | case Attribute_M34F: | ||
183 | obj.put("tag", "Attribute_M34F"); | ||
184 | break; | ||
185 | case Attribute_M42F: | ||
186 | obj.put("tag", "Attribute_M42F"); | ||
187 | break; | ||
188 | case Attribute_M43F: | ||
189 | obj.put("tag", "Attribute_M43F"); | ||
190 | break; | ||
191 | case Attribute_M44F: | ||
192 | obj.put("tag", "Attribute_M44F"); | ||
193 | break; | ||
194 | } | ||
195 | return obj; | ||
196 | } | ||
197 | case ObjectArraySchema: { | ||
198 | ObjectArraySchema v = (ObjectArraySchema)rawObj; | ||
199 | JSONObject obj = new JSONObject(); | ||
200 | switch (v.tag) { | ||
201 | case ObjectArraySchema: | ||
202 | obj.put("tag", "ObjectArraySchema"); | ||
203 | { | ||
204 | ObjectArraySchema.ObjectArraySchema_ tv = (ObjectArraySchema.ObjectArraySchema_)v; | ||
205 | obj.put("primitive", toJSON(Type.FetchPrimitive,tv.primitive)); | ||
206 | obj.put("attributes", toJSON(Type.Map_String_StreamType,tv.attributes)); | ||
207 | } | ||
208 | break; | ||
209 | } | ||
210 | return obj; | ||
211 | } | ||
212 | case PipelineSchema: { | ||
213 | PipelineSchema v = (PipelineSchema)rawObj; | ||
214 | JSONObject obj = new JSONObject(); | ||
215 | switch (v.tag) { | ||
216 | case PipelineSchema: | ||
217 | obj.put("tag", "PipelineSchema"); | ||
218 | { | ||
219 | PipelineSchema.PipelineSchema_ tv = (PipelineSchema.PipelineSchema_)v; | ||
220 | obj.put("objectArrays", toJSON(Type.Map_String_ObjectArraySchema,tv.objectArrays)); | ||
221 | obj.put("uniforms", toJSON(Type.Map_String_InputType,tv.uniforms)); | ||
222 | } | ||
223 | break; | ||
224 | } | ||
225 | return obj; | ||
226 | } | ||
227 | |||
228 | case String: { return rawObj; } | ||
229 | case Map_String_InputType: { | ||
230 | HashMap<String, InputType> v = (HashMap<String, InputType>)rawObj; | ||
231 | JSONObject obj = new JSONObject(); | ||
232 | for (Map.Entry<String,InputType> i : v.entrySet()) { | ||
233 | obj.put(i.getKey(), toJSON(Type.InputType,i.getValue())); | ||
234 | } | ||
235 | return obj; | ||
236 | } | ||
237 | case Map_String_ObjectArraySchema: { | ||
238 | HashMap<String, ObjectArraySchema> v = (HashMap<String, ObjectArraySchema>)rawObj; | ||
239 | JSONObject obj = new JSONObject(); | ||
240 | for (Map.Entry<String,ObjectArraySchema> i : v.entrySet()) { | ||
241 | obj.put(i.getKey(), toJSON(Type.ObjectArraySchema,i.getValue())); | ||
242 | } | ||
243 | return obj; | ||
244 | } | ||
245 | case Map_String_StreamType: { | ||
246 | HashMap<String, StreamType> v = (HashMap<String, StreamType>)rawObj; | ||
247 | JSONObject obj = new JSONObject(); | ||
248 | for (Map.Entry<String,StreamType> i : v.entrySet()) { | ||
249 | obj.put(i.getKey(), toJSON(Type.StreamType,i.getValue())); | ||
250 | } | ||
251 | return obj; | ||
252 | } | ||
253 | } | ||
254 | return null; | ||
255 | } | ||
123 | } \ No newline at end of file | 256 | } \ No newline at end of file |
diff --git a/ddl/out/java/LambdaCube/PipelineSchema/ObjectArraySchema.java b/ddl/out/java/LambdaCube/PipelineSchema/ObjectArraySchema.java index cc15385..adb12ff 100644 --- a/ddl/out/java/LambdaCube/PipelineSchema/ObjectArraySchema.java +++ b/ddl/out/java/LambdaCube/PipelineSchema/ObjectArraySchema.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.360355000000Z | 2 | // 2016-03-21T15:32:17.702608000000Z |
3 | 3 | ||
4 | package LambdaCube.PipelineSchema; | 4 | package LambdaCube.PipelineSchema; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/PipelineSchema/PipelineSchema.java b/ddl/out/java/LambdaCube/PipelineSchema/PipelineSchema.java index 3618a3a..cc221a8 100644 --- a/ddl/out/java/LambdaCube/PipelineSchema/PipelineSchema.java +++ b/ddl/out/java/LambdaCube/PipelineSchema/PipelineSchema.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.360355000000Z | 2 | // 2016-03-21T15:32:17.702608000000Z |
3 | 3 | ||
4 | package LambdaCube.PipelineSchema; | 4 | package LambdaCube.PipelineSchema; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/PipelineSchema/StreamType.java b/ddl/out/java/LambdaCube/PipelineSchema/StreamType.java index 1861146..f7007b5 100644 --- a/ddl/out/java/LambdaCube/PipelineSchema/StreamType.java +++ b/ddl/out/java/LambdaCube/PipelineSchema/StreamType.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.360355000000Z | 2 | // 2016-03-21T15:32:17.702608000000Z |
3 | 3 | ||
4 | package LambdaCube.PipelineSchema; | 4 | package LambdaCube.PipelineSchema; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/TypeInfo/CompileResult.java b/ddl/out/java/LambdaCube/TypeInfo/CompileResult.java index 0b21b64..4235172 100644 --- a/ddl/out/java/LambdaCube/TypeInfo/CompileResult.java +++ b/ddl/out/java/LambdaCube/TypeInfo/CompileResult.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.479415000000Z | 2 | // 2016-03-21T15:32:17.924228000000Z |
3 | 3 | ||
4 | package LambdaCube.TypeInfo; | 4 | package LambdaCube.TypeInfo; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/TypeInfo/JSON.java b/ddl/out/java/LambdaCube/TypeInfo/JSON.java index d4ea991..6679e5d 100644 --- a/ddl/out/java/LambdaCube/TypeInfo/JSON.java +++ b/ddl/out/java/LambdaCube/TypeInfo/JSON.java | |||
@@ -1,11 +1,12 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.479415000000Z | 2 | // 2016-03-21T15:32:17.924228000000Z |
3 | 3 | ||
4 | package LambdaCube.TypeInfo; | 4 | package LambdaCube.TypeInfo; |
5 | 5 | ||
6 | import java.util.ArrayList; | 6 | import java.util.ArrayList; |
7 | import java.util.HashMap; | 7 | import java.util.HashMap; |
8 | import java.util.Iterator; | 8 | import java.util.Iterator; |
9 | import java.util.Map; | ||
9 | import org.json.*; | 10 | import org.json.*; |
10 | import RT.*; | 11 | import RT.*; |
11 | 12 | ||
@@ -98,4 +99,87 @@ public class JSON { | |||
98 | } | 99 | } |
99 | throw new Exception("unknown type"); | 100 | throw new Exception("unknown type"); |
100 | } | 101 | } |
102 | |||
103 | public static Object toJSON(Type type, Object rawObj) throws JSONException, Exception { | ||
104 | switch (type) { | ||
105 | case Range: { | ||
106 | Range v = (Range)rawObj; | ||
107 | JSONObject obj = new JSONObject(); | ||
108 | switch (v.tag) { | ||
109 | case Range: | ||
110 | obj.put("tag", "Range"); | ||
111 | { | ||
112 | Range.Range_ tv = (Range.Range_)v; | ||
113 | obj.put("startLine", toJSON(Type.Int,tv.startLine)); | ||
114 | obj.put("startColumn", toJSON(Type.Int,tv.startColumn)); | ||
115 | obj.put("endLine", toJSON(Type.Int,tv.endLine)); | ||
116 | obj.put("endColumn", toJSON(Type.Int,tv.endColumn)); | ||
117 | } | ||
118 | break; | ||
119 | } | ||
120 | return obj; | ||
121 | } | ||
122 | case TypeInfo: { | ||
123 | TypeInfo v = (TypeInfo)rawObj; | ||
124 | JSONObject obj = new JSONObject(); | ||
125 | switch (v.tag) { | ||
126 | case TypeInfo: | ||
127 | obj.put("tag", "TypeInfo"); | ||
128 | { | ||
129 | TypeInfo.TypeInfo_ tv = (TypeInfo.TypeInfo_)v; | ||
130 | obj.put("range", toJSON(Type.Range,tv.range)); | ||
131 | obj.put("text", toJSON(Type.String,tv.text)); | ||
132 | } | ||
133 | break; | ||
134 | } | ||
135 | return obj; | ||
136 | } | ||
137 | case CompileResult: { | ||
138 | CompileResult v = (CompileResult)rawObj; | ||
139 | JSONObject obj = new JSONObject(); | ||
140 | switch (v.tag) { | ||
141 | case CompileError: | ||
142 | obj.put("tag", "CompileError"); | ||
143 | { | ||
144 | CompileResult.CompileError_ tv = (CompileResult.CompileError_)v; | ||
145 | obj.put("arg0", toJSON(Type.Array_Range,tv._0)); | ||
146 | obj.put("arg1", toJSON(Type.String,tv._1)); | ||
147 | obj.put("arg2", toJSON(Type.Array_TypeInfo,tv._2)); | ||
148 | } | ||
149 | break; | ||
150 | case Compiled: | ||
151 | obj.put("tag", "Compiled"); | ||
152 | { | ||
153 | CompileResult.Compiled_ tv = (CompileResult.Compiled_)v; | ||
154 | obj.put("arg0", toJSON(Type.String,tv._0)); | ||
155 | obj.put("arg1", toJSON(Type.String,tv._1)); | ||
156 | obj.put("arg2", toJSON(Type.Pipeline,tv._2)); | ||
157 | obj.put("arg3", toJSON(Type.Array_TypeInfo,tv._3)); | ||
158 | } | ||
159 | break; | ||
160 | } | ||
161 | return obj; | ||
162 | } | ||
163 | |||
164 | case Int: { return rawObj; } | ||
165 | case String: { return rawObj; } | ||
166 | case Array_Range: { | ||
167 | ArrayList<Range> v = (ArrayList<Range>)rawObj; | ||
168 | JSONArray obj = new JSONArray(); | ||
169 | for(Range i : v) { | ||
170 | obj.put(toJSON(Type.Range,i)); | ||
171 | } | ||
172 | return obj; | ||
173 | } | ||
174 | case Array_TypeInfo: { | ||
175 | ArrayList<TypeInfo> v = (ArrayList<TypeInfo>)rawObj; | ||
176 | JSONArray obj = new JSONArray(); | ||
177 | for(TypeInfo i : v) { | ||
178 | obj.put(toJSON(Type.TypeInfo,i)); | ||
179 | } | ||
180 | return obj; | ||
181 | } | ||
182 | } | ||
183 | return null; | ||
184 | } | ||
101 | } \ No newline at end of file | 185 | } \ No newline at end of file |
diff --git a/ddl/out/java/LambdaCube/TypeInfo/Range.java b/ddl/out/java/LambdaCube/TypeInfo/Range.java index 61e2ddb..36ab145 100644 --- a/ddl/out/java/LambdaCube/TypeInfo/Range.java +++ b/ddl/out/java/LambdaCube/TypeInfo/Range.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.479415000000Z | 2 | // 2016-03-21T15:32:17.924228000000Z |
3 | 3 | ||
4 | package LambdaCube.TypeInfo; | 4 | package LambdaCube.TypeInfo; |
5 | 5 | ||
diff --git a/ddl/out/java/LambdaCube/TypeInfo/TypeInfo.java b/ddl/out/java/LambdaCube/TypeInfo/TypeInfo.java index a34fda6..febda4b 100644 --- a/ddl/out/java/LambdaCube/TypeInfo/TypeInfo.java +++ b/ddl/out/java/LambdaCube/TypeInfo/TypeInfo.java | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-03-21T14:06:55.479415000000Z | 2 | // 2016-03-21T15:32:17.924228000000Z |
3 | 3 | ||
4 | package LambdaCube.TypeInfo; | 4 | package LambdaCube.TypeInfo; |
5 | 5 | ||