7f74c392dbb76ed4b9e60ca6e94f203ed5a7f007
[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(
23                 boolean tokenizeComments,
24                 boolean tokenizeWhiteSpace,
25                 boolean checkNonExternalizedStringLiterals,
26 //              long sourceLevel,
27                 char[][] taskTags,
28                 char[][] taskPriorities) {
29 //              boolean isTaskCaseSensitive) {
30 //              super(tokenizeComments, tokenizeWhiteSpace, 
31 //                              checkNonExternalizedStringLiterals, 
32 //                              sourceLevel, 
33 //                              taskTags, taskPriorities, isTaskCaseSensitive);
34                 super(tokenizeComments, tokenizeWhiteSpace, 
35                                 checkNonExternalizedStringLiterals, false, false,
36                                 taskTags, taskPriorities);
37         }
38         
39         /**
40          * Set start position negative for line comments.
41          * @see org.eclipse.jdt.internal.compiler.parser.Scanner#recordComment(int)
42          */
43         public void recordComment(int token) {
44                 super.recordComment(token);
45                 if (token == TokenNameCOMMENT_LINE) {
46                         // for comment line both positions are negative
47                         this.commentStarts[this.commentPtr] = -this.commentStarts[this.commentPtr];
48                 }
49         }
50 }