Class AnyCpdLexer

  • All Implemented Interfaces:
    CpdLexer

    public class AnyCpdLexer
    extends Object
    implements CpdLexer
    Simple tokenization into words and separators. Can ignore end-of-line comments and recognize double/single quoted string literals. It is not a goal to be very customizable, or have very high quality. Higher-quality lexers should be implemented with a lexer generator.

    In PMD 7, this replaces AbstractTokenizer, which provided nearly no more functionality.

    Note: This class has been called AnyTokenizer in PMD 6.

    • Constructor Detail

      • AnyCpdLexer

        public AnyCpdLexer()
      • AnyCpdLexer

        public AnyCpdLexer​(String eolCommentStart)
    • Method Detail

      • tokenize

        public void tokenize​(TextDocument document,
                             TokenFactory tokens)
        Description copied from interface: CpdLexer
        Tokenize the source code and record tokens using the provided token factory.
        Specified by:
        tokenize in interface CpdLexer