Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Enumerations | Functions | Variables
PCE.c File Reference
#include <stdio.h>
#include <setjmp.h>
#include <EIMIL.h>
#include <EIMILint.h>

Go to the source code of this file.

Classes

struct  PCE_data
struct  PCE_SEH_catchblock
struct  PCE_SEH_block
struct  PCE_context
struct  PCE_funcproto
struct  PCE_function
struct  PCE_inst_template
struct  PCE_label
struct  PCE_labelset
struct  PCE_parse_context
struct  PCE_code
struct  PCE_call_catcharg
union  PCE_code.val

Defines

#define PCE_MAX_NUMBER   ((1 << 23) - 1)
#define PCE_DICTIONARY_DEFAULT_SIZE   17
#define PCE_CALL_MAX_DEPTH   16
#define PCE_ARG_MAX   5
#define PCE_SET_REQUIRED_TYPES(PCX, PIT)   (memcpy((PCX)->required_type, (PIT)->required_type, sizeof((PCX)->required_type)))
#define PCE_NEW_PARSER_CONTEXT_MODE(pcx, m)   (((pcx)->mode & PCE_CONTEXT_MODE_PERSISTENT_MASK) | (m))
#define PCE_SET_PARSER_CONTEXT_MODE(pcx, m)   ((pcx)->mode | (m))
#define PCE_RESET_PARSER_CONTEXT_MODE(pcx, m)   ((pcx)->mode & (~(m)))
#define PCE_ADD_CODE(PCX, PCODE)   (((PCODE)->pnext = (PCX)->pc), ((PCX)->pc = (PCODE)), ((PCX)->idx++))
#define DECLARE_PARSER_METHOD(name)
#define DEFINE_PARSER_METHOD(name)   DECLARE_PARSER_METHOD(name)
#define PCE_noarg_option   (EIMIL_element_EMPTY | EIMIL_element_multiple)
#define PCE_arg_option   (EIMIL_element_multiple | EIMIL_allow_PCDATA | EIMIL_PCDATA_QUOTED_TOKEN)
#define DEFINE_SINST_TEMPLATE_1(name, kind, type, mode, arg1)
#define DEFINE_SINST_TEMPLATE_0(name, kind, type, mode)   DEFINE_SINST_TEMPLATE_1(name, kind, type, mode, 0)
#define DEFINE_INST_TEMPLATE_5(name, type, mode, arg1, arg2, arg3, arg4, arg5)
#define DEFINE_INST_TEMPLATE_4(name, type, mode, arg1, arg2, arg3, arg4)   DEFINE_INST_TEMPLATE_5(name, type, mode, arg1, arg2, arg3, arg4, 0)
#define DEFINE_INST_TEMPLATE_3(name, type, mode, arg1, arg2, arg3)   DEFINE_INST_TEMPLATE_5(name, type, mode, arg1, arg2, arg3, 0, 0)
#define DEFINE_INST_TEMPLATE_2(name, type, mode, arg1, arg2)   DEFINE_INST_TEMPLATE_5(name, type, mode, arg1, arg2, 0, 0, 0)
#define DEFINE_INST_TEMPLATE_1(name, type, mode, arg1)   DEFINE_INST_TEMPLATE_5(name, type, mode, arg1, 0, 0, 0, 0)
#define DEFINE_INST_TEMPLATE_0(name, type, mode)   DEFINE_INST_TEMPLATE_5(name, type, mode, 0, 0, 0, 0, 0)
#define INST_ELEMENT_TEMPLATE(name, strname)
#define INST_ELEMENT_TEMPLATE_NOARG(name, strname)
#define INST_ELEMENT_TEMPLATE_OPTION(name, strname, option)
#define DECLARE_EXEC_METHOD(name)
#define DEFINE_EXEC_METHOD(name)   DECLARE_EXEC_METHOD(name)
#define EIMIL_TEMPLATE_NUM(e)   (sizeof(e) / sizeof(EIMIL_element_template))
#define TYPE_NAME_LEN_MAX   64
#define PCE_LABEL_INITIALI_ALLOC_SIZE   16;
#define PCE_ischdec(c)   (((c) >= '0' && (c) <= '9'))
#define PCE_chdec(c)   ((c) - '0')
#define PCE_ischhex(c)
#define PCE_chhex(c)
#define PCE_ARGUMENT_DICTIONARY_SIZE   5

Typedefs

typedef struct PCE_code
typedef struct PCE_data
typedef struct PCE_context
typedef struct PCE_funcproto
typedef struct PCE_function
typedef struct PCE_inst_template
typedef struct PCE_parse_context
typedef struct PCE_label
typedef struct PCE_labelset
typedef EIMIL_value *(* PCE_EXEC_HANDLER )(PCE_context *pctx)
typedef enum PCE_ERROR_CODE(* PCE_SEH_TRY_FUNCTION )(PCE_context *pctx, void *arg)
typedef enum PCE_ERROR_CODE(* PCE_SEH_CATCH_FUNCTION )(PCE_context *pctx, int ecode, void *throwarg, void *catcharg)
typedef struct PCE_SEH_catchblock
typedef struct PCE_SEH_block

Enumerations

enum  PCE_CODE_TYPE {
  PCE_CODE_INST, PCE_CODE_VALUE, PCE_CODE_MAIN, PCE_CODE_DEFUN,
  PCE_CODE_JMP, PCE_CODE_UNRESOLVED_JMP, PCE_CODE_COND_JMP, PCE_CODE_UNRESOLVED_COND_JMP,
  PCE_CODE_COND_NOT_JMP, PCE_CODE_UNRESOLVED_COND_NOT_JMP, PCE_CODE_SYMBOL = (1 << 16), PCE_CODE_FUNCTION
}
enum  PCE_CONTEXT_MODE {
  PCE_IN_MAIN = (1 << 0), PCE_IN_TRY = (1 << 1), PCE_IN_CATCH = (1 << 2), PCE_IN_DEFVAR = (1 << 3),
  PCE_DEFVAR_NIL = (1 << 4), PCE_DEFVAR_DONE = (1 << 5), PCE_IN_DEFUN = (1 << 6), PCE_IN_DEFTABLE = (1 << 7),
  PCE_IN_DEFPATTERN = (1 << 8), PCE_CONTEXT_MODE_PERSISTENT_MASK = (1 << 16) - 1, PCE_IN_IF = (1 << 16), PCE_IN_ELSE = (1 << 17),
  PCE_IN_E = (1 << 18), PCE_IN_SELECT = (1 << 19), PCE_SELECT_HAS_DEFAULT = (1 << 20), PCE_ONLY_IN_MAIN_STATEMENT = (1 << 21)
}
enum  PCE_ERROR_CODE {
  PCE_ANY_ERROR = -1, PCE_SUCCESS = 0, PCE_UNKNOWN_ERROR, PCE_MEMORY_ERROR,
  PCE_LITERAL_OVERFLOW, PCE_DEC_NUMBER_ERROR, PCE_HEX_NUMBER_ERROR, PCE_CHAR_LITERAL_ERROR,
  PCE_MTEXT_LITERAL_ERROR, PCE_NOT_VARIABLE_ERROR, PCE_NOT_FUNCTION_ERROR, PCE_NOT_EXCEPTION_ERROR,
  PCE_LABEL_NOT_DEFINED_ERROR, PCE_PARSE_NOT_LITERAL, PCE_PARSE_SYNTAX_ERROR, PCE_PARSE_UNKNOWN_SYMBOL_ERROR,
  PCE_PARSE_INVALID_SYMBOL_ERROR, PCE_PARSE_RETURN_IN_DEFUN_ERROR, PCE_TOO_FEW_ARGUMENTS_ERROR, PCE_WRONG_TYPE_ARGUMENT_ERROR,
  PCE_VARIABLE_CONSTANT_ERROR, PCE_OUT_OF_RANGE_ERROR, PCE_OVER_EVAL_DEPTH_ERROR, PCE_DEFVAR_DONE_ERROR,
  PCE_DEFVAR_NIL_ERROR, PCE_RETURN_JMP_ERROR, PCE_WAIT_NEXT_EVENT_ERROR, PCE_NO_MORE_ARG_ERROR
}
enum  PCE_inst {
  PCE_INVALID_INST = -1, PCE_NOP = 0, PCE_WHILE, PCE_GO,
  PCE_LABEL, PCE_UNDO, PCE_MARK_UNDO, PCE_TRY,
  PCE_THROW, PCE_IF, PCE_SELECT, PCE_TOGGLE_PREEDIT,
  PCE_TOGGLE_LOOKUP_CHOICE, PCE_KEYEVENTP, PCE_OR, PCE_AND,
  PCE_NOT, PCE_GT, PCE_LT, PCE_LE,
  PCE_GE, PCE_EQL, PCE_TBLKEYMAXSIZE, PCE_TBLVALMAXSIZE,
  PCE_PROPSIZE, PCE_PROPMBEG, PCE_PROPMEND, PCE_EVVAL,
  PCE_EVMOD, PCE_STRLEN, PCE_STRCMP, PCE_ADD,
  PCE_SUB, PCE_MUL, PCE_DIV, PCE_MOD,
  PCE_BOR, PCE_BAND, PCE_BXOR, PCE_UCSVAL,
  PCE_MAKEPROP, PCE_PROPADD, PCE_PROPCOPY, PCE_GETMPROP,
  PCE_FINDMPROP, PCE_EVCHAR, PCE_STRREF, PCE_MAKECHAR,
  PCE_INTERACT, PCE_MATCH, PCE_EVTYPE, PCE_EVMTEXT,
  PCE_CONCAT, PCE_SUBSTR, PCE_NEXT, PCE_FORWARD,
  PCE_SEND, PCE_MAKEEV, PCE_COMMIT, PCE_UNROLL,
  PCE_PROPDEL, PCE_ADDMPROP, PCE_DELMPROP, PCE_SETMPROP,
  PCE_SET, PCE_E, PCE_TBLREF
}
enum  PCE_JMP_END_FLAG { PCE_UNCOND_JMP_END, PCE_COND_JMP_END, PCE_COND_NOT_JMP_END }
enum  PCE_VAL_TYPE { PCE_VAL_TYPE_INVALID, PCE_VAL_TYPE_NIL, PCE_VAL_TYPE_CONST, PCE_VAL_TYPE_INIT }

Functions

