Package com.dragome.compiler.ast

Examples of com.dragome.compiler.ast.ArrayAccess


      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;
View Full Code Here

TOP

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

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.