/*(LGPL) --------------------------------------------------------------------------- symtab.h - Simple symbol table for EEL --------------------------------------------------------------------------- * Copyright (C) 2000, 2002, David Olofson * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _EEL_SYMTAB_H_ #define _EEL_SYMTAB_H_ /*------------------------------------------------ Data container ------------------------------------------------*/ struct eel_symbol_table_t; struct eel_symbol_t; struct eel_data_t; typedef int (*eel_operator_cb_t)(int argc, struct eel_data_t *argv); typedef int (*eel_parser_cb_t)(void); /* Native datatypes */ typedef enum { EDT_ILLEGAL = 0, EDT_REAL, /* Real */ EDT_INTEGER, /* Integer */ EDT_STRING, /* String */ EDT_CADDR, /* Code address */ EDT_SYMREF, /* Symbol reference */ EDT_SYMTAB, /* Symbol Table Reference (for namespaces) */ EDT_SYMNAME, /* Name of a new symbol (String) */ EDT_OPERATOR, /* Operator callback */ EDT_DIRECTIVE, /* Directive parser callback */ EDT_SPECIAL /* Special parser callback */ } eel_datatypes_t; #define EDTM_ILLEGAL (1< callback; token = priority */ EST_DIRECTIVE, /* data -> callback */ EST_SPECIAL, /* data -> callback */ EST_ENUM, /* token = enum type; data.i = enum value */ EST_NAMESPACE /* data -> namespace symbol table */ } eel_symtypes_t; #define ESTM_UNDEFINED (1<