Package org.intellij.grammar.generator

Examples of org.intellij.grammar.generator.ParserGenerator


            long time = System.currentTimeMillis();
            int filesCount = files.size();
            ApplicationManager.getApplication().runReadAction(new ThrowableComputable<Boolean, Exception>() {
              @Override
              public Boolean compute() throws Exception {
                new ParserGenerator(file, sourcePath, genDir.getPath()) {
                  @Override
                  protected PrintWriter openOutputInner(File file) throws IOException {
                    files.add(file);
                    return super.openOutputInner(file);
                  }
View Full Code Here


              Class.forName("org.intellij.lang.annotations.RegExp");
              com.intellij.psi.impl.DebugUtil.psiToString(bnfFile, false);
            }

            count ++;
            new ParserGenerator((BnfFile) bnfFile, grammarDir.getAbsolutePath(), output.getAbsolutePath()).generate();
            System.out.println(file.getName() + " parser generated to " + output.getCanonicalPath());
          }
        }
        if (count == 0) {
          System.out.println("No grammars matching '"+wildCard+"' found in: "+ grammarDir);
View Full Code Here

    myFile = createPsiFile("empty.bnf", "{ }");
    newTestGenerator().generate();
  }

  private ParserGenerator newTestGenerator() {
    return new ParserGenerator((BnfFileImpl)myFile, "", myFullDataPath) {

      @Override
      protected PrintWriter openOutputInner(File file) throws IOException {
        String grammarName = FileUtil.getNameWithoutExtension(myFile.getName());
        String fileName = FileUtil.getNameWithoutExtension(file);
View Full Code Here

      if (file.exists()) {
        assertTrue(file.delete());
      }
    }

    ParserGenerator parserGenerator = newTestGenerator();
    if (generatePsi) parserGenerator.generate();
    else parserGenerator.generateParser();

    List<String> messages = new ArrayList<String>();
    try {
      for (File file : filesToCheck) {
        assertTrue("Generated file not found: "+file, file.exists());
View Full Code Here

TOP

Related Classes of org.intellij.grammar.generator.ParserGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.