Ejemplo n.º 1
0
  public void atMethodDecl(MethodDecl method) throws CompileError {
    ASTList mods = method.getModifiers();
    setMaxLocals(1);
    while (mods != null) {
      Keyword k = (Keyword) mods.head();
      mods = mods.tail();
      if (k.get() == STATIC) {
        setMaxLocals(0);
        inStaticMethod = true;
      }
    }

    ASTList params = method.getParams();
    while (params != null) {
      atDeclarator((Declarator) params.head());
      params = params.tail();
    }

    Stmnt s = method.getBody();
    atMethodBody(s, method.isConstructor(), method.getReturn().getType() == VOID);
  }