Package de.maramuse.soundcomp.parser

Examples of de.maramuse.soundcomp.parser.Parser


public class TimingTests extends TestCase {
  /**
   * code to verify the timeline creation
   */
  public void testTimeline() throws Exception {
  Parser parser=new Parser();
  parser.setDebug(false);
  parser.setOptimize(true);
 
  List<String> paths=new ArrayList<String>();
  File file=new File("javasrc/de/maramuse/soundcomp/test/testfiles/tempotest");
  Preprocessor.setDebug(false);
  ParserVal p=parser.parse(file, paths);
  if(p==null){
    SCParser.ParserVal val=parser.getLastSymbol();
    if(val==null){
    fail("no result and no error text");
    return;
    }
    String filename=val.getFilename();
    if(filename==null)
    filename="direct input";
    parser.dumpStack();
    fail(String.format("%s after reading %s(%s), %s, %d",
      parser.getError(),
      parser.getSymbol(val.getType()), val.getText(),
      val.getFilename(),
      val.getLine()));
  }
  if(!(p instanceof SoundCompText))
    fail("Parsing didn't create a SoundCompText object");
View Full Code Here


   * not expected to succeed completely soon.
   * @throws Exception
   */
 
  public void testParser() throws Exception {
  Parser parser=new Parser();
  parser.setDebug(true);
  List<String> paths=new ArrayList<String>();
  paths.add("javasrc/de/maramuse/soundcomp/test/testfiles/");
  File file=new File("javasrc/de/maramuse/soundcomp/test/testfiles/parsertest");
  ParserVal p=parser.parse(file, paths);
  if(p==null){
    SCParser.ParserVal val=parser.getLastSymbol();
    if(val==null){
    fail("no result and no error text");
    return;
    }
    String filename=val.getFilename();
    if(filename==null)
    filename="direct input";
    parser.dumpStack();
    fail(String.format("%s after reading %s(%s), %s, %d",
      parser.getError(),
      parser.getSymbol(val.getType()), val.getText(),
      val.getFilename(),
      val.getLine()));
  }
  if(!(p instanceof SoundCompText))
    fail("Parsing didn't create a SoundCompText object");
View Full Code Here

TOP

Related Classes of de.maramuse.soundcomp.parser.Parser

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.