protected List < Map < String , ? > > generateComments ( ) { final List < Map < String , ? > > list = new ArrayList <> ( ) ; // Block comment list . add ( pattern ( it -> { it . delimiters ( "(/\\*+)" , "(\\*/)" ) ; //$NON-NLS-1$ //$NON-NLS-2$ it . style ( BLOCK_COMMENT_STYLE ) ; it . beginStyle ( BLOCK_COMMENT_DELIMITER_STYLE ) ; it . endStyle ( BLOCK_COMMENT_DELIMITER_STYLE ) ; it . pattern ( it2 -> { it2 . matches ( "^\\s*(\\*)(?!/)" ) ; //$NON-NLS-1$ it2 . style ( BLOCK_COMMENT_DELIMITER_STYLE ) ; } ) ; it . comment ( "Multiline comments" ) ; //$NON-NLS-1$ } ) ) ; // Line comment list . add ( pattern ( it -> { it . matches ( "\\s*(//)(.*)$" ) ; //$NON-NLS-1$ it . substyle ( 1 , LINE_COMMENT_DELIMITER_STYLE ) ; it . substyle ( 2 , LINE_COMMENT_STYLE ) ; it . comment ( "Single-line comment" ) ; //$NON-NLS-1$ } ) ) ; return list ; }
Generate the rules for the comments .