Skip to content

Instantly share code, notes, and snippets.

@johnbartholomew
Created January 1, 2014 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnbartholomew/8204798 to your computer and use it in GitHub Desktop.
Save johnbartholomew/8204798 to your computer and use it in GitHub Desktop.
#include "nfa.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
Nfa *nfa;
NfaBuilder builder;
nfa_builder_init(&builder);
nfa_build_match_string(&builder, "Hello", 5, NFA_MATCH_CASE_INSENSITIVE);
nfa_build_match_string(&builder, "world", 5, 0);
nfa_build_alt(&builder);
nfa = nfa_builder_finish(&builder, 0);
nfa_builder_reset(&builder);
nfa_print_machine(nfa, stdout);
free(nfa);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment