当前位置: 首页>>代码示例>>Java>>正文


Java PsiBuilder.eof方法代码示例

本文整理汇总了Java中com.intellij.lang.PsiBuilder.eof方法的典型用法代码示例。如果您正苦于以下问题:Java PsiBuilder.eof方法的具体用法?Java PsiBuilder.eof怎么用?Java PsiBuilder.eof使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.lang.PsiBuilder的用法示例。


在下文中一共展示了PsiBuilder.eof方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseApplicationHandlerDefinitionSignature

import com.intellij.lang.PsiBuilder; //导入方法依赖的package包/类
public static boolean parseApplicationHandlerDefinitionSignature(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseApplicationHandlerDefinitionSignature")) return false;
  boolean r;
  //application handled definition in script only makes sense inside <using terms of> statement
  if (b.getUserData(IS_PARSING_USING_TERMS_FROM_STATEMENT) != Boolean.TRUE || b.getUserData(PARSING_TELL_COMPOUND_STATEMENT) == Boolean.TRUE) return false;

  StringHolder parsedCommandName = new StringHolder();
  String toldApplicationName = getTargetApplicationName(b);
  PsiBuilder.Marker m2 = enter_section_(b, l, _COLLAPSE_, "<parse Application Handler Definition");
  r = parseDictionaryCommandNameInner(b, l + 1, parsedCommandName, toldApplicationName, true, null);
  exit_section_(b, l, m2, DICTIONARY_COMMAND_NAME, r, false, null);

  if (!r) return false;
  // TODO: 06/12/15 may be try to avoid creating PSI here!..
  List<AppleScriptCommand> allCommandsWithName = getAllCommandsWithName(b, parsedCommandName.value, toldApplicationName, false, null);

  for (AppleScriptCommand command : allCommandsWithName) {
    r = parseParametersForCommand(b, l + 1, command);//custom parsing here
    if (r) {
      break;
    }
  }
  boolean incompleteHandlerCall = !r && allCommandsWithName.size() > 0 && (b.getTokenType() == NLS || b.eof());
  return r || incompleteHandlerCall;

}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:27,代码来源:AppleScriptGeneratedParserUtil.java

示例2: parseCommandParameterSelector

import com.intellij.lang.PsiBuilder; //导入方法依赖的package包/类
private static boolean parseCommandParameterSelector(PsiBuilder b, int l, AppleScriptCommand command,
                                                     StringHolder parsedParameterSelector) {
  if (!recursion_guard_(b, l, "parseCommandParameterSelector")) return false;
  boolean r = false;
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Command Parameter Selector>");//todo check this _AND_
  parsedParameterSelector.value = b.getTokenText() == null ? "" : b.getTokenText();
  while (!b.eof() && b.getTokenType() != NLS && b.getTokenType() != COMMENT) {
    b.advanceLexer();
    if (command.getParameterByName(parsedParameterSelector.value) != null) {
      r = true;
      break;
    }
    parsedParameterSelector.value += " " + b.getTokenText();
  }
  exit_section_(b, l, m, COMMAND_PARAMETER_SELECTOR, r, false, null);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:18,代码来源:AppleScriptGeneratedParserUtil.java

示例3: parseCommandHandlerCallExpression

import com.intellij.lang.PsiBuilder; //导入方法依赖的package包/类
/**
 * <<< COMMAND_HANDLER_CALL >>>
 */
// commandName commandParameters?
public static boolean parseCommandHandlerCallExpression(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseCommandHandlerCallExpression")) return false;
  boolean r;

  if (nextTokenIs(b, NLS)) return false;
  final String s = b.getTokenText();

  if (s == null || s.length() == 0 || !AppleScriptNames.isIdentifierStart(s.charAt(0))) return false;
  StringHolder parsedCommandName = new StringHolder();
  //get current application name to which messages will be sent in the current block
  String toldApplicationName = getTargetApplicationName(b);
  //if there are <use statements> present in the script
  boolean areThereUseStatements = b.getUserData(WAS_USE_STATEMENT_USED) == Boolean.TRUE;
  Set<String> applicationsToImport = null;
  if (areThereUseStatements) {
    //adding list of application names from use statements
    applicationsToImport = b.getUserData(USED_APPLICATION_NAMES);
  }
  PsiBuilder.Marker m2 = enter_section_(b, l, _COLLAPSE_, "<parse Command Handler Call Expression>");
  // TODO: 19/12/15 need to parse command name together with parameters for each possible application in order to be
  // able to parse the longest possible application name ('open for access' std lib vs 'open' from application dict)
  r = parseDictionaryCommandNameInner(b, l + 1, parsedCommandName, toldApplicationName, areThereUseStatements, applicationsToImport);
  exit_section_(b, l, m2, DICTIONARY_COMMAND_NAME, r, false, null);

  if (!r) return false;
  // TODO: 06/12/15 may be try to avoid creating PSI here!..
  List<AppleScriptCommand> allCommandsWithName = getAllCommandsWithName(b, parsedCommandName.value, toldApplicationName, areThereUseStatements,
          applicationsToImport);

  for (AppleScriptCommand command : allCommandsWithName) {
    r = parseParametersForCommand(b, l + 1, command);
    if (r) {
      break;
    }
  }
  boolean incompleteHandlerCall = !r && allCommandsWithName.size() > 0 && (b.getTokenType() == NLS || b.eof());
  return r || incompleteHandlerCall;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:43,代码来源:AppleScriptGeneratedParserUtil.java


注:本文中的com.intellij.lang.PsiBuilder.eof方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。