Feature Set Matching Sample Code ================================ NOTES: Class 'FeatureSet' provides the main entry points for this code. Namely: Parse, Format, Write, Match, Simplify. Class 'Test' is a runnable test harness that also provides example use of the feature set parsing and matching code. File 'Test.out is a copy of the output from this test harness. Classes of the form xxxPredicate are used to represent different types of feature set predicate, and also contain code for simplifying predicate expressions. These correspond roughly to the syntax elements declared in RFC 2533. The values TRUE and FALSE are represented by the special auxiliary predicates (TRUE) and (FALSE). TODO: (a) Add support for q-values -- and other parameters. (b) Add support for unit designators (c) Add support for auxiliary predicate parameters. (d) [MAYBE] Revise algorithm to keep set expressions intact, and use additional rules to handle them. This should help contain the explosion of conjunctions when converting to DNF. Version 1.00A 27-Apr-1999 --------------------------- Initial working version, based closely on RFC 2533. Version 1.00B 27-Apr-1999 --------------------------- Test handling of (TRUE), (FALSE) in conjunction. Test handling of (TRUE), (FALSE) in disjunction. Test handling of various set expression forms. Fix rational number parsing bug Fix set expression [3..2] simplification bug Fix rational comparison bug. Added support for basic auxiliary predicates. Redefined TRUEPredicate and FALSEPredicate as instances of AuxPredicate. (At this time, there is no support for auxiliary predicate simplification). Version 1.00C 29-Apr-1999 --------------------------- Implemented multiline expression formatting. Add examples from RFC 2531 into test data set. Revised multiline output to place as many complete predicates on a line as will fit. Version 1.00D 18-May-1999 --------------------------- (Revise algorithm to produce more intuitive results based on <=, >=, = and != operators.) Add EQFIRST processing tag value to Predicate. Add logic to ANDPredicate to process EQFIRST tag value. Change AtomicPredicate simplification to use EQ, NE, GE and LE for its four primitive comparison operators. ANDPredicate.ReducePredicates re-worked to perform reductions based on EQ, NE, GE, LE. Version 1.00E 14-Jun-1999 --------------------------- Add copyright notice, redistribution terms and conditions and warranty disclaimer to each source module. Change algorithm description references to indicate rather than RFC 2533. Version 1.10A 06-Apr-2000 --------------------------- Updated by Graham Klyne, Content Technologies Ltd., to include calculation of feature set hash value per Version 1.20A 05-Mar-2002 --------------------------- Updated by Graham Klyne, Nine by Nine. Revised the pretty-print formatting logic around modules Formatter and FormatterBase. Added Auxilliary predicate definition and substitution (without support for parameters). Added test program for IPP-fax examples.