lex: lexer generator - ponyatov/DLR GitHub Wiki

flex has big disadvantage - it has no option to generate lex.yy.h file with types and functuons declatations, used on lexer. We need function prototype for yy_scan_string(), so this point forces as to move main() into lexer file:

int main(int argc, char* argv[]) {
    for (;;) {
    char *cmdline = readline("> "); // get command line using line editor library
    if (*cmdline && cmdline[0]) { // if entered string not null
        yy_scan_string(cmdline); // set lexer input stream
        yyparse(); // and run parser
    }}
    return 0;
}
⚠️ **GitHub.com Fallback** ⚠️