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

Last change on this file since 60 was 58, checked in by phdmakk, 11 years ago

+ initial commit for additional tools for testing and development

  • Property svn:mime-type set to text/plain
File size: 792 bytes
Line 
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>");
18                        return;
19                }
20                Translator app = new Translator();
21                app.process(args[0],"bnf");
22        }
23
24        public void process(String filename, String extension) {
25                System.out.println("Processing: " + filename);
26                if (!filename.endsWith(extension)) {
27                        System.out.println("Selected file is not supported!");
28                        return;
29                }
30                switch (extension) {
31                case "bnf":
32                        EbnfResourceTool tool = new EbnfResourceTool();
33                        tool.processFile(new File(filename));
34                        break;
35                default:
36                        break;
37                }
38        }
39
40}
Note: See TracBrowser for help on using the repository browser.