mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-01 23:29:28 +01:00
Updating to C++, new Mac avr tools, Windows to be updated.
This commit is contained in:
parent
c8711cd2fd
commit
18fc6d6875
@ -526,14 +526,14 @@ public class Compiler implements MessageConsumer {
|
|||||||
String s1 = s.substring(partialStartIndex +
|
String s1 = s.substring(partialStartIndex +
|
||||||
partialTempPath.length() + 1);
|
partialTempPath.length() + 1);
|
||||||
//System.out.println(s1);
|
//System.out.println(s1);
|
||||||
if (s1.indexOf("In function")!= -1) {
|
int colon = s1.indexOf(':');
|
||||||
|
|
||||||
|
if (s1.indexOf("In function") != -1 || colon == -1) {
|
||||||
System.err.print(s1);
|
System.err.print(s1);
|
||||||
//firstErrorFound = true;
|
//firstErrorFound = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int colon = s1.indexOf(':');
|
|
||||||
|
|
||||||
int lineNumber = Integer.parseInt(s1.substring(0, colon));
|
int lineNumber = Integer.parseInt(s1.substring(0, colon));
|
||||||
|
|
||||||
// the "1" corresponds to the amount of lines written to the main code
|
// the "1" corresponds to the amount of lines written to the main code
|
||||||
|
@ -776,6 +776,15 @@ public class Editor extends JFrame
|
|||||||
// });
|
// });
|
||||||
// menu.add(item);
|
// menu.add(item);
|
||||||
|
|
||||||
|
item = new JMenuItem("Howto");
|
||||||
|
item.addActionListener(new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
Base.openURL(System.getProperty("user.dir") + File.separator +
|
||||||
|
"reference" + File.separator + "howto.html");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
menu.add(item);
|
||||||
|
|
||||||
item = new JMenuItem("Reference");
|
item = new JMenuItem("Reference");
|
||||||
item.addActionListener(new ActionListener() {
|
item.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
@ -1961,14 +1970,14 @@ public class Editor extends JFrame
|
|||||||
cutItem.setEnabled(true);
|
cutItem.setEnabled(true);
|
||||||
copyItem.setEnabled(true);
|
copyItem.setEnabled(true);
|
||||||
|
|
||||||
referenceFile = PdeKeywords.getReference(textarea.getSelectedText());
|
//referenceFile = PdeKeywords.getReference(textarea.getSelectedText());
|
||||||
if (referenceFile != null) {
|
//if (referenceFile != null) {
|
||||||
referenceItem.setEnabled(true);
|
//referenceItem.setEnabled(true);
|
||||||
}
|
//}
|
||||||
} else {
|
} else {
|
||||||
cutItem.setEnabled(false);
|
cutItem.setEnabled(false);
|
||||||
copyItem.setEnabled(false);
|
copyItem.setEnabled(false);
|
||||||
referenceItem.setEnabled(false);
|
//referenceItem.setEnabled(false);
|
||||||
}
|
}
|
||||||
super.show(component, x, y);
|
super.show(component, x, y);
|
||||||
}
|
}
|
||||||
|
@ -1382,7 +1382,8 @@ public class Sketch {
|
|||||||
//System.out.println();
|
//System.out.println();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
code[0].preprocName = className + "." + Preferences.get("build.extension");
|
//code[0].preprocName = className + "." + Preferences.get("build.extension");
|
||||||
|
code[0].preprocName = className + ".cpp";
|
||||||
}
|
}
|
||||||
|
|
||||||
// store this for the compiler and the runtime
|
// store this for the compiler and the runtime
|
||||||
@ -1511,7 +1512,8 @@ public class Sketch {
|
|||||||
// just write the the contents of 'program' to a .java file
|
// just write the the contents of 'program' to a .java file
|
||||||
// into the build directory. uses byte stream and reader/writer
|
// into the build directory. uses byte stream and reader/writer
|
||||||
// shtuff so that unicode bunk is properly handled
|
// shtuff so that unicode bunk is properly handled
|
||||||
String filename = code[i].name + "." + Preferences.get("build.extension");
|
//String filename = code[i].name + "." + Preferences.get("build.extension");
|
||||||
|
String filename = code[i].name + ".cpp";
|
||||||
try {
|
try {
|
||||||
Base.saveFile(code[i].program, new File(buildPath, filename));
|
Base.saveFile(code[i].program, new File(buildPath, filename));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -236,7 +236,7 @@ public class PdePreprocessor {
|
|||||||
String returntype, functioname, parameterlist, prototype;
|
String returntype, functioname, parameterlist, prototype;
|
||||||
java.util.LinkedList prototypes = new java.util.LinkedList();
|
java.util.LinkedList prototypes = new java.util.LinkedList();
|
||||||
//System.out.println("prototypes:");
|
//System.out.println("prototypes:");
|
||||||
if (Preferences.get("build.extension").equals("cpp")) {
|
//if (Preferences.get("build.extension").equals("cpp")) {
|
||||||
while(matcher.contains(input, pattern)){
|
while(matcher.contains(input, pattern)){
|
||||||
result = matcher.getMatch();
|
result = matcher.getMatch();
|
||||||
//System.out.println(result);
|
//System.out.println(result);
|
||||||
@ -253,7 +253,7 @@ public class PdePreprocessor {
|
|||||||
prototypes.add(prototype);
|
prototypes.add(prototype);
|
||||||
//System.out.println(prototype);
|
//System.out.println(prototype);
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
// store # of prototypes so that line number reporting can be adjusted
|
// store # of prototypes so that line number reporting can be adjusted
|
||||||
prototypeCount = prototypes.size();
|
prototypeCount = prototypes.size();
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ public class PdePreprocessor {
|
|||||||
// start parsing at the compilationUnit non-terminal
|
// start parsing at the compilationUnit non-terminal
|
||||||
//
|
//
|
||||||
//parser.pdeProgram();
|
//parser.pdeProgram();
|
||||||
parser.translationUnit();
|
//parser.translationUnit();
|
||||||
|
|
||||||
// set up the AST for traversal by PdeEmitter
|
// set up the AST for traversal by PdeEmitter
|
||||||
//
|
//
|
||||||
@ -329,16 +329,19 @@ public class PdePreprocessor {
|
|||||||
// output the code
|
// output the code
|
||||||
//
|
//
|
||||||
WEmitter emitter = new WEmitter(lexer.getPreprocessorInfoChannel());
|
WEmitter emitter = new WEmitter(lexer.getPreprocessorInfoChannel());
|
||||||
File streamFile = new File(buildPath, name + "." + Preferences.get("build.extension"));
|
//File streamFile = new File(buildPath, name + "." + Preferences.get("build.extension"));
|
||||||
|
File streamFile = new File(buildPath, name + ".cpp");
|
||||||
PrintStream stream = new PrintStream(new FileOutputStream(streamFile));
|
PrintStream stream = new PrintStream(new FileOutputStream(streamFile));
|
||||||
|
|
||||||
//writeHeader(stream, extraImports, name);
|
//writeHeader(stream, extraImports, name);
|
||||||
writeHeader(stream, name, prototypes);
|
writeHeader(stream, name, prototypes);
|
||||||
|
//added to write the pde code to the cpp file
|
||||||
|
writeProgram(stream, name, program);
|
||||||
emitter.setASTNodeType(TNode.class.getName());
|
emitter.setASTNodeType(TNode.class.getName());
|
||||||
emitter.setOut(stream);
|
emitter.setOut(stream);
|
||||||
emitter.printDeclarations(rootNode);
|
//emitter.printDeclarations(rootNode);
|
||||||
//emitter.print(rootNode);
|
//emitter.print(rootNode);
|
||||||
emitter.translationUnit(parser.getAST());
|
//emitter.translationUnit(parser.getAST());
|
||||||
|
|
||||||
writeFooter(stream);
|
writeFooter(stream);
|
||||||
stream.close();
|
stream.close();
|
||||||
@ -363,6 +366,12 @@ public class PdePreprocessor {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write the pde program to the cpp file
|
||||||
|
void writeProgram(PrintStream out, String className, String program) {
|
||||||
|
out.print(program);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write any required header material (eg imports, class decl stuff)
|
* Write any required header material (eg imports, class decl stuff)
|
||||||
*
|
*
|
||||||
|
@ -362,6 +362,7 @@
|
|||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
330B21530968180400345666 /* librxtxSerial.jnilib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; path = librxtxSerial.jnilib; sourceTree = "<group>"; };
|
330B21530968180400345666 /* librxtxSerial.jnilib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; path = librxtxSerial.jnilib; sourceTree = "<group>"; };
|
||||||
|
333269E1099BB1FC007D3AE2 /* tools.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = tools.zip; sourceTree = "<group>"; };
|
||||||
33AF620A0965D67800B514A9 /* antlr.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = antlr.jar; sourceTree = "<group>"; };
|
33AF620A0965D67800B514A9 /* antlr.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = antlr.jar; sourceTree = "<group>"; };
|
||||||
33AF620B0965D67900B514A9 /* applet.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = applet.html; sourceTree = "<group>"; };
|
33AF620B0965D67900B514A9 /* applet.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = applet.html; sourceTree = "<group>"; };
|
||||||
33AF620C0965D67900B514A9 /* mrj.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = mrj.jar; sourceTree = "<group>"; };
|
33AF620C0965D67900B514A9 /* mrj.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = mrj.jar; sourceTree = "<group>"; };
|
||||||
@ -517,7 +518,6 @@
|
|||||||
33FFFEB50965BD110016AC38 /* DS_Store */ = {isa = PBXFileReference; lastKnownFileType = file; path = DS_Store; sourceTree = "<group>"; };
|
33FFFEB50965BD110016AC38 /* DS_Store */ = {isa = PBXFileReference; lastKnownFileType = file; path = DS_Store; sourceTree = "<group>"; };
|
||||||
33FFFEB60965BD110016AC38 /* jikes */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = jikes; sourceTree = "<group>"; };
|
33FFFEB60965BD110016AC38 /* jikes */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = jikes; sourceTree = "<group>"; };
|
||||||
33FFFEB90965BD110016AC38 /* macosx_setup.command */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = macosx_setup.command; sourceTree = "<group>"; };
|
33FFFEB90965BD110016AC38 /* macosx_setup.command */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = macosx_setup.command; sourceTree = "<group>"; };
|
||||||
33FFFEBC0965BD110016AC38 /* tools.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = tools.zip; sourceTree = "<group>"; };
|
|
||||||
33FFFEBD0965BD110016AC38 /* dist.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = dist.sh; sourceTree = "<group>"; };
|
33FFFEBD0965BD110016AC38 /* dist.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = dist.sh; sourceTree = "<group>"; };
|
||||||
33FFFEBE0965BD110016AC38 /* make.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = make.sh; sourceTree = "<group>"; };
|
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>"; };
|
33FFFEBF0965BD110016AC38 /* mkdmg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = mkdmg; sourceTree = "<group>"; };
|
||||||
@ -940,14 +940,13 @@
|
|||||||
33FFFEAC0965BD110016AC38 /* dist */ = {
|
33FFFEAC0965BD110016AC38 /* dist */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
333269E1099BB1FC007D3AE2 /* tools.zip */,
|
||||||
330B21530968180400345666 /* librxtxSerial.jnilib */,
|
330B21530968180400345666 /* librxtxSerial.jnilib */,
|
||||||
33FFFEAE0965BD110016AC38 /* bootloader */,
|
33FFFEAE0965BD110016AC38 /* bootloader */,
|
||||||
33FFFEB20965BD110016AC38 /* drivers */,
|
33FFFEB20965BD110016AC38 /* drivers */,
|
||||||
33FFFEB50965BD110016AC38 /* DS_Store */,
|
33FFFEB50965BD110016AC38 /* DS_Store */,
|
||||||
33FFFEB60965BD110016AC38 /* jikes */,
|
33FFFEB60965BD110016AC38 /* jikes */,
|
||||||
33FFFEB90965BD110016AC38 /* macosx_setup.command */,
|
33FFFEB90965BD110016AC38 /* macosx_setup.command */,
|
||||||
33FFFEBA0965BD110016AC38 /* serial */,
|
|
||||||
33FFFEBC0965BD110016AC38 /* tools.zip */,
|
|
||||||
);
|
);
|
||||||
path = dist;
|
path = dist;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -969,13 +968,6 @@
|
|||||||
path = drivers;
|
path = drivers;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
33FFFEBA0965BD110016AC38 /* serial */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
);
|
|
||||||
path = serial;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXJavaArchiveBuildPhase section */
|
/* Begin PBXJavaArchiveBuildPhase section */
|
||||||
|
BIN
build/macosx/dist/tools.zip
vendored
BIN
build/macosx/dist/tools.zip
vendored
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user