Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Set ByteMatcher type idea. #7

Open
nishihatapalmer opened this issue Feb 21, 2016 · 1 comment
Open

New Set ByteMatcher type idea. #7

nishihatapalmer opened this issue Feb 21, 2016 · 1 comment

Comments

@nishihatapalmer
Copy link
Owner

Possibility of a new ByteMatcherSetMatcher - a Set composed of other ByteMatchers, rather than collapsing all the bytes into a single matcher. Simply iterate over the bytematchers, and return true if any of them match.

  • Could well be more efficient than translating to a single matcher backed by a bitset or an array with a binary search. e.g. a bitmask and another byte = [&5e 7f] == two tests at most.
  • Doesn't work well with the current compiler, which discards the parse tree before the optimiser kicks in, and turns it into collections of Bytes instead.
@nishihatapalmer
Copy link
Owner Author

Started a UnionByteMatcher in the incubator package of v3 which matches the union of a set of underlying ByteMatchers.

Could also have a SubtractionByteMatcher which matches all bytes in a first byte matcher, as long as they aren't in a second byte matcher, or IntersectionByteMatcher, which only matches the intersection of those matchers. However - it's unlikely that these would be more efficient than just calculating those sets and providing a Set byte matcher for the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant