Advertisement
Guest User

Untitled

a guest
May 26th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1.     public Object visitArgFunc(ArgFunc argFunc, List<Ast> astTree) throws SemanticException{
  2.         astTree.add(argFunc);
  3.         System.out.println("Visiting Argfunc");
  4.         List <String> expressoesArgumentos = new ArrayList<String>();
  5.         List <String> expressoesFunction = new ArrayList<String>();
  6.         boolean check = false;
  7.        
  8.         for (Exp exp : argFunc.getExpList()){
  9.             expressoesArgumentos.add((String) exp.visit(this, astTree));
  10.         }
  11.         int tamanho = expressoesArgumentos.size()-1;
  12.        
  13.         for (int i = 0; i<expressoesArgumentos.size(); i++){
  14.             expressoesFunction.add((String)(((ArgFunc) astTree.get(tamanho)).getExpList().get(i)).visit(this, astTree));
  15.         }
  16.        
  17.         if (expressoesArgumentos.equals(expressoesFunction)){
  18.             check = true;
  19.         }
  20.        
  21.        
  22.         if (!check){
  23.             throw new SemanticException("TIPOS DE ID NÃO CORRESPONDEM");
  24.         }
  25.        
  26. //      for(Exp exp : argFunc.getExpList()){
  27. //          exp.visit(this, astTree);
  28. //      }
  29.        
  30.         return null;
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement