23 lines
641 B
Java
23 lines
641 B
Java
package parser;
|
|
|
|
import de.dhbwstuttgart.parser.JavaTXParser;
|
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
|
import de.dhbwstuttgart.syntaxtree.visual.ASTPrinter;
|
|
import org.junit.Test;
|
|
|
|
import java.io.File;
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
public class RunParserTest {
|
|
|
|
private static final String rootDirectory = System.getProperty("user.dir")+"/test/parser/";
|
|
|
|
@Test
|
|
public void testMain() throws Exception {
|
|
String[] args = new String[1];
|
|
args[0] = rootDirectory+"WhileTest.jav";
|
|
SourceFile sf = new JavaTXParser().parse(new File(args[0]));
|
|
System.out.println(ASTPrinter.print(sf));
|
|
}
|
|
} |