Lines Matching refs:lb

108     label *lb;
119 lb = &ll->ll_label[ll->ll_nlabels++];
120 lb->lb_type = type;
121 lb->lb_str = strdup(str);
124 PyGrammar_LabelRepr(lb));
125 return Py_SAFE_DOWNCAST(lb - ll->ll_label, intptr_t, int);
168 translabel(grammar *g, label *lb)
173 printf("Translating label %s ...\n", PyGrammar_LabelRepr(lb));
175 if (lb->lb_type == NAME) {
177 if (strcmp(lb->lb_str, g->g_dfa[i].d_name) == 0) {
181 lb->lb_str,
183 lb->lb_type = g->g_dfa[i].d_type;
184 free(lb->lb_str);
185 lb->lb_str = NULL;
190 if (strcmp(lb->lb_str, _PyParser_TokenNames[i]) == 0) {
193 lb->lb_str, i);
194 lb->lb_type = i;
195 free(lb->lb_str);
196 lb->lb_str = NULL;
200 printf("Can't translate NAME label '%s'\n", lb->lb_str);
204 if (lb->lb_type == STRING) {
205 if (isalpha(Py_CHARMASK(lb->lb_str[1])) ||
206 lb->lb_str[1] == '_') {
212 printf("Label %s is a keyword\n", lb->lb_str);
213 lb->lb_type = NAME;
214 src = lb->lb_str + 1;
227 free(lb->lb_str);
228 lb->lb_str = dest;
230 else if (lb->lb_str[2] == lb->lb_str[0]) {
231 int type = (int) PyToken_OneChar(lb->lb_str[1]);
233 lb->lb_type = type;
234 free(lb->lb_str);
235 lb->lb_str = NULL;
239 lb->lb_str);
241 else if (lb->lb_str[2] && lb->lb_str[3] == lb->lb_str[0]) {
242 int type = (int) PyToken_TwoChars(lb->lb_str[1],
243 lb->lb_str[2]);
245 lb->lb_type = type;
246 free(lb->lb_str);
247 lb->lb_str = NULL;
251 lb->lb_str);
253 else if (lb->lb_str[2] && lb->lb_str[3] && lb->lb_str[4] == lb->lb_str[0]) {
254 int type = (int) PyToken_ThreeChars(lb->lb_str[1],
255 lb->lb_str[2],
256 lb->lb_str[3]);
258 lb->lb_type = type;
259 free(lb->lb_str);
260 lb->lb_str = NULL;
264 lb->lb_str);
268 lb->lb_str);
272 PyGrammar_LabelRepr(lb));