Package org.intellij.grammar.generator
Class ParserGeneratorUtil
java.lang.Object
org.intellij.grammar.generator.ParserGeneratorUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendTokenTypes(StringBuilder sb, List<String> tokenTypes) collectTokenPattern2Name(@NotNull BnfFile file, boolean createTokenIfMissing, @NotNull Map<String, String> map, @Nullable Set<String> usedInGrammar) static @Nullable PatterncompilePattern(String text) static <T extends Enum<T>>
TenumFromString(@Nullable String value, T def) static <T> @Nullable BnfAttrfindAttribute(@NotNull BnfRule rule, @NotNull KnownAttribute<T> attribute) static @NotNull List<com.intellij.psi.NavigatablePsiElement>findRuleImplMethods(@NotNull JavaHelper helper, @Nullable String psiImplUtilClass, @Nullable String methodName, @Nullable BnfRule rule) static @Nullable PatterngetAllTokenPattern(Map<String, String> tokens) static <T> TgetAttribute(@NotNull BnfRule rule, @NotNull KnownAttribute<T> attribute) static <T> TgetAttribute(@NotNull BnfRule rule, @NotNull KnownAttribute<T> attribute, @Nullable String match) static ObjectgetAttributeValue(BnfExpression value) static List<BnfExpression>getChildExpressions(@Nullable BnfExpression node) static com.intellij.psi.tree.IElementTypegetEffectiveType(com.intellij.psi.PsiElement tree) static StringgetElementType(BnfRule rule, @NotNull Case cas) static StringgetFuncName(@NotNull BnfRule r) static <T> TgetGenerateOption(@NotNull com.intellij.psi.PsiElement node, @NotNull KnownAttribute<T> attribute, @NotNull Map<String, String> genOptions, String... genOptionKeys) static StringgetGenericClauseString(List<JavaHelper.TypeParameterInfo> genericParameters, NameShortener shortener) static @NotNull StringgetGetterName(@NotNull String text) static <T> Tstatic @Nullable Stringstatic StringgetNextName(@NotNull String funcName, int i) static BnfExpressiongetNonTrivialNode(BnfExpression initialNode) static StringgetParametersString(List<String> paramsTypes, int offset, int mask, com.intellij.util.Function<? super String, String> substitutor, com.intellij.util.Function<? super Integer, ? extends List<String>> annoProvider, NameShortener shortener) static @NotNull ParserGeneratorUtil.NameFormatgetPsiClassFormat(BnfFile file) static @NotNull ParserGeneratorUtil.NameFormatgetPsiImplClassFormat(BnfFile file) static com.intellij.openapi.util.Couple<String>static StringgetRegexpTokenRegexp(@NotNull String tokenText) static <T> TgetRootAttribute(@NotNull com.intellij.psi.PsiElement node, @NotNull KnownAttribute<T> attribute) static <T> TgetRootAttribute(@NotNull com.intellij.psi.PsiElement node, @NotNull KnownAttribute<T> attribute, @Nullable String match) getRuleClasses(@NotNull BnfRule rule) static @Nullable StringgetRuleDisplayName(BnfRule rule, boolean force) static @NotNull StringgetRulePsiClassName(@NotNull BnfRule rule, @Nullable ParserGeneratorUtil.NameFormat format) static Collection<com.intellij.psi.impl.source.tree.LeafPsiElement>getSortedExternalRules(Set<com.intellij.psi.PsiElement> accessors) static Collection<BnfRule>getSortedPublicRules(Set<com.intellij.psi.PsiElement> accessors) static Collection<BnfExpression>getSortedTokens(Set<com.intellij.psi.PsiElement> accessors) static @NotNull StringgetThrowsString(List<String> exceptionList, NameShortener shortener) static StringgetTokenType(BnfFile file, String token, @NotNull Case cas) static BnfExpressiongetTrivialNodeChild(com.intellij.psi.PsiElement element) static booleanisRegexpToken(@NotNull String tokenText) static booleanisRollbackRequired(BnfExpression o, BnfFile file) static booleanisTokenSequence(@NotNull BnfRule rule, @Nullable BnfExpression node) static booleanisTrivialNode(com.intellij.psi.PsiElement element) static booleanmatchesAny(String regexp, String... text) static @Nullable Stringstatic <T extends com.intellij.psi.PsiElement>
it.unimi.dsi.fastutil.Hash.Strategy<T>static @NotNull StringtoIdentifier(@NotNull String text, @Nullable ParserGeneratorUtil.NameFormat format, @NotNull Case cas) topoSort(@NotNull Collection<BnfRule> rules, @NotNull RuleGraphHelper ruleGraph) static @NotNull String
-
Constructor Details
-
ParserGeneratorUtil
public ParserGeneratorUtil()
-
-
Method Details
-
enumFromString
-
getGenerateOption
public static <T> T getGenerateOption(@NotNull @NotNull com.intellij.psi.PsiElement node, @NotNull @NotNull KnownAttribute<T> attribute, @NotNull @NotNull Map<String, String> genOptions, String... genOptionKeys) -
getRootAttribute
public static <T> T getRootAttribute(@NotNull @NotNull com.intellij.psi.PsiElement node, @NotNull @NotNull KnownAttribute<T> attribute) -
getRootAttribute
public static <T> T getRootAttribute(@NotNull @NotNull com.intellij.psi.PsiElement node, @NotNull @NotNull KnownAttribute<T> attribute, @Nullable @Nullable String match) -
getAttribute
public static <T> T getAttribute(@NotNull @NotNull BnfRule rule, @NotNull @NotNull KnownAttribute<T> attribute) -
findAttribute
@Nullable public static <T> @Nullable BnfAttr findAttribute(@NotNull @NotNull BnfRule rule, @NotNull @NotNull KnownAttribute<T> attribute) -
getAttribute
public static <T> T getAttribute(@NotNull @NotNull BnfRule rule, @NotNull @NotNull KnownAttribute<T> attribute, @Nullable @Nullable String match) -
getAttributeValue
-
getLiteralValue
-
getLiteralValue
-
isTrivialNode
public static boolean isTrivialNode(com.intellij.psi.PsiElement element) -
getNonTrivialNode
-
getTrivialNodeChild
-
getEffectiveType
public static com.intellij.psi.tree.IElementType getEffectiveType(com.intellij.psi.PsiElement tree) -
getChildExpressions
-
getFuncName
-
getNextName
-
getGetterName
-
isRollbackRequired
-
toIdentifier
@NotNull public static @NotNull String toIdentifier(@NotNull @NotNull String text, @Nullable @Nullable ParserGeneratorUtil.NameFormat format, @NotNull @NotNull Case cas) -
getPsiClassFormat
-
getPsiImplClassFormat
-
getRulePsiClassName
@NotNull public static @NotNull String getRulePsiClassName(@NotNull @NotNull BnfRule rule, @Nullable @Nullable ParserGeneratorUtil.NameFormat format) -
getQualifiedRuleClassName
-
findRuleImplMethods
@NotNull public static @NotNull List<com.intellij.psi.NavigatablePsiElement> findRuleImplMethods(@NotNull @NotNull JavaHelper helper, @Nullable @Nullable String psiImplUtilClass, @Nullable @Nullable String methodName, @Nullable @Nullable BnfRule rule) -
getRuleClasses
-
getRuleDisplayName
-
getElementType
-
getTokenType
-
getSortedPublicRules
-
getSortedTokens
-
getSortedExternalRules
public static Collection<com.intellij.psi.impl.source.tree.LeafPsiElement> getSortedExternalRules(Set<com.intellij.psi.PsiElement> accessors) -
topoSort
public static List<BnfRule> topoSort(@NotNull @NotNull Collection<BnfRule> rules, @NotNull @NotNull RuleGraphHelper ruleGraph) -
isRegexpToken
-
getRegexpTokenRegexp
-
isTokenSequence
public static boolean isTokenSequence(@NotNull @NotNull BnfRule rule, @Nullable @Nullable BnfExpression node) -
appendTokenTypes
-
collectTokenPattern2Name
-
quote
-
compilePattern
-
matchesAny
-
getAllTokenPattern
-
getParametersString
-
unwrapTypeArgumentForParamList
-
getGenericClauseString
public static String getGenericClauseString(List<JavaHelper.TypeParameterInfo> genericParameters, NameShortener shortener) -
getThrowsString
@NotNull public static @NotNull String getThrowsString(List<String> exceptionList, NameShortener shortener) -
textStrategy
public static <T extends com.intellij.psi.PsiElement> it.unimi.dsi.fastutil.Hash.Strategy<T> textStrategy()
-