I tried to include the shared-ldap filter parser into LS, however the antlr based filter parser in shared-ldap doesn't fit the needs of an filter parser in LS:
- Parse incomplete filters: The shared-ldap parser is designed to parse complete filters. But it isn't possible to parse incomplete filters. When typing the filter into the text field, for example
the antlr based filter parser just throws and exception "unexpected token". It doesn't provide any information about the edited part of the filter and it isn't possible to provide context sensitive content assistence to the user.
- Error tolerance: The antlr based parser stops if an unexpected character occurs. For a filter builder it is necessary to have an parser that continues when unexpected characters occurs. That makes it possible to mark (red squirrel) the invalid characters in the editor.
- Position tracking: For a filter builder it is necessary to get the position of each token (left parenthesis, attribute, assertion, value, ...) to enable syntax highlighting and context sensitive content assistent. With the antlr based parser it is possible to track the line and columnt but it doesn't fit the Eclipse editor framework reqirements.
For that reasons I prefer to to keep and improve the hand-written filter parser in LS.