当前位置: 首页>>代码示例>>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;未经允许,请勿转载。