Index: trunk/extensions/AbuseFilter/parser_native/parser.h |
— | — | @@ -434,19 +434,19 @@ |
435 | 435 | |
436 | 436 | if (info.full) { |
437 | 437 | std::map<parser_id, std::string> rule_names; |
438 | | - rule_names[parser_grammar<charT>::id_value] = "value"; |
439 | | - rule_names[parser_grammar<charT>::id_variable] = "variable"; |
440 | | - rule_names[parser_grammar<charT>::id_basic] = "basic"; |
441 | | - rule_names[parser_grammar<charT>::id_bool_expr] = "bool_expr"; |
442 | | - rule_names[parser_grammar<charT>::id_ord_expr] = "ord_expr"; |
443 | | - rule_names[parser_grammar<charT>::id_eq_expr] = "eq_expr"; |
444 | | - rule_names[parser_grammar<charT>::id_pow_expr] = "pow_expr"; |
445 | | - rule_names[parser_grammar<charT>::id_mult_expr] = "mult_expr"; |
446 | | - rule_names[parser_grammar<charT>::id_plus_expr] = "plus_expr"; |
447 | | - rule_names[parser_grammar<charT>::id_in_expr] = "in_expr"; |
448 | | - rule_names[parser_grammar<charT>::id_function] = "function"; |
449 | | - rule_names[parser_grammar<charT>::id_tern_expr] = "tern_expr"; |
450 | | - rule_names[parser_grammar<charT>::id_string] = "string"; |
| 438 | + rule_names[pid_value] = "value"; |
| 439 | + rule_names[pid_variable] = "variable"; |
| 440 | + rule_names[pid_basic] = "basic"; |
| 441 | + rule_names[pid_bool_expr] = "bool_expr"; |
| 442 | + rule_names[pid_ord_expr] = "ord_expr"; |
| 443 | + rule_names[pid_eq_expr] = "eq_expr"; |
| 444 | + rule_names[pid_pow_expr] = "pow_expr"; |
| 445 | + rule_names[pid_mult_expr] = "mult_expr"; |
| 446 | + rule_names[pid_plus_expr] = "plus_expr"; |
| 447 | + rule_names[pid_in_expr] = "in_expr"; |
| 448 | + rule_names[pid_function] = "function"; |
| 449 | + rule_names[pid_tern_expr] = "tern_expr"; |
| 450 | + rule_names[pid_string] = "string"; |
451 | 451 | tree_to_xml(strm, info.trees, "", rule_names); |
452 | 452 | } else { |
453 | 453 | throw parse_error("parsing failed"); |
Index: trunk/extensions/AbuseFilter/parser_native/README |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +This is the AbuseFilter native expression parser. It improves the performance |
| 3 | +of the filter by using a C++ program to parse the expression. |
| 4 | + |
| 5 | +parser_native has been tested on these platforms: |
| 6 | + |
| 7 | +* Solaris 10 with GCC 3.4.3 |
| 8 | +* Solaris 10 with Sun Studio 12 (C++ patch 124864-04) |
| 9 | +* Debian Linux with GCC 4.3.1 |
| 10 | + |
| 11 | +parser_filter requires Boost (www.boost.org) 1.35.0 or higher. Earlier versions |
| 12 | +will generate a parser which does not work. |
| 13 | + |
| 14 | +To compile it, copy makefile.config.example to makefile.config, edit it, and |
| 15 | +run 'make'. (GNU make is required.) |