6ec7d6368c
asdlGen generates data structure and serializer code from ASDL specifications [1]. It is especially helpful for exchanging tree like data structures between different programming languages. Currently C, C++, Haskell, Java, Icon, OCaml and SML are supported. Although the asdlGen project itself seems no longer actively maintained, ASDL is "alive" as it is used (at least) in the Moby [2] and Python [3,4] compilers. The port optionally installs a simple usage example [5] for all seven programming languages. I developed it primarily to test the port, but it could be helpful to users of asdlGen to get a quicker start, especially if a less familiar programming language is involved in their project. Reviewers/committers can easily make use of it via the "test-demo" target. PR: ports/117703 Submitted by: Johannes 5 Joemann <joemann@beefree.free.de>
36 lines
1.2 KiB
Standard ML
36 lines
1.2 KiB
Standard ML
--- src/sml/translate/oo/java-pp.sml.orig 2000-01-14 02:42:28.000000000 +0100
|
|
+++ src/sml/translate/oo/java-pp.sml 2007-10-12 21:02:26.000000000 +0200
|
|
@@ -36,7 +36,8 @@
|
|
(case qualifier of
|
|
[] => NONE
|
|
| [""] => SOME {base=base,qualifier=[package_prefix]}
|
|
- | _ => SOME {base=base,qualifier=[package_prefix]@qualifier})
|
|
+ | _ => SOME {base=base,qualifier=[package_prefix]@
|
|
+ (map (String.map Char.toLower) qualifier)})
|
|
fun fix_ty_path {qualifier,base} =
|
|
case base of
|
|
"java_boolean" => SOME {qualifier=[],base="boolean"}
|
|
@@ -280,6 +281,7 @@
|
|
end
|
|
| pp_cls mn x =
|
|
let
|
|
+ val mn = String.map Char.toLower mn
|
|
fun get_name (DeclClass x) = PP.fix_tid(#name(x))
|
|
| get_name (DeclAbstractClass x) = PP.fix_tid(#name(x))
|
|
| get_name _ = raise Error.internal
|
|
@@ -311,6 +313,7 @@
|
|
|
|
fun mk_dep name =
|
|
let val mn = ModuleId.toString (PP.fix_mid name)
|
|
+ val mn = String.map Char.toLower mn
|
|
in
|
|
OS.Path.concat(package_prefix,
|
|
OS.Path.concat(mn,
|
|
@@ -337,6 +340,7 @@
|
|
end
|
|
| pp_consts mn x props imports =
|
|
let
|
|
+ val mn = String.map Char.toLower mn
|
|
val pp =
|
|
cat
|
|
[str ("package "^package_prefix^"."^mn^";"), nl,
|