summaryrefslogtreecommitdiff
path: root/include/parser/proc.h
blob: f74fee6b6e55497c1e9abf2380fa2b9f132e5db1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Procedure parser.
 * Copyright (c) 2023-2024, Quinn Stephens and the OSMORA team.
 * Provided under the BSD 3-Clause license.
 */

#ifndef _PARSER_PROC_H
#define _PARSER_PROC_H

#include "list.h"
#include "hashmap.h"
#include "parser/ast.h"
#include "parser/var.h"

struct parameter {
    struct variable var;
    struct list_entry list_entry;
};

struct procedure {
    struct hashmap_entry hashmap_entry;

    char *name;
    size_t name_len;

    struct hashmap vars;
    struct list params;

    struct type *ret_typ;
    int ret_n_ptrs;

    struct ast_node *node;
};

void parse_proc(struct parser *ctx);

#endif /* !_PARSER_PROC_H */