コード例 #1
0
ファイル: SetClass.java プロジェクト: rvalimaki/trygve
 @Override
 public RTCode runDetails(final RTObject myEnclosedScope) {
   final RTDynamicScope activationRecord =
       RunTimeEnvironment.runTimeEnvironment_.currentDynamicScope();
   final RTSetObject theListObject = (RTSetObject) activationRecord.getObject("this");
   final RTObject rawElement = activationRecord.getObject("element");
   theListObject.add(rawElement);
   return super.nextCode();
 }
コード例 #2
0
ファイル: SetClass.java プロジェクト: rvalimaki/trygve
 @Override
 public RTCode runDetails(final RTObject myEnclosedScope) {
   final RTDynamicScope activationRecord =
       RunTimeEnvironment.runTimeEnvironment_.currentDynamicScope();
   final RTSetObject theListObject = (RTSetObject) activationRecord.getObject("this");
   theListObject.ctor();
   RunTimeEnvironment.runTimeEnvironment_.pushStack(this);
   return super.nextCode();
 }
コード例 #3
0
ファイル: MapClass.java プロジェクト: rvalimaki/trygve
 @Override
 public RTCode runDetails(final RTObject myEnclosedScope) {
   final RTDynamicScope activationRecord =
       RunTimeEnvironment.runTimeEnvironment_.currentDynamicScope();
   final RTMapObject theMapObject = (RTMapObject) activationRecord.getObject("this");
   final int rawResult = theMapObject.size();
   final RTIntegerObject result = new RTIntegerObject(rawResult);
   RunTimeEnvironment.runTimeEnvironment_.pushStack(result);
   return super.nextCode();
 }
コード例 #4
0
ファイル: MapClass.java プロジェクト: rvalimaki/trygve
 @Override
 public RTCode runDetails(final RTObject myEnclosedScope) {
   final RTDynamicScope activationRecord =
       RunTimeEnvironment.runTimeEnvironment_.currentDynamicScope();
   final RTIntegerObject key = (RTIntegerObject) activationRecord.getObject("key");
   final RTMapObject theMapObject = (RTMapObject) activationRecord.getObject("this");
   final RTStackable result = (RTStackable) theMapObject.remove(key);
   RunTimeEnvironment.runTimeEnvironment_.pushStack(result);
   return super.nextCode();
 }
コード例 #5
0
ファイル: MapClass.java プロジェクト: rvalimaki/trygve
 @Override
 public RTCode runDetails(final RTObject myEnclosedScope) {
   final RTDynamicScope activationRecord =
       RunTimeEnvironment.runTimeEnvironment_.currentDynamicScope();
   final RTMapObject theMapObject = (RTMapObject) activationRecord.getObject("this");
   final RTObject rawKey = activationRecord.getObject("key");
   final RTObject value = theMapObject.get(rawKey);
   RunTimeEnvironment.runTimeEnvironment_.pushStack(value);
   return super.nextCode();
 }
コード例 #6
0
ファイル: SetClass.java プロジェクト: rvalimaki/trygve
    @Override
    public RTCode runDetails(final RTObject myEnclosedScope) {
      final RTDynamicScope activationRecord =
          RunTimeEnvironment.runTimeEnvironment_.currentDynamicScope();
      final RTSetObject theListObject = (RTSetObject) activationRecord.getObject("this");
      final boolean rawResult = theListObject.isEmpty();
      final RTBooleanObject result = new RTBooleanObject(rawResult);

      addRetvalTo(activationRecord);
      activationRecord.setObject("ret$val", result);

      return super.nextCode();
    }
コード例 #7
0
ファイル: SetClass.java プロジェクト: rvalimaki/trygve
    @Override
    public RTCode runDetails(final RTObject myEnclosedScope) {
      final RTDynamicScope activationRecord =
          RunTimeEnvironment.runTimeEnvironment_.currentDynamicScope();
      final RTObject argument = activationRecord.getObject("element");
      final RTSetObject theListObject = (RTSetObject) activationRecord.getObject("this");
      final RTObject result = (RTObject) theListObject.contains(argument);

      addRetvalTo(activationRecord);
      activationRecord.setObject("ret$val", result);

      return super.nextCode();
    }
コード例 #8
0
ファイル: SetClass.java プロジェクト: rvalimaki/trygve
 protected void addRetvalTo(final RTDynamicScope activationRecord) {
   if (null == activationRecord.getObject("ret$val")) {
     activationRecord.addObjectDeclaration("ret$val", null);
   }
 }