Commit 6cb06ace authored by David Gobbi's avatar David Gobbi
Browse files

Ignore more typedefs for anonymous structs.

This is for code where the typedef modifier does not come first, e.g.
    struct { ... } typedef mytype;
It causes such typefs to be ignored because vtkParse.y is currently
unable to properly deal with anonymous structs.  Note that the more
common "typedef struct { ... } mytype;" is already treated the same.
parent 530e3b55
......@@ -57,7 +57,7 @@
This file must be translated to C and modified to build everywhere.
Run bison like this:
Run bison like this (use bison 3.0.2 or later)
bison --no-lines -b vtkParse vtkParse.y
......@@ -66,7 +66,7 @@ Modify vtkParse.tab.c:
- replace all instances of "static inline" with "static"
- replace "#if ! defined lint || defined __GNUC__" with "#if 1"
- remove YY_ATTRIBUTE_UNUSED from yyfillin, yyfill, and yynormal
- remove the "break;" after return "return yyreportAmbiguity"
- remove the "break;" after "return yyreportAmbiguity"
- replace "(1-yyrhslen)" with "(1-(int)yyrhslen)"
*/
......@@ -1719,50 +1719,50 @@ static const unsigned short int yyrline[] =
2116, 2117, 2121, 2120, 2133, 2134, 2133, 2153, 2153, 2157,
2158, 2161, 2162, 2165, 2171, 2172, 2172, 2175, 2176, 2176,
2178, 2180, 2184, 2186, 2184, 2210, 2211, 2214, 2214, 2216,
2216, 2224, 2227, 2286, 2287, 2289, 2290, 2290, 2293, 2296,
2297, 2301, 2312, 2312, 2331, 2333, 2333, 2351, 2351, 2353,
2357, 2358, 2359, 2358, 2364, 2366, 2367, 2368, 2369, 2370,
2371, 2374, 2375, 2379, 2380, 2384, 2385, 2388, 2389, 2393,
2394, 2395, 2398, 2399, 2402, 2402, 2405, 2406, 2409, 2409,
2413, 2414, 2414, 2421, 2422, 2425, 2426, 2427, 2428, 2429,
2432, 2434, 2436, 2440, 2442, 2444, 2446, 2448, 2450, 2452,
2452, 2457, 2460, 2463, 2466, 2466, 2474, 2474, 2483, 2484,
2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494,
2495, 2496, 2497, 2498, 2499, 2500, 2501, 2502, 2503, 2510,
2511, 2512, 2513, 2514, 2515, 2516, 2522, 2523, 2526, 2527,
2529, 2530, 2533, 2534, 2537, 2538, 2539, 2540, 2543, 2544,
2545, 2546, 2547, 2551, 2552, 2553, 2556, 2557, 2560, 2561,
2569, 2572, 2572, 2574, 2574, 2578, 2579, 2581, 2585, 2586,
2588, 2588, 2590, 2592, 2596, 2599, 2599, 2601, 2601, 2605,
2608, 2608, 2610, 2610, 2614, 2615, 2617, 2619, 2621, 2623,
2625, 2629, 2630, 2633, 2634, 2635, 2636, 2637, 2638, 2639,
2640, 2641, 2642, 2643, 2644, 2645, 2646, 2647, 2648, 2649,
2650, 2651, 2652, 2653, 2656, 2657, 2658, 2659, 2660, 2661,
2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2690,
2691, 2692, 2693, 2696, 2700, 2704, 2704, 2708, 2709, 2724,
2725, 2741, 2742, 2745, 2745, 2745, 2752, 2752, 2762, 2763,
2763, 2762, 2772, 2772, 2782, 2782, 2791, 2791, 2791, 2824,
2823, 2834, 2835, 2835, 2834, 2844, 2862, 2862, 2867, 2867,
2872, 2872, 2877, 2877, 2882, 2882, 2887, 2887, 2892, 2892,
2897, 2897, 2902, 2902, 2919, 2919, 2933, 2970, 3008, 3045,
3046, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061,
3062, 3063, 3064, 3067, 3068, 3069, 3070, 3071, 3072, 3073,
3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083,
3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093,
3094, 3095, 3096, 3097, 3098, 3099, 3100, 3103, 3104, 3105,
3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115,
3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125,
3126, 3127, 3128, 3129, 3130, 3131, 3134, 3135, 3136, 3137,
3138, 3139, 3140, 3141, 3148, 3149, 3152, 3153, 3154, 3155,
3155, 3156, 3159, 3160, 3163, 3164, 3165, 3166, 3196, 3196,
3197, 3198, 3199, 3200, 3223, 3224, 3227, 3228, 3229, 3230,
3233, 3234, 3235, 3238, 3239, 3241, 3242, 3244, 3245, 3248,
3249, 3252, 3253, 3254, 3258, 3257, 3271, 3272, 3275, 3275,
3277, 3277, 3281, 3281, 3283, 3283, 3285, 3285, 3289, 3289,
3294, 3295, 3297, 3298, 3301, 3302, 3305, 3306, 3309, 3310,
3311, 3312, 3313, 3314, 3315, 3316, 3316, 3316, 3316, 3316,
3317, 3318, 3319, 3320, 3321, 3324, 3327, 3328, 3331, 3334,
3334, 3334
2216, 2224, 2227, 2290, 2291, 2293, 2294, 2294, 2297, 2300,
2301, 2305, 2316, 2316, 2335, 2337, 2337, 2355, 2355, 2357,
2361, 2362, 2363, 2362, 2368, 2370, 2371, 2372, 2373, 2374,
2375, 2378, 2379, 2383, 2384, 2388, 2389, 2392, 2393, 2397,
2398, 2399, 2402, 2403, 2406, 2406, 2409, 2410, 2413, 2413,
2417, 2418, 2418, 2425, 2426, 2429, 2430, 2431, 2432, 2433,
2436, 2438, 2440, 2444, 2446, 2448, 2450, 2452, 2454, 2456,
2456, 2461, 2464, 2467, 2470, 2470, 2478, 2478, 2487, 2488,
2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498,
2499, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2514,
2515, 2516, 2517, 2518, 2519, 2520, 2526, 2527, 2530, 2531,
2533, 2534, 2537, 2538, 2541, 2542, 2543, 2544, 2547, 2548,
2549, 2550, 2551, 2555, 2556, 2557, 2560, 2561, 2564, 2565,
2573, 2576, 2576, 2578, 2578, 2582, 2583, 2585, 2589, 2590,
2592, 2592, 2594, 2596, 2600, 2603, 2603, 2605, 2605, 2609,
2612, 2612, 2614, 2614, 2618, 2619, 2621, 2623, 2625, 2627,
2629, 2633, 2634, 2637, 2638, 2639, 2640, 2641, 2642, 2643,
2644, 2645, 2646, 2647, 2648, 2649, 2650, 2651, 2652, 2653,
2654, 2655, 2656, 2657, 2660, 2661, 2662, 2663, 2664, 2665,
2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2694,
2695, 2696, 2697, 2700, 2704, 2708, 2708, 2712, 2713, 2728,
2729, 2745, 2746, 2749, 2749, 2749, 2756, 2756, 2766, 2767,
2767, 2766, 2776, 2776, 2786, 2786, 2795, 2795, 2795, 2828,
2827, 2838, 2839, 2839, 2838, 2848, 2866, 2866, 2871, 2871,
2876, 2876, 2881, 2881, 2886, 2886, 2891, 2891, 2896, 2896,
2901, 2901, 2906, 2906, 2923, 2923, 2937, 2974, 3012, 3049,
3050, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065,
3066, 3067, 3068, 3071, 3072, 3073, 3074, 3075, 3076, 3077,
3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087,
3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 3097,
3098, 3099, 3100, 3101, 3102, 3103, 3104, 3107, 3108, 3109,
3110, 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119,
3120, 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129,
3130, 3131, 3132, 3133, 3134, 3135, 3138, 3139, 3140, 3141,
3142, 3143, 3144, 3145, 3152, 3153, 3156, 3157, 3158, 3159,
3159, 3160, 3163, 3164, 3167, 3168, 3169, 3170, 3200, 3200,
3201, 3202, 3203, 3204, 3227, 3228, 3231, 3232, 3233, 3234,
3237, 3238, 3239, 3242, 3243, 3245, 3246, 3248, 3249, 3252,
3253, 3256, 3257, 3258, 3262, 3261, 3275, 3276, 3279, 3279,
3281, 3281, 3285, 3285, 3287, 3287, 3289, 3289, 3293, 3293,
3298, 3299, 3301, 3302, 3305, 3306, 3309, 3310, 3313, 3314,
3315, 3316, 3317, 3318, 3319, 3320, 3320, 3320, 3320, 3320,
3321, 3322, 3323, 3324, 3325, 3328, 3331, 3332, 3335, 3338,
3338, 3338
};
#endif
......@@ -6832,7 +6832,11 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp,
if ((type & VTK_PARSE_TYPEDEF) != 0)
{
var->ItemType = VTK_TYPEDEF_INFO;
if (currentClass)
if (var->Class == NULL)
{
vtkParse_FreeValue(var);
}
else if (currentClass)
{
vtkParse_AddTypedefToClass(currentClass, var);
}
......
......@@ -2245,7 +2245,11 @@ init_declarator_id:
if ((type & VTK_PARSE_TYPEDEF) != 0)
{
var->ItemType = VTK_TYPEDEF_INFO;
if (currentClass)
if (var->Class == NULL)
{
vtkParse_FreeValue(var);
}
else if (currentClass)
{
vtkParse_AddTypedefToClass(currentClass, var);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment