Package com.dragome.compiler.ast

Examples of com.dragome.compiler.ast.ThisExpression


      case Const.ALOAD_3:
      {

        if (opcode == Const.ALOAD_0 && !Modifier.isStatic(methodDecl.getAccess()))
        {
          ThisExpression reference= new ThisExpression();
          instruction= reference;
        }
        else
        {
          VariableBinding reference= createVariableBinding(opcode - Const.ALOAD_0, Type.OBJECT, false);
          reference.setField(true);
          instruction= reference;
        }
        break;
      }

      case Const.ILOAD:

      case Const.LLOAD:

      case Const.FLOAD:

      case Const.DLOAD:
      {

        VariableBinding reference= createVariableBinding(readUnsigned(), form.getResultType(), false);
        reference.setField(false);
        instruction= reference;
        break;
      }

      case Const.ALOAD:
      {

        VariableBinding reference= createVariableBinding(readUnsigned(), Type.OBJECT, false);
        reference.setField(true);
        instruction= reference;
        break;
      }

      case Const.BALOAD:

      case Const.CALOAD:

      case Const.SALOAD:

      case Const.IALOAD:

      case Const.LALOAD:

      case Const.FALOAD:

      case Const.DALOAD:

      case Const.AALOAD:
      {

        Expression index= stack.pop();
        Expression arrayRef= stack.pop();
        ArrayAccess aa;
        aa= new ArrayAccess();
        aa.setTypeBinding(form.getResultType());
        aa.setArray(arrayRef);
        aa.setIndex(index);

        instruction= aa;
        break;
      }

      case Const.BASTORE:

      case Const.CASTORE:

      case Const.SASTORE:

      case Const.IASTORE:

      case Const.LASTORE:

      case Const.FASTORE:

      case Const.DASTORE:

      case Const.AASTORE:
      {

        Expression value= stack.pop();
        Expression index= stack.pop();
        Expression arrayRef= stack.pop();
        if (arrayRef instanceof ArrayCreation)
        {
          ArrayCreation ac= (ArrayCreation) arrayRef;
          if (ac.getInitializer() == null)
          {
            ac.setInitializer(new ArrayInitializer());
          }
          ac.getInitializer().getExpressions().add(value);
          instruction= new NoOperation();
          break;
        }
        Assignment a= new Assignment(Assignment.Operator.ASSIGN);

        ArrayAccess aa;
        aa= new ArrayAccess();
        aa.setArray(arrayRef);
        aa.setIndex(index);

        a.setLeftHandSide(aa);
        a.setRightHandSide(value);
        instruction= a;
        break;
      }

      case Const.DSTORE:

      case Const.DSTORE_0:

      case Const.DSTORE_1:

      case Const.DSTORE_2:

      case Const.DSTORE_3:
      {

        int index;
        if (opcode == Const.DSTORE)
        {
          index= readUnsigned();
        }
        else
        {
          index= opcode - Const.DSTORE_0;
        }
        Assignment a= new Assignment(Assignment.Operator.ASSIGN);
        VariableBinding reference= createVariableBinding(index, Type.DOUBLE, true);
        reference.setField(false);
        a.setLeftHandSide(reference);
        a.setRightHandSide(stack.pop());
        instruction= a;
        break;
      }

      case Const.FSTORE:

      case Const.FSTORE_0:

      case Const.FSTORE_1:

      case Const.FSTORE_2:

      case Const.FSTORE_3:
      {

        int index;
        if (opcode == Const.FSTORE)
        {
          index= readUnsigned();
        }
        else
        {
          index= opcode - Const.FSTORE_0;
        }
        Assignment a= new Assignment(Assignment.Operator.ASSIGN);
        VariableBinding reference= createVariableBinding(index, Type.FLOAT, true);
        reference.setField(false);
        a.setLeftHandSide(reference);
        a.setRightHandSide(stack.pop());
        instruction= a;
        break;
      }

      case Const.ISTORE:

      case Const.ISTORE_0:

      case Const.ISTORE_1:

      case Const.ISTORE_2:

      case Const.ISTORE_3:
      {

        int index;
        if (opcode == Const.ISTORE)
        {
          index= readUnsigned();
        }
        else
        {
          index= opcode - Const.ISTORE_0;
        }
        Assignment a= new Assignment(Assignment.Operator.ASSIGN);
        VariableBinding reference= createVariableBinding(index, Type.INT, true);
        reference.setField(false);
        a.setLeftHandSide(reference);
        a.setRightHandSide(stack.pop());
        instruction= a;
        break;
      }

      case Const.LSTORE:

      case Const.LSTORE_0:

      case Const.LSTORE_1:

      case Const.LSTORE_2:

      case Const.LSTORE_3:
      {

        int index;
        if (opcode == Const.LSTORE)
        {
          index= readUnsigned();
        }
        else
        {
          index= opcode - Const.LSTORE_0;
        }
        Assignment a= new Assignment(Assignment.Operator.ASSIGN);
        VariableBinding reference= createVariableBinding(index, Type.LONG, true);
        reference.setField(false);
        a.setLeftHandSide(reference);
        a.setRightHandSide(stack.pop());
        instruction= a;
        break;
      }
View Full Code Here

TOP

Related Classes of com.dragome.compiler.ast.ThisExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.