dol: add command line options and empty class
authorSebastian <basti@sraa.de>
Mon, 25 Nov 2013 18:27:27 +0000 (19:27 +0100)
committerSebastian <basti@sraa.de>
Mon, 25 Nov 2013 18:27:27 +0000 (19:27 +0100)
This allows selecting the Epiphany code generator
using the command line switches --epiphany or -E and
adds an empty EpiphanyVisitor class.

dol/src/dol/main/Main.java
dol/src/dol/main/Options.java
dol/src/dol/main/UserInterface.java
dol/src/dol/visitor/epiphany/EpiphanyVisitor.java [new file with mode: 0644]
dol/src/dol/visitor/epiphany/package.html [new file with mode: 0644]

index 6d0cd95fdb77ea382accc3a0ab6d36167099f0a3..cf31a65cc9fb30c8bce9e46e37cb0165c35e9c3e 100644 (file)
@@ -22,6 +22,7 @@ import dol.visitor.dot.MapDotVisitor;
 import dol.visitor.dot.PNDotVisitor;
 import dol.visitor.hds.HdsVisitor;
 import dol.visitor.hdsd.HdsdVisitor;
+import dol.visitor.Epiphany.EpiphanyVisitor;
 import dol.visitor.protothread.ProtothreadVisitor;
 import dol.visitor.rtems.RtemsVisitor;
 import dol.visitor.systemC.PNSystemCVisitor;
@@ -197,6 +198,14 @@ public class Main {
                 System.out.println();
             }
 
+            if (_ui.getEpiphanyFlag() && (_pn != null)) {
+                System.out.println("Generating Epiphany package:");
+                _pn.accept(new EpiphanyVisitor(
+                        _ui.getEpiphanyCodeDirectoryName()));
+                System.out.println(" -- Generation [Finished]");
+                System.out.println();
+            }
+
             if (_ui.getProtothreadFlag() && (_pn != null)) {
                 System.out.println("Generating protothread package:");
                 _pn.accept(new ProtothreadVisitor(
index b284d90a084f9f823a3d8df18c62cbac111493a7..3177da2741dfc03cf74949d055bcd235cf7cf113 100644 (file)
@@ -73,6 +73,9 @@ public class Options {
                         } else if(arg.equals("--PaF") || arg.equals("-PF") ) {
                             _ui.setPipeAndFilterCodeDirectoryName(args[++i]);
                             _ui.setPipeAndFilterFlag();
+                        } else if(arg.equals("--epiphany") || arg.equals("-E") ) {
+                            _ui.setEpiphanyCodeDirectoryName(args[++i]);
+                            _ui.setEpiphanyFlag();
                         } else if(arg.equals("--protothread") || arg.equals("-PT") ) {
                             _ui.setProtothreadCodeDirectoryName(args[++i]);
                             _ui.setProtothreadFlag();
@@ -192,7 +195,8 @@ public class Options {
         { "--profiling     ", "-T",   "<trace FileName>" },
         { "--vsplog        ", "-L",   "<log FileName>" },
         { "--cbe           ", "-CBE", "<DirectoryName>" },
-        { "--yapi          ", "-Y",   "<DirectoryName>" }
+        { "--yapi          ", "-Y",   "<DirectoryName>" },
+        { "--epiphany      ", "-E",   "<DirectoryName>" }
     };
 
     /**
index f9145eaf2ce743e68f3582e39a8d7b84cf5c6aa9..26d5add2d62d08d86be4727e41e5d7eff773f86e 100644 (file)
@@ -44,6 +44,9 @@ public class UserInterface {
     // the RTEMS board support package for which code is generated
     private String _rtemsBSP = "pc386";
 
+    // the Epiphany directory name
+    private String _epiphanyCodeDirectoryName = "nonameEpiphanyPackage";
+
     // the protothread directory name
     private String _protothreadCodeDirectoryName = "nonameHdsPackage";
 
@@ -81,6 +84,9 @@ public class UserInterface {
     // the SystemC flag
     private boolean _systemC = false;
 
+    // the Epiphany flag
+    private boolean _epiphanyFlag = false;
+
     // the PipeAndFilter flag
     private boolean _pipeAndFilter = false;
 
@@ -267,6 +273,24 @@ public class UserInterface {
         _codeDirectoryName = codeDirectoryName;
     }
 
+    /**
+     * Get the name of the Epiphany directory.
+     *
+     * @return The directory name of the Epiphany directory
+     */
+    public final String getEpiphanyCodeDirectoryName() {
+        return _epiphanyCodeDirectoryName;
+    }
+
+    /**
+     * Set the name of the Epiphany directory.
+     *
+     * @param codeDirectoryName Directory to generate Epiphany code in
+     */
+    public final void setEpiphanyCodeDirectoryName(String codeDirectoryName) {
+        _epiphanyCodeDirectoryName = codeDirectoryName;
+    }
+
     /**
      * Get the name of the PipeAndFilter directory.
      *
@@ -443,6 +467,22 @@ public class UserInterface {
         _systemC = true;
     }
 
+    /**
+     * Get the status of the Epiphany flag.
+     *
+     * @return Epiphany flag value
+     */
+    public final boolean getEpiphanyFlag() {
+        return _epiphanyFlag;
+    }
+
+    /*
+     * Set the Epiphany flag.
+     */
+    public final void setEpiphanyFlag() {
+        _epiphanyFlag = true;
+    }
+
     /**
      * Get the status of the PipeAndFilter flag.
      *
diff --git a/dol/src/dol/visitor/epiphany/EpiphanyVisitor.java b/dol/src/dol/visitor/epiphany/EpiphanyVisitor.java
new file mode 100644 (file)
index 0000000..d2a39e8
--- /dev/null
@@ -0,0 +1,10 @@
+package dol.visitor.Epiphany;
+
+import dol.visitor.PNVisitor;
+
+public class EpiphanyVisitor extends PNVisitor {
+       /* Constructor */
+       public EpiphanyVisitor(String packageName) {
+               System.out.println("EPIPHANY VISITOR CONSTRUCTOR");
+       }
+}
diff --git a/dol/src/dol/visitor/epiphany/package.html b/dol/src/dol/visitor/epiphany/package.html
new file mode 100644 (file)
index 0000000..ad1c0e8
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body bgcolor="white">
+
+Code generator for Epiphany platform.
+
+<h2>Package Specification</h2>
+
+<!-- use ordinary html here -->
+
+<h2>Related Documentation</h2>
+
+<!-- use ordinary html here -->
+
+<!-- Put @see and @since tags down here. -->
+
+</body>
+</html>