本文整理匯總了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;
}