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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core.util;
13 import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
16 * Internal scanner used for DOM AST nodes.
20 public class CommentRecorderScanner extends Scanner {
22 public CommentRecorderScanner(
23 boolean tokenizeComments,
24 boolean tokenizeWhiteSpace,
25 boolean checkNonExternalizedStringLiterals,
28 char[][] taskPriorities) {
29 // boolean isTaskCaseSensitive) {
30 // super(tokenizeComments, tokenizeWhiteSpace,
31 // checkNonExternalizedStringLiterals,
33 // taskTags, taskPriorities, isTaskCaseSensitive);
34 super(tokenizeComments, tokenizeWhiteSpace,
35 checkNonExternalizedStringLiterals, false, false,
36 taskTags, taskPriorities, true /*taskCaseSensitive*/);
40 * Set start position negative for line comments.
41 * @see org.eclipse.jdt.internal.compiler.parser.Scanner#recordComment(int)
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];