Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.81 KB | None | 0 0
  1.  
  2. void percorre_AST (n1 roots){
  3.     n1 root = roots;
  4.     int verificaIrmao = 1;
  5.     root =  root->filhos;
  6.     scope_Root = init_Scope("Global");
  7.     addPutcharGetChar();
  8.     while(verificaIrmao == 1){
  9.         if(strcmp(root->descricao,"VarDecl") == 0){
  10.             adiciona_VarDecl(root);
  11.         }
  12.         else if(strcmp(root->descricao,"FuncDecl") == 0){
  13.             if(checkFuncDecl(root->filhos->filhos->valor) == 0 && checkFuncInTable(root->filhos->filhos->valor) == 0){
  14.                 addFuncToGlogal(root);
  15.             }
  16.             else{
  17.  
  18.             }
  19.         }
  20.  
  21.         root = root->irmaos;
  22.         if(root == NULL){
  23.             verificaIrmao = 0;
  24.         }
  25.     }
  26.  
  27.     printScopes();
  28.     printf("\n");
  29.     //imprime_AST(roots,0);
  30.     imprime_AST_Anotada_Main(roots,0,"Program","Global");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement