47fe91b4be3ed35766ced7e42257f221cebea372
[sbp.git] / src / edu / berkeley / sbp / bind / bind.java
1 package edu.berkeley.sbp.bind;
2
3 import edu.berkeley.sbp.util.*;
4 import edu.berkeley.sbp.*;
5 import edu.berkeley.sbp.chr.*;
6 import edu.berkeley.sbp.bind.*;
7 import java.util.*;
8 import java.lang.annotation.*;
9 import java.lang.reflect.*;
10 import java.io.*;
11
12 @Retention(RetentionPolicy.RUNTIME)
13 public @interface bind {    
14     /**
15      *  Constructors, classes, and methods with this attribute will
16      *  match every production of the nonterminal called "value()"
17      *  that is arg-compatible.  If value() is undefined, then the
18      *  class/constructor/method name is used.
19      */ 
20     /*
21       @Retention(RetentionPolicy.RUNTIME) public static @interface nonterminal { String value() default ""; }
22     */
23
24     @Retention(RetentionPolicy.RUNTIME)
25         public static @interface raw { }
26
27     /**
28      *  Constructors, classes, and methods with this attribute will
29      *  match every tree tagged with "value()" that is arg-compatible.
30      *  If value() is undefined, then the class/constructor/method
31      *  name is used.
32      */ 
33
34     @Retention(RetentionPolicy.RUNTIME)
35         public static @interface as         { String value() default ""; }
36
37
38     /**
39      *  If any parameter to a method or field in a class has a named
40      *  arg-tag, that parameter/field matches the child of the tree
41      *  which either has that label or else is a reference to a
42      *  nonterminal with the corresponding name.
43      *  
44      *  The remaining non-named arg-tags match the remaining children
45      *  of the tree in sequential order.
46      *
47      *  If any arg-tagged parameters/fields remain, the match fails.
48      *  If there were no arg-tagged parameters-fields, it is as if all
49      *  of them were non-named and arg-tagged.
50      *
51      *  A method/constructor is arg-compatible if all of its arguments
52      *  are arg-compatible.
53      *
54      *  A class is arg-compatible if all of its fields are
55      *  arg-compatible, or if one of its constructors is arg-compatible.
56      *
57      */
58     @Retention(RetentionPolicy.RUNTIME)
59         public static @interface arg         { String value() default ""; }
60 }