+ /* Set first_char only if there is only one character that can be the
+ first character of a match */
+ tnfa->first_char = -1;
+ if (!tmp_ast_l->nullable)
+ {
+ int scanning = 1;
+ for (p = tree->firstpos; scanning && p->position >= 0; p++)
+ {
+ tre_tnfa_transition_t *j = transitions + offs[p->position];
+ while (j->state != NULL)
+ {
+ if (j->code_min <= j->code_max)
+ {
+ if (j->code_max != j->code_min || j->code_min == -1 || tnfa->first_char != -1)
+ {
+ tnfa->first_char = -1;
+ scanning = 0;
+ break;
+ }
+ tnfa->first_char = j->code_min;
+ }
+ j++;
+ }
+ }
+#ifdef TRE_DEBUG
+ if (tnfa->first_char >= 0)
+ DPRINT(("first char must be %d\n", tnfa->first_char));
+#endif /* TRE_DEBUG */
+ }
+#endif /* !USE_FIRSTPOS_CHARS */