1 package org.jf.smalidea; 2 3 import com.intellij.lang.ASTFactory; 4 import com.intellij.psi.impl.source.tree.LeafElement; 5 import com.intellij.psi.tree.IElementType; 6 import org.jetbrains.annotations.Nullable; 7 import org.jf.smalidea.psi.leaf.SmaliClassDescriptor; 8 9 public class SmaliASTFactory extends ASTFactory { 10 11 @Nullable 12 @Override createLeaf(IElementType type, CharSequence text)13 public LeafElement createLeaf(IElementType type, CharSequence text) { 14 if (type == SmaliTokens.CLASS_DESCRIPTOR) { 15 return new SmaliClassDescriptor(text); 16 } 17 return super.createLeaf(type, text); 18 } 19 } 20