<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>$BB4O@(B</title>
    <link rel="stylesheet" href="../stylesheet.css" type="text/css">
    <link rel="stylesheet" href="stylesheet.css" type="text/css">
    <style TYPE="text/css">
      <!--
      -->
    </STYLE>

  </head>
  
  <body>  
    <h1>$BB4O@(B</h1>
    <a href="memo.html">memo</a>
    <div class="round">scheme$B$G=q$$$?%=!<%9$r(Bjava$B$N%=!<%9$KJQ49$9$k!#(B</div>
    <h2>$B<j=g(B</h2>
    <p class="box2">
      scheme$B$N%=!<%9$rFI$_9~$`!#(B<br>
      ocamlyacc,ocamllex$B$r;H$C$FFI$_9~$s$G%j%9%H7A<0$N%G!<%?$K$9$k!#(B
    </p>
    <p class="box2">
      scheme$B$N(Bspecial form$B$K=>$C$F(Bscheme$B$N9=J82r@O$r9T$&!#(B<br>
      $B$5$i$K(Balpha$BJQ49$r9T$C$FJQ?t$N=P8=$r%f%K!<%/$K$9$k!#(B
    </p>
    <hr>
    <h2>java$B$X$NJQ49$N;EJ}(B</h2>
    <a href="schemeimp.html">Scheme$B$N%G!<%?$N(BJava$B>e$G$NI=8=(B</a>
    <p class="box2">
      syntax<br>
    </p>
    <pre>
type ident = I of string
let ppI (I(x)) = x

type term =
  | Int of int
  | Float of float
  | String of string
  | Bool of bool
  | Var of ident
  | Nil
type exp =
  | Term of term
  | If  of exp * exp * exp
  | Let of bind list * exp
  | Fix of fbind list * exp
  | Primsym of prim * exp list
  | App of exp * exp list
and bind = {vname : ident ; vbody : exp }
and fbind = {fname : ident ; fargs : ident list ; fvody : exp }
    </pre>
    <ol>
      <li>if$BJ8(B
	<div>
	  <pre class="scm">
(if a b c)
	  </pre>
	  $B"-(B
	  <pre class="java">
if(a){ 
  b; 
}else{ 
  c; 
}
	  </pre>	  
	</div>
      <li>Let$BJ8(B
	<div>
	  <pre class="scm">
(let ((a (+ 1 3)))
    (+ a a))
	  </pre>
	  $B"-(B
	  <pre class="java">
ScmObj a = ScmInt(1 + 3);
return ScmInt(((ScmInt)a).evalInt() + ((ScmInt)a).evalInt());
	  </pre>	  
	</div>
      <li>App$BJ8(B
	<div>
	  <pre class="scm">
(f 1)
	  </pre>
	  $B"-(B
	  <pre class="java">
return ((ScmProc)f).app(ScmInt(1));
	  </pre>	  
      <li>Fix$BJ8(B
	<div>
	  <pre class="scm">
(fix ((suc (x) (+ x 1)))
  (suc 1))
	  </pre>
	  $B"-(B
	  <pre class="java">
class suc
	  </pre>	  
      <li>Fix$BJ8(B
	<div>
	  <pre class="scm">
(fix ((suc (x) (+ x 1)))
  (suc 1))
	  </pre>
	  $B"-(B
	  <pre class="java">

	  </pre>	  
	</div>
    </ol>
    <a href="sample.html">Sample</a>
    <hr>
    <address><a href="mailto:ganat@ise42.is.s.u-tokyo.ac.jp">NAGATA Akihito</a></address>
    <!-- Created: Wed Nov  7 16:01:13 JST 2001 -->
    <!-- hhmts start -->
Last modified: Fri Jan 11 04:13:29 JST 2002
<!-- hhmts end -->
  </body>
</html>
