Пример #1
0
  /*
   * operation? prefixExpression
   */
  private void parsePrefixExpression() {
    //        System.out.println("pre at "  + myBuilder.getTokenText());

    if (at(LBRACKET)) {
      if (!parseLocalDeclaration()) {
        PsiBuilder.Marker expression = mark();
        myJetParsing.parseAnnotations(REGULAR_ANNOTATIONS_ONLY_WITH_BRACKETS);
        parsePrefixExpression();
        expression.done(ANNOTATED_EXPRESSION);
      }
    } else {
      myBuilder.disableJoiningComplexTokens();
      if (at(LABEL_IDENTIFIER)) {
        myBuilder.restoreJoiningComplexTokensState();
        parseLabeledExpression();
      } else if (atSet(Precedence.PREFIX.getOperations())) {
        PsiBuilder.Marker expression = mark();

        parseOperationReference();

        myBuilder.restoreJoiningComplexTokensState();

        parsePrefixExpression();
        expression.done(PREFIX_EXPRESSION);
      } else {
        myBuilder.restoreJoiningComplexTokensState();
        parsePostfixExpression();
      }
    }
  }
Пример #2
0
  /*
   * operation? prefixExpression
   */
  private void parsePrefixExpression() {
    //        System.out.println("pre at "  + myBuilder.getTokenText());

    if (at(AT)) {
      if (!parseLocalDeclaration()) {
        PsiBuilder.Marker expression = mark();
        myJetParsing.parseAnnotations(DEFAULT);
        parsePrefixExpression();
        expression.done(ANNOTATED_EXPRESSION);
      }
    } else {
      myBuilder.disableJoiningComplexTokens();
      if (isAtLabelDefinitionOrMissingIdentifier()) {
        myBuilder.restoreJoiningComplexTokensState();
        parseLabeledExpression();
      } else if (atSet(Precedence.PREFIX.getOperations())) {
        PsiBuilder.Marker expression = mark();

        parseOperationReference();

        myBuilder.restoreJoiningComplexTokensState();

        parsePrefixExpression();
        expression.done(PREFIX_EXPRESSION);
      } else {
        myBuilder.restoreJoiningComplexTokensState();
        parsePostfixExpression();
      }
    }
  }