static void PCE_set_error (EIMIL_data *ped, enum PCE_ERROR_CODE code)
static int PCE_generic_inst_parser (EIMIL_data *ped, EIMIL_attrs *patr, enum EIMIL_TAG_TYPE type, UTF8 *pchars, void **pprivate)
 DECLARE_PARSER_METHOD (PCE)
 DECLARE_PARSER_METHOD (mnemonic)
 DECLARE_PARSER_METHOD (pattern)
 DECLARE_PARSER_METHOD (key)
 DECLARE_PARSER_METHOD (defvar)
 DECLARE_PARSER_METHOD (defun)
 DEFINE_SINST_TEMPLATE_1 (defun, PCE_CODE_DEFUN, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_ANY|EIMIL_TYPE_OPTION1)
 DECLARE_PARSER_METHOD (deftable)
 DECLARE_PARSER_METHOD (defkeymap)
 DECLARE_PARSER_METHOD (defpattern)
 DECLARE_PARSER_METHOD (main)
 DEFINE_SINST_TEMPLATE_1 (main, PCE_CODE_MAIN, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_ANY|EIMIL_TYPE_OPTION1)
 DECLARE_PARSER_METHOD (while)
 DECLARE_PARSER_METHOD (go)
 DECLARE_PARSER_METHOD (label)
 DECLARE_PARSER_METHOD (undo)
 DECLARE_EXEC_METHOD (undo)
 DEFINE_INST_TEMPLATE_0 (undo, EIMIL_TYPE_NONE, 0)
 DECLARE_PARSER_METHOD (mark_undo)
 DECLARE_EXEC_METHOD (mark_undo)
 DEFINE_INST_TEMPLATE_0 (mark_undo, EIMIL_TYPE_NONE, 0)
 DECLARE_PARSER_METHOD (try)
 DECLARE_EXEC_METHOD (try)
 DEFINE_INST_TEMPLATE_1 (try, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_ANY|EIMIL_TYPE_OPTION1)
 DECLARE_PARSER_METHOD (catch)
 DECLARE_EXEC_METHOD (catch)
 DEFINE_INST_TEMPLATE_1 (catch, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_ANY|EIMIL_TYPE_OPTION1)
 DECLARE_PARSER_METHOD (throw)
 DECLARE_EXEC_METHOD (throw)
 DEFINE_INST_TEMPLATE_0 (throw, EIMIL_TYPE_NONE, 0)
 DECLARE_PARSER_METHOD (if)
 DECLARE_PARSER_METHOD (else)
 DECLARE_PARSER_METHOD (keycase)
 DECLARE_EXEC_METHOD (keycase)
 DEFINE_INST_TEMPLATE_1 (keycase, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_ANY|EIMIL_TYPE_OPTION1)
 DECLARE_PARSER_METHOD (keymap)
 DECLARE_EXEC_METHOD (keymap)
 DEFINE_INST_TEMPLATE_1 (keymap, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_ANY|EIMIL_TYPE_OPTION1)
 DECLARE_PARSER_METHOD (case)
 DECLARE_PARSER_METHOD (default)
 DECLARE_PARSER_METHOD (select)
 DECLARE_EXEC_METHOD (toggle_preedit)
 DEFINE_INST_TEMPLATE_1 (toggle_preedit, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_BOOL)
 DECLARE_EXEC_METHOD (toggle_lookup_choice)
 DEFINE_INST_TEMPLATE_1 (toggle_lookup_choice, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_BOOL)
 DECLARE_EXEC_METHOD (keyeventp)
 DEFINE_INST_TEMPLATE_1 (keyeventp, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_EVENT)
 DECLARE_EXEC_METHOD (or)
 DEFINE_INST_TEMPLATE_1 (or, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_ANY|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (and)
 DEFINE_INST_TEMPLATE_1 (and, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_ANY|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (not)
 DEFINE_INST_TEMPLATE_1 (not, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_ANY)
 DECLARE_EXEC_METHOD (gt)
 DEFINE_INST_TEMPLATE_2 (gt, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_NUMBER, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (lt)
 DEFINE_INST_TEMPLATE_2 (lt, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_NUMBER, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (le)
 DEFINE_INST_TEMPLATE_2 (le, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_NUMBER, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (ge)
 DEFINE_INST_TEMPLATE_2 (ge, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_NUMBER, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (eql)
 DEFINE_INST_TEMPLATE_2 (eql, EIMIL_TYPE_BOOL, 0, EIMIL_TYPE_NUMBER, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (propval)
 DEFINE_INST_TEMPLATE_2 (propval, EIMIL_TYPE_ANY, 0, EIMIL_TYPE_PROP, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (propsize)
 DEFINE_INST_TEMPLATE_1 (propsize, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_PROP)
 DECLARE_EXEC_METHOD (propmbeg)
 DEFINE_INST_TEMPLATE_1 (propmbeg, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_PROP)
 DECLARE_EXEC_METHOD (propmend)
 DEFINE_INST_TEMPLATE_1 (propmend, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_PROP)
 DECLARE_EXEC_METHOD (evval)
 DEFINE_INST_TEMPLATE_1 (evval, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_EVENT)
 DECLARE_EXEC_METHOD (evmod)
 DEFINE_INST_TEMPLATE_1 (evmod, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_EVENT)
 DECLARE_EXEC_METHOD (strlen)
 DEFINE_INST_TEMPLATE_1 (strlen, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_MTEXT)
 DECLARE_EXEC_METHOD (strcmp)
 DEFINE_INST_TEMPLATE_2 (strcmp, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_MTEXT, EIMIL_TYPE_MTEXT)
 DECLARE_EXEC_METHOD (add)
 DEFINE_INST_TEMPLATE_1 (add, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_NUMBER|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (sub)
 DEFINE_INST_TEMPLATE_1 (sub, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_NUMBER|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (mul)
 DEFINE_INST_TEMPLATE_1 (mul, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_NUMBER|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (div)
 DEFINE_INST_TEMPLATE_1 (div, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_NUMBER|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (mod)
 DEFINE_INST_TEMPLATE_1 (mod, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_NUMBER|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (bor)
 DEFINE_INST_TEMPLATE_1 (bor, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_NUMBER|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (band)
 DEFINE_INST_TEMPLATE_1 (band, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_NUMBER|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (bxor)
 DEFINE_INST_TEMPLATE_1 (bxor, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_NUMBER|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (UCSval)
 DEFINE_INST_TEMPLATE_1 (UCSval, EIMIL_TYPE_NUMBER, 0, EIMIL_TYPE_CHAR)
 DECLARE_EXEC_METHOD (propadd)
 DEFINE_INST_TEMPLATE_2 (propadd, EIMIL_TYPE_PROP, 0, EIMIL_TYPE_PROP, EIMIL_TYPE_ANY)
 DECLARE_EXEC_METHOD (propcopy)
 DEFINE_INST_TEMPLATE_1 (propcopy, EIMIL_TYPE_PROP, 0, EIMIL_TYPE_PROP)
 DECLARE_EXEC_METHOD (evchar)
 DEFINE_INST_TEMPLATE_1 (evchar, EIMIL_TYPE_CHAR, 0, EIMIL_TYPE_EVENT)
 DECLARE_EXEC_METHOD (strref)
 DEFINE_INST_TEMPLATE_2 (strref, EIMIL_TYPE_CHAR, 0, EIMIL_TYPE_MTEXT, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (makechar)
 DEFINE_INST_TEMPLATE_1 (makechar, EIMIL_TYPE_CHAR, 0, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (evtype)
 DEFINE_INST_TEMPLATE_1 (evtype, EIMIL_TYPE_MTEXT, 0, EIMIL_TYPE_EVENT)
 DECLARE_EXEC_METHOD (evmtext)
 DEFINE_INST_TEMPLATE_1 (evmtext, EIMIL_TYPE_MTEXT, 0, EIMIL_TYPE_EVENT)
 DECLARE_EXEC_METHOD (concat)
 DEFINE_INST_TEMPLATE_1 (concat, EIMIL_TYPE_MTEXT, 0, EIMIL_TYPE_CHAR|EIMIL_TYPE_MTEXT|EIMIL_TYPE_OPTION1)
 DECLARE_EXEC_METHOD (substr)
 DEFINE_INST_TEMPLATE_3 (substr, EIMIL_TYPE_MTEXT, 0, EIMIL_TYPE_MTEXT, EIMIL_TYPE_NUMBER, EIMIL_TYPE_NUMBER|EIMIL_TYPE_OPTION2)
 DECLARE_EXEC_METHOD (next)
 DEFINE_INST_TEMPLATE_2 (next, EIMIL_TYPE_NONE, PCE_ONLY_IN_MAIN_STATEMENT, EIMIL_TYPE_EVENT, EIMIL_TYPE_EVENT|EIMIL_TYPE_OPTION2)
 DECLARE_EXEC_METHOD (makeev)
 DEFINE_INST_TEMPLATE_5 (makeev, EIMIL_TYPE_EVENT, 0, EIMIL_TYPE_MTEXT, EIMIL_TYPE_NUMBER|EIMIL_TYPE_NIL, EIMIL_TYPE_NUMBER|EIMIL_TYPE_NIL, EIMIL_TYPE_CHAR|EIMIL_TYPE_NIL, EIMIL_TYPE_MTEXT|EIMIL_TYPE_NIL)
 DECLARE_EXEC_METHOD (commit)
 DEFINE_INST_TEMPLATE_1 (commit, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_MTEXT)
 DECLARE_EXEC_METHOD (unroll)
 DEFINE_INST_TEMPLATE_1 (unroll, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_EVENT)
 DECLARE_EXEC_METHOD (propdel)
 DEFINE_INST_TEMPLATE_2 (propdel, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_PROP, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (addmprop)
 DEFINE_INST_TEMPLATE_4 (addmprop, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_MTEXT, EIMIL_TYPE_PROP, EIMIL_TYPE_NUMBER, EIMIL_TYPE_NUMBER)
 DECLARE_EXEC_METHOD (delmprop)
 DEFINE_INST_TEMPLATE_1 (delmprop, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_PROP)
 DECLARE_EXEC_METHOD (setmprop)
 DEFINE_INST_TEMPLATE_4 (setmprop, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_MTEXT, EIMIL_TYPE_PROP, EIMIL_TYPE_NUMBER, EIMIL_TYPE_NUMBER)
 DECLARE_PARSER_METHOD (return)
 DECLARE_EXEC_METHOD (return)
 DEFINE_INST_TEMPLATE_1 (return, EIMIL_TYPE_NONE, 0, EIMIL_TYPE_ANY)
 DECLARE_PARSER_METHOD (tblkeymaxsize)
 DECLARE_EXEC_METHOD (tblkeymaxsize)
 DECLARE_PARSER_METHOD (tblvalmaxsize)
 DECLARE_EXEC_METHOD (tblvalmaxsize)
 DECLARE_PARSER_METHOD (tblref)
 DECLARE_EXEC_METHOD (tblref)
 DECLARE_PARSER_METHOD (makeprop)
 DECLARE_EXEC_METHOD (makeprop)
 DECLARE_PARSER_METHOD (getmprop)
 DECLARE_EXEC_METHOD (getmprop)
 DECLARE_PARSER_METHOD (findmprop)
 DECLARE_EXEC_METHOD (findmprop)
 DECLARE_PARSER_METHOD (interact)
 DECLARE_EXEC_METHOD (interact)
 DECLARE_PARSER_METHOD (match)
 DECLARE_EXEC_METHOD (match)
 DECLARE_PARSER_METHOD (forward)
 DECLARE_EXEC_METHOD (forward)
 DECLARE_PARSER_METHOD (send)
 DECLARE_EXEC_METHOD (send)
 DECLARE_PARSER_METHOD (set)
 DECLARE_EXEC_METHOD (set)
 DECLARE_PARSER_METHOD (e)
 DECLARE_EXEC_METHOD (e)
static EIMIL_symbolPCE_intern_soft (PCE_context *pctx, unsigned char *name)
static EIMIL_symbolPCE_intern_soft_for_parser (PCE_parse_context *pcx, unsigned char *name)
static EIMIL_symbolPCE_register_symbol (PCE_context *pctx, unsigned char *name, enum EIMIL_CATEGORY cat, enum EIMIL_TYPE type)
static EIMIL_symbolPCE_get_variable (EIMIL_data *ped, PCE_parse_context *pcx, UTF8 *varname)
static EIMIL_symbolPCE_get_function (EIMIL_data *ped, PCE_parse_context *pcx, UTF8 *varname)
static EIMIL_symbolPCE_get_exception (EIMIL_data *ped, PCE_parse_context *pcx, UTF8 *varname)
static EIMIL_symbolPCE_get_property (EIMIL_data *ped, PCE_parse_context *pcx, UTF8 *propname)
static PCE_codePCE_new_code_for_inst (PCE_EXEC_HANDLER h)
static PCE_codePCE_new_code_for_value (EIMIL_value *pv)
static PCE_codePCE_new_code_for_symbol (EIMIL_symbol *psym)
static PCE_codePCE_new_code_for_function (PCE_function *pf)
static PCE_codePCE_new_code_for_etc (enum PCE_CODE_TYPE type)
static PCE_codePCE_new_code_for_jmp (enum PCE_CODE_TYPE jmptype, int id)
static EIMIL_symbolPCE_lookup_symbol (PCE_context *pctx, PCE_code *pc)
static EIMIL_valuePCE_symbol_value (PCE_context *pctx, PCE_code *pc)
static EIMIL_dictionaryPCE_new_dictionary (EIMIL_data *ped, PCE_context *pctx)
static PCE_codePCE_reverse_code (PCE_code *p)
static enum EIMIL_TYPE PCE_get_type_from_name (UTF8 *name)
static int PCE_get_type_name (int type, char *buf, int len)
static void PCE_type_mismatch_error (EIMIL_data *ped, int type, int req)
static int PCE_check_type (EIMIL_data *ped, PCE_parse_context *pcx, int type)
static int PCE_setup_arg (EIMIL_data *ped, PCE_parse_context *pcx, PCE_code **ppc)
static void PCE_free_code (PCE_code *pc)
static void PCE_free_parse_context (PCE_parse_context *pcx)
static enum PCE_ERROR_CODE PCE_initialize_labels (PCE_parse_context *pcx)
static int PCE_make_label (PCE_parse_context *pcx)
static int PCE_make_named_label (EIMIL_data *ped, PCE_parse_context *pcx, UTF8 *name)
static int PCE_lookup_named_label (PCE_parse_context *pcx, UTF8 *name)
static void PCE_mark_label (PCE_parse_context *pcx, int id, PCE_code *pc, int nextp)
static void PCE_mark_label_yet (PCE_parse_context *pcx, int id, PCE_code *pc, int nextp)
static enum PCE_ERROR_CODE PCE_fixate_labels (EIMIL_data *ped, PCE_labelset *pls, PCE_code *pc_st)
static enum PCE_ERROR_CODE PCE_finalize_labels (EIMIL_data *ped, PCE_parse_context *pcx)
static enum PCE_ERROR_CODE PCE_parse_literal (EIMIL_data *ped, UTF8 *pchars, EIMIL_value **ppv)
static enum PCE_ERROR_CODE PCE_parse_token (EIMIL_data *ped, PCE_parse_context *pcx, UTF8 *pchars)
static enum EIMIL_TYPE PCE_get_type_from_attrs (EIMIL_data *ped, EIMIL_attrs *patr)
static PCE_parse_contextPCE_parser_decl_start (EIMIL_data *ped, PCE_parse_context *pcx)
static PCE_parse_contextPCE_new_parse_context (EIMIL_data *ped)
static PCE_parse_contextPCE_parser_generic_start (EIMIL_data *ped, PCE_parse_context *pcx, int type)
static PCE_parse_contextPCE_parser_generic_end (EIMIL_data *ped, PCE_parse_context *pcx, PCE_code *pc)
static PCE_codePCE_insert_head_code (PCE_code *pc, PCE_code *pc_ins, int first_argp)
static PCE_parse_contextPCE_parser_jmp_end (EIMIL_data *ped, PCE_parse_context *pcx, enum PCE_JMP_END_FLAG condflag, int loopp)
static PCE_parse_contextPCE_parser_select_case_end (EIMIL_data *ped, PCE_parse_context *pcx)
static PCE_parse_contextPCE_parser_select_default_end (EIMIL_data *ped, PCE_parse_context *pcx)
static PCE_parse_contextPCE_parser_select_end (EIMIL_data *ped, PCE_parse_context *pcx)
static UTF8PCE_get_name_attribute (EIMIL_data *ped, EIMIL_attrs *patr)
static enum PCE_VAL_TYPE PCE_get_val_type_attribute (EIMIL_data *ped, EIMIL_attrs *patr)
static int PCE_get_funcproto_attribute (EIMIL_data *ped, EIMIL_attrs *patr, PCE_function **ppf)
 DEFINE_PARSER_METHOD (defvar)
 DEFINE_PARSER_METHOD (defun)
 DEFINE_PARSER_METHOD (main)
 DEFINE_PARSER_METHOD (deftable)
 DEFINE_PARSER_METHOD (key)
 DEFINE_PARSER_METHOD (defkeymap)
 DEFINE_PARSER_METHOD (mnemonic)
 DEFINE_PARSER_METHOD (pattern)
 DEFINE_PARSER_METHOD (defpattern)
 DEFINE_PARSER_METHOD (return)
 DEFINE_PARSER_METHOD (if)
 DEFINE_PARSER_METHOD (else)
 DEFINE_PARSER_METHOD (while)
 DEFINE_PARSER_METHOD (case)
 DEFINE_PARSER_METHOD (default)
 DEFINE_PARSER_METHOD (select)
 DEFINE_PARSER_METHOD (try)
static EIMIL_symbolPCE_attr_get_exception_symbol (EIMIL_data *ped, PCE_parse_context *pcx, EIMIL_attrs *patr)
 DEFINE_PARSER_METHOD (throw)
 DEFINE_PARSER_METHOD (catch)
static UTF8PCE_attr_get_label_symbol (EIMIL_data *ped, PCE_parse_context *pcx, EIMIL_attrs *patr)
 DEFINE_PARSER_METHOD (go)
 DEFINE_PARSER_METHOD (label)
 DEFINE_PARSER_METHOD (tblkeymaxsize)
 DEFINE_PARSER_METHOD (tblvalmaxsize)
 DEFINE_PARSER_METHOD (tblref)
static EIMIL_symbolPCE_attr_get_property_symbol (EIMIL_data *ped, PCE_parse_context *pcx, EIMIL_attrs *patr)
 DEFINE_PARSER_METHOD (makeprop)
 DEFINE_PARSER_METHOD (getmprop)
 DEFINE_PARSER_METHOD (findmprop)
 DEFINE_PARSER_METHOD (interact)
 DEFINE_PARSER_METHOD (match)
 DEFINE_PARSER_METHOD (forward)
 DEFINE_PARSER_METHOD (send)
static EIMIL_symbolPCE_attr_get_variable_symbol (EIMIL_data *ped, PCE_parse_context *pcx, EIMIL_attrs *patr)
 DEFINE_PARSER_METHOD (set)
static EIMIL_symbolPCE_attr_get_function_symbol (EIMIL_data *ped, PCE_parse_context *pcx, EIMIL_attrs *patr)
 DEFINE_PARSER_METHOD (e)
 DEFINE_PARSER_METHOD (PCE)
static void PCE_SEH_free (PCE_SEH_block *pseh)
static void PCE_destruct_context (PCE_context *pctx)
static void PCE_destruct_data (PCE_data *pd)
static void * PCE_handler (enum EIMIL_ENGINE_COMMAND m, EIMIL_data *ped, void *class_private, void *handle_private)
static enum PCE_ERROR_CODE PCE_SEH_start (PCE_context *pctx)
static enum PCE_ERROR_CODE PCE_SEH_catch (PCE_context *pctx, enum PCE_ERROR_CODE e, PCE_SEH_CATCH_FUNCTION f, void *arg)
static enum PCE_ERROR_CODE PCE_SEH_try (PCE_context *pctx, PCE_SEH_TRY_FUNCTION tf, void *arg)
static void PCE_SEH_throw (PCE_context *pctx, int ecode, void *arg)
static EIMIL_valuePCE_call (PCE_context *pctx, PCE_function *pf, PCE_code *parg)
static EIMIL_valuePCE_eval (PCE_context *pctx, PCE_code *pc)
enum PCE_ERROR_CODE PCE_execute_loop (PCE_context *pctx, void *arg)
static void PCE_bind_function_arg (PCE_context *pctx, PCE_function *pf, PCE_code *parg)
static void PCE_unbind_function_arg (PCE_context *pctx, PCE_function *pf)
static enum PCE_ERROR_CODE PCE_call_exception_handler (PCE_context *pctx, int ecode, void *throwarg, void *catcharg)
static enum PCE_ERROR_CODE PCE_get_arg (PCE_context *pctx, int idx, int type, EIMIL_value **ppv)
static EIMIL_symbolPCE_get_symbol_arg (PCE_context *pctx, int idx, enum EIMIL_CATEGORY cat)
static enum PCE_ERROR_CODE PCE_get_arg_or_error (PCE_context *pctx, int idx, int type, EIMIL_value **ppv)
static int PCE_get_arg_totnum (PCE_context *pctx)
static void PCE_set_current_event (PCE_context *pctx, EIMIL_value *pv_event)
 DEFINE_EXEC_METHOD (undo)
 DEFINE_EXEC_METHOD (mark_undo)
 DEFINE_EXEC_METHOD (try)
 DEFINE_EXEC_METHOD (catch)
 DEFINE_EXEC_METHOD (throw)
 DEFINE_EXEC_METHOD (keycase)
 DEFINE_EXEC_METHOD (keymap)
 DEFINE_EXEC_METHOD (toggle_preedit)
 DEFINE_EXEC_METHOD (toggle_lookup_choice)
 DEFINE_EXEC_METHOD (keyeventp)
 DEFINE_EXEC_METHOD (or)
 DEFINE_EXEC_METHOD (and)
 DEFINE_EXEC_METHOD (not)
 DEFINE_EXEC_METHOD (gt)
 DEFINE_EXEC_METHOD (lt)
 DEFINE_EXEC_METHOD (le)
 DEFINE_EXEC_METHOD (ge)
 DEFINE_EXEC_METHOD (eql)
 DEFINE_EXEC_METHOD (propval)
 DEFINE_EXEC_METHOD (propsize)
 DEFINE_EXEC_METHOD (propmbeg)
 DEFINE_EXEC_METHOD (propmend)
 DEFINE_EXEC_METHOD (evval)
 DEFINE_EXEC_METHOD (evmod)
 DEFINE_EXEC_METHOD (strlen)
 DEFINE_EXEC_METHOD (strcmp)
 DEFINE_EXEC_METHOD (add)
 DEFINE_EXEC_METHOD (sub)
 DEFINE_EXEC_METHOD (mul)
 DEFINE_EXEC_METHOD (div)
 DEFINE_EXEC_METHOD (mod)
 DEFINE_EXEC_METHOD (bor)
 DEFINE_EXEC_METHOD (band)
 DEFINE_EXEC_METHOD (bxor)
 DEFINE_EXEC_METHOD (UCSval)
 DEFINE_EXEC_METHOD (propadd)
 DEFINE_EXEC_METHOD (propcopy)
 DEFINE_EXEC_METHOD (evchar)
 DEFINE_EXEC_METHOD (strref)
 DEFINE_EXEC_METHOD (makechar)
 DEFINE_EXEC_METHOD (evtype)
 DEFINE_EXEC_METHOD (evmtext)
 DEFINE_EXEC_METHOD (concat)
 DEFINE_EXEC_METHOD (substr)
 DEFINE_EXEC_METHOD (next)
 DEFINE_EXEC_METHOD (makeev)
 DEFINE_EXEC_METHOD (commit)
 DEFINE_EXEC_METHOD (unroll)
 DEFINE_EXEC_METHOD (propdel)
 DEFINE_EXEC_METHOD (addmprop)
 DEFINE_EXEC_METHOD (delmprop)
 DEFINE_EXEC_METHOD (setmprop)
 DEFINE_EXEC_METHOD (tblref)
 DEFINE_EXEC_METHOD (makeprop)
 DEFINE_EXEC_METHOD (getmprop)
 DEFINE_EXEC_METHOD (findmprop)
 DEFINE_EXEC_METHOD (interact)
 DEFINE_EXEC_METHOD (match)
 DEFINE_EXEC_METHOD (forward)
 DEFINE_EXEC_METHOD (send)
 DEFINE_EXEC_METHOD (set)
 DEFINE_EXEC_METHOD (return)
static enum PCE_ERROR_CODE PCE_root_exception_handler (PCE_context *pctx, int ecode, void *throwarg, void *catcharg)
static enum EIMIL_ENGINE_STATUS PCE_execute (void *private)
static void PCE_init_document_template ()
int PCE_init ()

Variables

static const UTF8PCE_classname = "com.sun.iiim.pce1.s1"
static const UTF8PCE_xmlns_uri = "http://www.OpenI18N.org/EIMIL/NS/PCE/1.0"
static EIMIL_element_template PCE_statement_template []
static EIMIL_element_template PCE_if_else_template []
static EIMIL_element_template PCE_if_full_template []
static EIMIL_attr_template PCE_attr_keycase []
static EIMIL_attr_template PCE_attr_keymap []
static EIMIL_element_template PCE_select_template []
static EIMIL_element_template PCE_try_catch_template []
static EIMIL_element_template PCE_try_full_template []
static EIMIL_attr_template PCE_attr_go []
static EIMIL_attr_template PCE_attr_label []
static EIMIL_attr_template PCE_attr_catch []
static EIMIL_attr_template PCE_attr_throw []
static EIMIL_attr_template PCE_attr_interact []
static EIMIL_attr_template PCE_attr_next []
static EIMIL_attr_template PCE_attr_forward []
static EIMIL_attr_template PCE_attr_send []
static EIMIL_attr_template PCE_attr_e []
static EIMIL_attr_template PCE_attr_set []
static EIMIL_attr_template PCE_attr_match []
static EIMIL_attr_template PCE_attr_tblref []
static EIMIL_attr_template PCE_attr_tblkeymaxsize []
static EIMIL_attr_template PCE_attr_tblvalmaxsize []
static EIMIL_attr_template PCE_attr_makeprop []
static EIMIL_attr_template PCE_attr_propval []
static EIMIL_attr_template PCE_attr_getmprop []
static EIMIL_attr_template PCE_attr_findmprop []
static EIMIL_attr_template PCE_attr_defvar []
static EIMIL_attr_template PCE_attr_defun []
static EIMIL_attr_template PCE_attr_defpattern []
static EIMIL_attr_template PCE_attr_mnemonic []
static EIMIL_attr_template PCE_attr_pattern []
static EIMIL_element_template PCE_defpattern_template []
static EIMIL_attr_template PCE_attr_deftable []
static EIMIL_attr_template PCE_attr_key []
static EIMIL_element_template PCE_defkeymap_template []
static EIMIL_attr_template PCE_attr_defkeymap []
static EIMIL_element_template PCE_template []
EIMIL_element_template PCE_docroot []

Class Documentation

struct PCE_data

Definition at line 44 of file PCE.c.

Collaboration diagram for PCE_data:
Class Members
PCE_code * pcode
struct PCE_SEH_catchblock

Definition at line 56 of file PCE.c.

Collaboration diagram for PCE_SEH_catchblock:
Class Members
void * catcharg
PCE_SEH_CATCH_FUNCTION pcfs
PCE_SEH_catchblock * pnext
int type
struct PCE_SEH_block

Definition at line 63 of file PCE.c.

Collaboration diagram for PCE_SEH_block:
Class Members
void * arg
jmp_buf jmp
PCE_SEH_catchblock * pcatchers
PCE_SEH_block * pnext
struct PCE_context

Definition at line 70 of file PCE.c.

Collaboration diagram for PCE_context:
Class Members
int depth
PCE_code * pcur
EIMIL_dictionary * pdic
EIMIL_dictionary * pdic_f
EIMIL_data * ped
EIMIL_dictionary * pfuncdic
PCE_data * ppce_data
PCE_SEH_block * pseh
EIMIL_symbol * psym_cev
struct PCE_funcproto

Definition at line 82 of file PCE.c.

Collaboration diagram for PCE_funcproto:
Class Members
EIMIL_symbol * psym
struct PCE_function

Definition at line 87 of file PCE.c.

Collaboration diagram for PCE_function:
Class Members
int nargs
PCE_code * pc
EIMIL_dictionary * pdic
PCE_funcproto * pfp
int rettype
struct PCE_inst_template

Definition at line 114 of file PCE.c.

struct PCE_label

Definition at line 125 of file PCE.c.

Collaboration diagram for PCE_label:
Class Members
int id
int nextp
PCE_code * pc
EIMIL_symbol * psym
struct PCE_labelset

Definition at line 134 of file PCE.c.

Collaboration diagram for PCE_labelset:
Class Members
int allocednum
int labelnum
EIMIL_dictionary * pdic
PCE_label * pl
struct PCE_parse_context

Definition at line 141 of file PCE.c.

Collaboration diagram for PCE_parse_context:
Class Members
int idx
unsigned int mode
PCE_context * pctx
int required_type
struct PCE_code

Definition at line 159 of file PCE.c.

Collaboration diagram for PCE_code:
Class Members
PCE_code * parg
PCE_code * pnext
void * poption
enum PCE_CODE_TYPE union PCE_code val
struct PCE_call_catcharg

Definition at line 3756 of file PCE.c.

Collaboration diagram for PCE_call_catcharg:
Class Members
PCE_function * pf
EIMIL_value * pv
union PCE_code.val

Definition at line 161 of file PCE.c.

Class Members
PCE_EXEC_HANDLER h
PCE_code * pc_to
PCE_function * pf
EIMIL_value * pv
EIMIL_SYMID symid
int to_labelid

Define Documentation

#define DECLARE_EXEC_METHOD (   name)
Value:
static EIMIL_value* PCE_##name##_exec( \
    PCE_context *pctx \
)

Definition at line 370 of file PCE.c.

#define DECLARE_PARSER_METHOD (   name)
Value:
static int PCE_##name##_parser( \
    EIMIL_data *ped, \
    EIMIL_attrs *patr, \
    enum EIMIL_TAG_TYPE type, \
    UTF8 *pchars, \
    void **pprivate \
)

Definition at line 306 of file PCE.c.

Definition at line 374 of file PCE.c.

#define DEFINE_INST_TEMPLATE_0 (   name,
  type,
  mode 
)    DEFINE_INST_TEMPLATE_5(name, type, mode, 0, 0, 0, 0, 0)

Definition at line 352 of file PCE.c.

#define DEFINE_INST_TEMPLATE_1 (   name,
  type,
  mode,
  arg1 
)    DEFINE_INST_TEMPLATE_5(name, type, mode, arg1, 0, 0, 0, 0)

Definition at line 350 of file PCE.c.

#define DEFINE_INST_TEMPLATE_2 (   name,
  type,
  mode,
  arg1,
  arg2 
)    DEFINE_INST_TEMPLATE_5(name, type, mode, arg1, arg2, 0, 0, 0)

Definition at line 348 of file PCE.c.

#define DEFINE_INST_TEMPLATE_3 (   name,
  type,
  mode,
  arg1,
  arg2,
  arg3 
)    DEFINE_INST_TEMPLATE_5(name, type, mode, arg1, arg2, arg3, 0, 0)

Definition at line 346 of file PCE.c.

#define DEFINE_INST_TEMPLATE_4 (   name,
  type,
  mode,
  arg1,
  arg2,
  arg3,
  arg4 
)    DEFINE_INST_TEMPLATE_5(name, type, mode, arg1, arg2, arg3, arg4, 0)

Definition at line 344 of file PCE.c.

#define DEFINE_INST_TEMPLATE_5 (   name,
  type,
  mode,
  arg1,
  arg2,
  arg3,
  arg4,
  arg5 
)
Value:
static PCE_inst_template \
PCE_##name##_inst_template = {PCE_CODE_INST, PCE_##name##_exec, type, mode, \
                              {arg1, arg2, arg3, arg4, arg5}}

Definition at line 340 of file PCE.c.

Definition at line 314 of file PCE.c.

#define DEFINE_SINST_TEMPLATE_0 (   name,
  kind,
  type,
  mode 
)    DEFINE_SINST_TEMPLATE_1(name, kind, type, mode, 0)

Definition at line 337 of file PCE.c.

#define DEFINE_SINST_TEMPLATE_1 (   name,
  kind,
  type,
  mode,
  arg1 
)
Value:
static PCE_inst_template \
PCE_##name##_inst_template = {kind, NULL, type, mode, {arg1}}

Definition at line 333 of file PCE.c.

#define EIMIL_TEMPLATE_NUM (   e)    (sizeof(e) / sizeof(EIMIL_element_template))

Definition at line 590 of file PCE.c.

#define INST_ELEMENT_TEMPLATE (   name,
  strname 
)
Value:
{(strname), PCE_generic_inst_parser, NULL, \
 PCE_arg_option, PCE_statement_template, \
 &PCE_##name##_inst_template}

Definition at line 355 of file PCE.c.

#define INST_ELEMENT_TEMPLATE_NOARG (   name,
  strname 
)
Value:
{(strname), PCE_generic_inst_parser, NULL, \
 PCE_noarg_option, NULL, \
 &PCE_##name##_inst_template}

Definition at line 360 of file PCE.c.

#define INST_ELEMENT_TEMPLATE_OPTION (   name,
  strname,
  option 
)
Value:
{(strname), PCE_generic_inst_parser, NULL, \
 (option), PCE_statement_template, \
 &PCE_##name##_inst_template}

Definition at line 365 of file PCE.c.

#define PCE_ADD_CODE (   PCX,
  PCODE 
)    (((PCODE)->pnext = (PCX)->pc), ((PCX)->pc = (PCODE)), ((PCX)->idx++))

Definition at line 203 of file PCE.c.

#define PCE_ARG_MAX   5

Definition at line 113 of file PCE.c.

Definition at line 330 of file PCE.c.

Definition at line 2269 of file PCE.c.

#define PCE_CALL_MAX_DEPTH   16

Definition at line 30 of file PCE.c.

#define PCE_chdec (   c)    ((c) - '0')

Definition at line 1750 of file PCE.c.

#define PCE_chhex (   c)
Value:
(((c) >= '0' && (c) <= '9') ? ((c) - '0') : \
                      ((c) >= 'a' && (c) <= 'f') ? ((c) - 'a') : ((c) - 'A'))

Definition at line 1754 of file PCE.c.

#define PCE_DICTIONARY_DEFAULT_SIZE   17

Definition at line 28 of file PCE.c.

#define PCE_ischdec (   c)    (((c) >= '0' && (c) <= '9'))

Definition at line 1749 of file PCE.c.

#define PCE_ischhex (   c)
Value:
(((c) >= '0' && (c) <= '9') \
                        || ((c) >= 'a' && (c) <= 'f') \
                        || ((c) >= 'A' && (c) <= 'F'))

Definition at line 1751 of file PCE.c.

Definition at line 1560 of file PCE.c.

#define PCE_MAX_NUMBER   ((1 << 23) - 1)

Definition at line 27 of file PCE.c.

#define PCE_NEW_PARSER_CONTEXT_MODE (   pcx,
 
)    (((pcx)->mode & PCE_CONTEXT_MODE_PERSISTENT_MASK) | (m))

Definition at line 194 of file PCE.c.

Definition at line 329 of file PCE.c.

#define PCE_RESET_PARSER_CONTEXT_MODE (   pcx,
 
)    ((pcx)->mode & (~(m)))

Definition at line 200 of file PCE.c.

#define PCE_SET_PARSER_CONTEXT_MODE (   pcx,
 
)    ((pcx)->mode | (m))

Definition at line 197 of file PCE.c.

#define PCE_SET_REQUIRED_TYPES (   PCX,
  PIT 
)    (memcpy((PCX)->required_type, (PIT)->required_type, sizeof((PCX)->required_type)))

Definition at line 122 of file PCE.c.

#define TYPE_NAME_LEN_MAX   64

Definition at line 1353 of file PCE.c.


Typedef Documentation

typedef struct PCE_code

Definition at line 32 of file PCE.c.

typedef struct PCE_context

Definition at line 34 of file PCE.c.

typedef struct PCE_data

Definition at line 33 of file PCE.c.

Definition at line 42 of file PCE.c.

typedef struct PCE_funcproto

Definition at line 35 of file PCE.c.

typedef struct PCE_function

Definition at line 36 of file PCE.c.

typedef struct PCE_inst_template

Definition at line 37 of file PCE.c.

typedef struct PCE_label

Definition at line 39 of file PCE.c.

typedef struct PCE_labelset

Definition at line 40 of file PCE.c.

typedef struct PCE_parse_context

Definition at line 38 of file PCE.c.

typedef struct PCE_SEH_block

Definition at line 55 of file PCE.c.

typedef enum PCE_ERROR_CODE(* PCE_SEH_CATCH_FUNCTION)(PCE_context *pctx, int ecode, void *throwarg, void *catcharg)

Definition at line 50 of file PCE.c.

typedef struct PCE_SEH_catchblock

Definition at line 54 of file PCE.c.

typedef enum PCE_ERROR_CODE(* PCE_SEH_TRY_FUNCTION)(PCE_context *pctx, void *arg)

Definition at line 48 of file PCE.c.


Enumeration Type Documentation

Enumerator:
PCE_CODE_INST 
PCE_CODE_VALUE 
PCE_CODE_MAIN 
PCE_CODE_DEFUN 
PCE_CODE_JMP 
PCE_CODE_UNRESOLVED_JMP 
PCE_CODE_COND_JMP 
PCE_CODE_UNRESOLVED_COND_JMP 
PCE_CODE_COND_NOT_JMP 
PCE_CODE_UNRESOLVED_COND_NOT_JMP 
PCE_CODE_SYMBOL 
PCE_CODE_FUNCTION 

Definition at line 95 of file PCE.c.

Enumerator:
PCE_IN_MAIN 
PCE_IN_TRY 
PCE_IN_CATCH 
PCE_IN_DEFVAR 
PCE_DEFVAR_NIL 
PCE_DEFVAR_DONE 
PCE_IN_DEFUN 
PCE_IN_DEFTABLE 
PCE_IN_DEFPATTERN 
PCE_CONTEXT_MODE_PERSISTENT_MASK 
PCE_IN_IF 
PCE_IN_ELSE 
PCE_IN_E 
PCE_IN_SELECT 
PCE_SELECT_HAS_DEFAULT 
PCE_ONLY_IN_MAIN_STATEMENT 

Definition at line 174 of file PCE.c.

                      {
       PCE_IN_MAIN = (1 << 0),
       PCE_IN_TRY = (1 << 1),
       PCE_IN_CATCH = (1 << 2),
       PCE_IN_DEFVAR = (1 << 3),
       PCE_DEFVAR_NIL = (1 << 4),
       PCE_DEFVAR_DONE = (1 << 5),
       PCE_IN_DEFUN = (1 << 6),
       PCE_IN_DEFTABLE = (1 << 7),
       PCE_IN_DEFPATTERN = (1 << 8),

       PCE_CONTEXT_MODE_PERSISTENT_MASK = (1 << 16) - 1,

       PCE_IN_IF = (1 << 16),
       PCE_IN_ELSE = (1 << 17),
       PCE_IN_E = (1 << 18),
       PCE_IN_SELECT = (1 << 19),
       PCE_SELECT_HAS_DEFAULT = (1 << 20),
       PCE_ONLY_IN_MAIN_STATEMENT = (1 << 21)
};
Enumerator:
PCE_ANY_ERROR 
PCE_SUCCESS 
PCE_UNKNOWN_ERROR 
PCE_MEMORY_ERROR 
PCE_LITERAL_OVERFLOW 
PCE_DEC_NUMBER_ERROR 
PCE_HEX_NUMBER_ERROR 
PCE_CHAR_LITERAL_ERROR 
PCE_MTEXT_LITERAL_ERROR 
PCE_NOT_VARIABLE_ERROR 
PCE_NOT_FUNCTION_ERROR 
PCE_NOT_EXCEPTION_ERROR 
PCE_LABEL_NOT_DEFINED_ERROR 
PCE_PARSE_NOT_LITERAL 
PCE_PARSE_SYNTAX_ERROR 
PCE_PARSE_UNKNOWN_SYMBOL_ERROR 
PCE_PARSE_INVALID_SYMBOL_ERROR 
PCE_PARSE_RETURN_IN_DEFUN_ERROR 
PCE_TOO_FEW_ARGUMENTS_ERROR 
PCE_WRONG_TYPE_ARGUMENT_ERROR 
PCE_VARIABLE_CONSTANT_ERROR 
PCE_OUT_OF_RANGE_ERROR 
PCE_OVER_EVAL_DEPTH_ERROR 
PCE_DEFVAR_DONE_ERROR 
PCE_DEFVAR_NIL_ERROR 
PCE_RETURN_JMP_ERROR 
PCE_WAIT_NEXT_EVENT_ERROR 
PCE_NO_MORE_ARG_ERROR 

Definition at line 211 of file PCE.c.

enum PCE_inst
Enumerator:
PCE_INVALID_INST 
PCE_NOP 
PCE_WHILE 
PCE_GO 
PCE_LABEL 
PCE_UNDO 
PCE_MARK_UNDO 
PCE_TRY 
PCE_THROW 
PCE_IF 
PCE_SELECT 
PCE_TOGGLE_PREEDIT 
PCE_TOGGLE_LOOKUP_CHOICE 
PCE_KEYEVENTP 
PCE_OR 
PCE_AND 
PCE_NOT 
PCE_GT 
PCE_LT 
PCE_LE 
PCE_GE 
PCE_EQL 
PCE_TBLKEYMAXSIZE 
PCE_TBLVALMAXSIZE 
PCE_PROPSIZE 
PCE_PROPMBEG 
PCE_PROPMEND 
PCE_EVVAL 
PCE_EVMOD 
PCE_STRLEN 
PCE_STRCMP 
PCE_ADD 
PCE_SUB 
PCE_MUL 
PCE_DIV 
PCE_MOD 
PCE_BOR 
PCE_BAND 
PCE_BXOR 
PCE_UCSVAL 
PCE_MAKEPROP 
PCE_PROPADD 
PCE_PROPCOPY 
PCE_GETMPROP 
PCE_FINDMPROP 
PCE_EVCHAR 
PCE_STRREF 
PCE_MAKECHAR 
PCE_INTERACT 
PCE_MATCH 
PCE_EVTYPE 
PCE_EVMTEXT 
PCE_CONCAT 
PCE_SUBSTR 
PCE_NEXT 
PCE_FORWARD 
PCE_SEND 
PCE_MAKEEV 
PCE_COMMIT 
PCE_UNROLL 
PCE_PROPDEL 
PCE_ADDMPROP 
PCE_DELMPROP 
PCE_SETMPROP 
PCE_SET 
PCE_E 
PCE_TBLREF 

Definition at line 937 of file PCE.c.

Enumerator:
PCE_UNCOND_JMP_END 
PCE_COND_JMP_END 
PCE_COND_NOT_JMP_END 

Definition at line 2025 of file PCE.c.

Enumerator:
PCE_VAL_TYPE_INVALID 
PCE_VAL_TYPE_NIL 
PCE_VAL_TYPE_CONST 
PCE_VAL_TYPE_INIT 

Definition at line 2231 of file PCE.c.


Function Documentation

DECLARE_EXEC_METHOD ( undo  )
DECLARE_EXEC_METHOD ( mark_undo  )
DECLARE_EXEC_METHOD ( catch  )
DECLARE_EXEC_METHOD ( throw  )
DECLARE_EXEC_METHOD ( keycase  )
DECLARE_EXEC_METHOD ( keymap  )
DECLARE_EXEC_METHOD ( toggle_preedit  )
DECLARE_EXEC_METHOD ( toggle_lookup_choice  )
DECLARE_EXEC_METHOD ( keyeventp  )
DECLARE_EXEC_METHOD ( propval  )
DECLARE_EXEC_METHOD ( propsize  )
DECLARE_EXEC_METHOD ( propmbeg  )
DECLARE_EXEC_METHOD ( propmend  )
DECLARE_EXEC_METHOD ( strlen  )
DECLARE_EXEC_METHOD ( strcmp  )
DECLARE_EXEC_METHOD ( band  )
DECLARE_EXEC_METHOD ( bxor  )
DECLARE_EXEC_METHOD ( UCSval  )
DECLARE_EXEC_METHOD ( propadd  )
DECLARE_EXEC_METHOD ( propcopy  )
DECLARE_EXEC_METHOD ( strref  )
DECLARE_EXEC_METHOD ( makechar  )
DECLARE_EXEC_METHOD ( concat  )
DECLARE_EXEC_METHOD ( substr  )
DECLARE_EXEC_METHOD ( next  )
DECLARE_EXEC_METHOD ( makeev  )
DECLARE_EXEC_METHOD ( unroll  )
DECLARE_EXEC_METHOD ( propdel  )
DECLARE_EXEC_METHOD ( addmprop  )
DECLARE_EXEC_METHOD ( delmprop  )
DECLARE_EXEC_METHOD ( setmprop  )
DECLARE_EXEC_METHOD ( return  )
DECLARE_EXEC_METHOD ( tblkeymaxsize  )
DECLARE_EXEC_METHOD ( tblvalmaxsize  )
DECLARE_EXEC_METHOD ( tblref  )
DECLARE_EXEC_METHOD ( makeprop  )
DECLARE_EXEC_METHOD ( getmprop  )
DECLARE_EXEC_METHOD ( findmprop  )
DECLARE_EXEC_METHOD ( interact  )
DECLARE_EXEC_METHOD ( forward  )
DECLARE_PARSER_METHOD ( mnemonic  )
DECLARE_PARSER_METHOD ( pattern  )
DECLARE_PARSER_METHOD ( defvar  )
DECLARE_PARSER_METHOD ( defun  )
DECLARE_PARSER_METHOD ( deftable  )
DECLARE_PARSER_METHOD ( defkeymap  )
DECLARE_PARSER_METHOD ( defpattern  )
DECLARE_PARSER_METHOD ( while  )
DECLARE_PARSER_METHOD ( mark_undo  )
DECLARE_PARSER_METHOD ( catch  )
DECLARE_PARSER_METHOD ( throw  )
DECLARE_PARSER_METHOD ( keycase  )
DECLARE_PARSER_METHOD ( keymap  )
DECLARE_PARSER_METHOD ( default  )
DECLARE_PARSER_METHOD ( select  )
DECLARE_PARSER_METHOD ( return  )
DECLARE_PARSER_METHOD ( tblkeymaxsize  )
DECLARE_PARSER_METHOD ( tblvalmaxsize  )
DECLARE_PARSER_METHOD ( tblref  )
DECLARE_PARSER_METHOD ( makeprop  )
DECLARE_PARSER_METHOD ( getmprop  )
DECLARE_PARSER_METHOD ( findmprop  )
DECLARE_PARSER_METHOD ( interact  )
DECLARE_PARSER_METHOD ( forward  )
DEFINE_EXEC_METHOD ( undo  )

Definition at line 3933 of file PCE.c.

{
    /* TODO */
    return NULL;
}
DEFINE_EXEC_METHOD ( mark_undo  )

Definition at line 3939 of file PCE.c.

{
    /* TODO */
    return NULL;
}
DEFINE_EXEC_METHOD ( try  )

Definition at line 3945 of file PCE.c.

{
    /* TODO */
    return NULL;
}
DEFINE_EXEC_METHOD ( catch  )

Definition at line 3951 of file PCE.c.

{
    /* TODO */
    return NULL;
}
DEFINE_EXEC_METHOD ( throw  )

Definition at line 3957 of file PCE.c.

{
    /* TODO */
    return NULL;
}
DEFINE_EXEC_METHOD ( keycase  )

Definition at line 3963 of file PCE.c.

{
    /* TODO */
    return NULL;
}
DEFINE_EXEC_METHOD ( keymap  )

Definition at line 3969 of file PCE.c.

{
    /* TODO */
    return NULL;
}
DEFINE_EXEC_METHOD ( toggle_preedit  )

Definition at line 3975 of file PCE.c.

{
    /* TODO */
    return NULL;
}
DEFINE_EXEC_METHOD ( toggle_lookup_choice  )

Definition at line 3981 of file PCE.c.

{
    /* TODO */
    return NULL;
}
DEFINE_EXEC_METHOD ( keyeventp  )

Definition at line 3987 of file PCE.c.

{
    EIMIL_value *pv;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_EVENT, &pv);
    if (strcmp(pv->v.event.type, "key") == 0)
       return EIMIL_construct_bool(1);

    return NULL;
}

Here is the call graph for this function:

Definition at line 3998 of file PCE.c.

{
    int i;
    EIMIL_value *pv;

    for (i = 0; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_ANY, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       if (pv) return EIMIL_construct_bool(1);
    }
    return NULL;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( and  )

Definition at line 4012 of file PCE.c.

{
    int i;
    EIMIL_value *pv;

    for (i = 0; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_ANY, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       if (!pv) return NULL;
    }
    return EIMIL_construct_bool(1);
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( not  )

Definition at line 4026 of file PCE.c.

{
    EIMIL_value *pv;
    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_ANY, &pv);

    if (pv) {
       EIMIL_REFCHECK(*pv);
       return NULL;
    }

    return EIMIL_construct_bool(1);
}

Here is the call graph for this function:

Definition at line 4039 of file PCE.c.

{
    EIMIL_value *pv1, *pv2, *pvr;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_NUMBER, &pv1);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER, &pv2);

    if (pv1->v.number > pv2->v.number)
       pvr = EIMIL_construct_bool(1);
    else
       pvr = NULL;
    EIMIL_REFCHECK(*pv1);
    EIMIL_REFCHECK(*pv2);

    return pvr;
}

Here is the call graph for this function:

Definition at line 4056 of file PCE.c.

{
    EIMIL_value *pv1, *pv2, *pvr;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_NUMBER, &pv1);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER, &pv2);

    if (pv1->v.number < pv2->v.number)
       pvr = EIMIL_construct_bool(1);
    else
       pvr = NULL;
    EIMIL_REFCHECK(*pv1);
    EIMIL_REFCHECK(*pv2);

    return pvr;
}

