Java 类com.intellij.lang.ForeignLeafType 实例源码

项目:glsl4idea    文件:GLSLParsingBase.java   
public void advanceLexer_remapTokens(){
    final String tokenText = getTokenText();
    final String[] namesThroughWhichThisTokenWasRedefined = getNamesThroughWhichThisTokenWasRedefined();
    for (String name : namesThroughWhichThisTokenWasRedefined) {
        if (name != null && name.equals(tokenText)) {
            // Happens for #define name .*name.*
            // We must not replace it with itself, as it would lead to much tears (and probably is't up to spec anyway)
            return;
        }
    }
    final List<ForeignLeafType> definition = definitions.get(tokenText);
    if (definition != null) {
        Marker macro = mark();
        remapCurrentTokenAdvanceLexer_remapTokens = false;
        remapCurrentToken(definition, tokenText); //This will advance the lexer which will eat the (real or substituted) token and replace it with redefinition
        remapCurrentTokenAdvanceLexer_remapTokens = true;
        macro.done(new RedefinedTokenElementType(definitionTexts.get(tokenText)));
        advanceLexer_remapTokens();
    }
}
项目:glsl4idea    文件:MultiRemapPsiBuilderAdapter.java   
public void remapCurrentToken(List<ForeignLeafType> remapToTypes, String remappedThrough) {
    remapCurrentTokenAdvanceLexer();
    final ArrayList<IElementType> tagged = new ArrayList<IElementType>(remapToTypes.size());
    for (final ForeignLeafType type : remapToTypes) {
        final IElementType taggedType;
        if (type instanceof RedefinedTokenType) {
            taggedType = ((RedefinedTokenType) type).redefineAlsoThrough(remappedThrough);
        } else {
            taggedType = new RedefinedTokenType(type, remappedThrough);
        }
        tagged.add(taggedType);
    }
    waitingTokens.addAll(0, tagged);
}
项目:intellij-ce-playground    文件:ForeignLeafPsiElement.java   
public ForeignLeafPsiElement(@NotNull ForeignLeafType type, CharSequence text) {
  super(dereferenceElementType(type.getDelegate()), text);
  myForeignType = type;
}
项目:intellij-ce-playground    文件:ForeignLeafPsiElement.java   
@NotNull
public ForeignLeafType getForeignType() {
  return myForeignType;
}
项目:glsl4idea    文件:RedefinedTokenType.java   
public RedefinedTokenType(@NotNull ForeignLeafType delegate, String redefinedThrough) {
    super(delegate.getDelegate(), delegate.getValue());
    this.redefinedThrough = new String[]{redefinedThrough};
}
项目:tools-idea    文件:ForeignLeafPsiElement.java   
public ForeignLeafPsiElement(ForeignLeafType type, CharSequence text) {
  super(dereferenceElementType(type.getDelegate()), text);
  myForeignType = type;
}
项目:tools-idea    文件:ForeignLeafPsiElement.java   
public ForeignLeafType getForeignType() {
  return myForeignType;
}
项目:consulo    文件:ForeignLeafPsiElement.java   
public ForeignLeafPsiElement(ForeignLeafType type, CharSequence text) {
  super(dereferenceElementType(type.getDelegate()), text);
  myForeignType = type;
}
项目:consulo    文件:ForeignLeafPsiElement.java   
public ForeignLeafType getForeignType() {
  return myForeignType;
}