A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / util / CommentRecorderScanner.java
1 /*******************************************************************************
2  * Copyright (c) 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core.util;
12
13 import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
14
15 /**
16  * Internal scanner used for DOM AST nodes.
17  * 
18  * @since 3.0
19  */
20 public class CommentRecorderScanner extends Scanner {
21
22         public CommentRecorderScanner(boolean tokenizeComments,
23                         boolean tokenizeWhiteSpace,
24                         boolean checkNonExternalizedStringLiterals,
25                         // long sourceLevel,
26                         char[][] taskTags, char[][] taskPriorities) {
27                 // boolean isTaskCaseSensitive) {
28                 // super(tokenizeComments, tokenizeWhiteSpace,
29                 // checkNonExternalizedStringLiterals,
30                 // sourceLevel,
31                 // taskTags, taskPriorities, isTaskCaseSensitive);
32                 super(tokenizeComments, tokenizeWhiteSpace,
33                                 checkNonExternalizedStringLiterals, false, false, taskTags,
34                                 taskPriorities, true /* taskCaseSensitive */);
35         }
36
37         /**
38          * Set start position negative for line comments.
39          * 
40          * @see net.sourceforge.phpdt.internal.compiler.parser.Scanner#recordComment(int)
41          */
42         public void recordComment(int token) {
43                 super.recordComment(token);
44                 if (token == TokenNameCOMMENT_LINE) {
45                         // for comment line both positions are negative
46                         this.commentStarts[this.commentPtr] = -this.commentStarts[this.commentPtr];
47                 }
48         }
49 }