tags:

views:

61

answers:

1

I've been trying out fnparse library written by Joshua Choi in Clojure and I'm having difficulties trying to work out how to call the rules on the text that I want to parse. I've been experimenting with cat which is part of the new release. Lets take the example code listed. Could anyone give me some ideas how I could call the rule on an expression?

Thank you!

+3  A: 

Hey, thanks for trying out FnParse 3.

In general, you use the edu.arizona.fnparse/match form (as well as the complementary find, substitute, and substitute-1 forms) to use the rules that you create. Check their documentation strings.

Sorry about the confusion—I should have added an example of match in math.clj—but take a look at the bottom of the sample Clojure parser at http://github.com/joshua-choi/fnparse/blob/3.α.3/src/edu/arizona/fnparse/clojure.clj. Even though the Clojure parser uses FnParse Hound, match works the same way in both Cat and Hound.

joshua-choi