Package org.eclipse.jdt.internal.compiler.parser

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner


  ICompilationUnit compilationUnit = compilationResult.getCompilationUnit();
  if (compilationUnit == null) return sourceEnd;
  char[] contents = compilationUnit.getContents();
  if (contents.length == 0) return sourceEnd;
  if (this.positionScanner == null) {
    this.positionScanner = new Scanner(false, false, false, this.options.sourceLevel, this.options.complianceLevel, null, null, false);
  }
  this.positionScanner.setSource(contents);
  this.positionScanner.resetTo(sourceStart, sourceEnd);
  try {
    int token;
View Full Code Here


  ICompilationUnit compilationUnit = compilationResult.getCompilationUnit();
  if (compilationUnit == null) return sourceStart;
  char[] contents = compilationUnit.getContents();
  if (contents.length == 0) return sourceStart;
  if (this.positionScanner == null) {
    this.positionScanner = new Scanner(false, false, false, this.options.sourceLevel, this.options.complianceLevel, null, null, false);
  }
  this.positionScanner.setSource(contents);
  this.positionScanner.resetTo(sourceStart, sourceEnd);
  int count = 0;
  try {
View Full Code Here

    // ignore
  }
  return sourceStart;
}
public void scannerError(Parser parser, String errorTokenName) {
  Scanner scanner = parser.scanner;

  int flag = IProblem.ParsingErrorNoSuggestion;
  int startPos = scanner.startPosition;
  int endPos = scanner.currentPosition - 1;
View Full Code Here

  /* (non-Javadoc)
   * Create and store a specific comment recorder scanner.
   * @see org.eclipse.jdt.internal.compiler.parser.Parser#initializeScanner()
   */
  public void initializeScanner() {
    this.scanner = new Scanner(
        false /*comment*/,
        false /*whitespace*/,
        this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore /*nls*/,
        this.options.sourceLevel /*sourceLevel*/,
        this.options.taskTags/*taskTags*/,
 
View Full Code Here

  private TextEdit probeFormatting(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) {
    if (PROBING_SCANNER == null) {
      // scanner use to check if the kind could be K_JAVA_DOC, K_MULTI_LINE_COMMENT or K_SINGLE_LINE_COMMENT
      // do not tokenize white spaces to get single comments even with spaces before...
      PROBING_SCANNER = new Scanner(true, false/*do not tokenize whitespaces*/, false/*nls*/, ClassFileConstants.JDK1_6, ClassFileConstants.JDK1_6, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
    }
    PROBING_SCANNER.setSource(source.toCharArray());

    IRegion coveredRegion = getCoveredRegion(regions);
    int offset = coveredRegion.getOffset();
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.parser.Scanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.