Package com.dragome.compiler.ast

Examples of com.dragome.compiler.ast.VariableDeclaration


    classUnit.setData(reset());

    List fields= theTypeDecl.getFields();
    for (int i= 0; i < fields.size(); i++)
    {
      VariableDeclaration decl= (VariableDeclaration) fields.get(i);

      if (decl.getLocation() == VariableDeclaration.NON_LOCAL)
      {
        //      if (Modifier.isStatic(decl.getModifiers()))
        //    continue;
        //    indent();
        decl.visit(this);
        //println(",");
      }
    }
    depth--;
    //  String superType= null;
View Full Code Here


    }

    Iterator<VariableDeclaration> iterator= method.getParameters().iterator();
    while (iterator.hasNext())
    {
      VariableDeclaration decl= iterator.next();
      if ("function".equals(decl.getName()))
        print("_");
      decl.visit(this);
      print(iterator.hasNext() ? ", " : "");
    }

    println(")");
    println("{");

    depth= 1;

    Collection<VariableDeclaration> localVariables= method.getLocalVariables();
    if (localVariables.size() > 0)
      print("var ");

    int i= 0;
    for (VariableDeclaration decl : localVariables)
    {
      decl.visit(this);

      if (++i < localVariables.size())
        print(",");
    }
View Full Code Here

    Field[] fields= jc.getFields();
    for (int i= 0; i < fields.length; i++)
    {
      Field field= fields[i];
      VariableDeclaration variableDecl= new VariableDeclaration(VariableDeclaration.NON_LOCAL);
      variableDecl.setName(field.getName());
      variableDecl.setModifiers(field.getModifiers());
      variableDecl.setType(field.getType());

      typeDecl.addField(variableDecl);
    }

    for (int i= 0; i < bcelMethods.length; i++)
View Full Code Here

      offset= 1;
    }
    for (int i= 0; i < types.length; i++)
    {
      VariableDeclaration variableDecl= new VariableDeclaration(VariableDeclaration.LOCAL_PARAMETER);
      variableDecl.setName(VariableDeclaration.getLocalVariableName(method, offset, 0));
      variableDecl.setType(types[i]);
      methodDecl.addParameter(variableDecl);
      offset+= types[i].getSize();
    }

    if (methodDecl.getCode() == null)
View Full Code Here

  }

  private CatchClause createCatchClause(TryStatement tryStmt, ExceptionHandler handle)
  {
    CatchClause cStmt= new CatchClause(handle.getHandlerPC());
    VariableDeclaration decl= new VariableDeclaration(VariableDeclaration.LOCAL_PARAMETER);
    decl.setName("_EX_");
    decl.setType(handle.getCatchType(constantPool));
    cStmt.setException(decl);
    tryStmt.addCatchStatement(cStmt);
    return cStmt;
  }
View Full Code Here

      return;

    Iterator iter= tempDecls.iterator();
    while (iter.hasNext())
    {
      VariableDeclaration decl= (VariableDeclaration) iter.next();
      int count= decl.vbs.size();
      if (count == 3)
      {
        if (reduceXCrement(decl))
        {
          iter.remove();
          methodDecl.removeLocalVariable(decl.getName());
        }
        else if (reduceYCrement(decl))
        {
          iter.remove();
          methodDecl.removeLocalVariable(decl.getName());
        }
      }
    }
  }
View Full Code Here

TOP

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

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.