/*
 * Created on 13.des.2005
 *
 * Copyright (c) 2005, Karl Trygve Kalleberg <karltk@ii.uib.no>
 * 
 * Licensed under the GNU Lesser General Public License, v2.1
 */
package org.spoofax.jsglr.tests;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import junit.framework.TestCase;

import org.spoofax.jsglr.FatalException;
import org.spoofax.jsglr.InvalidParseTableException;
import org.spoofax.jsglr.SGLR;
import org.spoofax.jsglr.Tools;

import aterm.ATerm;
import aterm.pure.PureFactory;

public abstract class ParseTestCase extends TestCase {

    SGLR sglr;
    PureFactory pf;
    String suffix;
    
    public void setUp(String grammar, String suffix) throws FileNotFoundException, IOException, FatalException, InvalidParseTableException {
        this.suffix = suffix;
        pf = new PureFactory();
        sglr = new SGLR(pf, new FileInputStream("tests/grammars/" + grammar + ".tbl"));
    }

    public void doParseTest(String s) throws FileNotFoundException, IOException {
        Tools.setOutput("tests/jsglr-full-trace-" + s);
        ATerm parsed = sglr.parse(new FileInputStream("tests/data/" + s
                + "." + suffix));
        ATerm loaded = pf.readFromFile("tests/data/" + s + ".trm");
    
        Tools.debug(parsed);
    
        assertNotNull(parsed);
        assertNotNull(loaded);
        System.out.println(parsed);
        // assertTrue(parsed.match(loaded) != null);
    }

}

@@ -1270,42 +1270,8 @@
    %0A
-        Tools.debug(parsed);%0A    %0A
     
@@ -1332,51 +1332,16 @@
 d);%0A
-        System.out.println(parsed);
 %0A       
  // 
@@ -1340,11 +1340,8 @@
     
- //
  ass

Add actual matching/comparison between SGLR and jsglr output.