Class ParserGeneratorUtil

java.lang.Object
org.intellij.grammar.generator.ParserGeneratorUtil

public class ParserGeneratorUtil extends Object
  • Constructor Details

    • ParserGeneratorUtil

      public ParserGeneratorUtil()
  • Method Details

    • enumFromString

      @NotNull public static <T extends Enum<T>> T enumFromString(@Nullable @Nullable String value, @NotNull T def)
    • 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

      public static Object getAttributeValue(BnfExpression value)
    • getLiteralValue

      @Nullable public static @Nullable String getLiteralValue(BnfStringLiteralExpression child)
    • getLiteralValue

      @Nullable public static <T> T getLiteralValue(BnfLiteralExpression child)
    • isTrivialNode

      public static boolean isTrivialNode(com.intellij.psi.PsiElement element)
    • getNonTrivialNode

      public static BnfExpression getNonTrivialNode(BnfExpression initialNode)
    • getTrivialNodeChild

      public static BnfExpression getTrivialNodeChild(com.intellij.psi.PsiElement element)
    • getEffectiveType

      public static com.intellij.psi.tree.IElementType getEffectiveType(com.intellij.psi.PsiElement tree)
    • getChildExpressions

      public static List<BnfExpression> getChildExpressions(@Nullable @Nullable BnfExpression node)
    • getFuncName

      public static String getFuncName(@NotNull @NotNull BnfRule r)
    • getNextName

      public static String getNextName(@NotNull @NotNull String funcName, int i)
    • getGetterName

      @NotNull public static @NotNull String getGetterName(@NotNull @NotNull String text)
    • isRollbackRequired

      public static boolean isRollbackRequired(BnfExpression o, BnfFile file)
    • toIdentifier

      @NotNull public static @NotNull String toIdentifier(@NotNull @NotNull String text, @Nullable @Nullable ParserGeneratorUtil.NameFormat format, @NotNull @NotNull Case cas)
    • getPsiClassFormat

      @NotNull public static @NotNull ParserGeneratorUtil.NameFormat getPsiClassFormat(BnfFile file)
    • getPsiImplClassFormat

      @NotNull public static @NotNull ParserGeneratorUtil.NameFormat getPsiImplClassFormat(BnfFile file)
    • getRulePsiClassName

      @NotNull public static @NotNull String getRulePsiClassName(@NotNull @NotNull BnfRule rule, @Nullable @Nullable ParserGeneratorUtil.NameFormat format)
    • getQualifiedRuleClassName

      public static com.intellij.openapi.util.Couple<String> getQualifiedRuleClassName(BnfRule rule)
    • 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

      @NotNull public static @NotNull Set<String> getRuleClasses(@NotNull @NotNull BnfRule rule)
    • getRuleDisplayName

      @Nullable public static @Nullable String getRuleDisplayName(BnfRule rule, boolean force)
    • getElementType

      public static String getElementType(BnfRule rule, @NotNull @NotNull Case cas)
    • getTokenType

      public static String getTokenType(BnfFile file, String token, @NotNull @NotNull Case cas)
    • getSortedPublicRules

      public static Collection<BnfRule> getSortedPublicRules(Set<com.intellij.psi.PsiElement> accessors)
    • getSortedTokens

      public static Collection<BnfExpression> getSortedTokens(Set<com.intellij.psi.PsiElement> accessors)
    • 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

      public static boolean isRegexpToken(@NotNull @NotNull String tokenText)
    • getRegexpTokenRegexp

      public static String getRegexpTokenRegexp(@NotNull @NotNull String tokenText)
    • isTokenSequence

      public static boolean isTokenSequence(@NotNull @NotNull BnfRule rule, @Nullable @Nullable BnfExpression node)
    • appendTokenTypes

      public static void appendTokenTypes(StringBuilder sb, List<String> tokenTypes)
    • collectTokenPattern2Name

      public static Map<String,String> collectTokenPattern2Name(@NotNull @NotNull BnfFile file, boolean createTokenIfMissing, @NotNull @NotNull Map<String,String> map, @Nullable @Nullable Set<String> usedInGrammar)
    • quote

      @Nullable public static @Nullable String quote(@Nullable @Nullable String text)
    • compilePattern

      @Nullable public static @Nullable Pattern compilePattern(String text)
    • matchesAny

      public static boolean matchesAny(String regexp, String... text)
    • getAllTokenPattern

      @Nullable public static @Nullable Pattern getAllTokenPattern(Map<String,String> tokens)
    • getParametersString

      public static String getParametersString(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)
    • unwrapTypeArgumentForParamList

      @NotNull public static @NotNull String unwrapTypeArgumentForParamList(String type)
    • 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()