Skip to content

narayana1208/nfa_evaluator

 
 

Repository files navigation

NFA Evaluation

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

  • a + b (union)
  • ab (concatenation)
  • a* (Kleene star)

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

About

NFA evaluation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published