本文整理汇总了Java中com.intellij.lexer.MergingLexerAdapter类的典型用法代码示例。如果您正苦于以下问题:Java MergingLexerAdapter类的具体用法?Java MergingLexerAdapter怎么用?Java MergingLexerAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MergingLexerAdapter类属于com.intellij.lexer包,在下文中一共展示了MergingLexerAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createPlainTextLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public static Lexer createPlainTextLexer() {
ArrayList<TokenParser> tokenParsers = new ArrayList<TokenParser>();
tokenParsers.add(new WhitespaceParser());
tokenParsers.addAll(BraceTokenParser.getBraces());
tokenParsers.addAll(BraceTokenParser.getParens());
tokenParsers.addAll(BraceTokenParser.getBrackets());
tokenParsers.addAll(BraceTokenParser.getAngleBrackets());
return new MergingLexerAdapter(new AbstractCustomLexer(tokenParsers), TokenSet.create(CustomHighlighterTokenType.CHARACTER));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PlainTextSyntaxHighlighterFactory.java
示例2: TemplateHighlighter
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public TemplateHighlighter() {
myLexer = new MergingLexerAdapter(new TemplateTextLexer(), TokenSet.create(TemplateTokenType.TEXT));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:TemplateEditorUtil.java
示例3: parseContents
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
@Override
public ASTNode parseContents(ASTNode chameleon) {
final CharTable table = SharedImplUtil.findCharTableByTree(chameleon);
final FileElement treeElement = new DummyHolder(((TreeElement)chameleon).getManager(), null, table).getTreeElement();
final FileElement fileElement = TreeUtil.getFileElement((TreeElement)chameleon);
final PsiFile file = (PsiFile)fileElement.getPsi();
PsiFile originalFile = file.getOriginalFile();
final TemplateLanguageFileViewProvider viewProvider = (TemplateLanguageFileViewProvider)originalFile.getViewProvider();
final Language language = getTemplateFileLanguage(viewProvider);
final CharSequence chars = chameleon.getChars();
final PsiFile templateFile = createTemplateFile(file, language, chars, viewProvider);
final FileElement parsed = ((PsiFileImpl)templateFile).calcTreeElement();
DebugUtil.startPsiModification("template language parsing");
try {
prepareParsedTemplateFile(parsed);
Lexer langLexer = LanguageParserDefinitions.INSTANCE.forLanguage(language).createLexer(file.getProject());
final Lexer lexer = new MergingLexerAdapter(
new TemplateBlackAndWhiteLexer(createBaseLexer(viewProvider), langLexer, myTemplateElementType, myOuterElementType),
TokenSet.create(myTemplateElementType, myOuterElementType));
lexer.start(chars);
insertOuters(parsed, lexer, table);
if (parsed != null) {
final TreeElement element = parsed.getFirstChildNode();
if (element != null) {
parsed.rawRemoveAllChildren();
treeElement.rawAddChildren(element);
}
}
}
finally {
DebugUtil.finishPsiModification();
}
treeElement.subtreeChanged();
TreeElement childNode = treeElement.getFirstChildNode();
DebugUtil.checkTreeStructure(parsed);
DebugUtil.checkTreeStructure(treeElement);
DebugUtil.checkTreeStructure(chameleon);
if (fileElement != chameleon) {
DebugUtil.checkTreeStructure(file.getNode());
DebugUtil.checkTreeStructure(originalFile.getNode());
}
return childNode;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:53,代码来源:TemplateDataElementType.java
示例4: TemplateHighlighter
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public TemplateHighlighter() {
myLexer = new MergingLexerAdapter(new FlexAdapter(new FileTemplateTextLexer()), TokenSet.create(FileTemplateTokenType.TEXT));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FileTemplateConfigurable.java
示例5: GroovyLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public GroovyLexer() {
super(new MergingLexerAdapter(new FlexAdapter(new _GroovyLexer((Reader) null)), tokensToMerge));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:GroovyLexer.java
示例6: parseContents
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
@Override
public ASTNode parseContents(ASTNode chameleon) {
final CharTable table = SharedImplUtil.findCharTableByTree(chameleon);
final FileElement treeElement = new DummyHolder(((TreeElement)chameleon).getManager(), null, table).getTreeElement();
final PsiFile file = (PsiFile)TreeUtil.getFileElement((TreeElement)chameleon).getPsi();
PsiFile originalFile = file.getOriginalFile();
final TemplateLanguageFileViewProvider viewProvider = (TemplateLanguageFileViewProvider)originalFile.getViewProvider();
final Language language = getTemplateFileLanguage(viewProvider);
final CharSequence chars = chameleon.getChars();
final PsiFile templateFile = createTemplateFile(file, language, chars, viewProvider);
final FileElement parsed = ((PsiFileImpl)templateFile).calcTreeElement();
prepareParsedTemplateFile(parsed);
Lexer langLexer = LanguageParserDefinitions.INSTANCE.forLanguage(language).createLexer(file.getProject());
final Lexer lexer = new MergingLexerAdapter(
new TemplateBlackAndWhiteLexer(createBaseLexer(viewProvider), langLexer, myTemplateElementType, myOuterElementType),
TokenSet.create(myTemplateElementType, myOuterElementType));
lexer.start(chars);
insertOuters(parsed, lexer, table);
if (parsed != null) {
final TreeElement element = parsed.getFirstChildNode();
if (element != null) {
parsed.rawRemoveAllChildren();
treeElement.rawAddChildren(element);
}
}
treeElement.subtreeChanged();
TreeElement childNode = treeElement.getFirstChildNode();
DebugUtil.checkTreeStructure(parsed);
DebugUtil.checkTreeStructure(treeElement);
DebugUtil.checkTreeStructure(chameleon);
DebugUtil.checkTreeStructure(file.getNode());
DebugUtil.checkTreeStructure(originalFile.getNode());
return childNode;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:43,代码来源:TemplateDataElementType.java
示例7: GroovyLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public GroovyLexer() {
super(new MergingLexerAdapter(new GroovyFlexLexer(), tokensToMerge));
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:GroovyLexer.java
示例8: HaxeLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public HaxeLexer(Project project) {
super(new MergingLexerAdapter(new HaxeFlexLexer(project), tokensToMerge));
myProject = project;
}
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:5,代码来源:HaxeLexer.java
示例9: XQueryLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public XQueryLexer() {
super(new MergingLexerAdapter(new FlexAdapter(new _XQueryLexer()), orSet(COMMENTS, WHITE_SPACES, CHARACTER_CONTENTS)));
}
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:4,代码来源:XQueryLexer.java
示例10: HaxeLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public HaxeLexer() {
super(new MergingLexerAdapter(new HaxeFlexLexer(), tokensToMerge));
myProject = null;
}
开发者ID:consulo,项目名称:consulo-haxe,代码行数:5,代码来源:HaxeLexer.java
示例11: PlayBaseTemplateLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public PlayBaseTemplateLexer()
{
super(new MergingLexerAdapter(new FlexAdapter(new _PlayBaseTemplateLexer((Reader) null)), TokenSet.create(TEMPLATE_TEXT, WHITE_SPACE)));
}
开发者ID:consulo,项目名称:consulo-play,代码行数:5,代码来源:PlayBaseTemplateLexer.java
示例12: DylanLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
public DylanLexer() {
super(new MergingLexerAdapter(new DylanFlexLexer(), tokensToMerge));
}
开发者ID:dylan-foundry,项目名称:DeftIDEA,代码行数:4,代码来源:DylanLexer.java
示例13: createLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
@NotNull
@Override
public Lexer createLexer()
{
return new MergingLexerAdapter(createInnerLexer(), TokenSet.create(CfsTokens.TEXT));
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:7,代码来源:BaseCfsLanguageVersion.java
示例14: createDefaultLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
@Nonnull
@VisibleForTesting
static Lexer createDefaultLexer() {
return new MergingLexerAdapter(new FileTemplateTextLexer(), TokenSet.create(FileTemplateTokenType.TEXT));
}
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:FileTemplateConfigurable.java
示例15: createLexer
import com.intellij.lexer.MergingLexerAdapter; //导入依赖的package包/类
@Override
@Nullable
protected Lexer createLexer()
{
return new MergingLexerAdapter(new FlexAdapter(new _JSDocLexer(false)), JSDocTokenTypes.TOKENS_TO_MERGE);
}
开发者ID:consulo,项目名称:consulo-javascript,代码行数:7,代码来源:JSTokenTypes.java
注:本文中的com.intellij.lexer.MergingLexerAdapter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论