Fix indentation in GPL headers
authorAdam Chlipala <adamc@hcoop.net>
Sun, 30 Jul 2006 15:50:33 +0000 (15:50 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sun, 30 Jul 2006 15:50:33 +0000 (15:50 +0000)
22 files changed:
src/ast.sml
src/baseTypes.sig
src/baseTypes.sml
src/dataStructures.sml
src/domain.sig
src/domain.sml
src/domtool.grm
src/domtool.lex
src/env.sig
src/env.sml
src/eval.sig
src/eval.sml
src/main.sig
src/main.sml
src/parse.sig
src/parse.sml
src/print.sig
src/print.sml
src/reduce.sig
src/reduce.sml
src/tycheck.sig
src/tycheck.sml

index bd87121..efc2fb0 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Configuration language abstract syntax *)
 
 
 (* Configuration language abstract syntax *)
 
index ea7bef4..2392fd4 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Add some base types *)
 
 
 (* Add some base types *)
 
index c9e95ee..bccbe67 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Add some base types *)
 
 
 (* Add some base types *)
 
index 75531fa..27505fa 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Some useful data structures *)
 
 
 (* Some useful data structures *)
 
index 0d74a54..eb94f3f 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Domain-related primitive actions *)
 
 
 (* Domain-related primitive actions *)
 
@@ -25,4 +25,9 @@ signature DOMAIN = sig
     (* Register handlers to run just before and after entering a domain
      * block. *)
 
     (* Register handlers to run just before and after entering a domain
      * block. *)
 
+    val currentDomain : unit -> string
+
+    val domainFile : string -> TextIO.outstream
+    (* Open one of the current domain's configuration files. *)
+
 end
 end
index e38ea4a..32b7ecf 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Domain-related primitive actions *)
 
 
 (* Domain-related primitive actions *)
 
@@ -40,9 +40,37 @@ fun registerAfter f =
     end
 
 val current = ref ""
     end
 
 val current = ref ""
+val currentPath = ref ""
+
+fun currentDomain () = !current
+
+fun domainFile name = TextIO.openOut (!currentPath ^ name)
+
+fun getPath domain =
+    let
+       val toks = String.fields (fn ch => ch = #".") domain
+
+       val elems = foldr (fn (piece, elems) =>
+                             let
+                                 val elems = piece :: elems
+                                 val path = String.concatWith "/" (Config.configRoot :: rev elems)
+                             in
+                                 (if Posix.FileSys.ST.isDir
+                                         (Posix.FileSys.stat path) then
+                                      ()
+                                  else
+                                      (OS.FileSys.remove path;
+                                       OS.FileSys.mkDir path))
+                                 handle OS.SysErr _ => OS.FileSys.mkDir path;
+                                 elems
+                             end) [] toks
+    in
+       String.concatWith "/" (Config.configRoot :: rev elems)
+    end
 
 val _ = Env.registerContainer ("domain",
                            fn (_, [(EString dom, _)]) => (current := dom;
 
 val _ = Env.registerContainer ("domain",
                            fn (_, [(EString dom, _)]) => (current := dom;
+                                                          currentPath := getPath dom;
                                                           !befores dom;
                                                           StringMap.empty)
                             | _ => Env.badArgs "domain",
                                                           !befores dom;
                                                           StringMap.empty)
                             | _ => Env.badArgs "domain",
index 349ab7a..cd899e1 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Parser for Domtool configuration files *)
 
 
 (* Parser for Domtool configuration files *)
 
index 6bf3475..5e40aa2 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Lexer for Domtool configuration files *)
 
 
 (* Lexer for Domtool configuration files *)
 
index f965ee2..d239e14 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Domtool type-checking and reduction environments *)
 
 
 (* Domtool type-checking and reduction environments *)
 
index 47003cb..2141f64 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Domtool type-checking and reduction environments *)
 
 
 (* Domtool type-checking and reduction environments *)
 
index 9b98e67..e9cd6aa 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Execution of Domtool programs reduced to primitive actions *)
 
 
 (* Execution of Domtool programs reduced to primitive actions *)
 
index c05d781..37a5d63 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Execution of Domtool programs reduced to primitive actions *)
 
 
 (* Execution of Domtool programs reduced to primitive actions *)
 
index f36fb65..46aedfb 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Main interface *)
 
 
 (* Main interface *)
 
index 7bc4599..7740522 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Main interface *)
 
 
 (* Main interface *)
 
index fa65151..7d06f47 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Domtool configuration language parser *)
 
 
 (* Domtool configuration language parser *)
 
index 5a5ce3f..d8dc9b9 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Domtool configuration language parser *)
 
 
 (* Domtool configuration language parser *)
 
index 8ac5294..6d615e6 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Pretty-printing Domtool configuration file ASTs *)
 
 
 (* Pretty-printing Domtool configuration file ASTs *)
 
index 4b497bd..9305714 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Pretty-printing Domtool configuration file ASTs *)
 
 
 (* Pretty-printing Domtool configuration file ASTs *)
 
index a874362..1aa6a8a 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Evaluation of expressions until only externs are around *)
 
 
 (* Evaluation of expressions until only externs are around *)
 
index 17a8507..5913873 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Evaluation of expressions until only externs are around *)
 
 
 (* Evaluation of expressions until only externs are around *)
 
index 50a816f..6ef31a5 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Domtool configuration language type checking *)
 
 
 (* Domtool configuration language type checking *)
 
index 30a1d86..8d35e2d 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*)
+ *)
 
 (* Domtool configuration language type checking *)
 
 
 (* Domtool configuration language type checking *)