Skip to content
Snippets Groups Projects
Select Git revision
  • 130bc9d1750a0dab358b537b79f7c1508197b086
  • dev default protected
  • main protected
  • feature/ros-java-integration
4 results

Test.jadd

Blame
  • rschoene's avatar
    René Schöne authored
    - parse complete JavaUse as type for attribute targets
    - add new observer entries (inc. eval) for NTA and attribute targets
    - tests currently not passing
    130bc9d1
    History
    Test.jadd 1.39 KiB
    import java.util.Set;
    import java.util.HashSet;
    aspect Computation {
      syn String SenderRoot.basic() = getInput();
      syn String SenderRoot.simple() = getInput() + "Post";
      syn int SenderRoot.transformed() = Integer.parseInt(getInput());
      syn A SenderRoot.toReferenceType() {
        A result = new A();
        result.setValue(getInput());
        Inner inner = new Inner();
        inner.setInnerValue("1");
        result.setInner(inner);
        return result;
      }
      syn nta A SenderRoot.toNTA() {
        A result = new A();
        result.setValue(getInput());
        Inner inner = new Inner();
        inner.setInnerValue("2");
        result.setInner(inner);
        return result;
      }
      syn int SenderRoot.circularAttribute() circular [0] {
        return Integer.parseInt(getInput()) + 2;
      }
      coll Set<String> SenderRoot.collectionAttribute() [new HashSet<>()] root SenderRoot ;
      A contributes getValue() to SenderRoot.collectionAttribute();
      SenderRoot contributes nta toNTA() to SenderRoot.collectionAttribute();
    }
    aspect MakeCodeCompile {
    
    }
    aspect MakeCodeWork {
    
    }
    aspect NameResolution {
      // overriding customID guarantees to produce the same JSON representation for equal lists
      // otherwise, the value for id is different each time
      @Override
      protected String A.customID() {
        return getClass().getSimpleName() + getValue();
      }
      @Override
      protected String Inner.customID() {
        return getClass().getSimpleName() + getInnerValue();
      }
    }