Here is the call graph for this function:

Definition at line 4073 of file PCE.c.

{
    EIMIL_value *pv1, *pv2, *pvr;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_NUMBER, &pv1);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER, &pv2);

    if (pv1->v.number <= pv2->v.number)
       pvr = EIMIL_construct_bool(1);
    else
       pvr = NULL;
    EIMIL_REFCHECK(*pv1);
    EIMIL_REFCHECK(*pv2);

    return pvr;
}

Here is the call graph for this function:

Definition at line 4090 of file PCE.c.

{
    EIMIL_value *pv1, *pv2, *pvr;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_NUMBER, &pv1);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER, &pv2);

    if (pv1->v.number >= pv2->v.number)
       pvr = EIMIL_construct_bool(1);
    else
       pvr = NULL;
    EIMIL_REFCHECK(*pv1);
    EIMIL_REFCHECK(*pv2);

    return pvr;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( eql  )

Definition at line 4107 of file PCE.c.

{
    EIMIL_value *pv1, *pv2, *pvr;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_NUMBER, &pv1);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER, &pv2);

    if (pv1->v.number == pv2->v.number)
       pvr = EIMIL_construct_bool(1);
    else
       pvr = NULL;
    EIMIL_REFCHECK(*pv1);
    EIMIL_REFCHECK(*pv2);

    return pvr;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( propval  )

