Applying some Mac build / project patches by Wim Lewis. Simplifying Compiler.java. Removing the preprocessor since it's not actually used for anything. Bumping the version number to 0011.

This commit is contained in:
David A. Mellis 2008-01-19 16:37:19 +00:00
parent bd56d4ff28
commit 3c43daaca8
39 changed files with 176 additions and 40147 deletions

View File

@ -54,7 +54,7 @@ import processing.core.*;
*/
public class Base {
static final int VERSION = 10;
static final String VERSION_NAME = "0010 Alpha";
static final String VERSION_NAME = "0011 Alpha";
/**
* Path of filename opened on the command line,
@ -172,7 +172,7 @@ public class Base {
/**
* returns true if the Arduino is running on a Mac OS machine,
* specifically a Mac OS X machine because it doesn't un on OS 9 anymore.
* specifically a Mac OS X machine because it doesn't run on OS 9 anymore.
*/
static public boolean isMacOS() {
return PApplet.platform == PConstants.MACOSX;
@ -877,18 +877,20 @@ public class Base {
static public String getContents(String what) {
String basePath = System.getProperty("user.dir");
/*
// do this later, when moving to .app package
if (PApplet.platform == PConstants.MACOSX) {
basePath = System.getProperty("processing.contents");
}
*/
return basePath + File.separator + what;
}
static public String getLibContents(String what) {
return getContents("lib" + File.separator + what);
/* On MacOSX, the arduino.app-resources property points to the
* resources directory inside the app bundle. On other platforms
* it's not set.
*/
String appResources = System.getProperty("arduino.app-resources");
if (appResources != null) {
return appResources + File.separator + what;
} else {
return getContents("lib" + File.separator + what);
}
}

View File

@ -85,7 +85,7 @@ public class Compiler implements MessageConsumer {
// } catch (IOException e) {
// throw new RunnerException(e.getMessage());
// }
String avrBasePath;
String avrBasePath;
if(Base.isMacOS()) {
avrBasePath = new String("hardware/tools/avr/bin/");
}
@ -97,7 +97,7 @@ public class Compiler implements MessageConsumer {
}
String preCommandCompiler[] = new String[] {
List baseCommandCompiler = new ArrayList(Arrays.asList(new String[] {
avrBasePath + "avr-gcc",
"-c", // compile, don't link
"-g", // include debugging info (so errors include line numbers)
@ -106,23 +106,14 @@ public class Compiler implements MessageConsumer {
"-w", // surpress all warnings
"-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"),
"-DF_CPU=" + Preferences.get("boards." + Preferences.get("board") + ".build.f_cpu"),
};
}));
// use lib directories as include paths
//String[] libDirs = libraryManager.getFolderPaths();
String[] libDirs = new String[sketch.importedLibraries.size()];
for (int i = 0; i < sketch.importedLibraries.size(); i++)
libDirs[i] = ((Library) sketch.importedLibraries.get(i)).getFolder().getPath();
// Last two arguments will specify the file being compiled and the output file.
String[] baseCommandCompiler = new String[preCommandCompiler.length + libDirs.length + 2];
System.arraycopy(preCommandCompiler, 0, baseCommandCompiler, 0, preCommandCompiler.length);
for (int i = 0; i < libDirs.length; ++i) {
baseCommandCompiler[preCommandCompiler.length + i] = "-I" + libDirs[i];
for (int i = 0; i < sketch.importedLibraries.size(); i++) {
baseCommandCompiler.add("-I" + ((Library) sketch.importedLibraries.get(i)).getFolder().getPath());
}
String preCommandCompilerCPP[] = new String[] {
List baseCommandCompilerCPP = new ArrayList(Arrays.asList(new String[] {
avrBasePath + "avr-g++",
"-c", // compile, don't link
"-g", // include debugging info (so errors include line numbers)
@ -132,196 +123,83 @@ public class Compiler implements MessageConsumer {
"-fno-exceptions",
"-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"),
"-DF_CPU=" + Preferences.get("boards." + Preferences.get("board") + ".build.f_cpu"),
};
}));
// use lib directories as include paths
// Last two arguments will specify the file being compiled and the output file.
String[] baseCommandCompilerCPP = new String[preCommandCompilerCPP.length + libDirs.length + 2];
System.arraycopy(preCommandCompilerCPP, 0, baseCommandCompilerCPP, 0, preCommandCompilerCPP.length);
for (int i = 0; i < libDirs.length; ++i) {
baseCommandCompilerCPP[preCommandCompilerCPP.length + i] = "-I" + libDirs[i];
for (int i = 0; i < sketch.importedLibraries.size(); ++i) {
baseCommandCompilerCPP.add("-I" + ((Library) sketch.importedLibraries.get(i)).getFolder().getPath());
}
String preCommandLinker[] = new String[] {
List baseCommandLinker = new ArrayList(Arrays.asList(new String[] {
avrBasePath + "avr-gcc",
" ",
"-Os",
"-mmcu=" + Preferences.get("boards." + Preferences.get("board") + ".build.mcu"),
"-o",
" ",
};
((!Base.isMacOS()) ? buildPath : buildPath) + File.separator + sketch.name + ".elf"
}));
String runtimeLibraryName = buildPath + File.separator + "core.a";
String baseCommandAR[] = new String[] {
List baseCommandAR = new ArrayList(Arrays.asList(new String[] {
avrBasePath + "avr-ar",
"rcs",
runtimeLibraryName,
" "
};
runtimeLibraryName
}));
// use lib object files during include
//String[] libObjectFiles = libraryManager.getObjectFiles();
Vector libObjectFilesVec = new Vector();
// use lib object files
for (Iterator i = sketch.importedLibraries.iterator(); i.hasNext(); ) {
Library library = (Library) i.next();
File[] objectFiles = library.getObjectFiles();
for (int j = 0; j < objectFiles.length; j++)
libObjectFilesVec.add(objectFiles[j].getPath());
baseCommandLinker.add(objectFiles[j].getPath());
}
String[] libObjectFiles = new String[libObjectFilesVec.size()];
libObjectFiles = (String[]) libObjectFilesVec.toArray(libObjectFiles);
String[] baseCommandLinker = new String[preCommandLinker.length + libObjectFiles.length];
System.arraycopy(preCommandLinker, 0, baseCommandLinker, 0, preCommandLinker.length);
for (int i = 0; i < libObjectFiles.length; ++i) {
baseCommandLinker[preCommandLinker.length + i] = libObjectFiles[i];
}
String baseCommandObjcopy[] = new String[] {
List baseCommandObjcopy = new ArrayList(Arrays.asList(new String[] {
avrBasePath + "avr-objcopy",
"-O",
" ",
"-R",
" ",
" ",
" "
};
/*String baseCommand[] = new String[] {
// user.dir is folder containing P5 (and therefore jikes)
// macosx needs the extra path info. linux doesn't like it, though
// windows doesn't seem to care. write once, headache anywhere.
((!Base.isMacOS()) ? "jikes" :
System.getProperty("user.dir") + File.separator + "jikes"),
// this doesn't help much.. also java 1.4 seems to not support
// -source 1.1 for javac, and jikes seems to also have dropped it.
// for versions of jikes that don't complain, "final int" inside
// a function doesn't throw an error, so it could just be a
// ms jvm error that this sort of thing doesn't work. blech.
//"-source",
//"1.1",
// necessary to make output classes compatible with 1.1
// i.e. so that exported applets can work with ms jvm on the web
"-target",
Preferences.get("preproc.jdk_version"), //"1.1",
// let the incompatability headache begin
// used when run without a vm ("expert" mode)
"-bootclasspath",
calcBootClassPath(),
// needed for macosx so that the classpath is set properly
// also for windows because qtjava will most likely be here
// and for linux, it just doesn't hurt
"-classpath",
sketch.classPath, //calcClassPath(includeFolder),
"-nowarn", // we're not currently interested in warnings
"+E", // output errors in machine-parsable format
"-d", buildPath // output the classes in the buildPath
//buildPath + File.separator + className + ".java" // file to compile
};*/
}));
// make list of code files that need to be compiled and the object files
// that they will be compiled to (includes code from the sketch and the
// library for the target platform)
String sourceNames[] = new String[sketch.codeCount + target.getSourceFilenames().size()];
String sourceNamesCPP[] = new String[sketch.codeCount + target.getSourceFilenames().size()];
String objectNames[] = new String[sketch.codeCount + target.getSourceFilenames().size()];
String objectNamesCPP[] = new String[sketch.codeCount + target.getSourceFilenames().size()];
String targetObjectNames[] = new String[target.getSourceFilenames().size()];
String sketchObjectNames[] = new String[sketch.codeCount];
int fileCount = 0;
int fileCountCPP = 0;
int targetCount = 0;
int sketchCount = 0;
List sourceNames = new ArrayList();
List sourceNamesCPP = new ArrayList();
List objectNames = new ArrayList();
List objectNamesCPP = new ArrayList();
List targetObjectNames = new ArrayList();
List sketchObjectNames = new ArrayList();
for (int i = 0; i < sketch.codeCount; i++) {
if (sketch.code[i].preprocName != null) {
if (sketch.code[i].preprocName.endsWith(".c")) {
sourceNames[fileCount] = buildPath + File.separator + sketch.code[i].preprocName;
objectNames[fileCount++] = buildPath + File.separator + sketch.code[i].preprocName + ".o";
sketchObjectNames[sketchCount++] = buildPath + File.separator + sketch.code[i].preprocName + ".o";
sourceNames.add(buildPath + File.separator + sketch.code[i].preprocName);
objectNames.add(buildPath + File.separator + sketch.code[i].preprocName + ".o");
sketchObjectNames.add(buildPath + File.separator + sketch.code[i].preprocName + ".o");
} else if (sketch.code[i].preprocName.endsWith(".cpp")) {
sourceNamesCPP[fileCountCPP] = buildPath + File.separator + sketch.code[i].preprocName;
objectNamesCPP[fileCountCPP++] = buildPath + File.separator + sketch.code[i].preprocName + ".o";
sketchObjectNames[sketchCount++] = buildPath + File.separator + sketch.code[i].preprocName + ".o";
sourceNamesCPP.add(buildPath + File.separator + sketch.code[i].preprocName);
objectNamesCPP.add(buildPath + File.separator + sketch.code[i].preprocName + ".o");
sketchObjectNames.add(buildPath + File.separator + sketch.code[i].preprocName + ".o");
}
}
}
for (Iterator iter = target.getSourceFilenames().iterator(); iter.hasNext(); ) {
String filename = (String) iter.next();
if (filename != null) {
targetObjectNames[targetCount++] = buildPath + File.separator + filename + ".o";
targetObjectNames.add(buildPath + File.separator + filename + ".o");
if (filename.endsWith(".c")) {
sourceNames[fileCount] = target.getPath() + File.separator + filename;
objectNames[fileCount++] = buildPath + File.separator + filename + ".o";
sourceNames.add(target.getPath() + File.separator + filename);
objectNames.add(buildPath + File.separator + filename + ".o");
} else if (filename.endsWith(".cpp")) {
sourceNamesCPP[fileCountCPP] = target.getPath() + File.separator + filename;
objectNamesCPP[fileCountCPP++] = buildPath + File.separator + filename + ".o";
sourceNamesCPP.add(target.getPath() + File.separator + filename);
objectNamesCPP.add(buildPath + File.separator + filename + ".o");
}
}
}
/*
String commandCompiler[] = new String[baseCommandCompiler.length + preprocCount];
System.arraycopy(baseCommandCompiler, 0, commandCompiler, 0, baseCommandCompiler.length);
// append each of the files to the command string
for (int i = 0; i < preprocCount; i++) {
commandCompiler[baseCommandCompiler.length + i] =
buildPath + File.separator + preprocNames[i];
}
String commandCompilerCPP[] = new String[baseCommandCompilerCPP.length + preprocCountCPP];
System.arraycopy(baseCommandCompilerCPP, 0, commandCompilerCPP, 0, baseCommandCompilerCPP.length);
for (int i = 0; i < preprocCountCPP; i++) {
commandCompilerCPP[baseCommandCompilerCPP.length + i] =
buildPath + File.separator + preprocNamesCPP[i];
}
*/
//PApplet.printarr(command);
baseCommandLinker[1] = "-Os";
baseCommandLinker[4] = ((!Base.isMacOS()) ? buildPath
: buildPath) + File.separator + sketch.name + ".elf";
String commandLinker[] = new String[baseCommandLinker.length + sketchCount + 3];
System.arraycopy(baseCommandLinker, 0, commandLinker, 0, baseCommandLinker.length);
int idx = 0;
for(int i = 0; i < sketchCount; i++, idx++) {
commandLinker[baseCommandLinker.length + idx] = sketchObjectNames[i];
}
commandLinker[baseCommandLinker.length + idx++] = runtimeLibraryName;
commandLinker[baseCommandLinker.length + idx++] = "-L" + buildPath;
commandLinker[baseCommandLinker.length + idx] = "-lm";
/*String command[] = new String[baseCommand.length + preprocCount];
System.arraycopy(baseCommand, 0, command, 0, baseCommand.length);
// append each of the files to the command string
for (int i = 0; i < preprocCount; i++) {
command[baseCommand.length + i] =
buildPath + File.separator + preprocNames[i];
}
//PApplet.printarr(command);
*/
/*
String command[] = new String[baseCommand.length + sketch.codeCount];
System.arraycopy(baseCommand, 0, command, 0, baseCommand.length);
// append each of the files to the command string
for (int i = 0; i < sketch.codeCount; i++) {
command[baseCommand.length + i] =
buildPath + File.separator + sketch.code[i].preprocName;
}
*/
//for (int i = 0; i < command.length; i++) {
//System.out.println("cmd " + i + " " + command[i]);
//}
baseCommandLinker.addAll(sketchObjectNames);
baseCommandLinker.add(runtimeLibraryName);
baseCommandLinker.add("-L" + buildPath);
baseCommandLinker.add("-lm");
firstErrorFound = false; // haven't found any errors yet
secondErrorFound = false;
@ -334,48 +212,48 @@ public class Compiler implements MessageConsumer {
Process process;
boolean compiling = true;
for(int i = 0; i < fileCount; i++) {
baseCommandCompiler[baseCommandCompiler.length - 2] = sourceNames[i];
baseCommandCompiler[baseCommandCompiler.length - 1] = "-o"+ objectNames[i];
//System.arraycopy(baseCommandCompiler.length
result = execAsynchronously(baseCommandCompiler);
if (result!=0)
for(int i = 0; i < sourceNames.size(); i++) {
List commandCompiler = new ArrayList(baseCommandCompiler);
commandCompiler.add(sourceNames.get(i));
commandCompiler.add("-o"+ objectNames.get(i));
if (execAsynchronously(commandCompiler) != 0)
return false;
}
for(int i = 0; i < fileCountCPP; i++) {
baseCommandCompilerCPP[baseCommandCompilerCPP.length - 2] = sourceNamesCPP[i];
baseCommandCompilerCPP[baseCommandCompilerCPP.length - 1] = "-o"+ objectNamesCPP[i];
result = execAsynchronously(baseCommandCompilerCPP);
if (result!=0)
for(int i = 0; i < sourceNamesCPP.size(); i++) {
List commandCompilerCPP = new ArrayList(baseCommandCompilerCPP);
commandCompilerCPP.add(sourceNamesCPP.get(i));
commandCompilerCPP.add("-o"+ objectNamesCPP.get(i));
if (execAsynchronously(commandCompilerCPP) != 0)
return false;
}
for(int i = 0; i < targetCount; i++) {
baseCommandAR[baseCommandAR.length - 1] = targetObjectNames[i];
result = execAsynchronously(baseCommandAR);
if(result!=0)
for(int i = 0; i < targetObjectNames.size(); i++) {
List commandAR = new ArrayList(baseCommandAR);
commandAR.add(targetObjectNames.get(i));
if (execAsynchronously(commandAR) != 0)
return false;
}
result = execAsynchronously(commandLinker);
if (result!=0)
if (execAsynchronously(baseCommandLinker) != 0)
return false;
baseCommandObjcopy[2] = "srec";
baseCommandObjcopy[4] = ".eeprom";
baseCommandObjcopy[5] = buildPath + File.separator + sketch.name + ".elf";
baseCommandObjcopy[6] = buildPath + File.separator + sketch.name + ".rom";
result = execAsynchronously(baseCommandObjcopy);
if (result!=0)
List commandObjcopy;
commandObjcopy = new ArrayList(baseCommandObjcopy);
commandObjcopy.add(2, "srec");
commandObjcopy.add(".eeprom");
commandObjcopy.add(buildPath + File.separator + sketch.name + ".elf");
commandObjcopy.add(buildPath + File.separator + sketch.name + ".rom");
if (execAsynchronously(commandObjcopy) != 0)
return false;
baseCommandObjcopy[2] = "ihex";
baseCommandObjcopy[4] = ".flash";
baseCommandObjcopy[5] = buildPath + File.separator + sketch.name + ".elf";
baseCommandObjcopy[6] = buildPath + File.separator + sketch.name + ".hex";
result = execAsynchronously(baseCommandObjcopy);
if (result!=0)
commandObjcopy = new ArrayList(baseCommandObjcopy);
commandObjcopy.add(2, "ihex");
commandObjcopy.add(".flash");
commandObjcopy.add(buildPath + File.separator + sketch.name + ".elf");
commandObjcopy.add(buildPath + File.separator + sketch.name + ".hex");
if (execAsynchronously(commandObjcopy) != 0)
return false;
} catch (Exception e) {
String msg = e.getMessage();
@ -383,8 +261,7 @@ public class Compiler implements MessageConsumer {
//System.err.println("jikes is missing");
Base.showWarning("Compiler error",
"Could not find the compiler.\n" +
"avr-gcc is missing from your PATH,\n" +
"see readme.txt for help.", null);
"avr-gcc is missing from your PATH.", null);
return false;
} else {
@ -415,8 +292,10 @@ public class Compiler implements MessageConsumer {
return (result == 0); // ? true : false;
}
public int execAsynchronously(String[] command)
public int execAsynchronously(List commandList)
throws RunnerException, IOException {
String[] command = new String[commandList.size()];
commandList.toArray(command);
int result = 0;
if (Preferences.getBoolean("build.verbose")) {

View File

@ -838,7 +838,7 @@ public class Editor extends JFrame
}
JCheckBoxMenuItem item = (JCheckBoxMenuItem)e.getSource();
item.setState(true);
String name = item.getLabel();
String name = item.getText();
//System.out.println(item.getLabel());
Preferences.set("serial.port", name);
//System.out.println("set to " + get("serial.port"));

View File

@ -155,7 +155,7 @@ public class EditorButtons extends JComponent implements MouseInputListener {
setState(i, INACTIVE, false);
}
}
Dimension size = size();
Dimension size = getSize();
if ((offscreen == null) ||
(size.width != width) || (size.height != height)) {
offscreen = createImage(size.width, size.height);

View File

@ -82,17 +82,16 @@ public class UpdateCheck implements Runnable {
Preferences.set("update.id", String.valueOf(id));
}
String info =
URLEncoder.encode(id + "\t" +
String info = id + "\t" +
Base.VERSION+ "\t" +
System.getProperty("java.version") + "\t" +
System.getProperty("java.vendor") + "\t" +
System.getProperty("os.name") + "\t" +
System.getProperty("os.version") + "\t" +
System.getProperty("os.arch"));
System.getProperty("os.arch");
try {
int latest = readInt(downloadURL + "?" + info);
int latest = readInt(downloadURL + "?" + URLEncoder.encode(info, "UTF-8"));
String lastString = Preferences.get("update.last");
long now = System.currentTimeMillis();

View File

@ -1,133 +0,0 @@
package processing.app.preproc;
import java.util.Vector;
import java.util.Hashtable;
import java.util.Enumeration;
public class CSymbolTable {
/** holds list of scopes */
private Vector scopeStack;
/** table where all defined names are mapped to TNode tree nodes */
private Hashtable symTable;
public CSymbolTable() {
scopeStack = new Vector(10);
symTable = new Hashtable(533);
}
/** push a new scope onto the scope stack.
*/
public void pushScope(String s) {
//System.out.println("push scope:" + s);
scopeStack.addElement(s);
}
/** pop the last scope off the scope stack.
*/
public void popScope() {
//System.out.println("pop scope");
int size = scopeStack.size();
if(size > 0)
scopeStack.removeElementAt(size - 1);
}
/** return the current scope as a string
*/
public String currentScopeAsString() {
StringBuffer buf = new StringBuffer(100);
boolean first = true;
Enumeration e = scopeStack.elements();
while(e.hasMoreElements()) {
if(first)
first = false;
else
buf.append("::");
buf.append(e.nextElement().toString());
}
return buf.toString();
}
/** given a name for a type, append it with the
current scope.
*/
public String addCurrentScopeToName(String name) {
String currScope = currentScopeAsString();
return addScopeToName(currScope, name);
}
/** given a name for a type, append it with the
given scope. MBZ
*/
public String addScopeToName(String scope, String name) {
if(scope == null || scope.length() > 0)
return scope + "::" + name;
else
return name;
}
/** remove one level of scope from name MBZ*/
public String removeOneLevelScope(String scopeName) {
int index = scopeName.lastIndexOf("::");
if (index > 0) {
return scopeName.substring(0,index);
}
if (scopeName.length() > 0) {
return "";
}
return null;
}
/** add a node to the table with it's key as
the current scope and the name */
public TNode add(String name, TNode node) {
return (TNode)symTable.put(addCurrentScopeToName(name),node);
}
/** lookup a fully scoped name in the symbol table */
public TNode lookupScopedName(String scopedName) {
return (TNode)symTable.get(scopedName);
}
/** lookup an unscoped name in the table by prepending
the current scope.
MBZ -- if not found, pop scopes and look again
*/
public TNode lookupNameInCurrentScope(String name) {
String scope = currentScopeAsString();
String scopedName;
TNode tnode = null;
//System.out.println( "\n"+ this.toString() );
while (tnode == null && scope != null) {
scopedName = addScopeToName(scope, name);
//System.out.println("lookup trying " + scopedName);
tnode = (TNode)symTable.get(scopedName);
scope = removeOneLevelScope(scope);
}
return tnode;
}
/** convert this table to a string */
public String toString() {
StringBuffer buff = new StringBuffer(300);
buff.append("CSymbolTable { \nCurrentScope: " + currentScopeAsString() +
"\nDefinedSymbols:\n");
Enumeration ke = symTable.keys();
Enumeration ve = symTable.elements();
while(ke.hasMoreElements()) {
buff.append(ke.nextElement().toString() + " (" +
TNode.getNameForType(((TNode)ve.nextElement()).getType()) + ")\n");
}
buff.append("}\n");
return buff.toString();
}
};

View File

@ -1,32 +0,0 @@
package processing.app.preproc;
import antlr.CommonToken;
public class CToken extends antlr.CommonToken {
String source = "";
int tokenNumber;
public String getSource()
{
return source;
}
public void setSource(String src)
{
source = src;
}
public int getTokenNumber()
{
return tokenNumber;
}
public void setTokenNumber(int i)
{
tokenNumber = i;
}
public String toString() {
return "CToken:" +"(" + hashCode() + ")" + "[" + getType() + "] "+ getText() + " line:" + getLine() + " source:" + source ;
}
}

View File

@ -1,132 +0,0 @@
package antlr;
/* ANTLR Translator Generator
* Project led by Terence Parr at http://www.jGuru.com
* Software rights: http://www.antlr.org/RIGHTS.html
*
* $Id$
*/
import java.io.*;
import antlr.*;
import antlr.collections.*;
import antlr.collections.impl.*;
/** A CommonAST whose initialization copies hidden token
* information from the Token used to create a node.
*/
public class ExtendedCommonASTWithHiddenTokens
extends CommonASTWithHiddenTokens {
public ExtendedCommonASTWithHiddenTokens() {
super();
}
public ExtendedCommonASTWithHiddenTokens(Token tok) {
super(tok);
}
public void initialize(AST ast) {
ExtendedCommonASTWithHiddenTokens a =
(ExtendedCommonASTWithHiddenTokens)ast;
super.initialize(a);
hiddenBefore = a.getHiddenBefore();
hiddenAfter = a.getHiddenAfter();
}
public String getHiddenAfterString() {
CommonHiddenStreamToken t;
StringBuffer hiddenAfterString = new StringBuffer(100);
for ( t = hiddenAfter ; t != null ; t = t.getHiddenAfter() ) {
hiddenAfterString.append(t.getText());
}
return hiddenAfterString.toString();
}
public String getHiddenBeforeString() {
antlr.CommonHiddenStreamToken
child = null,
parent = hiddenBefore;
// if there aren't any hidden tokens here, quietly return
//
if (parent == null) {
return "";
}
// traverse back to the head of the list of tokens before this node
do {
child = parent;
parent = child.getHiddenBefore();
} while (parent != null);
// dump that list
StringBuffer hiddenBeforeString = new StringBuffer(100);
for ( CommonHiddenStreamToken t = child; t != null ;
t = t.getHiddenAfter() ) {
hiddenBeforeString.append(t.getText());
}
return hiddenBeforeString.toString();
}
public void xmlSerializeNode(Writer out)
throws IOException {
StringBuffer buf = new StringBuffer(100);
buf.append("<");
buf.append(getClass().getName() + " ");
buf.append("hiddenBeforeString=\"" +
encode(getHiddenBeforeString()) +
"\" text=\"" + encode(getText()) + "\" type=\"" +
getType() + "\" hiddenAfterString=\"" +
encode(getHiddenAfterString()) + "\"/>");
out.write(buf.toString());
}
public void xmlSerializeRootOpen(Writer out)
throws IOException {
StringBuffer buf = new StringBuffer(100);
buf.append("<");
buf.append(getClass().getName() + " ");
buf.append("hiddenBeforeString=\"" +
encode(getHiddenBeforeString()) +
"\" text=\"" + encode(getText()) + "\" type=\"" +
getType() + "\" hiddenAfterString=\"" +
encode(getHiddenAfterString()) + "\">\n");
out.write(buf.toString());
}
public void xmlSerializeRootClose(Writer out)
throws IOException {
out.write("</" + getClass().getName() + ">\n");
}
public void xmlSerialize(Writer out) throws IOException {
// print out this node and all siblings
for (AST node = this;
node != null;
node = node.getNextSibling()) {
if (node.getFirstChild() == null) {
// print guts (class name, attributes)
((BaseAST)node).xmlSerializeNode(out);
}
else {
((BaseAST)node).xmlSerializeRootOpen(out);
// print children
((BaseAST)node.getFirstChild()).xmlSerialize(out);
// print end tag
((BaseAST)node).xmlSerializeRootClose(out);
}
}
}
}

View File

@ -1,126 +0,0 @@
package processing.app.preproc;
class LineObject {
LineObject parent = null;
String source = "";
int line = 1;
boolean enteringFile = false;
boolean returningToFile = false;
boolean systemHeader = false;
boolean treatAsC = false;
public LineObject()
{
super();
}
public LineObject( LineObject lobj )
{
parent = lobj.getParent();
source = lobj.getSource();
line = lobj.getLine();
enteringFile = lobj.getEnteringFile();
returningToFile = lobj.getReturningToFile();
systemHeader = lobj.getSystemHeader();
treatAsC = lobj.getTreatAsC();
}
public LineObject( String src)
{
source = src;
}
public void setSource(String src)
{
source = src;
}
public String getSource()
{
return source;
}
public void setParent(LineObject par)
{
parent = par;
}
public LineObject getParent()
{
return parent;
}
public void setLine(int l)
{
line = l;
}
public int getLine()
{
return line;
}
public void newline()
{
line++;
}
public void setEnteringFile(boolean v)
{
enteringFile = v;
}
public boolean getEnteringFile()
{
return enteringFile;
}
public void setReturningToFile(boolean v)
{
returningToFile = v;
}
public boolean getReturningToFile()
{
return returningToFile;
}
public void setSystemHeader(boolean v)
{
systemHeader = v;
}
public boolean getSystemHeader()
{
return systemHeader;
}
public void setTreatAsC(boolean v)
{
treatAsC = v;
}
public boolean getTreatAsC()
{
return treatAsC;
}
public String toString() {
StringBuffer ret;
ret = new StringBuffer("# " + line + " \"" + source + "\"");
if (enteringFile) {
ret.append(" 1");
}
if (returningToFile) {
ret.append(" 2");
}
if (systemHeader) {
ret.append(" 3");
}
if (treatAsC) {
ret.append(" 4");
}
return ret.toString();
}
}

View File

@ -1,36 +0,0 @@
classfiles = LineObject.class PreprocessorInfoChannel.class StdCParser.class StdCLexer.class WParser.class WLexer.class WTreeParser.class WEmitter.class
javafiles = CSymbolTable.java TNode.java TNodeFactory.java CToken.java LineObject.java PreprocessorInfoChannel.java StdCParser.java StdCLexer.java WParser.java WLexer.java WTreeParser.java WEmitter.java
all : $(javafiles) $(classfiles)
clean :
StdCParser.java StdCLexer.java : StdCParser.g
java -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool StdCParser.g
WParser.java WLexer.java : WParser.g WParser.g
java -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool -glib "StdCParser.g" WParser.g
WTreeParser.java : WTreeParser.g
java -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool WTreeParser.g
WEmitter.java : WEmitter.g WTreeParser.g
java -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool -glib "WTreeParser.g" WEmitter.g
.SUFFIXES: .java .class
.java.class :
../../build/windows/work/jikes -cp "..\\..\\build\\windows\\work\\java\\lib\\rt.jar;..\\..\\build\\windows\\work\\lib\\mrj.jar;..\\..\\build\\windows\\work\\lib\\antlr.jar;." $<

View File

@ -256,10 +256,10 @@ public class PdePreprocessor {
// match those that will be highlighted in the PDE IDE
//
//System.out.println(program);
WLexer lexer = new WLexer(programReader);
// DAM:WTF? WLexer lexer = new WLexer(programReader);
//lexer.setTokenObjectClass("antlr.CommonHiddenStreamToken");
lexer.setTokenObjectClass("processing.app.preproc.CToken");
lexer.initialize();
// DAM:WTF? lexer.setTokenObjectClass("processing.app.preproc.CToken");
// DAM:WTF? lexer.initialize();
// create the filter for hidden tokens and specify which tokens to
// hide and which to copy to the hidden text
@ -281,13 +281,13 @@ public class PdePreprocessor {
// create a parser and set what sort of AST should be generated
//
//PdeRecognizer parser = new PdeRecognizer(filter);
WParser parser = new WParser(lexer);
// DAM:WTF? WParser parser = new WParser(lexer);
// use our extended AST class
//
//parser.setASTNodeClass("antlr.ExtendedCommonASTWithHiddenTokens");
parser.setASTNodeType(TNode.class.getName());
TNode.setTokenVocabulary("processing.app.preproc.WTokenTypes");
// DAM:WTF? parser.setASTNodeType(TNode.class.getName());
// DAM:WTF? TNode.setTokenVocabulary("processing.app.preproc.WTokenTypes");
// start parsing at the compilationUnit non-terminal
//
@ -296,23 +296,23 @@ public class PdePreprocessor {
// set up the AST for traversal by PdeEmitter
//
ASTFactory factory = new ASTFactory();
AST parserAST = parser.getAST();
AST rootNode = factory.create(ROOT_ID, "AST ROOT");
rootNode.setFirstChild(parserAST);
// DAM:WTF? ASTFactory factory = new ASTFactory();
// DAM:WTF? AST parserAST = parser.getAST();
// DAM:WTF? AST rootNode = factory.create(ROOT_ID, "AST ROOT");
// DAM:WTF? rootNode.setFirstChild(parserAST);
// unclear if this actually works, but it's worth a shot
//
//((CommonAST)parserAST).setVerboseStringConversion(
// true, parser.getTokenNames());
// (made to use the static version because of jikes 1.22 warning)
CommonAST.setVerboseStringConversion(true, parser.getTokenNames());
// DAM:WTF? CommonAST.setVerboseStringConversion(true, parser.getTokenNames());
// if this is an advanced program, the classname is already defined.
//
if (programType == JAVA) {
name = getFirstClassName(parserAST);
}
// DAM:WTF? if (programType == JAVA) {
// DAM:WTF? name = getFirstClassName(parserAST);
// DAM:WTF? }
// if 'null' was passed in for the name, but this isn't
// a 'java' mode class, then there's a problem, so punt.
@ -321,7 +321,7 @@ public class PdePreprocessor {
// output the code
//
WEmitter emitter = new WEmitter(lexer.getPreprocessorInfoChannel());
// DAM:WTF? WEmitter emitter = new WEmitter(lexer.getPreprocessorInfoChannel());
File streamFile = new File(buildPath, name + ".cpp");
PrintStream stream = new PrintStream(new FileOutputStream(streamFile));
@ -329,8 +329,8 @@ public class PdePreprocessor {
writeHeader(stream, name, prototypes);
//added to write the pde code to the cpp file
writeProgram(stream, name, program);
emitter.setASTNodeType(TNode.class.getName());
emitter.setOut(stream);
// DAM:WTF? emitter.setASTNodeType(TNode.class.getName());
// DAM:WTF? emitter.setOut(stream);
//emitter.printDeclarations(rootNode);
//emitter.print(rootNode);
//emitter.translationUnit(parser.getAST());
@ -340,7 +340,7 @@ public class PdePreprocessor {
// if desired, serialize the parse tree to an XML file. can
// be viewed usefully with Mozilla or IE
/* DAM:WTF?
if (Preferences.getBoolean("preproc.output_parse_tree")) {
stream = new PrintStream(new FileOutputStream("parseTree.xml"));
@ -354,6 +354,7 @@ public class PdePreprocessor {
stream.println("</document>");
writer.close();
}
*/
return name;
}

View File

@ -1,73 +0,0 @@
package processing.app.preproc;
import java.util.*;
public class PreprocessorInfoChannel
{
Hashtable lineLists = new Hashtable(); // indexed by Token number
int firstValidTokenNumber = 0;
int maxTokenNumber = 0;
public void addLineForTokenNumber( Object line, Integer toknum )
{
if ( lineLists.containsKey( toknum ) ) {
Vector lines = (Vector) lineLists.get( toknum );
lines.addElement(line);
}
else {
Vector lines = new Vector();
lines.addElement(line);
lineLists.put(toknum, lines);
if ( maxTokenNumber < toknum.intValue() ) {
maxTokenNumber = toknum.intValue();
}
}
}
public int getMaxTokenNumber()
{
return maxTokenNumber;
}
public Vector extractLinesPrecedingTokenNumber( Integer toknum )
{
Vector lines = new Vector();
if (toknum == null) return lines;
for (int i = firstValidTokenNumber; i < toknum.intValue(); i++){
Integer inti = new Integer(i);
if ( lineLists.containsKey( inti ) ) {
Vector tokenLineVector = (Vector) lineLists.get( inti );
if ( tokenLineVector != null) {
Enumeration tokenLines = tokenLineVector.elements();
while ( tokenLines.hasMoreElements() ) {
lines.addElement( tokenLines.nextElement() );
}
lineLists.remove(inti);
}
}
}
firstValidTokenNumber = toknum.intValue();
return lines;
}
public String toString()
{
StringBuffer sb = new StringBuffer("PreprocessorInfoChannel:\n");
for (int i = 0; i <= maxTokenNumber + 1; i++){
Integer inti = new Integer(i);
if ( lineLists.containsKey( inti ) ) {
Vector tokenLineVector = (Vector) lineLists.get( inti );
if ( tokenLineVector != null) {
Enumeration tokenLines = tokenLineVector.elements();
while ( tokenLines.hasMoreElements() ) {
sb.append(inti + ":" + tokenLines.nextElement() + '\n');
}
}
}
}
return sb.toString();
}
}

View File

@ -1,149 +0,0 @@
// $ANTLR 2.7.2: "StdCParser.g" -> "StdCLexer.java"$
package processing.app.preproc;
import java.io.*;
import antlr.CommonAST;
import antlr.DumpASTVisitor;
public interface STDCTokenTypes {
int EOF = 1;
int NULL_TREE_LOOKAHEAD = 3;
int LITERAL_typedef = 4;
int LITERAL_asm = 5;
int LITERAL_volatile = 6;
int LCURLY = 7;
int RCURLY = 8;
int SEMI = 9;
int LITERAL_struct = 10;
int LITERAL_union = 11;
int LITERAL_enum = 12;
int LITERAL_auto = 13;
int LITERAL_register = 14;
int LITERAL_extern = 15;
int LITERAL_static = 16;
int LITERAL_const = 17;
int LITERAL_void = 18;
int LITERAL_char = 19;
int LITERAL_short = 20;
int LITERAL_int = 21;
int LITERAL_long = 22;
int LITERAL_float = 23;
int LITERAL_double = 24;
int LITERAL_signed = 25;
int LITERAL_unsigned = 26;
int ID = 27;
int COMMA = 28;
int COLON = 29;
int ASSIGN = 30;
int STAR = 31;
int LPAREN = 32;
int RPAREN = 33;
int LBRACKET = 34;
int RBRACKET = 35;
int VARARGS = 36;
int LITERAL_while = 37;
int LITERAL_do = 38;
int LITERAL_for = 39;
int LITERAL_goto = 40;
int LITERAL_continue = 41;
int LITERAL_break = 42;
int LITERAL_return = 43;
int LITERAL_case = 44;
int LITERAL_default = 45;
int LITERAL_if = 46;
int LITERAL_else = 47;
int LITERAL_switch = 48;
int DIV_ASSIGN = 49;
int PLUS_ASSIGN = 50;
int MINUS_ASSIGN = 51;
int STAR_ASSIGN = 52;
int MOD_ASSIGN = 53;
int RSHIFT_ASSIGN = 54;
int LSHIFT_ASSIGN = 55;
int BAND_ASSIGN = 56;
int BOR_ASSIGN = 57;
int BXOR_ASSIGN = 58;
int QUESTION = 59;
int LOR = 60;
int LAND = 61;
int BOR = 62;
int BXOR = 63;
int BAND = 64;
int EQUAL = 65;
int NOT_EQUAL = 66;
int LT = 67;
int LTE = 68;
int GT = 69;
int GTE = 70;
int LSHIFT = 71;
int RSHIFT = 72;
int PLUS = 73;
int MINUS = 74;
int DIV = 75;
int MOD = 76;
int INC = 77;
int DEC = 78;
int LITERAL_sizeof = 79;
int BNOT = 80;
int LNOT = 81;
int PTR = 82;
int DOT = 83;
int CharLiteral = 84;
int StringLiteral = 85;
int IntOctalConst = 86;
int LongOctalConst = 87;
int UnsignedOctalConst = 88;
int IntIntConst = 89;
int LongIntConst = 90;
int UnsignedIntConst = 91;
int IntHexConst = 92;
int LongHexConst = 93;
int UnsignedHexConst = 94;
int FloatDoubleConst = 95;
int DoubleDoubleConst = 96;
int LongDoubleConst = 97;
int NTypedefName = 98;
int NInitDecl = 99;
int NDeclarator = 100;
int NStructDeclarator = 101;
int NDeclaration = 102;
int NCast = 103;
int NPointerGroup = 104;
int NExpressionGroup = 105;
int NFunctionCallArgs = 106;
int NNonemptyAbstractDeclarator = 107;
int NInitializer = 108;
int NStatementExpr = 109;
int NEmptyExpression = 110;
int NParameterTypeList = 111;
int NFunctionDef = 112;
int NCompoundStatement = 113;
int NParameterDeclaration = 114;
int NCommaExpr = 115;
int NUnaryExpr = 116;
int NLabel = 117;
int NPostfixExpr = 118;
int NRangeExpr = 119;
int NStringSeq = 120;
int NInitializerElementLabel = 121;
int NLcurlyInitializer = 122;
int NAsmAttribute = 123;
int NGnuAsmExpr = 124;
int NTypeMissing = 125;
int Vocabulary = 126;
int Whitespace = 127;
int Comment = 128;
int CPPComment = 129;
int PREPROC_DIRECTIVE = 130;
int Space = 131;
int LineDirective = 132;
int BadStringLiteral = 133;
int Escape = 134;
int Digit = 135;
int LongSuffix = 136;
int UnsignedSuffix = 137;
int FloatSuffix = 138;
int Exponent = 139;
int Number = 140;
}

View File

@ -1,139 +0,0 @@
// $ANTLR 2.7.2: StdCParser.g -> STDCTokenTypes.txt$
STDC // output token vocab name
LITERAL_typedef="typedef"=4
LITERAL_asm="asm"=5
LITERAL_volatile="volatile"=6
LCURLY=7
RCURLY=8
SEMI=9
LITERAL_struct="struct"=10
LITERAL_union="union"=11
LITERAL_enum="enum"=12
LITERAL_auto="auto"=13
LITERAL_register="register"=14
LITERAL_extern="extern"=15
LITERAL_static="static"=16
LITERAL_const="const"=17
LITERAL_void="void"=18
LITERAL_char="char"=19
LITERAL_short="short"=20
LITERAL_int="int"=21
LITERAL_long="long"=22
LITERAL_float="float"=23
LITERAL_double="double"=24
LITERAL_signed="signed"=25
LITERAL_unsigned="unsigned"=26
ID=27
COMMA=28
COLON=29
ASSIGN=30
STAR=31
LPAREN=32
RPAREN=33
LBRACKET=34
RBRACKET=35
VARARGS=36
LITERAL_while="while"=37
LITERAL_do="do"=38
LITERAL_for="for"=39
LITERAL_goto="goto"=40
LITERAL_continue="continue"=41
LITERAL_break="break"=42
LITERAL_return="return"=43
LITERAL_case="case"=44
LITERAL_default="default"=45
LITERAL_if="if"=46
LITERAL_else="else"=47
LITERAL_switch="switch"=48
DIV_ASSIGN=49
PLUS_ASSIGN=50
MINUS_ASSIGN=51
STAR_ASSIGN=52
MOD_ASSIGN=53
RSHIFT_ASSIGN=54
LSHIFT_ASSIGN=55
BAND_ASSIGN=56
BOR_ASSIGN=57
BXOR_ASSIGN=58
QUESTION=59
LOR=60
LAND=61
BOR=62
BXOR=63
BAND=64
EQUAL=65
NOT_EQUAL=66
LT=67
LTE=68
GT=69
GTE=70
LSHIFT=71
RSHIFT=72
PLUS=73
MINUS=74
DIV=75
MOD=76
INC=77
DEC=78
LITERAL_sizeof="sizeof"=79
BNOT=80
LNOT=81
PTR=82
DOT=83
CharLiteral=84
StringLiteral=85
IntOctalConst=86
LongOctalConst=87
UnsignedOctalConst=88
IntIntConst=89
LongIntConst=90
UnsignedIntConst=91
IntHexConst=92
LongHexConst=93
UnsignedHexConst=94
FloatDoubleConst=95
DoubleDoubleConst=96
LongDoubleConst=97
NTypedefName=98
NInitDecl=99
NDeclarator=100
NStructDeclarator=101
NDeclaration=102
NCast=103
NPointerGroup=104
NExpressionGroup=105
NFunctionCallArgs=106
NNonemptyAbstractDeclarator=107
NInitializer=108
NStatementExpr=109
NEmptyExpression=110
NParameterTypeList=111
NFunctionDef=112
NCompoundStatement=113
NParameterDeclaration=114
NCommaExpr=115
NUnaryExpr=116
NLabel=117
NPostfixExpr=118
NRangeExpr=119
NStringSeq=120
NInitializerElementLabel=121
NLcurlyInitializer=122
NAsmAttribute=123
NGnuAsmExpr=124
NTypeMissing=125
Vocabulary=126
Whitespace=127
Comment=128
CPPComment=129
PREPROC_DIRECTIVE("a line directive")=130
Space=131
LineDirective=132
BadStringLiteral=133
Escape=134
Digit=135
LongSuffix=136
UnsignedSuffix=137
FloatSuffix=138
Exponent=139
Number=140

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,434 +0,0 @@
package processing.app.preproc;
import antlr.collections.AST;
import antlr.CommonAST;
import antlr.Token;
import java.lang.reflect.*;
import java.util.Hashtable;
import java.util.Enumeration;
//import CToken;
/**
Class TNode is an implementation of the AST interface
and adds many useful features:
It is double-linked for reverse searching.
(this is currently incomplete, in that method doubleLink() must
be called after any changes to the tree to maintain the
reverse links).
It can store a definition node (defNode), so that nodes such
as scoped names can refer to the node that defines the name.
It stores line numbers for nodes.
Searches for parents and children of a tree can be done
based on their type.
The tree can be printed to System.out using a lisp-style syntax.
*/
public class TNode extends CommonAST {
protected int ttype;
protected String text;
protected int lineNum = 0;
protected TNode defNode;
protected TNode up;
protected TNode left;
protected boolean marker = false;
protected Hashtable attributes = null;
static String tokenVocabulary;
/** Set the token vocabulary to a tokentypes class
generated by antlr.
*/
public static void setTokenVocabulary(String s) {
tokenVocabulary = s;
}
public void initialize(Token token) {
CToken tok = (CToken) token;
setText(tok.getText());
setType(tok.getType());
setLineNum(tok.getLine());
setAttribute("source", tok.getSource());
setAttribute("tokenNumber", new Integer(tok.getTokenNumber()));
}
public void initialize(AST tr) {
TNode t = (TNode) tr;
setText(t.getText());
setType(t.getType());
setLineNum(t.getLineNum());
setDefNode(t.getDefNode());
this.attributes = t.getAttributesTable();
}
/** Get the token type for this node */
public int getType() { return ttype; }
/** Set the token type for this node */
public void setType(int ttype_) {
ttype = ttype_;
}
/** Get the marker value for this node.
This member is a general-use marker.
*/
public boolean getMarker() { return marker; }
/** Set the marker value for this node.
This property is a general-use boolean marker.
*/
public void setMarker(boolean marker_) {
marker = marker_;
}
/** get the hashtable that holds attribute values.
*/
public Hashtable getAttributesTable() {
if(attributes == null)
attributes = new Hashtable(7);
return attributes;
}
/** set an attribute in the attribute table.
*/
public void setAttribute(String attrName, Object value) {
if(attributes == null)
attributes = new Hashtable(7);
attributes.put(attrName,value);
}
/** lookup the attribute name in the attribute table.
If the value does not exist, it returns null.
*/
public Object getAttribute(String attrName) {
if(attributes == null)
return null;
else
return attributes.get(attrName);
}
/** Get the line number for this node.
If the line number is 0, search for a non-zero line num among children */
public int getLineNum() {
if(lineNum != 0)
return lineNum;
else
if(down == null)
return lineNum;
else
return ((TNode)down).getLocalLineNum();
}
public int getLocalLineNum() {
if(lineNum != 0)
return lineNum;
else
if(down == null)
if(right == null)
return lineNum;
else
return ((TNode)right).getLocalLineNum();
else
return ((TNode)down).getLocalLineNum();
}
/** Set the line number for this node */
public void setLineNum(int lineNum_) {
lineNum = lineNum_;
}
/** Get the token text for this node */
public String getText() { return text; }
/** Set the token text for this node */
public void setText(String text_) {
text = text_;
}
/** return the last child of this node, or null if there is none */
public TNode getLastChild() {
TNode down = (TNode)getFirstChild();
if(down != null)
return down.getLastSibling();
else
return null;
}
/** return the last sibling of this node, which is
this if the next sibling is null */
public TNode getLastSibling() {
TNode next = (TNode)getNextSibling();
if(next != null)
return next.getLastSibling();
else
return this;
}
/** return the first sibling of this node, which is
this if the prev sibling is null */
public TNode getFirstSibling() {
TNode prev = (TNode)left;
if(prev != null)
return prev.getFirstSibling();
else
return this;
}
/** return the parent node of this node */
public TNode getParent() {
return (TNode)getFirstSibling().up;
}
/** add the new node as a new sibling, inserting it ahead of any
existing next sibling. This method maintains double-linking.
if node is null, nothing happens. If the node has siblings,
then they are added in as well.
*/
public void addSibling(AST node) {
if(node == null) return;
TNode next = (TNode)right;
right = (TNode)node;
((TNode)node).left = this;
TNode nodeLastSib = ((TNode)node).getLastSibling();
nodeLastSib.right = next;
if(next != null)
next.left = nodeLastSib;
}
/** return the number of children of this node */
public int numberOfChildren() {
int count = 0;
AST child = getFirstChild();
while(child != null) {
count++;
child = child.getNextSibling();
}
return count;
}
/** remove this node from the tree, resetting sibling and parent
pointers as necessary. This method maintains double-linking */
public void removeSelf() {
TNode parent = (TNode)up;
TNode prev = (TNode)left;
TNode next = (TNode)right;
if(parent != null) {
parent.down = next;
if(next != null) {
next.up = parent;
next.left = prev; // which should be null
}
}
else {
if(prev != null)
prev.right = next;
if(next != null)
next.left = prev;
}
}
/** return the def node for this node */
public TNode getDefNode() {
return defNode;
}
/** set the def node for this node */
public void setDefNode(TNode n) {
defNode = n;
}
/** return a deep copy of this node, and all sub nodes.
New tree is doubleLinked, with no parent or siblings.
Marker value is not copied!
*/
public TNode deepCopy() {
TNode copy = new TNode();
copy.ttype = ttype;
copy.text = text;
copy.lineNum = lineNum;
copy.defNode = defNode;
if(attributes != null)
copy.attributes = (Hashtable)attributes.clone();
if(down != null)
copy.down = ((TNode)down).deepCopyWithRightSiblings();
copy.doubleLink();
return copy;
}
/** return a deep copy of this node, all sub nodes,
and right siblings.
New tree is doubleLinked, with no parent or left siblings.
defNode is not copied */
public TNode deepCopyWithRightSiblings() {
TNode copy = new TNode();
copy.ttype = ttype;
copy.text = text;
copy.lineNum = lineNum;
copy.defNode = defNode;
if(attributes != null)
copy.attributes = (Hashtable)attributes.clone();
if(down != null)
copy.down = ((TNode)down).deepCopyWithRightSiblings();
if(right != null)
copy.right = ((TNode)right).deepCopyWithRightSiblings();
copy.doubleLink();
return copy;
}
/** return a short string representation of the node */
public String toString() {
StringBuffer str = new StringBuffer( getNameForType(getType()) +
"[" + getText() + ", " + "]");
if(this.getLineNum() != 0)
str.append(" line:" + (this.getLineNum() ) );
Enumeration keys = (this.getAttributesTable().keys());
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement();
str.append(" " + key + ":" + (this.getAttribute(key)));
}
return str.toString();
}
/** print given tree to System.out */
public static void printTree(AST t) {
if (t == null) return;
printASTNode(t,0);
System.out.print("\n");
}
/** protected method that does the work of printing */
protected static void printASTNode(AST t, int indent) {
AST child1, next;
child1 = t.getFirstChild();
System.out.print("\n");
for(int i = 0; i < indent; i++)
System.out.print(" ");
if(child1 != null)
System.out.print("(");
String s = t.getText();
if(s != null && s.length() > 0) {
System.out.print(getNameForType(t.getType()));
System.out.print(": \"" + s + "\"");
}
else
System.out.print(getNameForType(t.getType()));
if(((TNode)t).getLineNum() != 0)
System.out.print(" line:" + ((TNode)t).getLineNum() );
Enumeration keys = ((TNode)t).getAttributesTable().keys();
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement();
System.out.print(" " + key + ":" + ((TNode)t).getAttribute(key));
}
TNode def = ((TNode)t).getDefNode();
if(def != null)
System.out.print("[" + getNameForType(def.getType()) + "]");
if(child1 != null) {
printASTNode(child1,indent + 1);
System.out.print("\n");
for(int i = 0; i < indent; i++)
System.out.print(" ");
System.out.print(")");
}
next = t.getNextSibling();
if(next != null) {
printASTNode(next,indent);
}
}
/** converts an int tree token type to a name.
Does this by reflecting on nsdidl.IDLTreeTokenTypes,
and is dependent on how ANTLR 2.00 outputs that class. */
public static String getNameForType(int t) {
try{
Class c = Class.forName(tokenVocabulary);
Field[] fields = c.getDeclaredFields();
if(t-2 < fields.length)
return fields[t-2].getName();
} catch (Exception e) { System.out.println(e); }
return "unfoundtype: " + t;
}
/** set up reverse links between this node and its first
child and its first sibling, and link those as well */
public void doubleLink() {
TNode right = (TNode)getNextSibling();
if(right != null) {
right.left = this;
right.doubleLink();
}
TNode down = (TNode)getFirstChild();
if(down != null) {
down.up = this;
down.doubleLink();
}
}
/** find first parent of the given type,
return null on failure */
public TNode parentOfType(int type) {
if(up == null) {
if(left == null)
return null;
else
return left.parentOfType(type);
}
if(up.getType() == type)
return up;
return up.parentOfType(type);
}
/** find the first child of the node
of the given type, return null on failure */
public TNode firstChildOfType(int type) {
TNode down = (TNode)getFirstChild();
if(down == null)
return null;
if(down.getType() == type)
return down;
return down.firstSiblingOfType(type);
}
/** find the first sibling of the node
of the given type, return null on failure */
public TNode firstSiblingOfType(int type) {
TNode right = (TNode)getNextSibling();
if(right == null)
return null;
if(right.getType() == type)
return right;
return right.firstSiblingOfType(type);
}
}

View File

@ -1,33 +0,0 @@
package processing.app.preproc;
import antlr.Token;
import antlr.ASTFactory;
import antlr.collections.AST;
/** This class extends ASTFactory to build instances
of class TNode */
public class TNodeFactory extends ASTFactory {
/** Create a new ampty AST node */
public AST create() {
return new TNode();
}
/** Create a new AST node from type and text */
public AST create(int ttype, String text) {
AST ast = new TNode();
ast.setType(ttype);
ast.setText(text);
return ast;
}
/** Create a new AST node from an existing AST node */
public AST create(AST ast) {
AST newast = new TNode();
newast.setType(ast.getType());
newast.setText(ast.getText());
return newast;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,163 +0,0 @@
// $ANTLR 2.7.2: "expandedWEmitter.g" -> "WEmitter.java"$
package processing.app.preproc;
import processing.app.*;
import java.io.*;
import java.util.*;
import antlr.CommonAST;
import antlr.DumpASTVisitor;
public interface WEmitterTokenTypes {
int EOF = 1;
int NULL_TREE_LOOKAHEAD = 3;
int LITERAL_typedef = 4;
int LITERAL_asm = 5;
int LITERAL_volatile = 6;
int LCURLY = 7;
int RCURLY = 8;
int SEMI = 9;
int LITERAL_struct = 10;
int LITERAL_union = 11;
int LITERAL_enum = 12;
int LITERAL_auto = 13;
int LITERAL_register = 14;
int LITERAL_extern = 15;
int LITERAL_static = 16;
int LITERAL_const = 17;
int LITERAL_void = 18;
int LITERAL_char = 19;
int LITERAL_short = 20;
int LITERAL_int = 21;
int LITERAL_long = 22;
int LITERAL_float = 23;
int LITERAL_double = 24;
int LITERAL_signed = 25;
int LITERAL_unsigned = 26;
int ID = 27;
int COMMA = 28;
int COLON = 29;
int ASSIGN = 30;
int STAR = 31;
int LPAREN = 32;
int RPAREN = 33;
int LBRACKET = 34;
int RBRACKET = 35;
int VARARGS = 36;
int LITERAL_while = 37;
int LITERAL_do = 38;
int LITERAL_for = 39;
int LITERAL_goto = 40;
int LITERAL_continue = 41;
int LITERAL_break = 42;
int LITERAL_return = 43;
int LITERAL_case = 44;
int LITERAL_default = 45;
int LITERAL_if = 46;
int LITERAL_else = 47;
int LITERAL_switch = 48;
int DIV_ASSIGN = 49;
int PLUS_ASSIGN = 50;
int MINUS_ASSIGN = 51;
int STAR_ASSIGN = 52;
int MOD_ASSIGN = 53;
int RSHIFT_ASSIGN = 54;
int LSHIFT_ASSIGN = 55;
int BAND_ASSIGN = 56;
int BOR_ASSIGN = 57;
int BXOR_ASSIGN = 58;
int QUESTION = 59;
int LOR = 60;
int LAND = 61;
int BOR = 62;
int BXOR = 63;
int BAND = 64;
int EQUAL = 65;
int NOT_EQUAL = 66;
int LT = 67;
int LTE = 68;
int GT = 69;
int GTE = 70;
int LSHIFT = 71;
int RSHIFT = 72;
int PLUS = 73;
int MINUS = 74;
int DIV = 75;
int MOD = 76;
int INC = 77;
int DEC = 78;
int LITERAL_sizeof = 79;
int BNOT = 80;
int LNOT = 81;
int PTR = 82;
int DOT = 83;
int CharLiteral = 84;
int StringLiteral = 85;
int IntOctalConst = 86;
int LongOctalConst = 87;
int UnsignedOctalConst = 88;
int IntIntConst = 89;
int LongIntConst = 90;
int UnsignedIntConst = 91;
int IntHexConst = 92;
int LongHexConst = 93;
int UnsignedHexConst = 94;
int FloatDoubleConst = 95;
int DoubleDoubleConst = 96;
int LongDoubleConst = 97;
int NTypedefName = 98;
int NInitDecl = 99;
int NDeclarator = 100;
int NStructDeclarator = 101;
int NDeclaration = 102;
int NCast = 103;
int NPointerGroup = 104;
int NExpressionGroup = 105;
int NFunctionCallArgs = 106;
int NNonemptyAbstractDeclarator = 107;
int NInitializer = 108;
int NStatementExpr = 109;
int NEmptyExpression = 110;
int NParameterTypeList = 111;
int NFunctionDef = 112;
int NCompoundStatement = 113;
int NParameterDeclaration = 114;
int NCommaExpr = 115;
int NUnaryExpr = 116;
int NLabel = 117;
int NPostfixExpr = 118;
int NRangeExpr = 119;
int NStringSeq = 120;
int NInitializerElementLabel = 121;
int NLcurlyInitializer = 122;
int NAsmAttribute = 123;
int NGnuAsmExpr = 124;
int NTypeMissing = 125;
int Vocabulary = 126;
int Whitespace = 127;
int Comment = 128;
int CPPComment = 129;
int PREPROC_DIRECTIVE = 130;
int Space = 131;
int LineDirective = 132;
int BadStringLiteral = 133;
int Escape = 134;
int Digit = 135;
int LongSuffix = 136;
int UnsignedSuffix = 137;
int FloatSuffix = 138;
int Exponent = 139;
int Number = 140;
int LITERAL___label__ = 141;
int LITERAL_inline = 142;
int LITERAL_byte = 143;
int LITERAL_boolean = 144;
int LITERAL_Servo = 145;
int LITERAL_Wire = 146;
int LITERAL_typeof = 147;
int LITERAL___complex = 148;
int LITERAL___attribute = 149;
int LITERAL___alignof = 150;
int LITERAL___real = 151;
int LITERAL___imag = 152;
}

View File

@ -1,151 +0,0 @@
// $ANTLR 2.7.2: expandedWEmitter.g -> WEmitterTokenTypes.txt$
WEmitter // output token vocab name
LITERAL_typedef="typedef"=4
LITERAL_asm="asm"=5
LITERAL_volatile="volatile"=6
LCURLY=7
RCURLY=8
SEMI=9
LITERAL_struct="struct"=10
LITERAL_union="union"=11
LITERAL_enum="enum"=12
LITERAL_auto="auto"=13
LITERAL_register="register"=14
LITERAL_extern="extern"=15
LITERAL_static="static"=16
LITERAL_const="const"=17
LITERAL_void="void"=18
LITERAL_char="char"=19
LITERAL_short="short"=20
LITERAL_int="int"=21
LITERAL_long="long"=22
LITERAL_float="float"=23
LITERAL_double="double"=24
LITERAL_signed="signed"=25
LITERAL_unsigned="unsigned"=26
ID=27
COMMA=28
COLON=29
ASSIGN=30
STAR=31
LPAREN=32
RPAREN=33
LBRACKET=34
RBRACKET=35
VARARGS=36
LITERAL_while="while"=37
LITERAL_do="do"=38
LITERAL_for="for"=39
LITERAL_goto="goto"=40
LITERAL_continue="continue"=41
LITERAL_break="break"=42
LITERAL_return="return"=43
LITERAL_case="case"=44
LITERAL_default="default"=45
LITERAL_if="if"=46
LITERAL_else="else"=47
LITERAL_switch="switch"=48
DIV_ASSIGN=49
PLUS_ASSIGN=50
MINUS_ASSIGN=51
STAR_ASSIGN=52
MOD_ASSIGN=53
RSHIFT_ASSIGN=54
LSHIFT_ASSIGN=55
BAND_ASSIGN=56
BOR_ASSIGN=57
BXOR_ASSIGN=58
QUESTION=59
LOR=60
LAND=61
BOR=62
BXOR=63
BAND=64
EQUAL=65
NOT_EQUAL=66
LT=67
LTE=68
GT=69
GTE=70
LSHIFT=71
RSHIFT=72
PLUS=73
MINUS=74
DIV=75
MOD=76
INC=77
DEC=78
LITERAL_sizeof="sizeof"=79
BNOT=80
LNOT=81
PTR=82
DOT=83
CharLiteral=84
StringLiteral=85
IntOctalConst=86
LongOctalConst=87
UnsignedOctalConst=88
IntIntConst=89
LongIntConst=90
UnsignedIntConst=91
IntHexConst=92
LongHexConst=93
UnsignedHexConst=94
FloatDoubleConst=95
DoubleDoubleConst=96
LongDoubleConst=97
NTypedefName=98
NInitDecl=99
NDeclarator=100
NStructDeclarator=101
NDeclaration=102
NCast=103
NPointerGroup=104
NExpressionGroup=105
NFunctionCallArgs=106
NNonemptyAbstractDeclarator=107
NInitializer=108
NStatementExpr=109
NEmptyExpression=110
NParameterTypeList=111
NFunctionDef=112
NCompoundStatement=113
NParameterDeclaration=114
NCommaExpr=115
NUnaryExpr=116
NLabel=117
NPostfixExpr=118
NRangeExpr=119
NStringSeq=120
NInitializerElementLabel=121
NLcurlyInitializer=122
NAsmAttribute=123
NGnuAsmExpr=124
NTypeMissing=125
Vocabulary=126
Whitespace=127
Comment=128
CPPComment=129
PREPROC_DIRECTIVE("a line directive")=130
Space=131
LineDirective=132
BadStringLiteral=133
Escape=134
Digit=135
LongSuffix=136
UnsignedSuffix=137
FloatSuffix=138
Exponent=139
Number=140
LITERAL___label__="__label__"=141
LITERAL_inline="inline"=142
LITERAL_byte="byte"=143
LITERAL_boolean="boolean"=144
LITERAL_Servo="Servo"=145
LITERAL_Wire="Wire"=146
LITERAL_typeof="typeof"=147
LITERAL___complex="__complex"=148
LITERAL___attribute="__attribute"=149
LITERAL___alignof="__alignof"=150
LITERAL___real="__real"=151
LITERAL___imag="__imag"=152

File diff suppressed because it is too large Load Diff

View File

@ -1,168 +0,0 @@
// $ANTLR 2.7.2: "expandedWParser.g" -> "WLexer.java"$
package processing.app.preproc;
import java.io.*;
import antlr.CommonAST;
import antlr.DumpASTVisitor;
public interface WLexerTokenTypes {
int EOF = 1;
int NULL_TREE_LOOKAHEAD = 3;
int LITERAL_typedef = 4;
int LITERAL_asm = 5;
int LITERAL_volatile = 6;
int LCURLY = 7;
int RCURLY = 8;
int SEMI = 9;
int LITERAL_struct = 10;
int LITERAL_union = 11;
int LITERAL_enum = 12;
int LITERAL_auto = 13;
int LITERAL_register = 14;
int LITERAL_extern = 15;
int LITERAL_static = 16;
int LITERAL_const = 17;
int LITERAL_void = 18;
int LITERAL_char = 19;
int LITERAL_short = 20;
int LITERAL_int = 21;
int LITERAL_long = 22;
int LITERAL_float = 23;
int LITERAL_double = 24;
int LITERAL_signed = 25;
int LITERAL_unsigned = 26;
int ID = 27;
int COMMA = 28;
int COLON = 29;
int ASSIGN = 30;
int STAR = 31;
int LPAREN = 32;
int RPAREN = 33;
int LBRACKET = 34;
int RBRACKET = 35;
int VARARGS = 36;
int LITERAL_while = 37;
int LITERAL_do = 38;
int LITERAL_for = 39;
int LITERAL_goto = 40;
int LITERAL_continue = 41;
int LITERAL_break = 42;
int LITERAL_return = 43;
int LITERAL_case = 44;
int LITERAL_default = 45;
int LITERAL_if = 46;
int LITERAL_else = 47;
int LITERAL_switch = 48;
int DIV_ASSIGN = 49;
int PLUS_ASSIGN = 50;
int MINUS_ASSIGN = 51;
int STAR_ASSIGN = 52;
int MOD_ASSIGN = 53;
int RSHIFT_ASSIGN = 54;
int LSHIFT_ASSIGN = 55;
int BAND_ASSIGN = 56;
int BOR_ASSIGN = 57;
int BXOR_ASSIGN = 58;
int QUESTION = 59;
int LOR = 60;
int LAND = 61;
int BOR = 62;
int BXOR = 63;
int BAND = 64;
int EQUAL = 65;
int NOT_EQUAL = 66;
int LT = 67;
int LTE = 68;
int GT = 69;
int GTE = 70;
int LSHIFT = 71;
int RSHIFT = 72;
int PLUS = 73;
int MINUS = 74;
int DIV = 75;
int MOD = 76;
int INC = 77;
int DEC = 78;
int LITERAL_sizeof = 79;
int BNOT = 80;
int LNOT = 81;
int PTR = 82;
int DOT = 83;
int CharLiteral = 84;
int StringLiteral = 85;
int IntOctalConst = 86;
int LongOctalConst = 87;
int UnsignedOctalConst = 88;
int IntIntConst = 89;
int LongIntConst = 90;
int UnsignedIntConst = 91;
int IntHexConst = 92;
int LongHexConst = 93;
int UnsignedHexConst = 94;
int FloatDoubleConst = 95;
int DoubleDoubleConst = 96;
int LongDoubleConst = 97;
int NTypedefName = 98;
int NInitDecl = 99;
int NDeclarator = 100;
int NStructDeclarator = 101;
int NDeclaration = 102;
int NCast = 103;
int NPointerGroup = 104;
int NExpressionGroup = 105;
int NFunctionCallArgs = 106;
int NNonemptyAbstractDeclarator = 107;
int NInitializer = 108;
int NStatementExpr = 109;
int NEmptyExpression = 110;
int NParameterTypeList = 111;
int NFunctionDef = 112;
int NCompoundStatement = 113;
int NParameterDeclaration = 114;
int NCommaExpr = 115;
int NUnaryExpr = 116;
int NLabel = 117;
int NPostfixExpr = 118;
int NRangeExpr = 119;
int NStringSeq = 120;
int NInitializerElementLabel = 121;
int NLcurlyInitializer = 122;
int NAsmAttribute = 123;
int NGnuAsmExpr = 124;
int NTypeMissing = 125;
int Vocabulary = 126;
int Whitespace = 127;
int Comment = 128;
int CPPComment = 129;
int PREPROC_DIRECTIVE = 130;
int Space = 131;
int LineDirective = 132;
int BadStringLiteral = 133;
int Escape = 134;
int Digit = 135;
int LongSuffix = 136;
int UnsignedSuffix = 137;
int FloatSuffix = 138;
int Exponent = 139;
int Number = 140;
int LITERAL___label__ = 141;
int LITERAL_inline = 142;
int LITERAL_byte = 143;
int LITERAL_boolean = 144;
int LITERAL_Servo = 145;
int LITERAL_Wire = 146;
int LITERAL_typeof = 147;
int LITERAL___complex = 148;
int LITERAL___attribute = 149;
int LITERAL___alignof = 150;
int LITERAL___real = 151;
int LITERAL___imag = 152;
int LITERAL___extension__ = 153;
int IntSuffix = 154;
int NumberSuffix = 155;
int IDMEAT = 156;
int WideCharLiteral = 157;
int WideStringLiteral = 158;
}

View File

@ -1,157 +0,0 @@
// $ANTLR 2.7.2: expandedWParser.g -> WLexerTokenTypes.txt$
WLexer // output token vocab name
LITERAL_typedef="typedef"=4
LITERAL_asm="asm"=5
LITERAL_volatile="volatile"=6
LCURLY=7
RCURLY=8
SEMI=9
LITERAL_struct="struct"=10
LITERAL_union="union"=11
LITERAL_enum="enum"=12
LITERAL_auto="auto"=13
LITERAL_register="register"=14
LITERAL_extern="extern"=15
LITERAL_static="static"=16
LITERAL_const="const"=17
LITERAL_void="void"=18
LITERAL_char="char"=19
LITERAL_short="short"=20
LITERAL_int="int"=21
LITERAL_long="long"=22
LITERAL_float="float"=23
LITERAL_double="double"=24
LITERAL_signed="signed"=25
LITERAL_unsigned="unsigned"=26
ID=27
COMMA=28
COLON=29
ASSIGN=30
STAR=31
LPAREN=32
RPAREN=33
LBRACKET=34
RBRACKET=35
VARARGS=36
LITERAL_while="while"=37
LITERAL_do="do"=38
LITERAL_for="for"=39
LITERAL_goto="goto"=40
LITERAL_continue="continue"=41
LITERAL_break="break"=42
LITERAL_return="return"=43
LITERAL_case="case"=44
LITERAL_default="default"=45
LITERAL_if="if"=46
LITERAL_else="else"=47
LITERAL_switch="switch"=48
DIV_ASSIGN=49
PLUS_ASSIGN=50
MINUS_ASSIGN=51
STAR_ASSIGN=52
MOD_ASSIGN=53
RSHIFT_ASSIGN=54
LSHIFT_ASSIGN=55
BAND_ASSIGN=56
BOR_ASSIGN=57
BXOR_ASSIGN=58
QUESTION=59
LOR=60
LAND=61
BOR=62
BXOR=63
BAND=64
EQUAL=65
NOT_EQUAL=66
LT=67
LTE=68
GT=69
GTE=70
LSHIFT=71
RSHIFT=72
PLUS=73
MINUS=74
DIV=75
MOD=76
INC=77
DEC=78
LITERAL_sizeof="sizeof"=79
BNOT=80
LNOT=81
PTR=82
DOT=83
CharLiteral=84
StringLiteral=85
IntOctalConst=86
LongOctalConst=87
UnsignedOctalConst=88
IntIntConst=89
LongIntConst=90
UnsignedIntConst=91
IntHexConst=92
LongHexConst=93
UnsignedHexConst=94
FloatDoubleConst=95
DoubleDoubleConst=96
LongDoubleConst=97
NTypedefName=98
NInitDecl=99
NDeclarator=100
NStructDeclarator=101
NDeclaration=102
NCast=103
NPointerGroup=104
NExpressionGroup=105
NFunctionCallArgs=106
NNonemptyAbstractDeclarator=107
NInitializer=108
NStatementExpr=109
NEmptyExpression=110
NParameterTypeList=111
NFunctionDef=112
NCompoundStatement=113
NParameterDeclaration=114
NCommaExpr=115
NUnaryExpr=116
NLabel=117
NPostfixExpr=118
NRangeExpr=119
NStringSeq=120
NInitializerElementLabel=121
NLcurlyInitializer=122
NAsmAttribute=123
NGnuAsmExpr=124
NTypeMissing=125
Vocabulary=126
Whitespace=127
Comment=128
CPPComment=129
PREPROC_DIRECTIVE("a line directive")=130
Space=131
LineDirective=132
BadStringLiteral=133
Escape=134
Digit=135
LongSuffix=136
UnsignedSuffix=137
FloatSuffix=138
Exponent=139
Number=140
LITERAL___label__="__label__"=141
LITERAL_inline="inline"=142
LITERAL_byte="byte"=143
LITERAL_boolean="boolean"=144
LITERAL_Servo="Servo"=145
LITERAL_Wire="Wire"=146
LITERAL_typeof="typeof"=147
LITERAL___complex="__complex"=148
LITERAL___attribute="__attribute"=149
LITERAL___alignof="__alignof"=150
LITERAL___real="__real"=151
LITERAL___imag="__imag"=152
LITERAL___extension__="__extension__"=153
IntSuffix=154
NumberSuffix=155
IDMEAT=156
WideCharLiteral=157
WideStringLiteral=158

View File

@ -1,856 +0,0 @@
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Non, Inc. 1998 -- All Rights Reserved
PROJECT: C Compiler
MODULE: WParser
FILE: WParser.g
AUTHOR: Monty Zukowski (jamz@cdsnet.net) April 28, 1998
MODIFICATIONS: Hernando Barragan added support for the Wiring language
DESCRIPTION:
This is a grammar for the GNU C compiler. It is a
grammar subclass of StdCParser, overriding only those
rules which are different from Standard C.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
header {
package processing.app.preproc;
import java.io.*;
import antlr.CommonAST;
import antlr.DumpASTVisitor;
}
class WParser extends StdCParser;
options
{
k = 2;
exportVocab = W;
buildAST = true;
ASTLabelType = "TNode";
defaultErrorHandler = false;
// Copied following options from java grammar.
codeGenMakeSwitchThreshold = 2;
codeGenBitsetTestThreshold = 3;
}
{
// Suppport C++-style single-line comments?
public static boolean CPPComments = true;
// access to symbol table
public CSymbolTable symbolTable = new CSymbolTable();
// source for names to unnamed scopes
protected int unnamedScopeCounter = 0;
public boolean isTypedefName(String name) {
boolean returnValue = false;
TNode node = symbolTable.lookupNameInCurrentScope(name);
for (; node != null; node = (TNode) node.getNextSibling() ) {
if(node.getType() == LITERAL_typedef) {
returnValue = true;
break;
}
}
return returnValue;
}
public String getAScopeName() {
return "" + (unnamedScopeCounter++);
}
public void pushScope(String scopeName) {
symbolTable.pushScope(scopeName);
}
public void popScope() {
symbolTable.popScope();
}
int traceDepth = 0;
public void reportError(RecognitionException ex) {
try {
System.err.println("ANTLR Parsing Error: "+ex + " token name:" + tokenNames[LA(1)]);
ex.printStackTrace(System.err);
}
catch (TokenStreamException e) {
System.err.println("ANTLR Parsing Error: "+ex);
ex.printStackTrace(System.err);
}
}
public void reportError(String s) {
System.err.println("ANTLR Parsing Error from String: " + s);
}
public void reportWarning(String s) {
System.err.println("ANTLR Parsing Warning from String: " + s);
}
public void match(int t) throws MismatchedTokenException {
boolean debugging = false;
if ( debugging ) {
for (int x=0; x<traceDepth; x++) System.out.print(" ");
try {
System.out.println("Match("+tokenNames[t]+") with LA(1)="+
tokenNames[LA(1)] + ((inputState.guessing>0)?" [inputState.guessing "+ inputState.guessing + "]":""));
}
catch (TokenStreamException e) {
System.out.println("Match("+tokenNames[t]+") " + ((inputState.guessing>0)?" [inputState.guessing "+ inputState.guessing + "]":""));
}
}
try {
if ( LA(1)!=t ) {
if ( debugging ){
for (int x=0; x<traceDepth; x++) System.out.print(" ");
System.out.println("token mismatch: "+tokenNames[LA(1)]
+ "!="+tokenNames[t]);
}
throw new MismatchedTokenException(tokenNames, LT(1), t, false, getFilename());
} else {
// mark token as consumed -- fetch next token deferred until LA/LT
consume();
}
}
catch (TokenStreamException e) {
}
}
public void traceIn(String rname) {
traceDepth += 1;
for (int x=0; x<traceDepth; x++) System.out.print(" ");
try {
System.out.println("> "+rname+"; LA(1)==("+ tokenNames[LT(1).getType()]
+ ") " + LT(1).getText() + " [inputState.guessing "+ inputState.guessing + "]");
}
catch (TokenStreamException e) {
}
}
public void traceOut(String rname) {
for (int x=0; x<traceDepth; x++) System.out.print(" ");
try {
System.out.println("< "+rname+"; LA(1)==("+ tokenNames[LT(1).getType()]
+ ") "+LT(1).getText() + " [inputState.guessing "+ inputState.guessing + "]");
}
catch (TokenStreamException e) {
}
traceDepth -= 1;
}
}
translationUnit
: ( externalList )? /* Empty source files are allowed. */
;
asm_expr
: "asm"^
("volatile")? LCURLY expr RCURLY ( SEMI )+
;
idList
: ID ( options{warnWhenFollowAmbig=false;}: COMMA ID )*
;
externalDef
: ( "typedef" | declaration )=> declaration
| ( functionPrefix )=> functionDef
| typelessDeclaration
| asm_expr
| SEMI
;
/* these two are here because GCC allows "cat = 13;" as a valid program! */
functionPrefix
{ String declName; }
: ( (functionDeclSpecifiers)=> ds:functionDeclSpecifiers
| //epsilon
)
declName = d:declarator[true]
( declaration )* (VARARGS)? ( SEMI )*
LCURLY
;
typelessDeclaration
{ AST typeMissing = #[NTypeMissing]; }
: initDeclList[typeMissing] SEMI { ## = #( #[NTypeMissing], ##); }
;
initializer
: ( ( ( (initializerElementLabel)=> initializerElementLabel )?
( assignExpr | lcurlyInitializer ) { ## = #( #[NInitializer], ## ); }
)
| lcurlyInitializer
)
;
// GCC allows more specific initializers
initializerElementLabel
: ( ( LBRACKET ((constExpr VARARGS)=> rangeExpr | constExpr) RBRACKET (ASSIGN)? )
| ID COLON
| DOT ID ASSIGN
)
{ ## = #( #[NInitializerElementLabel], ##) ; }
;
// GCC allows empty initializer lists
lcurlyInitializer
:
LCURLY^ (initializerList ( COMMA! )? )? RCURLY
{ ##.setType( NLcurlyInitializer ); }
;
initializerList
: initializer ( options{warnWhenFollowAmbig=false;}:COMMA! initializer )*
;
declarator[boolean isFunctionDefinition] returns [String declName]
{ declName = ""; }
:
( pointerGroup )?
( id:ID { declName = id.getText(); }
| LPAREN declName = declarator[false] RPAREN
)
( declaratorParamaterList[isFunctionDefinition, declName]
| LBRACKET ( expr )? RBRACKET
)*
{ ## = #( #[NDeclarator], ## ); }
;
declaratorParamaterList[boolean isFunctionDefinition, String declName]
:
LPAREN^
{
if (isFunctionDefinition) {
pushScope(declName);
}
else {
pushScope("!"+declName);
}
}
(
(declSpecifiers)=> parameterTypeList
| (idList)?
)
{
popScope();
}
( COMMA! )?
RPAREN
{ ##.setType(NParameterTypeList); }
;
parameterTypeList
: parameterDeclaration
( options {
warnWhenFollowAmbig = false;
} :
( COMMA | SEMI )
parameterDeclaration
)*
( ( COMMA | SEMI )
VARARGS
)?
;
declarationList
: ( options { // this loop properly aborts when
// it finds a non-typedefName ID MBZ
warnWhenFollowAmbig = false;
} :
localLabelDeclaration
| ( declarationPredictor )=> declaration
)+
;
localLabelDeclaration
: ( //GNU note: any __label__ declarations must come before regular declarations.
"__label__"^ ID (options{warnWhenFollowAmbig=false;}: COMMA! ID)* ( COMMA! )? ( SEMI! )+
)
;
declaration
{ AST ds1 = null; }
: ds:declSpecifiers { ds1 = astFactory.dupList(#ds); }
(
initDeclList[ds1]
)?
( SEMI )+
{ ## = #( #[NDeclaration], ##); }
;
functionStorageClassSpecifier
: "extern"
| "static"
| "inline"
;
typeSpecifier [int specCount] returns [int retSpecCount]
{ retSpecCount = specCount + 1; }
:
( "void"
| "char"
| "short"
| "int"
| "long"
| "float"
| "double"
| "signed"
| "unsigned"
| "byte"
| "boolean"
| "Servo"
| "Wire"
| structOrUnionSpecifier ( options{warnWhenFollowAmbig=false;}: attributeDecl )*
| enumSpecifier
| { specCount==0 }? typedefName
| "typeof"^ LPAREN
( ( typeName )=> typeName
| expr
)
RPAREN
| "__complex"
)
;
structOrUnionSpecifier
{ String scopeName; }
: sou:structOrUnion!
( ( ID LCURLY )=> i:ID l:LCURLY
{
scopeName = #sou.getText() + " " + #i.getText();
#l.setText(scopeName);
pushScope(scopeName);
}
( structDeclarationList )?
{ popScope();}
RCURLY
| l1:LCURLY
{
scopeName = getAScopeName();
#l1.setText(scopeName);
pushScope(scopeName);
}
( structDeclarationList )?
{ popScope(); }
RCURLY
| ID
)
{
## = #( #sou, ## );
}
;
structDeclaration
: specifierQualifierList structDeclaratorList ( COMMA! )? ( SEMI! )+
;
structDeclaratorList
: structDeclarator ( options{warnWhenFollowAmbig=false;}: COMMA! structDeclarator )*
;
structDeclarator
: ( declarator[false] )?
( COLON constExpr )?
( attributeDecl )*
{ ## = #( #[NStructDeclarator], ##); }
;
enumSpecifier
: "enum"^
( ( ID LCURLY )=> i:ID LCURLY enumList[i.getText()] RCURLY
| LCURLY enumList["anonymous"] RCURLY
| ID
)
;
enumList[String enumName]
: enumerator[enumName] ( options{warnWhenFollowAmbig=false;}: COMMA! enumerator[enumName] )* ( COMMA! )?
;
initDeclList[AST declarationSpecifiers]
: initDecl[declarationSpecifiers]
( options{warnWhenFollowAmbig=false;}: COMMA! initDecl[declarationSpecifiers] )*
( COMMA! )?
;
initDecl[AST declarationSpecifiers]
{ String declName = ""; }
: declName = d:declarator[false]
{ AST ds1, d1;
ds1 = astFactory.dupList(declarationSpecifiers);
d1 = astFactory.dupList(#d);
symbolTable.add(declName, #(null, ds1, d1) );
}
( attributeDecl )*
( ASSIGN initializer
| COLON expr
)?
{ ## = #( #[NInitDecl], ## ); }
;
attributeDecl
: "__attribute"^ LPAREN LPAREN attributeList RPAREN RPAREN
| "asm"^ LPAREN stringConst RPAREN { ##.setType( NAsmAttribute ); }
;
attributeList
: attribute ( options{warnWhenFollowAmbig=false;}: COMMA attribute)* ( COMMA )?
;
attribute
: ( ~(LPAREN | RPAREN | COMMA)
| LPAREN attributeList RPAREN
)*
;
compoundStatement[String scopeName]
: LCURLY^
{
pushScope(scopeName);
}
( //this ambiguity is ok, declarationList and nestedFunctionDef end properly
options {
warnWhenFollowAmbig = false;
} :
( "typedef" | "__label__" | declaration )=> declarationList
| (nestedFunctionDef)=> nestedFunctionDef
)*
( statementList )?
{ popScope(); }
RCURLY
{ ##.setType( NCompoundStatement ); ##.setAttribute( "scopeName", scopeName ); }
;
nestedFunctionDef
{ String declName; }
: ( "auto" )? //only for nested functions
( (functionDeclSpecifiers)=> ds:functionDeclSpecifiers
)?
declName = d:declarator[false]
{
AST d2, ds2;
d2 = astFactory.dupList(#d);
ds2 = astFactory.dupList(#ds);
symbolTable.add(declName, #(null, ds2, d2));
pushScope(declName);
}
( declaration )*
{ popScope(); }
compoundStatement[declName]
{ ## = #( #[NFunctionDef], ## );}
;
statement
: SEMI // Empty statements
| compoundStatement[getAScopeName()] // Group of statements
| expr SEMI! { ## = #( #[NStatementExpr], ## );} // Expressions
// Iteration statements:
| "while"^ LPAREN! expr RPAREN! statement
| "do"^ statement "while"! LPAREN! expr RPAREN! SEMI!
|! "for"
LPAREN ( e1:expr )? SEMI ( e2:expr )? SEMI ( e3:expr )? RPAREN
s:statement
{
if ( #e1 == null) { #e1 = #[ NEmptyExpression ]; }
if ( #e2 == null) { #e2 = #[ NEmptyExpression ]; }
if ( #e3 == null) { #e3 = #[ NEmptyExpression ]; }
## = #( #[LITERAL_for, "for"], #e1, #e2, #e3, #s );
}
// Jump statements:
| "goto"^ expr SEMI!
| "continue" SEMI!
| "break" SEMI!
| "return"^ ( expr )? SEMI!
| ID COLON! (options {warnWhenFollowAmbig=false;}: statement)? { ## = #( #[NLabel], ## ); }
// GNU allows range expressions in case statements
| "case"^ ((constExpr VARARGS)=> rangeExpr | constExpr) COLON! ( options{warnWhenFollowAmbig=false;}:statement )?
| "default"^ COLON! ( options{warnWhenFollowAmbig=false;}: statement )?
// Selection statements:
| "if"^
LPAREN! expr RPAREN! statement
( //standard if-else ambiguity
options {
warnWhenFollowAmbig = false;
} :
"else" statement )?
| "switch"^ LPAREN! expr RPAREN! statement
;
conditionalExpr
: logicalOrExpr
( QUESTION^ (expr)? COLON conditionalExpr )?
;
rangeExpr //used in initializers only
: constExpr VARARGS constExpr
{ ## = #(#[NRangeExpr], ##); }
;
castExpr
: ( LPAREN typeName RPAREN )=>
LPAREN^ typeName RPAREN ( castExpr | lcurlyInitializer )
{ ##.setType(NCast); }
| unaryExpr
;
nonemptyAbstractDeclarator
: (
pointerGroup
( (LPAREN
( nonemptyAbstractDeclarator
| parameterTypeList
)?
( COMMA! )?
RPAREN)
| (LBRACKET (expr)? RBRACKET)
)*
| ( (LPAREN
( nonemptyAbstractDeclarator
| parameterTypeList
)?
( COMMA! )?
RPAREN)
| (LBRACKET (expr)? RBRACKET)
)+
)
{ ## = #( #[NNonemptyAbstractDeclarator], ## ); }
;
unaryExpr
: postfixExpr
| INC^ castExpr
| DEC^ castExpr
| u:unaryOperator castExpr { ## = #( #[NUnaryExpr], ## ); }
| "sizeof"^
( ( LPAREN typeName )=> LPAREN typeName RPAREN
| unaryExpr
)
| "__alignof"^
( ( LPAREN typeName )=> LPAREN typeName RPAREN
| unaryExpr
)
| gnuAsmExpr
;
unaryOperator
: BAND
| STAR
| PLUS
| MINUS
| BNOT //also stands for complex conjugation
| LNOT
| LAND //for label dereference (&&label)
| "__real"
| "__imag"
;
gnuAsmExpr
: "asm"^ ("volatile")?
LPAREN stringConst
( options { warnWhenFollowAmbig = false; }:
COLON (strOptExprPair ( COMMA strOptExprPair)* )?
( options { warnWhenFollowAmbig = false; }:
COLON (strOptExprPair ( COMMA strOptExprPair)* )?
)?
)?
( COLON stringConst ( COMMA stringConst)* )?
RPAREN
{ ##.setType(NGnuAsmExpr); }
;
//GCC requires the PARENs
strOptExprPair
: stringConst ( LPAREN expr RPAREN )?
;
primaryExpr
: ID
| Number
| charConst
| stringConst
// JTC:
// ID should catch the enumerator
// leaving it in gives ambiguous err
// | enumerator
| (LPAREN LCURLY) => LPAREN^ compoundStatement[getAScopeName()] RPAREN
| LPAREN^ expr RPAREN { ##.setType(NExpressionGroup); }
;
{
// import CToken;
import java.io.*;
// import LineObject;
import antlr.*;
}
class WLexer extends StdCLexer;
options
{
k = 3;
importVocab = W;
testLiterals = false;
}
tokens {
LITERAL___extension__ = "__extension__";
}
{
public void initialize(String src)
{
setOriginalSource(src);
initialize();
}
public void initialize()
{
literals.put(new ANTLRHashString("__alignof__", this), new Integer(LITERAL___alignof));
literals.put(new ANTLRHashString("__asm", this), new Integer(LITERAL_asm));
literals.put(new ANTLRHashString("__asm__", this), new Integer(LITERAL_asm));
literals.put(new ANTLRHashString("__attribute__", this), new Integer(LITERAL___attribute));
literals.put(new ANTLRHashString("__complex__", this), new Integer(LITERAL___complex));
literals.put(new ANTLRHashString("__const", this), new Integer(LITERAL_const));
literals.put(new ANTLRHashString("__const__", this), new Integer(LITERAL_const));
literals.put(new ANTLRHashString("__imag__", this), new Integer(LITERAL___imag));
literals.put(new ANTLRHashString("__inline", this), new Integer(LITERAL_inline));
literals.put(new ANTLRHashString("__inline__", this), new Integer(LITERAL_inline));
literals.put(new ANTLRHashString("__real__", this), new Integer(LITERAL___real));
literals.put(new ANTLRHashString("__signed", this), new Integer(LITERAL_signed));
literals.put(new ANTLRHashString("__signed__", this), new Integer(LITERAL_signed));
literals.put(new ANTLRHashString("__typeof", this), new Integer(LITERAL_typeof));
literals.put(new ANTLRHashString("__typeof__", this), new Integer(LITERAL_typeof));
literals.put(new ANTLRHashString("__volatile", this), new Integer(LITERAL_volatile));
literals.put(new ANTLRHashString("__volatile__", this), new Integer(LITERAL_volatile));
}
LineObject lineObject = new LineObject();
String originalSource = "";
PreprocessorInfoChannel preprocessorInfoChannel = new PreprocessorInfoChannel();
int tokenNumber = 0;
boolean countingTokens = true;
int deferredLineCount = 0;
public void setCountingTokens(boolean ct)
{
countingTokens = ct;
if ( countingTokens ) {
tokenNumber = 0;
}
else {
tokenNumber = 1;
}
}
public void setOriginalSource(String src)
{
originalSource = src;
lineObject.setSource(src);
}
public void setSource(String src)
{
lineObject.setSource(src);
}
public PreprocessorInfoChannel getPreprocessorInfoChannel()
{
return preprocessorInfoChannel;
}
public void setPreprocessingDirective(String pre)
{
preprocessorInfoChannel.addLineForTokenNumber( pre, new Integer(tokenNumber) );
}
protected Token makeToken(int t)
{
if ( t != Token.SKIP && countingTokens) {
tokenNumber++;
}
CToken tok = (CToken) super.makeToken(t);
tok.setLine(lineObject.line);
tok.setSource(lineObject.source);
tok.setTokenNumber(tokenNumber);
lineObject.line += deferredLineCount;
deferredLineCount = 0;
return tok;
}
public void deferredNewline() {
deferredLineCount++;
}
public void newline() {
lineObject.newline();
}
}
Whitespace
: ( ( ' ' | '\t' | '\014')
| "\r\n" { newline(); }
| ( '\n' | '\r' ) { newline(); }
) { _ttype = Token.SKIP; }
;
protected
Escape
: '\\'
( options{warnWhenFollowAmbig=false;}:
~('0'..'7' | 'x')
| ('0'..'3') ( options{warnWhenFollowAmbig=false;}: Digit )*
| ('4'..'7') ( options{warnWhenFollowAmbig=false;}: Digit )*
| 'x' ( options{warnWhenFollowAmbig=false;}: Digit | 'a'..'f' | 'A'..'F' )+
)
;
protected IntSuffix
: 'L'
| 'l'
| 'U'
| 'u'
| 'I'
| 'i'
| 'J'
| 'j'
;
protected NumberSuffix
:
IntSuffix
| 'F'
| 'f'
;
Number
: ( ( Digit )+ ( '.' | 'e' | 'E' ) )=> ( Digit )+
( '.' ( Digit )* ( Exponent )?
| Exponent
)
( NumberSuffix
)*
| ( "..." )=> "..." { _ttype = VARARGS; }
| '.' { _ttype = DOT; }
( ( Digit )+ ( Exponent )?
{ _ttype = Number; }
( NumberSuffix
)*
)?
| '0' ( '0'..'7' )*
( NumberSuffix
)*
| '1'..'9' ( Digit )*
( NumberSuffix
)*
| '0' ( 'x' | 'X' ) ( 'a'..'f' | 'A'..'F' | Digit )+
( IntSuffix
)*
;
IDMEAT
:
i:ID {
if ( i.getType() == LITERAL___extension__ ) {
$setType(Token.SKIP);
}
else {
$setType(i.getType());
}
}
;
protected ID
options
{
testLiterals = true;
}
: ( 'a'..'z' | 'A'..'Z' | '_' | '$')
( 'a'..'z' | 'A'..'Z' | '_' | '$' | '0'..'9' )*
;
WideCharLiteral
:
'L' CharLiteral
{ $setType(CharLiteral); }
;
WideStringLiteral
:
'L' StringLiteral
{ $setType(StringLiteral); }
;
StringLiteral
:
'"'
( ('\\' ~('\n'))=> Escape
| ( '\r' { newline(); }
| '\n' {
newline();
}
| '\\' '\n' {
newline();
}
)
| ~( '"' | '\r' | '\n' | '\\' )
)*
'"'
;

File diff suppressed because it is too large Load Diff

View File

@ -1,162 +0,0 @@
// $ANTLR 2.7.2: "expandedWParser.g" -> "WLexer.java"$
package processing.app.preproc;
import java.io.*;
import antlr.CommonAST;
import antlr.DumpASTVisitor;
public interface WTokenTypes {
int EOF = 1;
int NULL_TREE_LOOKAHEAD = 3;
int LITERAL_typedef = 4;
int LITERAL_asm = 5;
int LITERAL_volatile = 6;
int LCURLY = 7;
int RCURLY = 8;
int SEMI = 9;
int LITERAL_struct = 10;
int LITERAL_union = 11;
int LITERAL_enum = 12;
int LITERAL_auto = 13;
int LITERAL_register = 14;
int LITERAL_extern = 15;
int LITERAL_static = 16;
int LITERAL_const = 17;
int LITERAL_void = 18;
int LITERAL_char = 19;
int LITERAL_short = 20;
int LITERAL_int = 21;
int LITERAL_long = 22;
int LITERAL_float = 23;
int LITERAL_double = 24;
int LITERAL_signed = 25;
int LITERAL_unsigned = 26;
int ID = 27;
int COMMA = 28;
int COLON = 29;
int ASSIGN = 30;
int STAR = 31;
int LPAREN = 32;
int RPAREN = 33;
int LBRACKET = 34;
int RBRACKET = 35;
int VARARGS = 36;
int LITERAL_while = 37;
int LITERAL_do = 38;
int LITERAL_for = 39;
int LITERAL_goto = 40;
int LITERAL_continue = 41;
int LITERAL_break = 42;
int LITERAL_return = 43;
int LITERAL_case = 44;
int LITERAL_default = 45;
int LITERAL_if = 46;
int LITERAL_else = 47;
int LITERAL_switch = 48;
int DIV_ASSIGN = 49;
int PLUS_ASSIGN = 50;
int MINUS_ASSIGN = 51;
int STAR_ASSIGN = 52;
int MOD_ASSIGN = 53;
int RSHIFT_ASSIGN = 54;
int LSHIFT_ASSIGN = 55;
int BAND_ASSIGN = 56;
int BOR_ASSIGN = 57;
int BXOR_ASSIGN = 58;
int QUESTION = 59;
int LOR = 60;
int LAND = 61;
int BOR = 62;
int BXOR = 63;
int BAND = 64;
int EQUAL = 65;
int NOT_EQUAL = 66;
int LT = 67;
int LTE = 68;
int GT = 69;
int GTE = 70;
int LSHIFT = 71;
int RSHIFT = 72;
int PLUS = 73;
int MINUS = 74;
int DIV = 75;
int MOD = 76;
int INC = 77;
int DEC = 78;
int LITERAL_sizeof = 79;
int BNOT = 80;
int LNOT = 81;
int PTR = 82;
int DOT = 83;
int CharLiteral = 84;
int StringLiteral = 85;
int IntOctalConst = 86;
int LongOctalConst = 87;
int UnsignedOctalConst = 88;
int IntIntConst = 89;
int LongIntConst = 90;
int UnsignedIntConst = 91;
int IntHexConst = 92;
int LongHexConst = 93;
int UnsignedHexConst = 94;
int FloatDoubleConst = 95;
int DoubleDoubleConst = 96;
int LongDoubleConst = 97;
int NTypedefName = 98;
int NInitDecl = 99;
int NDeclarator = 100;
int NStructDeclarator = 101;
int NDeclaration = 102;
int NCast = 103;
int NPointerGroup = 104;
int NExpressionGroup = 105;
int NFunctionCallArgs = 106;
int NNonemptyAbstractDeclarator = 107;
int NInitializer = 108;
int NStatementExpr = 109;
int NEmptyExpression = 110;
int NParameterTypeList = 111;
int NFunctionDef = 112;
int NCompoundStatement = 113;
int NParameterDeclaration = 114;
int NCommaExpr = 115;
int NUnaryExpr = 116;
int NLabel = 117;
int NPostfixExpr = 118;
int NRangeExpr = 119;
int NStringSeq = 120;
int NInitializerElementLabel = 121;
int NLcurlyInitializer = 122;
int NAsmAttribute = 123;
int NGnuAsmExpr = 124;
int NTypeMissing = 125;
int Vocabulary = 126;
int Whitespace = 127;
int Comment = 128;
int CPPComment = 129;
int PREPROC_DIRECTIVE = 130;
int Space = 131;
int LineDirective = 132;
int BadStringLiteral = 133;
int Escape = 134;
int Digit = 135;
int LongSuffix = 136;
int UnsignedSuffix = 137;
int FloatSuffix = 138;
int Exponent = 139;
int Number = 140;
int LITERAL___label__ = 141;
int LITERAL_inline = 142;
int LITERAL_byte = 143;
int LITERAL_boolean = 144;
int LITERAL_Servo = 145;
int LITERAL_Wire = 146;
int LITERAL_typeof = 147;
int LITERAL___complex = 148;
int LITERAL___attribute = 149;
int LITERAL___alignof = 150;
int LITERAL___real = 151;
int LITERAL___imag = 152;
}

View File

@ -1,151 +0,0 @@
// $ANTLR 2.7.2: expandedWParser.g -> WTokenTypes.txt$
W // output token vocab name
LITERAL_typedef="typedef"=4
LITERAL_asm="asm"=5
LITERAL_volatile="volatile"=6
LCURLY=7
RCURLY=8
SEMI=9
LITERAL_struct="struct"=10
LITERAL_union="union"=11
LITERAL_enum="enum"=12
LITERAL_auto="auto"=13
LITERAL_register="register"=14
LITERAL_extern="extern"=15
LITERAL_static="static"=16
LITERAL_const="const"=17
LITERAL_void="void"=18
LITERAL_char="char"=19
LITERAL_short="short"=20
LITERAL_int="int"=21
LITERAL_long="long"=22
LITERAL_float="float"=23
LITERAL_double="double"=24
LITERAL_signed="signed"=25
LITERAL_unsigned="unsigned"=26
ID=27
COMMA=28
COLON=29
ASSIGN=30
STAR=31
LPAREN=32
RPAREN=33
LBRACKET=34
RBRACKET=35
VARARGS=36
LITERAL_while="while"=37
LITERAL_do="do"=38
LITERAL_for="for"=39
LITERAL_goto="goto"=40
LITERAL_continue="continue"=41
LITERAL_break="break"=42
LITERAL_return="return"=43
LITERAL_case="case"=44
LITERAL_default="default"=45
LITERAL_if="if"=46
LITERAL_else="else"=47
LITERAL_switch="switch"=48
DIV_ASSIGN=49
PLUS_ASSIGN=50
MINUS_ASSIGN=51
STAR_ASSIGN=52
MOD_ASSIGN=53
RSHIFT_ASSIGN=54
LSHIFT_ASSIGN=55
BAND_ASSIGN=56
BOR_ASSIGN=57
BXOR_ASSIGN=58
QUESTION=59
LOR=60
LAND=61
BOR=62
BXOR=63
BAND=64
EQUAL=65
NOT_EQUAL=66
LT=67
LTE=68
GT=69
GTE=70
LSHIFT=71
RSHIFT=72
PLUS=73
MINUS=74
DIV=75
MOD=76
INC=77
DEC=78
LITERAL_sizeof="sizeof"=79
BNOT=80
LNOT=81
PTR=82
DOT=83
CharLiteral=84
StringLiteral=85
IntOctalConst=86
LongOctalConst=87
UnsignedOctalConst=88
IntIntConst=89
LongIntConst=90
UnsignedIntConst=91
IntHexConst=92
LongHexConst=93
UnsignedHexConst=94
FloatDoubleConst=95
DoubleDoubleConst=96
LongDoubleConst=97
NTypedefName=98
NInitDecl=99
NDeclarator=100
NStructDeclarator=101
NDeclaration=102
NCast=103
NPointerGroup=104
NExpressionGroup=105
NFunctionCallArgs=106
NNonemptyAbstractDeclarator=107
NInitializer=108
NStatementExpr=109
NEmptyExpression=110
NParameterTypeList=111
NFunctionDef=112
NCompoundStatement=113
NParameterDeclaration=114
NCommaExpr=115
NUnaryExpr=116
NLabel=117
NPostfixExpr=118
NRangeExpr=119
NStringSeq=120
NInitializerElementLabel=121
NLcurlyInitializer=122
NAsmAttribute=123
NGnuAsmExpr=124
NTypeMissing=125
Vocabulary=126
Whitespace=127
Comment=128
CPPComment=129
PREPROC_DIRECTIVE("a line directive")=130
Space=131
LineDirective=132
BadStringLiteral=133
Escape=134
Digit=135
LongSuffix=136
UnsignedSuffix=137
FloatSuffix=138
Exponent=139
Number=140
LITERAL___label__="__label__"=141
LITERAL_inline="inline"=142
LITERAL_byte="byte"=143
LITERAL_boolean="boolean"=144
LITERAL_Servo="Servo"=145
LITERAL_Wire="Wire"=146
LITERAL_typeof="typeof"=147
LITERAL___complex="__complex"=148
LITERAL___attribute="__attribute"=149
LITERAL___alignof="__alignof"=150
LITERAL___real="__real"=151
LITERAL___imag="__imag"=152

View File

@ -1,857 +0,0 @@
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Non, Inc. 1998 -- All Rights Reserved
PROJECT: C Compiler
MODULE: WTreeParser
FILE: WTreeParser.g
AUTHOR: Monty Zukowski (jamz@cdsnet.net) April 28, 1998
MODIFICATIONS: Hernando Barragan added support for the Wiring language
DESCRIPTION:
This tree grammar is for a Gnu C AST. No actions in it,
subclass to do something useful.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
header {
package processing.app.preproc;
import java.io.*;
import antlr.CommonAST;
import antlr.DumpASTVisitor;
}
class WTreeParser extends TreeParser;
options
{
importVocab = W;
buildAST = false;
ASTLabelType = "TNode";
// Copied following options from java grammar.
codeGenMakeSwitchThreshold = 2;
codeGenBitsetTestThreshold = 3;
}
{
int traceDepth = 0;
public void reportError(RecognitionException ex) {
if ( ex != null) {
System.err.println("ANTLR Tree Parsing RecognitionException Error: " + ex.getClass().getName() + " " + ex );
ex.printStackTrace(System.err);
}
}
public void reportError(NoViableAltException ex) {
System.err.println("ANTLR Tree Parsing NoViableAltException Error: " + ex.toString());
TNode.printTree( ex.node );
ex.printStackTrace(System.err);
}
public void reportError(MismatchedTokenException ex) {
if ( ex != null) {
TNode.printTree( ex.node );
System.err.println("ANTLR Tree Parsing MismatchedTokenException Error: " + ex );
ex.printStackTrace(System.err);
}
}
public void reportError(String s) {
System.err.println("ANTLR Error from String: " + s);
}
public void reportWarning(String s) {
System.err.println("ANTLR Warning from String: " + s);
}
protected void match(AST t, int ttype) throws MismatchedTokenException {
//System.out.println("match("+ttype+"); cursor is "+t);
super.match(t, ttype);
}
public void match(AST t, BitSet b) throws MismatchedTokenException {
//System.out.println("match("+b+"); cursor is "+t);
super.match(t, b);
}
protected void matchNot(AST t, int ttype) throws MismatchedTokenException {
//System.out.println("matchNot("+ttype+"); cursor is "+t);
super.matchNot(t, ttype);
}
public void traceIn(String rname, AST t) {
traceDepth += 1;
for (int x=0; x<traceDepth; x++) System.out.print(" ");
super.traceIn(rname, t);
}
public void traceOut(String rname, AST t) {
for (int x=0; x<traceDepth; x++) System.out.print(" ");
super.traceOut(rname, t);
traceDepth -= 1;
}
}
translationUnit options {
defaultErrorHandler=false;
}
: ( externalList )?
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
externalList
: ( externalDef )+
;
externalDef
: declaration
| functionDef
| asm_expr
| SEMI
| typelessDeclaration
;
typelessDeclaration
: #(NTypeMissing initDeclList SEMI)
;
asm_expr
: #( "asm" ( "volatile" )? LCURLY expr RCURLY ( SEMI )+ )
;
declaration
: #( NDeclaration
declSpecifiers
(
initDeclList
)?
( SEMI )+
)
;
declSpecifiers
: ( storageClassSpecifier
| typeQualifier
| typeSpecifier
)+
;
storageClassSpecifier
: "auto"
| "register"
| "typedef"
| functionStorageClassSpecifier
;
functionStorageClassSpecifier
: "extern"
| "static"
| "inline"
;
typeQualifier
: "const"
| "volatile"
;
typeSpecifier
: "void"
| "char"
| "short"
| "int"
| "long"
| "float"
| "double"
| "signed"
| "unsigned"
| "byte"
| "boolean"
| "Servo"
| "Wire"
| structSpecifier ( attributeDecl )*
| unionSpecifier ( attributeDecl )*
| enumSpecifier
| typedefName
| #("typeof" LPAREN
( (typeName )=> typeName
| expr
)
RPAREN
)
| "__complex"
;
typedefName
: #(NTypedefName ID)
;
structSpecifier
: #( "struct" structOrUnionBody )
;
unionSpecifier
: #( "union" structOrUnionBody )
;
structOrUnionBody
: ( (ID LCURLY) => ID LCURLY
( structDeclarationList )?
RCURLY
| LCURLY
( structDeclarationList )?
RCURLY
| ID
)
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
structDeclarationList
: ( structDeclaration )+
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
structDeclaration
: specifierQualifierList structDeclaratorList
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
specifierQualifierList
: (
typeSpecifier
| typeQualifier
)+
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
structDeclaratorList
: ( structDeclarator )+
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
structDeclarator
:
#( NStructDeclarator
( declarator )?
( COLON expr )?
( attributeDecl )*
)
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
enumSpecifier
: #( "enum"
( ID )?
( LCURLY enumList RCURLY )?
)
;
enumList
: ( enumerator )+
;
enumerator
: ID ( ASSIGN expr )?
;
attributeDecl:
#( "__attribute" (.)* )
| #( NAsmAttribute LPAREN expr RPAREN )
;
initDeclList
: ( initDecl )+
;
initDecl
{ String declName = ""; }
: #( NInitDecl
declarator
( attributeDecl )*
( ASSIGN initializer
| COLON expr
)?
)
;
pointerGroup
: #( NPointerGroup ( STAR ( typeQualifier )* )+ )
;
idList
: ID ( COMMA ID )*
;
initializer
: #( NInitializer (initializerElementLabel)? expr )
| lcurlyInitializer
;
initializerElementLabel
: #( NInitializerElementLabel
(
( LBRACKET expr RBRACKET (ASSIGN)? )
| ID COLON
| DOT ID ASSIGN
)
)
;
lcurlyInitializer
: #( NLcurlyInitializer
initializerList
RCURLY
)
;
initializerList
: ( initializer )*
;
declarator
: #( NDeclarator
( pointerGroup )?
( id:ID
| LPAREN declarator RPAREN
)
( #( NParameterTypeList
(
parameterTypeList
| (idList)?
)
RPAREN
)
| LBRACKET ( expr )? RBRACKET
)*
)
;
parameterTypeList
: ( parameterDeclaration ( COMMA | SEMI )? )+ ( VARARGS )?
;
parameterDeclaration
: #( NParameterDeclaration
declSpecifiers
(declarator | nonemptyAbstractDeclarator)?
)
;
functionDef
: #( NFunctionDef
( functionDeclSpecifiers)?
declarator
(declaration | VARARGS)*
compoundStatement
)
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
functionDeclSpecifiers
:
( functionStorageClassSpecifier
| typeQualifier
| typeSpecifier
)+
;
declarationList
:
( //ANTLR doesn't know that declarationList properly eats all the declarations
//so it warns about the ambiguity
options {
warnWhenFollowAmbig = false;
} :
localLabelDecl
| declaration
)+
;
localLabelDecl
: #("__label__" (ID)+ )
;
compoundStatement
: #( NCompoundStatement
( declarationList
| functionDef
)*
( statementList )?
RCURLY
)
;
statementList
: ( statement )+
;
statement
: statementBody
;
statementBody
: SEMI // Empty statements
| compoundStatement // Group of statements
| #(NStatementExpr expr) // Expressions
// Iteration statements:
| #( "while" expr statement )
| #( "do" statement expr )
| #( "for"
expr expr expr
statement
)
// Jump statements:
| #( "goto" expr )
| "continue"
| "break"
| #( "return" ( expr )? )
// Labeled statements:
| #( NLabel ID (statement)? )
| #( "case" expr (statement)? )
| #( "default" (statement)? )
// Selection statements:
| #( "if"
expr statement
( "else" statement )?
)
| #( "switch" expr statement )
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
expr
: assignExpr
| conditionalExpr
| logicalOrExpr
| logicalAndExpr
| inclusiveOrExpr
| exclusiveOrExpr
| bitAndExpr
| equalityExpr
| relationalExpr
| shiftExpr
| additiveExpr
| multExpr
| castExpr
| unaryExpr
| postfixExpr
| primaryExpr
| commaExpr
| emptyExpr
| compoundStatementExpr
| initializer
| rangeExpr
| gnuAsmExpr
;
commaExpr
: #(NCommaExpr expr expr)
;
emptyExpr
: NEmptyExpression
;
compoundStatementExpr
: #(LPAREN compoundStatement RPAREN)
;
rangeExpr
: #(NRangeExpr expr VARARGS expr)
;
gnuAsmExpr
: #(NGnuAsmExpr
("volatile")?
LPAREN stringConst
( options { warnWhenFollowAmbig = false; }:
COLON (strOptExprPair ( COMMA strOptExprPair)* )?
( options { warnWhenFollowAmbig = false; }:
COLON (strOptExprPair ( COMMA strOptExprPair)* )?
)?
)?
( COLON stringConst ( COMMA stringConst)* )?
RPAREN
)
;
strOptExprPair
: stringConst ( LPAREN expr RPAREN )?
;
assignExpr
: #( ASSIGN expr expr)
| #( DIV_ASSIGN expr expr)
| #( PLUS_ASSIGN expr expr)
| #( MINUS_ASSIGN expr expr)
| #( STAR_ASSIGN expr expr)
| #( MOD_ASSIGN expr expr)
| #( RSHIFT_ASSIGN expr expr)
| #( LSHIFT_ASSIGN expr expr)
| #( BAND_ASSIGN expr expr)
| #( BOR_ASSIGN expr expr)
| #( BXOR_ASSIGN expr expr)
;
conditionalExpr
: #( QUESTION expr (expr)? COLON expr )
;
logicalOrExpr
: #( LOR expr expr)
;
logicalAndExpr
: #( LAND expr expr )
;
inclusiveOrExpr
: #( BOR expr expr )
;
exclusiveOrExpr
: #( BXOR expr expr )
;
bitAndExpr
: #( BAND expr expr )
;
equalityExpr
: #( EQUAL expr expr)
| #( NOT_EQUAL expr expr)
;
relationalExpr
: #( LT expr expr)
| #( LTE expr expr)
| #( GT expr expr)
| #( GTE expr expr)
;
shiftExpr
: #( LSHIFT expr expr)
| #( RSHIFT expr expr)
;
additiveExpr
: #( PLUS expr expr)
| #( MINUS expr expr)
;
multExpr
: #( STAR expr expr)
| #( DIV expr expr)
| #( MOD expr expr)
;
castExpr
: #( NCast typeName RPAREN expr)
;
typeName
: specifierQualifierList (nonemptyAbstractDeclarator)?
;
nonemptyAbstractDeclarator
: #( NNonemptyAbstractDeclarator
( pointerGroup
( (LPAREN
( nonemptyAbstractDeclarator
| parameterTypeList
)?
RPAREN)
| (LBRACKET (expr)? RBRACKET)
)*
| ( (LPAREN
( nonemptyAbstractDeclarator
| parameterTypeList
)?
RPAREN)
| (LBRACKET (expr)? RBRACKET)
)+
)
)
;
unaryExpr
: #( INC expr )
| #( DEC expr )
| #( NUnaryExpr unaryOperator expr)
| #( "sizeof"
( ( LPAREN typeName )=> LPAREN typeName RPAREN
| expr
)
)
| #( "__alignof"
( ( LPAREN typeName )=> LPAREN typeName RPAREN
| expr
)
)
;
/*
exception
catch [RecognitionException ex]
{
reportError(ex);
System.out.println("PROBLEM TREE:\n"
+ _t.toStringList());
if (_t!=null) {_t = _t.getNextSibling();}
}
*/
unaryOperator
: BAND
| STAR
| PLUS
| MINUS
| BNOT
| LNOT
| LAND
| "__real"
| "__imag"
;
postfixExpr
: #( NPostfixExpr
primaryExpr
( PTR ID
| DOT ID
| #( NFunctionCallArgs (argExprList)? RPAREN )
| LBRACKET expr RBRACKET
| INC
| DEC
)+
)
;
primaryExpr
: ID
| Number
| charConst
| stringConst
// JTC:
// ID should catch the enumerator
// leaving it in gives ambiguous err
// | enumerator
| #( NExpressionGroup expr )
;
argExprList
: ( expr )+
;
protected
charConst
: CharLiteral
;
protected
stringConst
: #(NStringSeq (StringLiteral)+)
;
protected
intConst
: IntOctalConst
| LongOctalConst
| UnsignedOctalConst
| IntIntConst
| LongIntConst
| UnsignedIntConst
| IntHexConst
| LongHexConst
| UnsignedHexConst
;
protected
floatConst
: FloatDoubleConst
| DoubleDoubleConst
| LongDoubleConst
;

File diff suppressed because it is too large Load Diff

View File

@ -1,162 +0,0 @@
// $ANTLR 2.7.2: "WTreeParser.g" -> "WTreeParser.java"$
package processing.app.preproc;
import java.io.*;
import antlr.CommonAST;
import antlr.DumpASTVisitor;
public interface WTreeParserTokenTypes {
int EOF = 1;
int NULL_TREE_LOOKAHEAD = 3;
int LITERAL_typedef = 4;
int LITERAL_asm = 5;
int LITERAL_volatile = 6;
int LCURLY = 7;
int RCURLY = 8;
int SEMI = 9;
int LITERAL_struct = 10;
int LITERAL_union = 11;
int LITERAL_enum = 12;
int LITERAL_auto = 13;
int LITERAL_register = 14;
int LITERAL_extern = 15;
int LITERAL_static = 16;
int LITERAL_const = 17;
int LITERAL_void = 18;
int LITERAL_char = 19;
int LITERAL_short = 20;
int LITERAL_int = 21;
int LITERAL_long = 22;
int LITERAL_float = 23;
int LITERAL_double = 24;
int LITERAL_signed = 25;
int LITERAL_unsigned = 26;
int ID = 27;
int COMMA = 28;
int COLON = 29;
int ASSIGN = 30;
int STAR = 31;
int LPAREN = 32;
int RPAREN = 33;
int LBRACKET = 34;
int RBRACKET = 35;
int VARARGS = 36;
int LITERAL_while = 37;
int LITERAL_do = 38;
int LITERAL_for = 39;
int LITERAL_goto = 40;
int LITERAL_continue = 41;
int LITERAL_break = 42;
int LITERAL_return = 43;
int LITERAL_case = 44;
int LITERAL_default = 45;
int LITERAL_if = 46;
int LITERAL_else = 47;
int LITERAL_switch = 48;
int DIV_ASSIGN = 49;
int PLUS_ASSIGN = 50;
int MINUS_ASSIGN = 51;
int STAR_ASSIGN = 52;
int MOD_ASSIGN = 53;
int RSHIFT_ASSIGN = 54;
int LSHIFT_ASSIGN = 55;
int BAND_ASSIGN = 56;
int BOR_ASSIGN = 57;
int BXOR_ASSIGN = 58;
int QUESTION = 59;
int LOR = 60;
int LAND = 61;
int BOR = 62;
int BXOR = 63;
int BAND = 64;
int EQUAL = 65;
int NOT_EQUAL = 66;
int LT = 67;
int LTE = 68;
int GT = 69;
int GTE = 70;
int LSHIFT = 71;
int RSHIFT = 72;
int PLUS = 73;
int MINUS = 74;
int DIV = 75;
int MOD = 76;
int INC = 77;
int DEC = 78;
int LITERAL_sizeof = 79;
int BNOT = 80;
int LNOT = 81;
int PTR = 82;
int DOT = 83;
int CharLiteral = 84;
int StringLiteral = 85;
int IntOctalConst = 86;
int LongOctalConst = 87;
int UnsignedOctalConst = 88;
int IntIntConst = 89;
int LongIntConst = 90;
int UnsignedIntConst = 91;
int IntHexConst = 92;
int LongHexConst = 93;
int UnsignedHexConst = 94;
int FloatDoubleConst = 95;
int DoubleDoubleConst = 96;
int LongDoubleConst = 97;
int NTypedefName = 98;
int NInitDecl = 99;
int NDeclarator = 100;
int NStructDeclarator = 101;
int NDeclaration = 102;
int NCast = 103;
int NPointerGroup = 104;
int NExpressionGroup = 105;
int NFunctionCallArgs = 106;
int NNonemptyAbstractDeclarator = 107;
int NInitializer = 108;
int NStatementExpr = 109;
int NEmptyExpression = 110;
int NParameterTypeList = 111;
int NFunctionDef = 112;
int NCompoundStatement = 113;
int NParameterDeclaration = 114;
int NCommaExpr = 115;
int NUnaryExpr = 116;
int NLabel = 117;
int NPostfixExpr = 118;
int NRangeExpr = 119;
int NStringSeq = 120;
int NInitializerElementLabel = 121;
int NLcurlyInitializer = 122;
int NAsmAttribute = 123;
int NGnuAsmExpr = 124;
int NTypeMissing = 125;
int Vocabulary = 126;
int Whitespace = 127;
int Comment = 128;
int CPPComment = 129;
int PREPROC_DIRECTIVE = 130;
int Space = 131;
int LineDirective = 132;
int BadStringLiteral = 133;
int Escape = 134;
int Digit = 135;
int LongSuffix = 136;
int UnsignedSuffix = 137;
int FloatSuffix = 138;
int Exponent = 139;
int Number = 140;
int LITERAL___label__ = 141;
int LITERAL_inline = 142;
int LITERAL_byte = 143;
int LITERAL_boolean = 144;
int LITERAL_Servo = 145;
int LITERAL_Wire = 146;
int LITERAL_typeof = 147;
int LITERAL___complex = 148;
int LITERAL___attribute = 149;
int LITERAL___alignof = 150;
int LITERAL___real = 151;
int LITERAL___imag = 152;
}

View File

@ -1,151 +0,0 @@
// $ANTLR 2.7.2: WTreeParser.g -> WTreeParserTokenTypes.txt$
WTreeParser // output token vocab name
LITERAL_typedef="typedef"=4
LITERAL_asm="asm"=5
LITERAL_volatile="volatile"=6
LCURLY=7
RCURLY=8
SEMI=9
LITERAL_struct="struct"=10
LITERAL_union="union"=11
LITERAL_enum="enum"=12
LITERAL_auto="auto"=13
LITERAL_register="register"=14
LITERAL_extern="extern"=15
LITERAL_static="static"=16
LITERAL_const="const"=17
LITERAL_void="void"=18
LITERAL_char="char"=19
LITERAL_short="short"=20
LITERAL_int="int"=21
LITERAL_long="long"=22
LITERAL_float="float"=23
LITERAL_double="double"=24
LITERAL_signed="signed"=25
LITERAL_unsigned="unsigned"=26
ID=27
COMMA=28
COLON=29
ASSIGN=30
STAR=31
LPAREN=32
RPAREN=33
LBRACKET=34
RBRACKET=35
VARARGS=36
LITERAL_while="while"=37
LITERAL_do="do"=38
LITERAL_for="for"=39
LITERAL_goto="goto"=40
LITERAL_continue="continue"=41
LITERAL_break="break"=42
LITERAL_return="return"=43
LITERAL_case="case"=44
LITERAL_default="default"=45
LITERAL_if="if"=46
LITERAL_else="else"=47
LITERAL_switch="switch"=48
DIV_ASSIGN=49
PLUS_ASSIGN=50
MINUS_ASSIGN=51
STAR_ASSIGN=52
MOD_ASSIGN=53
RSHIFT_ASSIGN=54
LSHIFT_ASSIGN=55
BAND_ASSIGN=56
BOR_ASSIGN=57
BXOR_ASSIGN=58
QUESTION=59
LOR=60
LAND=61
BOR=62
BXOR=63
BAND=64
EQUAL=65
NOT_EQUAL=66
LT=67
LTE=68
GT=69
GTE=70
LSHIFT=71
RSHIFT=72
PLUS=73
MINUS=74
DIV=75
MOD=76
INC=77
DEC=78
LITERAL_sizeof="sizeof"=79
BNOT=80
LNOT=81
PTR=82
DOT=83
CharLiteral=84
StringLiteral=85
IntOctalConst=86
LongOctalConst=87
UnsignedOctalConst=88
IntIntConst=89
LongIntConst=90
UnsignedIntConst=91
IntHexConst=92
LongHexConst=93
UnsignedHexConst=94
FloatDoubleConst=95
DoubleDoubleConst=96
LongDoubleConst=97
NTypedefName=98
NInitDecl=99
NDeclarator=100
NStructDeclarator=101
NDeclaration=102
NCast=103
NPointerGroup=104
NExpressionGroup=105
NFunctionCallArgs=106
NNonemptyAbstractDeclarator=107
NInitializer=108
NStatementExpr=109
NEmptyExpression=110
NParameterTypeList=111
NFunctionDef=112
NCompoundStatement=113
NParameterDeclaration=114
NCommaExpr=115
NUnaryExpr=116
NLabel=117
NPostfixExpr=118
NRangeExpr=119
NStringSeq=120
NInitializerElementLabel=121
NLcurlyInitializer=122
NAsmAttribute=123
NGnuAsmExpr=124
NTypeMissing=125
Vocabulary=126
Whitespace=127
Comment=128
CPPComment=129
PREPROC_DIRECTIVE("a line directive")=130
Space=131
LineDirective=132
BadStringLiteral=133
Escape=134
Digit=135
LongSuffix=136
UnsignedSuffix=137
FloatSuffix=138
Exponent=139
Number=140
LITERAL___label__="__label__"=141
LITERAL_inline="inline"=142
LITERAL_byte="byte"=143
LITERAL_boolean="boolean"=144
LITERAL_Servo="Servo"=145
LITERAL_Wire="Wire"=146
LITERAL_typeof="typeof"=147
LITERAL___complex="__complex"=148
LITERAL___attribute="__attribute"=149
LITERAL___alignof="__alignof"=150
LITERAL___real="__real"=151
LITERAL___imag="__imag"=152

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,150 +0,0 @@
// this is a whitespace and other invisible token torture test for the ANTLR-based
// preprocessor. edit pde.properties and set "editor.save_build_files" to true.
// then, build this in processing. next, use
//
// diff -u --strip-trailing-cr \
// work/sketchbook/default/whitespace_test/whitespace_test.pde \
// work/lib/build/MyDemo.java
//
// to compare the files before and after preprocessing. There should not be
// any differences.
import // comment test
java.io.*;
// comment 1
public class // post-class comment
// comment2
MyDemo extends BApplet implements // foo
java.lang. // bar
Cloneable {
//argh
public // foo
String // bar
fff = /*rheet */ "stuff";
static /*a*/ {
/*foo*/
/*bar*/
six = 6;
} /* b*/
static /*a*/ final /*b*/ int six;
void setup()
{
size(200, 200);
background(255);
this . fff = /* ook */ (String)/*foo*/"yo";
rectMode(CENTER_DIAMETER); // comment 1a
noStroke();
fill(255, 204, 0);
int q = /*a*/ - /*b*/ 1;
boolean c = /*a*/ ! /*b*/ true;
}
int foo() /*a*/ throws /*b*/ java.lang.Exception /*c*/
{
int b = 7;
switch /*a*/ ( /*b*/ b /*c*/ ) {
case /*d*/ 1 /*e*/: /*f*/
int c=9;
/*g*/
break; /*h*/
default /*i*/ :
int d=9;
break;
}
try { /* qq */
loop(); /* rr */
} catch /*ss*/ (java.lang.Exception ex) /*tt*/ {
b = 8; /*tut*/
throw /*utu*/ ex;
} /*uu*/ finally /*vv*/ {
b = 9;
} /*ww*/
b /*aaa*/ = /*bbb*/ true /*ccc*/ ? /*ddd*/ 0 /*eee*/
: /* fff*/ 1 /*ggg*/;
return /*a*/ 5 /*b*/;
}
// comment 2
void loop()
{
int arr1 /* VVV */ [ /* XXX */] /*YYY*/ ;
int[] arr2 = { /*a*/ 2, 3 /*b*/ } /*c*/ ;
for /*a*/ (/*b*/ int j=0 /*c*/; /*d*/ j<2/*e*/ ; /*f*/ j++ /*g*/)
/*h*/
arr2[1] = 6;
/*foo*/
;
/*bar*/
rect(width-mouseX, height-mouseY, 50, 50);
rect(mouseX, mouseY, 50, 50);
if (/*a*/ arr2[1] == 6/*b*/) {
/*c*/
int d=7;
} /*d*/else /*e*/{
int e=8;
/*f*/
}
int f;
if (/*aa*/ arr2[1] ==6 /*bb*/ )
/*cc*/
f=8; /*dd*/
else /*ee*/
f=10; /*ff*/
while ( /*aaa*/ f < 15) /*bbb*/ {
f ++;
} /*ggg*/
do /* aaaa */ {
f++;
} /*bbbb*/ while /*cccc*/ ( /*a*/ - /*b*/ 20 > f) /*dddd*/;
f = 2 * 3 + 4;
f = ( 2 * 3 ) + 4 + /*aa*/ -/*bb*/1;
f = 2 * ( 3 + 4 ) ;
fff = /*a*/ new /*b*/ String(/*c*/"foo"/*d*/) /*e*/;
int arr3[] = /*a*/ new /*b*/ int/*c*/[/*d*/] /*e*/ {1/*f*/,2};
int arr4[][] = new /*a*/int/*b*/[1][2]/*c*/;
}
class Shoe
{
Shoe(String brand)
{
println(brand);
}
}
class NikeAir extends Shoe
{
NikeAir()
{
/*a*/ super /*b*/ ( /*c*/ "Nike" /*d*/ ) /*e*/ ;
/*aa*/ ( /*bb*/ new /*cc*/ MyDemo /*dd*/ (/*ee*/)/*ff*/)/*gg*/./*hh*/super/*ii*/(/*jj*/5/*kk*/);
}
}
}

View File

@ -88,7 +88,6 @@
33FF070C0965BF760016AC38 /* CopyFiles */,
33FF07130965BFA80016AC38 /* CopyFiles */,
336EA3E309FF84FA0052D765 /* CopyFiles */,
33FF071D0965C1C20016AC38 /* CopyFiles */,
33FF07170965BFFE0016AC38 /* ShellScript */,
);
dependencies = (
@ -107,7 +106,7 @@
33AF61650965C4C600B514A9 /* Resources */,
33AF61660965C4C600B514A9 /* JavaArchive */,
33AF61670965C4C600B514A9 /* Frameworks */,
33CF03C809662DA200F2C9A9 /* CopyFiles */,
33CF03C809662DA200F2C9A9 /* Copy Java Resources */,
);
dependencies = (
);
@ -128,7 +127,7 @@
<key>CFBundleIconFile</key>
<string>arduino.icns</string>
<key>CFBundleIdentifier</key>
<string></string>
<string>cc.arduino.Arduino</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@ -161,6 +160,8 @@
<dict>
<key>apple.laf.useScreenMenuBar</key>
<string>true</string>
<key>arduino.app-resources</key>
<string>$APP_PACKAGE/Contents/Resources</string>
</dict>
</dict>
</dict>
@ -172,8 +173,8 @@
/* Begin PBXBuildFile section */
33055EFF0CB8187700824CD9 /* SerialException.java in Sources */ = {isa = PBXBuildFile; fileRef = 33055EFE0CB8187600824CD9 /* SerialException.java */; };
332D4DB609CF147F00BF81F6 /* Sizer.java in Sources */ = {isa = PBXBuildFile; fileRef = 332D4DB509CF147F00BF81F6 /* Sizer.java */; };
335A28F50C8CCB0A00D8A7F4 /* quaqua.jar in CopyFiles */ = {isa = PBXBuildFile; fileRef = 335A28F30C8CCAF700D8A7F4 /* quaqua.jar */; };
335A28FE0C8CCB4000D8A7F4 /* libquaqua.jnilib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 335A28F20C8CCAF700D8A7F4 /* libquaqua.jnilib */; };
335A28F50C8CCB0A00D8A7F4 /* quaqua.jar in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 335A28F30C8CCAF700D8A7F4 /* quaqua.jar */; };
335A28FE0C8CCB4000D8A7F4 /* libquaqua.jnilib in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 335A28F20C8CCAF700D8A7F4 /* libquaqua.jnilib */; };
335A29140C8CCC0900D8A7F4 /* PApplet.java in Sources */ = {isa = PBXBuildFile; fileRef = 335A29070C8CCC0900D8A7F4 /* PApplet.java */; };
335A29150C8CCC0900D8A7F4 /* PConstants.java in Sources */ = {isa = PBXBuildFile; fileRef = 335A29080C8CCC0900D8A7F4 /* PConstants.java */; };
335A29160C8CCC0900D8A7F4 /* PFont.java in Sources */ = {isa = PBXBuildFile; fileRef = 335A29090C8CCC0900D8A7F4 /* PFont.java */; };
@ -192,12 +193,9 @@
3383C03B0CB7CAF400A8FB57 /* hardware in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3383BF8B0CB7C71200A8FB57 /* hardware */; };
338C478A0AA204BE008F2C0D /* FTDIUSBSerialDriver_v2_1_6.dmg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 338C47870AA204B0008F2C0D /* FTDIUSBSerialDriver_v2_1_6.dmg */; };
338C478B0AA204BE008F2C0D /* FTDIUSBSerialDriver_v2_2_6_Intel.dmg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 338C47880AA204B0008F2C0D /* FTDIUSBSerialDriver_v2_2_6_Intel.dmg */; };
339514EE097AEB5900193C89 /* STDCTokenTypes.txt in Resources */ = {isa = PBXBuildFile; fileRef = 33FFFE420965BD110016AC38 /* STDCTokenTypes.txt */; };
339514FA097AEB8000193C89 /* license.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02B60965BD170016AC38 /* license.txt */; };
339514FB097AEB8000193C89 /* readme.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02B70965BD170016AC38 /* readme.txt */; };
33AF61760965C54B00B514A9 /* PreprocessorInfoChannel.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE3D0965BD110016AC38 /* PreprocessorInfoChannel.java */; };
33AF61770965C54B00B514A9 /* EditorListener.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE2C0965BD110016AC38 /* EditorListener.java */; };
33AF61780965C54B00B514A9 /* LineObject.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE3A0965BD110016AC38 /* LineObject.java */; };
33AF61790965C54B00B514A9 /* Serial.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE590965BD110016AC38 /* Serial.java */; };
33AF617A0965C54B00B514A9 /* TextUtilities.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE6D0965BD110016AC38 /* TextUtilities.java */; };
33AF617B0965C54B00B514A9 /* EditorConsole.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE290965BD110016AC38 /* EditorConsole.java */; };
@ -211,50 +209,34 @@
33AF61830965C54B00B514A9 /* SyntaxStyle.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE690965BD110016AC38 /* SyntaxStyle.java */; };
33AF61840965C54B00B514A9 /* Uploader.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE740965BD110016AC38 /* Uploader.java */; };
33AF61850965C54B00B514A9 /* RunnerException.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE580965BD110016AC38 /* RunnerException.java */; };
33AF61860965C54B00B514A9 /* WParser.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE4E0965BD110016AC38 /* WParser.java */; };
33AF61870965C54B00B514A9 /* TextAreaPainter.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE6C0965BD110016AC38 /* TextAreaPainter.java */; };
33AF61880965C54B00B514A9 /* Sketchbook.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE5B0965BD110016AC38 /* Sketchbook.java */; };
33AF61890965C54B00B514A9 /* EditorStatus.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE2D0965BD110016AC38 /* EditorStatus.java */; };
33AF618A0965C54B00B514A9 /* WTokenTypes.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE4F0965BD110016AC38 /* WTokenTypes.java */; };
33AF618B0965C54B00B514A9 /* TextAreaDefaults.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE6B0965BD110016AC38 /* TextAreaDefaults.java */; };
33AF618C0965C54B00B514A9 /* PdePreprocessor.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE3C0965BD110016AC38 /* PdePreprocessor.java */; };
33AF618D0965C54B00B514A9 /* CSymbolTable.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE350965BD110016AC38 /* CSymbolTable.java */; };
33AF618E0965C54B00B514A9 /* SketchHistory.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE5D0965BD110016AC38 /* SketchHistory.java */; };
33AF618F0965C54B00B514A9 /* RunnerClassLoader.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE570965BD110016AC38 /* RunnerClassLoader.java */; };
33AF61900965C54B00B514A9 /* MessageStream.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE320965BD110016AC38 /* MessageStream.java */; };
33AF61910965C54B00B514A9 /* SyntaxUtilities.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE6A0965BD110016AC38 /* SyntaxUtilities.java */; };
33AF61930965C54B00B514A9 /* PresentMode.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE550965BD110016AC38 /* PresentMode.java */; };
33AF61940965C54B00B514A9 /* STDCTokenTypes.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE410965BD110016AC38 /* STDCTokenTypes.java */; };
33AF61950965C54B00B514A9 /* CTokenMarker.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE600965BD110016AC38 /* CTokenMarker.java */; };
33AF61960965C54B00B514A9 /* CToken.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE360965BD110016AC38 /* CToken.java */; };
33AF61970965C54B00B514A9 /* WTreeParserTokenTypes.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE530965BD110016AC38 /* WTreeParserTokenTypes.java */; };
33AF61990965C54B00B514A9 /* Runner.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE560965BD110016AC38 /* Runner.java */; };
33AF619A0965C54B00B514A9 /* TNode.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE430965BD110016AC38 /* TNode.java */; };
33AF619B0965C54B00B514A9 /* KeywordMap.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE640965BD110016AC38 /* KeywordMap.java */; };
33AF619C0965C54B00B514A9 /* ExtendedCommonASTWithHiddenTokens.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE390965BD110016AC38 /* ExtendedCommonASTWithHiddenTokens.java */; };
33AF619D0965C54B00B514A9 /* Sketch.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE5A0965BD110016AC38 /* Sketch.java */; };
33AF619E0965C54B00B514A9 /* WEmitterTokenTypes.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE470965BD110016AC38 /* WEmitterTokenTypes.java */; };
33AF619F0965C54B00B514A9 /* TNodeFactory.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE440965BD110016AC38 /* TNodeFactory.java */; };
33AF61A00965C54B00B514A9 /* Target.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE700965BD110016AC38 /* Target.java */; };
33AF61A10965C54B00B514A9 /* UpdateCheck.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE730965BD110016AC38 /* UpdateCheck.java */; };
33AF61A20965C54B00B514A9 /* InputHandler.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE620965BD110016AC38 /* InputHandler.java */; };
33AF61A30965C54B00B514A9 /* MessageConsumer.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE300965BD110016AC38 /* MessageConsumer.java */; };
33AF61A40965C54B00B514A9 /* WLexer.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE4A0965BD110016AC38 /* WLexer.java */; };
33AF61A50965C54B00B514A9 /* Compiler.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE260965BD100016AC38 /* Compiler.java */; };
33AF61A60965C54B00B514A9 /* AutoFormat.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE720965BD110016AC38 /* AutoFormat.java */; };
33AF61A70965C54B00B514A9 /* StdCLexer.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE3E0965BD110016AC38 /* StdCLexer.java */; };
33AF61A80965C54B00B514A9 /* StdCParser.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE400965BD110016AC38 /* StdCParser.java */; };
33AF61A90965C54B00B514A9 /* PdeKeywords.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE650965BD110016AC38 /* PdeKeywords.java */; };
33AF61AA0965C54B00B514A9 /* Editor.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE270965BD100016AC38 /* Editor.java */; };
33AF61AB0965C54B00B514A9 /* WEmitter.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE460965BD110016AC38 /* WEmitter.java */; };
33AF61AC0965C54B00B514A9 /* SwingWorker.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE5E0965BD110016AC38 /* SwingWorker.java */; };
33AF61AD0965C54B00B514A9 /* DefaultInputHandler.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE610965BD110016AC38 /* DefaultInputHandler.java */; };
33AF61AE0965C54B00B514A9 /* SyntaxDocument.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE680965BD110016AC38 /* SyntaxDocument.java */; };
33AF61AF0965C54B00B514A9 /* WLexerTokenTypes.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE4B0965BD110016AC38 /* WLexerTokenTypes.java */; };
33AF61B00965C54B00B514A9 /* Token.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE6E0965BD110016AC38 /* Token.java */; };
33AF61B10965C54B00B514A9 /* Preferences.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE330965BD110016AC38 /* Preferences.java */; };
33AF61B20965C54B00B514A9 /* PdeTextAreaDefaults.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE660965BD110016AC38 /* PdeTextAreaDefaults.java */; };
33AF61B30965C54B00B514A9 /* WTreeParser.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE520965BD110016AC38 /* WTreeParser.java */; };
33AF61B40965C54B00B514A9 /* JEditTextArea.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE630965BD110016AC38 /* JEditTextArea.java */; };
33AF61B50965C54B00B514A9 /* Base.java in Sources */ = {isa = PBXBuildFile; fileRef = 33FFFE240965BD100016AC38 /* Base.java */; };
33BEDDB209D6DC1300430D5B /* LibraryManager.java in Sources */ = {isa = PBXBuildFile; fileRef = 33BEDDB009D6DC1300430D5B /* LibraryManager.java */; };
@ -262,28 +244,30 @@
33BEDDD609D6E8D800430D5B /* ExportFolder.java in Sources */ = {isa = PBXBuildFile; fileRef = 33BEDDD409D6E8D800430D5B /* ExportFolder.java */; };
33BEE0CE09D7446100430D5B /* Library.java in Sources */ = {isa = PBXBuildFile; fileRef = 33BEE0CD09D7446100430D5B /* Library.java */; };
33CF03B209662CB700F2C9A9 /* arduino.icns in Resources */ = {isa = PBXBuildFile; fileRef = 33CF03B009662CA800F2C9A9 /* arduino.icns */; };
33CF03CC09662DC000F2C9A9 /* mrj.jar in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33AF620C0965D67900B514A9 /* mrj.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33CF03CD09662DC000F2C9A9 /* RXTXcomm.jar in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33AF620F0965D67A00B514A9 /* RXTXcomm.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33CF03CE09662DC000F2C9A9 /* antlr.jar in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33AF620A0965D67800B514A9 /* antlr.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33CF03CF09662DC000F2C9A9 /* registry.jar in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33AF620E0965D67A00B514A9 /* registry.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33CF03D009662DC000F2C9A9 /* oro.jar in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33AF620D0965D67900B514A9 /* oro.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33CF03CC09662DC000F2C9A9 /* mrj.jar in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 33AF620C0965D67900B514A9 /* mrj.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33CF03CD09662DC000F2C9A9 /* RXTXcomm.jar in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 33AF620F0965D67A00B514A9 /* RXTXcomm.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33CF03CE09662DC000F2C9A9 /* antlr.jar in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 33AF620A0965D67800B514A9 /* antlr.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33CF03CF09662DC000F2C9A9 /* registry.jar in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 33AF620E0965D67A00B514A9 /* registry.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33CF03D009662DC000F2C9A9 /* oro.jar in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 33AF620D0965D67900B514A9 /* oro.jar */; settings = {JAVA_ARCHIVE_SUBDIR = ../shared/lib; }; };
33F944E10C2B33560093EB9C /* AvrdudeUploader.java in Sources */ = {isa = PBXBuildFile; fileRef = 33F944E00C2B33560093EB9C /* AvrdudeUploader.java */; };
33FF07100965BF8A0016AC38 /* burn.command in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FFFEAF0965BD110016AC38 /* burn.command */; };
33FF071F0965C1E30016AC38 /* about.jpg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF01DE0965BD160016AC38 /* about.jpg */; };
33FF07220965C1E30016AC38 /* buttons.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02770965BD160016AC38 /* buttons.gif */; };
33FF07230965C1E30016AC38 /* icon.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02780965BD160016AC38 /* icon.gif */; };
33FF07240965C1E30016AC38 /* keywords.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02790965BD160016AC38 /* keywords.txt */; };
33FF07250965C1E30016AC38 /* loading.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF027A0965BD160016AC38 /* loading.gif */; };
33FF07280965C1E30016AC38 /* preferences.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF027D0965BD160016AC38 /* preferences.txt */; };
33FF072A0965C1E30016AC38 /* resize.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF027F0965BD160016AC38 /* resize.gif */; };
33FF072C0965C1E30016AC38 /* tab-sel-left.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02810965BD160016AC38 /* tab-sel-left.gif */; };
33FF072D0965C1E30016AC38 /* tab-sel-menu.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02820965BD160016AC38 /* tab-sel-menu.gif */; };
33FF072E0965C1E30016AC38 /* tab-sel-mid.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02830965BD160016AC38 /* tab-sel-mid.gif */; };
33FF072F0965C1E30016AC38 /* tab-sel-right.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02840965BD160016AC38 /* tab-sel-right.gif */; };
33FF07300965C1E30016AC38 /* tab-unsel-left.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02850965BD160016AC38 /* tab-unsel-left.gif */; };
33FF07310965C1E30016AC38 /* tab-unsel-menu.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02860965BD160016AC38 /* tab-unsel-menu.gif */; };
33FF07320965C1E30016AC38 /* tab-unsel-mid.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02870965BD160016AC38 /* tab-unsel-mid.gif */; };
33FF07330965C1E30016AC38 /* tab-unsel-right.gif in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02880965BD160016AC38 /* tab-unsel-right.gif */; };
33FF071F0965C1E30016AC38 /* about.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 33FF01DE0965BD160016AC38 /* about.jpg */; };
33FF07220965C1E30016AC38 /* buttons.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02770965BD160016AC38 /* buttons.gif */; };
33FF07230965C1E30016AC38 /* icon.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02780965BD160016AC38 /* icon.gif */; };
33FF07240965C1E30016AC38 /* keywords.txt in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02790965BD160016AC38 /* keywords.txt */; };
33FF07250965C1E30016AC38 /* loading.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF027A0965BD160016AC38 /* loading.gif */; };
33FF07280965C1E30016AC38 /* preferences.txt in Resources */ = {isa = PBXBuildFile; fileRef = 33FF027D0965BD160016AC38 /* preferences.txt */; };
33FF072A0965C1E30016AC38 /* resize.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF027F0965BD160016AC38 /* resize.gif */; };
33FF072C0965C1E30016AC38 /* tab-sel-left.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02810965BD160016AC38 /* tab-sel-left.gif */; };
33FF072D0965C1E30016AC38 /* tab-sel-menu.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02820965BD160016AC38 /* tab-sel-menu.gif */; };
33FF072E0965C1E30016AC38 /* tab-sel-mid.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02830965BD160016AC38 /* tab-sel-mid.gif */; };
33FF072F0965C1E30016AC38 /* tab-sel-right.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02840965BD160016AC38 /* tab-sel-right.gif */; };
33FF07300965C1E30016AC38 /* tab-unsel-left.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02850965BD160016AC38 /* tab-unsel-left.gif */; };
33FF07310965C1E30016AC38 /* tab-unsel-menu.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02860965BD160016AC38 /* tab-unsel-menu.gif */; };
33FF07320965C1E30016AC38 /* tab-unsel-mid.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02870965BD160016AC38 /* tab-unsel-mid.gif */; };
33FF07330965C1E30016AC38 /* tab-unsel-right.gif in Resources */ = {isa = PBXBuildFile; fileRef = 33FF02880965BD160016AC38 /* tab-unsel-right.gif */; };
A337296F0D22505C00E82412 /* librxtxSerial.jnilib in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = A33729630D224FA700E82412 /* librxtxSerial.jnilib */; };
A3688DF40D284554003CBAA1 /* applet.html in Resources */ = {isa = PBXBuildFile; fileRef = 33AF620B0965D67900B514A9 /* applet.html */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -366,19 +350,22 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
33CF03C809662DA200F2C9A9 /* CopyFiles */ = {
33CF03C809662DA200F2C9A9 /* Copy Java Resources */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 15;
files = (
335A28F50C8CCB0A00D8A7F4 /* quaqua.jar in CopyFiles */,
33CF03CC09662DC000F2C9A9 /* mrj.jar in CopyFiles */,
33CF03CD09662DC000F2C9A9 /* RXTXcomm.jar in CopyFiles */,
33CF03CE09662DC000F2C9A9 /* antlr.jar in CopyFiles */,
33CF03CF09662DC000F2C9A9 /* registry.jar in CopyFiles */,
33CF03D009662DC000F2C9A9 /* oro.jar in CopyFiles */,
335A28F50C8CCB0A00D8A7F4 /* quaqua.jar in Copy Java Resources */,
33CF03CC09662DC000F2C9A9 /* mrj.jar in Copy Java Resources */,
33CF03CD09662DC000F2C9A9 /* RXTXcomm.jar in Copy Java Resources */,
33CF03CE09662DC000F2C9A9 /* antlr.jar in Copy Java Resources */,
33CF03CF09662DC000F2C9A9 /* registry.jar in Copy Java Resources */,
33CF03D009662DC000F2C9A9 /* oro.jar in Copy Java Resources */,
335A28FE0C8CCB4000D8A7F4 /* libquaqua.jnilib in Copy Java Resources */,
A337296F0D22505C00E82412 /* librxtxSerial.jnilib in Copy Java Resources */,
);
name = "Copy Java Resources";
runOnlyForDeploymentPostprocessing = 0;
};
33FF070C0965BF760016AC38 /* CopyFiles */ = {
@ -402,37 +389,12 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
33FF071D0965C1C20016AC38 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = lib;
dstSubfolderSpec = 16;
files = (
33FF071F0965C1E30016AC38 /* about.jpg in CopyFiles */,
33FF07220965C1E30016AC38 /* buttons.gif in CopyFiles */,
33FF07230965C1E30016AC38 /* icon.gif in CopyFiles */,
33FF07240965C1E30016AC38 /* keywords.txt in CopyFiles */,
33FF07250965C1E30016AC38 /* loading.gif in CopyFiles */,
33FF07280965C1E30016AC38 /* preferences.txt in CopyFiles */,
33FF072A0965C1E30016AC38 /* resize.gif in CopyFiles */,
33FF072C0965C1E30016AC38 /* tab-sel-left.gif in CopyFiles */,
33FF072D0965C1E30016AC38 /* tab-sel-menu.gif in CopyFiles */,
33FF072E0965C1E30016AC38 /* tab-sel-mid.gif in CopyFiles */,
33FF072F0965C1E30016AC38 /* tab-sel-right.gif in CopyFiles */,
33FF07300965C1E30016AC38 /* tab-unsel-left.gif in CopyFiles */,
33FF07310965C1E30016AC38 /* tab-unsel-menu.gif in CopyFiles */,
33FF07320965C1E30016AC38 /* tab-unsel-mid.gif in CopyFiles */,
33FF07330965C1E30016AC38 /* tab-unsel-right.gif in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
33FFFE1D0965BC050016AC38 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 16;
files = (
335A28FE0C8CCB4000D8A7F4 /* libquaqua.jnilib in CopyFiles */,
339514FA097AEB8000193C89 /* license.txt in CopyFiles */,
339514FB097AEB8000193C89 /* readme.txt in CopyFiles */,
);
@ -509,38 +471,7 @@
33FFFE310965BD110016AC38 /* MessageSiphon.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = MessageSiphon.java; sourceTree = "<group>"; };
33FFFE320965BD110016AC38 /* MessageStream.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = MessageStream.java; sourceTree = "<group>"; };
33FFFE330965BD110016AC38 /* Preferences.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = Preferences.java; sourceTree = "<group>"; };
33FFFE350965BD110016AC38 /* CSymbolTable.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = CSymbolTable.java; sourceTree = "<group>"; };
33FFFE360965BD110016AC38 /* CToken.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = CToken.java; sourceTree = "<group>"; };
33FFFE370965BD110016AC38 /* expandedWEmitter.g */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = expandedWEmitter.g; sourceTree = "<group>"; };
33FFFE380965BD110016AC38 /* expandedWParser.g */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = expandedWParser.g; sourceTree = "<group>"; };
33FFFE390965BD110016AC38 /* ExtendedCommonASTWithHiddenTokens.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = ExtendedCommonASTWithHiddenTokens.java; sourceTree = "<group>"; };
33FFFE3A0965BD110016AC38 /* LineObject.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = LineObject.java; sourceTree = "<group>"; };
33FFFE3B0965BD110016AC38 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
33FFFE3C0965BD110016AC38 /* PdePreprocessor.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = PdePreprocessor.java; sourceTree = "<group>"; };
33FFFE3D0965BD110016AC38 /* PreprocessorInfoChannel.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = PreprocessorInfoChannel.java; sourceTree = "<group>"; };
33FFFE3E0965BD110016AC38 /* StdCLexer.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = StdCLexer.java; sourceTree = "<group>"; };
33FFFE3F0965BD110016AC38 /* StdCParser.g */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = StdCParser.g; sourceTree = "<group>"; };
33FFFE400965BD110016AC38 /* StdCParser.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = StdCParser.java; sourceTree = "<group>"; };
33FFFE410965BD110016AC38 /* STDCTokenTypes.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = STDCTokenTypes.java; sourceTree = "<group>"; };
33FFFE420965BD110016AC38 /* STDCTokenTypes.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = STDCTokenTypes.txt; sourceTree = "<group>"; };
33FFFE430965BD110016AC38 /* TNode.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = TNode.java; sourceTree = "<group>"; };
33FFFE440965BD110016AC38 /* TNodeFactory.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = TNodeFactory.java; sourceTree = "<group>"; };
33FFFE450965BD110016AC38 /* WEmitter.g */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = WEmitter.g; sourceTree = "<group>"; };
33FFFE460965BD110016AC38 /* WEmitter.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = WEmitter.java; sourceTree = "<group>"; };
33FFFE470965BD110016AC38 /* WEmitterTokenTypes.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = WEmitterTokenTypes.java; sourceTree = "<group>"; };
33FFFE480965BD110016AC38 /* WEmitterTokenTypes.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = WEmitterTokenTypes.txt; sourceTree = "<group>"; };
33FFFE490965BD110016AC38 /* whitespace_test.pde */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = whitespace_test.pde; sourceTree = "<group>"; };
33FFFE4A0965BD110016AC38 /* WLexer.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = WLexer.java; sourceTree = "<group>"; };
33FFFE4B0965BD110016AC38 /* WLexerTokenTypes.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = WLexerTokenTypes.java; sourceTree = "<group>"; };
33FFFE4C0965BD110016AC38 /* WLexerTokenTypes.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = WLexerTokenTypes.txt; sourceTree = "<group>"; };
33FFFE4D0965BD110016AC38 /* WParser.g */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = WParser.g; sourceTree = "<group>"; };
33FFFE4E0965BD110016AC38 /* WParser.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = WParser.java; sourceTree = "<group>"; };
33FFFE4F0965BD110016AC38 /* WTokenTypes.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = WTokenTypes.java; sourceTree = "<group>"; };
33FFFE500965BD110016AC38 /* WTokenTypes.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = WTokenTypes.txt; sourceTree = "<group>"; };
33FFFE510965BD110016AC38 /* WTreeParser.g */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = WTreeParser.g; sourceTree = "<group>"; };
33FFFE520965BD110016AC38 /* WTreeParser.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = WTreeParser.java; sourceTree = "<group>"; };
33FFFE530965BD110016AC38 /* WTreeParserTokenTypes.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = WTreeParserTokenTypes.java; sourceTree = "<group>"; };
33FFFE540965BD110016AC38 /* WTreeParserTokenTypes.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = WTreeParserTokenTypes.txt; sourceTree = "<group>"; };
33FFFE550965BD110016AC38 /* PresentMode.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = PresentMode.java; sourceTree = "<group>"; };
33FFFE560965BD110016AC38 /* Runner.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = Runner.java; sourceTree = "<group>"; };
33FFFE570965BD110016AC38 /* RunnerClassLoader.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = RunnerClassLoader.java; sourceTree = "<group>"; };
@ -581,6 +512,9 @@
33FFFEBE0965BD110016AC38 /* make.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = make.sh; sourceTree = "<group>"; };
33FFFEBF0965BD110016AC38 /* mkdmg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = mkdmg; sourceTree = "<group>"; };
33FFFEC00965BD110016AC38 /* run.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = run.sh; sourceTree = "<group>"; };
A33729610D224FA700E82412 /* librxtxSerial-intel.jnilib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; path = "librxtxSerial-intel.jnilib"; sourceTree = "<group>"; };
A33729620D224FA700E82412 /* librxtxSerial-ppc.jnilib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; path = "librxtxSerial-ppc.jnilib"; sourceTree = "<group>"; };
A33729630D224FA700E82412 /* librxtxSerial.jnilib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; path = librxtxSerial.jnilib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -754,38 +688,7 @@
33FFFE340965BD110016AC38 /* preproc */ = {
isa = PBXGroup;
children = (
33FFFE350965BD110016AC38 /* CSymbolTable.java */,
33FFFE360965BD110016AC38 /* CToken.java */,
33FFFE370965BD110016AC38 /* expandedWEmitter.g */,
33FFFE380965BD110016AC38 /* expandedWParser.g */,
33FFFE390965BD110016AC38 /* ExtendedCommonASTWithHiddenTokens.java */,
33FFFE3A0965BD110016AC38 /* LineObject.java */,
33FFFE3B0965BD110016AC38 /* Makefile */,
33FFFE3C0965BD110016AC38 /* PdePreprocessor.java */,
33FFFE3D0965BD110016AC38 /* PreprocessorInfoChannel.java */,
33FFFE3E0965BD110016AC38 /* StdCLexer.java */,
33FFFE3F0965BD110016AC38 /* StdCParser.g */,
33FFFE400965BD110016AC38 /* StdCParser.java */,
33FFFE410965BD110016AC38 /* STDCTokenTypes.java */,
33FFFE420965BD110016AC38 /* STDCTokenTypes.txt */,
33FFFE430965BD110016AC38 /* TNode.java */,
33FFFE440965BD110016AC38 /* TNodeFactory.java */,
33FFFE450965BD110016AC38 /* WEmitter.g */,
33FFFE460965BD110016AC38 /* WEmitter.java */,
33FFFE470965BD110016AC38 /* WEmitterTokenTypes.java */,
33FFFE480965BD110016AC38 /* WEmitterTokenTypes.txt */,
33FFFE490965BD110016AC38 /* whitespace_test.pde */,
33FFFE4A0965BD110016AC38 /* WLexer.java */,
33FFFE4B0965BD110016AC38 /* WLexerTokenTypes.java */,
33FFFE4C0965BD110016AC38 /* WLexerTokenTypes.txt */,
33FFFE4D0965BD110016AC38 /* WParser.g */,
33FFFE4E0965BD110016AC38 /* WParser.java */,
33FFFE4F0965BD110016AC38 /* WTokenTypes.java */,
33FFFE500965BD110016AC38 /* WTokenTypes.txt */,
33FFFE510965BD110016AC38 /* WTreeParser.g */,
33FFFE520965BD110016AC38 /* WTreeParser.java */,
33FFFE530965BD110016AC38 /* WTreeParserTokenTypes.java */,
33FFFE540965BD110016AC38 /* WTreeParserTokenTypes.txt */,
);
path = preproc;
sourceTree = "<group>";
@ -861,6 +764,9 @@
isa = PBXGroup;
children = (
335A28F20C8CCAF700D8A7F4 /* libquaqua.jnilib */,
A33729610D224FA700E82412 /* librxtxSerial-intel.jnilib */,
A33729620D224FA700E82412 /* librxtxSerial-ppc.jnilib */,
A33729630D224FA700E82412 /* librxtxSerial.jnilib */,
335A28F30C8CCAF700D8A7F4 /* quaqua.jar */,
33FFFEAE0965BD110016AC38 /* bootloader */,
33FFFEB20965BD110016AC38 /* drivers */,
@ -933,7 +839,22 @@
buildActionMask = 2147483647;
files = (
33CF03B209662CB700F2C9A9 /* arduino.icns in Resources */,
339514EE097AEB5900193C89 /* STDCTokenTypes.txt in Resources */,
33FF07240965C1E30016AC38 /* keywords.txt in Resources */,
33FF07280965C1E30016AC38 /* preferences.txt in Resources */,
A3688DF40D284554003CBAA1 /* applet.html in Resources */,
33FF071F0965C1E30016AC38 /* about.jpg in Resources */,
33FF07220965C1E30016AC38 /* buttons.gif in Resources */,
33FF07230965C1E30016AC38 /* icon.gif in Resources */,
33FF07250965C1E30016AC38 /* loading.gif in Resources */,
33FF072A0965C1E30016AC38 /* resize.gif in Resources */,
33FF072C0965C1E30016AC38 /* tab-sel-left.gif in Resources */,
33FF072D0965C1E30016AC38 /* tab-sel-menu.gif in Resources */,
33FF072E0965C1E30016AC38 /* tab-sel-mid.gif in Resources */,
33FF072F0965C1E30016AC38 /* tab-sel-right.gif in Resources */,
33FF07300965C1E30016AC38 /* tab-unsel-left.gif in Resources */,
33FF07310965C1E30016AC38 /* tab-unsel-menu.gif in Resources */,
33FF07320965C1E30016AC38 /* tab-unsel-mid.gif in Resources */,
33FF07330965C1E30016AC38 /* tab-unsel-right.gif in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -951,7 +872,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "unzip -od $BUILT_PRODUCTS_DIR/hardware dist/tools-universal.zip\ncp dist/librxtxSerial.jnilib $BUILT_PRODUCTS_DIR/librxtxSerial.jnilib";
shellScript = "unzip -od $BUILT_PRODUCTS_DIR/hardware dist/tools-universal.zip\n";
};
3318B11A0AD6CE9F00FE1A05 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@ -964,7 +885,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "unzip -od $BUILT_PRODUCTS_DIR/hardware dist/tools-universal.zip\ncp dist/librxtxSerial.jnilib $BUILT_PRODUCTS_DIR/librxtxSerial.jnilib";
shellScript = "unzip -od $BUILT_PRODUCTS_DIR/hardware dist/tools-universal.zip\n";
};
3318B1520AD6D1EB00FE1A05 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@ -977,7 +898,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd $BUILT_PRODUCTS_DIR/../../\n\nREVISION=`head -1 ../../todo.txt | cut -c 1-4`\nSHORT_REVISION=`head -1 ../../todo.txt | cut -c 3-4`\nVERSIONED=`cat ../../app/Base.java | grep $REVISION`\n\nif [ -z \"$VERSIONED\" ]\nthen\n echo Fix the revision number in Base.java\n exit\nfi\n\nrm -rf arduino\nrm -rf arduino-*\n\nmv $BUILT_PRODUCTS_DIR arduino\n\nfind arduino -name \"*~\" -exec rm -f {} ';'\n# need to leave ds store stuff cuz one of those is important\n#find arduino -name \".DS_Store\" -exec rm -f {} ';'\nfind arduino -name \"._*\" -exec rm -f {} ';'\nfind arduino -name \"Thumbs.db\" -exec rm -f {} ';'\n\n# clean out the cvs entries\nfind arduino -name \"CVS\" -exec rm -rf {} ';' 2> /dev/null\nfind arduino -name \".cvsignore\" -exec rm -rf {} ';'\n\n# clean out the svn entries\nfind arduino -name \".svn\" -exec rm -rf {} ';' 2> /dev/null\n\n#mv arduino/Arduino.app/Contents/MacOS/Arduino \"arduino/Arduino.app/Contents/MacOS/Arduino $SHORT_REVISION\"\nmv arduino/Arduino.app \"arduino/Arduino $SHORT_REVISION.app\"\nmv arduino arduino-$REVISION\nzip -r arduino-$REVISION-mac-ppc.zip arduino-$REVISION\n";
shellScript = "REVISION=`head -1 $SRCROOT/../../todo.txt | cut -c 1-4`\nSHORT_REVISION=`head -1 $SRCROOT/../../todo.txt | cut -c 3-4`\nVERSIONED=`cat $SRCROOT/../../app/Base.java | grep $REVISION`\n\nif [ -z \"$VERSIONED\" ]\nthen\n echo Fix the revision number in Base.java\n exit\nfi\n\ncd \"$SRCROOT\"\n\nrm -rf arduino\nrm -rf arduino-*\n\nmv $BUILT_PRODUCTS_DIR arduino\n\nfind arduino -name \"*~\" -exec rm -f {} ';'\n# need to leave ds store stuff cuz one of those is important\n#find arduino -name \".DS_Store\" -exec rm -f {} ';'\nfind arduino -name \"._*\" -exec rm -f {} ';'\nfind arduino -name \"Thumbs.db\" -exec rm -f {} ';'\n\n# clean out the cvs entries\nfind arduino -name \"CVS\" -exec rm -rf {} ';' 2> /dev/null\nfind arduino -name \".cvsignore\" -exec rm -rf {} ';'\n\n# clean out the svn entries\nfind arduino -name \".svn\" -exec rm -rf {} ';' 2> /dev/null\n\n#mv arduino/Arduino.app/Contents/MacOS/Arduino \"arduino/Arduino.app/Contents/MacOS/Arduino $SHORT_REVISION\"\nmv arduino/Arduino.app \"arduino/Arduino $SHORT_REVISION.app\"\nmv arduino arduino-$REVISION\nzip -r arduino-$REVISION-mac-ppc.zip arduino-$REVISION\n";
};
3318B15E0AD6D1FC00FE1A05 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@ -1016,9 +937,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
33AF61760965C54B00B514A9 /* PreprocessorInfoChannel.java in Sources */,
33AF61770965C54B00B514A9 /* EditorListener.java in Sources */,
33AF61780965C54B00B514A9 /* LineObject.java in Sources */,
33AF61790965C54B00B514A9 /* Serial.java in Sources */,
33AF617A0965C54B00B514A9 /* TextUtilities.java in Sources */,
33AF617B0965C54B00B514A9 /* EditorConsole.java in Sources */,
@ -1032,50 +951,34 @@
33AF61830965C54B00B514A9 /* SyntaxStyle.java in Sources */,
33AF61840965C54B00B514A9 /* Uploader.java in Sources */,
33AF61850965C54B00B514A9 /* RunnerException.java in Sources */,
33AF61860965C54B00B514A9 /* WParser.java in Sources */,
33AF61870965C54B00B514A9 /* TextAreaPainter.java in Sources */,
33AF61880965C54B00B514A9 /* Sketchbook.java in Sources */,
33AF61890965C54B00B514A9 /* EditorStatus.java in Sources */,
33AF618A0965C54B00B514A9 /* WTokenTypes.java in Sources */,
33AF618B0965C54B00B514A9 /* TextAreaDefaults.java in Sources */,
33AF618C0965C54B00B514A9 /* PdePreprocessor.java in Sources */,
33AF618D0965C54B00B514A9 /* CSymbolTable.java in Sources */,
33AF618E0965C54B00B514A9 /* SketchHistory.java in Sources */,
33AF618F0965C54B00B514A9 /* RunnerClassLoader.java in Sources */,
33AF61900965C54B00B514A9 /* MessageStream.java in Sources */,
33AF61910965C54B00B514A9 /* SyntaxUtilities.java in Sources */,
33AF61930965C54B00B514A9 /* PresentMode.java in Sources */,
33AF61940965C54B00B514A9 /* STDCTokenTypes.java in Sources */,
33AF61950965C54B00B514A9 /* CTokenMarker.java in Sources */,
33AF61960965C54B00B514A9 /* CToken.java in Sources */,
33AF61970965C54B00B514A9 /* WTreeParserTokenTypes.java in Sources */,
33AF61990965C54B00B514A9 /* Runner.java in Sources */,
33AF619A0965C54B00B514A9 /* TNode.java in Sources */,
33AF619B0965C54B00B514A9 /* KeywordMap.java in Sources */,
33AF619C0965C54B00B514A9 /* ExtendedCommonASTWithHiddenTokens.java in Sources */,
33AF619D0965C54B00B514A9 /* Sketch.java in Sources */,
33AF619E0965C54B00B514A9 /* WEmitterTokenTypes.java in Sources */,
33AF619F0965C54B00B514A9 /* TNodeFactory.java in Sources */,
33AF61A00965C54B00B514A9 /* Target.java in Sources */,
33AF61A10965C54B00B514A9 /* UpdateCheck.java in Sources */,
33AF61A20965C54B00B514A9 /* InputHandler.java in Sources */,
33AF61A30965C54B00B514A9 /* MessageConsumer.java in Sources */,
33AF61A40965C54B00B514A9 /* WLexer.java in Sources */,
33AF61A50965C54B00B514A9 /* Compiler.java in Sources */,
33AF61A60965C54B00B514A9 /* AutoFormat.java in Sources */,
33AF61A70965C54B00B514A9 /* StdCLexer.java in Sources */,
33AF61A80965C54B00B514A9 /* StdCParser.java in Sources */,
33AF61A90965C54B00B514A9 /* PdeKeywords.java in Sources */,
33AF61AA0965C54B00B514A9 /* Editor.java in Sources */,
33AF61AB0965C54B00B514A9 /* WEmitter.java in Sources */,
33AF61AC0965C54B00B514A9 /* SwingWorker.java in Sources */,
33AF61AD0965C54B00B514A9 /* DefaultInputHandler.java in Sources */,
33AF61AE0965C54B00B514A9 /* SyntaxDocument.java in Sources */,
33AF61AF0965C54B00B514A9 /* WLexerTokenTypes.java in Sources */,
33AF61B00965C54B00B514A9 /* Token.java in Sources */,
33AF61B10965C54B00B514A9 /* Preferences.java in Sources */,
33AF61B20965C54B00B514A9 /* PdeTextAreaDefaults.java in Sources */,
33AF61B30965C54B00B514A9 /* WTreeParser.java in Sources */,
33AF61B40965C54B00B514A9 /* JEditTextArea.java in Sources */,
33AF61B50965C54B00B514A9 /* Base.java in Sources */,
332D4DB609CF147F00BF81F6 /* Sizer.java in Sources */,

View File

@ -1 +1 @@
0010 arduino
0011 arduino