Package net.sf.laja.parser.engine2.source

Examples of net.sf.laja.parser.engine2.source.FileSource


                String classname = filename.substring(0, filename.length()-".java".length());
                return new StateTemplateFactory(classname);
            }
        });

        ParsingResult result = parser.parse(new FileSource(filePath));

        if (!result.success()) {
            return null;
        }
View Full Code Here


            public BehaviourParser.IBehaviourFactory getFactory(int phase) {
                return new BehaviourFactory();
            }
        });

        ParsingResult result = parser.parse(new FileSource(filePath));

        if (!result.success()) {
            return null;
        }
View Full Code Here

            public ConstructorParser.IConstructorFactory getFactory(int phase) {
                return new ConstructorFactory();
            }
        });

        ParsingResult result = parser.parse(new FileSource(filePath));

        if (!result.success()) {
            return null;
        }
View Full Code Here

    return parse(new StringSource(string));
  }

  // parse file
  public ParsingResult parseFile(String filename) throws ParserException {
    return parse(new FileSource(filename));
  }
View Full Code Here

    return parse(new StringSource(string));
  }

  // parse file
  public ParsingResult parseFile(String filename) throws ParserException {
    return parse(new FileSource(filename));
  }
View Full Code Here

   
    return template;
  }

  public static Template parseFile(final String filename, final TemplateTextWriter templateTextWriter, final Namespaces namespaces, final Classes classes, final GroovyClassLoader groovyClassLoader) {
    final FileSource sourceFile = new FileSource(filename);
   
    TemplateParser parser = new TemplateParser(new ITemplateFactoryFactory() {
      public ITemplateFactory getFactory(int phase) {
        return new TemplateFactory(sourceFile, templateTextWriter, namespaces, classes, groovyClassLoader);
      }
View Full Code Here

        return parse(new StringSource(string));
    }

    // parse file
    public ParsingResult parseFile(String filename) throws ParserException {
        return parse(new FileSource(filename));
    }
View Full Code Here

  @Test
  public void errorInLineOne() {
    StringSource stringSource = new StringSource("12345\n6789");
   
    final int index = 0;
    SourceLine sourceLine = stringSource.getSourceLine(index);
    SourceLine expectedLine = new SourceLine(1, 1, index, "12345", "^");
   
    assertEquals(expectedLine, sourceLine);
  }
View Full Code Here

  @Test
  public void errorInLineTwo() {
    StringSource stringSource = new StringSource("1\r\n2345\r\n67");
   
    final int index = 4;
    SourceLine sourceLine = stringSource.getSourceLine(index);
    SourceLine expectedLine = new SourceLine(2, 2, index, "2345", " ^");
   
    assertEquals(expectedLine, sourceLine);
  }
View Full Code Here

    return factory2;
  }

  // parse string
  public ParsingResult parseString(String string) throws ParserException {
    return parse(new StringSource(string));
  }
View Full Code Here

TOP

Related Classes of net.sf.laja.parser.engine2.source.FileSource

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.