source: default/trunk/de.ugoe.cs.swe.bnftools.xtools/src/app/Translator.java

Last change on this file was 68, checked in by hkaulbersch, 10 years ago

1.)Changed the outline
2.)Added a PopupButton? for codegeneration(not running yet)

  • Property svn:mime-type set to text/plain
File size: 871 bytes
RevLine 
[58]1package app;
2
3import java.io.File;
4
5import org.eclipse.emf.ecore.resource.Resource;
6
7import resource.tools.xtools.EbnfResourceTool;
8
9
10public class Translator {
11        public Translator(){
12                super();
13        }
14       
15        public static void main(String[] args) {
16                if (args.length != 1) {
17                        System.out.println("Usage: Translator <FILE>");
[68]18//                      return;
[58]19                }
[68]20               
[58]21                Translator app = new Translator();
[68]22                System.out.println(args[0]);
23                String path = "C:\\Users\\hauke\\test.bnf";
24                app.process(path,"bnf");
[58]25        }
26
27        public void process(String filename, String extension) {
28                System.out.println("Processing: " + filename);
29                if (!filename.endsWith(extension)) {
30                        System.out.println("Selected file is not supported!");
31                        return;
32                }
33                switch (extension) {
34                case "bnf":
35                        EbnfResourceTool tool = new EbnfResourceTool();
36                        tool.processFile(new File(filename));
37                        break;
38                default:
39                        break;
40                }
41        }
42
43}
Note: See TracBrowser for help on using the repository browser.