Hi,
I ended up finding out that Jint includes a parser that can do what I was looking for. Here is an example of how I used it:
I ended up finding out that Jint includes a parser that can do what I was looking for. Here is an example of how I used it:
List<string> itemRefs = new List<string>();
JavaScriptParser jpParser = new JavaScriptParser();
Program parsedJS = jpParser.Parse(formulaToEval, new ParserOptions { Comment = true, Source = formulaToEval, Tokens = true, Tolerant = true });
foreach (Token jsToken in parsedJS.Tokens)
{
string tokenVal = jsToken.Value.ToString();
if (jsToken.Type != Tokens.Identifier )
continue;
itemRefs.Add(tokenVal );
}
return itemRefs;