Definition at line 4124 of file PCE.c.

{
    int idx;
    EIMIL_value *pv_prop, *pv_idx, *pvr;
    EIMIL_prop *pprop;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_PROP, &pv_prop);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER, &pv_idx);

    pprop = &pv_prop->v.prop;
    idx = pv_idx->v.number;
    EIMIL_REFCHECK(*pv_idx);
    if ((idx < 0) || (pprop->size <= idx)) {
       EIMIL_REFCHECK(*pv_prop);
       return NULL;
    }
    pvr = pprop->pvals[idx];

    EIMIL_REFCHECK_GUARD(*pv_prop, *pvr);

    return pvr;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( propsize  )

Definition at line 4147 of file PCE.c.

{
    EIMIL_value *pv_prop;
    EIMIL_prop *pprop;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_PROP, &pv_prop);

    pprop = &pv_prop->v.prop;

    return EIMIL_construct_number(pprop->size);
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( propmbeg  )

Definition at line 4159 of file PCE.c.

{
    EIMIL_value *pv_prop;
    EIMIL_prop *pprop;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_PROP, &pv_prop);

    pprop = &pv_prop->v.prop;

    return EIMIL_construct_number(pprop->st);
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( propmend  )

Definition at line 4171 of file PCE.c.

{
    EIMIL_value *pv_prop;
    EIMIL_prop *pprop;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_PROP, &pv_prop);

    pprop = &pv_prop->v.prop;

    return EIMIL_construct_number(pprop->end);
}

Here is the call graph for this function:

Definition at line 4183 of file PCE.c.

{
    EIMIL_value *pv, *pvr;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_EVENT, &pv);

    pvr = pv->v.event.pv_val;
    EIMIL_REFCHECK_GUARD(*pv, *pvr);

    return pvr;
}

Here is the call graph for this function:

Definition at line 4195 of file PCE.c.

{
    EIMIL_value *pv, *pvr;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_EVENT, &pv);

    pvr = pv->v.event.pv_mod;
    EIMIL_REFCHECK_GUARD(*pv, *pvr);

    return pvr;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( strlen  )

Definition at line 4207 of file PCE.c.

{
    int len;
    EIMIL_value *pv_mtext;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_MTEXT, &pv_mtext);

    len = pv_mtext->v.mtext.len;
    EIMIL_REFCHECK(*pv_mtext);

    return EIMIL_construct_number(len);
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( strcmp  )

Definition at line 4220 of file PCE.c.

{
    int r;
    EIMIL_value *pv_mtext1, *pv_mtext2;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_MTEXT, &pv_mtext1);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_MTEXT, &pv_mtext2);

    r = EIMIL_UTF32_strcmp(pv_mtext1->v.mtext.ustr, pv_mtext2->v.mtext.ustr);

    EIMIL_REFCHECK(*pv_mtext1);
    EIMIL_REFCHECK(*pv_mtext2);

    return EIMIL_construct_number(r);
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( add  )

Definition at line 4236 of file PCE.c.

{
    int i, n;
    EIMIL_value *pv;

    n = 0;
    for (i = 0; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_NUMBER, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       n += pv->v.number;
       EIMIL_REFCHECK(*pv);
    }
    pv = EIMIL_construct_number(n);
    if (!pv) PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);

    return pv;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( sub  )

Definition at line 4255 of file PCE.c.

{
    int i, n;
    EIMIL_value *pv;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_NUMBER, &pv);
    n = pv->v.number;
    EIMIL_REFCHECK(*pv);
    for (i = 1; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_NUMBER, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       n -= pv->v.number;
       EIMIL_REFCHECK(*pv);
    }
    pv = EIMIL_construct_number(n);
    if (!pv) PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);

    return pv;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( mul  )

Definition at line 4276 of file PCE.c.

{
    int i, n;
    EIMIL_value *pv;

    n = 1;
    for (i = 0; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_NUMBER, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       n *= pv->v.number;
       EIMIL_REFCHECK(*pv);
    }
    pv = EIMIL_construct_number(n);
    if (!pv) PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);

    return pv;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( div  )

Definition at line 4295 of file PCE.c.

{
    int i, n;
    EIMIL_value *pv;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_NUMBER, &pv);
    n = pv->v.number;
    EIMIL_REFCHECK(*pv);
    for (i = 1; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_NUMBER, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       n /= pv->v.number;
       EIMIL_REFCHECK(*pv);
    }
    pv = EIMIL_construct_number(n);
    if (!pv) PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);

    return pv;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( mod  )

Definition at line 4316 of file PCE.c.

{
    int i, n;
    EIMIL_value *pv;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_NUMBER, &pv);
    n = pv->v.number;
    EIMIL_REFCHECK(*pv);
    for (i = 1; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_NUMBER, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       n %= pv->v.number;
       EIMIL_REFCHECK(*pv);
    }
    pv = EIMIL_construct_number(n);
    if (!pv) PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);

    return pv;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( bor  )

Definition at line 4337 of file PCE.c.

{
    int i, n;
    EIMIL_value *pv;

    if (PCE_get_arg(pctx, 0, EIMIL_TYPE_NUMBER, &pv)
       == PCE_NO_MORE_ARG_ERROR) {
       PCE_SEH_throw(pctx, PCE_TOO_FEW_ARGUMENTS_ERROR, NULL);
    }
    n = pv->v.number;
    EIMIL_REFCHECK(*pv);
    for (i = 1; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_NUMBER, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       n |= pv->v.number;
       EIMIL_REFCHECK(*pv);
    }
    pv = EIMIL_construct_number(n);
    if (!pv) PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);

    return pv;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( band  )

Definition at line 4361 of file PCE.c.

{
    int i, n;
    EIMIL_value *pv;

    if (PCE_get_arg(pctx, 0, EIMIL_TYPE_NUMBER, &pv)
       == PCE_NO_MORE_ARG_ERROR) {
       PCE_SEH_throw(pctx, PCE_TOO_FEW_ARGUMENTS_ERROR, NULL);
    }
    n = pv->v.number;
    EIMIL_REFCHECK(*pv);
    for (i = 1; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_NUMBER, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       n &= pv->v.number;
       EIMIL_REFCHECK(*pv);
    }
    pv = EIMIL_construct_number(n);
    if (!pv) PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);

    return pv;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( bxor  )

Definition at line 4385 of file PCE.c.

{
    int i, n;
    EIMIL_value *pv;

    if (PCE_get_arg(pctx, 0, EIMIL_TYPE_NUMBER, &pv)
       == PCE_NO_MORE_ARG_ERROR) {
       PCE_SEH_throw(pctx, PCE_TOO_FEW_ARGUMENTS_ERROR, NULL);
    }
    n = pv->v.number;
    EIMIL_REFCHECK(*pv);
    for (i = 1; ; i++) {
       if (PCE_get_arg(pctx, i, EIMIL_TYPE_NUMBER, &pv)
           == PCE_NO_MORE_ARG_ERROR)
           break;
       n ^= pv->v.number;
       EIMIL_REFCHECK(*pv);
    }
    pv = EIMIL_construct_number(n);
    if (!pv) PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);

    return pv;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( UCSval  )

Definition at line 4409 of file PCE.c.

{
    UTF32 ch;
    EIMIL_value *pv;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_CHAR, &pv);
    ch = pv->v.ch;
    EIMIL_REFCHECK(*pv);

    return EIMIL_construct_number((int)ch);
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( propadd  )

Definition at line 4421 of file PCE.c.

{
    EIMIL_value *pv_prop, *pv_val;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_PROP, &pv_prop);
    PCE_get_arg_or_error(pctx, 1, pv_prop->v.prop.type, &pv_val);

    if (!EIMIL_add_prop(&pv_prop->v.prop, pv_val)) {
       PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);
    }
    EIMIL_ADDREF(*pv_val);

    return pv_prop;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( propcopy  )

Definition at line 4436 of file PCE.c.

{
    EIMIL_value *pv_prop, *pv_prop2;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_PROP, &pv_prop);
    pv_prop2 = EIMIL_copy_value(pv_prop);

    if (!pv_prop2) {
       PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);
    }

    return pv_prop2;
}

Here is the call graph for this function:

Definition at line 4450 of file PCE.c.

{
    EIMIL_value *pv;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_EVENT, &pv);

    return pv->v.event.pv_char;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( strref  )

Definition at line 4459 of file PCE.c.

{
    int idx, len;
    UTF32* pstr, ch;
    EIMIL_value *pv_mtext, *pv_idx;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_MTEXT, &pv_mtext);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER, &pv_idx);

    pstr = pv_mtext->v.mtext.ustr;
    len = pv_mtext->v.mtext.len;
    idx = pv_idx->v.number;
    if ((idx < 0) || (idx >= len)) {
       PCE_SEH_throw(pctx, PCE_OUT_OF_RANGE_ERROR, NULL);
    }

    ch = pstr[idx];

    EIMIL_REFCHECK(*pv_mtext);
    EIMIL_REFCHECK(*pv_idx);

    return EIMIL_construct_char(ch);
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( makechar  )

Definition at line 4483 of file PCE.c.

{
    int n;
    EIMIL_value *pv;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_NUMBER, &pv);
    n = pv->v.number;
    EIMIL_REFCHECK(*pv);

    return EIMIL_construct_char((UTF32)n);
}

Here is the call graph for this function:

Definition at line 4495 of file PCE.c.

{
    EIMIL_value *pv;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_EVENT, &pv);

    return EIMIL_construct_mtext_from_UTF8(pv->v.event.type);
}

Here is the call graph for this function:

Definition at line 4504 of file PCE.c.

{
    EIMIL_value *pv, *pvr;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_EVENT, &pv);

    pvr = pv->v.event.pv_mtext;
    EIMIL_REFCHECK_GUARD(*pv, *pvr);

    return pvr;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( concat  )

Definition at line 4516 of file PCE.c.

{
    int i, n;
    EIMIL_value *pvr;
    EIMIL_value **ppv;

    n = PCE_get_arg_totnum(pctx);
    if (n == 0) return EIMIL_construct_mtext_from_UTF8("");

#if 1
    ppv = (EIMIL_value**) alloca(sizeof(EIMIL_value*) * n);
#else
    ppv = (EIMIL_value**) malloc(sizeof(EIMIL_value*) * n);
#endif

    for (i = 0; i < n; i++) {
       PCE_get_arg_or_error(pctx, i,
                          EIMIL_TYPE_CHAR | EIMIL_TYPE_MTEXT,
                          ppv + i);
    }

    pvr = EIMIL_mtext_concat(n, ppv);

    for (i = 0; i < n; i++) {
       EIMIL_REFCHECK(*(ppv[i]));
    }

#if 1
#else
    free(ppv);
#endif

    return pvr;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( substr  )

Definition at line 4551 of file PCE.c.

{
    int beg, end, len;
    EIMIL_value *pv_mtext, *pv_beg, *pv_end, *pvr;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_MTEXT, &pv_mtext);
    len = pv_mtext->v.mtext.len;
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER, &pv_beg);
    beg = pv_beg->v.number;
    EIMIL_REFCHECK(*pv_beg);

    if (PCE_get_arg(pctx, 2, EIMIL_TYPE_NUMBER, &pv_end)
       == PCE_NO_MORE_ARG_ERROR) {
       end = len;
    } else {
       end = pv_end->v.number;
       EIMIL_REFCHECK(*pv_end);
    }

    if ((beg < 0) || (beg >= end) || (end > len)) {
       PCE_SEH_throw(pctx, PCE_OUT_OF_RANGE_ERROR, NULL);
    }

    pvr = EIMIL_mtext_substr(pv_mtext, beg, end);

    EIMIL_REFCHECK(*pv_mtext);

    return pvr;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( next  )

Definition at line 4581 of file PCE.c.

{
    EIMIL_value *pv_event;

    if (PCE_get_arg(pctx, 0, EIMIL_TYPE_ANY, &pv_event)
       == PCE_SUCCESS) {
       EIMIL_reply_event(pctx->ped, pv_event);
    }
    EIMIL_REFCHECK(*pv_event);

    pv_event = EIMIL_next_event(pctx->ped);

    if (pv_event) {
       PCE_set_current_event(pctx, pv_event);
    } else {
       PCE_SEH_throw(pctx, PCE_WAIT_NEXT_EVENT_ERROR, NULL);
    }

    return NULL;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( makeev  )

Definition at line 4602 of file PCE.c.

{
    UTF8* type;
    EIMIL_value *pv_type, *pv_val, *pv_mod, *pv_char, *pv_mtext;
    EIMIL_value *ret;

    pv_val = pv_char = pv_mtext = NULL;
    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_MTEXT, &pv_type);
    
    type = EIMIL_convert_UTF32_to_UTF8(pv_type->v.mtext.ustr);
    if (!type) {
       PCE_SEH_throw(pctx, PCE_MEMORY_ERROR, NULL);
    }
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER | EIMIL_TYPE_NIL, &pv_val);
    PCE_get_arg_or_error(pctx, 2, EIMIL_TYPE_NUMBER | EIMIL_TYPE_NIL, &pv_mod);
    PCE_get_arg_or_error(pctx, 3, EIMIL_TYPE_CHAR | EIMIL_TYPE_NIL, &pv_char);
    PCE_get_arg_or_error(pctx, 4, EIMIL_TYPE_MTEXT | EIMIL_TYPE_NIL, &pv_mtext);

    ret = EIMIL_construct_event(type, pv_val, pv_mod, pv_char, pv_mtext);

    if (type) free(type);
    
    return ret;
}

Here is the call graph for this function:

Definition at line 4627 of file PCE.c.

{
    return NULL;
}
DEFINE_EXEC_METHOD ( unroll  )

Definition at line 4632 of file PCE.c.

{
    return NULL;
}
DEFINE_EXEC_METHOD ( propdel  )

Definition at line 4637 of file PCE.c.

{
    int idx;
    EIMIL_value *pv_prop, *pv_idx;
    EIMIL_prop *pprop;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_PROP, &pv_prop);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_NUMBER, &pv_idx);

    pprop = &pv_prop->v.prop;
    idx = pv_idx->v.number;
    EIMIL_delete_prop(pprop, idx);
    EIMIL_REFCHECK(*pv_prop);
    EIMIL_REFCHECK(*pv_idx);

    return NULL;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( addmprop  )

Definition at line 4655 of file PCE.c.

{
    int beg, end, len;
    EIMIL_value *pv_target, *pv_prop, *pv_beg, *pv_end;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_MTEXT, &pv_target);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_PROP, &pv_prop);
    PCE_get_arg_or_error(pctx, 2, EIMIL_TYPE_NUMBER, &pv_beg);
    PCE_get_arg_or_error(pctx, 3, EIMIL_TYPE_NUMBER, &pv_end);

    len = pv_target->v.mtext.len;
    beg = pv_beg->v.number;
    end = pv_end->v.number;

    if ((beg < 0) || (beg >= end) || (end > len)) {
       PCE_SEH_throw(pctx, PCE_OUT_OF_RANGE_ERROR, NULL);
    }

    EIMIL_add_prop_on_mtext(&pv_target->v.mtext, pv_prop, beg, end);

    EIMIL_REFCHECK(*pv_target);
    EIMIL_REFCHECK(*pv_prop);
    EIMIL_REFCHECK(*pv_beg);
    EIMIL_REFCHECK(*pv_end);

    return NULL;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( delmprop  )

Definition at line 4683 of file PCE.c.

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( setmprop  )

Definition at line 4696 of file PCE.c.

{
    int beg, end, len;
    EIMIL_value *pv_target, *pv_prop, *pv_beg, *pv_end;

    PCE_get_arg_or_error(pctx, 0, EIMIL_TYPE_MTEXT, &pv_target);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_PROP, &pv_prop);
    PCE_get_arg_or_error(pctx, 2, EIMIL_TYPE_NUMBER, &pv_beg);
    PCE_get_arg_or_error(pctx, 3, EIMIL_TYPE_NUMBER, &pv_end);

    len = pv_target->v.mtext.len;
    beg = pv_beg->v.number;
    end = pv_end->v.number;

    if ((beg < 0) || (beg >= end) || (end > len)) {
       PCE_SEH_throw(pctx, PCE_OUT_OF_RANGE_ERROR, NULL);
    }

    EIMIL_set_prop_on_mtext(&pv_target->v.mtext, pv_prop, beg, end);

    EIMIL_REFCHECK(*pv_target);
    EIMIL_REFCHECK(*pv_prop);
    EIMIL_REFCHECK(*pv_beg);
    EIMIL_REFCHECK(*pv_end);

    return NULL;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( tblref  )

Definition at line 4724 of file PCE.c.

{
    return NULL;
}
DEFINE_EXEC_METHOD ( makeprop  )

Definition at line 4729 of file PCE.c.

{
    EIMIL_symbol *psym;

    psym = PCE_get_symbol_arg(pctx, 0, EIMIL_CAT_PROPERTY);

    return EIMIL_construct_prop(psym);
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( getmprop  )

Definition at line 4738 of file PCE.c.

{
    EIMIL_symbol *psym;
    EIMIL_value *pv_mtext, *pv_beg, *pvr;

    psym = PCE_get_symbol_arg(pctx, 0, EIMIL_CAT_PROPERTY);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_MTEXT, &pv_mtext);
    PCE_get_arg_or_error(pctx, 2, EIMIL_TYPE_NUMBER, &pv_beg);

    pvr = EIMIL_get_prop_from_mtext(&pv_mtext->v.mtext,
                                psym, pv_beg->v.number);

    EIMIL_REFCHECK(*pv_mtext);
    EIMIL_REFCHECK(*pv_beg);

    return pvr;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( findmprop  )

Definition at line 4756 of file PCE.c.

{
    EIMIL_symbol *psym;
    EIMIL_value *pv_mtext, *pv_beg, *pvr;

    psym = PCE_get_symbol_arg(pctx, 0, EIMIL_CAT_PROPERTY);
    PCE_get_arg_or_error(pctx, 1, EIMIL_TYPE_MTEXT, &pv_mtext);
    PCE_get_arg_or_error(pctx, 2, EIMIL_TYPE_NUMBER, &pv_beg);

    pvr = EIMIL_find_prop_from_mtext(&pv_mtext->v.mtext,
                                 psym, pv_beg->v.number);

    EIMIL_REFCHECK(*pv_mtext);
    EIMIL_REFCHECK(*pv_beg);

    return pvr;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( interact  )

Definition at line 4774 of file PCE.c.

{
    return NULL;
}

Definition at line 4779 of file PCE.c.

{
    return NULL;
}
DEFINE_EXEC_METHOD ( forward  )

Definition at line 4784 of file PCE.c.

{
    return NULL;
}

Definition at line 4789 of file PCE.c.

{
    return NULL;
}
DEFINE_EXEC_METHOD ( set  )

Definition at line 4794 of file PCE.c.

{
    EIMIL_value *pv, *pvo;
    EIMIL_symbol *psym;

    ASSERT(pctx->pcur->parg && pctx->pcur->parg->pnext);
    psym = PCE_lookup_symbol(pctx, pctx->pcur->parg->pnext);
    ASSERT(psym && psym->cat == EIMIL_CAT_VARIABLE);

    if (!PCE_get_arg(pctx, 0, EIMIL_TYPE_ANY, &pv)
       == PCE_NO_MORE_ARG_ERROR) {
       PCE_SEH_throw(pctx, PCE_TOO_FEW_ARGUMENTS_ERROR, NULL);
    }
    if (psym->obj.v.constp) {
       PCE_SEH_throw(pctx, PCE_VARIABLE_CONSTANT_ERROR, NULL);
    }
    if (pv && (pv->type != psym->obj.v.type)) {
       PCE_SEH_throw(pctx, PCE_WRONG_TYPE_ARGUMENT_ERROR, NULL);
    }
    pvo = psym->obj.v.pv;
    if (pvo) EIMIL_RMREF(*pvo);
    psym->obj.v.pv = pv;
    if (pv) EIMIL_ADDREF(*pv);

    return pv;
}

Here is the call graph for this function:

DEFINE_EXEC_METHOD ( return  )

Definition at line 4821 of file PCE.c.

Here is the call graph for this function:

DEFINE_INST_TEMPLATE_0 ( undo  ,
EIMIL_TYPE_NONE  ,
 
)
DEFINE_INST_TEMPLATE_0 ( mark_undo  ,
EIMIL_TYPE_NONE  ,
 
)
DEFINE_INST_TEMPLATE_0 ( throw  ,
EIMIL_TYPE_NONE  ,
 
)
DEFINE_INST_TEMPLATE_1 ( try  ,
EIMIL_TYPE_NONE  ,
,
EIMIL_TYPE_ANY EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( catch  ,
EIMIL_TYPE_NONE  ,
,
EIMIL_TYPE_ANY EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( keycase  ,
EIMIL_TYPE_NONE  ,
,
EIMIL_TYPE_ANY EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( keymap  ,
EIMIL_TYPE_NONE  ,
,
EIMIL_TYPE_ANY EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( toggle_preedit  ,
EIMIL_TYPE_BOOL  ,
,
EIMIL_TYPE_BOOL   
)
DEFINE_INST_TEMPLATE_1 ( toggle_lookup_choice  ,
EIMIL_TYPE_BOOL  ,
,
EIMIL_TYPE_BOOL   
)
DEFINE_INST_TEMPLATE_1 ( keyeventp  ,
EIMIL_TYPE_BOOL  ,
,
EIMIL_TYPE_EVENT   
)
DEFINE_INST_TEMPLATE_1 ( or  ,
EIMIL_TYPE_BOOL  ,
,
EIMIL_TYPE_ANY EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( and  ,
EIMIL_TYPE_BOOL  ,
,
EIMIL_TYPE_ANY EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( propsize  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_PROP   
)
DEFINE_INST_TEMPLATE_1 ( propmbeg  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_PROP   
)
DEFINE_INST_TEMPLATE_1 ( propmend  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_PROP   
)
DEFINE_INST_TEMPLATE_1 ( add  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_NUMBER EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( sub  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_NUMBER EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( mul  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_NUMBER EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( div  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_NUMBER EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( mod  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_NUMBER EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( bor  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_NUMBER EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( band  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_NUMBER EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( bxor  ,
EIMIL_TYPE_NUMBER  ,
,
EIMIL_TYPE_NUMBER EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( propcopy  ,
EIMIL_TYPE_PROP  ,
,
EIMIL_TYPE_PROP   
)
DEFINE_INST_TEMPLATE_1 ( makechar  ,
EIMIL_TYPE_CHAR  ,
,
EIMIL_TYPE_NUMBER   
)
DEFINE_INST_TEMPLATE_1 ( concat  ,
EIMIL_TYPE_MTEXT  ,
,
EIMIL_TYPE_CHAR|EIMIL_TYPE_MTEXT EIMIL_TYPE_OPTION1 
)
DEFINE_INST_TEMPLATE_1 ( delmprop  ,
EIMIL_TYPE_NONE  ,
,
EIMIL_TYPE_PROP   
)
DEFINE_INST_TEMPLATE_1 ( return  ,
EIMIL_TYPE_NONE  ,
,
EIMIL_TYPE_ANY   
)
DEFINE_INST_TEMPLATE_3 ( substr  ,
EIMIL_TYPE_MTEXT  ,
,
EIMIL_TYPE_MTEXT  ,
EIMIL_TYPE_NUMBER  ,
EIMIL_TYPE_NUMBER EIMIL_TYPE_OPTION2 
)
DEFINE_INST_TEMPLATE_5 ( makeev  ,
EIMIL_TYPE_EVENT  ,
,
EIMIL_TYPE_MTEXT  ,
EIMIL_TYPE_NUMBER EIMIL_TYPE_NIL,
EIMIL_TYPE_NUMBER EIMIL_TYPE_NIL,
EIMIL_TYPE_CHAR EIMIL_TYPE_NIL,
EIMIL_TYPE_MTEXT EIMIL_TYPE_NIL 
)
DEFINE_PARSER_METHOD ( defvar  )

Definition at line 2358 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
      {
         int constp = 0;
         enum PCE_VAL_TYPE vt;
         EIMIL_symbol *psym;
         char *name;
         
         type = PCE_get_type_from_attrs(ped, patr);
         if (type == EIMIL_TYPE_INVALID) return 0;
         vt = PCE_get_val_type_attribute(ped, patr);
         if (vt == PCE_VAL_TYPE_INVALID) return 0;
         name = PCE_get_name_attribute(ped, patr);
         if (!name) return 0;
         if (vt == PCE_VAL_TYPE_CONST) {
             constp = 1;
         } else if (vt == PCE_VAL_TYPE_NIL) {
             pcx->mode = PCE_SET_PARSER_CONTEXT_MODE(pcx,
                                                PCE_DEFVAR_NIL);
         }

         psym = PCE_register_symbol(pcx->pctx, name,
                                 EIMIL_CAT_VARIABLE,
                                 type);
         free(name);
         if (!psym) return 0;
         psym->publicp = 0;
         psym->obj.v.constp = constp;
         psym->obj.v.type = type;
         psym->obj.v.pv = NULL;
         pcx->psym = psym;
         return 1;
      }
      case EIMIL_CHARDATA:
      {
         EIMIL_value *pv;
         EIMIL_symbol *psym = pcx->psym;
         enum PCE_ERROR_CODE r;

         if (pcx->mode & PCE_DEFVAR_DONE) {
             PCE_set_error(ped, PCE_DEFVAR_DONE_ERROR);
             return 0;
         }
         if (pcx->mode & PCE_DEFVAR_NIL) {
             PCE_set_error(ped, PCE_DEFVAR_NIL_ERROR);
             return 0;
         }
         r = PCE_parse_literal(ped, pchars, &pv);
         if (r != PCE_SUCCESS) {
             PCE_set_error(ped, r);
             return 0;
         }
         if (psym->obj.v.type != pv->type) {
             PCE_type_mismatch_error(ped, psym->obj.v.type, pv->type);
             return 0;
         }
         
         psym = pcx->psym;
         ASSERT(psym);
         pcx->psym->obj.v.pv = pv;
         EIMIL_ADDREF(*pv);
         pcx->mode = PCE_SET_PARSER_CONTEXT_MODE(pcx,
                                            PCE_DEFVAR_DONE);
         return 1;
      }

      case EIMIL_END_TAG:
       pcx->mode = PCE_RESET_PARSER_CONTEXT_MODE(pcx,
                                           PCE_DEFVAR_NIL_ERROR
                                           | PCE_DEFVAR_DONE);
       return 1;
       
      default:
       EIMIL_set_error_pt(ped, NULL, "Unknown error.");
    }

    return 0;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( defun  )

Definition at line 2441 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;
    PCE_inst_template *pit = (PCE_inst_template*) ped->pcommon->ps.pcet->private;

    switch (type) {
      case EIMIL_START_TAG:
      {
         PCE_function *pf;
         EIMIL_symbol *psym;
         char *name;
         enum EIMIL_TYPE rettype;

         rettype = PCE_get_type_from_attrs(ped, patr);
         if (rettype == EIMIL_TYPE_INVALID) return 0;
         name = PCE_get_name_attribute(ped, patr);
         if (!name) return 0;
         if (!PCE_get_funcproto_attribute(ped, patr, &pf)) return 0;
         pf->rettype = rettype;
         psym = PCE_register_symbol(pcx->pctx, name,
                                 EIMIL_CAT_FUNCTION,
                                 type);
         free(name);
         if (!psym)  return 0;
         psym->publicp = 0;
         psym->obj.f.type = type;
         psym->obj.f.def = pf;

         pcx = PCE_parser_generic_start(ped, pcx, pit->result);
         if (!pcx) return 0;
         PCE_SET_REQUIRED_TYPES(pcx, pit);
         pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, PCE_IN_DEFUN);
         pcx->psym = psym;
         pcx->pdic = pf->pdic;
         pcx->pf = pf;
         *pprivate = pcx;
         return 1;
      }
      case EIMIL_CHARDATA:
       EIMIL_set_error(ped, NULL, "The expression has no effect.");
       return 0;

      case EIMIL_END_TAG:
      {
         EIMIL_symbol *psym = pcx->psym;
         PCE_function *pf = (PCE_function*) psym->obj.f.def;
         int symid;
         symid = pcx->psym->symbolid;
         pcx = PCE_parser_generic_end(ped, pcx,
                                   PCE_new_code_for_etc(PCE_CODE_DEFUN));
         pcx->pc->val.symid = symid;
         if (!pcx) return 0;
         pf->pc = pcx->pc;
         return 1;
      }
       
      default:
       EIMIL_set_error_pt(ped, NULL, "Unknown error.");
    }

    return 0;
}

Here is the call graph for this function:

Definition at line 2504 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;
    PCE_inst_template *pit = (PCE_inst_template*) ped->pcommon->ps.pcet->private;

    switch (type) {
      case EIMIL_START_TAG:
      {
         pcx = PCE_parser_generic_start(ped, pcx, pit->result);
         if (!pcx) return 0;
         PCE_SET_REQUIRED_TYPES(pcx, pit);
         pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, PCE_IN_MAIN);
         *pprivate = pcx;
         return 1;
      }
      case EIMIL_CHARDATA:
       EIMIL_set_error(ped, NULL, "The expression has no effect.");
       return 0;

      case EIMIL_END_TAG:
      {
         PCE_data *pd = pcx->pctx->ppce_data;
         pcx = PCE_parser_generic_end(ped, pcx,
                                   PCE_new_code_for_etc(PCE_CODE_MAIN));
         if (!pcx) return 0;
         pd->pcode = pcx->pc;
         return 1;
      }
       
      default:
       EIMIL_set_error_pt(ped, NULL, "Unknown error.");
    }

    return 0;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( deftable  )

Definition at line 2540 of file PCE.c.

{
    /* TODO */
    return 1;
}

Definition at line 2546 of file PCE.c.

{
    return 0;
}
DEFINE_PARSER_METHOD ( defkeymap  )

Definition at line 2551 of file PCE.c.

{
    /* TODO */
    return 1;
}
DEFINE_PARSER_METHOD ( mnemonic  )

Definition at line 2557 of file PCE.c.

{
    /* TODO */
    return 1;
}
DEFINE_PARSER_METHOD ( pattern  )

Definition at line 2562 of file PCE.c.

{
    /* TODO */
    return 1;
}
DEFINE_PARSER_METHOD ( defpattern  )

Definition at line 2567 of file PCE.c.

{
    /* TODO */
    return 1;
}
DEFINE_PARSER_METHOD ( return  )

Definition at line 2627 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    if (type == EIMIL_START_TAG) {
       int r;
       if (!(pcx->mode & PCE_IN_DEFUN)) {
           PCE_set_error(ped, PCE_PARSE_RETURN_IN_DEFUN_ERROR);
       }
       r = PCE_generic_inst_parser(ped, patr, type, pchars, pprivate);
       ASSERT(pcx->pf);
       pcx->required_type[0] = pcx->pf->rettype;
       return r;
    }
    return PCE_generic_inst_parser(ped, patr, type, pchars, pprivate);
}

Here is the call graph for this function:

Definition at line 2648 of file PCE.c.

{
    int id;
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
       id = PCE_make_label(pcx);
       if (id < 0) return 0;
       pcx = PCE_parser_generic_start(ped, pcx, EIMIL_TYPE_NONE);
       if (!pcx) return 0;
       pcx->required_type[0] = EIMIL_TYPE_ANY;
       pcx->required_type[1] = EIMIL_TYPE_ANY | EIMIL_TYPE_OPTION1;
       pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, PCE_IN_IF);
       pcx->labelid = pcx->labelid2 = id;
       *pprivate = pcx;
       return 1;

      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
      {
         int st_label_id = pcx->labelid2;
         pcx = PCE_parser_jmp_end(ped, pcx, PCE_COND_NOT_JMP_END, 0);
         if (!pcx) return 0;
         PCE_mark_label_yet(pcx, st_label_id, pcx->pc, 1);
         return 1;
      }
      default:
        break;
    }

    return 0;
}

Here is the call graph for this function:

Definition at line 2685 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
      {
         int id;
         PCE_code *pc;

         id = PCE_make_label(pcx);
         if (id < 0) return 0;
         pc = PCE_new_code_for_jmp(PCE_CODE_UNRESOLVED_JMP, id);
         if (!pc) return 0;
         PCE_ADD_CODE(pcx, pc);
         PCE_mark_label(pcx, pcx->labelid, pc, 1);
         pcx->labelid2 = id;
         return 1;
      }

      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
       return 1;

      default:
       break;
    }

    return 0;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( while  )

Definition at line 2719 of file PCE.c.

{
    int id;
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
       id = PCE_make_label(pcx);
       if (id < 0) return 0;
       pcx = PCE_parser_generic_start(ped, pcx, EIMIL_TYPE_NONE);
       if (!pcx) return 0;
       pcx->required_type[0] = EIMIL_TYPE_ANY | EIMIL_TYPE_OPTION1;
       pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, PCE_IN_IF);
       pcx->labelid = id;
       *pprivate = pcx;
       return 1;

      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
      {
         int st_label_id = pcx->labelid;
         pcx = PCE_parser_jmp_end(ped, pcx, PCE_COND_NOT_JMP_END, 1);
         if (!pcx) return 0;
         PCE_mark_label_yet(pcx, st_label_id, pcx->pc, 1);
         return 1;
      }

      default:
        break;
    }

    return 0;
}

Here is the call graph for this function:

Definition at line 2756 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
      {
         int id;

         id = PCE_make_label(pcx);
         if (id < 0) return 0;
         pcx = PCE_parser_generic_start(ped, pcx, EIMIL_TYPE_NONE);
         if (!pcx) return 0;
         pcx->required_type[0] = EIMIL_TYPE_ANY;
         pcx->required_type[1] = EIMIL_TYPE_ANY | EIMIL_TYPE_OPTION1;
         pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, PCE_IN_SELECT);
         pcx->labelid2 = id;
         *pprivate = pcx;
         return 1;
      }

      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
       pcx = PCE_parser_select_case_end(ped, pcx);
       if (!pcx) return 0;
       return 1;
      default:
       break;
    }

    return 0;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( default  )

Definition at line 2792 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
      {
         int id;

         id = PCE_make_label(pcx);
         if (id < 0) return 0;
         pcx = PCE_parser_generic_start(ped, pcx, EIMIL_TYPE_NONE);
         if (!pcx) return 0;
         pcx->required_type[0] = EIMIL_TYPE_ANY | EIMIL_TYPE_OPTION1;
         pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, PCE_IN_SELECT);
         pcx->labelid2 = id;
         *pprivate = pcx;
         return 1;
      }

      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
       pcx = PCE_parser_select_default_end(ped, pcx);
       if (!pcx) return 0;
       return 1;

      default:
       break;
    }

    return 0;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( select  )

Definition at line 2828 of file PCE.c.

{
    int id;
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
       id = PCE_make_label(pcx); /* label for the tail.  */
       if (id < 0) return 0;
       pcx = PCE_parser_generic_start(ped, pcx, EIMIL_TYPE_NONE);
       if (!pcx) return 0;
       pcx->required_type[0] = EIMIL_TYPE_ANY | EIMIL_TYPE_OPTION1;
       pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, PCE_IN_SELECT);
       pcx->labelid = id;
       pcx->pc_head = NULL; /* Used for the head jmp table(s). */
       *pprivate = pcx;
       return 1;

      case EIMIL_CHARDATA:
       return 0;

      case EIMIL_END_TAG:
      {
         pcx = PCE_parser_select_end(ped, pcx);
         if (!pcx) return 0;
         return 1;
      }
      default:
       break;
    }

    return 0;
}

