Skip to content

Commit c5b047e

Browse files
authored
Merge pull request #75 from dzaima/antlr
Clean up comments
2 parents 425eba4 + 3fcf512 commit c5b047e

19 files changed

+125
-126
lines changed

java/src/processing/mode/java/Commander.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ static void printCommandLine(PrintStream out) {
389389
out.println("--no-java Do not embed Java. Use at your own risk!");
390390
out.println("--platform Specify the platform (export to application only).");
391391
out.println(" Should be one of 'windows', 'macosx', or 'linux'.");
392-
// out.addEmptyLine("--bits Must be specified if libraries are used that are");
393-
// out.addEmptyLine(" 32- or 64-bit specific such as the OpenGL library.");
394-
// out.addEmptyLine(" Otherwise specify 0 or leave it out.");
392+
// out.println("--bits Must be specified if libraries are used that are");
393+
// out.println(" 32- or 64-bit specific such as the OpenGL library.");
394+
// out.println(" Otherwise specify 0 or leave it out.");
395395

396396
out.println();
397397
out.println("The --build, --run, --present, or --export must be the final parameter");

java/src/processing/mode/java/Compiler.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ static public boolean compile(JavaBuild build) throws SketchException {
7676
"-nowarn", // we're not currently interested in warnings (works in ecj)
7777
"-d", build.getBinFolder().getAbsolutePath() // output the classes in the buildPath
7878
};
79-
//PApplet.addEmptyLine(baseCommand);
79+
//PApplet.println(baseCommand);
8080

8181
String[] sourceFiles = Util.listFiles(build.getSrcFolder(), false, ".java");
8282
String[] command = PApplet.concat(baseCommand, sourceFiles);
83-
//PApplet.addEmptyLine(command);
83+
//PApplet.println(command);
8484

8585
try {
8686
// Load errors into a local StringBuilder
@@ -131,7 +131,7 @@ public void close() { }
131131

132132
BufferedReader reader =
133133
new BufferedReader(new StringReader(errorBuffer.toString()));
134-
//System.err.addEmptyLine(errorBuffer.toString());
134+
//System.err.println(errorBuffer.toString());
135135

136136
String line = null;
137137
while ((line = reader.readLine()) != null) {
@@ -141,9 +141,9 @@ public void close() { }
141141
// and at least the first line of the error message
142142
String errorFormat = "([\\w\\d_]+.java):(\\d+):\\s*(.*):\\s*(.*)\\s*";
143143
String[] pieces = PApplet.match(line, errorFormat);
144-
//PApplet.addEmptyLine(pieces);
144+
//PApplet.println(pieces);
145145

146-
// if it's something unexpected, die and addCode the mess to the console
146+
// if it's something unexpected, die and print the mess to the console
147147
if (pieces == null) {
148148
exception = new SketchException("Cannot parse error text: " + line);
149149
exception.hideStackTrace();
@@ -180,7 +180,7 @@ public void close() { }
180180
String[] m = PApplet.match(errorMessage, "The import (.*) cannot be resolved");
181181
//what = what.substring(0, what.indexOf(' '));
182182
if (m != null) {
183-
// System.out.addEmptyLine("'" + m[1] + "'");
183+
// System.out.println("'" + m[1] + "'");
184184
if (m[1].equals("processing.xml")) {
185185
exception.setMessage("processing.xml no longer exists, this code needs to be updated for 2.0.");
186186
System.err.println("The processing.xml library has been replaced " +
@@ -225,7 +225,7 @@ public void close() { }
225225

226226
} else if (errorMessage.endsWith("cannot be resolved")) {
227227
// xxx cannot be resolved
228-
//addEmptyLine(xxx);
228+
//println(xxx);
229229

230230
String what = errorMessage.substring(0, errorMessage.indexOf(' '));
231231

java/src/processing/mode/java/Debugger.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,11 @@ protected boolean hasBreakpoint(LineID line) {
497497
// /** Print a list of currently set breakpoints. */
498498
// public synchronized void listBreakpoints() {
499499
// if (breakpoints.isEmpty()) {
500-
// System.out.addEmptyLine("no breakpoints");
500+
// System.out.println("no breakpoints");
501501
// } else {
502-
// System.out.addEmptyLine("line breakpoints:");
502+
// System.out.println("line breakpoints:");
503503
// for (LineBreakpoint bp : breakpoints) {
504-
// System.out.addEmptyLine(bp);
504+
// System.out.println(bp);
505505
// }
506506
// }
507507
// }
@@ -692,7 +692,7 @@ protected void stepOutIntoViewOrContinue() {
692692
List<StackFrame> frames = currentThread.frames();
693693
if (frames.size() > 1) {
694694
if (locationIsVisible(frames.get(1).location())) {
695-
//System.out.addEmptyLine("stepping out to: " + locationToString(frames.get(1).location()));
695+
//System.out.println("stepping out to: " + locationToString(frames.get(1).location()));
696696
stepOut();
697697
return;
698698
}
@@ -740,7 +740,7 @@ public synchronized boolean isBusy() {
740740

741741
/**
742742
* Print call stack trace of a thread. Only works on suspended threads.
743-
* @param t suspended thread to addCode stack trace of
743+
* @param t suspended thread to print stack trace of
744744
*/
745745
protected void printStackTrace(ThreadReference t) {
746746
if (!t.isSuspended()) {
@@ -794,7 +794,7 @@ public synchronized void printThreads() {
794794
/**
795795
* Print info about a thread. Includes name, status, isSuspended,
796796
* isAtBreakpoint.
797-
* @param t the thread to addCode info about
797+
* @param t the thread to print info about
798798
*/
799799
protected void printThread(ThreadReference t) {
800800
System.out.println(t.name());
@@ -896,7 +896,7 @@ protected void updateVariableInspector(ThreadReference t) {
896896
javax.swing.SwingUtilities.invokeLater(new Runnable() {
897897
@Override
898898
public void run() {
899-
//System.out.addEmptyLine("updating vi. from EDT: " + javax.swing.SwingUtilities.isEventDispatchThread());
899+
//System.out.println("updating vi. from EDT: " + javax.swing.SwingUtilities.isEventDispatchThread());
900900
vi.updateCallStack(stackTrace, "Call Stack");
901901
vi.updateLocals(locals, "Locals at " + currentLocation);
902902
vi.updateThisFields(thisFields, "Class " + thisName);
@@ -974,13 +974,13 @@ protected String locationToString(Location loc) {
974974
* @return the list of current locals
975975
*/
976976
protected List<VariableNode> getLocals(ThreadReference t, int depth) {
977-
//System.out.addEmptyLine("getting locals");
977+
//System.out.println("getting locals");
978978
List<VariableNode> vars = new ArrayList<>();
979979
try {
980980
if (t.frameCount() > 0) {
981981
StackFrame sf = t.frame(0);
982982
for (LocalVariable lv : sf.visibleVariables()) {
983-
//System.out.addEmptyLine("local var: " + lv.name());
983+
//System.out.println("local var: " + lv.name());
984984
Value val = sf.getValue(lv);
985985
VariableNode var = new LocalVariableNode(lv.name(), lv.typeName(), val, lv, sf);
986986
if (depth > 0) {
@@ -1163,11 +1163,11 @@ protected void printSourceLocation(ThreadReference t) {
11631163

11641164
/**
11651165
* Print source code snippet.
1166-
* @param l {@link Location} object to addCode source code for
1166+
* @param l {@link Location} object to print source code for
11671167
*/
11681168
protected void printSourceLocation(Location l) {
11691169
try {
1170-
//System.out.addEmptyLine(l.sourceName() + ":" + l.lineNumber());
1170+
//System.out.println(l.sourceName() + ":" + l.lineNumber());
11711171
System.out.println("in method " + l.method() + ":");
11721172
System.out.println(getSourceLine(l.sourcePath(), l.lineNumber(), 2));
11731173

@@ -1189,7 +1189,7 @@ protected String getSourceLine(String filePath, int lineNo, int radius) {
11891189
loge("invalid line number: " + lineNo, null);
11901190
return "";
11911191
}
1192-
//System.out.addEmptyLine("getting line: " + lineNo);
1192+
//System.out.println("getting line: " + lineNo);
11931193
File f = new File(srcPath + File.separator + filePath);
11941194
String output = "";
11951195
try {
@@ -1213,7 +1213,7 @@ protected String getSourceLine(String filePath, int lineNo, int radius) {
12131213
return output;
12141214

12151215
} catch (FileNotFoundException ex) {
1216-
//System.err.addEmptyLine(ex);
1216+
//System.err.println(ex);
12171217
return f.getName() + ":" + lineNo;
12181218

12191219
} catch (IOException ex) {
@@ -1226,7 +1226,7 @@ protected String getSourceLine(String filePath, int lineNo, int radius) {
12261226
/**
12271227
* Print info about a ReferenceType. Prints class name, source file name,
12281228
* lists methods.
1229-
* @param rt the reference type to addCode out
1229+
* @param rt the reference type to print out
12301230
*/
12311231
protected void printType(ReferenceType rt) {
12321232
System.out.println("ref.type: " + rt);
@@ -1375,13 +1375,13 @@ protected void startTrackingLineChanges() {
13751375
runtimeLineChanges.put(old, tracked);
13761376
}
13771377
runtimeTabsTracked.add(tab.getFileName());
1378-
//System.out.addEmptyLine("tracking tab: " + tab.getFileName());
1378+
//System.out.println("tracking tab: " + tab.getFileName());
13791379
}
13801380

13811381

13821382
/** Stop tracking line changes in all tabs. */
13831383
protected void stopTrackingLineChanges() {
1384-
//System.out.addEmptyLine("stop tracking line changes");
1384+
//System.out.println("stop tracking line changes");
13851385
for (LineID tracked : runtimeLineChanges.values()) {
13861386
tracked.stopTracking();
13871387
}
@@ -1456,7 +1456,7 @@ public void run() {
14561456
while (true) {
14571457
EventSet eventSet = eventQueue.remove();
14581458
listener.vmEvent(eventSet);
1459-
// for (Event e : eventSet) { System.out.addEmptyLine("VM Event: " + e.toString()); }
1459+
// for (Event e : eventSet) { System.out.println("VM Event: " + e.toString()); }
14601460
}
14611461
} catch (VMDisconnectedException e) {
14621462
Messages.log("VMEventReader quit on VM disconnect");

java/src/processing/mode/java/JavaBuild.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public String preprocess(File srcFolder,
157157
// make sure the user isn't playing "hide the sketch folder"
158158
sketch.ensureExistence();
159159

160-
// System.out.addEmptyLine("srcFolder is " + srcFolder);
160+
// System.out.println("srcFolder is " + srcFolder);
161161
classPath = binFolder.getAbsolutePath();
162162

163163
// figure out the contents of the code folder to see if there
@@ -496,7 +496,7 @@ public SketchException placeException(String message,
496496
int codeLine = -1;
497497

498498
//System.out.println(message + " placing " + dotJavaFilename + " " + dotJavaLine);
499-
//System.out.addEmptyLine("code count is " + getCodeCount());
499+
//System.out.println("code count is " + getCodeCount());
500500

501501
// first check to see if it's a .java file
502502
for (int i = 0; i < sketch.getCodeCount(); i++) {
@@ -526,7 +526,7 @@ public SketchException placeException(String message,
526526
//System.out.println("looking for line " + dotJavaLine);
527527
if (code.getPreprocOffset() <= dotJavaLine) {
528528
codeIndex = i;
529-
// System.out.addEmptyLine("i'm thinkin file " + i);
529+
// System.out.println("i'm thinkin file " + i);
530530
codeLine = dotJavaLine - code.getPreprocOffset();
531531
}
532532
}
@@ -976,7 +976,7 @@ protected boolean exportApplication(File destFolder,
976976
pw.print("APPDIR=$(dirname \"$APPDIR\")\n"); // more POSIX compliant
977977

978978
// another fix for bug #234, LD_LIBRARY_PATH ignored on some platforms
979-
//ps.addCode("LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$APPDIR\n");
979+
//ps.print("LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$APPDIR\n");
980980

981981
if (embedJava) {
982982
// https://github.com/processing/processing/issues/2349
@@ -1121,7 +1121,7 @@ protected void addClasses(ZipOutputStream zos, File dir) throws IOException {
11211121
if (!path.endsWith("/") && !path.endsWith("\\")) {
11221122
path += '/';
11231123
}
1124-
// System.out.addEmptyLine("path is " + path);
1124+
// System.out.println("path is " + path);
11251125
addClasses(zos, dir, path);
11261126
}
11271127

@@ -1134,13 +1134,13 @@ public boolean accept(File dir, String name) {
11341134
});
11351135
for (File sub : files) {
11361136
String relativePath = sub.getAbsolutePath().substring(rootPath.length());
1137-
// System.out.addEmptyLine("relative path is " + relativePath);
1137+
// System.out.println("relative path is " + relativePath);
11381138

11391139
if (sub.isDirectory()) {
11401140
addClasses(zos, sub, rootPath);
11411141

11421142
} else if (sub.getName().endsWith(".class")) {
1143-
// System.out.addEmptyLine(" adding item " + relativePath);
1143+
// System.out.println(" adding item " + relativePath);
11441144
ZipEntry entry = new ZipEntry(relativePath);
11451145
zos.putNextEntry(entry);
11461146
//zos.write(Base.loadBytesRaw(sub));

0 commit comments

Comments
 (0)