SHARE
TWEET

Untitled

a guest May 22nd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top