Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.ImportReference


protected void consumePackageDeclaration() {
  // PackageDeclaration ::= 'package' Name ';'
  /* build an ImportRef build from the last name
  stored in the identifier stack. */

  ImportReference impt = this.compilationUnit.currentPackage;
  this.compilationUnit.javadoc = this.javadoc;
  this.javadoc = null;
  // flush comments defined prior to import statements
  impt.declarationEnd = this.endStatementPosition;
  impt.declarationSourceEnd = flushCommentsDefinedPriorTo(impt.declarationSourceEnd);
View Full Code Here


protected void consumePackageDeclarationName() {
  // PackageDeclarationName ::= PackageComment 'package' Name RejectTypeAnnotations
  /* build an ImportRef build from the last name
  stored in the identifier stack. */

  ImportReference impt;
  int length;
  char[][] tokens =
    new char[length = this.identifierLengthStack[this.identifierLengthPtr--]][];
  this.identifierPtr -= length;
  long[] positions = new long[length];
  System.arraycopy(this.identifierStack, ++this.identifierPtr, tokens, 0, length);
  System.arraycopy(
    this.identifierPositionStack,
    this.identifierPtr--,
    positions,
    0,
    length);

  impt = new ImportReference(tokens, positions, false, ClassFileConstants.AccDefault);
  this.compilationUnit.currentPackage = impt;

  if (this.currentToken == TokenNameSEMICOLON){
    impt.declarationSourceEnd = this.scanner.currentPosition - 1;
  } else {
View Full Code Here

protected void consumePackageDeclarationNameWithModifiers() {
  // PackageDeclarationName ::= Modifiers 'package' PushRealModifiers Name RejectTypeAnnotations
  /* build an ImportRef build from the last name
  stored in the identifier stack. */

  ImportReference impt;
  int length;
  char[][] tokens =
    new char[length = this.identifierLengthStack[this.identifierLengthPtr--]][];
  this.identifierPtr -= length;
  long[] positions = new long[length];
  System.arraycopy(this.identifierStack, ++this.identifierPtr, tokens, 0, length);
  System.arraycopy(
    this.identifierPositionStack,
    this.identifierPtr--,
    positions,
    0,
    length);

  int packageModifiersSourceStart = this.intStack[this.intPtr--];
  int packageModifiersSourceEnd = packageModifiersSourceStart; // Unless there were any
  int packageModifiers = this.intStack[this.intPtr--];

  impt = new ImportReference(tokens, positions, false, packageModifiers);
  this.compilationUnit.currentPackage = impt;
  // consume annotations
  if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
    System.arraycopy(
      this.expressionStack,
View Full Code Here

protected void consumeSingleStaticImportDeclarationName() {
  // SingleTypeImportDeclarationName ::= 'import' Name RejectTypeAnnotations
  /* push an ImportRef build from the last name
  stored in the identifier stack. */

  ImportReference impt;
  int length;
  char[][] tokens = new char[length = this.identifierLengthStack[this.identifierLengthPtr--]][];
  this.identifierPtr -= length;
  long[] positions = new long[length];
  System.arraycopy(this.identifierStack, this.identifierPtr + 1, tokens, 0, length);
  System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, length);
  pushOnAstStack(impt = new ImportReference(tokens, positions, false, ClassFileConstants.AccStatic));

  this.modifiers = ClassFileConstants.AccDefault;
  this.modifiersSourceStart = -1; // <-- see comment into modifiersFlag(int)

  if (this.currentToken == TokenNameSEMICOLON){
View Full Code Here

protected void consumeSingleTypeImportDeclarationName() {
  // SingleTypeImportDeclarationName ::= 'import' Name
  /* push an ImportRef build from the last name
  stored in the identifier stack. */

  ImportReference impt;
  int length;
  char[][] tokens = new char[length = this.identifierLengthStack[this.identifierLengthPtr--]][];
  this.identifierPtr -= length;
  long[] positions = new long[length];
  System.arraycopy(this.identifierStack, this.identifierPtr + 1, tokens, 0, length);
  System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, length);
  pushOnAstStack(impt = new ImportReference(tokens, positions, false, ClassFileConstants.AccDefault));

  if (this.currentToken == TokenNameSEMICOLON){
    impt.declarationSourceEnd = this.scanner.currentPosition - 1;
  } else {
    impt.declarationSourceEnd = impt.sourceEnd;
View Full Code Here

protected void consumeStaticImportOnDemandDeclarationName() {
  // StaticImportOnDemandDeclarationName ::= 'import' 'static' Name '.' RejectTypeAnnotations '*'
  /* push an ImportRef build from the last name
  stored in the identifier stack. */

  ImportReference impt;
  int length;
  char[][] tokens = new char[length = this.identifierLengthStack[this.identifierLengthPtr--]][];
  this.identifierPtr -= length;
  long[] positions = new long[length];
  System.arraycopy(this.identifierStack, this.identifierPtr + 1, tokens, 0, length);
  System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, length);
  pushOnAstStack(impt = new ImportReference(tokens, positions, true, ClassFileConstants.AccStatic));

  // star end position
  impt.trailingStarPosition = this.intStack[this.intPtr--];
  this.modifiers = ClassFileConstants.AccDefault;
  this.modifiersSourceStart = -1; // <-- see comment into modifiersFlag(int)
View Full Code Here

protected void consumeTypeImportOnDemandDeclarationName() {
  // TypeImportOnDemandDeclarationName ::= 'import' Name '.' RejectTypeAnnotations '*'
  /* push an ImportRef build from the last name
  stored in the identifier stack. */

  ImportReference impt;
  int length;
  char[][] tokens = new char[length = this.identifierLengthStack[this.identifierLengthPtr--]][];
  this.identifierPtr -= length;
  long[] positions = new long[length];
  System.arraycopy(this.identifierStack, this.identifierPtr + 1, tokens, 0, length);
  System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, length);
  pushOnAstStack(impt = new ImportReference(tokens, positions, true, ClassFileConstants.AccDefault));

  // star end position
  impt.trailingStarPosition = this.intStack[this.intPtr--];
  if (this.currentToken == TokenNameSEMICOLON){
    impt.declarationSourceEnd = this.scanner.currentPosition - 1;
View Full Code Here

    positions,
    0,
    length);

  /* build specific assist node on import statement */
  ImportReference reference = createAssistImportReference(subset, positions, ClassFileConstants.AccStatic);
  reference.bits |= ASTNode.OnDemand;
  // star end position
  reference.trailingStarPosition = this.intStack[this.intPtr--];
  this.assistNode = reference;
  this.lastCheckPoint = reference.sourceEnd + 1;
View Full Code Here

    positions,
    0,
    length);

  /* build specific assist node on import statement */
  ImportReference reference = createAssistImportReference(subset, positions, ClassFileConstants.AccDefault);
  reference.bits |= ASTNode.OnDemand;
  // star end position
  reference.trailingStarPosition = this.intStack[this.intPtr--];
  this.assistNode = reference;
  this.lastCheckPoint = reference.sourceEnd + 1;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.ImportReference

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.