/* You must include the header generated by perplex (-i option) for
 * the perplex_t and function prototypes, as well as the token
 * definitions header generated by lemon. Here we include them
 * indirectly via the main header.
 */
#include "main.h"

/* Conditions are commonly used in more complex scanners. BRL-CAD runs
 * perplex and re2c with condition support by default. Define basic
 * conditions here.
 */
enum {INITIAL, normal};
%%

/* Need at least one state transition to avoid build warning about the
 * setCondition routine being unused.
 */
INITIAL => normal { continue; }

<normal> {
/* yyextra (or the convenience variable you assign it to in the
 * PERPLEX_ON_ENTER macro) and yytext both need to be used in at least
 * one rule to avoid a build warning.
 */

/* A wildcard rule such as this frequently appears as the last
 * (lowest-precedent) rule to handle unmatched input, e.g. by
 * ignoring it or echoing it.
 */
[^] {
    /* ignore any character and continue scanning */
    continue;
}
}