Here is the call graph for this function:

Definition at line 2866 of file PCE.c.

{
    /* TODO */
    return 1;
}
DEFINE_PARSER_METHOD ( throw  )

Definition at line 2900 of file PCE.c.

{
    if (type != EIMIL_EMPTY_TAG) return 0;

    {
       PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

       EIMIL_symbol *psym;
       PCE_code *pc, *pc_arg;
         
       psym = PCE_attr_get_exception_symbol(ped, pcx, patr);

       pc_arg = PCE_new_code_for_symbol(pcx->psym);
       if (!pc_arg) {
           PCE_set_error(ped, PCE_MEMORY_ERROR);
           return 0;
       }
       pc = PCE_new_code_for_inst(PCE_throw_exec);
       if (!pc) {
           PCE_set_error(ped, PCE_MEMORY_ERROR);
           return 0;
       }
       pc->parg = pc_arg;
       PCE_ADD_CODE(pcx, pc);
    }

    return 1;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( catch  )

Definition at line 2929 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
      {
         EIMIL_symbol *psym;
         
         psym = PCE_attr_get_exception_symbol(ped, pcx, patr);
         pcx = PCE_parser_generic_start(ped, pcx, EIMIL_TYPE_NONE);
         if (!pcx) return 0;
         pcx->required_type[0] = EIMIL_TYPE_ANY | EIMIL_TYPE_OPTION1;
         pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, 0);
         pcx->psym = psym;
         *pprivate = pcx;
         return 1;
      }
      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
      {
         PCE_code *pc = PCE_new_code_for_symbol(pcx->psym);
         if (!pc) {
             PCE_set_error(ped, PCE_MEMORY_ERROR);
             return 0;
         }
         pcx = PCE_parser_generic_end(ped, pcx,
                                   PCE_new_code_for_inst(PCE_catch_exec));
         /* Insert EIMIL_exception symbol
            to the first argument of `catch'.  */
         pc->pnext = pcx->pc->parg;
         pcx->pc->parg = pc;
         if (!pcx) return 0;
         return 1;
      }
      default:
      break;
    }

    return 0;
}

Here is the call graph for this function:

Definition at line 2994 of file PCE.c.

{
    int id;
    UTF8* labelname;
    PCE_code *pc;
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    ASSERT(type == EIMIL_EMPTY_TAG);

    if (!(pcx->mode & PCE_IN_MAIN)) {
       EIMIL_set_error_pt(ped, NULL, "`go' element must be in `main' element.");
       return 0;
    }

    labelname = PCE_attr_get_label_symbol(ped, pcx, patr);
    if (!labelname) return 0;

    id = PCE_lookup_named_label(pcx, labelname);
    if (id < 0) {
       id = PCE_make_named_label(ped, pcx, labelname);
       if (id < 0) {
           free(labelname);
           return 0;
       }
    }
    free(labelname);
    pc = PCE_new_code_for_jmp(PCE_CODE_UNRESOLVED_JMP, id);
    PCE_ADD_CODE(pcx, pc);

    return 1;
}

Here is the call graph for this function:

Definition at line 3026 of file PCE.c.

{
    int id;
    UTF8* labelname;
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    ASSERT(type == EIMIL_EMPTY_TAG);

    if (!(pcx->mode & PCE_IN_MAIN)) {
       EIMIL_set_error_pt(ped, NULL, "`label' element must be in `main' element.");
       return 0;
    }

    labelname = PCE_attr_get_label_symbol(ped, pcx, patr);
    if (!labelname) return 0;

    id = PCE_lookup_named_label(pcx, labelname);
    if (id < 0) {
       id = PCE_make_named_label(ped, pcx, labelname);
       if (id < 0) return 0;
    }
    PCE_mark_label(pcx, id, pcx->pc, 1);

    return 1;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( tblkeymaxsize  )

Definition at line 3052 of file PCE.c.

{
    return 1;
}
DEFINE_PARSER_METHOD ( tblvalmaxsize  )

Definition at line 3057 of file PCE.c.

{
    return 1;
}
DEFINE_PARSER_METHOD ( tblref  )

Definition at line 3062 of file PCE.c.

{
    return 1;
}
DEFINE_PARSER_METHOD ( makeprop  )

Definition at line 3089 of file PCE.c.

{
    if (type != EIMIL_EMPTY_TAG) return 0;

    {
       PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

       EIMIL_symbol *psym;
       PCE_code *pc, *pc_arg;
         
       psym = PCE_attr_get_property_symbol(ped, pcx, patr);

       pc_arg = PCE_new_code_for_symbol(pcx->psym);
       if (!pc_arg) {
           PCE_set_error(ped, PCE_MEMORY_ERROR);
           return 0;
       }
       pc = PCE_new_code_for_inst(PCE_makeprop_exec);
       if (!pc) {
           PCE_set_error(ped, PCE_MEMORY_ERROR);
           return 0;
       }
       pc->parg = pc_arg;
       PCE_ADD_CODE(pcx, pc);
    }

    return 1;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( getmprop  )

Definition at line 3118 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
      {
         EIMIL_symbol *psym;
         
         psym = PCE_attr_get_property_symbol(ped, pcx, patr);
         pcx = PCE_parser_generic_start(ped, pcx, EIMIL_TYPE_NONE);
         if (!pcx) return 0;
         pcx->required_type[0] = EIMIL_TYPE_MTEXT;
         pcx->required_type[1] = EIMIL_TYPE_NUMBER;
         pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, 0);
         pcx->psym = psym;
         *pprivate = pcx;
         return 1;
      }
      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
      {
         PCE_code *pc = PCE_new_code_for_symbol(pcx->psym);
         if (!pc) {
             PCE_set_error(ped, PCE_MEMORY_ERROR);
             return 0;
         }
         pcx = PCE_parser_generic_end(ped, pcx,
                                   PCE_new_code_for_inst(PCE_getmprop_exec));
         /* Insert EIMIL_exception symbol
            to the first argument of `catch'.  */
         pc->pnext = pcx->pc->parg;
         pcx->pc->parg = pc;
         if (!pcx) return 0;
         return 1;
      }
      default:
        break;
    }

    return 0;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( findmprop  )

Definition at line 3164 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
      {
         EIMIL_symbol *psym;
         
         psym = PCE_attr_get_property_symbol(ped, pcx, patr);
         pcx = PCE_parser_generic_start(ped, pcx, EIMIL_TYPE_NONE);
         if (!pcx) return 0;
         pcx->required_type[0] = EIMIL_TYPE_MTEXT;
         pcx->required_type[1] = EIMIL_TYPE_NUMBER;
         pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, 0);
         pcx->psym = psym;
         *pprivate = pcx;
         return 1;
      }
      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
      {
         PCE_code *pc = PCE_new_code_for_symbol(pcx->psym);
         if (!pc) {
             PCE_set_error(ped, PCE_MEMORY_ERROR);
             return 0;
         }
         pcx = PCE_parser_generic_end(ped, pcx,
                                   PCE_new_code_for_inst(PCE_findmprop_exec));
         /* Insert EIMIL_exception symbol
            to the first argument of `catch'.  */
         pc->pnext = pcx->pc->parg;
         pcx->pc->parg = pc;
         if (!pcx) return 0;
         return 1;
      }
      default:
        break;
    }

    return 0;
}

Here is the call graph for this function:

DEFINE_PARSER_METHOD ( interact  )

Definition at line 3210 of file PCE.c.

{
    return 1;
}

Definition at line 3215 of file PCE.c.

{
    return 1;
}
DEFINE_PARSER_METHOD ( forward  )

Definition at line 3220 of file PCE.c.

{
    return 1;
}

Definition at line 3225 of file PCE.c.

{
    return 1;
}

Definition at line 3255 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
      {
         EIMIL_symbol *psym;
         
         psym = PCE_attr_get_variable_symbol(ped, pcx, patr);
         if (!psym) {
             EIMIL_set_error_pt(ped, NULL,
                             "invalid `v' attribute in `set' element.");
             return 0;
         }
         pcx = PCE_parser_generic_start(ped, pcx, psym->obj.v.type);
         if (!pcx) return 0;
         pcx->required_type[0] = psym->obj.v.type | EIMIL_TYPE_NIL;
         pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, 0);
         pcx->psym = psym;
         *pprivate = pcx;
         return 1;
      }
      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
      {
         PCE_code *pc = PCE_new_code_for_symbol(pcx->psym);
         if (!pc) {
             PCE_set_error(ped, PCE_MEMORY_ERROR);
             return 0;
         }
         PCE_ADD_CODE(pcx, pc);
         pcx = PCE_parser_generic_end(ped, pcx,
                                   PCE_new_code_for_inst(PCE_set_exec));
         if (!pcx) return 0;
         return 1;
      }
      default:
          break;
    }

    return 0;
}

Here is the call graph for this function:

Definition at line 3326 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;

    switch (type) {
      case EIMIL_START_TAG:
      {
         EIMIL_symbol *psym;
         PCE_function *pf;

         psym = PCE_attr_get_function_symbol(ped, pcx, patr);
         pf = (PCE_function*) psym->obj.f.def;
         pcx = PCE_parser_generic_start(ped, pcx, pf->rettype);
         if (!pcx) return 0;
         pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, PCE_IN_E);
         pcx->pf = pf;
         *pprivate = pcx;
         return 1;
      }
      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
       pcx = PCE_parser_generic_end(ped, pcx,
                                PCE_new_code_for_function(pcx->pf));
       if (!pcx) return 0;
       return 1;

      default:
       break;
    }

    return 0;
}

Here is the call graph for this function:

Definition at line 3366 of file PCE.c.

