mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Reworked build system: makefiles replaced with in-program logic; core replaced with targets; preproc/ replaced with Wiring's; now prepend "#include "WProgram.h" instead of wiringlite.inc; new entries in preferences.txt; bundled Wiring libs.
This commit is contained in:
33
app/preproc/TNodeFactory.java
Executable file
33
app/preproc/TNodeFactory.java
Executable file
@ -0,0 +1,33 @@
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user