copyright notices/updates
[sbp.git] / src / edu / berkeley / sbp / misc / Demo.java
index 3d0a3a6..8315472 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright 2006 all rights reserved; see LICENSE file for BSD-style license
+
 package edu.berkeley.sbp.misc;
 
 import edu.berkeley.sbp.*;
@@ -30,7 +32,6 @@ public class Demo {
         public static @bind.as("/") class Divide   extends BinOp { }
         public static @bind.as("+") class Add      extends BinOp { }
         public static @bind.as("-") class Subtract extends BinOp { }
-
     }
 
 
@@ -39,7 +40,7 @@ public class Demo {
 
         Parser metaGrammarParser   = new CharParser(MetaGrammar.newInstance());
         Tree<String> parsedGrammar = metaGrammarParser.parse(new CharInput(new FileInputStream(s[0]))).expand1();
-        GrammarBindingResolver gbr = new AnnotationGrammarBindingResolver(Math.class);
+        Grammar.Bindings gbr       = new AnnotationGrammarBindings(Math.class);
         Union   mathGrammar        = Grammar.create(parsedGrammar, "Expr", gbr);
         Parser  mathParser         = new CharParser(mathGrammar);
 
@@ -47,7 +48,7 @@ public class Demo {
         Tree tree = mathParser.parse(new CharInput(new StringReader(s[1]))).expand1();
 
         // below is ugly voodoo which will go away very soon.  ignore it.
-        Tree.TreeFunctor tf = (Tree.TreeFunctor)tree.head();
+        TreeFunctor tf = (TreeFunctor)tree.head();
         Math.Expr e = (Math.Expr)tf.invoke(tree);
         // above is ugly voodoo which will go away very soon.  ignore it.