{
    PCE_parse_context *pcx;

    if (type == EIMIL_START_TAG) {
       PCE_context *pctx = (PCE_context*) *pprivate;

       pcx = PCE_new_parse_context(ped);
       if (!pcx) return 0;
       if (PCE_initialize_labels(pcx) != PCE_SUCCESS) return 0;
       pcx->pctx = pctx;
       pcx->required_type[0] = EIMIL_TYPE_ANY | EIMIL_TYPE_OPTION1;
       *pprivate = pcx;
       return 1;
    } else {
       pcx = (PCE_parse_context*) *pprivate;
       ASSERT(!pcx->pnext);
       PCE_finalize_labels(ped, pcx);
       /*
         Almost all of the work on pcx->pctx should be done in the
         subelement parsers.  Thus currently do nothing in the root parser.
       */
       free(pcx);
       return 1;
    }

    return 0;
}

Here is the call graph for this function:

DEFINE_SINST_TEMPLATE_1 ( defun  ,
PCE_CODE_DEFUN  ,
EIMIL_TYPE_NONE  ,
,
EIMIL_TYPE_ANY EIMIL_TYPE_OPTION1 
)
DEFINE_SINST_TEMPLATE_1 ( main  ,
PCE_CODE_MAIN  ,
EIMIL_TYPE_NONE  ,
,
EIMIL_TYPE_ANY EIMIL_TYPE_OPTION1 
)
static EIMIL_symbol* PCE_attr_get_exception_symbol ( EIMIL_data ped,
PCE_parse_context pcx,
EIMIL_attrs patr 
) [static]

Definition at line 2878 of file PCE.c.

