1 package polyglot.main; 2 3 /** This class encapsulates the version of the compiler. */ 4 public abstract class Version { 5 /** 6 * The name of the language. Files produced by different languages 7 * are not compatible. 8 */ 9 public abstract String name(); 10 11 /** 12 * Marks major changes in the output format of the files produced by the 13 * compiler. Files produced be different major versions are considered 14 * incompatible and will not be used as source of class information. 15 */ 16 public abstract int major(); 17 18 /** 19 * Indicates a change in the compiler that does not affect the output 20 * format. Source files will be prefered over class files build by 21 * compilers with different minor versions, but if no source file is 22 * available, then the class file will be used. 23 */ 24 public abstract int minor(); 25 26 /** 27 * Denote minor changes and bugfixes to the compiler. Class files compiled 28 * with versions of the compiler that only differ in patchlevel (from the 29 * current instantiation) will always be preferred over source files 30 * (unless the source files have newer modification dates). 31 */ 32 public abstract int patch_level(); 33 34 public String toString() { 35 return "" + major() + "." + minor() + "." + patch_level(); 36 } 37 } 38