Merge pull request #2978 from kfeuz/textAuto

Normalize line endings
This commit is contained in:
Ben Fry
2014-11-21 09:22:38 -05:00
30 changed files with 3017 additions and 3005 deletions

12
.gitattributes vendored Normal file
View File

@@ -0,0 +1,12 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Files which should always be normalized and converted
# to native line endings on checkout.
*.java text
*.pde text
# Files that will always have CRLF line endings on checkout.
*.bat eol=crlf
build/macosx/jAppleMenuBar.url eol=crlf

View File

@@ -1,231 +1,231 @@
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2013 The Processing Foundation
Copyright (c) 2011-12 Ben Fry and Casey Reas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package processing.app.contrib;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import processing.core.PApplet;
abstract public class Contribution {
static final String SPECIAL_CATEGORY_NAME = "Starred";
static final List validCategories =
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography",
"Utilities", "Video & Vision", "Other");
//protected String category; // "Sound"
protected List<String> categories; // "Sound", "Typography"
protected String name; // "pdf" or "PDF Export"
protected String authorList; // Ben Fry
protected String url; // http://processing.org
protected String sentence; // Write graphics to PDF files.
protected String paragraph; // <paragraph length description for site>
protected int version; // 102
protected String prettyVersion; // "1.0.2"
protected long lastUpdated; // 1402805757
protected int minRevision; // 0
protected int maxRevision; // 227
// "Sound"
// public String getCategory() {
// return category;
// }
// "Sound", "Utilities"... see valid list in ContributionListing
protected List<String> getCategories() {
return categories;
}
protected String getCategoryStr() {
StringBuilder sb = new StringBuilder();
for (String category : categories) {
sb.append(category);
sb.append(',');
}
sb.deleteCharAt(sb.length()-1); // delete last comma
return sb.toString();
}
protected boolean hasCategory(String category) {
if (category != null) {
for (String c : categories) {
if (category.equalsIgnoreCase(c)) {
return true;
}
}
}
return false;
}
// "pdf" or "PDF Export"
public String getName() {
return name;
}
// "[Ben Fry](http://benfry.com/)"
public String getAuthorList() {
return authorList;
}
// "http://processing.org"
public String getUrl() {
return url;
}
// "Write graphics to PDF files."
public String getSentence() {
return sentence;
}
// <paragraph length description for site>
public String getParagraph() {
return paragraph;
}
// 102
public int getVersion() {
return version;
}
// "1.0.2"
public String getPrettyVersion() {
return prettyVersion;
}
// 1402805757
public long getLastUpdated() {
return lastUpdated;
}
// 0
public int getMinRevision() {
return minRevision;
}
// 227
public int getMaxRevision() {
return maxRevision;
}
public boolean isCompatible(int versionNum) {
return ((maxRevision == 0 || versionNum < maxRevision) && versionNum > minRevision);
}
abstract public ContributionType getType();
public String getTypeName() {
return getType().toString();
}
abstract public boolean isInstalled();
// /**
// * Returns true if the type of contribution requires the PDE to restart
// * when being added or removed.
// */
// public boolean requiresRestart() {
// return getType() == ContributionType.TOOL || getType() == ContributionType.MODE;
// }
boolean isRestartFlagged() {
return false;
}
/** Overridden by LocalContribution. */
boolean isDeletionFlagged() {
return false;
}
boolean isUpdateFlagged() {
return false;
}
/**
* Returns true if the contribution is a starred/recommended contribution, or
* is by the Processing Foundation.
*
* @return
*/
boolean isSpecial() {
try {
return (authorList.indexOf("The Processing Foundation") != -1 ||
categories.contains(SPECIAL_CATEGORY_NAME));
} catch (NullPointerException npe) {
return false;
}
}
/**
* @return a single element list with "Unknown" as the category.
*/
static List<String> defaultCategory() {
List<String> outgoing = new ArrayList<String>();
outgoing.add("Unknown");
return outgoing;
}
/**
* @return the list of categories that this contribution is part of
* (e.g. "Typography / Geometry"). "Unknown" if the category null.
*/
static List<String> parseCategories(String categoryStr) {
List<String> outgoing = new ArrayList<String>();
if (categoryStr != null) {
String[] listing = PApplet.trim(PApplet.split(categoryStr, ','));
for (String category : listing) {
if (validCategories.contains(category)) {
outgoing.add(category);
}
}
}
if (outgoing.size() == 0) {
return defaultCategory();
}
return outgoing;
}
}
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2013 The Processing Foundation
Copyright (c) 2011-12 Ben Fry and Casey Reas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package processing.app.contrib;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import processing.core.PApplet;
abstract public class Contribution {
static final String SPECIAL_CATEGORY_NAME = "Starred";
static final List validCategories =
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography",
"Utilities", "Video & Vision", "Other");
//protected String category; // "Sound"
protected List<String> categories; // "Sound", "Typography"
protected String name; // "pdf" or "PDF Export"
protected String authorList; // Ben Fry
protected String url; // http://processing.org
protected String sentence; // Write graphics to PDF files.
protected String paragraph; // <paragraph length description for site>
protected int version; // 102
protected String prettyVersion; // "1.0.2"
protected long lastUpdated; // 1402805757
protected int minRevision; // 0
protected int maxRevision; // 227
// "Sound"
// public String getCategory() {
// return category;
// }
// "Sound", "Utilities"... see valid list in ContributionListing
protected List<String> getCategories() {
return categories;
}
protected String getCategoryStr() {
StringBuilder sb = new StringBuilder();
for (String category : categories) {
sb.append(category);
sb.append(',');
}
sb.deleteCharAt(sb.length()-1); // delete last comma
return sb.toString();
}
protected boolean hasCategory(String category) {
if (category != null) {
for (String c : categories) {
if (category.equalsIgnoreCase(c)) {
return true;
}
}
}
return false;
}
// "pdf" or "PDF Export"
public String getName() {
return name;
}
// "[Ben Fry](http://benfry.com/)"
public String getAuthorList() {
return authorList;
}
// "http://processing.org"
public String getUrl() {
return url;
}
// "Write graphics to PDF files."
public String getSentence() {
return sentence;
}
// <paragraph length description for site>
public String getParagraph() {
return paragraph;
}
// 102
public int getVersion() {
return version;
}
// "1.0.2"
public String getPrettyVersion() {
return prettyVersion;
}
// 1402805757
public long getLastUpdated() {
return lastUpdated;
}
// 0
public int getMinRevision() {
return minRevision;
}
// 227
public int getMaxRevision() {
return maxRevision;
}
public boolean isCompatible(int versionNum) {
return ((maxRevision == 0 || versionNum < maxRevision) && versionNum > minRevision);
}
abstract public ContributionType getType();
public String getTypeName() {
return getType().toString();
}
abstract public boolean isInstalled();
// /**
// * Returns true if the type of contribution requires the PDE to restart
// * when being added or removed.
// */
// public boolean requiresRestart() {
// return getType() == ContributionType.TOOL || getType() == ContributionType.MODE;
// }
boolean isRestartFlagged() {
return false;
}
/** Overridden by LocalContribution. */
boolean isDeletionFlagged() {
return false;
}
boolean isUpdateFlagged() {
return false;
}
/**
* Returns true if the contribution is a starred/recommended contribution, or
* is by the Processing Foundation.
*
* @return
*/
boolean isSpecial() {
try {
return (authorList.indexOf("The Processing Foundation") != -1 ||
categories.contains(SPECIAL_CATEGORY_NAME));
} catch (NullPointerException npe) {
return false;
}
}
/**
* @return a single element list with "Unknown" as the category.
*/
static List<String> defaultCategory() {
List<String> outgoing = new ArrayList<String>();
outgoing.add("Unknown");
return outgoing;
}
/**
* @return the list of categories that this contribution is part of
* (e.g. "Typography / Geometry"). "Unknown" if the category null.
*/
static List<String> parseCategories(String categoryStr) {
List<String> outgoing = new ArrayList<String>();
if (categoryStr != null) {
String[] listing = PApplet.trim(PApplet.split(categoryStr, ','));
for (String category : listing) {
if (validCategories.contains(category)) {
outgoing.add(category);
}
}
}
if (outgoing.size() == 0) {
return defaultCategory();
}
return outgoing;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,176 +1,176 @@
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2013 The Processing Foundation
Copyright (c) 2011-12 Ben Fry and Casey Reas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package processing.app.contrib;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.net.URLClassLoader;
import java.util.*;
import processing.app.Base;
import processing.app.Mode;
public class ModeContribution extends LocalContribution {
private Mode mode;
static public ModeContribution load(Base base, File folder) {
return load(base, folder, null);
}
static public ModeContribution load(Base base, File folder,
String searchName) {
try {
return new ModeContribution(base, folder, searchName);
} catch (IgnorableException ig) {
Base.log(ig.getMessage());
} catch (Throwable err) {
// Throwable to catch Exceptions or UnsupportedClassVersionError et al
if (searchName == null) {
err.printStackTrace();
} else {
// For the built-in modes, don't print the exception, just log it
// for debugging. This should be impossible for most users to reach,
// but it helps us load experimental mode when it's available.
Base.log("ModeContribution.load() failed for " + searchName, err);
}
}
return null;
}
/**
*
* @param base the base object that this will be tied to
* @param folder location inside the sketchbook modes folder or contrib
* @param className name of class and full package, or null to use default
* @throws Exception
*/
private ModeContribution(Base base, File folder,
String className) throws Exception {
super(folder);
className = initLoader(className);
if (className != null) {
Class<?> modeClass = loader.loadClass(className);
Constructor con = modeClass.getConstructor(Base.class, File.class);
mode = (Mode) con.newInstance(base, folder);
mode.setClassLoader(loader);
if (base != null) {
mode.setupGUI();
}
}
}
/**
* Method to close the ClassLoader so that the archives are no longer "locked"
* and a mode can be removed without restart.
*/
public void clearClassLoader(Base base) {
ArrayList<ModeContribution> contribModes = base.getModeContribs();
int botherToRemove = contribModes.indexOf(this);
if (botherToRemove != -1) { // The poor thing isn't even loaded, and we're trying to remove it...
contribModes.remove(botherToRemove);
try {
((URLClassLoader) loader).close();
// The typecast should be safe, since the only case when loader is not of
// type URLClassLoader is when no archives were found in the first
// place...
} catch (IOException e) {
e.printStackTrace();
}
}
}
static public void loadMissing(Base base) {
File modesFolder = Base.getSketchbookModesFolder();
ArrayList<ModeContribution> contribModes = base.getModeContribs();
HashMap<File, ModeContribution> existing = new HashMap<File, ModeContribution>();
for (ModeContribution contrib : contribModes) {
existing.put(contrib.getFolder(), contrib);
}
File[] potential = ContributionType.MODE.listCandidates(modesFolder);
// If modesFolder does not exist or is inaccessible (folks might like to
// mess with folders then report it as a bug) 'potential' will be null.
if (potential != null) {
for (File folder : potential) {
if (!existing.containsKey(folder)) {
try {
contribModes.add(new ModeContribution(base, folder, null));
} catch (IgnorableException ig) {
Base.log(ig.getMessage());
} catch (Throwable e) {
e.printStackTrace();
}
}
}
}
// This allows you to build and test your Mode code from Eclipse.
// -Dusemode=com.foo.FrobMode:/path/to/FrobMode
final String useMode = System.getProperty("usemode");
if (useMode != null) {
final String[] modeInfo = useMode.split(":", 2);
final String modeClass = modeInfo[0];
final String modeResourcePath = modeInfo[1];
System.out.println("Attempting to load " + modeClass + " with resources at " + modeResourcePath);
contribModes.add(ModeContribution.load(base, new File(modeResourcePath), modeClass));
}
}
public Mode getMode() {
return mode;
}
public ContributionType getType() {
return ContributionType.MODE;
}
public boolean equals(Object o) {
if (o == null || !(o instanceof ModeContribution)) {
return false;
}
ModeContribution other = (ModeContribution) o;
return loader.equals(other.loader) && mode.equals(other.getMode());
}
// static protected List<File> discover(File folder) {
// File[] folders = listCandidates(folder, "mode");
// if (folders == null) {
// return new ArrayList<File>();
// } else {
// return Arrays.asList(folders);
// }
// }
}
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2013 The Processing Foundation
Copyright (c) 2011-12 Ben Fry and Casey Reas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package processing.app.contrib;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.net.URLClassLoader;
import java.util.*;
import processing.app.Base;
import processing.app.Mode;
public class ModeContribution extends LocalContribution {
private Mode mode;
static public ModeContribution load(Base base, File folder) {
return load(base, folder, null);
}
static public ModeContribution load(Base base, File folder,
String searchName) {
try {
return new ModeContribution(base, folder, searchName);
} catch (IgnorableException ig) {
Base.log(ig.getMessage());
} catch (Throwable err) {
// Throwable to catch Exceptions or UnsupportedClassVersionError et al
if (searchName == null) {
err.printStackTrace();
} else {
// For the built-in modes, don't print the exception, just log it
// for debugging. This should be impossible for most users to reach,
// but it helps us load experimental mode when it's available.
Base.log("ModeContribution.load() failed for " + searchName, err);
}
}
return null;
}
/**
*
* @param base the base object that this will be tied to
* @param folder location inside the sketchbook modes folder or contrib
* @param className name of class and full package, or null to use default
* @throws Exception
*/
private ModeContribution(Base base, File folder,
String className) throws Exception {
super(folder);
className = initLoader(className);
if (className != null) {
Class<?> modeClass = loader.loadClass(className);
Constructor con = modeClass.getConstructor(Base.class, File.class);
mode = (Mode) con.newInstance(base, folder);
mode.setClassLoader(loader);
if (base != null) {
mode.setupGUI();
}
}
}
/**
* Method to close the ClassLoader so that the archives are no longer "locked"
* and a mode can be removed without restart.
*/
public void clearClassLoader(Base base) {
ArrayList<ModeContribution> contribModes = base.getModeContribs();
int botherToRemove = contribModes.indexOf(this);
if (botherToRemove != -1) { // The poor thing isn't even loaded, and we're trying to remove it...
contribModes.remove(botherToRemove);
try {
((URLClassLoader) loader).close();
// The typecast should be safe, since the only case when loader is not of
// type URLClassLoader is when no archives were found in the first
// place...
} catch (IOException e) {
e.printStackTrace();
}
}
}
static public void loadMissing(Base base) {
File modesFolder = Base.getSketchbookModesFolder();
ArrayList<ModeContribution> contribModes = base.getModeContribs();
HashMap<File, ModeContribution> existing = new HashMap<File, ModeContribution>();
for (ModeContribution contrib : contribModes) {
existing.put(contrib.getFolder(), contrib);
}
File[] potential = ContributionType.MODE.listCandidates(modesFolder);
// If modesFolder does not exist or is inaccessible (folks might like to
// mess with folders then report it as a bug) 'potential' will be null.
if (potential != null) {
for (File folder : potential) {
if (!existing.containsKey(folder)) {
try {
contribModes.add(new ModeContribution(base, folder, null));
} catch (IgnorableException ig) {
Base.log(ig.getMessage());
} catch (Throwable e) {
e.printStackTrace();
}
}
}
}
// This allows you to build and test your Mode code from Eclipse.
// -Dusemode=com.foo.FrobMode:/path/to/FrobMode
final String useMode = System.getProperty("usemode");
if (useMode != null) {
final String[] modeInfo = useMode.split(":", 2);
final String modeClass = modeInfo[0];
final String modeResourcePath = modeInfo[1];
System.out.println("Attempting to load " + modeClass + " with resources at " + modeResourcePath);
contribModes.add(ModeContribution.load(base, new File(modeResourcePath), modeClass));
}
}
public Mode getMode() {
return mode;
}
public ContributionType getType() {
return ContributionType.MODE;
}
public boolean equals(Object o) {
if (o == null || !(o instanceof ModeContribution)) {
return false;
}
ModeContribution other = (ModeContribution) o;
return loader.equals(other.loader) && mode.equals(other.getMode());
}
// static protected List<File> discover(File folder) {
// File[] folders = listCandidates(folder, "mode");
// if (folders == null) {
// return new ArrayList<File>();
// } else {
// return Arrays.asList(folders);
// }
// }
}

View File

@@ -1,182 +1,182 @@
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2013 The Processing Foundation
Copyright (c) 2011-12 Ben Fry and Casey Reas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package processing.app.contrib;
import java.io.*;
import java.net.URLClassLoader;
//import java.net.*;
import java.util.*;
import processing.app.Base;
//import processing.app.Base;
import processing.app.Editor;
import processing.app.tools.Tool;
public class ToolContribution extends LocalContribution implements Tool {
private Tool tool;
private File referenceFile; // shortname/reference/index.html
static public ToolContribution load(File folder) {
try {
return new ToolContribution(folder);
} catch (IgnorableException ig) {
Base.log(ig.getMessage());
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2013 The Processing Foundation
Copyright (c) 2011-12 Ben Fry and Casey Reas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package processing.app.contrib;
import java.io.*;
import java.net.URLClassLoader;
//import java.net.*;
import java.util.*;
import processing.app.Base;
//import processing.app.Base;
import processing.app.Editor;
import processing.app.tools.Tool;
public class ToolContribution extends LocalContribution implements Tool {
private Tool tool;
private File referenceFile; // shortname/reference/index.html
static public ToolContribution load(File folder) {
try {
return new ToolContribution(folder);
} catch (IgnorableException ig) {
Base.log(ig.getMessage());
} catch (VerifyError ve) { // incompatible
// avoid the excessive error spew that happens here
} catch (Throwable e) { // unknown error
e.printStackTrace();
}
return null;
}
}
return null;
}
private ToolContribution(File folder) throws Throwable {
super(folder);
String className = initLoader(null);
if (className != null) {
Class<?> toolClass = loader.loadClass(className);
tool = (Tool) toolClass.newInstance();
}
referenceFile = new File(folder, "reference/index.html");
}
/**
* Method to close the ClassLoader so that the archives are no longer "locked" and
* a tool can be removed without restart.
*/
public void clearClassLoader(Base base) {
try {
((URLClassLoader) this.loader).close();
} catch (IOException e1) {
e1.printStackTrace();
}
Iterator<Editor> editorIter = base.getEditors().iterator();
while (editorIter.hasNext()) {
Editor editor = editorIter.next();
ArrayList<ToolContribution> contribTools = editor.contribTools;
for (ToolContribution toolContrib : contribTools)
if (toolContrib.getName().equals(this.name)) {
try {
((URLClassLoader) toolContrib.loader).close();
editor.contribTools.remove(toolContrib);
break;
} catch (IOException e) {
e.printStackTrace();
}
// base.getActiveEditor().rebuildToolMenu();
}
}
}
// static protected List<File> discover(File folder) {
// File[] folders = listCandidates(folder, "tool");
// if (folders == null) {
// return new ArrayList<File>();
// } else {
// return Arrays.asList(folders);
// }
// }
static public ArrayList<ToolContribution> loadAll(File toolsFolder) {
File[] list = ContributionType.TOOL.listCandidates(toolsFolder);
ArrayList<ToolContribution> outgoing = new ArrayList<ToolContribution>();
// If toolsFolder does not exist or is inaccessible (stranger things have
// happened, and are reported as bugs) list will come back null.
if (list != null) {
for (File folder : list) {
try {
ToolContribution tc = load(folder);
if (tc != null) {
outgoing.add(tc);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
return outgoing;
}
// Editor editor; // used to send error messages
public void init(Editor editor) {
// try {
// this.editor = editor;
tool.init(editor);
// } catch (NoSuchMethodError nsme) {
// editor.statusError(tool.getMenuTitle() + " is not compatible with this version of Processing");
// nsme.printStackTrace();
// }
}
public void run() {
// try {
tool.run();
// } catch (NoSuchMethodError nsme) {
// editor.statusError(tool.getMenuTitle() + " is not compatible with this version of Processing");
// nsme.printStackTrace();
// }
}
public String getMenuTitle() {
return tool.getMenuTitle();
}
public ContributionType getType() {
return ContributionType.TOOL;
}
/**
* Returns the object stored in the referenceFile field, which contains an
* instance of the file object representing the index file of the reference
*
* @return referenceFile
*/
public File getReferenceIndexFile() {
return referenceFile;
}
/**
* Tests whether the reference's index file indicated by referenceFile exists.
*
* @return true if and only if the file denoted by referenceFile exists; false
* otherwise.
*/
public boolean hasReference() {
return referenceFile.exists();
}
super(folder);
String className = initLoader(null);
if (className != null) {
Class<?> toolClass = loader.loadClass(className);
tool = (Tool) toolClass.newInstance();
}
referenceFile = new File(folder, "reference/index.html");
}
/**
* Method to close the ClassLoader so that the archives are no longer "locked" and
* a tool can be removed without restart.
*/
public void clearClassLoader(Base base) {
try {
((URLClassLoader) this.loader).close();
} catch (IOException e1) {
e1.printStackTrace();
}
Iterator<Editor> editorIter = base.getEditors().iterator();
while (editorIter.hasNext()) {
Editor editor = editorIter.next();
ArrayList<ToolContribution> contribTools = editor.contribTools;
for (ToolContribution toolContrib : contribTools)
if (toolContrib.getName().equals(this.name)) {
try {
((URLClassLoader) toolContrib.loader).close();
editor.contribTools.remove(toolContrib);
break;
} catch (IOException e) {
e.printStackTrace();
}
// base.getActiveEditor().rebuildToolMenu();
}
}
}
// static protected List<File> discover(File folder) {
// File[] folders = listCandidates(folder, "tool");
// if (folders == null) {
// return new ArrayList<File>();
// } else {
// return Arrays.asList(folders);
// }
// }
static public ArrayList<ToolContribution> loadAll(File toolsFolder) {
File[] list = ContributionType.TOOL.listCandidates(toolsFolder);
ArrayList<ToolContribution> outgoing = new ArrayList<ToolContribution>();
// If toolsFolder does not exist or is inaccessible (stranger things have
// happened, and are reported as bugs) list will come back null.
if (list != null) {
for (File folder : list) {
try {
ToolContribution tc = load(folder);
if (tc != null) {
outgoing.add(tc);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
return outgoing;
}
// Editor editor; // used to send error messages
public void init(Editor editor) {
// try {
// this.editor = editor;
tool.init(editor);
// } catch (NoSuchMethodError nsme) {
// editor.statusError(tool.getMenuTitle() + " is not compatible with this version of Processing");
// nsme.printStackTrace();
// }
}
public void run() {
// try {
tool.run();
// } catch (NoSuchMethodError nsme) {
// editor.statusError(tool.getMenuTitle() + " is not compatible with this version of Processing");
// nsme.printStackTrace();
// }
}
public String getMenuTitle() {
return tool.getMenuTitle();
}
public ContributionType getType() {
return ContributionType.TOOL;
}
/**
* Returns the object stored in the referenceFile field, which contains an
* instance of the file object representing the index file of the reference
*
* @return referenceFile
*/
public File getReferenceIndexFile() {
return referenceFile;
}
/**
* Tests whether the reference's index file indicated by referenceFile exists.
*
* @return true if and only if the file denoted by referenceFile exists; false
* otherwise.
*/
public boolean hasReference() {
return referenceFile.exists();
}
}

View File

@@ -1,394 +1,394 @@
/* -*- mode: antlr; c-basic-offset: 4; indent-tabs-mode: nil -*- */
header {
package processing.mode.java.preproc;
}
class PdeRecognizer extends JavaRecognizer;
options {
importVocab = Java;
exportVocab = PdePartial;
//codeGenMakeSwitchThreshold=10; // this is set high for debugging
//codeGenBitsetTestThreshold=10; // this is set high for debugging
// developers may to want to set this to true for better
// debugging messages, however, doing so disables highlighting errors
// in the editor.
defaultErrorHandler = false; //true;
}
tokens {
CONSTRUCTOR_CAST; EMPTY_FIELD;
}
{
// this clause copied from java15.g! ANTLR does not copy this
// section from the super grammar.
/**
* Counts the number of LT seen in the typeArguments production.
* It is used in semantic predicates to ensure we have seen
* enough closing '>' characters; which actually may have been
* either GT, SR or BSR tokens.
*/
private int ltCounter = 0;
private PdePreprocessor pp;
public PdeRecognizer(final PdePreprocessor pp, final TokenStream ts) {
this(ts);
this.pp = pp;
}
private void mixed() throws RecognitionException, TokenStreamException {
throw new RecognitionException("It looks like you're mixing \"active\" and \"static\" modes.",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}
}
pdeProgram
:
// Some programs can be equally well interpreted as STATIC or ACTIVE;
// this forces the parser to prefer the STATIC interpretation.
(staticProgram) => staticProgram
{ pp.setMode(PdePreprocessor.Mode.STATIC); }
| (activeProgram) => activeProgram
{ pp.setMode(PdePreprocessor.Mode.ACTIVE); }
| staticProgram
{ pp.setMode(PdePreprocessor.Mode.STATIC); }
;
// advanced mode is really just a normal java file
javaProgram
: compilationUnit
;
activeProgram
: (
(IDENT LPAREN) => IDENT LPAREN { mixed(); }
| possiblyEmptyField
)+ EOF!
;
staticProgram
: (
statement
)* EOF!
;
// copy of the java.g rule with WEBCOLOR_LITERAL added
constant
: NUM_INT
| CHAR_LITERAL
| STRING_LITERAL
| NUM_FLOAT
| NUM_LONG
| NUM_DOUBLE
| webcolor_literal
;
// fix bug http://dev.processing.org/bugs/show_bug.cgi?id=1519
// by altering a syntactic predicate whose sole purpose is to
// emit a useless error with no line numbers.
// These are from Java15.g, with a few lines edited to make nice errors.
// Type arguments to a class or interface type
typeArguments
{int currentLtLevel = 0;}
:
{currentLtLevel = ltCounter;}
LT! {ltCounter++;}
typeArgument
(options{greedy=true;}: // match as many as possible
{if (! (inputState.guessing !=0 || ltCounter == currentLtLevel + 1)) {
throw new RecognitionException("Maybe too many > characters?",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}}
COMMA! typeArgument
)*
( // turn warning off since Antlr generates the right code,
// plus we have our semantic predicate below
options{generateAmbigWarnings=false;}:
typeArgumentsOrParametersEnd
)?
// make sure we have gobbled up enough '>' characters
// if we are at the "top level" of nested typeArgument productions
{if (! ((currentLtLevel != 0) || ltCounter == currentLtLevel)) {
throw new RecognitionException("Maybe too many > characters?",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}}
{#typeArguments = #(#[TYPE_ARGUMENTS, "TYPE_ARGUMENTS"], #typeArguments);}
;
typeParameters
{int currentLtLevel = 0;}
:
{currentLtLevel = ltCounter;}
LT! {ltCounter++;}
typeParameter (COMMA! typeParameter)*
(typeArgumentsOrParametersEnd)?
// make sure we have gobbled up enough '>' characters
// if we are at the "top level" of nested typeArgument productions
{if (! ((currentLtLevel != 0) || ltCounter == currentLtLevel)) {
throw new RecognitionException("Maybe too many > characters?",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}}
{#typeParameters = #(#[TYPE_PARAMETERS, "TYPE_PARAMETERS"], #typeParameters);}
;
// this gobbles up *some* amount of '>' characters, and counts how many
// it gobbled.
protected typeArgumentsOrParametersEnd
: GT! {ltCounter-=1;}
| SR! {ltCounter-=2;}
| BSR! {ltCounter-=3;}
;
// of the form #cc008f in PDE
webcolor_literal
: w:WEBCOLOR_LITERAL
{ if (! (processing.app.Preferences.getBoolean("preproc.web_colors")
&&
w.getText().length() == 6)) {
throw new RecognitionException("Web colors must be exactly 6 hex digits. This looks like " + w.getText().length() + ".",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}} // must be exactly 6 hex digits
;
// copy of the java.g builtInType rule
builtInConsCastType
: "void"
| "boolean"
| "byte"
| "char"
| "short"
| "int"
| "float"
| "long"
| "double"
;
// our types include the java types and "color". this is separated into two
// rules so that constructor casts can just use the original typelist, since
// we don't want to support the color type as a constructor cast.
//
builtInType
: builtInConsCastType
| "color" // aliased to an int in PDE
{ processing.app.Preferences.getBoolean("preproc.color_datatype") }?
;
// constructor style casts.
constructorCast!
: t:consCastTypeSpec[true]
LPAREN!
e:expression
RPAREN!
// if this is a string literal, make sure the type we're trying to cast
// to is one of the supported ones
//
{ (#e == null) ||
( (#e.getType() != STRING_LITERAL) ||
( #t.getType() == LITERAL_boolean ||
#t.getType() == LITERAL_double ||
#t.getType() == LITERAL_float ||
#t.getType() == LITERAL_int ||
#t.getType() == LITERAL_long ||
#t.getType() == LITERAL_short )) }?
// create the node
//
{#constructorCast = #(#[CONSTRUCTOR_CAST,"CONSTRUCTOR_CAST"], t, e);}
;
// A list of types that be used as the destination type in a constructor-style
// cast. Ideally, this would include all class types, not just "String".
// Unfortunately, it's not possible to tell whether Foo(5) is supposed to be
// a method call or a constructor cast without have a table of all valid
// types or methods, which requires semantic analysis (eg processing of import
// statements). So we accept the set of built-in types plus "String".
//
consCastTypeSpec[boolean addImagNode]
// : stringTypeSpec[addImagNode]
// | builtInConsCastTypeSpec[addImagNode]
: builtInConsCastTypeSpec[addImagNode]
// trying to remove String() cast [fry]
;
//stringTypeSpec[boolean addImagNode]
// : id:IDENT { #id.getText().equals("String") }?
// {
// if ( addImagNode ) {
// #stringTypeSpec = #(#[TYPE,"TYPE"],
// #stringTypeSpec);
// }
// }
// ;
builtInConsCastTypeSpec[boolean addImagNode]
: builtInConsCastType
{
if ( addImagNode ) {
#builtInConsCastTypeSpec = #(#[TYPE,"TYPE"],
#builtInConsCastTypeSpec);
}
}
;
// Since "color" tokens are lexed as LITERAL_color now, we need to have a rule
// that can generate a method call from an expression that starts with this
// token
//
colorMethodCall
: c:"color" {#c.setType(IDENT);} // this would default to LITERAL_color
lp:LPAREN^ {#lp.setType(METHOD_CALL);}
argList
RPAREN!
;
// copy of the java.g rule with added constructorCast and colorMethodCall
// alternatives
primaryExpression
: (consCastTypeSpec[false] LPAREN) => constructorCast
{ processing.app.Preferences.getBoolean("preproc.enhanced_casting") }?
| identPrimary ( options {greedy=true;} : DOT^ "class" )?
| constant
| "true"
| "false"
| "null"
| newExpression
| "this"
| "super"
| LPAREN! assignmentExpression RPAREN!
| colorMethodCall
// look for int.class and int[].class
| builtInType
( lbt:LBRACK^ {#lbt.setType(ARRAY_DECLARATOR);} RBRACK! )*
DOT^ "class"
;
// the below variable rule hacks are needed so that it's possible for the
// emitter to correctly output variable declarations of the form "float a, b"
// from the AST. This means that our AST has a somewhat different form in
// these rules than the java one does, and this new form may have its own
// semantic issues. But it seems to fix the comma declaration issues.
//
variableDefinitions![AST mods, AST t]
: vd:variableDeclarator[getASTFactory().dupTree(mods),
getASTFactory().dupTree(t)]
{#variableDefinitions = #(#[VARIABLE_DEF,"VARIABLE_DEF"], mods,
t, vd);}
;
variableDeclarator[AST mods, AST t]
: ( id:IDENT (lb:LBRACK^ {#lb.setType(ARRAY_DECLARATOR);} RBRACK!)*
v:varInitializer (COMMA!)? )+
;
// java.g builds syntax trees with an inconsistent structure. override one of
// the rules there to fix this.
//
explicitConstructorInvocation!
: (typeArguments)?
t:"this" LPAREN a1:argList RPAREN SEMI
{#explicitConstructorInvocation = #(#[CTOR_CALL, "CTOR_CALL"],
#t, #a1);}
| s:"super" LPAREN a2:argList RPAREN SEMI
{#explicitConstructorInvocation = #(#[SUPER_CTOR_CALL,
"SUPER_CTOR_CALL"],
#s, #a2);}
;
// quick-n-dirty hack to the get the advanced class name. we should
// really be getting it from the AST and not forking this rule from
// the java.g copy at all. Since this is a recursive descent parser, we get
// the last class name in the file so that we don't end up with the classname
// of an inner class. If there is more than one "outer" class in a file,
// this heuristic will fail.
//
classDefinition![AST modifiers]
: "class" i:IDENT
// it _might_ have type paramaters
(tp:typeParameters)?
// it _might_ have a superclass...
sc:superClassClause
// it might implement some interfaces...
ic:implementsClause
// now parse the body of the class
cb:classBlock
{#classDefinition = #(#[CLASS_DEF,"CLASS_DEF"],
modifiers,i,tp,sc,ic,cb);
pp.setAdvClassName(i.getText());}
;
possiblyEmptyField
: classField
| s:SEMI {#s.setType(EMPTY_FIELD);}
;
class PdeLexer extends JavaLexer;
options {
importVocab=PdePartial;
exportVocab=Pde;
}
// We need to preserve whitespace and commentary instead of ignoring
// like the supergrammar does. Otherwise Jikes won't be able to give
// us error messages that point to the equivalent PDE code.
// WS, SL_COMMENT, ML_COMMENT are copies of the original productions,
// but with the SKIP assigment removed.
WS : ( ' '
| '\t'
| '\f'
// handle newlines
| ( options {generateAmbigWarnings=false;}
: "\r\n" // Evil DOS
| '\r' // Macintosh
| '\n' // Unix (the right way)
)
{ newline(); }
)+
;
// Single-line comments
SL_COMMENT
: "//"
(~('\n'|'\r'))* ('\n'|'\r'('\n')?)
{newline();}
;
// multiple-line comments
ML_COMMENT
: "/*"
( /* '\r' '\n' can be matched in one alternative or by matching
'\r' in one iteration and '\n' in another. I am trying to
handle any flavor of newline that comes in, but the language
that allows both "\r\n" and "\r" and "\n" to all be valid
newline is ambiguous. Consequently, the resulting grammar
must be ambiguous. I'm shutting this warning off.
*/
options {
generateAmbigWarnings=false;
}
:
{ LA(2)!='/' }? '*'
| '\r' '\n' {newline();}
| '\r' {newline();}
| '\n' {newline();}
| ~('*'|'\n'|'\r')
)*
"*/"
;
WEBCOLOR_LITERAL
: '#'! (HEX_DIGIT)+
;
/* -*- mode: antlr; c-basic-offset: 4; indent-tabs-mode: nil -*- */
header {
package processing.mode.java.preproc;
}
class PdeRecognizer extends JavaRecognizer;
options {
importVocab = Java;
exportVocab = PdePartial;
//codeGenMakeSwitchThreshold=10; // this is set high for debugging
//codeGenBitsetTestThreshold=10; // this is set high for debugging
// developers may to want to set this to true for better
// debugging messages, however, doing so disables highlighting errors
// in the editor.
defaultErrorHandler = false; //true;
}
tokens {
CONSTRUCTOR_CAST; EMPTY_FIELD;
}
{
// this clause copied from java15.g! ANTLR does not copy this
// section from the super grammar.
/**
* Counts the number of LT seen in the typeArguments production.
* It is used in semantic predicates to ensure we have seen
* enough closing '>' characters; which actually may have been
* either GT, SR or BSR tokens.
*/
private int ltCounter = 0;
private PdePreprocessor pp;
public PdeRecognizer(final PdePreprocessor pp, final TokenStream ts) {
this(ts);
this.pp = pp;
}
private void mixed() throws RecognitionException, TokenStreamException {
throw new RecognitionException("It looks like you're mixing \"active\" and \"static\" modes.",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}
}
pdeProgram
:
// Some programs can be equally well interpreted as STATIC or ACTIVE;
// this forces the parser to prefer the STATIC interpretation.
(staticProgram) => staticProgram
{ pp.setMode(PdePreprocessor.Mode.STATIC); }
| (activeProgram) => activeProgram
{ pp.setMode(PdePreprocessor.Mode.ACTIVE); }
| staticProgram
{ pp.setMode(PdePreprocessor.Mode.STATIC); }
;
// advanced mode is really just a normal java file
javaProgram
: compilationUnit
;
activeProgram
: (
(IDENT LPAREN) => IDENT LPAREN { mixed(); }
| possiblyEmptyField
)+ EOF!
;
staticProgram
: (
statement
)* EOF!
;
// copy of the java.g rule with WEBCOLOR_LITERAL added
constant
: NUM_INT
| CHAR_LITERAL
| STRING_LITERAL
| NUM_FLOAT
| NUM_LONG
| NUM_DOUBLE
| webcolor_literal
;
// fix bug http://dev.processing.org/bugs/show_bug.cgi?id=1519
// by altering a syntactic predicate whose sole purpose is to
// emit a useless error with no line numbers.
// These are from Java15.g, with a few lines edited to make nice errors.
// Type arguments to a class or interface type
typeArguments
{int currentLtLevel = 0;}
:
{currentLtLevel = ltCounter;}
LT! {ltCounter++;}
typeArgument
(options{greedy=true;}: // match as many as possible
{if (! (inputState.guessing !=0 || ltCounter == currentLtLevel + 1)) {
throw new RecognitionException("Maybe too many > characters?",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}}
COMMA! typeArgument
)*
( // turn warning off since Antlr generates the right code,
// plus we have our semantic predicate below
options{generateAmbigWarnings=false;}:
typeArgumentsOrParametersEnd
)?
// make sure we have gobbled up enough '>' characters
// if we are at the "top level" of nested typeArgument productions
{if (! ((currentLtLevel != 0) || ltCounter == currentLtLevel)) {
throw new RecognitionException("Maybe too many > characters?",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}}
{#typeArguments = #(#[TYPE_ARGUMENTS, "TYPE_ARGUMENTS"], #typeArguments);}
;
typeParameters
{int currentLtLevel = 0;}
:
{currentLtLevel = ltCounter;}
LT! {ltCounter++;}
typeParameter (COMMA! typeParameter)*
(typeArgumentsOrParametersEnd)?
// make sure we have gobbled up enough '>' characters
// if we are at the "top level" of nested typeArgument productions
{if (! ((currentLtLevel != 0) || ltCounter == currentLtLevel)) {
throw new RecognitionException("Maybe too many > characters?",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}}
{#typeParameters = #(#[TYPE_PARAMETERS, "TYPE_PARAMETERS"], #typeParameters);}
;
// this gobbles up *some* amount of '>' characters, and counts how many
// it gobbled.
protected typeArgumentsOrParametersEnd
: GT! {ltCounter-=1;}
| SR! {ltCounter-=2;}
| BSR! {ltCounter-=3;}
;
// of the form #cc008f in PDE
webcolor_literal
: w:WEBCOLOR_LITERAL
{ if (! (processing.app.Preferences.getBoolean("preproc.web_colors")
&&
w.getText().length() == 6)) {
throw new RecognitionException("Web colors must be exactly 6 hex digits. This looks like " + w.getText().length() + ".",
getFilename(), LT(1).getLine(), LT(1).getColumn());
}} // must be exactly 6 hex digits
;
// copy of the java.g builtInType rule
builtInConsCastType
: "void"
| "boolean"
| "byte"
| "char"
| "short"
| "int"
| "float"
| "long"
| "double"
;
// our types include the java types and "color". this is separated into two
// rules so that constructor casts can just use the original typelist, since
// we don't want to support the color type as a constructor cast.
//
builtInType
: builtInConsCastType
| "color" // aliased to an int in PDE
{ processing.app.Preferences.getBoolean("preproc.color_datatype") }?
;
// constructor style casts.
constructorCast!
: t:consCastTypeSpec[true]
LPAREN!
e:expression
RPAREN!
// if this is a string literal, make sure the type we're trying to cast
// to is one of the supported ones
//
{ (#e == null) ||
( (#e.getType() != STRING_LITERAL) ||
( #t.getType() == LITERAL_boolean ||
#t.getType() == LITERAL_double ||
#t.getType() == LITERAL_float ||
#t.getType() == LITERAL_int ||
#t.getType() == LITERAL_long ||
#t.getType() == LITERAL_short )) }?
// create the node
//
{#constructorCast = #(#[CONSTRUCTOR_CAST,"CONSTRUCTOR_CAST"], t, e);}
;
// A list of types that be used as the destination type in a constructor-style
// cast. Ideally, this would include all class types, not just "String".
// Unfortunately, it's not possible to tell whether Foo(5) is supposed to be
// a method call or a constructor cast without have a table of all valid
// types or methods, which requires semantic analysis (eg processing of import
// statements). So we accept the set of built-in types plus "String".
//
consCastTypeSpec[boolean addImagNode]
// : stringTypeSpec[addImagNode]
// | builtInConsCastTypeSpec[addImagNode]
: builtInConsCastTypeSpec[addImagNode]
// trying to remove String() cast [fry]
;
//stringTypeSpec[boolean addImagNode]
// : id:IDENT { #id.getText().equals("String") }?
// {
// if ( addImagNode ) {
// #stringTypeSpec = #(#[TYPE,"TYPE"],
// #stringTypeSpec);
// }
// }
// ;
builtInConsCastTypeSpec[boolean addImagNode]
: builtInConsCastType
{
if ( addImagNode ) {
#builtInConsCastTypeSpec = #(#[TYPE,"TYPE"],
#builtInConsCastTypeSpec);
}
}
;
// Since "color" tokens are lexed as LITERAL_color now, we need to have a rule
// that can generate a method call from an expression that starts with this
// token
//
colorMethodCall
: c:"color" {#c.setType(IDENT);} // this would default to LITERAL_color
lp:LPAREN^ {#lp.setType(METHOD_CALL);}
argList
RPAREN!
;
// copy of the java.g rule with added constructorCast and colorMethodCall
// alternatives
primaryExpression
: (consCastTypeSpec[false] LPAREN) => constructorCast
{ processing.app.Preferences.getBoolean("preproc.enhanced_casting") }?
| identPrimary ( options {greedy=true;} : DOT^ "class" )?
| constant
| "true"
| "false"
| "null"
| newExpression
| "this"
| "super"
| LPAREN! assignmentExpression RPAREN!
| colorMethodCall
// look for int.class and int[].class
| builtInType
( lbt:LBRACK^ {#lbt.setType(ARRAY_DECLARATOR);} RBRACK! )*
DOT^ "class"
;
// the below variable rule hacks are needed so that it's possible for the
// emitter to correctly output variable declarations of the form "float a, b"
// from the AST. This means that our AST has a somewhat different form in
// these rules than the java one does, and this new form may have its own
// semantic issues. But it seems to fix the comma declaration issues.
//
variableDefinitions![AST mods, AST t]
: vd:variableDeclarator[getASTFactory().dupTree(mods),
getASTFactory().dupTree(t)]
{#variableDefinitions = #(#[VARIABLE_DEF,"VARIABLE_DEF"], mods,
t, vd);}
;
variableDeclarator[AST mods, AST t]
: ( id:IDENT (lb:LBRACK^ {#lb.setType(ARRAY_DECLARATOR);} RBRACK!)*
v:varInitializer (COMMA!)? )+
;
// java.g builds syntax trees with an inconsistent structure. override one of
// the rules there to fix this.
//
explicitConstructorInvocation!
: (typeArguments)?
t:"this" LPAREN a1:argList RPAREN SEMI
{#explicitConstructorInvocation = #(#[CTOR_CALL, "CTOR_CALL"],
#t, #a1);}
| s:"super" LPAREN a2:argList RPAREN SEMI
{#explicitConstructorInvocation = #(#[SUPER_CTOR_CALL,
"SUPER_CTOR_CALL"],
#s, #a2);}
;
// quick-n-dirty hack to the get the advanced class name. we should
// really be getting it from the AST and not forking this rule from
// the java.g copy at all. Since this is a recursive descent parser, we get
// the last class name in the file so that we don't end up with the classname
// of an inner class. If there is more than one "outer" class in a file,
// this heuristic will fail.
//
classDefinition![AST modifiers]
: "class" i:IDENT
// it _might_ have type paramaters
(tp:typeParameters)?
// it _might_ have a superclass...
sc:superClassClause
// it might implement some interfaces...
ic:implementsClause
// now parse the body of the class
cb:classBlock
{#classDefinition = #(#[CLASS_DEF,"CLASS_DEF"],
modifiers,i,tp,sc,ic,cb);
pp.setAdvClassName(i.getText());}
;
possiblyEmptyField
: classField
| s:SEMI {#s.setType(EMPTY_FIELD);}
;
class PdeLexer extends JavaLexer;
options {
importVocab=PdePartial;
exportVocab=Pde;
}
// We need to preserve whitespace and commentary instead of ignoring
// like the supergrammar does. Otherwise Jikes won't be able to give
// us error messages that point to the equivalent PDE code.
// WS, SL_COMMENT, ML_COMMENT are copies of the original productions,
// but with the SKIP assigment removed.
WS : ( ' '
| '\t'
| '\f'
// handle newlines
| ( options {generateAmbigWarnings=false;}
: "\r\n" // Evil DOS
| '\r' // Macintosh
| '\n' // Unix (the right way)
)
{ newline(); }
)+
;
// Single-line comments
SL_COMMENT
: "//"
(~('\n'|'\r'))* ('\n'|'\r'('\n')?)
{newline();}
;
// multiple-line comments
ML_COMMENT
: "/*"
( /* '\r' '\n' can be matched in one alternative or by matching
'\r' in one iteration and '\n' in another. I am trying to
handle any flavor of newline that comes in, but the language
that allows both "\r\n" and "\r" and "\n" to all be valid
newline is ambiguous. Consequently, the resulting grammar
must be ambiguous. I'm shutting this warning off.
*/
options {
generateAmbigWarnings=false;
}
:
{ LA(2)!='/' }? '*'
| '\r' '\n' {newline();}
| '\r' {newline();}
| '\n' {newline();}
| ~('*'|'\n'|'\r')
)*
"*/"
;
WEBCOLOR_LITERAL
: '#'! (HEX_DIGIT)+
;

View File

@@ -1,29 +1,29 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1064 extends PApplet {
public void setup() {
// import ";
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1064" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1064 extends PApplet {
public void setup() {
// import ";
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1064" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,41 +1,41 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.Collections;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug136 extends PApplet {
java.util.List alist = Collections.synchronizedList(new ArrayList());
public void setup() {
size(400, 200);
alist.add("hello");
}
public void draw() {
rect(width/4, height/4, width/2, height/2);
synchronized(alist) {
alist.get(0);
}
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug136" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.Collections;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug136 extends PApplet {
java.util.List alist = Collections.synchronizedList(new ArrayList());
public void setup() {
size(400, 200);
alist.add("hello");
}
public void draw() {
rect(width/4, height/4, width/2, height/2);
synchronized(alist) {
alist.get(0);
}
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug136" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,29 +1,29 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1362 extends PApplet {
public void setup() {
if (true) {} else { new String(); }
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1362" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1362 extends PApplet {
public void setup() {
if (true) {} else { new String(); }
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1362" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,28 +1,28 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1442 extends PApplet {
public float a() {
return 1.0f;
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1442" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1442 extends PApplet {
public float a() {
return 1.0f;
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1442" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,37 +1,37 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1511 extends PApplet {
public void setup() {
// \u00df
/**
* a
*/
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1511" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1511 extends PApplet {
public void setup() {
// \u00df
/**
* a
*/
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1511" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,29 +1,29 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1512 extends PApplet {
public void setup() {
println("oi/*");
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1512" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1512 extends PApplet {
public void setup() {
println("oi/*");
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1512" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,35 +1,35 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1514a extends PApplet {
public void setup() {
//----- \u00e8\u00e9\u00e9\u00e8\u00e8\u00e9\u00e9\u00e9\u00e0\u00e9\u00e9\u00e8\u00e9''\u00e9\u00e9\u00e9
//----------------------------------------------------------------
//--- IMPORTS
//----------------------------------------------------------------
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1514a" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1514a extends PApplet {
public void setup() {
//----- \u00e8\u00e9\u00e9\u00e8\u00e8\u00e9\u00e9\u00e9\u00e0\u00e9\u00e9\u00e8\u00e9''\u00e9\u00e9\u00e9
//----------------------------------------------------------------
//--- IMPORTS
//----------------------------------------------------------------
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1514a" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,35 +1,35 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1514b extends PApplet {
public void setup() {
//----- \u00e8\u00e9\u00e9\u00e8\u00e8\u00e9\u00e9\u00e9\u00e0\u00e9\u00e9\u00e8\u00e9''\u00e9\u00e9
//----------------------------------------------------------------
//--- IMPORTS
//----------------------------------------------------------------
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1514b" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1514b extends PApplet {
public void setup() {
//----- \u00e8\u00e9\u00e9\u00e8\u00e8\u00e9\u00e9\u00e9\u00e0\u00e9\u00e9\u00e8\u00e9''\u00e9\u00e9
//----------------------------------------------------------------
//--- IMPORTS
//----------------------------------------------------------------
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1514b" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,32 +1,32 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1515 extends PApplet {
// a class definition that does something with things that extend PApplet
class Heythere<T extends PApplet>{
}
// method definition which can do things with papplet
public <T extends PApplet> void doSomething( T thing ){
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1515" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1515 extends PApplet {
// a class definition that does something with things that extend PApplet
class Heythere<T extends PApplet>{
}
// method definition which can do things with papplet
public <T extends PApplet> void doSomething( T thing ){
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1515" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,52 +1,52 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1516 extends PApplet {
public void setup()
{
List<String> list = new ArrayList<String>();
list.add("foo");
list.add("bar");
list.add("baz");
Comparator<String> comparator = new Comparator<String>()
{
public int compare(final String value0, final String value1)
{
return value0.compareTo(value1);
}
};
Collections.sort(list, comparator);
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1516" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1516 extends PApplet {
public void setup()
{
List<String> list = new ArrayList<String>();
list.add("foo");
list.add("bar");
list.add("baz");
Comparator<String> comparator = new Comparator<String>()
{
public int compare(final String value0, final String value1)
{
return value0.compareTo(value1);
}
};
Collections.sort(list, comparator);
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1516" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,52 +1,52 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1517 extends PApplet {
Comparator<String> comparator = new Comparator<String>()
{
public int compare(final String value0, final String value1)
{
return value0.compareTo(value1);
}
};
public void setup()
{
List<String> list = new ArrayList<String>();
list.add("foo");
list.add("bar");
list.add("baz");
Collections.sort(list, comparator);
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1517" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1517 extends PApplet {
Comparator<String> comparator = new Comparator<String>()
{
public int compare(final String value0, final String value1)
{
return value0.compareTo(value1);
}
};
public void setup()
{
List<String> list = new ArrayList<String>();
list.add("foo");
list.add("bar");
list.add("baz");
Collections.sort(list, comparator);
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1517" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,45 +1,45 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1518a extends PApplet {
public void setup()
{
List<String> list = new ArrayList<String>();
list.add("foo");
list.add("bar");
list.add("baz");
binarySearch(list, "bar");
}
static <T> int binarySearch(List<? extends Comparable<? super T>> list, T
key) {
return 0;
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1518a" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1518a extends PApplet {
public void setup()
{
List<String> list = new ArrayList<String>();
list.add("foo");
list.add("bar");
list.add("baz");
binarySearch(list, "bar");
}
static <T> int binarySearch(List<? extends Comparable<? super T>> list, T
key) {
return 0;
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1518a" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,43 +1,43 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1518b extends PApplet {
public void setup()
{
List<String> list = new ArrayList<String>();
list.add("foo");
list.add("bar");
list.add("baz");
}
static <T> int binarySearch(List<? extends Comparable<? super T>> list, T
key) {
return 0;
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1518b" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug1518b extends PApplet {
public void setup()
{
List<String> list = new ArrayList<String>();
list.add("foo");
list.add("bar");
list.add("baz");
}
static <T> int binarySearch(List<? extends Comparable<? super T>> list, T
key) {
return 0;
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug1518b" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,32 +1,32 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug281 extends PApplet {
public void setup() {
if ( "monopoly".charAt( 3 ) == '(' )
{
println("parcheesi");
}
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug281" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug281 extends PApplet {
public void setup() {
if ( "monopoly".charAt( 3 ) == '(' )
{
println("parcheesi");
}
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug281" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,32 +1,32 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.applet.Applet;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug481 extends PApplet {
public void setup() {
Class[] abc = new Class[]{Applet.class};
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug481" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.applet.Applet;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug481 extends PApplet {
public void setup() {
Class[] abc = new Class[]{Applet.class};
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug481" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,70 +1,70 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import static java.lang.Math.tanh;
import java.util.concurrent.Callable;
import java.util.List;
import java.util.Comparator;
import java.util.Map;
import java.util.Collection;
import java.util.Arrays;
import java.util.HashSet;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug598 extends PApplet {
// java 5 torture test
private static Comparator<String> rotarapmoc = new Comparator<String>() {
public int compare(final String o1, final String o2)
{
return o1.charAt(o1.length() - 1) - o2.charAt(o2.length() - 1);
}
};
final <T> void printClass(T t) {
println(t.getClass());
}
public final List<String> sortem(final String... strings) {
Arrays.sort(strings, rotarapmoc);
return Arrays.asList(strings);
}
final Map<String, Collection<Integer>>
charlesDeGaulle = new HashMap<String, Collection<Integer>>();
public void setup() {
charlesDeGaulle.put("banana", new HashSet<Integer>());
charlesDeGaulle.get("banana").add(0);
System.out.println(sortem("aztec", "maya", "spanish", "portuguese"));
printClass(12.d);
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug598" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import static java.lang.Math.tanh;
import java.util.concurrent.Callable;
import java.util.List;
import java.util.Comparator;
import java.util.Map;
import java.util.Collection;
import java.util.Arrays;
import java.util.HashSet;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug598 extends PApplet {
// java 5 torture test
private static Comparator<String> rotarapmoc = new Comparator<String>() {
public int compare(final String o1, final String o2)
{
return o1.charAt(o1.length() - 1) - o2.charAt(o2.length() - 1);
}
};
final <T> void printClass(T t) {
println(t.getClass());
}
public final List<String> sortem(final String... strings) {
Arrays.sort(strings, rotarapmoc);
return Arrays.asList(strings);
}
final Map<String, Collection<Integer>>
charlesDeGaulle = new HashMap<String, Collection<Integer>>();
public void setup() {
charlesDeGaulle.put("banana", new HashSet<Integer>());
charlesDeGaulle.get("banana").add(0);
System.out.println(sortem("aztec", "maya", "spanish", "portuguese"));
printClass(12.d);
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug598" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,30 +1,30 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug5a extends PApplet {
public void setup() {
println("The next line should not cause a failure.");
// no newline after me
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug5a" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug5a extends PApplet {
public void setup() {
println("The next line should not cause a failure.");
// no newline after me
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug5a" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,30 +1,30 @@
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug5b extends PApplet {
public void setup() {
println("The next line should not cause a failure.");
/* no newline after me */
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug5b" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
public class bug5b extends PApplet {
public void setup() {
println("The next line should not cause a failure.");
/* no newline after me */
noLoop();
}
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "bug5b" };
if (passedArgs != null) {
PApplet.main(concat(appletArgs, passedArgs));
} else {
PApplet.main(appletArgs);
}
}
}

View File

@@ -1,2 +1,2 @@
[InternetShortcut]
URL=https://github.com/kritzikratzi/jAppleMenuBar
[InternetShortcut]
URL=https://github.com/kritzikratzi/jAppleMenuBar

View File

@@ -1,93 +1,93 @@
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@@ -1,3 +1,3 @@
@echo off
@echo off
.\java\bin\java -cp lib/pde.jar;core/library/core.jar;lib/jna.jar;lib/antlr.jar;lib/ant.jar;lib/ant-launcher.jar;lib/org-netbeans-swing-outline.jar;lib/com.ibm.icu_4.4.2.v20110823.jar;lib/jdi.jar;lib/jdimodel.jar;lib/org.eclipse.osgi_3.8.1.v20120830-144521.jar processing.app.Base

View File

@@ -1,12 +1,12 @@
#Sat Nov 12 10:56:00 CST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
#Sat Nov 12 10:56:00 CST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View File

@@ -1,12 +1,12 @@
#Sat Nov 12 10:56:44 CST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
#Sat Nov 12 10:56:44 CST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6