本文整理汇总了Java中com.intellij.psi.impl.source.CharTableImpl类的典型用法代码示例。如果您正苦于以下问题:Java CharTableImpl类的具体用法?Java CharTableImpl怎么用?Java CharTableImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CharTableImpl类属于com.intellij.psi.impl.source包,在下文中一共展示了CharTableImpl类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createAST
import com.intellij.psi.impl.source.CharTableImpl; //导入依赖的package包/类
private ASTNode createAST(String text) {
ParserDefinition definition = new BuildParserDefinition();
PsiParser parser = definition.createParser(getProject());
Lexer lexer = definition.createLexer(getProject());
PsiBuilderImpl psiBuilder =
new PsiBuilderImpl(
getProject(), null, definition, lexer, new CharTableImpl(), text, null, null);
PsiBuilderAdapter adapter =
new PsiBuilderAdapter(psiBuilder) {
@Override
public void error(String messageText) {
super.error(messageText);
errors.add(messageText);
}
};
return parser.parse(definition.getFileNodeType(), adapter);
}
开发者ID:bazelbuild,项目名称:intellij,代码行数:18,代码来源:BuildParserTest.java
示例2: createRootAST
import com.intellij.psi.impl.source.CharTableImpl; //导入依赖的package包/类
@NotNull
private ASTNode createRootAST(@NotNull StartMarker rootMarker) {
final IElementType type = rootMarker.getTokenType();
@SuppressWarnings("NullableProblems")
final ASTNode rootNode = type instanceof ILazyParseableElementType ?
ASTFactory.lazy((ILazyParseableElementType)type, null) : createComposite(rootMarker);
if (myCharTable == null) {
myCharTable = rootNode instanceof FileElement ? ((FileElement)rootNode).getCharTable() : new CharTableImpl();
}
if (!(rootNode instanceof FileElement)) {
rootNode.putUserData(CharTable.CHAR_TABLE_KEY, myCharTable);
}
return rootNode;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PsiBuilderImpl.java
示例3: parseText
import com.intellij.psi.impl.source.CharTableImpl; //导入依赖的package包/类
public static @NotNull <T extends PsiElement> T parseText(
@NotNull String text,
@NotNull IElementType rootElementType,
@NotNull Class<T> rootElementClass,
@NotNull ParserDefinition parserDefinition,
@Nullable ErrorProcessor errorProcessor) {
LanguageParserDefinitions.INSTANCE.addExplicitExtension(
parserDefinition.getFileNodeType().getLanguage(),
parserDefinition
);
PsiParser parser = parserDefinition.createParser(model.first);
Lexer lexer = parserDefinition.createLexer(model.first);
PsiBuilderImpl psiBuilder = new PsiBuilderImpl(
model.first,
null,
parserDefinition,
lexer,
new CharTableImpl(),
text,
null,
null
);
ASTNode astNode = parser.parse(rootElementType, psiBuilder);
T res = astNode.getPsi(rootElementClass);
collectErrors(res, errorProcessor);
return res;
}
开发者ID:SumoLogic,项目名称:epigraph,代码行数:32,代码来源:EpigraphPsiUtil.java
示例4: createRootAST
import com.intellij.psi.impl.source.CharTableImpl; //导入依赖的package包/类
private ASTNode createRootAST(final StartMarker rootMarker) {
final IElementType type = rootMarker.getTokenType();
@SuppressWarnings("NullableProblems")
final ASTNode rootNode = type instanceof ILazyParseableElementType ?
ASTFactory.lazy((ILazyParseableElementType)type, null) : createComposite(rootMarker);
if (myCharTable == null) {
myCharTable = rootNode instanceof FileElement ? ((FileElement)rootNode).getCharTable() : new CharTableImpl();
}
if (!(rootNode instanceof FileElement)) {
rootNode.putUserData(CharTable.CHAR_TABLE_KEY, myCharTable);
}
return rootNode;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:PsiBuilderImpl.java
示例5: createRootAST
import com.intellij.psi.impl.source.CharTableImpl; //导入依赖的package包/类
@Nonnull
private TreeElement createRootAST(@Nonnull StartMarker rootMarker) {
final IElementType type = rootMarker.getTokenType();
@SuppressWarnings("NullableProblems") final TreeElement rootNode =
type instanceof ILazyParseableElementType ? ASTFactory.lazy((ILazyParseableElementType)type, null) : createComposite(rootMarker);
if (myCharTable == null) {
myCharTable = rootNode instanceof FileElement ? ((FileElement)rootNode).getCharTable() : new CharTableImpl();
}
if (!(rootNode instanceof FileElement)) {
rootNode.putUserData(CharTable.CHAR_TABLE_KEY, myCharTable);
}
return rootNode;
}
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:PsiBuilderImpl.java
示例6: PsiAnnotationStubImpl
import com.intellij.psi.impl.source.CharTableImpl; //导入依赖的package包/类
public PsiAnnotationStubImpl(final StubElement parent, final String text) {
super(parent, JavaStubElementTypes.ANNOTATION);
CharSequence interned = CharTableImpl.getStaticInterned(text);
myText = interned == null ? text : interned.toString();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:PsiAnnotationStubImpl.java
注:本文中的com.intellij.psi.impl.source.CharTableImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论