2017-03-09 15:20:05 +00:00
|
|
|
package parser;
|
|
|
|
|
2017-04-06 14:22:36 +00:00
|
|
|
import de.dhbwstuttgart.parser.JavaTXParser;
|
2017-08-17 13:58:56 +00:00
|
|
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
|
|
|
import de.dhbwstuttgart.syntaxtree.visual.ASTPrinter;
|
2017-03-09 15:20:05 +00:00
|
|
|
import org.junit.Test;
|
|
|
|
|
2017-04-06 14:22:36 +00:00
|
|
|
import java.io.File;
|
|
|
|
|
2017-03-09 15:20:05 +00:00
|
|
|
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];
|
2017-08-17 13:08:30 +00:00
|
|
|
args[0] = rootDirectory+"WhileTest.jav";
|
2017-08-17 13:58:56 +00:00
|
|
|
SourceFile sf = new JavaTXParser().parse(new File(args[0]));
|
|
|
|
System.out.println(ASTPrinter.print(sf));
|
2017-03-09 15:20:05 +00:00
|
|
|
}
|
|
|
|
}
|