Class ParserGenerator


  • public class ParserGenerator
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static com.intellij.openapi.diagnostic.Logger LOG  
    • Constructor Summary

      Constructors 
      Constructor Description
      ParserGenerator​(@NotNull BnfFile psiFile, @NotNull java.lang.String sourcePath, @NotNull java.lang.String outputPath, @NotNull java.lang.String packagePrefix)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addWarning​(java.lang.String text)  
      void generate()  
      static @NotNull org.intellij.grammar.generator.NodeCalls.NodeCall generateConsumeTextToken​(@NotNull org.intellij.grammar.generator.ParserGeneratorUtil.ConsumeType consumeType, @NotNull java.lang.String tokenText)  
      java.lang.String generateFirstCheck​(BnfRule rule, java.lang.String frameName, boolean skipIfOne)  
      void generateParser()  
      void generateParser​(java.lang.String parserClass, java.util.Collection<java.lang.String> ownRuleNames)  
      java.util.Collection<java.lang.String> getRuleMethodTypesToImport​(BnfRule rule)  
      void newLine()  
      protected java.io.PrintWriter openOutputInner​(java.lang.String className, java.io.File file)  
      void out​(java.lang.String s)  
      void out​(java.lang.String s, java.lang.Object... args)  
      @NotNull java.lang.String shorten​(@NotNull java.lang.String s)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        public static final com.intellij.openapi.diagnostic.Logger LOG
    • Constructor Detail

      • ParserGenerator

        public ParserGenerator​(@NotNull
                               @NotNull BnfFile psiFile,
                               @NotNull
                               @NotNull java.lang.String sourcePath,
                               @NotNull
                               @NotNull java.lang.String outputPath,
                               @NotNull
                               @NotNull java.lang.String packagePrefix)
    • Method Detail

      • addWarning

        public void addWarning​(java.lang.String text)
      • openOutputInner

        protected java.io.PrintWriter openOutputInner​(java.lang.String className,
                                                      java.io.File file)
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • out

        public void out​(java.lang.String s,
                        java.lang.Object... args)
      • out

        public void out​(java.lang.String s)
      • newLine

        public void newLine()
      • shorten

        @NotNull
        public @NotNull java.lang.String shorten​(@NotNull
                                                 @NotNull java.lang.String s)
      • generate

        public void generate()
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • generateParser

        public void generateParser()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • generateParser

        public void generateParser​(java.lang.String parserClass,
                                   java.util.Collection<java.lang.String> ownRuleNames)
      • generateFirstCheck

        public java.lang.String generateFirstCheck​(BnfRule rule,
                                                   java.lang.String frameName,
                                                   boolean skipIfOne)
      • generateConsumeTextToken

        @NotNull
        public static @NotNull org.intellij.grammar.generator.NodeCalls.NodeCall generateConsumeTextToken​(@NotNull
                                                                                                          @NotNull org.intellij.grammar.generator.ParserGeneratorUtil.ConsumeType consumeType,
                                                                                                          @NotNull
                                                                                                          @NotNull java.lang.String tokenText)
      • getRuleMethodTypesToImport

        public java.util.Collection<java.lang.String> getRuleMethodTypesToImport​(BnfRule rule)