Пример #1
0
 /**
  * Die Methode führt die Kontextanalyse für diesen Ausdruck durch. Dabei wird ein Zugriff über
  * SELF in den Syntaxbaum eingefügt, wenn dieser Ausdruck ein Attribut oder eine Methode
  * bezeichnet. Diese Methode wird niemals für Ausdrücke aufgerufen, die rechts vom
  * Objekt-Zugriffsoperator stehen.
  *
  * @param declarations Die an dieser Stelle gültigen Deklarationen.
  * @return Dieser Ausdruck oder ein neuer Ausdruck, falls ein Boxing oder der Zugriff über SELF
  *     eingefügt wurde.
  * @throws CompileException Während der Kontextanylyse wurde ein Fehler gefunden.
  */
 Expression contextAnalysis(Declarations declarations) throws CompileException {
   contextAnalysisForMember(declarations);
   if (identifier.declaration instanceof MethodDeclaration
       || identifier.declaration instanceof VarDeclaration
           && ((VarDeclaration) identifier.declaration).isAttribute) {
     AccessExpression a =
         new AccessExpression(new VarOrCall(new ResolvableIdentifier("_self", position)), this);
     a.leftOperand = a.leftOperand.contextAnalysis(declarations);
     a.leftOperand = a.leftOperand.box(declarations);
     a.type = type;
     a.lValue = lValue;
     /** BEGIN Ausgabe (f): Methoden Parameter */
     contextAnalysisForParameters(declarations);
     /** END Aufgabe (f) */
     return a;
   } else {
     return this;
   }
 }