{
    for (; patr->name;patr++) {
       if (strcmp(patr->name, "exc") == 0) {
           EIMIL_symbol *psym;
           UTF8 *name;
           if (!EIMIL_get_attr_nmtokens(patr->val, &name)) {
              EIMIL_set_error_pt(ped, NULL, "Unrecogized keyword in `v'");
              return NULL;
           }
           psym = PCE_get_exception(ped, pcx, name);
           free(name);
           if (!psym) return NULL;
           return psym;
       }
    }
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_symbol* PCE_attr_get_function_symbol ( EIMIL_data ped,
PCE_parse_context pcx,
EIMIL_attrs patr 
) [static]

Definition at line 3304 of file PCE.c.

{
    for (; patr->name;patr++) {
       if (strcmp(patr->name, "f") == 0) {
           EIMIL_symbol *psym;
           UTF8 *name;
           if (!EIMIL_get_attr_nmtokens(patr->val, &name)) {
              EIMIL_set_error_pt(ped, NULL, "Unrecogized keyword in `v'");
              return NULL;
           }
           psym = PCE_get_function(ped, pcx, name);
           free(name);
           if (!psym) return NULL;
           return psym;
       }
    }
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static UTF8* PCE_attr_get_label_symbol ( EIMIL_data ped,
PCE_parse_context pcx,
EIMIL_attrs patr 
) [static]

Definition at line 2976 of file PCE.c.

{
    for (; patr->name;patr++) {
       if (strcmp(patr->name, "to") == 0) {
           UTF8 *name;
           if (!EIMIL_get_attr_nmtokens(patr->val, &name)) {
              EIMIL_set_error_pt(ped, NULL, "Unrecogized keyword in `v'");
              return NULL;
           }
           return name;
       }
    }
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_symbol* PCE_attr_get_property_symbol ( EIMIL_data ped,
PCE_parse_context pcx,
EIMIL_attrs patr 
) [static]

Definition at line 3069 of file PCE.c.

{
    for (; patr->name;patr++) {
       if (strcmp(patr->name, "p") == 0) {
           EIMIL_symbol *psym;
           UTF8 *name;
           if (!EIMIL_get_attr_nmtokens(patr->val, &name)) {
              EIMIL_set_error_pt(ped, NULL, "Unrecogized keyword in `p'");
              return NULL;
           }
           psym = PCE_get_property(ped, pcx, name);
           return psym;
       }
    }
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_symbol* PCE_attr_get_variable_symbol ( EIMIL_data ped,
PCE_parse_context pcx,
EIMIL_attrs patr 
) [static]

Definition at line 3232 of file PCE.c.

{
    for (; patr->name;patr++) {
       if (strcmp(patr->name, "v") == 0) {
           EIMIL_symbol *psym;
           UTF8 *name;
           if (!EIMIL_get_attr_nmtokens(patr->val, &name)) {
              EIMIL_set_error_pt(ped, NULL, "Unrecogized keyword in `v'");
              return NULL;
           }
           psym = PCE_get_variable(ped, pcx, name);
           free(name);
           if (!psym) return NULL;
           return psym;
       }
    }
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void PCE_bind_function_arg ( PCE_context pctx,
PCE_function pf,
PCE_code parg 
) [static]

Definition at line 3708 of file PCE.c.

{
    int i;
    PCE_funcproto *pfp;
    EIMIL_value *pv;
    int idx = pctx->depth++;

    pctx->pfuncdic[idx] = pf->pdic;
    for (i = 0, pfp = pf->pfp; i < pf->nargs; i++, pfp++) {
       ASSERT(parg);
       pv = PCE_eval(pctx, parg);
       pfp->psym->obj.v.pv = pv;
       if (pv) EIMIL_ADDREF(*pv);
       parg = parg->pnext;
    }
    pctx->pdic_f = pf->pdic;

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_value * PCE_call ( PCE_context pctx,
PCE_function pf,
PCE_code parg 
) [static]

Definition at line 3781 of file PCE.c.

{
    enum PCE_ERROR_CODE r;
    struct PCE_call_catcharg carg;

    if (pctx->depth >= PCE_CALL_MAX_DEPTH) {
       PCE_SEH_throw(pctx, PCE_OVER_EVAL_DEPTH_ERROR, NULL);
    }

    if (PCE_SEH_start(pctx) != PCE_SUCCESS) return NULL;

    PCE_bind_function_arg(pctx, pf, parg);
    carg.pv = NULL;
    carg.pf = pf;
    if (PCE_SEH_catch(pctx, PCE_ANY_ERROR,
                    PCE_call_exception_handler,
                    &carg)
       != PCE_SUCCESS)
       return NULL;

    pctx->pcur = pf->pc;
    r = PCE_SEH_try(pctx, PCE_execute_loop, NULL);
    PCE_unbind_function_arg(pctx, pf);
    if (r == PCE_SUCCESS) return carg.pv;

    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static enum PCE_ERROR_CODE PCE_call_exception_handler ( PCE_context pctx,
int  ecode,
void *  throwarg,
void *  catcharg 
) [static]

Definition at line 3761 of file PCE.c.

{
    struct PCE_call_catcharg *pcarg = (struct PCE_call_catcharg*) catcharg;

    if (ecode == PCE_RETURN_JMP_ERROR) {
       pcarg->pv = (EIMIL_value*) throwarg;
    } else {
       PCE_unbind_function_arg(pctx, pcarg->pf);
       PCE_SEH_throw(pctx, ecode, throwarg);
    }

    return PCE_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PCE_check_type ( EIMIL_data ped,
PCE_parse_context pcx,
int  type 
) [static]

Definition at line 1447 of file PCE.c.

{
    int i;
    int req;

    /* argument type */
    if (pcx->mode & PCE_IN_E) {
       PCE_function *pf = pcx->pf;
       if (pf->nargs <= pcx->idx) {
           req = 0;
       } else {
           PCE_funcproto *pfp = pf->pfp + pcx->idx;
           req = pfp->type;
       }
    } else {
       for (i = 0; i <= pcx->idx; i++) {
           if (i >= PCE_ARG_MAX) {
              req = 0;
              break;
           }
           req = pcx->required_type[i];
           if (!req) break;
           /* 
              Note that EIMIL_TYPE_OPTION1 means it allows
              arbitrary number of arguments.
           */
           if (req & EIMIL_TYPE_OPTION1) break;
       }
    }
    if (req == 0) {
       EIMIL_set_error_pt(ped, NULL, "Too many arguments.");
       return 0;
    }
    if ((req & EIMIL_TYPE_NIL) && (type == EIMIL_TYPE_NIL)) return 1;
    if ((req & EIMIL_TYPE_ANY) || (type & EIMIL_TYPE_ANY)) return 1;
    if ((req | type) == req) return 1;

    PCE_type_mismatch_error(ped, type, req);

    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void PCE_destruct_context ( PCE_context pctx) [static]

Definition at line 3405 of file PCE.c.

{
    EIMIL_free_dictionary(pctx->pdic);
    {
       PCE_SEH_block *pseh1, *pseh2;
       for (pseh1 = pctx->pseh; pseh1; ) {
           pseh2 = pseh1->pnext;
           PCE_SEH_free(pseh1);
           pseh1 = pseh2;
       }
    }
    free(pctx);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void PCE_destruct_data ( PCE_data pd) [static]

Definition at line 3422 of file PCE.c.

{
    PCE_free_code(pd->pcode);
    free(pd);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_value* PCE_eval ( PCE_context pctx,
PCE_code pc 
) [static]

Definition at line 3621 of file PCE.c.

{
    EIMIL_value *pv;

    for (;;) {
       if (!pc) break;
       switch (pc->type) {
         case PCE_CODE_VALUE:
          pv = pc->val.pv;
          pctx->pcur = pc->pnext;
          return pv;
         case PCE_CODE_SYMBOL:
          pv = PCE_symbol_value(pctx, pc);
          pctx->pcur = pc->pnext;
          return pv;

         case PCE_CODE_JMP:
          pc = pctx->pcur = pc->val.pc_to;
          continue;

         case PCE_CODE_COND_JMP:
          pv = PCE_eval(pctx, pc->parg);
          if (pv) {
              EIMIL_REFCHECK(*pv);
              pc = pctx->pcur = pc->val.pc_to;
          } else {
              pc = pctx->pcur = pc->pnext;
          }
          continue;

         case PCE_CODE_COND_NOT_JMP:
          pv = PCE_eval(pctx, pc->parg);
          if (pv) {
              EIMIL_REFCHECK(*pv);
              pc = pctx->pcur = pc->pnext;
          } else {
              pc = pctx->pcur = pc->val.pc_to;
          }
          continue;

         case PCE_CODE_FUNCTION:
          pv = PCE_call(pctx, pc->val.pf, pc->parg);
          pctx->pcur = pc->pnext;
          return pv;

         default:
          ASSERT(pc->type == PCE_CODE_INST);
          pctx->pcur = pc;
          pv = (*pc->val.h)(pctx);
          pctx->pcur = pc->pnext;

          return pv;
       }
    }

    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static enum EIMIL_ENGINE_STATUS PCE_execute ( void *  private) [static]

Definition at line 4852 of file PCE.c.

Here is the call graph for this function:

Here is the caller graph for this function:

enum PCE_ERROR_CODE PCE_execute_loop ( PCE_context pctx,
void *  arg 
)

Definition at line 3683 of file PCE.c.

{
    PCE_code *pc;
    EIMIL_value *pv;

    if (!pctx->pcur) {
       pc = pctx->ppce_data->pcode;
       ASSERT(pc->type == PCE_CODE_MAIN);
       pc = pc->parg;
       pctx->pcur = pc;
    }
    for (;;){
       pc = pctx->pcur;
       if (!pc) break;
       pv = PCE_eval(pctx, pc);
       if (pv) EIMIL_REFCHECK(*pv);
    }

    return PCE_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static enum PCE_ERROR_CODE PCE_finalize_labels ( EIMIL_data ped,
PCE_parse_context pcx 
) [static]

Definition at line 1727 of file PCE.c.

{
    enum PCE_ERROR_CODE r;
    PCE_labelset *pls = pcx->plabels;

    r = PCE_fixate_labels(ped, pls, pcx->pc);
    if (r != PCE_SUCCESS) return r;

    EIMIL_free_dictionary_and_symbol(pls->pdic);
    free(pls->pl);
    free(pls);

    return PCE_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static enum PCE_ERROR_CODE PCE_fixate_labels ( EIMIL_data ped,
PCE_labelset pls,
PCE_code pc_st 
) [static]

Definition at line 1684 of file PCE.c.

{
    enum PCE_ERROR_CODE r;
    PCE_label *pl;
    PCE_code *pc;

    for (pc = pc_st; pc; pc = pc->pnext) {
       if ((pc->type == PCE_CODE_UNRESOLVED_JMP)
           || (pc->type == PCE_CODE_UNRESOLVED_COND_JMP)
           || (pc->type == PCE_CODE_UNRESOLVED_COND_NOT_JMP)) {
           ASSERT(pc->val.to_labelid < pls->labelnum);
           pl = pls->pl + pc->val.to_labelid;
           if (!pl->pc) {
              ASSERT(pl->psym);
              EIMIL_set_error(ped, "label:%s is not defined, but refered.",
                            pl->psym->name);
              return PCE_LABEL_NOT_DEFINED_ERROR;
           }
           if (pc->type == PCE_CODE_UNRESOLVED_JMP)
              pc->type = PCE_CODE_JMP;
           else if (pc->type == PCE_CODE_UNRESOLVED_COND_JMP)
              pc->type = PCE_CODE_COND_JMP;
           else
              pc->type = PCE_CODE_COND_NOT_JMP;

           if (pl->nextp)
              pc->val.pc_to = pl->pc->pnext;
           else
              pc->val.pc_to = pl->pc;
       }
       if (pc->parg) {
           r = PCE_fixate_labels(ped, pls, pc->parg);
           if (r != PCE_SUCCESS) return r;
       }
    }
    return PCE_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void PCE_free_code ( PCE_code pc) [static]

Definition at line 1525 of file PCE.c.

{
    PCE_code *pc2;
    while (pc) {
       pc2 = pc->pnext;
       if (pc->parg) PCE_free_code(pc->parg);

       if (pc->type == PCE_CODE_VALUE) {
           EIMIL_RMREF(*pc->val.pv);
       }
       free(pc);
       pc = pc2;
    }
}

Here is the caller graph for this function:

static void PCE_free_parse_context ( PCE_parse_context pcx) [static]

Definition at line 1543 of file PCE.c.

{
    PCE_parse_context *pcx2;

    if (pcx->pc)
       PCE_free_code(pcx->pc);
    pcx2 = pcx->pnext;
    free(pcx);
    if (pcx2) PCE_free_parse_context(pcx2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PCE_generic_inst_parser ( EIMIL_data ped,
EIMIL_attrs patr,
enum EIMIL_TAG_TYPE  type,
UTF8 pchars,
void **  pprivate 
) [static]

Definition at line 2578 of file PCE.c.

{
    PCE_parse_context *pcx = (PCE_parse_context*) *pprivate;
    PCE_inst_template *pit = (PCE_inst_template*) ped->pcommon->ps.pcet->private;

    switch (type) {
      case EIMIL_START_TAG:
       pcx = PCE_parser_generic_start(ped, pcx, pit->result);
       if (!pcx) return 0;
       PCE_SET_REQUIRED_TYPES(pcx, pit);
       if ((pit->newmode & PCE_ONLY_IN_MAIN_STATEMENT)
          && !(pcx->mode & PCE_IN_MAIN)) {
          EIMIL_set_error_pt(ped, NULL, "`%s' element must be in `main' element.",
                           ped->pcommon->ps.pcet->name);
          return 0;
       }
       pcx->mode = PCE_NEW_PARSER_CONTEXT_MODE(pcx, pit->newmode);
       *pprivate = pcx;
       return 1;

      case EIMIL_CHARDATA:
       if (PCE_parse_token(ped, pcx, pchars) == PCE_SUCCESS) return 1;
       return 0;

      case EIMIL_END_TAG:
       if (pit->code_type == PCE_CODE_INST)
          pcx = PCE_parser_generic_end(ped, pcx, PCE_new_code_for_inst(pit->handler));
       else
          pcx = PCE_parser_generic_end(ped, pcx, PCE_new_code_for_etc(pit->code_type));
       if (!pcx) return 0;
       return 1;

      default:
       EIMIL_set_error_pt(ped, NULL, "Unknown error.");
    }

    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static enum PCE_ERROR_CODE PCE_get_arg ( PCE_context pctx,
int  idx,
int  type,
EIMIL_value **  ppv 
) [static]

Definition at line 3824 of file PCE.c.

{
    int i;
    EIMIL_value *pv;
    PCE_code *pc_orig, *pc;

    pc_orig = pctx->pcur;
    pc = pc_orig->parg;
    for (i = 0; i < idx; i++) {
       if (!pc) break;
       pc = pc->pnext;
    }
    if (!pc) return PCE_NO_MORE_ARG_ERROR;
    pv = PCE_eval(pctx, pc);
    pctx->pcur = pc_orig;

    if ((type & EIMIL_TYPE_ANY)
       || (!pv && (type & EIMIL_TYPE_NIL))
       || (pv && ((pv->type & type) != 0))) {
       *ppv = pv;
       return PCE_SUCCESS;
    }

    PCE_SEH_throw(pctx, PCE_WRONG_TYPE_ARGUMENT_ERROR, NULL);
    return PCE_UNKNOWN_ERROR;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static enum PCE_ERROR_CODE PCE_get_arg_or_error ( PCE_context pctx,
int  idx,
int  type,
EIMIL_value **  ppv 
) [static]

Definition at line 3883 of file PCE.c.

{
    enum PCE_ERROR_CODE r = PCE_get_arg(pctx, idx, type, ppv);
    if (r == PCE_NO_MORE_ARG_ERROR) {
       PCE_SEH_throw(pctx, PCE_TOO_FEW_ARGUMENTS_ERROR, NULL);
    } else if (r != PCE_SUCCESS) {
       PCE_SEH_throw(pctx, PCE_UNKNOWN_ERROR, NULL);
    }
    return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PCE_get_arg_totnum ( PCE_context pctx) [static]

Definition at line 3900 of file PCE.c.

{
    int i;
    PCE_code *pc = pctx->pcur;

    for (i = 0, pc = pc->parg; pc; i++, pc = pc->pnext);
    return i;
}

Here is the caller graph for this function:

static EIMIL_symbol* PCE_get_exception ( EIMIL_data ped,
PCE_parse_context pcx,
UTF8 varname 
) [static]

Definition at line 1108 of file PCE.c.

{
    EIMIL_symbol *psym;

    psym = PCE_intern_soft_for_parser(pcx, varname);
    if (!psym) {
       PCE_set_error(ped, PCE_PARSE_UNKNOWN_SYMBOL_ERROR);
       return NULL;
    }
    if (psym->cat != EIMIL_CAT_EXCEPTION) {
       PCE_set_error(ped, PCE_NOT_EXCEPTION_ERROR);
       return NULL;
    }
    return psym;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PCE_get_funcproto_attribute ( EIMIL_data ped,
EIMIL_attrs patr,
PCE_function **  ppf 
) [static]

Definition at line 2271 of file PCE.c.

{
    for (; patr->name;patr++) {
       if (strcmp(patr->name, "args") == 0) {
           enum EIMIL_TYPE type;
           UTF8 *argname, *typename;
           EIMIL_dictionary *pdic = NULL;
           EIMIL_symbol *psym;
           PCE_function *pf;
           PCE_funcproto *pfp, *pfp2;
           Ebyte *c = patr->val;
           int i = 0;
           int n = 0;

           pfp2 = pfp = NULL;
           while ((c = EIMIL_get_attr_nmtokens(c, &argname)) != NULL) {
              if (i >= n) {
                  n += 10;
                  pfp2 = (PCE_funcproto*) realloc(pfp2,
                                              sizeof(PCE_funcproto) * n);
                  if (!pfp2) {
                     PCE_set_error(ped, PCE_MEMORY_ERROR);
                     return 0;
                  }
                  pfp = pfp2 + i;
              }
              typename = strchr(argname, ':');
              if (!typename) {
                  EIMIL_set_error_pt(ped, NULL,
                                   "Function argument must specify type name.");
                  return 0;
              }
              *typename = '\0';
              typename++;
              type = PCE_get_type_from_name(typename);
              if (type == EIMIL_TYPE_INVALID) {
                  EIMIL_set_error_pt(ped, NULL,
                                   "Invalid type name:%s.", typename);
                  return 0;
              }
              pfp->type = type;
              if (!pdic) {
                  pdic = EIMIL_new_dictionary(PCE_ARGUMENT_DICTIONARY_SIZE, 1);
                  if (!pdic) {
                     PCE_set_error(ped, PCE_MEMORY_ERROR);
                     return 0;
                  }
              }
              psym = EIMIL_register_symbol(ped, pdic, argname,
                                        EIMIL_CAT_VARIABLE, type);
              pfp->psym = psym;
              pfp++;
              i++;
           }
           if (i > 0) {
              pfp = (PCE_funcproto*) realloc(pfp2,
                                          sizeof(PCE_funcproto) * i);
              if (!pfp) {
                  PCE_set_error(ped, PCE_MEMORY_ERROR);
                  return 0;
              }
           }         
           pf = (PCE_function*) malloc(sizeof(PCE_function));
           if (!pf) {
              PCE_set_error(ped, PCE_MEMORY_ERROR);
              return 0;
           }
           memset(pf, 0, sizeof(PCE_function));
           pf->nargs = i;
           pf->pdic = pdic;
           pf->pfp = pfp;
           pf->pc = NULL;
           *ppf = pf;
           return 1;
       }
    }
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_symbol* PCE_get_function ( EIMIL_data ped,
PCE_parse_context pcx,
UTF8 varname 
) [static]

Definition at line 1087 of file PCE.c.

{
    EIMIL_symbol *psym;

    psym = PCE_intern_soft_for_parser(pcx, varname);
    if (!psym) {
       PCE_set_error(ped, PCE_PARSE_UNKNOWN_SYMBOL_ERROR);
       return NULL;
    }
    if (psym->cat != EIMIL_CAT_FUNCTION) {
       PCE_set_error(ped, PCE_NOT_FUNCTION_ERROR);
       return NULL;
    }
    return psym;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static UTF8* PCE_get_name_attribute ( EIMIL_data ped,
EIMIL_attrs patr 
) [static]

Definition at line 2213 of file PCE.c.

{
    UTF8 *name;
    for (; patr->name;patr++) {
       if (strcmp(patr->name, "name") == 0) {
           if (!EIMIL_get_attr_nmtoken(patr->val, &name)) {
              EIMIL_set_error_pt(ped, NULL, "Invalid nmtoken in `name'");
              return NULL;
           }
           return name;
       }
    }
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_symbol* PCE_get_property ( EIMIL_data ped,
PCE_parse_context pcx,
UTF8 propname 
) [static]

Definition at line 1129 of file PCE.c.

{
    EIMIL_symbol *psym;

    psym = PCE_intern_soft_for_parser(pcx, propname);
    if (!psym) {
       PCE_set_error(ped, PCE_PARSE_UNKNOWN_SYMBOL_ERROR);
       return NULL;
    }
    if (psym->cat != EIMIL_CAT_PROPERTY) {
       PCE_set_error(ped, PCE_NOT_EXCEPTION_ERROR);
       return NULL;
    }
    return psym;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_symbol* PCE_get_symbol_arg ( PCE_context pctx,
int  idx,
enum EIMIL_CATEGORY  cat 
) [static]

Definition at line 3857 of file PCE.c.

{
    int i;
    EIMIL_symbol *psym;
    PCE_code *pc = pctx->pcur;

    pc = pc->parg;
    for (i = 0; i < idx; i++) {
       if (!pc) {
           ERROR_INTERNAL("!!Invalid PCE_code(Too few args).");
       }
       pc = pc->pnext;
    }
    ASSERT(pc->type == PCE_CODE_SYMBOL);
    psym = PCE_lookup_symbol(pctx, pc);
    ASSERT(psym);
    ASSERT(psym->cat == cat);

    return psym;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static enum EIMIL_TYPE PCE_get_type_from_attrs ( EIMIL_data ped,
EIMIL_attrs patr 
) [static]

Definition at line 1886 of file PCE.c.

{
    UTF8 *name;
    enum EIMIL_TYPE type;

    for (; patr->name; patr++) {
       if (strcmp(patr->name, "type") == 0) {
           if (!EIMIL_get_attr_nmtoken(patr->val, &name)) {
              type = EIMIL_TYPE_INVALID;
              break;
           }
           type = PCE_get_type_from_name(name);
           free(name);
           free(patr->name);
           free(patr->val);
           EIMIL_remove_attr(patr);
           break;
       }
    }
    if (type == EIMIL_TYPE_INVALID) {
       EIMIL_set_error_pt(ped, NULL,
                        "Invalid type name:%s", patr->name);
    }

    return type;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static enum EIMIL_TYPE PCE_get_type_from_name ( UTF8 name) [static]

Definition at line 1339 of file PCE.c.

{
    if (strcmp(name, "bool") == 0) return EIMIL_TYPE_BOOL;
    else if (strcmp(name, "number") == 0) return EIMIL_TYPE_NUMBER;
    else if (strcmp(name, "char") == 0) return EIMIL_TYPE_CHAR;
    else if (strcmp(name, "mtext") == 0) return EIMIL_TYPE_MTEXT;
    else if (strcmp(name, "event") == 0) return EIMIL_TYPE_EVENT;
    else if (strcmp(name, "prop") == 0) return EIMIL_TYPE_PROP;

    return EIMIL_TYPE_INVALID;
}

Here is the caller graph for this function:

static int PCE_get_type_name ( int  type,
char *  buf,
int  len 
) [static]

Definition at line 1355 of file PCE.c.

{
    char *tn = buf;
    buf[0] = '\0';
    if (type & EIMIL_TYPE_ANY) {
       tn = "any type";
       if (strlen(tn) >= len) return 0;
       strcpy(buf, tn);
       return 1;
    }
    if (type & EIMIL_TYPE_BOOL) {
       tn = "bool";
       len -= strlen(tn);
       if (len <= 0) return 0;
       strcat(buf, tn);
    }
    if (type & EIMIL_TYPE_NUMBER) {
       if (*tn)
           tn = " or number";
       else
           tn = "number";
       len -= strlen(tn);
       if (len <= 0) return 0;
       strcat(buf, tn);
    }
    if (type & EIMIL_TYPE_CHAR) {
       if (*tn)
           tn = " or char";
       else
           tn = "char";
       len -= strlen(tn);
       if (len <= 0) return 0;
       strcat(buf, tn);
    }
    if (type & EIMIL_TYPE_MTEXT) {
       if (*tn)
           tn = " or mtext";
       else
           tn = "mtext";
       len -= strlen(tn);
       if (len <= 0) return 0;
       strcat(buf, tn);
    }
    if (type & EIMIL_TYPE_EVENT) {
       if (*tn)
           tn = " or event";
       else
           tn = "event";
       len -= strlen(tn);
       if (len <= 0) return 0;
       strcat(buf, tn);
    }
    if (type & EIMIL_TYPE_PROP) {
       if (*tn)
           tn = " or prop";
       else
           tn = "prop";
       len -= strlen(tn);
       if (len <= 0) return 0;
       strcat(buf, tn);
    }
    if (type & EIMIL_TYPE_NIL) {
       if (*tn)
           tn = " or nil";
       else
           tn = "nil";
       len -= strlen(tn);
       if (len <= 0) return 0;
       strcat(buf, tn);
    }

    return 1;
}

Here is the caller graph for this function:

static enum PCE_VAL_TYPE PCE_get_val_type_attribute ( EIMIL_data ped,
EIMIL_attrs patr 
) [static]

Definition at line 2239 of file PCE.c.

{
    for (; patr->name; patr++) {
       if (strcmp(patr->name, "val") == 0) {
           enum PCE_VAL_TYPE vt;
           UTF8 *val;

           if (!EIMIL_get_attr_nmtoken(patr->val, &val)) {
              EIMIL_set_error_pt(ped, NULL, "Unrecogized keyword in `val'");
              return PCE_VAL_TYPE_INVALID;
           }
           if (strcmp(val, "const") == 0) {
              vt = PCE_VAL_TYPE_CONST;
           } else if (strcmp(val, "nil") == 0) {
              vt = PCE_VAL_TYPE_NIL;
           } else if (strcmp(val, "init") == 0) {
              vt = PCE_VAL_TYPE_INIT;
           } else {
              vt = PCE_VAL_TYPE_INVALID;
           }
           free(val);
           return vt;
       }
    }
    return PCE_VAL_TYPE_INVALID;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_symbol* PCE_get_variable ( EIMIL_data ped,
PCE_parse_context pcx,
UTF8 varname 
) [static]

Definition at line 1066 of file PCE.c.

{
    EIMIL_symbol *psym;

    psym = PCE_intern_soft_for_parser(pcx, varname);
    if (!psym) {
       PCE_set_error(ped, PCE_PARSE_UNKNOWN_SYMBOL_ERROR);
       return NULL;
    }
    if (psym->cat != EIMIL_CAT_VARIABLE) {
       PCE_set_error(ped, PCE_NOT_VARIABLE_ERROR);
       return NULL;
    }
    return psym;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void* PCE_handler ( enum EIMIL_ENGINE_COMMAND  m,
EIMIL_data ped,
void *  class_private,
void *  handle_private 
) [static]

Definition at line 3432 of file PCE.c.

{
    PCE_data *pd = (PCE_data*) class_private;
    PCE_context *ph = (PCE_context*) handle_private;

    switch (m) {
      case EIMIL_ENGINE_INSTANCIATE:
       pd = (PCE_data*) malloc(sizeof(PCE_data));
       if (!pd) return NULL;
       memset(pd, 0, sizeof(*pd));
       return pd;
       
      case EIMIL_ENGINE_DUPLICATE:
       if (!ph) {
          ph = (PCE_context*) malloc(sizeof(PCE_context));
          if (!ph) return NULL;
          memset(ph, 0, sizeof(PCE_context));
          ph->ped = ped;
          PCE_new_dictionary(ped, ph);
          ph->ppce_data = pd;
          if (!ph->pdic) {
              free(ph);
              return NULL;
          }
          return ph;
       } else {
          PCE_context *pnh;
          pnh = (PCE_context*) malloc(sizeof(PCE_context));
          if (!pnh) return NULL;
          memset(pnh, 0, sizeof(PCE_context));
          pnh->ped = ped;
          pnh->pdic = EIMIL_duplicate_dictionary(ph->pdic);
          pnh->ppce_data = ph->ppce_data;
          if (!pnh->pdic) {
              free(pnh);
              return NULL;
          }
          return pnh;
       }

      case EIMIL_ENGINE_DESTRUCT:
       PCE_destruct_context(ph);
       return NULL;
       
      case EIMIL_ENGINE_UNINSTANCIATE:
       PCE_destruct_data(pd);
       return NULL;
    }

    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int PCE_init ( )

Definition at line 4908 of file PCE.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void PCE_init_document_template ( ) [static]

Definition at line 4887 of file PCE.c.

Here is the caller graph for this function:

static enum PCE_ERROR_CODE PCE_initialize_labels ( PCE_parse_context pcx) [static]

Definition at line 1563 of file PCE.c.

{
    PCE_labelset *pls;
    pls = (PCE_labelset*) malloc(sizeof(PCE_labelset));
    if (!pls) return PCE_MEMORY_ERROR;
    memset(pls, 0, sizeof(*pls));
    pcx->plabels = pls;
    pls->pdic = EIMIL_new_dictionary(7, 0);
    if (!pls->pdic) {
       free(pls);
       return PCE_MEMORY_ERROR;
    }
    return PCE_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PCE_code* PCE_insert_head_code ( PCE_code pc,
PCE_code pc_ins,
int  first_argp 
) [static]

Definition at line 1996 of file PCE.c.

{
    PCE_code *pc2, *pc_end, *pc_prevend;

    pc_end = pc_prevend = NULL;
    for (pc2 = pc; pc2; pc2 = pc2->pnext) {
       pc_prevend = pc_end;
       pc_end = pc2;
    }

    if (first_argp) {
       ASSERT(pc_end);
       pc_ins->parg = pc_end;
       if (pc_prevend)      pc_prevend->pnext = pc_ins;
       pc_ins->parg->pnext = NULL;
    } else {
       if (pc_end)
           pc_end->pnext = pc_ins;
       else
           return pc_ins;
    }

    return pc;
}

Here is the caller graph for this function:

static EIMIL_symbol* PCE_intern_soft ( PCE_context pctx,
unsigned char *  name 
) [static]

Definition at line 1008 of file PCE.c.

{
    EIMIL_symbol *psym;

    psym = EIMIL_intern_soft(pctx->pdic, name);
    if (!psym) {
       psym = EIMIL_intern_soft(pctx->ped->pdic, name);
    }
    return psym;
}

Here is the call graph for this function:

static EIMIL_symbol* PCE_intern_soft_for_parser ( PCE_parse_context pcx,
unsigned char *  name 
) [static]

Definition at line 1023 of file PCE.c.

{
    EIMIL_symbol *psym;
    PCE_context *pctx = pcx->pctx;

    if (pcx->pdic)
       psym = EIMIL_intern_soft(pcx->pdic, name);
    else
       psym = NULL;
    if (!psym) {
       psym = EIMIL_intern_soft(pctx->pdic, name);
       if (!psym) {
           psym = EIMIL_intern_soft(pctx->ped->pdic, name);
       }
    }
    return psym;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PCE_lookup_named_label ( PCE_parse_context pcx,
UTF8 name 
) [static]

Definition at line 1637 of file PCE.c.

{
    int id;
    EIMIL_symbol *psym;
    PCE_labelset *pls = pcx->plabels;

    id = PCE_make_label(pcx);

    psym = EIMIL_intern_soft(pls->pdic, name);
    if (!psym) return -1;

    return psym->obj.opt.optnum1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static EIMIL_symbol* PCE_lookup_symbol ( PCE_context pctx,
PCE_code pc 
) [static]

Definition at line 1251 of file PCE.c.

{
    EIMIL_symbol *psym;
    ASSERT((pc->type & PCE_CODE_SYMBOL) || (pc->type & PCE_CODE_DEFUN));

    if (pctx->pdic_f) {
       psym = EIMIL_lookup_symbol_internal(pctx->pdic_f, pc->val.symid);
       if (psym) return psym;
    }

    psym = EIMIL_lookup_symbol_internal(pctx->pdic, pc->val.symid);
    if (psym) return psym;

    psym = EIMIL_lookup_symbol_internal(pctx->ped->pdic, pc->val.symid);
    return psym;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PCE_make_label ( PCE_parse_context pcx) [static]

Definition at line 1581 of file PCE.c.

{
    PCE_labelset *pls = pcx->plabels;
    PCE_label *pl;

    if (pls->allocednum <= pls->labelnum) {
       int newsize;
       if (pls->allocednum == 0) {
           newsize = PCE_LABEL_INITIALI_ALLOC_SIZE;
       } else {
           newsize = pls->allocednum * 2;
       }
       pl = (PCE_label*) realloc(pls->pl, sizeof(PCE_label) * newsize);
       if (!pl) return -1;
       pls->allocednum = newsize;
       pls->pl = pl;
    }

    pl = pls->pl + pls->labelnum;
    pl->id = pls->labelnum;
    pl->pc = NULL;
    pl->psym = NULL;
    pls->labelnum++;

    return pl->id;
}

Here is the caller graph for this function:

static int PCE_make_named_label ( EIMIL_data ped,
PCE_parse_context pcx,
UTF8 name 
) [static]

Definition at line 1611 of file PCE.c.

{
    int id;
    EIMIL_symbol *psym;
    PCE_labelset *pls = pcx->plabels;
    PCE_label *pl;

    id = PCE_make_label(pcx);
    if (id < 0) return id;
    pl = pls->pl + id;

    psym = EIMIL_register_symbol(ped, pls->pdic, name,
                             EIMIL_CAT_OPTIONAL,
                             EIMIL_TYPE_NONE);
    if (!psym) return -1;
    psym->obj.opt.optnum1 = id;
    pl->psym = psym;

    return id;
}

Here is the call graph for this function:

Here is the caller graph for this function:

<