本文整理汇总了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;
}
示例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;
}
示例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;
}