pwightman / nfa_evaluator

NFA evaluation
1 stars 1 forks source link

NFA Evaluation

This evaluator supports building and traversing NFA's based on Regular Expressions that support the following actions:

General Usage

// NFA representing the RE: ((a + b)c)*

Nfa* a = Nfa::simple("a");
Nfa* b = Nfa::simple("b");
Nfa* c = Nfa::simple("c");

a->unite(b);
a->concatenate(c);
a->star();

// Run strings on the Nfa

a->isValidString("acbc", false);     // returns true
a->isValidString("acacacac", false); // returns true
a->isValidString("xyz", false);      // returns false

The booleans being passed into isValidString determine whether the evaluation should occur in parallel or not.

NOTE: Parallel evaluation is currently broken