當前位置: 首頁>>代碼示例>>Java>>正文


Java PsiBuilder.putUserData方法代碼示例

本文整理匯總了Java中com.intellij.lang.PsiBuilder.putUserData方法的典型用法代碼示例。如果您正苦於以下問題:Java PsiBuilder.putUserData方法的具體用法?Java PsiBuilder.putUserData怎麽用?Java PsiBuilder.putUserData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.lang.PsiBuilder的用法示例。


在下文中一共展示了PsiBuilder.putUserData方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseParametersForCommand

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
/**
 * @param b                       {@link PsiBuilder}
 * @param l                       level deep
 * @param parsedCommandDefinition command for which pars the parameters
 * @return true if rule matches, false otherwise
 */
private static boolean parseParametersForCommand(PsiBuilder b, int l,
                                                 @NotNull final AppleScriptCommand parsedCommandDefinition) {
  if (!recursion_guard_(b, l, "parseParametersForCommand")) return false;
  boolean r = true;
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse command handler call parameters>");
  b.putUserData(PARSING_COMMAND_HANDLER_CALL_PARAMETERS, true);
  if (parsedCommandDefinition.getDirectParameter() != null) {
    consumeToken(b, OF); //not mandatory
    r = parseCommandDirectParameterValue(b, l + 1, parsedCommandDefinition.getDirectParameter());
  }
  if (!parsedCommandDefinition.getParameters().isEmpty()) {
    r = parseCommandParameters(b, l + 1, parsedCommandDefinition);
  }
  exit_section_(b, l, m, null, r, false, null);
  b.putUserData(PARSING_COMMAND_HANDLER_CALL_PARAMETERS, false);
  return true;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:24,代碼來源:AppleScriptGeneratedParserUtil.java

示例2: parseTellCompoundStatement

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
/**
 * If rule matches, removes added application name from the name stack which was used for parsing application terms
 *
 * @param b {@link PsiBuilder}
 * @param l level deep
 * @return true if rule matches
 */
public static boolean parseTellCompoundStatement(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseTellCompoundStatement")) return false;
  if (!nextTokenIs(b, TELL)) return false;
  boolean r;
  boolean pushStateBefore = b.getUserData(APPLICATION_NAME_PUSHED) == Boolean.TRUE;
  boolean compoundStateBefore = b.getUserData(PARSING_TELL_COMPOUND_STATEMENT) == Boolean.TRUE;
  b.putUserData(APPLICATION_NAME_PUSHED, false);
  b.putUserData(PARSING_TELL_COMPOUND_STATEMENT, true);

  r = AppleScriptParser.tellCompoundStatement(b, l + 1);

  b.putUserData(PARSING_TELL_COMPOUND_STATEMENT, compoundStateBefore);
  popApplicationNameIfWasPushed(b);
  b.putUserData(APPLICATION_NAME_PUSHED, pushStateBefore);
  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:24,代碼來源:AppleScriptGeneratedParserUtil.java

示例3: parseUsingTermsFromStatement

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
/**
 * If rule matches, removes added application name from the name stack which was used for parsing application terms
 *
 * @param b {@link PsiBuilder}
 * @param l level deep
 * @return true if rule matches
 */
public static boolean parseUsingTermsFromStatement(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseUsingTermsFromStatement")) return false;
  boolean r;
  boolean oldParseUsingTermsState = b.getUserData(IS_PARSING_USING_TERMS_FROM_STATEMENT) == Boolean.TRUE;
  boolean oldPushedState = b.getUserData(APPLICATION_NAME_PUSHED) == Boolean.TRUE;
  b.putUserData(IS_PARSING_USING_TERMS_FROM_STATEMENT, true);
  b.putUserData(APPLICATION_NAME_PUSHED, false);

  r = AppleScriptParser.usingTermsFromStatement(b, l + 1);

  popApplicationNameIfWasPushed(b);
  b.putUserData(IS_PARSING_USING_TERMS_FROM_STATEMENT, oldParseUsingTermsState);
  b.putUserData(APPLICATION_NAME_PUSHED, oldPushedState);

  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:24,代碼來源:AppleScriptGeneratedParserUtil.java

示例4: parseAssignmentStatementInner

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
public static boolean parseAssignmentStatementInner(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseAssignmentStatementInner")) return false;
  boolean r;
  b.putUserData(PARSING_COMMAND_ASSIGNMENT_STATEMENT, true);
  r = AppleScriptParser.assignmentStatement(b, l + 1);
  b.putUserData(PARSING_COMMAND_ASSIGNMENT_STATEMENT, false);
  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:9,代碼來源:AppleScriptGeneratedParserUtil.java

示例5: parseLiteralExpression

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
public static boolean parseLiteralExpression(PsiBuilder b, int l, Parser literalExpression) {
  if (!recursion_guard_(b, l, "parseLiteralExpression")) return false;
  boolean r;
  b.putUserData(PARSING_LITERAL_EXPRESSION, true);
  r = literalExpression.parse(b, l + 1);
  b.putUserData(PARSING_LITERAL_EXPRESSION, false);
  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:9,代碼來源:AppleScriptGeneratedParserUtil.java

示例6: parseTellSimpleStatementInner

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
public static boolean parseTellSimpleStatementInner(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "tellSimpleStatement")) return false;
  if (!nextTokenIs(b, TELL)) return false;
  boolean r;
  boolean pushStateBefore = b.getUserData(APPLICATION_NAME_PUSHED) == Boolean.TRUE;
  b.putUserData(APPLICATION_NAME_PUSHED, false);
  b.putUserData(PARSING_TELL_SIMPLE_STATEMENT, true);
  r = AppleScriptParser.tellSimpleStatement(b, l + 1);
  b.putUserData(PARSING_TELL_SIMPLE_STATEMENT, false);
  popApplicationNameIfWasPushed(b);
  b.putUserData(APPLICATION_NAME_PUSHED, pushStateBefore);
  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:14,代碼來源:AppleScriptGeneratedParserUtil.java

示例7: parseTellSimpleObjectReference

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
/**
 * For custom parsing, so not to detect 'referenceIdentifier to ...' as labeled handler call
 */
public static boolean parseTellSimpleObjectReference(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseTellSimpleObjectReference")) return false;
  boolean r;
  r = nextTokenIsFast(b, LPAREN) && AppleScriptParser.parenthesizedExpression(b, l + 1);
  if (!r) {
    b.putUserData(PARSING_TELL_SIMPLE_OBJECT_REF, true);
    r = AppleScriptParser.expression(b, l + 1);
    b.putUserData(PARSING_TELL_SIMPLE_OBJECT_REF, false);
  }
  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:15,代碼來源:AppleScriptGeneratedParserUtil.java

示例8: parseUsedApplicationNameExternal

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
/**
 * Add application name from this &lt;use statement&gt; to the set of application names from dictionary of which to
 * import terms if importing condition is not explicitly prohibited by syntax
 *
 * @param b           {@link PsiBuilder}
 * @param l           level deep
 * @param isImporting whether to make terms from this application's dictionary available in the script
 * @return true if this is application reference
 */
public static boolean parseUsedApplicationNameExternal(PsiBuilder b, int l, Parser isImporting) {
  if (!recursion_guard_(b, l, "parseUsedApplicationNameExternal")) return false;
  boolean r;
  if (!nextTokenIs(b, "parseUsedApplicationNameExternal", APPLICATION, APP, SCRIPTING_ADDITIONS)) return false;
  String appName = null;
  r = consumeToken(b, SCRIPTING_ADDITIONS);
  if (r) {
    appName = ApplicationDictionary.SCRIPTING_ADDITIONS_LIBRARY;
  } else {
    PsiBuilder.Marker mAppRef = enter_section_(b, l, _NONE_, "<application reference>");
    PsiBuilder.Marker mCls = enter_section_(b, l, _NONE_, "<dictionary class name>");
    r = consumeToken(b, APPLICATION);
    if (!r) r = consumeToken(b, APP);
    exit_section_(b, l, mCls, DICTIONARY_CLASS_NAME, r, false, null);
    if (r) {
      String appNameStr = b.getTokenText();
      r = consumeToken(b, STRING_LITERAL);
      if (r && !StringUtil.isEmpty(appNameStr)) {
        appName = appNameStr.replace("\"", "");
      }
    }
    exit_section_(b, l, mAppRef, APPLICATION_REFERENCE, r, false, null);
  }
  boolean doTermsImport = isImporting.parse(b, l + 1);
  if (doTermsImport && !StringUtil.isEmpty(appName)) {
    Set<String> usedAppNames = b.getUserData(USED_APPLICATION_NAMES);
    if (usedAppNames == null) {
      usedAppNames = new HashSet<>();
      b.putUserData(USED_APPLICATION_NAMES, usedAppNames);
    }
    usedAppNames.add(appName);
  }
  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:44,代碼來源:AppleScriptGeneratedParserUtil.java

示例9: parseUseStatement

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
/**
 * If there is at least one &lt;use statement&gt; in script, set WAS_USE_STATEMENT_USED flag to true
 */
public static boolean parseUseStatement(PsiBuilder b, int l, Parser useStatement) {
  if (!recursion_guard_(b, l, "parseUseStatement")) return false;
  boolean r = useStatement.parse(b, l + 1);
  boolean prevPass = b.getUserData(WAS_USE_STATEMENT_USED) == Boolean.TRUE;
  b.putUserData(WAS_USE_STATEMENT_USED, r || prevPass);
  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:11,代碼來源:AppleScriptGeneratedParserUtil.java

示例10: pushTargetApplicationName

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
private static Stack<String> pushTargetApplicationName(PsiBuilder b, @NotNull String applicationNameString) {
  Stack<String> dictionaryNameStack = b.getUserData(TOLD_APPLICATION_NAME_STACK);
  if (dictionaryNameStack == null) {
    dictionaryNameStack = new Stack<>();
    b.putUserData(TOLD_APPLICATION_NAME_STACK, dictionaryNameStack);
  }
  dictionaryNameStack.push(applicationNameString);
  b.putUserData(APPLICATION_NAME_PUSHED, true);
  return dictionaryNameStack;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:11,代碼來源:AppleScriptGeneratedParserUtil.java

示例11: parseBooleanParameter

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
private static boolean parseBooleanParameter(PsiBuilder b, int l, AppleScriptCommand command, StringHolder
        parsedParameterSelector) {
  if (!recursion_guard_(b, l, "parseBooleanParameter")) return false;
  boolean r;
  //need to rollback with/without if there is no match
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Boolean Parameter>");
  b.putUserData(PARSING_COMMAND_HANDLER_BOOLEAN_PARAMETER, true);
  r = consumeToken(b, WITH);
  if (!r) r = consumeToken(b, WITHOUT);
  if (!r) r = consumeToken(b, LAND); //for cases like: '...with regexp and all occurrences without case sensitive'
  r = r && parseCommandParameterSelector(b, l + 1, command, parsedParameterSelector);
  exit_section_(b, l, m, null, r, false, null);
  b.putUserData(PARSING_COMMAND_HANDLER_BOOLEAN_PARAMETER, false);
  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:16,代碼來源:AppleScriptGeneratedParserUtil.java

示例12: parseCommandParametersExpression

import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
public static boolean parseCommandParametersExpression(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseCommandParametersExpression")) return false;
  boolean r;
  b.putUserData(PARSING_COMMAND_HANDLER_CALL_PARAMETERS, true);
  r = AppleScriptParser.expression(b, l + 1);
  b.putUserData(PARSING_COMMAND_HANDLER_CALL_PARAMETERS, false);
  return r;
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:9,代碼來源:AppleScriptGeneratedParserUtil.java


注:本文中的com.intellij.lang.PsiBuilder.putUserData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。