You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2021/10/03 11:22:51 UTC

[plc4x-build-tools] branch feature/mspec-ng created (now afd94d4)

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a change to branch feature/mspec-ng
in repository https://gitbox.apache.org/repos/asf/plc4x-build-tools.git.


      at afd94d4  Worked on implementing some of the mspec changes we discussed (WIP)

This branch includes the following new commits:

     new afd94d4  Worked on implementing some of the mspec changes we discussed (WIP)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[plc4x-build-tools] 01/01: Worked on implementing some of the mspec changes we discussed (WIP)

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/mspec-ng
in repository https://gitbox.apache.org/repos/asf/plc4x-build-tools.git

commit afd94d466105e5059b69733ec76b8e2c741c1638
Author: cdutz <ch...@c-ware.de>
AuthorDate: Sun Oct 3 13:22:32 2021 +0200

    Worked on implementing some of the mspec changes we discussed (WIP)
---
 .../types/fields/FieldConversions.java             | 14 -----------
 .../codegenerator/types/fields/OptionalField.java  |  4 +++-
 .../codegenerator/types/fields/TryField.java       | 28 ----------------------
 .../types/references/SimpleTypeReference.java      |  1 +
 4 files changed, 4 insertions(+), 43 deletions(-)

diff --git a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/FieldConversions.java b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/FieldConversions.java
index 6a9d95c..d348fa8 100644
--- a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/FieldConversions.java
+++ b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/FieldConversions.java
@@ -263,20 +263,6 @@ public interface FieldConversions {
     }
 
     /**
-     * @return true if {@code this} is instance of {@link TryField}
-     */
-    default boolean isTryField() {
-        return this instanceof TryField;
-    }
-
-    /**
-     * @return a {@link TryField} if castable.
-     */
-    default Optional<TryField> asTryField() {
-        return Optional.of(this).filter(TryField.class::isInstance).map(TryField.class::cast);
-    }
-
-    /**
      * @return true if {@code this} is instance of {@link TypedField}
      */
     default boolean isTypedField() {
diff --git a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/OptionalField.java b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/OptionalField.java
index 0585890..166caaf 100644
--- a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/OptionalField.java
+++ b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/OptionalField.java
@@ -21,12 +21,14 @@ package org.apache.plc4x.plugins.codegenerator.types.fields;
 
 import org.apache.plc4x.plugins.codegenerator.types.terms.Term;
 
+import java.util.Optional;
+
 public interface OptionalField extends PropertyField {
 
     default String getTypeName() {
         return "optional";
     }
 
-    Term getConditionExpression();
+    Optional<Term> getConditionExpression();
 
 }
diff --git a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/TryField.java b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/TryField.java
deleted file mode 100644
index 0b6328b..0000000
--- a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/TryField.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.plc4x.plugins.codegenerator.types.fields;
-
-public interface TryField {
-    /**
-     * Returns true if this field should be tryed to be parsed
-     *
-     * @return true if failure is an option
-     */
-    boolean isTry();
-}
diff --git a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/references/SimpleTypeReference.java b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/references/SimpleTypeReference.java
index bb3d9bc..ad2f3b6 100644
--- a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/references/SimpleTypeReference.java
+++ b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/references/SimpleTypeReference.java
@@ -32,6 +32,7 @@ public interface SimpleTypeReference extends TypeReference {
         FLOAT,
         UFLOAT,
         STRING,
+        VSTRING,
         TIME,
         DATE,
         DATETIME,