mojoshader_lexer.c
changeset 910 3ee487d85ecb
parent 866 3fc643a4f742
child 960 d90fa2381bab
equal deleted inserted replaced
909:1859faa45249 910:3ee487d85ecb
  1227 			if (yych != '#') goto yy210;
  1227 			if (yych != '#') goto yy210;
  1228 		}
  1228 		}
  1229 	}
  1229 	}
  1230 	yyaccept = 0;
  1230 	yyaccept = 0;
  1231 	yych = *(YYMARKER = ++YYCURSOR);
  1231 	yych = *(YYMARKER = ++YYCURSOR);
  1232 	if (yych <= 'e') {
  1232 	if (yych <= 'h') {
  1233 		if (yych <= 0x1F) {
  1233 		if (yych <= 0x1F) {
  1234 			if (yych == '\t') goto yy214;
  1234 			if (yych == '\t') goto yy214;
  1235 		} else {
  1235 		} else {
  1236 			if (yych <= ' ') goto yy214;
  1236 			if (yych <= ' ') goto yy214;
  1237 			if (yych >= 'd') goto yy214;
  1237 			if (yych <= 'c') goto yy207;
  1238 		}
  1238 			if (yych <= 'e') goto yy214;
  1239 	} else {
  1239 		}
  1240 		if (yych <= 'k') {
  1240 	} else {
  1241 			if (yych == 'i') goto yy214;
  1241 		if (yych <= 'o') {
  1242 		} else {
  1242 			if (yych <= 'i') goto yy214;
  1243 			if (yych <= 'l') goto yy214;
  1243 			if (yych == 'l') goto yy214;
       
  1244 		} else {
       
  1245 			if (yych <= 'p') goto yy214;
  1244 			if (yych == 'u') goto yy214;
  1246 			if (yych == 'u') goto yy214;
  1245 		}
  1247 		}
  1246 	}
  1248 	}
  1247 yy207:
  1249 yy207:
  1248 	{
  1250 	{
  1275 yy213:
  1277 yy213:
  1276 	++YYCURSOR;
  1278 	++YYCURSOR;
  1277 	if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
  1279 	if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
  1278 	yych = *YYCURSOR;
  1280 	yych = *YYCURSOR;
  1279 yy214:
  1281 yy214:
  1280 	if (yych <= 'e') {
  1282 	if (yych <= 'h') {
  1281 		if (yych <= 0x1F) {
  1283 		if (yych <= ' ') {
  1282 			if (yych == '\t') goto yy213;
  1284 			if (yych == '\t') goto yy213;
  1283 		} else {
  1285 			if (yych >= ' ') goto yy213;
  1284 			if (yych <= ' ') goto yy213;
  1286 		} else {
  1285 			if (yych <= 'c') goto yy215;
  1287 			if (yych <= 'c') goto yy215;
  1286 			if (yych <= 'd') goto yy219;
  1288 			if (yych <= 'd') goto yy220;
  1287 			goto yy216;
  1289 			if (yych <= 'e') goto yy217;
  1288 		}
  1290 		}
  1289 	} else {
  1291 	} else {
  1290 		if (yych <= 'k') {
  1292 		if (yych <= 'o') {
  1291 			if (yych == 'i') goto yy217;
  1293 			if (yych <= 'i') goto yy218;
  1292 		} else {
  1294 			if (yych == 'l') goto yy221;
  1293 			if (yych <= 'l') goto yy220;
  1295 		} else {
  1294 			if (yych == 'u') goto yy218;
  1296 			if (yych <= 'p') goto yy216;
       
  1297 			if (yych == 'u') goto yy219;
  1295 		}
  1298 		}
  1296 	}
  1299 	}
  1297 yy215:
  1300 yy215:
  1298 	YYCURSOR = YYMARKER;
  1301 	YYCURSOR = YYMARKER;
  1299 	if (yyaccept <= 0) {
  1302 	if (yyaccept <= 0) {
  1300 		goto yy207;
  1303 		goto yy207;
  1301 	} else {
  1304 	} else {
  1302 		goto yy238;
  1305 		goto yy239;
  1303 	}
  1306 	}
  1304 yy216:
  1307 yy216:
  1305 	yych = *++YYCURSOR;
  1308 	yych = *++YYCURSOR;
       
  1309 	if (yych == 'r') goto yy272;
       
  1310 	goto yy215;
       
  1311 yy217:
       
  1312 	yych = *++YYCURSOR;
  1306 	if (yych <= 'm') {
  1313 	if (yych <= 'm') {
  1307 		if (yych == 'l') goto yy254;
  1314 		if (yych == 'l') goto yy255;
  1308 		goto yy215;
  1315 		goto yy215;
  1309 	} else {
  1316 	} else {
  1310 		if (yych <= 'n') goto yy255;
  1317 		if (yych <= 'n') goto yy256;
  1311 		if (yych == 'r') goto yy256;
  1318 		if (yych == 'r') goto yy257;
  1312 		goto yy215;
  1319 		goto yy215;
  1313 	}
  1320 	}
  1314 yy217:
       
  1315 	yych = *++YYCURSOR;
       
  1316 	if (yych == 'f') goto yy237;
       
  1317 	if (yych == 'n') goto yy236;
       
  1318 	goto yy215;
       
  1319 yy218:
  1321 yy218:
  1320 	yych = *++YYCURSOR;
  1322 	yych = *++YYCURSOR;
  1321 	if (yych == 'n') goto yy231;
  1323 	if (yych == 'f') goto yy238;
       
  1324 	if (yych == 'n') goto yy237;
  1322 	goto yy215;
  1325 	goto yy215;
  1323 yy219:
  1326 yy219:
  1324 	yych = *++YYCURSOR;
  1327 	yych = *++YYCURSOR;
  1325 	if (yych == 'e') goto yy225;
  1328 	if (yych == 'n') goto yy232;
  1326 	goto yy215;
  1329 	goto yy215;
  1327 yy220:
  1330 yy220:
  1328 	yych = *++YYCURSOR;
  1331 	yych = *++YYCURSOR;
       
  1332 	if (yych == 'e') goto yy226;
       
  1333 	goto yy215;
       
  1334 yy221:
       
  1335 	yych = *++YYCURSOR;
  1329 	if (yych != 'i') goto yy215;
  1336 	if (yych != 'i') goto yy215;
  1330 	yych = *++YYCURSOR;
  1337 	yych = *++YYCURSOR;
  1331 	if (yych != 'n') goto yy215;
  1338 	if (yych != 'n') goto yy215;
  1332 	yych = *++YYCURSOR;
  1339 	yych = *++YYCURSOR;
  1333 	if (yych != 'e') goto yy215;
  1340 	if (yych != 'e') goto yy215;
  1334 	++YYCURSOR;
  1341 	++YYCURSOR;
  1335 	{ RET(TOKEN_PP_LINE); }
  1342 	{ RET(TOKEN_PP_LINE); }
  1336 yy225:
  1343 yy226:
  1337 	yych = *++YYCURSOR;
  1344 	yych = *++YYCURSOR;
  1338 	if (yych != 'f') goto yy215;
  1345 	if (yych != 'f') goto yy215;
  1339 	yych = *++YYCURSOR;
  1346 	yych = *++YYCURSOR;
  1340 	if (yych != 'i') goto yy215;
  1347 	if (yych != 'i') goto yy215;
  1341 	yych = *++YYCURSOR;
  1348 	yych = *++YYCURSOR;
  1342 	if (yych != 'n') goto yy215;
  1349 	if (yych != 'n') goto yy215;
  1343 	yych = *++YYCURSOR;
  1350 	yych = *++YYCURSOR;
  1344 	if (yych != 'e') goto yy215;
  1351 	if (yych != 'e') goto yy215;
  1345 	++YYCURSOR;
  1352 	++YYCURSOR;
  1346 	{ RET(TOKEN_PP_DEFINE); }
  1353 	{ RET(TOKEN_PP_DEFINE); }
  1347 yy231:
  1354 yy232:
  1348 	yych = *++YYCURSOR;
  1355 	yych = *++YYCURSOR;
  1349 	if (yych != 'd') goto yy215;
  1356 	if (yych != 'd') goto yy215;
  1350 	yych = *++YYCURSOR;
  1357 	yych = *++YYCURSOR;
  1351 	if (yych != 'e') goto yy215;
  1358 	if (yych != 'e') goto yy215;
  1352 	yych = *++YYCURSOR;
  1359 	yych = *++YYCURSOR;
  1353 	if (yych != 'f') goto yy215;
  1360 	if (yych != 'f') goto yy215;
  1354 	++YYCURSOR;
  1361 	++YYCURSOR;
  1355 	{ RET(TOKEN_PP_UNDEF); }
  1362 	{ RET(TOKEN_PP_UNDEF); }
  1356 yy236:
  1363 yy237:
  1357 	yych = *++YYCURSOR;
  1364 	yych = *++YYCURSOR;
  1358 	if (yych == 'c') goto yy248;
  1365 	if (yych == 'c') goto yy249;
  1359 	goto yy215;
  1366 	goto yy215;
  1360 yy237:
  1367 yy238:
  1361 	yyaccept = 1;
  1368 	yyaccept = 1;
  1362 	yych = *(YYMARKER = ++YYCURSOR);
  1369 	yych = *(YYMARKER = ++YYCURSOR);
  1363 	if (yych == 'd') goto yy240;
  1370 	if (yych == 'd') goto yy241;
  1364 	if (yych == 'n') goto yy239;
  1371 	if (yych == 'n') goto yy240;
  1365 yy238:
  1372 yy239:
  1366 	{ RET(TOKEN_PP_IF); }
  1373 	{ RET(TOKEN_PP_IF); }
  1367 yy239:
  1374 yy240:
  1368 	yych = *++YYCURSOR;
  1375 	yych = *++YYCURSOR;
  1369 	if (yych == 'd') goto yy244;
  1376 	if (yych == 'd') goto yy245;
  1370 	goto yy215;
  1377 	goto yy215;
  1371 yy240:
  1378 yy241:
  1372 	yych = *++YYCURSOR;
  1379 	yych = *++YYCURSOR;
  1373 	if (yych != 'e') goto yy215;
  1380 	if (yych != 'e') goto yy215;
  1374 	yych = *++YYCURSOR;
  1381 	yych = *++YYCURSOR;
  1375 	if (yych != 'f') goto yy215;
  1382 	if (yych != 'f') goto yy215;
  1376 	++YYCURSOR;
  1383 	++YYCURSOR;
  1377 	{ RET(TOKEN_PP_IFDEF); }
  1384 	{ RET(TOKEN_PP_IFDEF); }
  1378 yy244:
  1385 yy245:
  1379 	yych = *++YYCURSOR;
  1386 	yych = *++YYCURSOR;
  1380 	if (yych != 'e') goto yy215;
  1387 	if (yych != 'e') goto yy215;
  1381 	yych = *++YYCURSOR;
  1388 	yych = *++YYCURSOR;
  1382 	if (yych != 'f') goto yy215;
  1389 	if (yych != 'f') goto yy215;
  1383 	++YYCURSOR;
  1390 	++YYCURSOR;
  1384 	{ RET(TOKEN_PP_IFNDEF); }
  1391 	{ RET(TOKEN_PP_IFNDEF); }
  1385 yy248:
  1392 yy249:
  1386 	yych = *++YYCURSOR;
  1393 	yych = *++YYCURSOR;
  1387 	if (yych != 'l') goto yy215;
  1394 	if (yych != 'l') goto yy215;
  1388 	yych = *++YYCURSOR;
  1395 	yych = *++YYCURSOR;
  1389 	if (yych != 'u') goto yy215;
  1396 	if (yych != 'u') goto yy215;
  1390 	yych = *++YYCURSOR;
  1397 	yych = *++YYCURSOR;
  1391 	if (yych != 'd') goto yy215;
  1398 	if (yych != 'd') goto yy215;
  1392 	yych = *++YYCURSOR;
  1399 	yych = *++YYCURSOR;
  1393 	if (yych != 'e') goto yy215;
  1400 	if (yych != 'e') goto yy215;
  1394 	++YYCURSOR;
  1401 	++YYCURSOR;
  1395 	{ RET(TOKEN_PP_INCLUDE); }
  1402 	{ RET(TOKEN_PP_INCLUDE); }
  1396 yy254:
       
  1397 	yych = *++YYCURSOR;
       
  1398 	if (yych == 'i') goto yy265;
       
  1399 	if (yych == 's') goto yy266;
       
  1400 	goto yy215;
       
  1401 yy255:
  1403 yy255:
  1402 	yych = *++YYCURSOR;
  1404 	yych = *++YYCURSOR;
  1403 	if (yych == 'd') goto yy261;
  1405 	if (yych == 'i') goto yy266;
       
  1406 	if (yych == 's') goto yy267;
  1404 	goto yy215;
  1407 	goto yy215;
  1405 yy256:
  1408 yy256:
  1406 	yych = *++YYCURSOR;
  1409 	yych = *++YYCURSOR;
       
  1410 	if (yych == 'd') goto yy262;
       
  1411 	goto yy215;
       
  1412 yy257:
       
  1413 	yych = *++YYCURSOR;
  1407 	if (yych != 'r') goto yy215;
  1414 	if (yych != 'r') goto yy215;
  1408 	yych = *++YYCURSOR;
  1415 	yych = *++YYCURSOR;
  1409 	if (yych != 'o') goto yy215;
  1416 	if (yych != 'o') goto yy215;
  1410 	yych = *++YYCURSOR;
  1417 	yych = *++YYCURSOR;
  1411 	if (yych != 'r') goto yy215;
  1418 	if (yych != 'r') goto yy215;
  1412 	++YYCURSOR;
  1419 	++YYCURSOR;
  1413 	{ RET(TOKEN_PP_ERROR); }
  1420 	{ RET(TOKEN_PP_ERROR); }
  1414 yy261:
  1421 yy262:
  1415 	yych = *++YYCURSOR;
  1422 	yych = *++YYCURSOR;
  1416 	if (yych != 'i') goto yy215;
  1423 	if (yych != 'i') goto yy215;
  1417 	yych = *++YYCURSOR;
  1424 	yych = *++YYCURSOR;
  1418 	if (yych != 'f') goto yy215;
  1425 	if (yych != 'f') goto yy215;
  1419 	++YYCURSOR;
  1426 	++YYCURSOR;
  1420 	{ RET(TOKEN_PP_ENDIF); }
  1427 	{ RET(TOKEN_PP_ENDIF); }
  1421 yy265:
  1428 yy266:
  1422 	yych = *++YYCURSOR;
  1429 	yych = *++YYCURSOR;
  1423 	if (yych == 'f') goto yy269;
  1430 	if (yych == 'f') goto yy270;
  1424 	goto yy215;
  1431 	goto yy215;
  1425 yy266:
  1432 yy267:
  1426 	yych = *++YYCURSOR;
  1433 	yych = *++YYCURSOR;
  1427 	if (yych != 'e') goto yy215;
  1434 	if (yych != 'e') goto yy215;
  1428 	++YYCURSOR;
  1435 	++YYCURSOR;
  1429 	{ RET(TOKEN_PP_ELSE); }
  1436 	{ RET(TOKEN_PP_ELSE); }
  1430 yy269:
  1437 yy270:
  1431 	++YYCURSOR;
  1438 	++YYCURSOR;
  1432 	{ RET(TOKEN_PP_ELIF); }
  1439 	{ RET(TOKEN_PP_ELIF); }
       
  1440 yy272:
       
  1441 	yych = *++YYCURSOR;
       
  1442 	if (yych != 'a') goto yy215;
       
  1443 	yych = *++YYCURSOR;
       
  1444 	if (yych != 'g') goto yy215;
       
  1445 	yych = *++YYCURSOR;
       
  1446 	if (yych != 'm') goto yy215;
       
  1447 	yych = *++YYCURSOR;
       
  1448 	if (yych != 'a') goto yy215;
       
  1449 	++YYCURSOR;
       
  1450 	{ RET(TOKEN_PP_PRAGMA); }
  1433 }
  1451 }
  1434 
  1452 
  1435 
  1453 
  1436 bad_chars:
  1454 bad_chars:
  1437     if (YYLIMIT == YYCURSOR) YYFILL(1);
  1455     if (YYLIMIT == YYCURSOR) YYFILL(1);
  1440 	YYCTYPE yych;
  1458 	YYCTYPE yych;
  1441 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
  1459 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
  1442 	yych = *YYCURSOR;
  1460 	yych = *YYCURSOR;
  1443 	if (yych <= '#') {
  1461 	if (yych <= '#') {
  1444 		if (yych <= '\r') {
  1462 		if (yych <= '\r') {
  1445 			if (yych <= 0x00) goto yy275;
  1463 			if (yych <= 0x00) goto yy282;
  1446 			if (yych <= 0x08) goto yy277;
  1464 			if (yych <= 0x08) goto yy284;
  1447 		} else {
  1465 		} else {
  1448 			if (yych <= 0x1F) goto yy277;
  1466 			if (yych <= 0x1F) goto yy284;
  1449 			if (yych == '"') goto yy277;
  1467 			if (yych == '"') goto yy284;
  1450 		}
  1468 		}
  1451 	} else {
  1469 	} else {
  1452 		if (yych <= '@') {
  1470 		if (yych <= '@') {
  1453 			if (yych <= '$') goto yy277;
  1471 			if (yych <= '$') goto yy284;
  1454 			if (yych >= '@') goto yy277;
  1472 			if (yych >= '@') goto yy284;
  1455 		} else {
  1473 		} else {
  1456 			if (yych == '`') goto yy277;
  1474 			if (yych == '`') goto yy284;
  1457 			if (yych >= 0x7F) goto yy277;
  1475 			if (yych >= 0x7F) goto yy284;
  1458 		}
  1476 		}
  1459 	}
  1477 	}
  1460 	++YYCURSOR;
  1478 	++YYCURSOR;
  1461 	{ cursor--; RET(TOKEN_BAD_CHARS); }
  1479 	{ cursor--; RET(TOKEN_BAD_CHARS); }
  1462 yy275:
  1480 yy282:
  1463 	++YYCURSOR;
  1481 	++YYCURSOR;
  1464 	{
  1482 	{
  1465                         if (eoi)
  1483                         if (eoi)
  1466                         {
  1484                         {
  1467                             assert( !((token >= sentinel) &&
  1485                             assert( !((token >= sentinel) &&
  1470                             cursor = (uchar *) s->source_base + s->orig_length;
  1488                             cursor = (uchar *) s->source_base + s->orig_length;
  1471                             RET(TOKEN_BAD_CHARS);  // next call will be EOI.
  1489                             RET(TOKEN_BAD_CHARS);  // next call will be EOI.
  1472                         }
  1490                         }
  1473                         goto bad_chars;
  1491                         goto bad_chars;
  1474                     }
  1492                     }
  1475 yy277:
  1493 yy284:
  1476 	++YYCURSOR;
  1494 	++YYCURSOR;
  1477 	{ goto bad_chars; }
  1495 	{ goto bad_chars; }
  1478 }
  1496 }
  1479 
  1497 
  1480 
  1498