org.eclipse.jdt.internal.compiler.parser.Parser类的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中org.eclipse.jdt.internal.compiler.parser.Parser类的一些代码示例,展示了Parser类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser类的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.parser.Parser
类名称:Parser

Parser介绍

暂无

代码示例

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

private Expression parseMemberValue(char[] memberValue) {
    // memberValue must not be null
    if (this.parser == null) {
      this.parser = new Parser(this.problemReporter, true);
    }
    return this.parser.parseMemberValue(memberValue, 0, memberValue.length, this.unit);
  }
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

public void parseStatements(
  Parser parser,
  TypeDeclaration typeDeclaration,
  CompilationUnitDeclaration unit) {
  //fill up the method body with statement
  parser.parse(this, typeDeclaration, unit);
}

代码示例来源:origin: INRIA/spoon

unit = unitsToProcess[i];
this.reportProgress(Messages.bind(Messages.compilation_processing, new String(unit.getFileName())));
this.parser.getMethodBodies(unit);

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

markEnclosingMemberWithLocalType();
  blockReal();
pushOnAstStack(typeDecl);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

static class IntArrayList {
  public int[] list = new int[5];
  public int length = 0;
  public void add(int i) {
    if (this.list.length == this.length) {
      System.arraycopy(this.list, 0, this.list = new int[this.length*2], 0, this.length);
    }
      this.list[this.length++] = i;
    }
  }

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

markEnclosingMemberWithLocalType();
  blockReal();
pushOnAstStack(annotationTypeDeclaration);
if(!this.statementRecoveryActivated &&
    this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
    this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
  problemReporter().invalidUsageOfAnnotationDeclarations(annotationTypeDeclaration);

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

private CompilationUnitDeclaration convert(IModule module, CompilationResult compilationResult) throws JavaModelException {
  this.unit = new CompilationUnitDeclaration(this.problemReporter, compilationResult, 0);
  // not filled at this point
  ModuleDescriptionInfo moduleInfo = (ModuleDescriptionInfo) module;
  org.eclipse.jdt.core.ICompilationUnit cuHandle = moduleInfo.getHandle().getCompilationUnit();
  this.cu = (ICompilationUnit) cuHandle;
  // always parse, because (a) dietParse is always sufficient, (b) we don't yet have the necessary conversion methods for module directives 
  return new Parser(this.problemReporter, true).dietParse(this.cu, compilationResult);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

blockReal();
pushOnAstStack(enumDeclaration);
    this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
  problemReporter().invalidUsageOfEnumDeclarations(enumDeclaration);

代码示例来源:origin: org.projectlombok/lombok.ast

private static Parser makeDummyParser(ProblemReporter reporter, String mainTypeName) {
  Parser parser = new Parser(reporter, false);
  CompilationResult cr = new CompilationResult((mainTypeName + ".java").toCharArray(), 0, 1, 0);
  parser.compilationUnit = new CompilationUnitDeclaration(reporter, cr, 0);
  return parser;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

private ReferenceExpression copy() {
  final Parser parser = new Parser(this.enclosingScope.problemReporter(), false);
  final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit();
  final char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text;
  ReferenceExpression copy =  (ReferenceExpression) parser.parseExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1, 
                  this.enclosingScope.referenceCompilationUnit(), false /* record line separators */);
  copy.original = this;
  copy.sourceStart = this.sourceStart;
  copy.sourceEnd = this.sourceEnd;
  return copy;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

protected CompilationUnitDeclaration buildBindings(ICompilationUnit compilationUnit, boolean isTopLevelOrMember) throws JavaModelException {
  // source unit
  org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) compilationUnit;

  CompilationResult compilationResult = new CompilationResult(sourceUnit, 1, 1, 0);
  CompilationUnitDeclaration unit =
    isTopLevelOrMember ?
      this.locator.basicParser().dietParse(sourceUnit, compilationResult) :
      this.locator.basicParser().parse(sourceUnit, compilationResult);
  if (unit != null) {
    this.locator.lookupEnvironment.buildTypeBindings(unit, null /*no access restriction*/);
    this.locator.lookupEnvironment.completeTypeBindings(unit, !isTopLevelOrMember);
    if (!isTopLevelOrMember) {
      if (unit.scope != null)
        unit.scope.faultInTypes(); // fault in fields & methods
      unit.resolve();
    }
  }
  return unit;
}
public char[][][] collect() throws JavaModelException {

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

protected void consumeAnnotationName() {
  if(this.currentElement != null) {
    int start = this.intStack[this.intPtr];
    int end = (int) (this.identifierPositionStack[this.identifierPtr] & 0x00000000FFFFFFFFL);
    annotationRecoveryCheckPoint(start, end);

    if (this.annotationRecoveryActivated) {
      this.currentElement = this.currentElement.addAnnotationName(this.identifierPtr, this.identifierLengthPtr, start, 0);
    }
  }
  this.recordStringLiterals = false;
}
protected void consumeAnnotationTypeDeclaration() {

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

LambdaExpression copy() {
  final Parser parser = new Parser(this.enclosingScope.problemReporter(), false);
  final char[] source = this.compilationResult.getCompilationUnit().getContents();
  LambdaExpression copy =  (LambdaExpression) parser.parseLambdaExpression(source, this.sourceStart, this.sourceEnd - this.sourceStart + 1, 
                  this.enclosingScope.referenceCompilationUnit(), false /* record line separators */);
  if (copy != null) { // ==> syntax errors == null
    copy.original = this;
  }
  return copy;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

protected void consumeEmptyArrayInitializer() {
  // ArrayInitializer ::= '{' ,opt '}'
  arrayInitializer(0);
}
protected void consumeEmptyArrayInitializeropt() {

代码示例来源:origin: org.eclipse.scout.sdk.deps/ecj

protected static int original_state(int state) {
  return -base_check(state);
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

private int mergeCandidate(int state, int buffer_position) {
  char[] name1 = this.lexStream.name(this.buffer[buffer_position]);
  char[] name2 = this.lexStream.name(this.buffer[buffer_position + 1]);
  int len  = name1.length + name2.length;
  char[] str = CharOperation.concat(name1, name2);
  for (int k = Parser.asi(state); Parser.asr[k] != 0; k++) {
    int l = Parser.terminal_index[Parser.asr[k]];
    if (len == Parser.name[l].length()) {
      char[] name = Parser.name[l].toCharArray();
      if (CharOperation.equals(str, name, false)) {
        return Parser.asr[k];
      }
    }
  }
  return 0;
}

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

buildFile(file, entries);

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public void accept(ICompilationUnit unit, AccessRestriction accessRestriction) {
  CompilationResult unitResult = new CompilationResult(unit, 1, 1, this.options.maxProblemsPerUnit);
  CompilationUnitDeclaration parsedUnit = this.basicParser.dietParse(unit, unitResult);
  this.lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction);
  this.lookupEnvironment.completeTypeBindings(parsedUnit, true);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

markEnclosingMemberWithLocalType();
  blockReal();
pushOnAstStack(typeDecl);

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

static class IntArrayList {
  public int[] list = new int[5];
  public int length = 0;
  public void add(int i) {
    if (this.list.length == this.length) {
      System.arraycopy(this.list, 0, this.list = new int[this.length*2], 0, this.length);
    }
      this.list[this.length++] = i;
    }
  }

相关文章

微信公众号

最新文章

更多

Parser类方法