Skip to content

Instantly share code, notes, and snippets.

@musicm122
Created July 12, 2014 21:38
Show Gist options
  • Save musicm122/f6b12b0404077c3893a5 to your computer and use it in GitHub Desktop.
Save musicm122/f6b12b0404077c3893a5 to your computer and use it in GitHub Desktop.
ConditionParserWorkflow
void Main()
{
//The user input expression
var expression = "\"java\" and \"SQL\" and \"C#\" or \"VB.NET\"";
//The collection of tokens that we will use to evaluate the logic in the expression
var tokens = Tokenize(expression);
//tokens.Dump();
//Our evaluated representation of the tokens; We can use this to
//convert the expression to whatever language we wish
var ConditionNode = Eval(tokens);
//Transforms our Nodes into our desired programming language
var endResult = CreateQueryString(ConditionNode );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment