
/**
 * This file was automatically generated by running the './srcutil/method_dispatch.pl'
 * script. Do not modify this file directly.
 *
 * There are various macros in this header and they can be
 * enabled within various sections of code by doing the following
 * 
 * #define PLTUBA_METGHV_STRUCT
 * #include "this_header_name"
 * #undef PLTUBA_METHGV_STRUCT
 *
 * which will paste the definition of the methgv struct
 */

/** Structure defining GVs for all our callback methods */
#ifdef PLTUBA_METHGV_STRUCT
struct {
    GV* on_string;
    GV* on_key;
    GV* on_number;
    GV* on_object;
    GV* on_list;
    GV* on_data;
    GV* on_json;
    GV* on_special;
    GV* on_boolean;
    GV* on_null;
    GV* on_any;
    GV* start_string;
    GV* start_key;
    GV* start_number;
    GV* start_object;
    GV* start_list;
    GV* start_data;
    GV* start_json;
    GV* start_special;
    GV* start_boolean;
    GV* start_null;
    GV* start_any;
    GV* end_string;
    GV* end_key;
    GV* end_number;
    GV* end_object;
    GV* end_list;
    GV* end_data;
    GV* end_json;
    GV* end_special;
    GV* end_boolean;
    GV* end_null;
    GV* end_any;
} methgv;

#endif /* PLTUBA_METHGV_STRUCT */

/** X-Macro for method names */
#ifdef PLTUBA_DEFINE_XMETHGV
#define PLTUBA_XMETHGV \
X(on, string) \
X(on, key) \
X(on, number) \
X(on, object) \
X(on, list) \
X(on, data) \
X(on, json) \
X(on, special) \
X(on, boolean) \
X(on, null) \
X(on, any) \
X(start, string) \
X(start, key) \
X(start, number) \
X(start, object) \
X(start, list) \
X(start, data) \
X(start, json) \
X(start, special) \
X(start, boolean) \
X(start, null) \
X(start, any) \
X(end, string) \
X(end, key) \
X(end, number) \
X(end, object) \
X(end, list) \
X(end, data) \
X(end, json) \
X(end, special) \
X(end, boolean) \
X(end, null) \
X(end, any) \

#endif /* PLTUBA_DEFINE_XMETHGV */

/**
 * This generates a large switch statement which will
 * return the proper method name and the pointer to the GV
 * slot in the methgv structure
 */
#ifdef PLTUBA_METH_GETMETH
switch(action) {
    
/* on */
case '>': {
    switch(cbtype) {
    case '"':
        /* string */
        methname = "on_string";
        methgvp = &tuba->methgv.on_string;
        break;
    case '#':
        /* key */
        methname = "on_key";
        methgvp = &tuba->methgv.on_key;
        break;
    case '=':
        /* number */
        methname = "on_number";
        methgvp = &tuba->methgv.on_number;
        break;
    case '{':
        /* object */
        methname = "on_object";
        methgvp = &tuba->methgv.on_object;
        break;
    case '[':
        /* list */
        methname = "on_list";
        methgvp = &tuba->methgv.on_list;
        break;
    case 'c':
        /* data */
        methname = "on_data";
        methgvp = &tuba->methgv.on_data;
        break;
    case 'D':
        /* json */
        methname = "on_json";
        methgvp = &tuba->methgv.on_json;
        break;
    case '^':
        /* special */
        methname = "on_special";
        methgvp = &tuba->methgv.on_special;
        break;
    case '?':
        /* boolean */
        methname = "on_boolean";
        methgvp = &tuba->methgv.on_boolean;
        break;
    case '~':
        /* null */
        methname = "on_null";
        methgvp = &tuba->methgv.on_null;
        break;
    case '.':
        /* any */
        methname = "on_any";
        methgvp = &tuba->methgv.on_any;
        break;
    default:
        break;
    }
    break;
    }
    
/* start */
case '+': {
    switch(cbtype) {
    case '"':
        /* string */
        methname = "start_string";
        methgvp = &tuba->methgv.start_string;
        break;
    case '#':
        /* key */
        methname = "start_key";
        methgvp = &tuba->methgv.start_key;
        break;
    case '=':
        /* number */
        methname = "start_number";
        methgvp = &tuba->methgv.start_number;
        break;
    case '{':
        /* object */
        methname = "start_object";
        methgvp = &tuba->methgv.start_object;
        break;
    case '[':
        /* list */
        methname = "start_list";
        methgvp = &tuba->methgv.start_list;
        break;
    case 'c':
        /* data */
        methname = "start_data";
        methgvp = &tuba->methgv.start_data;
        break;
    case 'D':
        /* json */
        methname = "start_json";
        methgvp = &tuba->methgv.start_json;
        break;
    case '^':
        /* special */
        methname = "start_special";
        methgvp = &tuba->methgv.start_special;
        break;
    case '?':
        /* boolean */
        methname = "start_boolean";
        methgvp = &tuba->methgv.start_boolean;
        break;
    case '~':
        /* null */
        methname = "start_null";
        methgvp = &tuba->methgv.start_null;
        break;
    case '.':
        /* any */
        methname = "start_any";
        methgvp = &tuba->methgv.start_any;
        break;
    default:
        break;
    }
    break;
    }
    
/* end */
case '-': {
    switch(cbtype) {
    case '"':
        /* string */
        methname = "end_string";
        methgvp = &tuba->methgv.end_string;
        break;
    case '#':
        /* key */
        methname = "end_key";
        methgvp = &tuba->methgv.end_key;
        break;
    case '=':
        /* number */
        methname = "end_number";
        methgvp = &tuba->methgv.end_number;
        break;
    case '{':
        /* object */
        methname = "end_object";
        methgvp = &tuba->methgv.end_object;
        break;
    case '[':
        /* list */
        methname = "end_list";
        methgvp = &tuba->methgv.end_list;
        break;
    case 'c':
        /* data */
        methname = "end_data";
        methgvp = &tuba->methgv.end_data;
        break;
    case 'D':
        /* json */
        methname = "end_json";
        methgvp = &tuba->methgv.end_json;
        break;
    case '^':
        /* special */
        methname = "end_special";
        methgvp = &tuba->methgv.end_special;
        break;
    case '?':
        /* boolean */
        methname = "end_boolean";
        methgvp = &tuba->methgv.end_boolean;
        break;
    case '~':
        /* null */
        methname = "end_null";
        methgvp = &tuba->methgv.end_null;
        break;
    case '.':
        /* any */
        methname = "end_any";
        methgvp = &tuba->methgv.end_any;
        break;
    default:
        break;
    }
    break;
    }
default:
    methname = NULL;
    methgvp = NULL;
    break;
}

#endif /* PLTUBA_METH_GETMETH */
