Skip to content
Snippets Groups Projects
Select Git revision
  • a4ef44f13dced928cac8def20052beabec0350de
  • development default protected
  • treinamento-2025
  • cursos-superior
  • doc_agregado_ies
  • micro_dados_2021
  • escola-agregada-teste
  • homologa protected
  • master protected
  • v1.0.41
10 results

escola.csv

Blame
  • ts.h 1.22 KiB
    #ifndef __TS__
    #define __TS__
    
    typedef struct vs_t {
        int tipo;
        int desloc;
    } vs_t;
    
    typedef struct pr_t {
        char rot[4];
        int quant;
        int **param;
    } pr_t;
    
    typedef struct pf_t {
        int tipo;
        int desloc;
        int passagem;
    } pf_t;
    
    typedef struct fun_t {
        char rot[4];
        int quant;
        int **param;
        int tipo;
        int desloc;
    } fun_t;
    
    typedef union info_t {
        vs_t vs;
        pr_t pr;
        pf_t pf;
        fun_t fun;
    } info_t;
    
    typedef struct simb_t {
        char *ident;
        int categ;
        int nivel;
        info_t info;
        struct simb_t *prox; // Corrigido: use explicitamente struct simb_t
    } simb_t;
    
    typedef struct ts_t {
        simb_t *topo;
        int tam;
    } ts_t;
    
    // enum de tipos
    #define NSEI 0
    #define INTEIRO 1
    #define BOOLEAN 2
    
    // enum categorias
    #define VS 0
    #define PR 1
    #define PF 2
    #define FUN 3
    
    // enum passagem
    #define VLR 0
    #define REF 1
    
    void inicializa_ts(ts_t *ts);
    
    void insere_ts(char *ident, int categ, int nivel, info_t info, ts_t *ts);
    
    simb_t *busca(char *ident, ts_t *ts); // Corrigido: retorna ponteiro para simb_t
    
    simb_t *topo(ts_t *ts);
    
    int retira(int n, ts_t *ts);
    
    void atualiza_tipo(int n, int tipo, ts_t *ts);
    
    void adiciona_param(char *ident, int n, ts_t *ts);
    
    void mostra_ts(ts_t *ts);
    
    #endif