/* =====================================
 * Generated by Mod-c 0.26.5
 * MODULE symbol
 * ===================================== */

#include "symbol.h"

void symbol(void);

/**
 * Symbol table related stuff.
 */
#include "stddef.h"
#include "arena.h"
#include "ttype.h"
#include "symkind.h"
#include "node.h"
/** TTymbol structure */
/**
 * Function symbol_create()
 * @param arena
 * @param kind
 * @param name
 * @param name_len
 * @param decl
 * @return ^TSymbol
 */
TSymbol* symbol_create(Arena* arena, SymbolKind kind, const char* name, size_t name_len, pNode decl)
{
    TSymbol* s = arena_alloc(arena, ((integer)sizeof(TSymbol)));
    ((*s)).kind = kind;
    ((*s)).name = name;
    ((*s)).name_len = name_len;
    ((*s)).symbol_type = nil;
    ((*s)).decl = decl;
    ((*s)).is_exported = false;
    ((*s)).has_const_value = false;
    ((*s)).const_value = 0;
    ((*s)).is_method_instance = false;
    /* return value captured before defers */
    TSymbol* __ret_l61 = s;
    return __ret_l61;
}

/**
 * Function symbol_kind_name()
 * @param kind
 * @return const ^char
 */
const char* symbol_kind_name(SymbolKind kind)
{
    switch (kind)
    {
        case SYM_KIND_CONST:
        {
            /* return value captured before defers */
            const char* __ret_l73 = "CONST";
            return __ret_l73;
        }
        break;
        case SYM_KIND_FIELD:
        {
            /* return value captured before defers */
            const char* __ret_l74 = "FIELD";
            return __ret_l74;
        }
        break;
        case SYM_KIND_FUNC:
        {
            /* return value captured before defers */
            const char* __ret_l75 = "FUNC";
            return __ret_l75;
        }
        break;
        case SYM_KIND_IMPORT:
        {
            /* return value captured before defers */
            const char* __ret_l76 = "IMPORT";
            return __ret_l76;
        }
        break;
        case SYM_KIND_LET:
        {
            /* return value captured before defers */
            const char* __ret_l77 = "LET";
            return __ret_l77;
        }
        break;
        case SYM_KIND_PARAM:
        {
            /* return value captured before defers */
            const char* __ret_l78 = "PARAM";
            return __ret_l78;
        }
        break;
        case SYM_KIND_PROC:
        {
            /* return value captured before defers */
            const char* __ret_l79 = "PROC";
            return __ret_l79;
        }
        break;
        case SYM_KIND_RECEIVER:
        {
            /* return value captured before defers */
            const char* __ret_l80 = "RECEIVER";
            return __ret_l80;
        }
        break;
        case SYM_KIND_STRUCT:
        {
            /* return value captured before defers */
            const char* __ret_l81 = "STRUCT";
            return __ret_l81;
        }
        break;
        case SYM_KIND_TYPE:
        {
            /* return value captured before defers */
            const char* __ret_l82 = "TYPE";
            return __ret_l82;
        }
        break;
        case SYM_KIND_UNKNOWN:
        {
            /* return value captured before defers */
            const char* __ret_l83 = "UNKNOWN";
            return __ret_l83;
        }
        break;
        case SYM_KIND_VAR:
        {
            /* return value captured before defers */
            const char* __ret_l84 = "VAR";
            return __ret_l84;
        }
        break;
        default:
        {
            /* return value captured before defers */
            const char* __ret_l85 = "UNKNOWN";
            return __ret_l85;
        }
        break;
    }
}


void symbol(void)
{
}
