Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/configuration/ConfigurationBuilder.java @ 13658:50c11b9a7fdf
Ruby: remove some unimportant debugging flags.
author | Chris Seaton <chris.seaton@oracle.com> |
---|---|
date | Wed, 15 Jan 2014 19:33:33 +0000 |
parents | 497fada09efb |
children | 62bfc12dc9e1 |
rev | line source |
---|---|
13514 | 1 /* |
2 * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. This | |
3 * code is released under a tri EPL/GPL/LGPL license. You can use it, | |
4 * redistribute it and/or modify it under the terms of the: | |
5 * | |
6 * Eclipse Public License version 1.0 | |
7 * GNU General Public License version 2 | |
8 * GNU Lesser General Public License version 2.1 | |
9 */ | |
10 package com.oracle.truffle.ruby.runtime.configuration; | |
11 | |
12 import java.io.*; | |
13 | |
14 import com.oracle.truffle.ruby.runtime.*; | |
15 | |
16 /** | |
17 * The mutable counterpart to {@link Configuration}. | |
18 */ | |
19 public class ConfigurationBuilder { | |
20 | |
21 /** | |
22 * The path of the JRuby packaging of the Ruby standard library within our source tree. | |
23 */ | |
24 public static final String JRUBY_STDLIB_JAR = "lib/jruby-stdlib-1.7.4.jar"; | |
25 | |
26 private String standardLibrary = JRUBY_STDLIB_JAR; | |
27 | |
13596
dd0ba029bf34
Ruby: disabled debugging and tracing while they?re broken.
Chris Seaton <chris.seaton@oracle.com>
parents:
13514
diff
changeset
|
28 private boolean debug = false; |
13514 | 29 private boolean verbose = false; |
30 private int warningLevel = 0; | |
31 private int taintCheckLevel = 0; | |
32 | |
33 private String defaultExternalEncoding = null; | |
34 private String defaultInternalEncoding = null; | |
35 | |
13596
dd0ba029bf34
Ruby: disabled debugging and tracing while they?re broken.
Chris Seaton <chris.seaton@oracle.com>
parents:
13514
diff
changeset
|
36 private boolean trace = false; |
13514 | 37 private boolean fullObjectSpace = false; |
38 | |
39 private boolean printParseTree = false; | |
40 private boolean printUninitializedCalls = false; | |
41 private boolean printJavaExceptions = false; | |
42 private boolean printRubyExceptions = false; | |
43 | |
44 private PrintStream standardOut = System.out; | |
45 | |
46 private InputReader inputReader = new InputReader() { | |
47 | |
48 private final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); | |
49 | |
50 @Override | |
51 public String readLine(String prompt) throws IOException { | |
52 System.err.print(prompt); | |
53 return reader.readLine(); | |
54 } | |
55 | |
56 }; | |
57 | |
58 public ConfigurationBuilder() { | |
59 } | |
60 | |
61 public ConfigurationBuilder(Configuration configuration) { | |
62 assert configuration != null; | |
63 | |
64 standardLibrary = configuration.getStandardLibrary(); | |
65 | |
66 debug = configuration.getDebug(); | |
67 verbose = configuration.getVerbose(); | |
68 warningLevel = configuration.getWarningLevel(); | |
69 taintCheckLevel = configuration.getTaintCheckLevel(); | |
70 | |
71 defaultExternalEncoding = configuration.getDefaultExternalEncoding(); | |
72 defaultInternalEncoding = configuration.getDefaultInternalEncoding(); | |
73 | |
74 trace = configuration.getTrace(); | |
75 fullObjectSpace = configuration.getFullObjectSpace(); | |
76 | |
77 printParseTree = configuration.getPrintParseTree(); | |
78 printUninitializedCalls = configuration.getPrintUninitializedCalls(); | |
79 printJavaExceptions = configuration.getPrintJavaExceptions(); | |
80 printRubyExceptions = configuration.getPrintRubyExceptions(); | |
81 | |
82 standardOut = configuration.getStandardOut(); | |
83 } | |
84 | |
85 public String getStandardLibrary() { | |
86 return standardLibrary; | |
87 } | |
88 | |
89 public void setStandardLibrary(String standardLibrary) { | |
90 assert standardLibrary != null; | |
91 this.standardLibrary = standardLibrary; | |
92 } | |
93 | |
94 public boolean getDebug() { | |
95 return debug; | |
96 } | |
97 | |
98 public void setDebug(boolean debug) { | |
99 this.debug = debug; | |
100 } | |
101 | |
102 public boolean getVerbose() { | |
103 return verbose; | |
104 } | |
105 | |
106 public void setVerbose(boolean verbose) { | |
107 this.verbose = verbose; | |
108 } | |
109 | |
110 public int getWarningLevel() { | |
111 return warningLevel; | |
112 } | |
113 | |
114 public void setWarningLevel(int warningLevel) { | |
115 this.warningLevel = warningLevel; | |
116 } | |
117 | |
118 public int getTaintCheckLevel() { | |
119 return taintCheckLevel; | |
120 } | |
121 | |
122 public void setTaintCheckLevel(int taintCheckLevel) { | |
123 this.taintCheckLevel = taintCheckLevel; | |
124 } | |
125 | |
126 public String getDefaultExternalEncoding() { | |
127 return defaultExternalEncoding; | |
128 } | |
129 | |
130 public void setDefaultExternalEncoding(String defaultExternalEncoding) { | |
131 assert defaultExternalEncoding != null; | |
132 this.defaultExternalEncoding = defaultExternalEncoding; | |
133 } | |
134 | |
135 public String getDefaultInternalEncoding() { | |
136 return defaultInternalEncoding; | |
137 } | |
138 | |
139 public void setDefaultInternalEncoding(String defaultInternalEncoding) { | |
140 assert defaultInternalEncoding != null; | |
141 this.defaultInternalEncoding = defaultInternalEncoding; | |
142 } | |
143 | |
144 public boolean getTrace() { | |
145 return trace; | |
146 } | |
147 | |
148 public void setTrace(boolean trace) { | |
149 this.trace = trace; | |
150 } | |
151 | |
152 public boolean getFullObjectSpace() { | |
153 return fullObjectSpace; | |
154 } | |
155 | |
156 public void setFullObjectSpace(boolean fullObjectSpace) { | |
157 this.fullObjectSpace = fullObjectSpace; | |
158 } | |
159 | |
160 public boolean getPrintParseTree() { | |
161 return printParseTree; | |
162 } | |
163 | |
164 public void setPrintParseTree(boolean printParseTree) { | |
165 this.printParseTree = printParseTree; | |
166 } | |
167 | |
168 public boolean getPrintUninitializedCalls() { | |
169 return printUninitializedCalls; | |
170 } | |
171 | |
172 public void setPrintUninitializedCalls(boolean printUninitializedCalls) { | |
173 this.printUninitializedCalls = printUninitializedCalls; | |
174 } | |
175 | |
176 public boolean getPrintJavaExceptions() { | |
177 return printJavaExceptions; | |
178 } | |
179 | |
180 public void setPrintJavaExceptions(boolean printJavaExceptions) { | |
181 this.printJavaExceptions = printJavaExceptions; | |
182 } | |
183 | |
184 public boolean getPrintRubyExceptions() { | |
185 return printRubyExceptions; | |
186 } | |
187 | |
188 public void setPrintRubyExceptions(boolean printRubyExceptions) { | |
189 this.printRubyExceptions = printRubyExceptions; | |
190 } | |
191 | |
192 public PrintStream getStandardOut() { | |
193 return standardOut; | |
194 } | |
195 | |
196 public void setStandardOut(PrintStream standardOut) { | |
197 assert standardOut != null; | |
198 this.standardOut = standardOut; | |
199 } | |
200 | |
201 public InputReader getInputReader() { | |
202 return inputReader; | |
203 } | |
204 | |
205 public void setInputReader(InputReader lineReader) { | |
206 assert lineReader != null; | |
207 this.inputReader = lineReader; | |
208 } | |
209 | |
210 } |