Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void percorre_AST (n1 roots){
- n1 root = roots;
- int verificaIrmao = 1;
- root = root->filhos;
- scope_Root = init_Scope("Global");
- addPutcharGetChar();
- while(verificaIrmao == 1){
- if(strcmp(root->descricao,"VarDecl") == 0){
- adiciona_VarDecl(root);
- }
- else if(strcmp(root->descricao,"FuncDecl") == 0){
- if(checkFuncDecl(root->filhos->filhos->valor) == 0 && checkFuncInTable(root->filhos->filhos->valor) == 0){
- addFuncToGlogal(root);
- }
- else{
- }
- }
- root = root->irmaos;
- if(root == NULL){
- verificaIrmao = 0;
- }
- }
- printScopes();
- printf("\n");
- //imprime_AST(roots,0);
- imprime_AST_Anotada_Main(roots,0,"Program","Global");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement