Beispiel #1
0
  protected void consumeMethodInvocationName() {
    // MethodInvocation ::= Name '(' ArgumentListopt ')'

    if (this.scanner.startPosition >= this.codeSnippetStart
        && this.scanner.startPosition <= this.codeSnippetEnd + 1 + this.lineSeparatorLength // 14838
        && isTopLevelType()) {

      // when the name is only an identifier...we have a message send to "this" (implicit)

      MessageSend m = newMessageSend();
      m.sourceEnd = this.rParenPos;
      m.sourceStart =
          (int) ((m.nameSourcePosition = this.identifierPositionStack[this.identifierPtr]) >>> 32);
      m.selector = this.identifierStack[this.identifierPtr--];
      if (this.identifierLengthStack[this.identifierLengthPtr] == 1) {
        m.receiver = new CodeSnippetThisReference(0, 0, this.evaluationContext, true);
        this.identifierLengthPtr--;
      } else {
        this.identifierLengthStack[this.identifierLengthPtr]--;
        m.receiver = getUnspecifiedReference();
        m.sourceStart = m.receiver.sourceStart;
      }
      pushOnExpressionStack(m);
    } else {
      super.consumeMethodInvocationName();
    }
  }
Beispiel #2
0
  protected void consumeMethodInvocationSuper() {
    // MethodInvocation ::= 'super' '.' 'Identifier' '(' ArgumentListopt ')'

    MessageSend m = newMessageSend();
    m.sourceStart = this.intStack[this.intPtr--];
    m.sourceEnd = this.rParenPos;
    m.nameSourcePosition = this.identifierPositionStack[this.identifierPtr];
    m.selector = this.identifierStack[this.identifierPtr--];
    this.identifierLengthPtr--;
    m.receiver =
        new CodeSnippetSuperReference(m.sourceStart, this.endPosition, this.evaluationContext);
    pushOnExpressionStack(m);
  }