From 8aa4db21bdbb83e5c4b47dbdb26842417cf69748 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 23 Jun 2015 22:02:27 +0100 Subject: [PATCH] Comment on test for character class operations. --- re2c/src/test/range/test.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/re2c/src/test/range/test.h b/re2c/src/test/range/test.h index fb546351..18aa1aca 100644 --- a/re2c/src/test/range/test.h +++ b/re2c/src/test/range/test.h @@ -7,6 +7,16 @@ namespace re2c { class Range; } namespace re2c_test { +/* + * If encoding has N code units (characters), character class can be + * represented as an N-bit integer: k-th bit is set iff k-th character + * belongs to the class. + * + * Addition and subtraction can be implemented trivially for such + * integer representation of character classes: addition is simply + * bitwise OR of two classes, subtraction is bitwise AND of the first + * class and negated second class. + */ template re2c::Range * range (uint32_t n); template re2c::Range * add (uint32_t n1, uint32_t n2); template re2c::Range * sub (uint32_t n1, uint32_t n2); -- 2.40.0