diff --git a/.gitattributes b/.gitattributes index c9a54fbd472ecc..5c10850a550cb6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -59,3 +59,4 @@ Doc/library/token-list.inc linguist-generated=true Include/token.h linguist-generated=true Lib/token.py linguist-generated=true Parser/token.c linguist-generated=true +Modules/gramvalid.c linguist-generated=true diff --git a/Include/node.h b/Include/node.h index 2b390740973873..96a995fb797967 100644 --- a/Include/node.h +++ b/Include/node.h @@ -22,6 +22,7 @@ PyAPI_FUNC(node *) PyNode_New(int type); PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, char *str, int lineno, int col_offset, int end_lineno, int end_col_offset); +PyAPI_FUNC(void) PyNode_Compress(node *n); PyAPI_FUNC(void) PyNode_Free(node *n); #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); diff --git a/Makefile.pre.in b/Makefile.pre.in index cd7098cac72b1d..75982d34630d37 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -794,9 +794,11 @@ regen-grammar: regen-token $(PYTHON_FOR_REGEN) -m Parser.pgen $(srcdir)/Grammar/Grammar \ $(srcdir)/Grammar/Tokens \ $(srcdir)/Include/graminit.h.new \ - $(srcdir)/Python/graminit.c.new + $(srcdir)/Python/graminit.c.new \ + $(srcdir)/Modules/gramvalid.c.new $(UPDATE_FILE) $(srcdir)/Include/graminit.h $(srcdir)/Include/graminit.h.new $(UPDATE_FILE) $(srcdir)/Python/graminit.c $(srcdir)/Python/graminit.c.new + $(UPDATE_FILE) $(srcdir)/Modules/gramvalid.c $(srcdir)/Modules/gramvalid.c.new .PHONY=regen-ast regen-ast: diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-12-06-16-55-19.bpo-26415.jbufv5.rst b/Misc/NEWS.d/next/Core and Builtins/2018-12-06-16-55-19.bpo-26415.jbufv5.rst new file mode 100644 index 00000000000000..ceddaa71632abd --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-12-06-16-55-19.bpo-26415.jbufv5.rst @@ -0,0 +1,3 @@ +Reduce peak memory consumption by the parser, by compressing some +branchless stretches in the parse tree into a single node. AST is +not affected. diff --git a/Modules/gramvalid.c b/Modules/gramvalid.c new file mode 100644 index 00000000000000..4b702c7fcdf3c7 --- /dev/null +++ b/Modules/gramvalid.c @@ -0,0 +1,4736 @@ +/* Generated by Parser/pgen */ + +#include "grammar.h" +grammar ValidationGrammar; +static const arc arcs_0_0[12] = { + {2, 1}, + {3, 2}, + {112, 2}, + {113, 2}, + {114, 2}, + {115, 2}, + {116, 2}, + {53, 2}, + {117, 2}, + {55, 2}, + {56, 2}, + {4, 1}, +}; +static const arc arcs_0_1[1] = { + {0, 1}, +}; +static const arc arcs_0_2[1] = { + {2, 1}, +}; +static state states_0[3] = { + {12, arcs_0_0}, + {1, arcs_0_1}, + {1, arcs_0_2}, +}; +static const arc arcs_1_0[14] = { + {44, 1}, + {2, 0}, + {45, 0}, + {3, 0}, + {4, 0}, + {112, 0}, + {113, 0}, + {114, 0}, + {115, 0}, + {116, 0}, + {53, 0}, + {117, 0}, + {55, 0}, + {56, 0}, +}; +static const arc arcs_1_1[1] = { + {0, 1}, +}; +static state states_1[2] = { + {14, arcs_1_0}, + {1, arcs_1_1}, +}; +static const arc arcs_2_0[24] = { + {47, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {60, 1}, + {126, 1}, +}; +static const arc arcs_2_1[2] = { + {44, 2}, + {2, 1}, +}; +static const arc arcs_2_2[1] = { + {0, 2}, +}; +static state states_2[3] = { + {24, arcs_2_0}, + {2, arcs_2_1}, + {1, arcs_2_2}, +}; +static const arc arcs_3_0[1] = { + {10, 1}, +}; +static const arc arcs_3_1[2] = { + {49, 2}, + {40, 2}, +}; +static const arc arcs_3_2[2] = { + {5, 3}, + {2, 4}, +}; +static const arc arcs_3_3[26] = { + {50, 5}, + {51, 6}, + {131, 6}, + {132, 6}, + {135, 6}, + {137, 6}, + {9, 6}, + {139, 6}, + {11, 6}, + {12, 6}, + {13, 6}, + {148, 6}, + {150, 6}, + {152, 6}, + {154, 6}, + {157, 6}, + {158, 6}, + {162, 6}, + {163, 6}, + {164, 6}, + {40, 6}, + {41, 6}, + {42, 6}, + {174, 6}, + {60, 6}, + {126, 6}, +}; +static const arc arcs_3_4[1] = { + {0, 4}, +}; +static const arc arcs_3_5[1] = { + {2, 4}, +}; +static const arc arcs_3_6[1] = { + {50, 5}, +}; +static state states_3[7] = { + {1, arcs_3_0}, + {2, arcs_3_1}, + {2, arcs_3_2}, + {26, arcs_3_3}, + {1, arcs_3_4}, + {1, arcs_3_5}, + {1, arcs_3_6}, +}; +static const arc arcs_4_0[1] = { + {48, 1}, +}; +static const arc arcs_4_1[2] = { + {0, 1}, + {48, 1}, +}; +static state states_4[2] = { + {1, arcs_4_0}, + {2, arcs_4_1}, +}; +static const arc arcs_5_0[2] = { + {52, 1}, + {48, 1}, +}; +static const arc arcs_5_1[3] = { + {54, 2}, + {55, 2}, + {56, 2}, +}; +static const arc arcs_5_2[1] = { + {0, 2}, +}; +static state states_5[3] = { + {2, arcs_5_0}, + {3, arcs_5_1}, + {1, arcs_5_2}, +}; +static const arc arcs_6_0[1] = { + {38, 1}, +}; +static const arc arcs_6_1[1] = { + {56, 2}, +}; +static const arc arcs_6_2[1] = { + {0, 2}, +}; +static state states_6[3] = { + {1, arcs_6_0}, + {1, arcs_6_1}, + {1, arcs_6_2}, +}; +static const arc arcs_7_0[1] = { + {19, 1}, +}; +static const arc arcs_7_1[1] = { + {40, 2}, +}; +static const arc arcs_7_2[1] = { + {57, 3}, +}; +static const arc arcs_7_3[2] = { + {58, 4}, + {59, 5}, +}; +static const arc arcs_7_4[23] = { + {60, 6}, + {131, 6}, + {132, 6}, + {135, 6}, + {137, 6}, + {9, 6}, + {139, 6}, + {11, 6}, + {12, 6}, + {13, 6}, + {148, 6}, + {150, 6}, + {152, 6}, + {154, 6}, + {157, 6}, + {158, 6}, + {162, 6}, + {163, 6}, + {164, 6}, + {40, 6}, + {41, 6}, + {42, 6}, + {126, 6}, +}; +static const arc arcs_7_5[3] = { + {61, 7}, + {62, 8}, + {4, 8}, +}; +static const arc arcs_7_6[1] = { + {59, 5}, +}; +static const arc arcs_7_7[2] = { + {62, 8}, + {4, 8}, +}; +static const arc arcs_7_8[1] = { + {0, 8}, +}; +static state states_7[9] = { + {1, arcs_7_0}, + {1, arcs_7_1}, + {1, arcs_7_2}, + {2, arcs_7_3}, + {23, arcs_7_4}, + {3, arcs_7_5}, + {1, arcs_7_6}, + {2, arcs_7_7}, + {1, arcs_7_8}, +}; +static const arc arcs_8_0[1] = { + {5, 1}, +}; +static const arc arcs_8_1[5] = { + {50, 2}, + {63, 3}, + {40, 3}, + {65, 3}, + {6, 3}, +}; +static const arc arcs_8_2[1] = { + {0, 2}, +}; +static const arc arcs_8_3[1] = { + {50, 2}, +}; +static state states_8[4] = { + {1, arcs_8_0}, + {5, arcs_8_1}, + {1, arcs_8_2}, + {1, arcs_8_3}, +}; +static const arc arcs_9_0[4] = { + {6, 1}, + {64, 2}, + {65, 3}, + {40, 3}, +}; +static const arc arcs_9_1[5] = { + {0, 1}, + {66, 4}, + {61, 5}, + {65, 6}, + {40, 6}, +}; +static const arc arcs_9_2[2] = { + {65, 7}, + {40, 7}, +}; +static const arc arcs_9_3[4] = { + {0, 3}, + {66, 8}, + {67, 9}, + {61, 5}, +}; +static const arc arcs_9_4[5] = { + {0, 4}, + {64, 2}, + {61, 10}, + {65, 11}, + {40, 11}, +}; +static const arc arcs_9_5[1] = { + {0, 5}, +}; +static const arc arcs_9_6[3] = { + {0, 6}, + {66, 4}, + {61, 5}, +}; +static const arc arcs_9_7[3] = { + {0, 7}, + {66, 12}, + {61, 5}, +}; +static const arc arcs_9_8[6] = { + {0, 8}, + {6, 13}, + {64, 2}, + {61, 14}, + {65, 3}, + {40, 3}, +}; +static const arc arcs_9_9[23] = { + {60, 15}, + {131, 15}, + {132, 15}, + {135, 15}, + {137, 15}, + {9, 15}, + {139, 15}, + {11, 15}, + {12, 15}, + {13, 15}, + {148, 15}, + {150, 15}, + {152, 15}, + {154, 15}, + {157, 15}, + {158, 15}, + {162, 15}, + {163, 15}, + {164, 15}, + {40, 15}, + {41, 15}, + {42, 15}, + {126, 15}, +}; +static const arc arcs_9_10[4] = { + {0, 10}, + {64, 2}, + {65, 11}, + {40, 11}, +}; +static const arc arcs_9_11[4] = { + {0, 11}, + {66, 4}, + {67, 16}, + {61, 5}, +}; +static const arc arcs_9_12[2] = { + {0, 12}, + {61, 5}, +}; +static const arc arcs_9_13[5] = { + {0, 13}, + {66, 17}, + {61, 5}, + {65, 18}, + {40, 18}, +}; +static const arc arcs_9_14[5] = { + {0, 14}, + {6, 13}, + {64, 2}, + {65, 3}, + {40, 3}, +}; +static const arc arcs_9_15[3] = { + {0, 15}, + {66, 8}, + {61, 5}, +}; +static const arc arcs_9_16[23] = { + {60, 6}, + {131, 6}, + {132, 6}, + {135, 6}, + {137, 6}, + {9, 6}, + {139, 6}, + {11, 6}, + {12, 6}, + {13, 6}, + {148, 6}, + {150, 6}, + {152, 6}, + {154, 6}, + {157, 6}, + {158, 6}, + {162, 6}, + {163, 6}, + {164, 6}, + {40, 6}, + {41, 6}, + {42, 6}, + {126, 6}, +}; +static const arc arcs_9_17[5] = { + {0, 17}, + {64, 2}, + {61, 19}, + {65, 20}, + {40, 20}, +}; +static const arc arcs_9_18[3] = { + {0, 18}, + {66, 17}, + {61, 5}, +}; +static const arc arcs_9_19[4] = { + {0, 19}, + {64, 2}, + {65, 20}, + {40, 20}, +}; +static const arc arcs_9_20[4] = { + {0, 20}, + {66, 17}, + {67, 21}, + {61, 5}, +}; +static const arc arcs_9_21[23] = { + {60, 18}, + {131, 18}, + {132, 18}, + {135, 18}, + {137, 18}, + {9, 18}, + {139, 18}, + {11, 18}, + {12, 18}, + {13, 18}, + {148, 18}, + {150, 18}, + {152, 18}, + {154, 18}, + {157, 18}, + {158, 18}, + {162, 18}, + {163, 18}, + {164, 18}, + {40, 18}, + {41, 18}, + {42, 18}, + {126, 18}, +}; +static state states_9[22] = { + {4, arcs_9_0}, + {5, arcs_9_1}, + {2, arcs_9_2}, + {4, arcs_9_3}, + {5, arcs_9_4}, + {1, arcs_9_5}, + {3, arcs_9_6}, + {3, arcs_9_7}, + {6, arcs_9_8}, + {23, arcs_9_9}, + {4, arcs_9_10}, + {4, arcs_9_11}, + {2, arcs_9_12}, + {5, arcs_9_13}, + {5, arcs_9_14}, + {3, arcs_9_15}, + {23, arcs_9_16}, + {5, arcs_9_17}, + {3, arcs_9_18}, + {4, arcs_9_19}, + {4, arcs_9_20}, + {23, arcs_9_21}, +}; +static const arc arcs_10_0[1] = { + {40, 1}, +}; +static const arc arcs_10_1[2] = { + {0, 1}, + {59, 2}, +}; +static const arc arcs_10_2[23] = { + {60, 3}, + {131, 3}, + {132, 3}, + {135, 3}, + {137, 3}, + {9, 3}, + {139, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {148, 3}, + {150, 3}, + {152, 3}, + {154, 3}, + {157, 3}, + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {41, 3}, + {42, 3}, + {126, 3}, +}; +static const arc arcs_10_3[1] = { + {0, 3}, +}; +static state states_10[4] = { + {1, arcs_10_0}, + {2, arcs_10_1}, + {23, arcs_10_2}, + {1, arcs_10_3}, +}; +static const arc arcs_11_0[4] = { + {6, 1}, + {64, 2}, + {69, 3}, + {40, 3}, +}; +static const arc arcs_11_1[4] = { + {0, 1}, + {66, 4}, + {69, 5}, + {40, 5}, +}; +static const arc arcs_11_2[2] = { + {69, 6}, + {40, 6}, +}; +static const arc arcs_11_3[3] = { + {0, 3}, + {66, 7}, + {67, 8}, +}; +static const arc arcs_11_4[4] = { + {0, 4}, + {64, 2}, + {69, 9}, + {40, 9}, +}; +static const arc arcs_11_5[2] = { + {0, 5}, + {66, 4}, +}; +static const arc arcs_11_6[2] = { + {0, 6}, + {66, 10}, +}; +static const arc arcs_11_7[5] = { + {0, 7}, + {6, 11}, + {64, 2}, + {69, 3}, + {40, 3}, +}; +static const arc arcs_11_8[23] = { + {60, 12}, + {131, 12}, + {132, 12}, + {135, 12}, + {137, 12}, + {9, 12}, + {139, 12}, + {11, 12}, + {12, 12}, + {13, 12}, + {148, 12}, + {150, 12}, + {152, 12}, + {154, 12}, + {157, 12}, + {158, 12}, + {162, 12}, + {163, 12}, + {164, 12}, + {40, 12}, + {41, 12}, + {42, 12}, + {126, 12}, +}; +static const arc arcs_11_9[3] = { + {0, 9}, + {66, 4}, + {67, 13}, +}; +static const arc arcs_11_10[1] = { + {0, 10}, +}; +static const arc arcs_11_11[4] = { + {0, 11}, + {66, 14}, + {69, 15}, + {40, 15}, +}; +static const arc arcs_11_12[2] = { + {0, 12}, + {66, 7}, +}; +static const arc arcs_11_13[23] = { + {60, 5}, + {131, 5}, + {132, 5}, + {135, 5}, + {137, 5}, + {9, 5}, + {139, 5}, + {11, 5}, + {12, 5}, + {13, 5}, + {148, 5}, + {150, 5}, + {152, 5}, + {154, 5}, + {157, 5}, + {158, 5}, + {162, 5}, + {163, 5}, + {164, 5}, + {40, 5}, + {41, 5}, + {42, 5}, + {126, 5}, +}; +static const arc arcs_11_14[4] = { + {0, 14}, + {64, 2}, + {69, 16}, + {40, 16}, +}; +static const arc arcs_11_15[2] = { + {0, 15}, + {66, 14}, +}; +static const arc arcs_11_16[3] = { + {0, 16}, + {66, 14}, + {67, 17}, +}; +static const arc arcs_11_17[23] = { + {60, 15}, + {131, 15}, + {132, 15}, + {135, 15}, + {137, 15}, + {9, 15}, + {139, 15}, + {11, 15}, + {12, 15}, + {13, 15}, + {148, 15}, + {150, 15}, + {152, 15}, + {154, 15}, + {157, 15}, + {158, 15}, + {162, 15}, + {163, 15}, + {164, 15}, + {40, 15}, + {41, 15}, + {42, 15}, + {126, 15}, +}; +static state states_11[18] = { + {4, arcs_11_0}, + {4, arcs_11_1}, + {2, arcs_11_2}, + {3, arcs_11_3}, + {4, arcs_11_4}, + {2, arcs_11_5}, + {2, arcs_11_6}, + {5, arcs_11_7}, + {23, arcs_11_8}, + {3, arcs_11_9}, + {1, arcs_11_10}, + {4, arcs_11_11}, + {2, arcs_11_12}, + {23, arcs_11_13}, + {4, arcs_11_14}, + {2, arcs_11_15}, + {3, arcs_11_16}, + {23, arcs_11_17}, +}; +static const arc arcs_12_0[1] = { + {40, 1}, +}; +static const arc arcs_12_1[1] = { + {0, 1}, +}; +static state states_12[2] = { + {1, arcs_12_0}, + {1, arcs_12_1}, +}; +static const arc arcs_13_0[11] = { + {3, 1}, + {112, 1}, + {113, 1}, + {114, 1}, + {115, 1}, + {116, 1}, + {53, 1}, + {117, 1}, + {55, 1}, + {56, 1}, + {4, 1}, +}; +static const arc arcs_13_1[1] = { + {0, 1}, +}; +static state states_13[2] = { + {11, arcs_13_0}, + {1, arcs_13_1}, +}; +static const arc arcs_14_0[48] = { + {70, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {9, 1}, + {137, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {16, 1}, + {18, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {29, 1}, + {30, 1}, + {31, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {35, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {60, 1}, + {72, 1}, + {73, 1}, + {74, 1}, + {75, 1}, + {76, 1}, + {77, 1}, + {78, 1}, + {79, 1}, + {80, 1}, + {83, 1}, + {84, 1}, + {99, 1}, + {100, 1}, + {101, 1}, + {102, 1}, + {103, 1}, + {104, 1}, + {105, 1}, + {126, 1}, +}; +static const arc arcs_14_1[2] = { + {71, 2}, + {2, 3}, +}; +static const arc arcs_14_2[49] = { + {2, 3}, + {70, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {9, 1}, + {137, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {16, 1}, + {18, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {29, 1}, + {30, 1}, + {31, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {35, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {60, 1}, + {72, 1}, + {73, 1}, + {74, 1}, + {75, 1}, + {76, 1}, + {77, 1}, + {78, 1}, + {79, 1}, + {80, 1}, + {83, 1}, + {84, 1}, + {99, 1}, + {100, 1}, + {101, 1}, + {102, 1}, + {103, 1}, + {104, 1}, + {105, 1}, + {126, 1}, +}; +static const arc arcs_14_3[1] = { + {0, 3}, +}; +static state states_14[4] = { + {48, arcs_14_0}, + {2, arcs_14_1}, + {49, arcs_14_2}, + {1, arcs_14_3}, +}; +static const arc arcs_15_0[47] = { + {72, 1}, + {73, 1}, + {74, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {80, 1}, + {84, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {60, 1}, + {126, 1}, + {75, 1}, + {99, 1}, + {100, 1}, + {101, 1}, + {102, 1}, + {103, 1}, + {35, 1}, + {16, 1}, + {18, 1}, + {83, 1}, + {30, 1}, + {31, 1}, + {76, 1}, + {77, 1}, + {104, 1}, + {105, 1}, + {78, 1}, + {79, 1}, + {29, 1}, +}; +static const arc arcs_15_1[1] = { + {0, 1}, +}; +static state states_15[2] = { + {47, arcs_15_0}, + {1, arcs_15_1}, +}; +static const arc arcs_16_0[25] = { + {80, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {84, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {60, 1}, + {126, 1}, +}; +static const arc arcs_16_1[17] = { + {0, 1}, + {67, 2}, + {81, 3}, + {82, 4}, + {96, 4}, + {97, 4}, + {85, 4}, + {86, 4}, + {87, 4}, + {88, 4}, + {89, 4}, + {90, 4}, + {91, 4}, + {92, 4}, + {93, 4}, + {94, 4}, + {95, 4}, +}; +static const arc arcs_16_2[27] = { + {80, 5}, + {131, 5}, + {132, 5}, + {135, 5}, + {137, 5}, + {9, 5}, + {139, 5}, + {11, 5}, + {12, 5}, + {13, 5}, + {84, 5}, + {148, 5}, + {150, 5}, + {152, 5}, + {154, 5}, + {157, 5}, + {158, 5}, + {162, 5}, + {163, 5}, + {164, 5}, + {40, 5}, + {41, 5}, + {42, 5}, + {60, 5}, + {126, 5}, + {83, 5}, + {35, 5}, +}; +static const arc arcs_16_3[1] = { + {0, 3}, +}; +static const arc arcs_16_4[26] = { + {47, 3}, + {131, 3}, + {132, 3}, + {135, 3}, + {137, 3}, + {9, 3}, + {139, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {148, 3}, + {150, 3}, + {152, 3}, + {154, 3}, + {157, 3}, + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {41, 3}, + {42, 3}, + {60, 3}, + {126, 3}, + {83, 3}, + {35, 3}, +}; +static const arc arcs_16_5[3] = { + {0, 5}, + {67, 2}, + {61, 3}, +}; +static state states_16[6] = { + {25, arcs_16_0}, + {17, arcs_16_1}, + {27, arcs_16_2}, + {1, arcs_16_3}, + {26, arcs_16_4}, + {3, arcs_16_5}, +}; +static const arc arcs_17_0[1] = { + {59, 1}, +}; +static const arc arcs_17_1[23] = { + {60, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_17_2[2] = { + {0, 2}, + {67, 3}, +}; +static const arc arcs_17_3[26] = { + {47, 4}, + {131, 4}, + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {60, 4}, + {126, 4}, + {83, 4}, + {35, 4}, +}; +static const arc arcs_17_4[1] = { + {0, 4}, +}; +static state states_17[5] = { + {1, arcs_17_0}, + {23, arcs_17_1}, + {2, arcs_17_2}, + {26, arcs_17_3}, + {1, arcs_17_4}, +}; +static const arc arcs_18_0[24] = { + {84, 1}, + {60, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static const arc arcs_18_1[2] = { + {0, 1}, + {66, 2}, +}; +static const arc arcs_18_2[25] = { + {0, 2}, + {84, 1}, + {60, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static state states_18[3] = { + {24, arcs_18_0}, + {2, arcs_18_1}, + {25, arcs_18_2}, +}; +static const arc arcs_19_0[13] = { + {85, 1}, + {86, 1}, + {87, 1}, + {88, 1}, + {89, 1}, + {90, 1}, + {91, 1}, + {92, 1}, + {93, 1}, + {94, 1}, + {95, 1}, + {96, 1}, + {97, 1}, +}; +static const arc arcs_19_1[1] = { + {0, 1}, +}; +static state states_19[2] = { + {13, arcs_19_0}, + {1, arcs_19_1}, +}; +static const arc arcs_20_0[1] = { + {20, 1}, +}; +static const arc arcs_20_1[19] = { + {98, 2}, + {9, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {84, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_20_2[1] = { + {0, 2}, +}; +static state states_20[3] = { + {1, arcs_20_0}, + {19, arcs_20_1}, + {1, arcs_20_2}, +}; +static const arc arcs_21_0[1] = { + {29, 1}, +}; +static const arc arcs_21_1[1] = { + {0, 1}, +}; +static state states_21[2] = { + {1, arcs_21_0}, + {1, arcs_21_1}, +}; +static const arc arcs_22_0[11] = { + {99, 1}, + {16, 1}, + {100, 1}, + {18, 1}, + {101, 1}, + {30, 1}, + {102, 1}, + {31, 1}, + {103, 1}, + {35, 1}, + {83, 1}, +}; +static const arc arcs_22_1[1] = { + {0, 1}, +}; +static state states_22[2] = { + {11, arcs_22_0}, + {1, arcs_22_1}, +}; +static const arc arcs_23_0[1] = { + {16, 1}, +}; +static const arc arcs_23_1[1] = { + {0, 1}, +}; +static state states_23[2] = { + {1, arcs_23_0}, + {1, arcs_23_1}, +}; +static const arc arcs_24_0[1] = { + {18, 1}, +}; +static const arc arcs_24_1[1] = { + {0, 1}, +}; +static state states_24[2] = { + {1, arcs_24_0}, + {1, arcs_24_1}, +}; +static const arc arcs_25_0[1] = { + {31, 1}, +}; +static const arc arcs_25_1[26] = { + {0, 1}, + {80, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {84, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {60, 2}, + {126, 2}, +}; +static const arc arcs_25_2[1] = { + {0, 2}, +}; +static state states_25[3] = { + {1, arcs_25_0}, + {26, arcs_25_1}, + {1, arcs_25_2}, +}; +static const arc arcs_26_0[2] = { + {83, 1}, + {35, 1}, +}; +static const arc arcs_26_1[1] = { + {0, 1}, +}; +static state states_26[2] = { + {2, arcs_26_0}, + {1, arcs_26_1}, +}; +static const arc arcs_27_0[1] = { + {30, 1}, +}; +static const arc arcs_27_1[24] = { + {0, 1}, + {60, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_27_2[2] = { + {0, 2}, + {22, 3}, +}; +static const arc arcs_27_3[23] = { + {60, 4}, + {131, 4}, + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {126, 4}, +}; +static const arc arcs_27_4[1] = { + {0, 4}, +}; +static state states_27[5] = { + {1, arcs_27_0}, + {24, arcs_27_1}, + {2, arcs_27_2}, + {23, arcs_27_3}, + {1, arcs_27_4}, +}; +static const arc arcs_28_0[2] = { + {104, 1}, + {105, 1}, +}; +static const arc arcs_28_1[1] = { + {0, 1}, +}; +static state states_28[2] = { + {2, arcs_28_0}, + {1, arcs_28_1}, +}; +static const arc arcs_29_0[1] = { + {25, 1}, +}; +static const arc arcs_29_1[4] = { + {106, 2}, + {40, 2}, + {49, 2}, + {111, 2}, +}; +static const arc arcs_29_2[1] = { + {0, 2}, +}; +static state states_29[3] = { + {1, arcs_29_0}, + {4, arcs_29_1}, + {1, arcs_29_2}, +}; +static const arc arcs_30_0[1] = { + {22, 1}, +}; +static const arc arcs_30_1[4] = { + {107, 2}, + {9, 2}, + {49, 3}, + {40, 3}, +}; +static const arc arcs_30_2[5] = { + {25, 4}, + {107, 2}, + {9, 2}, + {49, 3}, + {40, 3}, +}; +static const arc arcs_30_3[1] = { + {25, 4}, +}; +static const arc arcs_30_4[5] = { + {5, 5}, + {6, 6}, + {108, 6}, + {40, 6}, + {109, 6}, +}; +static const arc arcs_30_5[3] = { + {108, 7}, + {40, 7}, + {109, 7}, +}; +static const arc arcs_30_6[1] = { + {0, 6}, +}; +static const arc arcs_30_7[1] = { + {50, 6}, +}; +static state states_30[8] = { + {1, arcs_30_0}, + {4, arcs_30_1}, + {5, arcs_30_2}, + {1, arcs_30_3}, + {5, arcs_30_4}, + {3, arcs_30_5}, + {1, arcs_30_6}, + {1, arcs_30_7}, +}; +static const arc arcs_31_0[1] = { + {40, 1}, +}; +static const arc arcs_31_1[2] = { + {0, 1}, + {110, 2}, +}; +static const arc arcs_31_2[1] = { + {40, 3}, +}; +static const arc arcs_31_3[1] = { + {0, 3}, +}; +static state states_31[4] = { + {1, arcs_31_0}, + {2, arcs_31_1}, + {1, arcs_31_2}, + {1, arcs_31_3}, +}; +static const arc arcs_32_0[2] = { + {49, 1}, + {40, 1}, +}; +static const arc arcs_32_1[2] = { + {0, 1}, + {110, 2}, +}; +static const arc arcs_32_2[1] = { + {40, 3}, +}; +static const arc arcs_32_3[1] = { + {0, 3}, +}; +static state states_32[4] = { + {2, arcs_32_0}, + {2, arcs_32_1}, + {1, arcs_32_2}, + {1, arcs_32_3}, +}; +static const arc arcs_33_0[2] = { + {109, 1}, + {40, 1}, +}; +static const arc arcs_33_1[2] = { + {0, 1}, + {66, 2}, +}; +static const arc arcs_33_2[3] = { + {0, 2}, + {109, 1}, + {40, 1}, +}; +static state states_33[3] = { + {2, arcs_33_0}, + {2, arcs_33_1}, + {3, arcs_33_2}, +}; +static const arc arcs_34_0[3] = { + {111, 1}, + {40, 1}, + {49, 1}, +}; +static const arc arcs_34_1[2] = { + {0, 1}, + {66, 0}, +}; +static state states_34[2] = { + {3, arcs_34_0}, + {2, arcs_34_1}, +}; +static const arc arcs_35_0[1] = { + {40, 1}, +}; +static const arc arcs_35_1[2] = { + {0, 1}, + {107, 0}, +}; +static state states_35[2] = { + {1, arcs_35_0}, + {2, arcs_35_1}, +}; +static const arc arcs_36_0[1] = { + {23, 1}, +}; +static const arc arcs_36_1[1] = { + {40, 2}, +}; +static const arc arcs_36_2[2] = { + {0, 2}, + {66, 1}, +}; +static state states_36[3] = { + {1, arcs_36_0}, + {1, arcs_36_1}, + {2, arcs_36_2}, +}; +static const arc arcs_37_0[1] = { + {27, 1}, +}; +static const arc arcs_37_1[1] = { + {40, 2}, +}; +static const arc arcs_37_2[2] = { + {0, 2}, + {66, 1}, +}; +static state states_37[3] = { + {1, arcs_37_0}, + {1, arcs_37_1}, + {2, arcs_37_2}, +}; +static const arc arcs_38_0[1] = { + {15, 1}, +}; +static const arc arcs_38_1[23] = { + {60, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_38_2[2] = { + {0, 2}, + {66, 3}, +}; +static const arc arcs_38_3[23] = { + {60, 4}, + {131, 4}, + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {126, 4}, +}; +static const arc arcs_38_4[1] = { + {0, 4}, +}; +static state states_38[5] = { + {1, arcs_38_0}, + {23, arcs_38_1}, + {2, arcs_38_2}, + {23, arcs_38_3}, + {1, arcs_38_4}, +}; +static const arc arcs_39_0[9] = { + {112, 1}, + {55, 1}, + {53, 1}, + {113, 1}, + {56, 1}, + {114, 1}, + {115, 1}, + {116, 1}, + {117, 1}, +}; +static const arc arcs_39_1[1] = { + {0, 1}, +}; +static state states_39[2] = { + {9, arcs_39_0}, + {1, arcs_39_1}, +}; +static const arc arcs_40_0[1] = { + {38, 1}, +}; +static const arc arcs_40_1[3] = { + {113, 2}, + {56, 2}, + {117, 2}, +}; +static const arc arcs_40_2[1] = { + {0, 2}, +}; +static state states_40[3] = { + {1, arcs_40_0}, + {3, arcs_40_1}, + {1, arcs_40_2}, +}; +static const arc arcs_41_0[1] = { + {24, 1}, +}; +static const arc arcs_41_1[24] = { + {118, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {60, 2}, + {126, 2}, +}; +static const arc arcs_41_2[1] = { + {59, 3}, +}; +static const arc arcs_41_3[2] = { + {119, 4}, + {4, 4}, +}; +static const arc arcs_41_4[3] = { + {0, 4}, + {121, 5}, + {120, 1}, +}; +static const arc arcs_41_5[1] = { + {59, 6}, +}; +static const arc arcs_41_6[2] = { + {119, 7}, + {4, 7}, +}; +static const arc arcs_41_7[1] = { + {0, 7}, +}; +static state states_41[8] = { + {1, arcs_41_0}, + {24, arcs_41_1}, + {1, arcs_41_2}, + {2, arcs_41_3}, + {3, arcs_41_4}, + {1, arcs_41_5}, + {2, arcs_41_6}, + {1, arcs_41_7}, +}; +static const arc arcs_42_0[1] = { + {33, 1}, +}; +static const arc arcs_42_1[24] = { + {118, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {60, 2}, + {126, 2}, +}; +static const arc arcs_42_2[1] = { + {59, 3}, +}; +static const arc arcs_42_3[2] = { + {119, 4}, + {4, 4}, +}; +static const arc arcs_42_4[2] = { + {0, 4}, + {121, 5}, +}; +static const arc arcs_42_5[1] = { + {59, 6}, +}; +static const arc arcs_42_6[2] = { + {119, 7}, + {4, 7}, +}; +static const arc arcs_42_7[1] = { + {0, 7}, +}; +static state states_42[8] = { + {1, arcs_42_0}, + {24, arcs_42_1}, + {1, arcs_42_2}, + {2, arcs_42_3}, + {2, arcs_42_4}, + {1, arcs_42_5}, + {2, arcs_42_6}, + {1, arcs_42_7}, +}; +static const arc arcs_43_0[1] = { + {21, 1}, +}; +static const arc arcs_43_1[19] = { + {98, 2}, + {9, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {84, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_43_2[1] = { + {122, 3}, +}; +static const arc arcs_43_3[24] = { + {47, 4}, + {131, 4}, + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {60, 4}, + {126, 4}, +}; +static const arc arcs_43_4[1] = { + {59, 5}, +}; +static const arc arcs_43_5[3] = { + {61, 6}, + {119, 7}, + {4, 7}, +}; +static const arc arcs_43_6[2] = { + {119, 7}, + {4, 7}, +}; +static const arc arcs_43_7[2] = { + {0, 7}, + {121, 8}, +}; +static const arc arcs_43_8[1] = { + {59, 9}, +}; +static const arc arcs_43_9[2] = { + {119, 10}, + {4, 10}, +}; +static const arc arcs_43_10[1] = { + {0, 10}, +}; +static state states_43[11] = { + {1, arcs_43_0}, + {19, arcs_43_1}, + {1, arcs_43_2}, + {24, arcs_43_3}, + {1, arcs_43_4}, + {3, arcs_43_5}, + {2, arcs_43_6}, + {2, arcs_43_7}, + {1, arcs_43_8}, + {2, arcs_43_9}, + {1, arcs_43_10}, +}; +static const arc arcs_44_0[1] = { + {32, 1}, +}; +static const arc arcs_44_1[1] = { + {59, 2}, +}; +static const arc arcs_44_2[2] = { + {119, 3}, + {4, 3}, +}; +static const arc arcs_44_3[3] = { + {123, 4}, + {124, 5}, + {127, 5}, +}; +static const arc arcs_44_4[1] = { + {59, 6}, +}; +static const arc arcs_44_5[1] = { + {59, 7}, +}; +static const arc arcs_44_6[2] = { + {119, 8}, + {4, 8}, +}; +static const arc arcs_44_7[2] = { + {119, 9}, + {4, 9}, +}; +static const arc arcs_44_8[1] = { + {0, 8}, +}; +static const arc arcs_44_9[5] = { + {0, 9}, + {123, 4}, + {121, 10}, + {124, 5}, + {127, 5}, +}; +static const arc arcs_44_10[1] = { + {59, 11}, +}; +static const arc arcs_44_11[2] = { + {119, 12}, + {4, 12}, +}; +static const arc arcs_44_12[2] = { + {0, 12}, + {123, 4}, +}; +static state states_44[13] = { + {1, arcs_44_0}, + {1, arcs_44_1}, + {2, arcs_44_2}, + {3, arcs_44_3}, + {1, arcs_44_4}, + {1, arcs_44_5}, + {2, arcs_44_6}, + {2, arcs_44_7}, + {1, arcs_44_8}, + {5, arcs_44_9}, + {1, arcs_44_10}, + {2, arcs_44_11}, + {2, arcs_44_12}, +}; +static const arc arcs_45_0[1] = { + {34, 1}, +}; +static const arc arcs_45_1[24] = { + {125, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {60, 2}, + {126, 2}, +}; +static const arc arcs_45_2[2] = { + {66, 1}, + {59, 3}, +}; +static const arc arcs_45_3[3] = { + {61, 4}, + {119, 5}, + {4, 5}, +}; +static const arc arcs_45_4[2] = { + {119, 5}, + {4, 5}, +}; +static const arc arcs_45_5[1] = { + {0, 5}, +}; +static state states_45[6] = { + {1, arcs_45_0}, + {24, arcs_45_1}, + {2, arcs_45_2}, + {3, arcs_45_3}, + {2, arcs_45_4}, + {1, arcs_45_5}, +}; +static const arc arcs_46_0[23] = { + {60, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static const arc arcs_46_1[2] = { + {0, 1}, + {110, 2}, +}; +static const arc arcs_46_2[17] = { + {126, 3}, + {9, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {148, 3}, + {150, 3}, + {152, 3}, + {154, 3}, + {157, 3}, + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {41, 3}, + {42, 3}, +}; +static const arc arcs_46_3[1] = { + {0, 3}, +}; +static state states_46[4] = { + {23, arcs_46_0}, + {2, arcs_46_1}, + {17, arcs_46_2}, + {1, arcs_46_3}, +}; +static const arc arcs_47_0[1] = { + {127, 1}, +}; +static const arc arcs_47_1[24] = { + {0, 1}, + {60, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_47_2[2] = { + {0, 2}, + {110, 3}, +}; +static const arc arcs_47_3[1] = { + {40, 4}, +}; +static const arc arcs_47_4[1] = { + {0, 4}, +}; +static state states_47[5] = { + {1, arcs_47_0}, + {24, arcs_47_1}, + {2, arcs_47_2}, + {1, arcs_47_3}, + {1, arcs_47_4}, +}; +static const arc arcs_48_0[2] = { + {2, 1}, + {4, 2}, +}; +static const arc arcs_48_1[1] = { + {128, 3}, +}; +static const arc arcs_48_2[1] = { + {0, 2}, +}; +static const arc arcs_48_3[12] = { + {45, 4}, + {3, 4}, + {4, 4}, + {112, 4}, + {113, 4}, + {114, 4}, + {115, 4}, + {116, 4}, + {53, 4}, + {117, 4}, + {55, 4}, + {56, 4}, +}; +static const arc arcs_48_4[13] = { + {129, 2}, + {45, 4}, + {3, 4}, + {4, 4}, + {112, 4}, + {113, 4}, + {114, 4}, + {115, 4}, + {116, 4}, + {53, 4}, + {117, 4}, + {55, 4}, + {56, 4}, +}; +static state states_48[5] = { + {2, arcs_48_0}, + {1, arcs_48_1}, + {1, arcs_48_2}, + {12, arcs_48_3}, + {13, arcs_48_4}, +}; +static const arc arcs_49_0[23] = { + {60, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static const arc arcs_49_1[2] = { + {0, 1}, + {130, 2}, +}; +static const arc arcs_49_2[23] = { + {60, 3}, + {131, 3}, + {132, 3}, + {135, 3}, + {137, 3}, + {9, 3}, + {139, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {148, 3}, + {150, 3}, + {152, 3}, + {154, 3}, + {157, 3}, + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {41, 3}, + {42, 3}, + {126, 3}, +}; +static const arc arcs_49_3[1] = { + {0, 3}, +}; +static state states_49[4] = { + {23, arcs_49_0}, + {2, arcs_49_1}, + {23, arcs_49_2}, + {1, arcs_49_3}, +}; +static const arc arcs_50_0[22] = { + {131, 1}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_50_1[1] = { + {0, 1}, +}; +static const arc arcs_50_2[2] = { + {0, 2}, + {24, 3}, +}; +static const arc arcs_50_3[21] = { + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {126, 4}, +}; +static const arc arcs_50_4[1] = { + {121, 5}, +}; +static const arc arcs_50_5[23] = { + {60, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static state states_50[6] = { + {22, arcs_50_0}, + {1, arcs_50_1}, + {2, arcs_50_2}, + {21, arcs_50_3}, + {1, arcs_50_4}, + {23, arcs_50_5}, +}; +static const arc arcs_51_0[22] = { + {134, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static const arc arcs_51_1[1] = { + {0, 1}, +}; +static state states_51[2] = { + {22, arcs_51_0}, + {1, arcs_51_1}, +}; +static const arc arcs_52_0[1] = { + {26, 1}, +}; +static const arc arcs_52_1[5] = { + {59, 2}, + {68, 3}, + {40, 3}, + {69, 3}, + {6, 3}, +}; +static const arc arcs_52_2[23] = { + {60, 4}, + {131, 4}, + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {126, 4}, +}; +static const arc arcs_52_3[1] = { + {59, 2}, +}; +static const arc arcs_52_4[1] = { + {0, 4}, +}; +static state states_52[5] = { + {1, arcs_52_0}, + {5, arcs_52_1}, + {23, arcs_52_2}, + {1, arcs_52_3}, + {1, arcs_52_4}, +}; +static const arc arcs_53_0[1] = { + {26, 1}, +}; +static const arc arcs_53_1[5] = { + {59, 2}, + {68, 3}, + {40, 3}, + {69, 3}, + {6, 3}, +}; +static const arc arcs_53_2[23] = { + {133, 4}, + {132, 4}, + {134, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {126, 4}, +}; +static const arc arcs_53_3[1] = { + {59, 2}, +}; +static const arc arcs_53_4[1] = { + {0, 4}, +}; +static state states_53[5] = { + {1, arcs_53_0}, + {5, arcs_53_1}, + {23, arcs_53_2}, + {1, arcs_53_3}, + {1, arcs_53_4}, +}; +static const arc arcs_54_0[20] = { + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static const arc arcs_54_1[2] = { + {0, 1}, + {136, 0}, +}; +static state states_54[2] = { + {20, arcs_54_0}, + {2, arcs_54_1}, +}; +static const arc arcs_55_0[19] = { + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static const arc arcs_55_1[2] = { + {0, 1}, + {138, 0}, +}; +static state states_55[2] = { + {19, arcs_55_0}, + {2, arcs_55_1}, +}; +static const arc arcs_56_0[19] = { + {28, 1}, + {139, 2}, + {9, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_56_1[19] = { + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_56_2[1] = { + {0, 2}, +}; +static state states_56[3] = { + {19, arcs_56_0}, + {19, arcs_56_1}, + {1, arcs_56_2}, +}; +static const arc arcs_57_0[17] = { + {126, 1}, + {9, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, +}; +static const arc arcs_57_1[10] = { + {0, 1}, + {140, 0}, + {141, 0}, + {142, 0}, + {143, 0}, + {144, 0}, + {145, 0}, + {146, 0}, + {147, 0}, + {122, 0}, +}; +static state states_57[2] = { + {17, arcs_57_0}, + {10, arcs_57_1}, +}; +static const arc arcs_58_0[10] = { + {28, 3}, + {147, 2}, + {122, 1}, + {141, 1}, + {142, 1}, + {143, 1}, + {141, 1}, + {144, 1}, + {145, 1}, + {146, 1}, +}; +static const arc arcs_58_1[1] = { + {0, 1}, +}; +static const arc arcs_58_2[2] = { + {0, 2}, + {28, 1}, +}; +static const arc arcs_58_3[1] = { + {122, 1}, +}; +static state states_58[4] = { + {10, arcs_58_0}, + {1, arcs_58_1}, + {2, arcs_58_2}, + {1, arcs_58_3}, +}; +static const arc arcs_59_0[1] = { + {6, 1}, +}; +static const arc arcs_59_1[17] = { + {126, 2}, + {9, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, +}; +static const arc arcs_59_2[1] = { + {0, 2}, +}; +static state states_59[3] = { + {1, arcs_59_0}, + {17, arcs_59_1}, + {1, arcs_59_2}, +}; +static const arc arcs_60_0[16] = { + {148, 1}, + {9, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, +}; +static const arc arcs_60_1[2] = { + {0, 1}, + {149, 0}, +}; +static state states_60[2] = { + {16, arcs_60_0}, + {2, arcs_60_1}, +}; +static const arc arcs_61_0[15] = { + {150, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {9, 1}, + {41, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {42, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, +}; +static const arc arcs_61_1[2] = { + {0, 1}, + {151, 0}, +}; +static state states_61[2] = { + {15, arcs_61_0}, + {2, arcs_61_1}, +}; +static const arc arcs_62_0[14] = { + {152, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {9, 1}, + {41, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {42, 1}, + {154, 1}, + {157, 1}, + {158, 1}, +}; +static const arc arcs_62_1[2] = { + {0, 1}, + {153, 0}, +}; +static state states_62[2] = { + {14, arcs_62_0}, + {2, arcs_62_1}, +}; +static const arc arcs_63_0[13] = { + {154, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {9, 1}, + {41, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {42, 1}, + {157, 1}, + {158, 1}, +}; +static const arc arcs_63_1[3] = { + {0, 1}, + {155, 0}, + {156, 0}, +}; +static state states_63[2] = { + {13, arcs_63_0}, + {3, arcs_63_1}, +}; +static const arc arcs_64_0[12] = { + {157, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {9, 1}, + {41, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {42, 1}, + {158, 1}, +}; +static const arc arcs_64_1[3] = { + {0, 1}, + {7, 0}, + {8, 0}, +}; +static state states_64[2] = { + {12, arcs_64_0}, + {3, arcs_64_1}, +}; +static const arc arcs_65_0[11] = { + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {9, 1}, + {41, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {42, 1}, +}; +static const arc arcs_65_1[6] = { + {0, 1}, + {159, 0}, + {6, 0}, + {160, 0}, + {161, 0}, + {10, 0}, +}; +static state states_65[2] = { + {11, arcs_65_0}, + {6, arcs_65_1}, +}; +static const arc arcs_66_0[13] = { + {7, 1}, + {8, 1}, + {37, 1}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {9, 2}, + {41, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {42, 2}, +}; +static const arc arcs_66_1[11] = { + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {9, 2}, + {41, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {42, 2}, +}; +static const arc arcs_66_2[1] = { + {0, 2}, +}; +static state states_66[3] = { + {13, arcs_66_0}, + {11, arcs_66_1}, + {1, arcs_66_2}, +}; +static const arc arcs_67_0[9] = { + {163, 1}, + {164, 1}, + {40, 1}, + {9, 1}, + {41, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {42, 1}, +}; +static const arc arcs_67_1[2] = { + {0, 1}, + {64, 2}, +}; +static const arc arcs_67_2[11] = { + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {9, 3}, + {41, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {42, 3}, +}; +static const arc arcs_67_3[1] = { + {0, 3}, +}; +static state states_67[4] = { + {9, arcs_67_0}, + {2, arcs_67_1}, + {11, arcs_67_2}, + {1, arcs_67_3}, +}; +static const arc arcs_68_0[9] = { + {39, 1}, + {164, 2}, + {40, 2}, + {9, 2}, + {41, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {42, 2}, +}; +static const arc arcs_68_1[8] = { + {164, 2}, + {40, 2}, + {9, 2}, + {41, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {42, 2}, +}; +static const arc arcs_68_2[2] = { + {0, 2}, + {165, 2}, +}; +static state states_68[3] = { + {9, arcs_68_0}, + {8, arcs_68_1}, + {2, arcs_68_2}, +}; +static const arc arcs_69_0[10] = { + {13, 2}, + {12, 2}, + {11, 2}, + {5, 1}, + {9, 2}, + {14, 3}, + {36, 4}, + {40, 2}, + {41, 2}, + {42, 5}, +}; +static const arc arcs_69_1[29] = { + {50, 2}, + {166, 6}, + {131, 6}, + {132, 6}, + {135, 6}, + {137, 6}, + {9, 6}, + {139, 6}, + {11, 6}, + {12, 6}, + {13, 6}, + {148, 6}, + {84, 6}, + {150, 6}, + {152, 6}, + {154, 6}, + {157, 6}, + {158, 6}, + {162, 6}, + {163, 6}, + {164, 6}, + {40, 6}, + {41, 6}, + {42, 6}, + {118, 6}, + {60, 6}, + {126, 6}, + {83, 6}, + {35, 6}, +}; +static const arc arcs_69_2[1] = { + {0, 2}, +}; +static const arc arcs_69_3[27] = { + {167, 2}, + {166, 7}, + {131, 7}, + {132, 7}, + {135, 7}, + {137, 7}, + {9, 7}, + {139, 7}, + {11, 7}, + {12, 7}, + {13, 7}, + {148, 7}, + {84, 7}, + {150, 7}, + {152, 7}, + {154, 7}, + {157, 7}, + {158, 7}, + {162, 7}, + {163, 7}, + {164, 7}, + {40, 7}, + {41, 7}, + {42, 7}, + {118, 7}, + {60, 7}, + {126, 7}, +}; +static const arc arcs_69_4[26] = { + {168, 2}, + {169, 8}, + {131, 8}, + {132, 8}, + {135, 8}, + {137, 8}, + {9, 8}, + {139, 8}, + {11, 8}, + {12, 8}, + {13, 8}, + {84, 8}, + {148, 8}, + {150, 8}, + {152, 8}, + {154, 8}, + {157, 8}, + {158, 8}, + {162, 8}, + {163, 8}, + {164, 8}, + {40, 8}, + {41, 8}, + {42, 8}, + {60, 8}, + {126, 8}, +}; +static const arc arcs_69_5[2] = { + {0, 5}, + {42, 5}, +}; +static const arc arcs_69_6[1] = { + {50, 2}, +}; +static const arc arcs_69_7[1] = { + {167, 2}, +}; +static const arc arcs_69_8[1] = { + {168, 2}, +}; +static state states_69[9] = { + {10, arcs_69_0}, + {29, arcs_69_1}, + {1, arcs_69_2}, + {27, arcs_69_3}, + {26, arcs_69_4}, + {2, arcs_69_5}, + {1, arcs_69_6}, + {1, arcs_69_7}, + {1, arcs_69_8}, +}; +static const arc arcs_70_0[25] = { + {118, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {60, 1}, + {126, 1}, + {84, 1}, +}; +static const arc arcs_70_1[4] = { + {0, 1}, + {66, 2}, + {170, 3}, + {177, 3}, +}; +static const arc arcs_70_2[26] = { + {0, 2}, + {118, 4}, + {131, 4}, + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {60, 4}, + {126, 4}, + {84, 4}, +}; +static const arc arcs_70_3[1] = { + {0, 3}, +}; +static const arc arcs_70_4[2] = { + {0, 4}, + {66, 2}, +}; +static state states_70[5] = { + {25, arcs_70_0}, + {4, arcs_70_1}, + {26, arcs_70_2}, + {1, arcs_70_3}, + {2, arcs_70_4}, +}; +static const arc arcs_71_0[3] = { + {5, 1}, + {107, 2}, + {14, 3}, +}; +static const arc arcs_71_1[26] = { + {50, 4}, + {51, 5}, + {131, 5}, + {132, 5}, + {135, 5}, + {137, 5}, + {9, 5}, + {139, 5}, + {11, 5}, + {12, 5}, + {13, 5}, + {148, 5}, + {150, 5}, + {152, 5}, + {154, 5}, + {157, 5}, + {158, 5}, + {162, 5}, + {163, 5}, + {164, 5}, + {40, 5}, + {41, 5}, + {42, 5}, + {174, 5}, + {60, 5}, + {126, 5}, +}; +static const arc arcs_71_2[1] = { + {40, 4}, +}; +static const arc arcs_71_3[26] = { + {171, 6}, + {131, 6}, + {132, 6}, + {135, 6}, + {137, 6}, + {9, 6}, + {139, 6}, + {11, 6}, + {12, 6}, + {13, 6}, + {148, 6}, + {150, 6}, + {152, 6}, + {154, 6}, + {157, 6}, + {158, 6}, + {162, 6}, + {163, 6}, + {164, 6}, + {40, 6}, + {41, 6}, + {42, 6}, + {172, 6}, + {59, 6}, + {60, 6}, + {126, 6}, +}; +static const arc arcs_71_4[1] = { + {0, 4}, +}; +static const arc arcs_71_5[1] = { + {50, 4}, +}; +static const arc arcs_71_6[1] = { + {167, 4}, +}; +static state states_71[7] = { + {3, arcs_71_0}, + {26, arcs_71_1}, + {1, arcs_71_2}, + {26, arcs_71_3}, + {1, arcs_71_4}, + {1, arcs_71_5}, + {1, arcs_71_6}, +}; +static const arc arcs_72_0[25] = { + {172, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {59, 1}, + {60, 1}, + {126, 1}, +}; +static const arc arcs_72_1[2] = { + {0, 1}, + {66, 2}, +}; +static const arc arcs_72_2[26] = { + {0, 2}, + {172, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {59, 1}, + {60, 1}, + {126, 1}, +}; +static state states_72[3] = { + {25, arcs_72_0}, + {2, arcs_72_1}, + {26, arcs_72_2}, +}; +static const arc arcs_73_0[24] = { + {59, 1}, + {60, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_73_1[26] = { + {0, 1}, + {173, 3}, + {59, 3}, + {60, 4}, + {131, 4}, + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {126, 4}, +}; +static const arc arcs_73_2[2] = { + {0, 2}, + {59, 1}, +}; +static const arc arcs_73_3[1] = { + {0, 3}, +}; +static const arc arcs_73_4[3] = { + {0, 4}, + {173, 3}, + {59, 3}, +}; +static state states_73[5] = { + {24, arcs_73_0}, + {26, arcs_73_1}, + {2, arcs_73_2}, + {1, arcs_73_3}, + {3, arcs_73_4}, +}; +static const arc arcs_74_0[1] = { + {59, 1}, +}; +static const arc arcs_74_1[24] = { + {0, 1}, + {60, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_74_2[1] = { + {0, 2}, +}; +static state states_74[3] = { + {1, arcs_74_0}, + {24, arcs_74_1}, + {1, arcs_74_2}, +}; +static const arc arcs_75_0[18] = { + {126, 1}, + {9, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {84, 1}, +}; +static const arc arcs_75_1[2] = { + {0, 1}, + {66, 2}, +}; +static const arc arcs_75_2[19] = { + {0, 2}, + {126, 1}, + {9, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {84, 1}, +}; +static state states_75[3] = { + {18, arcs_75_0}, + {2, arcs_75_1}, + {19, arcs_75_2}, +}; +static const arc arcs_76_0[23] = { + {60, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static const arc arcs_76_1[2] = { + {0, 1}, + {66, 2}, +}; +static const arc arcs_76_2[24] = { + {0, 2}, + {60, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {126, 1}, +}; +static state states_76[3] = { + {23, arcs_76_0}, + {2, arcs_76_1}, + {24, arcs_76_2}, +}; +static const arc arcs_77_0[25] = { + {64, 1}, + {84, 2}, + {60, 3}, + {131, 3}, + {132, 3}, + {135, 3}, + {137, 3}, + {9, 3}, + {139, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {148, 3}, + {150, 3}, + {152, 3}, + {154, 3}, + {157, 3}, + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {41, 3}, + {42, 3}, + {126, 3}, +}; +static const arc arcs_77_1[17] = { + {126, 4}, + {9, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, +}; +static const arc arcs_77_2[4] = { + {0, 2}, + {66, 5}, + {170, 6}, + {177, 6}, +}; +static const arc arcs_77_3[5] = { + {0, 3}, + {66, 5}, + {59, 7}, + {170, 6}, + {177, 6}, +}; +static const arc arcs_77_4[4] = { + {0, 4}, + {66, 8}, + {170, 6}, + {177, 6}, +}; +static const arc arcs_77_5[25] = { + {0, 5}, + {84, 9}, + {60, 9}, + {131, 9}, + {132, 9}, + {135, 9}, + {137, 9}, + {9, 9}, + {139, 9}, + {11, 9}, + {12, 9}, + {13, 9}, + {148, 9}, + {150, 9}, + {152, 9}, + {154, 9}, + {157, 9}, + {158, 9}, + {162, 9}, + {163, 9}, + {164, 9}, + {40, 9}, + {41, 9}, + {42, 9}, + {126, 9}, +}; +static const arc arcs_77_6[1] = { + {0, 6}, +}; +static const arc arcs_77_7[23] = { + {60, 4}, + {131, 4}, + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {126, 4}, +}; +static const arc arcs_77_8[25] = { + {0, 8}, + {64, 10}, + {60, 11}, + {131, 11}, + {132, 11}, + {135, 11}, + {137, 11}, + {9, 11}, + {139, 11}, + {11, 11}, + {12, 11}, + {13, 11}, + {148, 11}, + {150, 11}, + {152, 11}, + {154, 11}, + {157, 11}, + {158, 11}, + {162, 11}, + {163, 11}, + {164, 11}, + {40, 11}, + {41, 11}, + {42, 11}, + {126, 11}, +}; +static const arc arcs_77_9[2] = { + {0, 9}, + {66, 5}, +}; +static const arc arcs_77_10[17] = { + {126, 12}, + {9, 12}, + {11, 12}, + {12, 12}, + {13, 12}, + {148, 12}, + {150, 12}, + {152, 12}, + {154, 12}, + {157, 12}, + {158, 12}, + {162, 12}, + {163, 12}, + {164, 12}, + {40, 12}, + {41, 12}, + {42, 12}, +}; +static const arc arcs_77_11[1] = { + {59, 13}, +}; +static const arc arcs_77_12[2] = { + {0, 12}, + {66, 8}, +}; +static const arc arcs_77_13[23] = { + {60, 12}, + {131, 12}, + {132, 12}, + {135, 12}, + {137, 12}, + {9, 12}, + {139, 12}, + {11, 12}, + {12, 12}, + {13, 12}, + {148, 12}, + {150, 12}, + {152, 12}, + {154, 12}, + {157, 12}, + {158, 12}, + {162, 12}, + {163, 12}, + {164, 12}, + {40, 12}, + {41, 12}, + {42, 12}, + {126, 12}, +}; +static state states_77[14] = { + {25, arcs_77_0}, + {17, arcs_77_1}, + {4, arcs_77_2}, + {5, arcs_77_3}, + {4, arcs_77_4}, + {25, arcs_77_5}, + {1, arcs_77_6}, + {23, arcs_77_7}, + {25, arcs_77_8}, + {2, arcs_77_9}, + {17, arcs_77_10}, + {1, arcs_77_11}, + {2, arcs_77_12}, + {23, arcs_77_13}, +}; +static const arc arcs_78_0[1] = { + {17, 1}, +}; +static const arc arcs_78_1[1] = { + {40, 2}, +}; +static const arc arcs_78_2[2] = { + {5, 3}, + {59, 4}, +}; +static const arc arcs_78_3[26] = { + {50, 5}, + {51, 6}, + {131, 6}, + {132, 6}, + {135, 6}, + {137, 6}, + {9, 6}, + {139, 6}, + {11, 6}, + {12, 6}, + {13, 6}, + {148, 6}, + {150, 6}, + {152, 6}, + {154, 6}, + {157, 6}, + {158, 6}, + {162, 6}, + {163, 6}, + {164, 6}, + {40, 6}, + {41, 6}, + {42, 6}, + {174, 6}, + {60, 6}, + {126, 6}, +}; +static const arc arcs_78_4[2] = { + {119, 7}, + {4, 7}, +}; +static const arc arcs_78_5[1] = { + {59, 4}, +}; +static const arc arcs_78_6[1] = { + {50, 5}, +}; +static const arc arcs_78_7[1] = { + {0, 7}, +}; +static state states_78[8] = { + {1, arcs_78_0}, + {1, arcs_78_1}, + {2, arcs_78_2}, + {26, arcs_78_3}, + {2, arcs_78_4}, + {1, arcs_78_5}, + {1, arcs_78_6}, + {1, arcs_78_7}, +}; +static const arc arcs_79_0[24] = { + {174, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {60, 1}, + {126, 1}, +}; +static const arc arcs_79_1[2] = { + {0, 1}, + {66, 2}, +}; +static const arc arcs_79_2[25] = { + {0, 2}, + {174, 1}, + {131, 1}, + {132, 1}, + {135, 1}, + {137, 1}, + {9, 1}, + {139, 1}, + {11, 1}, + {12, 1}, + {13, 1}, + {148, 1}, + {150, 1}, + {152, 1}, + {154, 1}, + {157, 1}, + {158, 1}, + {162, 1}, + {163, 1}, + {164, 1}, + {40, 1}, + {41, 1}, + {42, 1}, + {60, 1}, + {126, 1}, +}; +static state states_79[3] = { + {24, arcs_79_0}, + {2, arcs_79_1}, + {25, arcs_79_2}, +}; +static const arc arcs_80_0[25] = { + {6, 1}, + {64, 1}, + {60, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_80_1[23] = { + {60, 3}, + {131, 3}, + {132, 3}, + {135, 3}, + {137, 3}, + {9, 3}, + {139, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {148, 3}, + {150, 3}, + {152, 3}, + {154, 3}, + {157, 3}, + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {41, 3}, + {42, 3}, + {126, 3}, +}; +static const arc arcs_80_2[5] = { + {0, 2}, + {130, 1}, + {67, 1}, + {170, 3}, + {177, 3}, +}; +static const arc arcs_80_3[1] = { + {0, 3}, +}; +static state states_80[4] = { + {25, arcs_80_0}, + {23, arcs_80_1}, + {5, arcs_80_2}, + {1, arcs_80_3}, +}; +static const arc arcs_81_0[3] = { + {170, 1}, + {177, 1}, + {176, 1}, +}; +static const arc arcs_81_1[1] = { + {0, 1}, +}; +static state states_81[2] = { + {3, arcs_81_0}, + {1, arcs_81_1}, +}; +static const arc arcs_82_0[1] = { + {21, 1}, +}; +static const arc arcs_82_1[19] = { + {98, 2}, + {9, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {84, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_82_2[1] = { + {122, 3}, +}; +static const arc arcs_82_3[21] = { + {132, 4}, + {135, 4}, + {137, 4}, + {9, 4}, + {139, 4}, + {11, 4}, + {12, 4}, + {13, 4}, + {148, 4}, + {150, 4}, + {152, 4}, + {154, 4}, + {157, 4}, + {158, 4}, + {162, 4}, + {163, 4}, + {164, 4}, + {40, 4}, + {41, 4}, + {42, 4}, + {126, 4}, +}; +static const arc arcs_82_4[5] = { + {0, 4}, + {175, 5}, + {176, 5}, + {177, 5}, + {170, 5}, +}; +static const arc arcs_82_5[1] = { + {0, 5}, +}; +static state states_82[6] = { + {1, arcs_82_0}, + {19, arcs_82_1}, + {1, arcs_82_2}, + {21, arcs_82_3}, + {5, arcs_82_4}, + {1, arcs_82_5}, +}; +static const arc arcs_83_0[2] = { + {38, 1}, + {177, 2}, +}; +static const arc arcs_83_1[1] = { + {177, 2}, +}; +static const arc arcs_83_2[1] = { + {0, 2}, +}; +static state states_83[3] = { + {2, arcs_83_0}, + {1, arcs_83_1}, + {1, arcs_83_2}, +}; +static const arc arcs_84_0[1] = { + {24, 1}, +}; +static const arc arcs_84_1[23] = { + {133, 2}, + {132, 2}, + {134, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_84_2[5] = { + {0, 2}, + {175, 3}, + {176, 3}, + {177, 3}, + {170, 3}, +}; +static const arc arcs_84_3[1] = { + {0, 3}, +}; +static state states_84[4] = { + {1, arcs_84_0}, + {23, arcs_84_1}, + {5, arcs_84_2}, + {1, arcs_84_3}, +}; +static const arc arcs_85_0[1] = { + {40, 1}, +}; +static const arc arcs_85_1[1] = { + {0, 1}, +}; +static state states_85[2] = { + {1, arcs_85_0}, + {1, arcs_85_1}, +}; +static const arc arcs_86_0[1] = { + {35, 1}, +}; +static const arc arcs_86_1[27] = { + {0, 1}, + {179, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {80, 2}, + {84, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {60, 2}, + {126, 2}, +}; +static const arc arcs_86_2[1] = { + {0, 2}, +}; +static state states_86[3] = { + {1, arcs_86_0}, + {27, arcs_86_1}, + {1, arcs_86_2}, +}; +static const arc arcs_87_0[26] = { + {22, 1}, + {80, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {84, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {60, 2}, + {126, 2}, +}; +static const arc arcs_87_1[23] = { + {60, 2}, + {131, 2}, + {132, 2}, + {135, 2}, + {137, 2}, + {9, 2}, + {139, 2}, + {11, 2}, + {12, 2}, + {13, 2}, + {148, 2}, + {150, 2}, + {152, 2}, + {154, 2}, + {157, 2}, + {158, 2}, + {162, 2}, + {163, 2}, + {164, 2}, + {40, 2}, + {41, 2}, + {42, 2}, + {126, 2}, +}; +static const arc arcs_87_2[1] = { + {0, 2}, +}; +static state states_87[3] = { + {26, arcs_87_0}, + {23, arcs_87_1}, + {1, arcs_87_2}, +}; +static const arc arcs_88_0[2] = { + {2, 1}, + {4, 2}, +}; +static const arc arcs_88_1[2] = { + {128, 3}, + {61, 4}, +}; +static const arc arcs_88_2[1] = { + {0, 2}, +}; +static const arc arcs_88_3[12] = { + {45, 5}, + {3, 5}, + {4, 5}, + {112, 5}, + {113, 5}, + {114, 5}, + {115, 5}, + {116, 5}, + {53, 5}, + {117, 5}, + {55, 5}, + {56, 5}, +}; +static const arc arcs_88_4[1] = { + {2, 6}, +}; +static const arc arcs_88_5[13] = { + {129, 2}, + {45, 5}, + {3, 5}, + {4, 5}, + {112, 5}, + {113, 5}, + {114, 5}, + {115, 5}, + {116, 5}, + {53, 5}, + {117, 5}, + {55, 5}, + {56, 5}, +}; +static const arc arcs_88_6[1] = { + {128, 3}, +}; +static state states_88[7] = { + {2, arcs_88_0}, + {2, arcs_88_1}, + {1, arcs_88_2}, + {12, arcs_88_3}, + {1, arcs_88_4}, + {13, arcs_88_5}, + {1, arcs_88_6}, +}; +static const arc arcs_89_0[1] = { + {181, 1}, +}; +static const arc arcs_89_1[2] = { + {44, 2}, + {2, 1}, +}; +static const arc arcs_89_2[1] = { + {0, 2}, +}; +static state states_89[3] = { + {1, arcs_89_0}, + {2, arcs_89_1}, + {1, arcs_89_2}, +}; +static const arc arcs_90_0[1] = { + {5, 1}, +}; +static const arc arcs_90_1[26] = { + {50, 2}, + {182, 3}, + {131, 3}, + {132, 3}, + {6, 3}, + {135, 3}, + {137, 3}, + {9, 3}, + {139, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {148, 3}, + {150, 3}, + {152, 3}, + {154, 3}, + {157, 3}, + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {41, 3}, + {42, 3}, + {60, 3}, + {126, 3}, +}; +static const arc arcs_90_2[1] = { + {58, 4}, +}; +static const arc arcs_90_3[1] = { + {50, 2}, +}; +static const arc arcs_90_4[23] = { + {60, 5}, + {131, 5}, + {132, 5}, + {135, 5}, + {137, 5}, + {9, 5}, + {139, 5}, + {11, 5}, + {12, 5}, + {13, 5}, + {148, 5}, + {150, 5}, + {152, 5}, + {154, 5}, + {157, 5}, + {158, 5}, + {162, 5}, + {163, 5}, + {164, 5}, + {40, 5}, + {41, 5}, + {42, 5}, + {126, 5}, +}; +static const arc arcs_90_5[1] = { + {0, 5}, +}; +static state states_90[6] = { + {1, arcs_90_0}, + {26, arcs_90_1}, + {1, arcs_90_2}, + {1, arcs_90_3}, + {23, arcs_90_4}, + {1, arcs_90_5}, +}; +static const arc arcs_91_0[25] = { + {6, 1}, + {64, 2}, + {60, 3}, + {131, 3}, + {132, 3}, + {135, 3}, + {137, 3}, + {9, 3}, + {139, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {148, 3}, + {150, 3}, + {152, 3}, + {154, 3}, + {157, 3}, + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {41, 3}, + {42, 3}, + {126, 3}, +}; +static const arc arcs_91_1[25] = { + {0, 1}, + {66, 4}, + {60, 5}, + {131, 5}, + {132, 5}, + {135, 5}, + {137, 5}, + {9, 5}, + {139, 5}, + {11, 5}, + {12, 5}, + {13, 5}, + {148, 5}, + {150, 5}, + {152, 5}, + {154, 5}, + {157, 5}, + {158, 5}, + {162, 5}, + {163, 5}, + {164, 5}, + {40, 5}, + {41, 5}, + {42, 5}, + {126, 5}, +}; +static const arc arcs_91_2[23] = { + {60, 6}, + {131, 6}, + {132, 6}, + {135, 6}, + {137, 6}, + {9, 6}, + {139, 6}, + {11, 6}, + {12, 6}, + {13, 6}, + {148, 6}, + {150, 6}, + {152, 6}, + {154, 6}, + {157, 6}, + {158, 6}, + {162, 6}, + {163, 6}, + {164, 6}, + {40, 6}, + {41, 6}, + {42, 6}, + {126, 6}, +}; +static const arc arcs_91_3[2] = { + {0, 3}, + {66, 7}, +}; +static const arc arcs_91_4[24] = { + {64, 2}, + {60, 5}, + {131, 5}, + {132, 5}, + {135, 5}, + {137, 5}, + {9, 5}, + {139, 5}, + {11, 5}, + {12, 5}, + {13, 5}, + {148, 5}, + {150, 5}, + {152, 5}, + {154, 5}, + {157, 5}, + {158, 5}, + {162, 5}, + {163, 5}, + {164, 5}, + {40, 5}, + {41, 5}, + {42, 5}, + {126, 5}, +}; +static const arc arcs_91_5[2] = { + {0, 5}, + {66, 4}, +}; +static const arc arcs_91_6[1] = { + {0, 6}, +}; +static const arc arcs_91_7[26] = { + {0, 7}, + {6, 8}, + {64, 2}, + {60, 3}, + {131, 3}, + {132, 3}, + {135, 3}, + {137, 3}, + {9, 3}, + {139, 3}, + {11, 3}, + {12, 3}, + {13, 3}, + {148, 3}, + {150, 3}, + {152, 3}, + {154, 3}, + {157, 3}, + {158, 3}, + {162, 3}, + {163, 3}, + {164, 3}, + {40, 3}, + {41, 3}, + {42, 3}, + {126, 3}, +}; +static const arc arcs_91_8[25] = { + {0, 8}, + {66, 9}, + {60, 10}, + {131, 10}, + {132, 10}, + {135, 10}, + {137, 10}, + {9, 10}, + {139, 10}, + {11, 10}, + {12, 10}, + {13, 10}, + {148, 10}, + {150, 10}, + {152, 10}, + {154, 10}, + {157, 10}, + {158, 10}, + {162, 10}, + {163, 10}, + {164, 10}, + {40, 10}, + {41, 10}, + {42, 10}, + {126, 10}, +}; +static const arc arcs_91_9[24] = { + {64, 2}, + {60, 10}, + {131, 10}, + {132, 10}, + {135, 10}, + {137, 10}, + {9, 10}, + {139, 10}, + {11, 10}, + {12, 10}, + {13, 10}, + {148, 10}, + {150, 10}, + {152, 10}, + {154, 10}, + {157, 10}, + {158, 10}, + {162, 10}, + {163, 10}, + {164, 10}, + {40, 10}, + {41, 10}, + {42, 10}, + {126, 10}, +}; +static const arc arcs_91_10[2] = { + {0, 10}, + {66, 9}, +}; +static state states_91[11] = { + {25, arcs_91_0}, + {25, arcs_91_1}, + {23, arcs_91_2}, + {2, arcs_91_3}, + {24, arcs_91_4}, + {2, arcs_91_5}, + {1, arcs_91_6}, + {26, arcs_91_7}, + {25, arcs_91_8}, + {24, arcs_91_9}, + {2, arcs_91_10}, +}; +static const dfa dfas[92] = { + {256, "single_input", 3, states_0, 0}, + {257, "file_input", 2, states_1, 0}, + {258, "eval_input", 3, states_2, 0}, + {259, "decorator", 7, states_3, 0}, + {260, "decorators", 2, states_4, 0}, + {261, "decorated", 3, states_5, 0}, + {262, "async_funcdef", 3, states_6, 0}, + {263, "funcdef", 9, states_7, 0}, + {264, "parameters", 4, states_8, 0}, + {265, "typedargslist", 22, states_9, 0}, + {266, "tfpdef", 4, states_10, 0}, + {267, "varargslist", 18, states_11, 0}, + {268, "vfpdef", 2, states_12, 0}, + {269, "stmt", 2, states_13, 0}, + {270, "simple_stmt", 4, states_14, 0}, + {271, "small_stmt", 2, states_15, 0}, + {272, "expr_stmt", 6, states_16, 0}, + {273, "annassign", 5, states_17, 0}, + {274, "testlist_star_expr", 3, states_18, 0}, + {275, "augassign", 2, states_19, 0}, + {276, "del_stmt", 3, states_20, 0}, + {277, "pass_stmt", 2, states_21, 0}, + {278, "flow_stmt", 2, states_22, 0}, + {279, "break_stmt", 2, states_23, 0}, + {280, "continue_stmt", 2, states_24, 0}, + {281, "return_stmt", 3, states_25, 0}, + {282, "yield_stmt", 2, states_26, 0}, + {283, "raise_stmt", 5, states_27, 0}, + {284, "import_stmt", 2, states_28, 0}, + {285, "import_name", 3, states_29, 0}, + {286, "import_from", 8, states_30, 0}, + {287, "import_as_name", 4, states_31, 0}, + {288, "dotted_as_name", 4, states_32, 0}, + {289, "import_as_names", 3, states_33, 0}, + {290, "dotted_as_names", 2, states_34, 0}, + {291, "dotted_name", 2, states_35, 0}, + {292, "global_stmt", 3, states_36, 0}, + {293, "nonlocal_stmt", 3, states_37, 0}, + {294, "assert_stmt", 5, states_38, 0}, + {295, "compound_stmt", 2, states_39, 0}, + {296, "async_stmt", 3, states_40, 0}, + {297, "if_stmt", 8, states_41, 0}, + {298, "while_stmt", 8, states_42, 0}, + {299, "for_stmt", 11, states_43, 0}, + {300, "try_stmt", 13, states_44, 0}, + {301, "with_stmt", 6, states_45, 0}, + {302, "with_item", 4, states_46, 0}, + {303, "except_clause", 5, states_47, 0}, + {304, "suite", 5, states_48, 0}, + {305, "namedexpr_test", 4, states_49, 0}, + {306, "test", 6, states_50, 0}, + {307, "test_nocond", 2, states_51, 0}, + {308, "lambdef", 5, states_52, 0}, + {309, "lambdef_nocond", 5, states_53, 0}, + {310, "or_test", 2, states_54, 0}, + {311, "and_test", 2, states_55, 0}, + {312, "not_test", 3, states_56, 0}, + {313, "comparison", 2, states_57, 0}, + {314, "comp_op", 4, states_58, 0}, + {315, "star_expr", 3, states_59, 0}, + {316, "expr", 2, states_60, 0}, + {317, "xor_expr", 2, states_61, 0}, + {318, "and_expr", 2, states_62, 0}, + {319, "shift_expr", 2, states_63, 0}, + {320, "arith_expr", 2, states_64, 0}, + {321, "term", 2, states_65, 0}, + {322, "factor", 3, states_66, 0}, + {323, "power", 4, states_67, 0}, + {324, "atom_expr", 3, states_68, 0}, + {325, "atom", 9, states_69, 0}, + {326, "testlist_comp", 5, states_70, 0}, + {327, "trailer", 7, states_71, 0}, + {328, "subscriptlist", 3, states_72, 0}, + {329, "subscript", 5, states_73, 0}, + {330, "sliceop", 3, states_74, 0}, + {331, "exprlist", 3, states_75, 0}, + {332, "testlist", 3, states_76, 0}, + {333, "dictorsetmaker", 14, states_77, 0}, + {334, "classdef", 8, states_78, 0}, + {335, "arglist", 3, states_79, 0}, + {336, "argument", 4, states_80, 0}, + {337, "comp_iter", 2, states_81, 0}, + {338, "sync_comp_for", 6, states_82, 0}, + {339, "comp_for", 3, states_83, 0}, + {340, "comp_if", 4, states_84, 0}, + {341, "encoding_decl", 2, states_85, 0}, + {342, "yield_expr", 3, states_86, 0}, + {343, "yield_arg", 3, states_87, 0}, + {344, "func_body_suite", 7, states_88, 0}, + {345, "func_type_input", 3, states_89, 0}, + {346, "func_type", 6, states_90, 0}, + {347, "typelist", 11, states_91, 0}, +}; +static const label labels[183] = { + {0, "EMPTY"}, + {256, 0}, + {4, 0}, + {295, 0}, + {270, 0}, + {7, 0}, + {16, 0}, + {14, 0}, + {15, 0}, + {52, 0}, + {49, 0}, + {1, "False"}, + {1, "None"}, + {1, "True"}, + {9, 0}, + {1, "assert"}, + {1, "break"}, + {1, "class"}, + {1, "continue"}, + {1, "def"}, + {1, "del"}, + {1, "for"}, + {1, "from"}, + {1, "global"}, + {1, "if"}, + {1, "import"}, + {1, "lambda"}, + {1, "nonlocal"}, + {1, "not"}, + {1, "pass"}, + {1, "raise"}, + {1, "return"}, + {1, "try"}, + {1, "while"}, + {1, "with"}, + {1, "yield"}, + {25, 0}, + {31, 0}, + {56, 0}, + {55, 0}, + {1, 0}, + {2, 0}, + {3, 0}, + {257, 0}, + {0, 0}, + {269, 0}, + {258, 0}, + {332, 0}, + {259, 0}, + {291, 0}, + {8, 0}, + {335, 0}, + {260, 0}, + {261, 0}, + {262, 0}, + {334, 0}, + {263, 0}, + {264, 0}, + {51, 0}, + {11, 0}, + {306, 0}, + {58, 0}, + {344, 0}, + {265, 0}, + {35, 0}, + {266, 0}, + {12, 0}, + {22, 0}, + {267, 0}, + {268, 0}, + {271, 0}, + {13, 0}, + {294, 0}, + {276, 0}, + {272, 0}, + {278, 0}, + {292, 0}, + {284, 0}, + {293, 0}, + {277, 0}, + {274, 0}, + {273, 0}, + {275, 0}, + {342, 0}, + {315, 0}, + {40, 0}, + {41, 0}, + {46, 0}, + {38, 0}, + {36, 0}, + {37, 0}, + {48, 0}, + {39, 0}, + {44, 0}, + {45, 0}, + {50, 0}, + {43, 0}, + {42, 0}, + {331, 0}, + {279, 0}, + {280, 0}, + {283, 0}, + {281, 0}, + {282, 0}, + {286, 0}, + {285, 0}, + {290, 0}, + {23, 0}, + {289, 0}, + {287, 0}, + {1, "as"}, + {288, 0}, + {296, 0}, + {299, 0}, + {297, 0}, + {300, 0}, + {298, 0}, + {301, 0}, + {305, 0}, + {304, 0}, + {1, "elif"}, + {1, "else"}, + {1, "in"}, + {1, "finally"}, + {303, 0}, + {302, 0}, + {316, 0}, + {1, "except"}, + {5, 0}, + {6, 0}, + {53, 0}, + {308, 0}, + {310, 0}, + {307, 0}, + {309, 0}, + {311, 0}, + {1, "or"}, + {312, 0}, + {1, "and"}, + {313, 0}, + {314, 0}, + {28, 0}, + {20, 0}, + {29, 0}, + {27, 0}, + {21, 0}, + {30, 0}, + {1, "is"}, + {317, 0}, + {18, 0}, + {318, 0}, + {32, 0}, + {319, 0}, + {19, 0}, + {320, 0}, + {33, 0}, + {34, 0}, + {321, 0}, + {322, 0}, + {24, 0}, + {17, 0}, + {47, 0}, + {323, 0}, + {324, 0}, + {325, 0}, + {327, 0}, + {326, 0}, + {10, 0}, + {26, 0}, + {333, 0}, + {339, 0}, + {328, 0}, + {329, 0}, + {330, 0}, + {336, 0}, + {337, 0}, + {340, 0}, + {338, 0}, + {341, 0}, + {343, 0}, + {345, 0}, + {346, 0}, + {347, 0}, +}; +grammar ValidationGrammar = { + 92, + dfas, + {183, labels}, + 256 +}; diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index 0f681622f28820..1e9213dc5f9efd 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -39,6 +39,7 @@ #include "parsetok.h" extern grammar _PyParser_Grammar; /* From graminit.c */ +extern grammar ValidationGrammar; /* From gramvalid.c */ #ifdef lint #include @@ -649,11 +650,11 @@ validate_node(node *tree) assert(ISNONTERMINAL(type)); type -= NT_OFFSET; - if (type >= _PyParser_Grammar.g_ndfas) { + if (type >= ValidationGrammar.g_ndfas) { PyErr_Format(parser_error, "Unrecognized node type %d.", TYPE(tree)); return 0; } - const dfa *nt_dfa = &_PyParser_Grammar.g_dfa[type]; + const dfa *nt_dfa = &ValidationGrammar.g_dfa[type]; REQ(tree, nt_dfa->d_type); /* Run the DFA for this nonterminal. */ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 5c5a720ba0c818..34d44b58a62bbe 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -293,6 +293,7 @@ + diff --git a/Parser/parser.c b/Parser/parser.c index 227b9184f471d2..fef29ca5a42691 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -56,12 +56,12 @@ s_pop(stack *s) { if (s_empty(s)) Py_FatalError("s_pop: parser stack underflow -- FATAL"); - s->s_top++; + PyNode_Compress(s->s_top++->s_parent); } #else /* !Py_DEBUG */ -#define s_pop(s) (s)->s_top++ +#define s_pop(s) PyNode_Compress((s)->s_top++->s_parent) #endif diff --git a/Parser/pgen/__main__.py b/Parser/pgen/__main__.py index eea52618422e41..451ae6cc81366f 100644 --- a/Parser/pgen/__main__.py +++ b/Parser/pgen/__main__.py @@ -21,6 +21,11 @@ def main(): type=argparse.FileType('w'), help="The path to write the grammar as initialized data", ) + parser.add_argument( + "gramvalid_c", + type=argparse.FileType('w'), + help="The path to write the validation grammar as initialized data", + ) parser.add_argument("--verbose", "-v", action="count") args = parser.parse_args() @@ -28,7 +33,9 @@ def main(): p = ParserGenerator(args.grammar, args.tokens, verbose=args.verbose) grammar = p.make_grammar() grammar.produce_graminit_h(args.graminit_h.write) - grammar.produce_graminit_c(args.graminit_c.write) + grammar.produce_graminit_c(args.graminit_c.write, "_PyParser_Grammar") + grammar.extend_for_validation() + grammar.produce_graminit_c(args.gramvalid_c.write, "ValidationGrammar") if __name__ == "__main__": diff --git a/Parser/pgen/grammar.py b/Parser/pgen/grammar.py index 5cd652426b4755..492c13141d770b 100644 --- a/Parser/pgen/grammar.py +++ b/Parser/pgen/grammar.py @@ -58,16 +58,16 @@ def produce_graminit_h(self, writer): for number, symbol in self.number2symbol.items(): writer("#define {} {}\n".format(symbol, number)) - def produce_graminit_c(self, writer): + def produce_graminit_c(self, writer, name): writer("/* Generated by Parser/pgen */\n\n") writer('#include "grammar.h"\n') - writer("grammar _PyParser_Grammar;\n") + writer("grammar {};\n".format(name)) self.print_dfas(writer) self.print_labels(writer) - writer("grammar _PyParser_Grammar = {\n") + writer("grammar {} = {{\n".format(name)) writer(" {n_dfas},\n".format(n_dfas=len(self.dfas))) writer(" dfas,\n") writer(" {{{n_labels}, labels}},\n".format(n_labels=len(self.labels))) @@ -96,12 +96,14 @@ def print_dfas(self, writer): ' {{{dfa_symbol}, "{symbol_name}", '.format( dfa_symbol=symbol, symbol_name=self.number2symbol[symbol] ) - + "{n_states}, states_{dfa_index},\n".format( + + "{n_states}, states_{dfa_index},".format( n_states=len(dfa), dfa_index=dfaindex ) - + ' "' ) - + if first_sets is None: + writer(" 0},\n") + continue + writer('\n "') bitset = bytearray((len(self.labels) >> 3) + 1) for token in first_sets: bitset[token >> 3] |= 1 << (token & 7) @@ -142,3 +144,86 @@ def print_arcs(self, write, dfaindex, states): ) ) write("};\n") + + def extend_for_validation(self): + """ Set up ValidationGrammar by extending _PyParser_Grammar with + the "transitive closure" of single-arc productions. + + Given the grammar which has single-arc productions, such as + + or_test ::= and_test + + --and other productions using the nonterminals produced by the above, e.g. + + test := or_test 'if' or_test 'else' test + + --it adds to the grammar the "transitive" rules. + For the rules shown above, the following new rules will be added: + + test := or_test 'if' and_test 'else' test + test := and_test 'if' or_test 'else' test + test := and_test 'if' and_test 'else' test + """ + + reducible_from = {symbol: set() for symbol in self.dfas} + nt_label = {} + + # Build the reverse mapping for NT index -> label ID + for i, (symbol, _) in enumerate(self.labels): + if symbol > 255: + nt_label[symbol] = i + + # Pass 1: build the sets in `reducible_from` + for symbol, (states, _) in self.dfas.items(): + label = nt_label[symbol] + for a_label, a_arrow in states[0]: + + # Does `a_arrow` point to a final state? + if any(next_label == 0 for next_label, _ in states[a_arrow]): + + # Yes! Update the sets: `symbol` is reducible from `a_label` + reducible_from[symbol].add(a_label) + + lb_type, _ = self.labels[a_label] + if lb_type > 255: + # `symbol` is transitively reducible from whatever + # `a_label`'s symbol is reducible from. + reducible_from[symbol] |= reducible_from[lb_type] + + # Anything that is reducible from `symbol`, is transitively + # reducible from whatever `symbol` is reducible from. + for other in self.dfas: + if label in reducible_from[other]: + reducible_from[other] |= reducible_from[symbol] + + # Pass 2: generate the extended DFAs + self.states = [] + new_dfas = {} + for symbol, (old_states, _) in self.dfas.items(): + new_states = [] + for old_state in old_states: + new_state = [] + + # Initialize the new arcs. + for old_arc in old_state: + a_label, a_arrow = old_arc + lb_type, lb_name = self.labels[a_label] + + # Copy the original arc; if it's a specific NAME, put it first, + # so that it takes precedence over a generic NAME arc. + if lb_name: + new_state.insert(0, old_arc) + else: + new_state.append(old_arc) + + # Add new arcs for symbols that `lb_type` is reducible from. + if lb_type > 255: + new_state.extend((other_lbl, a_arrow) + for other_lbl in reducible_from[lb_type]) + + new_states.append(new_state) + + self.states.append(new_states) + new_dfas[symbol] = (new_states, None) + + self.dfas = new_dfas diff --git a/Python/ast.c b/Python/ast.c index 913e53ad7937d8..a38344853e5100 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -14,6 +14,11 @@ #include #define MAXLEVEL 200 /* Max parentheses level */ +#define case_EXPR case comparison: case lambdef: \ + case term: case factor: case power: case namedexpr_test: \ + case test: case test_nocond: case and_test: case or_test: case not_test: \ + case expr: case xor_expr: case and_expr: case shift_expr: \ + case arith_expr: case star_expr: case atom_expr: case atom static int validate_stmts(asdl_seq *); static int validate_exprs(asdl_seq *, expr_context_ty, int); @@ -728,7 +733,7 @@ num_stmts(const node *n) l = 0; for (i = 0; i < NCH(n); i++) { ch = CHILD(n, i); - if (TYPE(ch) == stmt) + if (TYPE(ch) == stmt || TYPE(ch) == simple_stmt || TYPE(ch) == compound_stmt) l += num_stmts(ch); } return l; @@ -742,17 +747,14 @@ num_stmts(const node *n) case func_body_suite: /* func_body_suite: simple_stmt | NEWLINE [TYPE_COMMENT NEWLINE] INDENT stmt+ DEDENT */ /* suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT */ - if (NCH(n) == 1) - return num_stmts(CHILD(n, 0)); - else { - i = 2; - l = 0; - if (TYPE(CHILD(n, 1)) == TYPE_COMMENT) - i += 2; - for (; i < (NCH(n) - 1); i++) - l += num_stmts(CHILD(n, i)); - return l; - } + assert(NCH(n) > 1); + i = 2; + l = 0; + if (TYPE(CHILD(n, 1)) == TYPE_COMMENT) + i += 2; + for (; i < (NCH(n) - 1); i++) + l += num_stmts(CHILD(n, i)); + return l; default: { char buf[128]; @@ -800,7 +802,7 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, ch = CHILD(n, i); if (TYPE(ch) == NEWLINE) continue; - REQ(ch, stmt); + assert(TYPE(ch) == stmt || TYPE(ch) == simple_stmt || TYPE(ch) == compound_stmt); num = num_stmts(ch); if (num == 1) { s = ast_for_stmt(&c, ch); @@ -809,7 +811,6 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, asdl_seq_SET(stmts, k++, s); } else { - ch = CHILD(ch, 0); REQ(ch, simple_stmt); for (j = 0; j < num; j++) { s = ast_for_stmt(&c, CHILD(ch, j * 2)); @@ -897,7 +898,7 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, * stars on the args -- just parse them into an ordered list */ num = 0; for (i = 0; i < NCH(ch); i++) { - if (TYPE(CHILD(ch, i)) == test) { + if (TYPE(CHILD(ch, i)) >= NT_OFFSET) { num++; } } @@ -908,7 +909,7 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, j = 0; for (i = 0; i < NCH(ch); i++) { - if (TYPE(CHILD(ch, i)) == test) { + if (TYPE(CHILD(ch, i)) >= NT_OFFSET) { arg = ast_for_expr(&c, CHILD(ch, i)); if (!arg) goto out; @@ -1235,9 +1236,7 @@ ast_for_comp_op(struct compiling *c, const node *n) /* comp_op: '<'|'>'|'=='|'>='|'<='|'!='|'in'|'not' 'in'|'is' |'is' 'not' */ - REQ(n, comp_op); - if (NCH(n) == 1) { - n = CHILD(n, 0); + if (NCH(n) == 0) { switch (TYPE(n)) { case LESS: return Lt; @@ -1263,7 +1262,8 @@ ast_for_comp_op(struct compiling *c, const node *n) return (cmpop_ty)0; } } - else if (NCH(n) == 2) { + REQ(n, comp_op); + if (NCH(n) == 2) { /* handle "not in" and "is not" */ switch (TYPE(CHILD(n, 0))) { case NAME: @@ -1300,7 +1300,11 @@ seq_for_testlist(struct compiling *c, const node *n) for (i = 0; i < NCH(n); i += 2) { const node *ch = CHILD(n, i); - assert(TYPE(ch) == test || TYPE(ch) == test_nocond || TYPE(ch) == star_expr || TYPE(ch) == namedexpr_test); + switch (TYPE(ch)) { + case_EXPR: break; + default: assert(0 && "unexpected type in testlist"); + } + expression = ast_for_expr(c, ch); if (!expression) @@ -2475,47 +2479,51 @@ ast_for_slice(struct compiling *c, const node *n) node *ch; expr_ty lower = NULL, upper = NULL, step = NULL; - REQ(n, subscript); - /* subscript: test | [test] ':' [test] [sliceop] sliceop: ':' [test] */ - ch = CHILD(n, 0); - if (NCH(n) == 1 && TYPE(ch) == test) { + switch (TYPE(n)) { + case_EXPR: /* 'step' variable hold no significance in terms of being used over other vars */ - step = ast_for_expr(c, ch); + step = ast_for_expr(c, n); if (!step) return NULL; return Index(step, c->c_arena); + case COLON: + return Slice(NULL, NULL, NULL, c->c_arena); } - if (TYPE(ch) == test) { + REQ(n, subscript); + assert(NCH(n) > 1); + ch = CHILD(n, 0); + if (TYPE(ch) != COLON) { lower = ast_for_expr(c, ch); if (!lower) return NULL; - } - /* If there's an upper bound it's in the second or third position. */ - if (TYPE(ch) == COLON) { - if (NCH(n) > 1) { - node *n2 = CHILD(n, 1); + /* If there's an upper bound it's in the second or third position. */ + if (NCH(n) > 2) { + node *n2 = CHILD(n, 2); - if (TYPE(n2) == test) { + if (TYPE(n2) != sliceop) { upper = ast_for_expr(c, n2); if (!upper) return NULL; } } - } else if (NCH(n) > 2) { - node *n2 = CHILD(n, 2); + } else { + REQ(ch, COLON); + if (NCH(n) > 1) { + node *n2 = CHILD(n, 1); - if (TYPE(n2) == test) { - upper = ast_for_expr(c, n2); - if (!upper) - return NULL; + if (TYPE(n2) != sliceop) { + upper = ast_for_expr(c, n2); + if (!upper) + return NULL; + } } } @@ -2523,11 +2531,9 @@ ast_for_slice(struct compiling *c, const node *n) if (TYPE(ch) == sliceop) { if (NCH(ch) != 1) { ch = CHILD(ch, 1); - if (TYPE(ch) == test) { - step = ast_for_expr(c, ch); - if (!step) - return NULL; - } + step = ast_for_expr(c, ch); + if (!step) + return NULL; } } @@ -2707,6 +2713,7 @@ ast_for_atom_expr(struct compiling *c, const node *n) REQ(n, atom_expr); nch = NCH(n); + assert(nch > 1); if (TYPE(CHILD(n, 0)) == AWAIT) { if (c->c_feature_version < 5) { @@ -2715,14 +2722,11 @@ ast_for_atom_expr(struct compiling *c, const node *n) return NULL; } start = 1; - assert(nch > 1); } e = ast_for_atom(c, CHILD(n, start)); if (!e) return NULL; - if (nch == 1) - return e; if (start && nch == 2) { return Await(e, LINENO(n), n->n_col_offset, n->n_end_lineno, n->n_end_col_offset, c->c_arena); @@ -2756,13 +2760,17 @@ ast_for_power(struct compiling *c, const node *n) /* power: atom trailer* ('**' factor)* */ expr_ty e; + node *ch; REQ(n, power); - e = ast_for_atom_expr(c, CHILD(n, 0)); + assert(NCH(n) > 1); + ch = CHILD(n, 0); + if (TYPE(ch) == atom) + e = ast_for_atom(c, ch); + else + e = ast_for_atom_expr(c, ch); if (!e) return NULL; - if (NCH(n) == 1) - return e; - if (TYPE(CHILD(n, NCH(n) - 1)) == factor) { + if (TYPE(CHILD(n, NCH(n) - 2)) == DOUBLESTAR) { expr_ty f = ast_for_expr(c, CHILD(n, NCH(n) - 1)); if (!f) return NULL; @@ -2814,29 +2822,25 @@ ast_for_expr(struct compiling *c, const node *n) yield_expr: 'yield' [yield_arg] */ - asdl_seq *seq; + asdl_seq *seq, *cmps; + asdl_int_seq *ops; + expr_ty expression; int i; - loop: switch (TYPE(n)) { + case lambdef: + case lambdef_nocond: + return ast_for_lambdef(c, n); case namedexpr_test: - if (NCH(n) == 3) - return ast_for_namedexpr(c, n); - /* Fallthrough */ + assert(NCH(n) == 3); + return ast_for_namedexpr(c, n); case test: case test_nocond: - if (TYPE(CHILD(n, 0)) == lambdef || - TYPE(CHILD(n, 0)) == lambdef_nocond) - return ast_for_lambdef(c, CHILD(n, 0)); - else if (NCH(n) > 1) - return ast_for_ifexpr(c, n); - /* Fallthrough */ + assert(NCH(n) > 1); + return ast_for_ifexpr(c, n); case or_test: case and_test: - if (NCH(n) == 1) { - n = CHILD(n, 0); - goto loop; - } + assert(NCH(n) > 1); seq = _Py_asdl_seq_new((NCH(n) + 1) / 2, c->c_arena); if (!seq) return NULL; @@ -2854,60 +2858,46 @@ ast_for_expr(struct compiling *c, const node *n) return BoolOp(Or, seq, LINENO(n), n->n_col_offset, n->n_end_lineno, n->n_end_col_offset, c->c_arena); case not_test: - if (NCH(n) == 1) { - n = CHILD(n, 0); - goto loop; - } - else { - expr_ty expression = ast_for_expr(c, CHILD(n, 1)); - if (!expression) - return NULL; + assert(NCH(n) > 1); + expression = ast_for_expr(c, CHILD(n, 1)); + if (!expression) + return NULL; - return UnaryOp(Not, expression, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, - c->c_arena); - } + return UnaryOp(Not, expression, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, + c->c_arena); case comparison: - if (NCH(n) == 1) { - n = CHILD(n, 0); - goto loop; + assert(NCH(n) > 1); + ops = _Py_asdl_int_seq_new(NCH(n) / 2, c->c_arena); + if (!ops) + return NULL; + cmps = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena); + if (!cmps) { + return NULL; } - else { - expr_ty expression; - asdl_int_seq *ops; - asdl_seq *cmps; - ops = _Py_asdl_int_seq_new(NCH(n) / 2, c->c_arena); - if (!ops) - return NULL; - cmps = _Py_asdl_seq_new(NCH(n) / 2, c->c_arena); - if (!cmps) { + for (i = 1; i < NCH(n); i += 2) { + cmpop_ty newoperator; + + newoperator = ast_for_comp_op(c, CHILD(n, i)); + if (!newoperator) { return NULL; } - for (i = 1; i < NCH(n); i += 2) { - cmpop_ty newoperator; - newoperator = ast_for_comp_op(c, CHILD(n, i)); - if (!newoperator) { - return NULL; - } - - expression = ast_for_expr(c, CHILD(n, i + 1)); - if (!expression) { - return NULL; - } - - asdl_seq_SET(ops, i / 2, newoperator); - asdl_seq_SET(cmps, i / 2, expression); - } - expression = ast_for_expr(c, CHILD(n, 0)); + expression = ast_for_expr(c, CHILD(n, i + 1)); if (!expression) { return NULL; } - return Compare(expression, ops, cmps, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); + asdl_seq_SET(ops, i / 2, newoperator); + asdl_seq_SET(cmps, i / 2, expression); } - break; + expression = ast_for_expr(c, CHILD(n, 0)); + if (!expression) { + return NULL; + } + + return Compare(expression, ops, cmps, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); case star_expr: return ast_for_starred(c, n); @@ -2921,10 +2911,7 @@ ast_for_expr(struct compiling *c, const node *n) case shift_expr: case arith_expr: case term: - if (NCH(n) == 1) { - n = CHILD(n, 0); - goto loop; - } + assert(NCH(n) > 1); return ast_for_binop(c, n); case yield_expr: { node *an = NULL; @@ -2951,13 +2938,14 @@ ast_for_expr(struct compiling *c, const node *n) n->n_end_lineno, n->n_end_col_offset, c->c_arena); } case factor: - if (NCH(n) == 1) { - n = CHILD(n, 0); - goto loop; - } + assert(NCH(n) > 1); return ast_for_factor(c, n); case power: return ast_for_power(c, n); + case atom: + return ast_for_atom(c, n); + case atom_expr: + return ast_for_atom_expr(c, n); default: PyErr_Format(PyExc_SystemError, "unhandled expr: %d", TYPE(n)); return NULL; @@ -3114,32 +3102,9 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, // To remain LL(1), the grammar accepts any test (basically, any // expression) in the keyword slot of a call site. So, we need // to manually enforce that the keyword is a NAME here. - static const int name_tree[] = { - test, - or_test, - and_test, - not_test, - comparison, - expr, - xor_expr, - and_expr, - shift_expr, - arith_expr, - term, - factor, - power, - atom_expr, - atom, - 0, - }; node *expr_node = chch; - for (int i = 0; name_tree[i]; i++) { - if (TYPE(expr_node) != name_tree[i]) - break; - if (NCH(expr_node) != 1) - break; + if (TYPE(expr_node) == atom && NCH(expr_node) == 1) expr_node = CHILD(expr_node, 0); - } if (TYPE(expr_node) != NAME) { ast_error(c, chch, "expression cannot contain assignment, " @@ -3181,24 +3146,31 @@ ast_for_testlist(struct compiling *c, const node* n) { /* testlist_comp: test (comp_for | (',' test)* [',']) */ /* testlist: test (',' test)* [','] */ + asdl_seq *tmp; assert(NCH(n) > 0); - if (TYPE(n) == testlist_comp) { - if (NCH(n) > 1) + switch (TYPE(n)) { + case testlist_comp: + if (NCH(n) > 1) { assert(TYPE(CHILD(n, 1)) != comp_for); + break; + } + n = CHILD(n, 0); + /* Fallthrough */ + case_EXPR: + return ast_for_expr(c, n); + case testlist: + case testlist_star_expr: + assert(NCH(n) > 1); + break; + default: + PyErr_SetString(PyExc_SystemError, "unexpected testlist type"); + return NULL; } - else { - assert(TYPE(n) == testlist || - TYPE(n) == testlist_star_expr); - } - if (NCH(n) == 1) - return ast_for_expr(c, CHILD(n, 0)); - else { - asdl_seq *tmp = seq_for_testlist(c, n); - if (!tmp) - return NULL; - return Tuple(tmp, Load, LINENO(n), n->n_col_offset, - n->n_end_lineno, n->n_end_col_offset, c->c_arena); - } + tmp = seq_for_testlist(c, n); + if (!tmp) + return NULL; + return Tuple(tmp, Load, LINENO(n), n->n_col_offset, + n->n_end_lineno, n->n_end_col_offset, c->c_arena); } static stmt_ty @@ -3513,8 +3485,9 @@ alias_for_import_name(struct compiling *c, const node *n, int store) dotted_name: NAME ('.' NAME)* */ identifier str, name; + node *asname_node; + alias_ty a; - loop: switch (TYPE(n)) { case import_as_name: { node *name_node = CHILD(n, 0); @@ -3537,24 +3510,18 @@ alias_for_import_name(struct compiling *c, const node *n, int store) return alias(name, str, c->c_arena); } case dotted_as_name: - if (NCH(n) == 1) { - n = CHILD(n, 0); - goto loop; - } - else { - node *asname_node = CHILD(n, 2); - alias_ty a = alias_for_import_name(c, CHILD(n, 0), 0); - if (!a) - return NULL; - assert(!a->asname); - a->asname = NEW_IDENTIFIER(asname_node); - if (!a->asname) - return NULL; - if (forbidden_name(c, a->asname, asname_node, 0)) - return NULL; - return a; - } - break; + assert(NCH(n) > 1); + asname_node = CHILD(n, 2); + a = alias_for_import_name(c, CHILD(n, 0), 0); + if (!a) + return NULL; + assert(!a->asname); + a->asname = NEW_IDENTIFIER(asname_node); + if (!a->asname) + return NULL; + if (forbidden_name(c, a->asname, asname_node, 0)) + return NULL; + return a; case dotted_name: if (NCH(n) == 1) { node *name_node = CHILD(n, 0); @@ -3827,16 +3794,14 @@ ast_for_suite(struct compiling *c, const node *n) int i, total, num, end, pos = 0; node *ch; - if (TYPE(n) != func_body_suite) { - REQ(n, suite); - } + assert(TYPE(n) == suite || TYPE(n) == func_body_suite || + TYPE(n) == simple_stmt); total = num_stmts(n); seq = _Py_asdl_seq_new(total, c->c_arena); if (!seq) return NULL; - if (TYPE(CHILD(n, 0)) == simple_stmt) { - n = CHILD(n, 0); + if (TYPE(n) == simple_stmt) { /* simple_stmt always ends with a NEWLINE, and may have a trailing SEMI */ @@ -3861,7 +3826,7 @@ ast_for_suite(struct compiling *c, const node *n) for (; i < (NCH(n) - 1); i++) { ch = CHILD(n, i); - REQ(ch, stmt); + assert(TYPE(ch) == stmt || TYPE(ch) == simple_stmt || TYPE(ch) == compound_stmt); num = num_stmts(ch); if (num == 1) { /* small_stmt or compound_stmt with only one child */ @@ -3872,7 +3837,6 @@ ast_for_suite(struct compiling *c, const node *n) } else { int j; - ch = CHILD(ch, 0); REQ(ch, simple_stmt); for (j = 0; j < NCH(ch); j += 2) { /* statement terminates with a semi-colon ';' */ @@ -4161,7 +4125,7 @@ ast_for_except_clause(struct compiling *c, const node *exc, node *body) /* except_clause: 'except' [test ['as' test]] */ int end_lineno, end_col_offset; REQ(exc, except_clause); - REQ(body, suite); + assert(TYPE(body) == suite || TYPE(body) == simple_stmt); if (NCH(exc) == 1) { asdl_seq *suite_seq = ast_for_suite(c, body); @@ -4447,10 +4411,7 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq) static stmt_ty ast_for_stmt(struct compiling *c, const node *n) { - if (TYPE(n) == stmt) { - assert(NCH(n) == 1); - n = CHILD(n, 0); - } + assert(TYPE(n) != stmt); // must have been compressed if (TYPE(n) == simple_stmt) { assert(num_stmts(n) == 1); n = CHILD(n, 0); @@ -5845,3 +5806,41 @@ _PyAST_GetDocString(asdl_seq *body) } return NULL; } + +void PyNode_Compress(node* n) { + if (NCH(n) == 1) { + node* ch; + switch (TYPE(n)) { + case func_body_suite: + case suite: + case comp_op: + case subscript: + case atom_expr: + case power: + case factor: + case expr: + case xor_expr: + case and_expr: + case shift_expr: + case arith_expr: + case term: + case comparison: + case testlist_star_expr: + case testlist: + case namedexpr_test: + case test: + case test_nocond: + case or_test: + case and_test: + case not_test: + case dotted_as_name: + case stmt: + if (STR(n) != NULL) + PyObject_FREE(STR(n)); + ch = CHILD(n, 0); + *n = *ch; + // All grandchildren are now adopted; don't need to free them, so no need for PyNode_Free + PyObject_FREE(ch); + } + } +} diff --git a/setup.py b/setup.py index 58c16e8ba49d5c..83c039336b6a67 100644 --- a/setup.py +++ b/setup.py @@ -774,7 +774,7 @@ def detect_simple_extensions(self): self.add(Extension('select', ['selectmodule.c'])) # Fred Drake's interface to the Python parser - self.add(Extension('parser', ['parsermodule.c'])) + self.add(Extension('parser', ['parsermodule.c', 'gramvalid.c'])) # Memory-mapped files (also works on Win32). self.add(Extension('mmap', ['mmapmodule.c']))