Commit 345ab207 authored by Benedikt Engeser's avatar Benedikt Engeser

tidyup

parent df7f1fb3
......@@ -75,8 +75,9 @@ public class CupFileWizard extends Wizard implements INewWizard {
final IFile file = container.getFile(new Path(fileName));
try {
ClassLoader cl = this.getClass().getClassLoader();
InputStream stream = cl.getResourceAsStream("/templates/parser.cup");
InputStream stream = cl
.getResourceAsStream("/templates/parser.cup");
if (file.exists()) {
file.setContents(stream, true, true, monitor);
} else {
......
......@@ -2,7 +2,6 @@ package de.tum.in.www2.cupplugin.wizards;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.lang.Thread.State;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -206,25 +205,27 @@ public class CupJavaProjectWizard extends Wizard implements INewWizard {
IFile parserFile;
if (generateCalculator) {
parserFile = createFile(project, monitor, "parser.cup",
parserFile = createFile(project, monitor, "parser.cup",
getTemplate("parser.cup"));
createFile(project, monitor, "lexer.jflex",
getTemplate("lexer.jflex"));
createFile(project, monitor, "input.txt", getTemplate("input.txt"));
createFile(project, monitor, "build.xml", getTemplate("build_jflex.xml"));
createFile(project, monitor, "build.xml",
getTemplate("build_jflex.xml"));
} else {
parserFile = createFile(project, monitor, "parser.cup",
parserFile = createFile(project, monitor, "parser.cup",
getTemplate("empty_file"));
if (useJflex) {
createFile(project, monitor, "lexer.jflex",
getTemplate("empty_file"));
createFile(project, monitor, "build.xml", getTemplate("build_jflex.xml"));
}else{
createFile(project, monitor, "build.xml", getTemplate("build.xml"));
createFile(project, monitor, "build.xml",
getTemplate("build_jflex.xml"));
} else {
createFile(project, monitor, "build.xml",
getTemplate("build.xml"));
}
}
createFile(exampleDir, monitor, "Driver.java",
......@@ -232,11 +233,10 @@ public class CupJavaProjectWizard extends Wizard implements INewWizard {
IFolder folder = createDirectory(project, monitor, "tools");
if(useJflex){
if (useJflex) {
createFile(folder, monitor, "JFlex.jar", getTemplate("JFlex.jar"));
}
IFile runtimeFile = createFile(folder, monitor,
"java-cup-11b-runtime.jar",
getTemplate("java-cup-11b-runtime.jar"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment