Java Code Examples for com.intellij.lang.PsiBuilder#getTokenText()

The following examples show how to use com.intellij.lang.PsiBuilder#getTokenText() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: intellij-latte   File: LatteParserUtil.java    License: MIT License 6 votes vote down vote up
@NotNull
private static String getHtmlTagName(PsiBuilder builder) {
	String macroName = "?";

	consumeTokenFast(builder, T_HTML_OPEN_TAG_OPEN);
	if (nextTokenIsFast(builder, T_TEXT)) {
		macroName = builder.getTokenText();
		if (macroName != null && macroName.length() > 0) {
			macroName = macroName.split(" ")[0];

		} else {
			macroName = "?";
		}
	}
	return macroName;
}
 
Example 2
Source Project: arma-intellij-plugin   File: SQFParserUtil.java    License: MIT License 5 votes vote down vote up
private static boolean command_rule(PsiBuilder b, int l, @NotNull String commandName, IElementType exitType) {
	if (!recursion_guard_(b, l, "command")) return false;

	if (!nextTokenIs(b, COMMAND_TOKEN)) {
		return false;
	}
	if (b.getTokenText() == null || !b.getTokenText().equalsIgnoreCase(commandName)) {
		return false;
	}
	boolean r;
	PsiBuilder.Marker m = enter_section_(b);
	r = consumeToken(b, COMMAND_TOKEN);
	exit_section_(b, m, exitType, r);
	return r;
}
 
Example 3
Source Project: arma-intellij-plugin   File: SQFParserUtil.java    License: MIT License 5 votes vote down vote up
private static boolean command_rule(PsiBuilder b, int l, @NotNull String commandName, IElementType exitType) {
	if (!recursion_guard_(b, l, "command")) return false;

	if (!nextTokenIs(b, COMMAND_TOKEN)) {
		return false;
	}
	if (b.getTokenText() == null || !b.getTokenText().equalsIgnoreCase(commandName)) {
		return false;
	}
	boolean r;
	PsiBuilder.Marker m = enter_section_(b);
	r = consumeToken(b, COMMAND_TOKEN);
	exit_section_(b, m, exitType, r);
	return r;
}