本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例8: parseUsedApplicationNameExternal
import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
/**
* Add application name from this <use statement> 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;
}
示例9: parseUseStatement
import com.intellij.lang.PsiBuilder; //導入方法依賴的package包/類
/**
* If there is at least one <use statement> 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;
}
示例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;
}
示例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;
}
示例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;
}