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

Consider defining Matcher nodes in addition to Error and Proxy nodes #346

Open
alessiostalla opened this issue May 27, 2024 · 0 comments
Open

Comments

@alessiostalla
Copy link
Member

XYZMatcher : Matcher<XYZ> is a node with the same features as XYZ but with the following properties, used to express search patterns over the AST:

  • attributes are of type AttributeMatcher<PrimitiveType> where possible subclasses include ExactMatch ("=" in SQL), IsPresent ("is not null" in SQL), IsAbsent ("is null" in SQL), comparison matchers for numbers (and dates and whatever is comparable), string matchers for strings (contains, not contains, regex)
  • References match against their target, so we need special targets (or special ReferenceByName subclasses) to match "no reference specified" and "reference specified but not resolved" (see below)
  • Contained nodes are matchers, recursively (again we need a special canary node to mean "Containment absent" as opposed to null, see below)
  • Note that in all cases above a null value (for an attribute, reference, etc.) means "ignore this feature". E.g. a Matcher<Person> node with features "name" and "surname", where "name" is ExactMatch("Alessio") and "surname" is null, would match all people named "Alessio" regardless of their surname. This requires special sentinel nodes as described above. The alternative would be to have a sentinel node meaning "ignore this feature for comparison".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant