Class ChannelFilter

java.lang.Object
io.github.douira.glsl_transformer.print.filter.ChannelFilter
All Implemented Interfaces:
TokenFilter

public class ChannelFilter extends Object implements TokenFilter
The channel filter accepts all tokens that are not from a lexer channel that is on the given list of disallowed channels.
  • Constructor Details

    • ChannelFilter

      public ChannelFilter(EnumSet<TokenFilter.TokenChannel> disallowedChannels)
      Creates a new channel filter with the given disallowed channels.
      Parameters:
      disallowedChannels - The disallowed channels
    • ChannelFilter

      public ChannelFilter(TokenFilter.TokenChannel disallowedChannel)
      Creates a new channel filter with a single disallowed channel.
      Parameters:
      disallowedChannel - The disallowed channel
  • Method Details

    • isTokenAllowed

      public boolean isTokenAllowed(Token token)
      Description copied from interface: TokenFilter
      Checks if the token should be printed.
      Specified by:
      isTokenAllowed in interface TokenFilter
      Parameters:
      token - The token to check
      Returns:
      true if the given token should be printed