New upstream version 1.9.0~beta5
Emmanuel Bourg
5 years ago
+17
-1
2546 | 2546 | this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7); |
2547 | 2547 | } else if (currentArg.equals("1.8") || currentArg.equals("8") || currentArg.equals("8.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
2548 | 2548 | this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8); |
2549 | } else if (currentArg.equals("1.9") || currentArg.equals("9") || currentArg.equals("9.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ | |
2550 | this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_9); | |
2549 | 2551 | } |
2550 | 2552 | else if (currentArg.equals("jsr14")) { //$NON-NLS-1$ |
2551 | 2553 | this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_JSR14); |
2602 | 2604 | this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7); |
2603 | 2605 | } else if (currentArg.equals("1.8") || currentArg.equals("8") || currentArg.equals("8.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
2604 | 2606 | this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8); |
2607 | } else if (currentArg.equals("1.9") || currentArg.equals("9") || currentArg.equals("9.0")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ | |
2608 | this.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_9); | |
2605 | 2609 | } else { |
2606 | 2610 | throw new IllegalArgumentException(this.bind("configure.source", currentArg)); //$NON-NLS-1$ |
2607 | 2611 | } |
4843 | 4847 | } else if (CompilerOptions.VERSION_1_8.equals(version)) { |
4844 | 4848 | if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8); |
4845 | 4849 | if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8); |
4850 | } else if (CompilerOptions.VERSION_9.equals(version)) { | |
4851 | if (!didSpecifyCompliance) this.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_9); | |
4852 | if (!this.didSpecifyTarget) this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_9); | |
4846 | 4853 | } |
4847 | 4854 | } |
4848 | 4855 | |
4849 | 4856 | final String sourceVersion = this.options.get(CompilerOptions.OPTION_Source); |
4850 | 4857 | final String compliance = this.options.get(CompilerOptions.OPTION_Compliance); |
4851 | if (sourceVersion.equals(CompilerOptions.VERSION_1_8) | |
4858 | if (sourceVersion.equals(CompilerOptions.VERSION_9) | |
4859 | && CompilerOptions.versionToJdkLevel(compliance) < ClassFileConstants.JDK9) { | |
4860 | // compliance must be 1.9 if source is 1.9 | |
4861 | throw new IllegalArgumentException(this.bind("configure.incompatibleComplianceForSource", this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_9)); //$NON-NLS-1$ | |
4862 | } else if (sourceVersion.equals(CompilerOptions.VERSION_1_8) | |
4852 | 4863 | && CompilerOptions.versionToJdkLevel(compliance) < ClassFileConstants.JDK1_8) { |
4853 | 4864 | // compliance must be 1.8 if source is 1.8 |
4854 | 4865 | throw new IllegalArgumentException(this.bind("configure.incompatibleComplianceForSource", this.options.get(CompilerOptions.OPTION_Compliance), CompilerOptions.VERSION_1_8)); //$NON-NLS-1$ |
4887 | 4898 | throw new IllegalArgumentException(this.bind("configure.incompatibleComplianceForCldcTarget", targetVersion, sourceVersion)); //$NON-NLS-1$ |
4888 | 4899 | } |
4889 | 4900 | } else { |
4901 | // target must be 1.9 if source is 1.9 | |
4902 | if (CompilerOptions.versionToJdkLevel(sourceVersion) >= ClassFileConstants.JDK9 | |
4903 | && CompilerOptions.versionToJdkLevel(targetVersion) < ClassFileConstants.JDK9){ | |
4904 | throw new IllegalArgumentException(this.bind("configure.incompatibleTargetForSource", targetVersion, CompilerOptions.VERSION_9)); //$NON-NLS-1$ | |
4905 | } | |
4890 | 4906 | // target must be 1.8 if source is 1.8 |
4891 | 4907 | if (CompilerOptions.versionToJdkLevel(sourceVersion) >= ClassFileConstants.JDK1_8 |
4892 | 4908 | && CompilerOptions.versionToJdkLevel(targetVersion) < ClassFileConstants.JDK1_8){ |
+1
-33
794 | 794 | } |
795 | 795 | return bytes; |
796 | 796 | } |
797 | ||
798 | // protected static byte[] readCharTable(Class parserClass, String filename) throws java.io.IOException { // AspectJ Extension - used passed class not static ref | |
799 | // | |
800 | // | |
801 | // //files are located at Parser.class directory | |
802 | // | |
803 | // InputStream stream = parserClass.getResourceAsStream(filename); // AspectJ Extension - used passed class not static ref | |
804 | // if (stream == null) { | |
805 | // throw new java.io.IOException(Messages.bind(Messages.parser_missingFile, filename)); | |
806 | // } | |
807 | // char[] bytes = null; | |
808 | // try { | |
809 | // stream = new BufferedInputStream(stream); | |
810 | // bytes = Util.getInputStreamAsByteArray(stream, -1); | |
811 | // } finally { | |
812 | // try { | |
813 | // stream.close(); | |
814 | // } catch (IOException e) { | |
815 | // // ignore | |
816 | // } | |
817 | // } | |
818 | // return bytes; | |
819 | // } | |
820 | 797 | protected static long[] readLongTable(Class parserClass, String filename) throws java.io.IOException { // AspectJ Extension - used passed class not static ref |
821 | 798 | |
822 | 799 | //files are located at Parser.class directory |
938 | 915 | return chars; |
939 | 916 | } |
940 | 917 | public static int tAction(int state, int sym) { |
941 | try { | |
942 | int bas = base_action[state]; | |
943 | int tcheck = term_check[bas+sym]; | |
944 | int idx = tcheck==sym?bas+sym:bas; | |
945 | int taction = term_action[idx]; | |
946 | return term_action[term_check[base_action[state]+sym] == sym ? base_action[state] + sym : base_action[state]]; | |
947 | } catch (Throwable t) { | |
948 | int stop =1 ; | |
949 | throw t; | |
950 | } | |
918 | return term_action[term_check[base_action[state]+sym] == sym ? base_action[state] + sym : base_action[state]]; | |
951 | 919 | } |
952 | 920 | protected int astLengthPtr; |
953 | 921 |
252 | 252 | |
253 | 253 | public static final String COMMAND_EDITOR_NAME = AjcTask.class.getName() + ".COMMAND_EDITOR"; |
254 | 254 | |
255 | static final String[] TARGET_INPUTS = new String[] { "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8" }; | |
256 | static final String[] SOURCE_INPUTS = new String[] { "1.3", "1.4", "1.5", "1.6", "1.7", "1.8" }; | |
257 | static final String[] COMPLIANCE_INPUTS = new String[] { "-1.3", "-1.4", "-1.5", "-1.6", "-1.7", "-1.8" }; | |
255 | static final String[] TARGET_INPUTS = new String[] { "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9" }; | |
256 | static final String[] SOURCE_INPUTS = new String[] { "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9" }; | |
257 | static final String[] COMPLIANCE_INPUTS = new String[] { "-1.3", "-1.4", "-1.5", "-1.6", "-1.7", "-1.8", "1.9" }; | |
258 | 258 | |
259 | 259 | private static final ICommandEditor COMMAND_EDITOR; |
260 | 260 |
12 | 12 | <classpathentry kind="lib" path="/lib/bcel/bcel.jar" sourcepath="/lib/bcel/bcel-src.zip"/> |
13 | 13 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> |
14 | 14 | <classpathentry combineaccessrules="false" kind="src" path="/org.aspectj.matcher"/> |
15 | <classpathentry kind="lib" path="/lib/asm/asm-5.0.1.renamed.jar"/> | |
15 | <classpathentry kind="lib" path="/lib/asm/asm-6.0_ALPHA.renamed.jar"/> | |
16 | 16 | <classpathentry kind="output" path="bin"/> |
17 | 17 | </classpath> |