    001    // This file was created as aprt of the 2003 Revision of the ESC tools.
    002    // Author: David R. Cok
    003
    004    package escjava.ast;
    005
    006    /** This class adds some JML-specific modifiers to the usual Java set.
    007    */
    008    public class Modifiers extends javafe.ast.Modifiers {
    009
    010      public static final int ACC_HELPER = 0x20000; // helper method, model or not
    011      public static final int ACC_MODEL = 0x80000; // model fields and methods
    012      public static final int ACC_DESUGARED = 0x400000; // set if desugaring
    013                                            // of routine specs is complete
    014
    015      public static boolean isModel(int modifiers) {
    016            return (modifiers&ACC_MODEL) != 0;
    017      }
    018      public static boolean isHelper(int modifiers) {
    019            return (modifiers&ACC_HELPER) != 0;
    020      }
    021
    022      //@ ensures \result != null;
    023      public static String toString(int modifiers) {
    024        String s = javafe.ast.Modifiers.toString(modifiers);
    025        if (isModel(modifiers)) s = "model " + s;
    026        // FIXME if (Utils.isPure(modifiers)) s = "pure " + s;
    027        if (isHelper(modifiers)) s = "helper " + s;
    028        return s;
    029      }
    030
    031    }