diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index 1fd0d9817f7e698a7fef7e16cbd903cebb17229d..3e34dd2dfb918275fcdce4824028854496629a5e 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -1,173 +1,174 @@ /* A Bison parser, made from Gmsh.y - by GNU Bison version 1.28 */ + by GNU Bison version 1.25 + */ #define YYBISON 1 /* Identify Bison output. */ -#define tDOUBLE 257 -#define tSTRING 258 -#define tBIGSTR 259 -#define tEND 260 -#define tAFFECT 261 -#define tDOTS 262 -#define tPi 263 -#define tExp 264 -#define tLog 265 -#define tLog10 266 -#define tSqrt 267 -#define tSin 268 -#define tAsin 269 -#define tCos 270 -#define tAcos 271 -#define tTan 272 -#define tRand 273 -#define tAtan 274 -#define tAtan2 275 -#define tSinh 276 -#define tCosh 277 -#define tTanh 278 -#define tFabs 279 -#define tFloor 280 -#define tCeil 281 -#define tFmod 282 -#define tModulo 283 -#define tHypot 284 -#define tPrintf 285 -#define tSprintf 286 -#define tDraw 287 -#define tPoint 288 -#define tCircle 289 -#define tEllipsis 290 -#define tLine 291 -#define tSurface 292 -#define tSpline 293 -#define tVolume 294 -#define tCharacteristic 295 -#define tLength 296 -#define tParametric 297 -#define tElliptic 298 -#define tPlane 299 -#define tRuled 300 -#define tTransfinite 301 -#define tComplex 302 -#define tPhysical 303 -#define tUsing 304 -#define tBump 305 -#define tProgression 306 -#define tRotate 307 -#define tTranslate 308 -#define tSymmetry 309 -#define tDilate 310 -#define tExtrude 311 -#define tDuplicata 312 -#define tLoop 313 -#define tRecombine 314 -#define tDelete 315 -#define tCoherence 316 -#define tIntersect 317 -#define tView 318 -#define tAttractor 319 -#define tLayers 320 -#define tScalarTetrahedron 321 -#define tVectorTetrahedron 322 -#define tTensorTetrahedron 323 -#define tScalarTriangle 324 -#define tVectorTriangle 325 -#define tTensorTriangle 326 -#define tScalarLine 327 -#define tVectorLine 328 -#define tTensorLine 329 -#define tScalarPoint 330 -#define tVectorPoint 331 -#define tTensorPoint 332 -#define tBSpline 333 -#define tNurbs 334 -#define tOrder 335 -#define tWith 336 -#define tBounds 337 -#define tKnots 338 -#define tColor 339 -#define tFor 340 -#define tIn 341 -#define tEndFor 342 -#define tIf 343 -#define tEndIf 344 -#define tExit 345 -#define tReturn 346 -#define tCall 347 -#define tFunction 348 -#define tMesh 349 -#define tB_SPLINE_SURFACE_WITH_KNOTS 350 -#define tB_SPLINE_CURVE_WITH_KNOTS 351 -#define tCARTESIAN_POINT 352 -#define tTRUE 353 -#define tFALSE 354 -#define tUNSPECIFIED 355 -#define tU 356 -#define tV 357 -#define tEDGE_CURVE 358 -#define tVERTEX_POINT 359 -#define tORIENTED_EDGE 360 -#define tPLANE 361 -#define tFACE_OUTER_BOUND 362 -#define tEDGE_LOOP 363 -#define tADVANCED_FACE 364 -#define tVECTOR 365 -#define tDIRECTION 366 -#define tAXIS2_PLACEMENT_3D 367 -#define tISO 368 -#define tENDISO 369 -#define tENDSEC 370 -#define tDATA 371 -#define tHEADER 372 -#define tFILE_DESCRIPTION 373 -#define tFILE_SCHEMA 374 -#define tFILE_NAME 375 -#define tMANIFOLD_SOLID_BREP 376 -#define tCLOSED_SHELL 377 -#define tADVANCED_BREP_SHAPE_REPRESENTATION 378 -#define tFACE_BOUND 379 -#define tCYLINDRICAL_SURFACE 380 -#define tCONICAL_SURFACE 381 -#define tCIRCLE 382 -#define tTRIMMED_CURVE 383 -#define tGEOMETRIC_SET 384 -#define tCOMPOSITE_CURVE_SEGMENT 385 -#define tCONTINUOUS 386 -#define tCOMPOSITE_CURVE 387 -#define tTOROIDAL_SURFACE 388 -#define tPRODUCT_DEFINITION 389 -#define tPRODUCT_DEFINITION_SHAPE 390 -#define tSHAPE_DEFINITION_REPRESENTATION 391 -#define tELLIPSE 392 -#define tTrimmed 393 -#define tSolid 394 -#define tEndSolid 395 -#define tVertex 396 -#define tFacet 397 -#define tNormal 398 -#define tOuter 399 -#define tLoopSTL 400 -#define tEndLoop 401 -#define tEndFacet 402 -#define tAFFECTPLUS 403 -#define tAFFECTMINUS 404 -#define tAFFECTTIMES 405 -#define tAFFECTDIVIDE 406 -#define tOR 407 -#define tAND 408 -#define tEQUAL 409 -#define tNOTEQUAL 410 -#define tAPPROXEQUAL 411 -#define tLESSOREQUAL 412 -#define tGREATEROREQUAL 413 -#define tCROSSPRODUCT 414 -#define tPLUSPLUS 415 -#define tMINUSMINUS 416 -#define UNARYPREC 417 +#define tDOUBLE 258 +#define tSTRING 259 +#define tBIGSTR 260 +#define tEND 261 +#define tAFFECT 262 +#define tDOTS 263 +#define tPi 264 +#define tExp 265 +#define tLog 266 +#define tLog10 267 +#define tSqrt 268 +#define tSin 269 +#define tAsin 270 +#define tCos 271 +#define tAcos 272 +#define tTan 273 +#define tRand 274 +#define tAtan 275 +#define tAtan2 276 +#define tSinh 277 +#define tCosh 278 +#define tTanh 279 +#define tFabs 280 +#define tFloor 281 +#define tCeil 282 +#define tFmod 283 +#define tModulo 284 +#define tHypot 285 +#define tPrintf 286 +#define tSprintf 287 +#define tDraw 288 +#define tPoint 289 +#define tCircle 290 +#define tEllipsis 291 +#define tLine 292 +#define tSurface 293 +#define tSpline 294 +#define tVolume 295 +#define tCharacteristic 296 +#define tLength 297 +#define tParametric 298 +#define tElliptic 299 +#define tPlane 300 +#define tRuled 301 +#define tTransfinite 302 +#define tComplex 303 +#define tPhysical 304 +#define tUsing 305 +#define tBump 306 +#define tProgression 307 +#define tRotate 308 +#define tTranslate 309 +#define tSymmetry 310 +#define tDilate 311 +#define tExtrude 312 +#define tDuplicata 313 +#define tLoop 314 +#define tRecombine 315 +#define tDelete 316 +#define tCoherence 317 +#define tIntersect 318 +#define tView 319 +#define tAttractor 320 +#define tLayers 321 +#define tScalarTetrahedron 322 +#define tVectorTetrahedron 323 +#define tTensorTetrahedron 324 +#define tScalarTriangle 325 +#define tVectorTriangle 326 +#define tTensorTriangle 327 +#define tScalarLine 328 +#define tVectorLine 329 +#define tTensorLine 330 +#define tScalarPoint 331 +#define tVectorPoint 332 +#define tTensorPoint 333 +#define tBSpline 334 +#define tNurbs 335 +#define tOrder 336 +#define tWith 337 +#define tBounds 338 +#define tKnots 339 +#define tColor 340 +#define tFor 341 +#define tIn 342 +#define tEndFor 343 +#define tIf 344 +#define tEndIf 345 +#define tExit 346 +#define tReturn 347 +#define tCall 348 +#define tFunction 349 +#define tMesh 350 +#define tB_SPLINE_SURFACE_WITH_KNOTS 351 +#define tB_SPLINE_CURVE_WITH_KNOTS 352 +#define tCARTESIAN_POINT 353 +#define tTRUE 354 +#define tFALSE 355 +#define tUNSPECIFIED 356 +#define tU 357 +#define tV 358 +#define tEDGE_CURVE 359 +#define tVERTEX_POINT 360 +#define tORIENTED_EDGE 361 +#define tPLANE 362 +#define tFACE_OUTER_BOUND 363 +#define tEDGE_LOOP 364 +#define tADVANCED_FACE 365 +#define tVECTOR 366 +#define tDIRECTION 367 +#define tAXIS2_PLACEMENT_3D 368 +#define tISO 369 +#define tENDISO 370 +#define tENDSEC 371 +#define tDATA 372 +#define tHEADER 373 +#define tFILE_DESCRIPTION 374 +#define tFILE_SCHEMA 375 +#define tFILE_NAME 376 +#define tMANIFOLD_SOLID_BREP 377 +#define tCLOSED_SHELL 378 +#define tADVANCED_BREP_SHAPE_REPRESENTATION 379 +#define tFACE_BOUND 380 +#define tCYLINDRICAL_SURFACE 381 +#define tCONICAL_SURFACE 382 +#define tCIRCLE 383 +#define tTRIMMED_CURVE 384 +#define tGEOMETRIC_SET 385 +#define tCOMPOSITE_CURVE_SEGMENT 386 +#define tCONTINUOUS 387 +#define tCOMPOSITE_CURVE 388 +#define tTOROIDAL_SURFACE 389 +#define tPRODUCT_DEFINITION 390 +#define tPRODUCT_DEFINITION_SHAPE 391 +#define tSHAPE_DEFINITION_REPRESENTATION 392 +#define tELLIPSE 393 +#define tTrimmed 394 +#define tSolid 395 +#define tEndSolid 396 +#define tVertex 397 +#define tFacet 398 +#define tNormal 399 +#define tOuter 400 +#define tLoopSTL 401 +#define tEndLoop 402 +#define tEndFacet 403 +#define tAFFECTPLUS 404 +#define tAFFECTMINUS 405 +#define tAFFECTTIMES 406 +#define tAFFECTDIVIDE 407 +#define tOR 408 +#define tAND 409 +#define tEQUAL 410 +#define tNOTEQUAL 411 +#define tAPPROXEQUAL 412 +#define tLESSOREQUAL 413 +#define tGREATEROREQUAL 414 +#define tCROSSPRODUCT 415 +#define tPLUSPLUS 416 +#define tMINUSMINUS 417 +#define UNARYPREC 418 #line 1 "Gmsh.y" - /* $Id: Gmsh.tab.cpp,v 1.49 2000-12-17 21:17:29 remacle Exp $ */ + /* $Id: Gmsh.tab.cpp,v 1.50 2000-12-18 08:32:08 geuzaine Exp $ */ #include <stdarg.h> @@ -253,7 +254,7 @@ typedef union { #define YYFLAG -32768 #define YYNTBASE 182 -#define YYTRANSLATE(x) ((unsigned)(x) <= 417 ? yytranslate[x] : 261) +#define YYTRANSLATE(x) ((unsigned)(x) <= 418 ? yytranslate[x] : 261) static const short yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -281,23 +282,23 @@ static const short yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 154, 155, 156, 157, - 158, 160, 162, 168, 170, 171, 172 + 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 154, 155, 156, + 157, 158, 160, 162, 168, 170, 171, 172 }; #if YYDEBUG != 0 @@ -323,7 +324,7 @@ static const short yyprhs[] = { 0, 1387, 1396, 1419, 1440, 1449, 1458, 1464, 1473, 1481, 1490, 1496, 1508, 1514, 1524, 1526, 1528, 1530, 1531, 1534, 1539, 1544, 1551, 1555, 1559, 1563, 1566, 1569, 1576, 1585, 1594, - 1605, 1607, 1609, 1613, 1616, 1621, 1623, 1632, 1645, 1654, + 1605, 1607, 1610, 1612, 1616, 1621, 1623, 1632, 1645, 1654, 1667, 1676, 1689, 1701, 1717, 1719, 1722, 1732, 1735, 1742, 1752, 1762, 1771, 1780, 1789, 1796, 1801, 1804, 1807, 1809, 1812, 1814, 1816, 1818, 1820, 1822, 1824, 1828, 1831, 1834, @@ -500,8 +501,8 @@ static const short yyrhs[] = { 184, 246, 8, 246, 175, 0, 86, 174, 246, 8, 246, 8, 246, 175, 0, 86, 4, 87, 180, 246, 8, 246, 181, 0, 86, 4, 87, 180, 246, 8, 246, - 8, 246, 181, 0, 88, 0, 92, 0, 93, 4, - 6, 0, 94, 4, 0, 89, 174, 246, 175, 0, + 8, 246, 181, 0, 88, 0, 94, 4, 0, 92, + 0, 93, 4, 6, 0, 89, 174, 246, 175, 0, 90, 0, 57, 34, 180, 246, 179, 249, 181, 6, 0, 57, 34, 180, 246, 179, 249, 179, 249, 179, 246, 181, 6, 0, 57, 37, 180, 246, 179, 249, @@ -595,20 +596,20 @@ static const short yyrline[] = { 0, 1431, 1452, 1460, 1466, 1472, 1478, 1490, 1496, 1502, 1514, 1520, 1525, 1530, 1537, 1539, 1540, 1543, 1548, 1559, 1577, 1585, 1589, 1600, 1672, 1692, 1696, 1715, 1731, 1745, 1770, - 1795, 1821, 1826, 1831, 1838, 1842, 1852, 1858, 1864, 1868, - 1872, 1876, 1880, 1885, 1892, 1896, 1901, 1919, 1929, 1947, - 1964, 1981, 2002, 2022, 2042, 2059, 2083, 2088, 2099, 2101, - 2104, 2106, 2107, 2108, 2109, 2112, 2114, 2115, 2116, 2117, - 2118, 2119, 2120, 2121, 2128, 2129, 2130, 2131, 2132, 2133, - 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, - 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, - 2154, 2155, 2156, 2157, 2158, 2159, 2164, 2169, 2173, 2185, - 2203, 2215, 2233, 2245, 2265, 2286, 2310, 2331, 2355, 2376, - 2401, 2408, 2421, 2428, 2432, 2436, 2440, 2445, 2450, 2454, - 2458, 2464, 2468, 2473, 2477, 2482, 2486, 2490, 2496, 2502, - 2508, 2512, 2518, 2533, 2540, 2546, 2555, 2567, 2571, 2579, - 2592, 2597, 2601, 2606, 2611, 2629, 2634, 2655, 2664, 2670, - 2675, 2679 + 1795, 1821, 1827, 1832, 1837, 1841, 1851, 1857, 1863, 1867, + 1871, 1875, 1879, 1884, 1891, 1895, 1900, 1918, 1928, 1946, + 1963, 1980, 2001, 2021, 2041, 2058, 2082, 2087, 2098, 2100, + 2103, 2105, 2106, 2107, 2108, 2111, 2113, 2114, 2115, 2116, + 2117, 2118, 2119, 2120, 2127, 2128, 2129, 2130, 2131, 2132, + 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, + 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, + 2153, 2154, 2155, 2156, 2157, 2158, 2163, 2168, 2172, 2184, + 2202, 2214, 2232, 2244, 2264, 2285, 2309, 2330, 2354, 2375, + 2400, 2407, 2420, 2427, 2431, 2435, 2439, 2444, 2449, 2453, + 2457, 2463, 2467, 2472, 2476, 2481, 2485, 2489, 2495, 2501, + 2507, 2511, 2517, 2532, 2539, 2545, 2554, 2566, 2570, 2578, + 2591, 2596, 2600, 2605, 2610, 2628, 2633, 2654, 2663, 2669, + 2674, 2678 }; #endif @@ -719,7 +720,7 @@ static const short yyr2[] = { 0, 8, 22, 20, 8, 8, 5, 8, 7, 8, 5, 11, 5, 9, 1, 1, 1, 0, 2, 4, 4, 6, 3, 3, 3, 2, 2, 6, 8, 8, 10, - 1, 1, 3, 2, 4, 1, 8, 12, 8, 12, + 1, 2, 1, 3, 4, 1, 8, 12, 8, 12, 8, 12, 11, 15, 1, 2, 9, 2, 6, 9, 9, 8, 8, 8, 6, 4, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, 2, 2, @@ -741,7 +742,7 @@ static const short yydefact[] = { 0, 12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 211, 0, 216, 0, 212, + 0, 0, 0, 0, 0, 211, 0, 216, 0, 213, 0, 0, 0, 52, 54, 53, 55, 56, 57, 58, 59, 64, 63, 60, 61, 62, 239, 0, 0, 0, 13, 14, 16, 15, 17, 312, 312, 0, 287, 289, @@ -754,7 +755,7 @@ static const short yydefact[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 303, 0, 0, 0, 0, 0, 197, 321, 0, 0, 197, 237, 238, 0, 321, 321, 0, 0, - 0, 0, 0, 0, 205, 0, 214, 0, 240, 0, + 0, 0, 0, 0, 205, 0, 212, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -769,7 +770,7 @@ static const short yydefact[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 304, 0, 0, 0, 0, 197, 197, 0, 0, 0, 0, 0, 0, 0, 202, 0, 0, 69, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 213, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2495,8 +2496,7 @@ static const short yycheck[] = { 23, 166, 167, -1, -1, -1, -1, -1, 173, -1, 175 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/lib/bison.simple" -/* This file comes from bison-1.28. */ +#line 3 "/usr/local/share/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -2513,66 +2513,46 @@ static const short yycheck[] = { 23, You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ +#ifndef alloca #ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) #include <alloca.h> #else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ +#if defined (MSDOS) && !defined (__TURBOC__) #include <malloc.h> -#endif #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include <malloc.h> */ +#include <malloc.h> #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca +#else /* not MSDOS, __TURBOC__, or _AIX */ +#ifdef __hpux +#ifdef __cplusplus +extern "C" { +void *alloca (unsigned int); +}; +#else /* not __cplusplus */ +void *alloca (); +#endif /* not __cplusplus */ #endif /* __hpux */ -#endif #endif /* not _AIX */ #endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ +#endif /* not sparc. */ +#endif /* not GNU C. */ +#endif /* alloca not defined. */ -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action @@ -2582,8 +2562,8 @@ static const short yycheck[] = { 23, #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab +#define YYACCEPT return(0) +#define YYABORT return(1) #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the @@ -2664,12 +2644,12 @@ int yydebug; /* nonzero means print parse trace */ #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif - -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +int yyparse (void); +#endif + #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ @@ -2681,7 +2661,7 @@ static void __yy_memcpy (to, from, count) char *to; char *from; - unsigned int count; + int count; { register char *f = from; register char *t = to; @@ -2696,10 +2676,10 @@ __yy_memcpy (to, from, count) /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void -__yy_memcpy (char *to, char *from, unsigned int count) +__yy_memcpy (char *to, char *from, int count) { - register char *t = to; register char *f = from; + register char *t = to; register int i = count; while (i-- > 0) @@ -2709,7 +2689,7 @@ __yy_memcpy (char *to, char *from, unsigned int count) #endif #endif -#line 217 "/usr/lib/bison.simple" +#line 196 "/usr/local/share/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. @@ -2730,15 +2710,6 @@ __yy_memcpy (char *to, char *from, unsigned int count) #define YYPARSE_PARAM_DECL #endif /* not YYPARSE_PARAM */ -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -#ifdef YYPARSE_PARAM -int yyparse (void *); -#else -int yyparse (void); -#endif -#endif - int yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL @@ -2767,7 +2738,6 @@ yyparse(YYPARSE_PARAM_ARG) #endif int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; #ifdef YYPURE int yychar; @@ -2852,32 +2822,18 @@ yynewstate: if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); + yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); + yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); #ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); + yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); #endif #endif /* no yyoverflow */ @@ -4839,46 +4795,45 @@ case 211: case 212: #line 1822 "Gmsh.y" { - if(!FunctionManager::Instance()->leaveFunction(&yyin,yylineno)) - vyyerror("Error while exiting function"); + if(!FunctionManager::Instance()->createFunction(yyvsp[0].c,yyin,yylineno)) + vyyerror("Redefinition of function %s",yyvsp[0].c); + skip_until("Return"); ; break;} case 213: -#line 1827 "Gmsh.y" +#line 1828 "Gmsh.y" { - if(!FunctionManager::Instance()->enterFunction(yyvsp[-1].c,&yyin,yylineno)) - vyyerror("Unknown Function %s",yyvsp[-1].c); + if(!FunctionManager::Instance()->leaveFunction(&yyin,yylineno)) + vyyerror("Error while exiting function"); ; break;} case 214: -#line 1832 "Gmsh.y" +#line 1833 "Gmsh.y" { - // skip everything until return is found - if(!FunctionManager::Instance()->createFunction(yyvsp[0].c,yyin,yylineno)) - vyyerror("Redefinition of function %s",yyvsp[0].c); - skip_until("Return"); + if(!FunctionManager::Instance()->enterFunction(yyvsp[-1].c,&yyin,yylineno)) + vyyerror("Unknown Function %s",yyvsp[-1].c); ; break;} case 215: -#line 1839 "Gmsh.y" +#line 1838 "Gmsh.y" { if(!yyvsp[-1].d) skip_until("EndIf"); ; break;} case 216: -#line 1843 "Gmsh.y" +#line 1842 "Gmsh.y" { ; break;} case 217: -#line 1854 "Gmsh.y" +#line 1853 "Gmsh.y" { Curve *pc, *prc; Extrude_ProtudePoint(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,&pc,&prc,NULL); ; break;} case 218: -#line 1859 "Gmsh.y" +#line 1858 "Gmsh.y" { Curve *pc, *prc; Extrude_ProtudePoint(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d, @@ -4886,55 +4841,55 @@ case 218: ; break;} case 219: -#line 1865 "Gmsh.y" +#line 1864 "Gmsh.y" { Extrude_ProtudeCurve(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,NULL); ; break;} case 220: -#line 1869 "Gmsh.y" +#line 1868 "Gmsh.y" { Extrude_ProtudeCurve(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,NULL); ; break;} case 221: -#line 1873 "Gmsh.y" +#line 1872 "Gmsh.y" { Extrude_ProtudeSurface(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,0,NULL); ; break;} case 222: -#line 1877 "Gmsh.y" +#line 1876 "Gmsh.y" { Extrude_ProtudeSurface(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,0,NULL); ; break;} case 223: -#line 1881 "Gmsh.y" +#line 1880 "Gmsh.y" { int vol = NEWREG(); Extrude_ProtudeSurface(1,(int)yyvsp[-7].d,yyvsp[-5].v[0],yyvsp[-5].v[1],yyvsp[-5].v[2],0.,0.,0.,0.,vol,&extr); ; break;} case 224: -#line 1886 "Gmsh.y" +#line 1885 "Gmsh.y" { int vol = NEWREG(); Extrude_ProtudeSurface(0,(int)yyvsp[-11].d,yyvsp[-9].v[0],yyvsp[-9].v[1],yyvsp[-9].v[2],yyvsp[-7].v[0],yyvsp[-7].v[1],yyvsp[-7].v[2],yyvsp[-5].d,vol,&extr); ; break;} case 225: -#line 1894 "Gmsh.y" +#line 1893 "Gmsh.y" { ; break;} case 226: -#line 1897 "Gmsh.y" +#line 1896 "Gmsh.y" { ; break;} case 227: -#line 1903 "Gmsh.y" +#line 1902 "Gmsh.y" { double d; int j; @@ -4953,13 +4908,13 @@ case 227: ; break;} case 228: -#line 1920 "Gmsh.y" +#line 1919 "Gmsh.y" { extr.mesh.Recombine = true; ; break;} case 229: -#line 1931 "Gmsh.y" +#line 1930 "Gmsh.y" { Curve *c; for(i=0;i<List_Nbr(yyvsp[-3].l);i++){ @@ -4978,7 +4933,7 @@ case 229: ; break;} case 230: -#line 1948 "Gmsh.y" +#line 1947 "Gmsh.y" { Curve *c; for(i=0;i<List_Nbr(yyvsp[-6].l);i++){ @@ -4997,7 +4952,7 @@ case 230: ; break;} case 231: -#line 1965 "Gmsh.y" +#line 1964 "Gmsh.y" { Curve *c; for(i=0;i<List_Nbr(yyvsp[-6].l);i++){ @@ -5016,7 +4971,7 @@ case 231: ; break;} case 232: -#line 1982 "Gmsh.y" +#line 1981 "Gmsh.y" { Surface *s = FindSurface((int)yyvsp[-4].d,THEM); if(!s) @@ -5039,7 +4994,7 @@ case 232: ; break;} case 233: -#line 2003 "Gmsh.y" +#line 2002 "Gmsh.y" { Surface *s = FindSurface((int)yyvsp[-4].d,THEM); if(!s) @@ -5061,7 +5016,7 @@ case 233: ; break;} case 234: -#line 2023 "Gmsh.y" +#line 2022 "Gmsh.y" { Volume *v = FindVolume((int)yyvsp[-4].d,THEM); if(!v) @@ -5083,7 +5038,7 @@ case 234: ; break;} case 235: -#line 2043 "Gmsh.y" +#line 2042 "Gmsh.y" { Surface *s; for(i=0;i<List_Nbr(yyvsp[-3].l);i++){ @@ -5102,7 +5057,7 @@ case 235: ; break;} case 236: -#line 2060 "Gmsh.y" +#line 2059 "Gmsh.y" { Surface *s; for(i=0;i<List_Nbr(yyvsp[-1].l);i++){ @@ -5121,79 +5076,79 @@ case 236: ; break;} case 237: -#line 2085 "Gmsh.y" +#line 2084 "Gmsh.y" { Coherence_PS(); ; break;} case 238: -#line 2089 "Gmsh.y" +#line 2088 "Gmsh.y" { IntersectAllSegmentsTogether(); ; break;} case 239: -#line 2100 "Gmsh.y" +#line 2099 "Gmsh.y" { yyval.d = yyvsp[0].d; ; break;} case 240: -#line 2101 "Gmsh.y" +#line 2100 "Gmsh.y" { yyval.d = -yyvsp[0].d; ; break;} case 241: -#line 2105 "Gmsh.y" +#line 2104 "Gmsh.y" {yyval.i = 1;; break;} case 242: -#line 2106 "Gmsh.y" +#line 2105 "Gmsh.y" {yyval.i = 0;; break;} case 243: -#line 2107 "Gmsh.y" +#line 2106 "Gmsh.y" {yyval.i = -1;; break;} case 244: -#line 2108 "Gmsh.y" +#line 2107 "Gmsh.y" {yyval.i = -1;; break;} case 245: -#line 2109 "Gmsh.y" +#line 2108 "Gmsh.y" {yyval.i = -1;; break;} case 246: -#line 2113 "Gmsh.y" +#line 2112 "Gmsh.y" { yyval.d = yyvsp[0].d; ; break;} case 247: -#line 2114 "Gmsh.y" +#line 2113 "Gmsh.y" { yyval.d = yyvsp[-1].d ; ; break;} case 248: -#line 2115 "Gmsh.y" +#line 2114 "Gmsh.y" { yyval.d = -yyvsp[0].d ; ; break;} case 249: -#line 2116 "Gmsh.y" +#line 2115 "Gmsh.y" { yyval.d = yyvsp[0].d; ; break;} case 250: -#line 2117 "Gmsh.y" +#line 2116 "Gmsh.y" { yyval.d = !yyvsp[0].d ; ; break;} case 251: -#line 2118 "Gmsh.y" +#line 2117 "Gmsh.y" { yyval.d = yyvsp[-2].d - yyvsp[0].d ; ; break;} case 252: -#line 2119 "Gmsh.y" +#line 2118 "Gmsh.y" { yyval.d = yyvsp[-2].d + yyvsp[0].d ; ; break;} case 253: -#line 2120 "Gmsh.y" +#line 2119 "Gmsh.y" { yyval.d = yyvsp[-2].d * yyvsp[0].d ; ; break;} case 254: -#line 2122 "Gmsh.y" +#line 2121 "Gmsh.y" { if(!yyvsp[0].d) vyyerror("Division by Zero in '%g / %g'", yyvsp[-2].d, yyvsp[0].d); @@ -5202,143 +5157,143 @@ case 254: ; break;} case 255: -#line 2128 "Gmsh.y" +#line 2127 "Gmsh.y" { yyval.d = (int)yyvsp[-2].d % (int)yyvsp[0].d ; ; break;} case 256: -#line 2129 "Gmsh.y" +#line 2128 "Gmsh.y" { yyval.d = pow(yyvsp[-2].d,yyvsp[0].d) ; ; break;} case 257: -#line 2130 "Gmsh.y" +#line 2129 "Gmsh.y" { yyval.d = yyvsp[-2].d < yyvsp[0].d ; ; break;} case 258: -#line 2131 "Gmsh.y" +#line 2130 "Gmsh.y" { yyval.d = yyvsp[-2].d > yyvsp[0].d ; ; break;} case 259: -#line 2132 "Gmsh.y" +#line 2131 "Gmsh.y" { yyval.d = yyvsp[-2].d <= yyvsp[0].d ; ; break;} case 260: -#line 2133 "Gmsh.y" +#line 2132 "Gmsh.y" { yyval.d = yyvsp[-2].d >= yyvsp[0].d ; ; break;} case 261: -#line 2134 "Gmsh.y" +#line 2133 "Gmsh.y" { yyval.d = yyvsp[-2].d == yyvsp[0].d ; ; break;} case 262: -#line 2135 "Gmsh.y" +#line 2134 "Gmsh.y" { yyval.d = yyvsp[-2].d != yyvsp[0].d ; ; break;} case 263: -#line 2136 "Gmsh.y" +#line 2135 "Gmsh.y" { yyval.d = yyvsp[-2].d && yyvsp[0].d ; ; break;} case 264: -#line 2137 "Gmsh.y" +#line 2136 "Gmsh.y" { yyval.d = yyvsp[-2].d || yyvsp[0].d ; ; break;} case 265: -#line 2138 "Gmsh.y" +#line 2137 "Gmsh.y" { yyval.d = yyvsp[-4].d? yyvsp[-2].d : yyvsp[0].d ; ; break;} case 266: -#line 2139 "Gmsh.y" +#line 2138 "Gmsh.y" { yyval.d = exp(yyvsp[-1].d); ; break;} case 267: -#line 2140 "Gmsh.y" +#line 2139 "Gmsh.y" { yyval.d = log(yyvsp[-1].d); ; break;} case 268: -#line 2141 "Gmsh.y" +#line 2140 "Gmsh.y" { yyval.d = log10(yyvsp[-1].d); ; break;} case 269: -#line 2142 "Gmsh.y" +#line 2141 "Gmsh.y" { yyval.d = sqrt(yyvsp[-1].d); ; break;} case 270: -#line 2143 "Gmsh.y" +#line 2142 "Gmsh.y" { yyval.d = sin(yyvsp[-1].d); ; break;} case 271: -#line 2144 "Gmsh.y" +#line 2143 "Gmsh.y" { yyval.d = asin(yyvsp[-1].d); ; break;} case 272: -#line 2145 "Gmsh.y" +#line 2144 "Gmsh.y" { yyval.d = cos(yyvsp[-1].d); ; break;} case 273: -#line 2146 "Gmsh.y" +#line 2145 "Gmsh.y" { yyval.d = acos(yyvsp[-1].d); ; break;} case 274: -#line 2147 "Gmsh.y" +#line 2146 "Gmsh.y" { yyval.d = tan(yyvsp[-1].d); ; break;} case 275: -#line 2148 "Gmsh.y" +#line 2147 "Gmsh.y" { yyval.d = atan(yyvsp[-1].d); ; break;} case 276: -#line 2149 "Gmsh.y" +#line 2148 "Gmsh.y" { yyval.d = atan2(yyvsp[-3].d,yyvsp[-1].d); ; break;} case 277: -#line 2150 "Gmsh.y" +#line 2149 "Gmsh.y" { yyval.d = sinh(yyvsp[-1].d); ; break;} case 278: -#line 2151 "Gmsh.y" +#line 2150 "Gmsh.y" { yyval.d = cosh(yyvsp[-1].d); ; break;} case 279: -#line 2152 "Gmsh.y" +#line 2151 "Gmsh.y" { yyval.d = tanh(yyvsp[-1].d); ; break;} case 280: -#line 2153 "Gmsh.y" +#line 2152 "Gmsh.y" { yyval.d = fabs(yyvsp[-1].d); ; break;} case 281: -#line 2154 "Gmsh.y" +#line 2153 "Gmsh.y" { yyval.d = floor(yyvsp[-1].d); ; break;} case 282: -#line 2155 "Gmsh.y" +#line 2154 "Gmsh.y" { yyval.d = ceil(yyvsp[-1].d); ; break;} case 283: -#line 2156 "Gmsh.y" +#line 2155 "Gmsh.y" { yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d); ; break;} case 284: -#line 2157 "Gmsh.y" +#line 2156 "Gmsh.y" { yyval.d = fmod(yyvsp[-3].d,yyvsp[-1].d); ; break;} case 285: -#line 2158 "Gmsh.y" +#line 2157 "Gmsh.y" { yyval.d = sqrt(yyvsp[-3].d*yyvsp[-3].d+yyvsp[-1].d*yyvsp[-1].d); ; break;} case 286: -#line 2159 "Gmsh.y" +#line 2158 "Gmsh.y" { yyval.d = yyvsp[-1].d*(double)rand()/(double)RAND_MAX; ; break;} case 287: -#line 2168 "Gmsh.y" +#line 2167 "Gmsh.y" { yyval.d = yyvsp[0].d; ; break;} case 288: -#line 2169 "Gmsh.y" +#line 2168 "Gmsh.y" { yyval.d = 3.141592653589793; ; break;} case 289: -#line 2174 "Gmsh.y" +#line 2173 "Gmsh.y" { TheSymbol.Name = yyvsp[0].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5352,7 +5307,7 @@ case 289: ; break;} case 290: -#line 2186 "Gmsh.y" +#line 2185 "Gmsh.y" { TheSymbol.Name = yyvsp[-3].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5371,7 +5326,7 @@ case 290: ; break;} case 291: -#line 2204 "Gmsh.y" +#line 2203 "Gmsh.y" { TheSymbol.Name = yyvsp[-1].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5385,7 +5340,7 @@ case 291: ; break;} case 292: -#line 2216 "Gmsh.y" +#line 2215 "Gmsh.y" { TheSymbol.Name = yyvsp[-4].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5404,7 +5359,7 @@ case 292: ; break;} case 293: -#line 2234 "Gmsh.y" +#line 2233 "Gmsh.y" { TheSymbol.Name = yyvsp[-1].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5418,7 +5373,7 @@ case 293: ; break;} case 294: -#line 2246 "Gmsh.y" +#line 2245 "Gmsh.y" { TheSymbol.Name = yyvsp[-4].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5437,7 +5392,7 @@ case 294: ; break;} case 295: -#line 2266 "Gmsh.y" +#line 2265 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-2].c))){ vyyerror("Unknown Numeric Option Class '%s'", yyvsp[-2].c); @@ -5460,7 +5415,7 @@ case 295: ; break;} case 296: -#line 2287 "Gmsh.y" +#line 2286 "Gmsh.y" { if(strcmp(yyvsp[-7].c, "PostProcessing")){ vyyerror("Unknown View Option Class '%s'", yyvsp[-7].c); @@ -5485,7 +5440,7 @@ case 296: ; break;} case 297: -#line 2311 "Gmsh.y" +#line 2310 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-3].c))){ vyyerror("Unknown Numeric Option Class '%s'", yyvsp[-3].c); @@ -5508,7 +5463,7 @@ case 297: ; break;} case 298: -#line 2332 "Gmsh.y" +#line 2331 "Gmsh.y" { if(strcmp(yyvsp[-8].c, "PostProcessing")){ vyyerror("Unknown View Option Class '%s'", yyvsp[-8].c); @@ -5533,7 +5488,7 @@ case 298: ; break;} case 299: -#line 2356 "Gmsh.y" +#line 2355 "Gmsh.y" { if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-3].c))){ vyyerror("Unknown Numeric Option Class '%s'", yyvsp[-3].c); @@ -5556,7 +5511,7 @@ case 299: ; break;} case 300: -#line 2377 "Gmsh.y" +#line 2376 "Gmsh.y" { if(strcmp(yyvsp[-8].c, "PostProcessing")){ vyyerror("Unknown View Option Class '%s'", yyvsp[-8].c); @@ -5581,7 +5536,7 @@ case 300: ; break;} case 301: -#line 2403 "Gmsh.y" +#line 2402 "Gmsh.y" { ListOfDouble2_L = List_Create(2,1,sizeof(double)) ; for(d=yyvsp[-2].d ; (yyvsp[-2].d<yyvsp[0].d)?(d<=yyvsp[0].d):(d>=yyvsp[0].d) ; (yyvsp[-2].d<yyvsp[0].d)?(d+=1.):(d-=1.)) @@ -5589,7 +5544,7 @@ case 301: ; break;} case 302: -#line 2409 "Gmsh.y" +#line 2408 "Gmsh.y" { ListOfDouble2_L = List_Create(2,1,sizeof(double)) ; if(!yyvsp[0].d || (yyvsp[-4].d<yyvsp[-2].d && yyvsp[0].d<0) || (yyvsp[-4].d>yyvsp[-2].d && yyvsp[0].d>0)){ @@ -5602,7 +5557,7 @@ case 302: ; break;} case 303: -#line 2423 "Gmsh.y" +#line 2422 "Gmsh.y" { memcpy(yyval.v, yyvsp[0].v, 5*sizeof(double)) ; //??? Avec ce qui suit, bison se plante sur DEC @@ -5610,110 +5565,110 @@ case 303: ; break;} case 304: -#line 2429 "Gmsh.y" +#line 2428 "Gmsh.y" { for(i=0 ; i<5 ; i++) yyval.v[i] = -yyvsp[0].v[i] ; ; break;} case 305: -#line 2433 "Gmsh.y" +#line 2432 "Gmsh.y" { for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[0].v[i]; ; break;} case 306: -#line 2437 "Gmsh.y" +#line 2436 "Gmsh.y" { for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[-2].v[i] - yyvsp[0].v[i] ; ; break;} case 307: -#line 2441 "Gmsh.y" +#line 2440 "Gmsh.y" { for(i=0 ; i<5 ; i++) yyval.v[i] = yyvsp[-2].v[i] + yyvsp[0].v[i] ; ; break;} case 308: -#line 2447 "Gmsh.y" +#line 2446 "Gmsh.y" { yyval.v[0]=yyvsp[-9].d; yyval.v[1]=yyvsp[-7].d; yyval.v[2]=yyvsp[-5].d; yyval.v[3]=yyvsp[-3].d; yyval.v[4]=yyvsp[-1].d; ; break;} case 309: -#line 2451 "Gmsh.y" +#line 2450 "Gmsh.y" { yyval.v[0]=yyvsp[-7].d; yyval.v[1]=yyvsp[-5].d; yyval.v[2]=yyvsp[-3].d; yyval.v[3]=yyvsp[-1].d; yyval.v[4]=1.0; ; break;} case 310: -#line 2455 "Gmsh.y" +#line 2454 "Gmsh.y" { yyval.v[0]=yyvsp[-5].d; yyval.v[1]=yyvsp[-3].d; yyval.v[2]=yyvsp[-1].d; yyval.v[3]=0.0; yyval.v[4]=1.0; ; break;} case 311: -#line 2459 "Gmsh.y" +#line 2458 "Gmsh.y" { yyval.v[0]=yyvsp[-5].d; yyval.v[1]=yyvsp[-3].d; yyval.v[2]=yyvsp[-1].d; yyval.v[3]=0.0; yyval.v[4]=1.0; ; break;} case 312: -#line 2466 "Gmsh.y" +#line 2465 "Gmsh.y" { ; break;} case 313: -#line 2469 "Gmsh.y" +#line 2468 "Gmsh.y" { ; break;} case 314: -#line 2475 "Gmsh.y" +#line 2474 "Gmsh.y" { ; break;} case 315: -#line 2478 "Gmsh.y" +#line 2477 "Gmsh.y" { ; break;} case 316: -#line 2484 "Gmsh.y" +#line 2483 "Gmsh.y" { ; break;} case 317: -#line 2487 "Gmsh.y" +#line 2486 "Gmsh.y" { yyval.l=ListOfListOfDouble_L; ; break;} case 318: -#line 2491 "Gmsh.y" +#line 2490 "Gmsh.y" { yyval.l=ListOfListOfDouble_L; ; break;} case 319: -#line 2498 "Gmsh.y" +#line 2497 "Gmsh.y" { ListOfListOfDouble_L = List_Create(2,1,sizeof(List_T*)) ; List_Add(ListOfListOfDouble_L, &(yyvsp[0].l)) ; ; break;} case 320: -#line 2503 "Gmsh.y" +#line 2502 "Gmsh.y" { List_Add(ListOfListOfDouble_L, &(yyvsp[0].l)) ; ; break;} case 321: -#line 2510 "Gmsh.y" +#line 2509 "Gmsh.y" { ; break;} case 322: -#line 2513 "Gmsh.y" +#line 2512 "Gmsh.y" { ListOfDouble_L = List_Create(2,1,sizeof(double)) ; List_Add(ListOfDouble_L, &(yyvsp[0].d)) ; @@ -5721,7 +5676,7 @@ case 322: ; break;} case 323: -#line 2519 "Gmsh.y" +#line 2518 "Gmsh.y" { ListOfDouble_L = List_Create(2,1,sizeof(double)) ; TheSymbol.Name = yyvsp[-2].c ; @@ -5738,20 +5693,20 @@ case 323: ; break;} case 324: -#line 2534 "Gmsh.y" +#line 2533 "Gmsh.y" { yyval.l=ListOfDouble_L; ; break;} case 325: -#line 2542 "Gmsh.y" +#line 2541 "Gmsh.y" { ListOfDouble_L = List_Create(2,1,sizeof(double)) ; List_Add(ListOfDouble_L, &(yyvsp[0].d)) ; ; break;} case 326: -#line 2547 "Gmsh.y" +#line 2546 "Gmsh.y" { ListOfDouble_L = List_Create(2,1,sizeof(double)) ; for(i=0 ; i<List_Nbr(ListOfDouble2_L) ; i++){ @@ -5762,7 +5717,7 @@ case 326: ; break;} case 327: -#line 2556 "Gmsh.y" +#line 2555 "Gmsh.y" { ListOfDouble_L = List_Create(2,1,sizeof(double)) ; TheSymbol.Name = yyvsp[-2].c ; @@ -5776,13 +5731,13 @@ case 327: ; break;} case 328: -#line 2568 "Gmsh.y" +#line 2567 "Gmsh.y" { List_Add(ListOfDouble_L, &(yyvsp[0].d)) ; ; break;} case 329: -#line 2572 "Gmsh.y" +#line 2571 "Gmsh.y" { for(i=0 ; i<List_Nbr(ListOfDouble2_L) ; i++){ List_Read(ListOfDouble2_L, i, &d) ; @@ -5792,7 +5747,7 @@ case 329: ; break;} case 330: -#line 2580 "Gmsh.y" +#line 2579 "Gmsh.y" { TheSymbol.Name = yyvsp[-2].c ; if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))) { @@ -5805,33 +5760,33 @@ case 330: ; break;} case 331: -#line 2594 "Gmsh.y" +#line 2593 "Gmsh.y" { yyval.u = PACK_COLOR((int)yyvsp[-7].d, (int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d); ; break;} case 332: -#line 2598 "Gmsh.y" +#line 2597 "Gmsh.y" { yyval.u = PACK_COLOR((int)yyvsp[-5].d, (int)yyvsp[-3].d, (int)yyvsp[-1].d, 255); ; break;} case 333: -#line 2602 "Gmsh.y" +#line 2601 "Gmsh.y" { yyval.u = Get_ColorForString(ColorString, (int)yyvsp[-1].d, yyvsp[-3].c, &flag); if(flag) vyyerror("Unknown Color '%s'", yyvsp[-3].c); ; break;} case 334: -#line 2607 "Gmsh.y" +#line 2606 "Gmsh.y" { yyval.u = Get_ColorForString(ColorString, -1, yyvsp[0].c, &flag); if(flag) vyyerror("Unknown Color '%s'", yyvsp[0].c); ; break;} case 335: -#line 2612 "Gmsh.y" +#line 2611 "Gmsh.y" { if(!(pColCat = Get_ColorOptionCategory(yyvsp[-4].c))){ vyyerror("Unknown Color Option Class '%s'", yyvsp[-4].c); @@ -5849,13 +5804,13 @@ case 335: ; break;} case 336: -#line 2631 "Gmsh.y" +#line 2630 "Gmsh.y" { yyval.l = ListOfColor_L; ; break;} case 337: -#line 2635 "Gmsh.y" +#line 2634 "Gmsh.y" { if(!ListOfColor_L) ListOfColor_L = List_Create(256,10,sizeof(unsigned int)) ; @@ -5876,7 +5831,7 @@ case 337: ; break;} case 338: -#line 2657 "Gmsh.y" +#line 2656 "Gmsh.y" { if(!ListOfColor_L) ListOfColor_L = List_Create(256,10,sizeof(unsigned int)) ; @@ -5886,25 +5841,25 @@ case 338: ; break;} case 339: -#line 2665 "Gmsh.y" +#line 2664 "Gmsh.y" { List_Add(ListOfColor_L, &(yyvsp[0].u)) ; ; break;} case 340: -#line 2672 "Gmsh.y" +#line 2671 "Gmsh.y" { yyval.c = yyvsp[0].c; ; break;} case 341: -#line 2676 "Gmsh.y" +#line 2675 "Gmsh.y" { yyval.c = yyvsp[-1].c; ; break;} case 342: -#line 2680 "Gmsh.y" +#line 2679 "Gmsh.y" { for(i = 0 ; i<List_Nbr(ListOfDouble_L) ; i++){ if(!i){ @@ -5930,7 +5885,7 @@ case 342: break;} } /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/lib/bison.simple" +#line 498 "/usr/local/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; @@ -6125,32 +6080,8 @@ yyerrhandle: yystate = yyn; goto yynewstate; - - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 1; } -#line 2704 "Gmsh.y" +#line 2703 "Gmsh.y" void InitSymbols(void){ diff --git a/Parser/Gmsh.tab.cpp.h b/Parser/Gmsh.tab.cpp.h index 4a4d722c1b66665aab40ec8d45bedb6bea28d804..ac1bce85bd14f6ee22c6058c6681188269542609 100644 --- a/Parser/Gmsh.tab.cpp.h +++ b/Parser/Gmsh.tab.cpp.h @@ -7,167 +7,167 @@ typedef union { Shape s; List_T *l; } YYSTYPE; -#define tDOUBLE 257 -#define tSTRING 258 -#define tBIGSTR 259 -#define tEND 260 -#define tAFFECT 261 -#define tDOTS 262 -#define tPi 263 -#define tExp 264 -#define tLog 265 -#define tLog10 266 -#define tSqrt 267 -#define tSin 268 -#define tAsin 269 -#define tCos 270 -#define tAcos 271 -#define tTan 272 -#define tRand 273 -#define tAtan 274 -#define tAtan2 275 -#define tSinh 276 -#define tCosh 277 -#define tTanh 278 -#define tFabs 279 -#define tFloor 280 -#define tCeil 281 -#define tFmod 282 -#define tModulo 283 -#define tHypot 284 -#define tPrintf 285 -#define tSprintf 286 -#define tDraw 287 -#define tPoint 288 -#define tCircle 289 -#define tEllipsis 290 -#define tLine 291 -#define tSurface 292 -#define tSpline 293 -#define tVolume 294 -#define tCharacteristic 295 -#define tLength 296 -#define tParametric 297 -#define tElliptic 298 -#define tPlane 299 -#define tRuled 300 -#define tTransfinite 301 -#define tComplex 302 -#define tPhysical 303 -#define tUsing 304 -#define tBump 305 -#define tProgression 306 -#define tRotate 307 -#define tTranslate 308 -#define tSymmetry 309 -#define tDilate 310 -#define tExtrude 311 -#define tDuplicata 312 -#define tLoop 313 -#define tRecombine 314 -#define tDelete 315 -#define tCoherence 316 -#define tIntersect 317 -#define tView 318 -#define tAttractor 319 -#define tLayers 320 -#define tScalarTetrahedron 321 -#define tVectorTetrahedron 322 -#define tTensorTetrahedron 323 -#define tScalarTriangle 324 -#define tVectorTriangle 325 -#define tTensorTriangle 326 -#define tScalarLine 327 -#define tVectorLine 328 -#define tTensorLine 329 -#define tScalarPoint 330 -#define tVectorPoint 331 -#define tTensorPoint 332 -#define tBSpline 333 -#define tNurbs 334 -#define tOrder 335 -#define tWith 336 -#define tBounds 337 -#define tKnots 338 -#define tColor 339 -#define tFor 340 -#define tIn 341 -#define tEndFor 342 -#define tIf 343 -#define tEndIf 344 -#define tExit 345 -#define tReturn 346 -#define tCall 347 -#define tFunction 348 -#define tMesh 349 -#define tB_SPLINE_SURFACE_WITH_KNOTS 350 -#define tB_SPLINE_CURVE_WITH_KNOTS 351 -#define tCARTESIAN_POINT 352 -#define tTRUE 353 -#define tFALSE 354 -#define tUNSPECIFIED 355 -#define tU 356 -#define tV 357 -#define tEDGE_CURVE 358 -#define tVERTEX_POINT 359 -#define tORIENTED_EDGE 360 -#define tPLANE 361 -#define tFACE_OUTER_BOUND 362 -#define tEDGE_LOOP 363 -#define tADVANCED_FACE 364 -#define tVECTOR 365 -#define tDIRECTION 366 -#define tAXIS2_PLACEMENT_3D 367 -#define tISO 368 -#define tENDISO 369 -#define tENDSEC 370 -#define tDATA 371 -#define tHEADER 372 -#define tFILE_DESCRIPTION 373 -#define tFILE_SCHEMA 374 -#define tFILE_NAME 375 -#define tMANIFOLD_SOLID_BREP 376 -#define tCLOSED_SHELL 377 -#define tADVANCED_BREP_SHAPE_REPRESENTATION 378 -#define tFACE_BOUND 379 -#define tCYLINDRICAL_SURFACE 380 -#define tCONICAL_SURFACE 381 -#define tCIRCLE 382 -#define tTRIMMED_CURVE 383 -#define tGEOMETRIC_SET 384 -#define tCOMPOSITE_CURVE_SEGMENT 385 -#define tCONTINUOUS 386 -#define tCOMPOSITE_CURVE 387 -#define tTOROIDAL_SURFACE 388 -#define tPRODUCT_DEFINITION 389 -#define tPRODUCT_DEFINITION_SHAPE 390 -#define tSHAPE_DEFINITION_REPRESENTATION 391 -#define tELLIPSE 392 -#define tTrimmed 393 -#define tSolid 394 -#define tEndSolid 395 -#define tVertex 396 -#define tFacet 397 -#define tNormal 398 -#define tOuter 399 -#define tLoopSTL 400 -#define tEndLoop 401 -#define tEndFacet 402 -#define tAFFECTPLUS 403 -#define tAFFECTMINUS 404 -#define tAFFECTTIMES 405 -#define tAFFECTDIVIDE 406 -#define tOR 407 -#define tAND 408 -#define tEQUAL 409 -#define tNOTEQUAL 410 -#define tAPPROXEQUAL 411 -#define tLESSOREQUAL 412 -#define tGREATEROREQUAL 413 -#define tCROSSPRODUCT 414 -#define tPLUSPLUS 415 -#define tMINUSMINUS 416 -#define UNARYPREC 417 +#define tDOUBLE 258 +#define tSTRING 259 +#define tBIGSTR 260 +#define tEND 261 +#define tAFFECT 262 +#define tDOTS 263 +#define tPi 264 +#define tExp 265 +#define tLog 266 +#define tLog10 267 +#define tSqrt 268 +#define tSin 269 +#define tAsin 270 +#define tCos 271 +#define tAcos 272 +#define tTan 273 +#define tRand 274 +#define tAtan 275 +#define tAtan2 276 +#define tSinh 277 +#define tCosh 278 +#define tTanh 279 +#define tFabs 280 +#define tFloor 281 +#define tCeil 282 +#define tFmod 283 +#define tModulo 284 +#define tHypot 285 +#define tPrintf 286 +#define tSprintf 287 +#define tDraw 288 +#define tPoint 289 +#define tCircle 290 +#define tEllipsis 291 +#define tLine 292 +#define tSurface 293 +#define tSpline 294 +#define tVolume 295 +#define tCharacteristic 296 +#define tLength 297 +#define tParametric 298 +#define tElliptic 299 +#define tPlane 300 +#define tRuled 301 +#define tTransfinite 302 +#define tComplex 303 +#define tPhysical 304 +#define tUsing 305 +#define tBump 306 +#define tProgression 307 +#define tRotate 308 +#define tTranslate 309 +#define tSymmetry 310 +#define tDilate 311 +#define tExtrude 312 +#define tDuplicata 313 +#define tLoop 314 +#define tRecombine 315 +#define tDelete 316 +#define tCoherence 317 +#define tIntersect 318 +#define tView 319 +#define tAttractor 320 +#define tLayers 321 +#define tScalarTetrahedron 322 +#define tVectorTetrahedron 323 +#define tTensorTetrahedron 324 +#define tScalarTriangle 325 +#define tVectorTriangle 326 +#define tTensorTriangle 327 +#define tScalarLine 328 +#define tVectorLine 329 +#define tTensorLine 330 +#define tScalarPoint 331 +#define tVectorPoint 332 +#define tTensorPoint 333 +#define tBSpline 334 +#define tNurbs 335 +#define tOrder 336 +#define tWith 337 +#define tBounds 338 +#define tKnots 339 +#define tColor 340 +#define tFor 341 +#define tIn 342 +#define tEndFor 343 +#define tIf 344 +#define tEndIf 345 +#define tExit 346 +#define tReturn 347 +#define tCall 348 +#define tFunction 349 +#define tMesh 350 +#define tB_SPLINE_SURFACE_WITH_KNOTS 351 +#define tB_SPLINE_CURVE_WITH_KNOTS 352 +#define tCARTESIAN_POINT 353 +#define tTRUE 354 +#define tFALSE 355 +#define tUNSPECIFIED 356 +#define tU 357 +#define tV 358 +#define tEDGE_CURVE 359 +#define tVERTEX_POINT 360 +#define tORIENTED_EDGE 361 +#define tPLANE 362 +#define tFACE_OUTER_BOUND 363 +#define tEDGE_LOOP 364 +#define tADVANCED_FACE 365 +#define tVECTOR 366 +#define tDIRECTION 367 +#define tAXIS2_PLACEMENT_3D 368 +#define tISO 369 +#define tENDISO 370 +#define tENDSEC 371 +#define tDATA 372 +#define tHEADER 373 +#define tFILE_DESCRIPTION 374 +#define tFILE_SCHEMA 375 +#define tFILE_NAME 376 +#define tMANIFOLD_SOLID_BREP 377 +#define tCLOSED_SHELL 378 +#define tADVANCED_BREP_SHAPE_REPRESENTATION 379 +#define tFACE_BOUND 380 +#define tCYLINDRICAL_SURFACE 381 +#define tCONICAL_SURFACE 382 +#define tCIRCLE 383 +#define tTRIMMED_CURVE 384 +#define tGEOMETRIC_SET 385 +#define tCOMPOSITE_CURVE_SEGMENT 386 +#define tCONTINUOUS 387 +#define tCOMPOSITE_CURVE 388 +#define tTOROIDAL_SURFACE 389 +#define tPRODUCT_DEFINITION 390 +#define tPRODUCT_DEFINITION_SHAPE 391 +#define tSHAPE_DEFINITION_REPRESENTATION 392 +#define tELLIPSE 393 +#define tTrimmed 394 +#define tSolid 395 +#define tEndSolid 396 +#define tVertex 397 +#define tFacet 398 +#define tNormal 399 +#define tOuter 400 +#define tLoopSTL 401 +#define tEndLoop 402 +#define tEndFacet 403 +#define tAFFECTPLUS 404 +#define tAFFECTMINUS 405 +#define tAFFECTTIMES 406 +#define tAFFECTDIVIDE 407 +#define tOR 408 +#define tAND 409 +#define tEQUAL 410 +#define tNOTEQUAL 411 +#define tAPPROXEQUAL 412 +#define tLESSOREQUAL 413 +#define tGREATEROREQUAL 414 +#define tCROSSPRODUCT 415 +#define tPLUSPLUS 416 +#define tMINUSMINUS 417 +#define UNARYPREC 418 extern YYSTYPE yylval; diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index aa74e9997d1d64694c041f60c57e4ada52d2acf9..16d96e8022114d08f367518aa3e23df2114c7c72 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -1,4 +1,4 @@ -%{ /* $Id: Gmsh.y,v 1.45 2000-12-17 21:17:30 remacle Exp $ */ +%{ /* $Id: Gmsh.y,v 1.46 2000-12-18 08:32:08 geuzaine Exp $ */ #include <stdarg.h> @@ -1818,6 +1818,12 @@ Loop : ImbricatedLoop--; } } + | tFunction tSTRING + { + if(!FunctionManager::Instance()->createFunction($2,yyin,yylineno)) + vyyerror("Redefinition of function %s",$2); + skip_until("Return"); + } | tReturn { if(!FunctionManager::Instance()->leaveFunction(&yyin,yylineno)) @@ -1828,13 +1834,6 @@ Loop : if(!FunctionManager::Instance()->enterFunction($2,&yyin,yylineno)) vyyerror("Unknown Function %s",$2); } - | tFunction tSTRING - { - // skip everything until return is found - if(!FunctionManager::Instance()->createFunction($2,yyin,yylineno)) - vyyerror("Redefinition of function %s",$2); - skip_until("Return"); - } | tIf '(' FExpr ')' { if(!$3) skip_until("EndIf"); diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index 8949d1475a97ed23e3aed0bc66578852708c2e97..01acdb116ed7aa30854318a7ccc36dd22d10b3a5 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -2,7 +2,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.49 2000-12-17 21:17:30 remacle Exp $ + * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.50 2000-12-18 08:32:08 geuzaine Exp $ */ #define FLEX_SCANNER @@ -1165,7 +1165,7 @@ YY_MALLOC_DECL YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; + register char *yy_cp, *yy_bp; register int yy_act; #line 60 "Gmsh.l"