Class CommentTokenMatcher

    • Constructor Detail

      • CommentTokenMatcher

        public CommentTokenMatcher​(java.lang.String regex)
      • CommentTokenMatcher

        public CommentTokenMatcher​(java.util.regex.Pattern pattern)
    • Method Detail

      • buildToken

        public Token buildToken​(java.lang.String s)
        Description copied from class: RegExpTokenMatcher
        Builds a token following a successful match. Note new objects should be created each time as error reporting information is later attached to tokens.
        Specified by:
        buildToken in interface TokenBuilder
        Specified by:
        buildToken in class RegExpTokenMatcher
        Parameters:
        s - String representing the completed matched token
        Returns:
        the appropriate type of token.
      • slashStarCommentMatcher

        public static CommentTokenMatcher slashStarCommentMatcher()
        Recognize comments of the form /* ... */ on a single line.
        Returns:
        a TokenMatcher
      • multiLineSlashStarCommentMatcher

        public static MultiLineMatcher multiLineSlashStarCommentMatcher()
        Recognize comments of the form /* ... */ which can span multiple lines.
        Returns:
        a TokenMatcher
      • slashSlashCommentMatcher

        public static CommentTokenMatcher slashSlashCommentMatcher()
        Recognize comments of the form /// ...
        Returns:
        a TokenMatcher
      • hashCommentMatcher

        public static CommentTokenMatcher hashCommentMatcher()
        Recognize comments of the form # ...
        Returns:
        a TokenMatcher
      • init

        public void init​(Jep j)
        Description copied from interface: TokenMatcher
        Initialize the matcher when the Jep instance is known.
        Parameters:
        j - Jep instance