From: <fwi...@us...> - 2008-11-17 21:50:28
|
Revision: 5587 http://jython.svn.sourceforge.net/jython/?rev=5587&view=rev Author: fwierzbicki Date: 2008-11-17 21:50:26 +0000 (Mon, 17 Nov 2008) Log Message: ----------- Now checking in output of asdl_antlr.py. Modified Paths: -------------- branches/astwrite/src/org/python/antlr/ast/Assign.java branches/astwrite/src/org/python/antlr/ast/BoolOp.java branches/astwrite/src/org/python/antlr/ast/Call.java branches/astwrite/src/org/python/antlr/ast/ClassDef.java branches/astwrite/src/org/python/antlr/ast/Compare.java branches/astwrite/src/org/python/antlr/ast/Delete.java branches/astwrite/src/org/python/antlr/ast/Dict.java branches/astwrite/src/org/python/antlr/ast/ExtSlice.java branches/astwrite/src/org/python/antlr/ast/For.java branches/astwrite/src/org/python/antlr/ast/FunctionDef.java branches/astwrite/src/org/python/antlr/ast/GeneratorExp.java branches/astwrite/src/org/python/antlr/ast/Global.java branches/astwrite/src/org/python/antlr/ast/If.java branches/astwrite/src/org/python/antlr/ast/Import.java branches/astwrite/src/org/python/antlr/ast/ImportFrom.java branches/astwrite/src/org/python/antlr/ast/Interactive.java branches/astwrite/src/org/python/antlr/ast/List.java branches/astwrite/src/org/python/antlr/ast/ListComp.java branches/astwrite/src/org/python/antlr/ast/Module.java branches/astwrite/src/org/python/antlr/ast/Print.java branches/astwrite/src/org/python/antlr/ast/Suite.java branches/astwrite/src/org/python/antlr/ast/TryExcept.java branches/astwrite/src/org/python/antlr/ast/TryFinally.java branches/astwrite/src/org/python/antlr/ast/Tuple.java branches/astwrite/src/org/python/antlr/ast/While.java branches/astwrite/src/org/python/antlr/ast/With.java branches/astwrite/src/org/python/antlr/ast/argumentsType.java branches/astwrite/src/org/python/antlr/ast/comprehensionType.java branches/astwrite/src/org/python/antlr/ast/excepthandlerType.java Modified: branches/astwrite/src/org/python/antlr/ast/Assign.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Assign.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/Assign.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -7,53 +7,56 @@ import java.io.IOException; public class Assign extends stmtType { - public exprType[] targets; + public java.util.List<exprType> targets; public exprType value; private final static String[] fields = new String[] {"targets", "value"}; public String[] get_fields() { return fields; } - public Assign(exprType[] targets, exprType value) { + public Assign(java.util.List<exprType> targets, exprType value) { this.targets = targets; if (targets != null) { - for(int itargets=0;itargets<targets.length;itargets++) { - addChild(targets[itargets]); + for(PythonTree t : targets) { + addChild(t); } } this.value = value; addChild(value); } - public Assign(Token token, exprType[] targets, exprType value) { + public Assign(Token token, java.util.List<exprType> targets, exprType + value) { super(token); this.targets = targets; if (targets != null) { - for(int itargets=0;itargets<targets.length;itargets++) { - addChild(targets[itargets]); + for(PythonTree t : targets) { + addChild(t); } } this.value = value; addChild(value); } - public Assign(int ttype, Token token, exprType[] targets, exprType value) { + public Assign(int ttype, Token token, java.util.List<exprType> targets, + exprType value) { super(ttype, token); this.targets = targets; if (targets != null) { - for(int itargets=0;itargets<targets.length;itargets++) { - addChild(targets[itargets]); + for(PythonTree t : targets) { + addChild(t); } } this.value = value; addChild(value); } - public Assign(PythonTree tree, exprType[] targets, exprType value) { + public Assign(PythonTree tree, java.util.List<exprType> targets, exprType + value) { super(tree); this.targets = targets; if (targets != null) { - for(int itargets=0;itargets<targets.length;itargets++) { - addChild(targets[itargets]); + for(PythonTree t : targets) { + addChild(t); } } this.value = value; @@ -82,9 +85,9 @@ public void traverse(VisitorIF visitor) throws Exception { if (targets != null) { - for (int i = 0; i < targets.length; i++) { - if (targets[i] != null) - targets[i].accept(visitor); + for (PythonTree t : targets) { + if (t != null) + t.accept(visitor); } } if (value != null) Modified: branches/astwrite/src/org/python/antlr/ast/BoolOp.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/BoolOp.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/BoolOp.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -8,50 +8,52 @@ public class BoolOp extends exprType { public boolopType op; - public exprType[] values; + public java.util.List<exprType> values; private final static String[] fields = new String[] {"op", "values"}; public String[] get_fields() { return fields; } - public BoolOp(boolopType op, exprType[] values) { + public BoolOp(boolopType op, java.util.List<exprType> values) { this.op = op; this.values = values; if (values != null) { - for(int ivalues=0;ivalues<values.length;ivalues++) { - addChild(values[ivalues]); + for(PythonTree t : values) { + addChild(t); } } } - public BoolOp(Token token, boolopType op, exprType[] values) { + public BoolOp(Token token, boolopType op, java.util.List<exprType> values) { super(token); this.op = op; this.values = values; if (values != null) { - for(int ivalues=0;ivalues<values.length;ivalues++) { - addChild(values[ivalues]); + for(PythonTree t : values) { + addChild(t); } } } - public BoolOp(int ttype, Token token, boolopType op, exprType[] values) { + public BoolOp(int ttype, Token token, boolopType op, + java.util.List<exprType> values) { super(ttype, token); this.op = op; this.values = values; if (values != null) { - for(int ivalues=0;ivalues<values.length;ivalues++) { - addChild(values[ivalues]); + for(PythonTree t : values) { + addChild(t); } } } - public BoolOp(PythonTree tree, boolopType op, exprType[] values) { + public BoolOp(PythonTree tree, boolopType op, java.util.List<exprType> + values) { super(tree); this.op = op; this.values = values; if (values != null) { - for(int ivalues=0;ivalues<values.length;ivalues++) { - addChild(values[ivalues]); + for(PythonTree t : values) { + addChild(t); } } } @@ -78,9 +80,9 @@ public void traverse(VisitorIF visitor) throws Exception { if (values != null) { - for (int i = 0; i < values.length; i++) { - if (values[i] != null) - values[i].accept(visitor); + for (PythonTree t : values) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/Call.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Call.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/Call.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -8,8 +8,8 @@ public class Call extends exprType { public exprType func; - public exprType[] args; - public keywordType[] keywords; + public java.util.List<exprType> args; + public java.util.List<keywordType> keywords; public exprType starargs; public exprType kwargs; @@ -18,20 +18,20 @@ "starargs", "kwargs"}; public String[] get_fields() { return fields; } - public Call(exprType func, exprType[] args, keywordType[] keywords, - exprType starargs, exprType kwargs) { + public Call(exprType func, java.util.List<exprType> args, + java.util.List<keywordType> keywords, exprType starargs, exprType kwargs) { this.func = func; addChild(func); this.args = args; if (args != null) { - for(int iargs=0;iargs<args.length;iargs++) { - addChild(args[iargs]); + for(PythonTree t : args) { + addChild(t); } } this.keywords = keywords; if (keywords != null) { - for(int ikeywords=0;ikeywords<keywords.length;ikeywords++) { - addChild(keywords[ikeywords]); + for(PythonTree t : keywords) { + addChild(t); } } this.starargs = starargs; @@ -40,21 +40,21 @@ addChild(kwargs); } - public Call(Token token, exprType func, exprType[] args, keywordType[] - keywords, exprType starargs, exprType kwargs) { + public Call(Token token, exprType func, java.util.List<exprType> args, + java.util.List<keywordType> keywords, exprType starargs, exprType kwargs) { super(token); this.func = func; addChild(func); this.args = args; if (args != null) { - for(int iargs=0;iargs<args.length;iargs++) { - addChild(args[iargs]); + for(PythonTree t : args) { + addChild(t); } } this.keywords = keywords; if (keywords != null) { - for(int ikeywords=0;ikeywords<keywords.length;ikeywords++) { - addChild(keywords[ikeywords]); + for(PythonTree t : keywords) { + addChild(t); } } this.starargs = starargs; @@ -63,21 +63,22 @@ addChild(kwargs); } - public Call(int ttype, Token token, exprType func, exprType[] args, - keywordType[] keywords, exprType starargs, exprType kwargs) { + public Call(int ttype, Token token, exprType func, java.util.List<exprType> + args, java.util.List<keywordType> keywords, exprType starargs, exprType + kwargs) { super(ttype, token); this.func = func; addChild(func); this.args = args; if (args != null) { - for(int iargs=0;iargs<args.length;iargs++) { - addChild(args[iargs]); + for(PythonTree t : args) { + addChild(t); } } this.keywords = keywords; if (keywords != null) { - for(int ikeywords=0;ikeywords<keywords.length;ikeywords++) { - addChild(keywords[ikeywords]); + for(PythonTree t : keywords) { + addChild(t); } } this.starargs = starargs; @@ -86,21 +87,21 @@ addChild(kwargs); } - public Call(PythonTree tree, exprType func, exprType[] args, keywordType[] - keywords, exprType starargs, exprType kwargs) { + public Call(PythonTree tree, exprType func, java.util.List<exprType> args, + java.util.List<keywordType> keywords, exprType starargs, exprType kwargs) { super(tree); this.func = func; addChild(func); this.args = args; if (args != null) { - for(int iargs=0;iargs<args.length;iargs++) { - addChild(args[iargs]); + for(PythonTree t : args) { + addChild(t); } } this.keywords = keywords; if (keywords != null) { - for(int ikeywords=0;ikeywords<keywords.length;ikeywords++) { - addChild(keywords[ikeywords]); + for(PythonTree t : keywords) { + addChild(t); } } this.starargs = starargs; @@ -142,15 +143,15 @@ if (func != null) func.accept(visitor); if (args != null) { - for (int i = 0; i < args.length; i++) { - if (args[i] != null) - args[i].accept(visitor); + for (PythonTree t : args) { + if (t != null) + t.accept(visitor); } } if (keywords != null) { - for (int i = 0; i < keywords.length; i++) { - if (keywords[i] != null) - keywords[i].accept(visitor); + for (PythonTree t : keywords) { + if (t != null) + t.accept(visitor); } } if (starargs != null) Modified: branches/astwrite/src/org/python/antlr/ast/ClassDef.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/ClassDef.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/ClassDef.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -8,105 +8,106 @@ public class ClassDef extends stmtType { public String name; - public exprType[] bases; - public stmtType[] body; - public exprType[] decorators; + public java.util.List<exprType> bases; + public java.util.List<stmtType> body; + public java.util.List<exprType> decorators; private final static String[] fields = new String[] {"name", "bases", "body", "decorators"}; public String[] get_fields() { return fields; } - public ClassDef(String name, exprType[] bases, stmtType[] body, exprType[] - decorators) { + public ClassDef(String name, java.util.List<exprType> bases, + java.util.List<stmtType> body, java.util.List<exprType> decorators) { this.name = name; this.bases = bases; if (bases != null) { - for(int ibases=0;ibases<bases.length;ibases++) { - addChild(bases[ibases]); + for(PythonTree t : bases) { + addChild(t); } } this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.decorators = decorators; if (decorators != null) { - for(int idecorators=0;idecorators<decorators.length;idecorators++) { - addChild(decorators[idecorators]); + for(PythonTree t : decorators) { + addChild(t); } } } - public ClassDef(Token token, String name, exprType[] bases, stmtType[] - body, exprType[] decorators) { + public ClassDef(Token token, String name, java.util.List<exprType> bases, + java.util.List<stmtType> body, java.util.List<exprType> decorators) { super(token); this.name = name; this.bases = bases; if (bases != null) { - for(int ibases=0;ibases<bases.length;ibases++) { - addChild(bases[ibases]); + for(PythonTree t : bases) { + addChild(t); } } this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.decorators = decorators; if (decorators != null) { - for(int idecorators=0;idecorators<decorators.length;idecorators++) { - addChild(decorators[idecorators]); + for(PythonTree t : decorators) { + addChild(t); } } } - public ClassDef(int ttype, Token token, String name, exprType[] bases, - stmtType[] body, exprType[] decorators) { + public ClassDef(int ttype, Token token, String name, + java.util.List<exprType> bases, java.util.List<stmtType> body, + java.util.List<exprType> decorators) { super(ttype, token); this.name = name; this.bases = bases; if (bases != null) { - for(int ibases=0;ibases<bases.length;ibases++) { - addChild(bases[ibases]); + for(PythonTree t : bases) { + addChild(t); } } this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.decorators = decorators; if (decorators != null) { - for(int idecorators=0;idecorators<decorators.length;idecorators++) { - addChild(decorators[idecorators]); + for(PythonTree t : decorators) { + addChild(t); } } } - public ClassDef(PythonTree tree, String name, exprType[] bases, stmtType[] - body, exprType[] decorators) { + public ClassDef(PythonTree tree, String name, java.util.List<exprType> + bases, java.util.List<stmtType> body, java.util.List<exprType> decorators) { super(tree); this.name = name; this.bases = bases; if (bases != null) { - for(int ibases=0;ibases<bases.length;ibases++) { - addChild(bases[ibases]); + for(PythonTree t : bases) { + addChild(t); } } this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.decorators = decorators; if (decorators != null) { - for(int idecorators=0;idecorators<decorators.length;idecorators++) { - addChild(decorators[idecorators]); + for(PythonTree t : decorators) { + addChild(t); } } } @@ -139,21 +140,21 @@ public void traverse(VisitorIF visitor) throws Exception { if (bases != null) { - for (int i = 0; i < bases.length; i++) { - if (bases[i] != null) - bases[i].accept(visitor); + for (PythonTree t : bases) { + if (t != null) + t.accept(visitor); } } if (body != null) { - for (int i = 0; i < body.length; i++) { - if (body[i] != null) - body[i].accept(visitor); + for (PythonTree t : body) { + if (t != null) + t.accept(visitor); } } if (decorators != null) { - for (int i = 0; i < decorators.length; i++) { - if (decorators[i] != null) - decorators[i].accept(visitor); + for (PythonTree t : decorators) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/Compare.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Compare.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/Compare.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -8,67 +8,64 @@ public class Compare extends exprType { public exprType left; - public cmpopType[] ops; - public exprType[] comparators; + public java.util.List<cmpopType> ops; + public java.util.List<exprType> comparators; private final static String[] fields = new String[] {"left", "ops", "comparators"}; public String[] get_fields() { return fields; } - public Compare(exprType left, cmpopType[] ops, exprType[] comparators) { + public Compare(exprType left, java.util.List<cmpopType> ops, + java.util.List<exprType> comparators) { this.left = left; addChild(left); this.ops = ops; this.comparators = comparators; if (comparators != null) { - for(int - icomparators=0;icomparators<comparators.length;icomparators++) { - addChild(comparators[icomparators]); + for(PythonTree t : comparators) { + addChild(t); } } } - public Compare(Token token, exprType left, cmpopType[] ops, exprType[] - comparators) { + public Compare(Token token, exprType left, java.util.List<cmpopType> ops, + java.util.List<exprType> comparators) { super(token); this.left = left; addChild(left); this.ops = ops; this.comparators = comparators; if (comparators != null) { - for(int - icomparators=0;icomparators<comparators.length;icomparators++) { - addChild(comparators[icomparators]); + for(PythonTree t : comparators) { + addChild(t); } } } - public Compare(int ttype, Token token, exprType left, cmpopType[] ops, - exprType[] comparators) { + public Compare(int ttype, Token token, exprType left, + java.util.List<cmpopType> ops, java.util.List<exprType> comparators) { super(ttype, token); this.left = left; addChild(left); this.ops = ops; this.comparators = comparators; if (comparators != null) { - for(int - icomparators=0;icomparators<comparators.length;icomparators++) { - addChild(comparators[icomparators]); + for(PythonTree t : comparators) { + addChild(t); } } } - public Compare(PythonTree tree, exprType left, cmpopType[] ops, exprType[] - comparators) { + public Compare(PythonTree tree, exprType left, java.util.List<cmpopType> + ops, java.util.List<exprType> comparators) { super(tree); this.left = left; addChild(left); this.ops = ops; this.comparators = comparators; if (comparators != null) { - for(int - icomparators=0;icomparators<comparators.length;icomparators++) { - addChild(comparators[icomparators]); + for(PythonTree t : comparators) { + addChild(t); } } } @@ -100,9 +97,9 @@ if (left != null) left.accept(visitor); if (comparators != null) { - for (int i = 0; i < comparators.length; i++) { - if (comparators[i] != null) - comparators[i].accept(visitor); + for (PythonTree t : comparators) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/Delete.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Delete.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/Delete.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -7,46 +7,46 @@ import java.io.IOException; public class Delete extends stmtType { - public exprType[] targets; + public java.util.List<exprType> targets; private final static String[] fields = new String[] {"targets"}; public String[] get_fields() { return fields; } - public Delete(exprType[] targets) { + public Delete(java.util.List<exprType> targets) { this.targets = targets; if (targets != null) { - for(int itargets=0;itargets<targets.length;itargets++) { - addChild(targets[itargets]); + for(PythonTree t : targets) { + addChild(t); } } } - public Delete(Token token, exprType[] targets) { + public Delete(Token token, java.util.List<exprType> targets) { super(token); this.targets = targets; if (targets != null) { - for(int itargets=0;itargets<targets.length;itargets++) { - addChild(targets[itargets]); + for(PythonTree t : targets) { + addChild(t); } } } - public Delete(int ttype, Token token, exprType[] targets) { + public Delete(int ttype, Token token, java.util.List<exprType> targets) { super(ttype, token); this.targets = targets; if (targets != null) { - for(int itargets=0;itargets<targets.length;itargets++) { - addChild(targets[itargets]); + for(PythonTree t : targets) { + addChild(t); } } } - public Delete(PythonTree tree, exprType[] targets) { + public Delete(PythonTree tree, java.util.List<exprType> targets) { super(tree); this.targets = targets; if (targets != null) { - for(int itargets=0;itargets<targets.length;itargets++) { - addChild(targets[itargets]); + for(PythonTree t : targets) { + addChild(t); } } } @@ -70,9 +70,9 @@ public void traverse(VisitorIF visitor) throws Exception { if (targets != null) { - for (int i = 0; i < targets.length; i++) { - if (targets[i] != null) - targets[i].accept(visitor); + for (PythonTree t : targets) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/Dict.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Dict.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/Dict.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -7,71 +7,75 @@ import java.io.IOException; public class Dict extends exprType { - public exprType[] keys; - public exprType[] values; + public java.util.List<exprType> keys; + public java.util.List<exprType> values; private final static String[] fields = new String[] {"keys", "values"}; public String[] get_fields() { return fields; } - public Dict(exprType[] keys, exprType[] values) { + public Dict(java.util.List<exprType> keys, java.util.List<exprType> values) + { this.keys = keys; if (keys != null) { - for(int ikeys=0;ikeys<keys.length;ikeys++) { - addChild(keys[ikeys]); + for(PythonTree t : keys) { + addChild(t); } } this.values = values; if (values != null) { - for(int ivalues=0;ivalues<values.length;ivalues++) { - addChild(values[ivalues]); + for(PythonTree t : values) { + addChild(t); } } } - public Dict(Token token, exprType[] keys, exprType[] values) { + public Dict(Token token, java.util.List<exprType> keys, + java.util.List<exprType> values) { super(token); this.keys = keys; if (keys != null) { - for(int ikeys=0;ikeys<keys.length;ikeys++) { - addChild(keys[ikeys]); + for(PythonTree t : keys) { + addChild(t); } } this.values = values; if (values != null) { - for(int ivalues=0;ivalues<values.length;ivalues++) { - addChild(values[ivalues]); + for(PythonTree t : values) { + addChild(t); } } } - public Dict(int ttype, Token token, exprType[] keys, exprType[] values) { + public Dict(int ttype, Token token, java.util.List<exprType> keys, + java.util.List<exprType> values) { super(ttype, token); this.keys = keys; if (keys != null) { - for(int ikeys=0;ikeys<keys.length;ikeys++) { - addChild(keys[ikeys]); + for(PythonTree t : keys) { + addChild(t); } } this.values = values; if (values != null) { - for(int ivalues=0;ivalues<values.length;ivalues++) { - addChild(values[ivalues]); + for(PythonTree t : values) { + addChild(t); } } } - public Dict(PythonTree tree, exprType[] keys, exprType[] values) { + public Dict(PythonTree tree, java.util.List<exprType> keys, + java.util.List<exprType> values) { super(tree); this.keys = keys; if (keys != null) { - for(int ikeys=0;ikeys<keys.length;ikeys++) { - addChild(keys[ikeys]); + for(PythonTree t : keys) { + addChild(t); } } this.values = values; if (values != null) { - for(int ivalues=0;ivalues<values.length;ivalues++) { - addChild(values[ivalues]); + for(PythonTree t : values) { + addChild(t); } } } @@ -98,15 +102,15 @@ public void traverse(VisitorIF visitor) throws Exception { if (keys != null) { - for (int i = 0; i < keys.length; i++) { - if (keys[i] != null) - keys[i].accept(visitor); + for (PythonTree t : keys) { + if (t != null) + t.accept(visitor); } } if (values != null) { - for (int i = 0; i < values.length; i++) { - if (values[i] != null) - values[i].accept(visitor); + for (PythonTree t : values) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/ExtSlice.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/ExtSlice.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/ExtSlice.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -7,46 +7,46 @@ import java.io.IOException; public class ExtSlice extends sliceType { - public sliceType[] dims; + public java.util.List<sliceType> dims; private final static String[] fields = new String[] {"dims"}; public String[] get_fields() { return fields; } - public ExtSlice(sliceType[] dims) { + public ExtSlice(java.util.List<sliceType> dims) { this.dims = dims; if (dims != null) { - for(int idims=0;idims<dims.length;idims++) { - addChild(dims[idims]); + for(PythonTree t : dims) { + addChild(t); } } } - public ExtSlice(Token token, sliceType[] dims) { + public ExtSlice(Token token, java.util.List<sliceType> dims) { super(token); this.dims = dims; if (dims != null) { - for(int idims=0;idims<dims.length;idims++) { - addChild(dims[idims]); + for(PythonTree t : dims) { + addChild(t); } } } - public ExtSlice(int ttype, Token token, sliceType[] dims) { + public ExtSlice(int ttype, Token token, java.util.List<sliceType> dims) { super(ttype, token); this.dims = dims; if (dims != null) { - for(int idims=0;idims<dims.length;idims++) { - addChild(dims[idims]); + for(PythonTree t : dims) { + addChild(t); } } } - public ExtSlice(PythonTree tree, sliceType[] dims) { + public ExtSlice(PythonTree tree, java.util.List<sliceType> dims) { super(tree); this.dims = dims; if (dims != null) { - for(int idims=0;idims<dims.length;idims++) { - addChild(dims[idims]); + for(PythonTree t : dims) { + addChild(t); } } } @@ -70,9 +70,9 @@ public void traverse(VisitorIF visitor) throws Exception { if (dims != null) { - for (int i = 0; i < dims.length; i++) { - if (dims[i] != null) - dims[i].accept(visitor); + for (PythonTree t : dims) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/For.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/For.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/For.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -9,35 +9,35 @@ public class For extends stmtType { public exprType target; public exprType iter; - public stmtType[] body; - public stmtType[] orelse; + public java.util.List<stmtType> body; + public java.util.List<stmtType> orelse; private final static String[] fields = new String[] {"target", "iter", "body", "orelse"}; public String[] get_fields() { return fields; } - public For(exprType target, exprType iter, stmtType[] body, stmtType[] - orelse) { + public For(exprType target, exprType iter, java.util.List<stmtType> body, + java.util.List<stmtType> orelse) { this.target = target; addChild(target); this.iter = iter; addChild(iter); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.orelse = orelse; if (orelse != null) { - for(int iorelse=0;iorelse<orelse.length;iorelse++) { - addChild(orelse[iorelse]); + for(PythonTree t : orelse) { + addChild(t); } } } - public For(Token token, exprType target, exprType iter, stmtType[] body, - stmtType[] orelse) { + public For(Token token, exprType target, exprType iter, + java.util.List<stmtType> body, java.util.List<stmtType> orelse) { super(token); this.target = target; addChild(target); @@ -45,20 +45,20 @@ addChild(iter); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.orelse = orelse; if (orelse != null) { - for(int iorelse=0;iorelse<orelse.length;iorelse++) { - addChild(orelse[iorelse]); + for(PythonTree t : orelse) { + addChild(t); } } } public For(int ttype, Token token, exprType target, exprType iter, - stmtType[] body, stmtType[] orelse) { + java.util.List<stmtType> body, java.util.List<stmtType> orelse) { super(ttype, token); this.target = target; addChild(target); @@ -66,20 +66,20 @@ addChild(iter); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.orelse = orelse; if (orelse != null) { - for(int iorelse=0;iorelse<orelse.length;iorelse++) { - addChild(orelse[iorelse]); + for(PythonTree t : orelse) { + addChild(t); } } } - public For(PythonTree tree, exprType target, exprType iter, stmtType[] - body, stmtType[] orelse) { + public For(PythonTree tree, exprType target, exprType iter, + java.util.List<stmtType> body, java.util.List<stmtType> orelse) { super(tree); this.target = target; addChild(target); @@ -87,14 +87,14 @@ addChild(iter); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.orelse = orelse; if (orelse != null) { - for(int iorelse=0;iorelse<orelse.length;iorelse++) { - addChild(orelse[iorelse]); + for(PythonTree t : orelse) { + addChild(t); } } } @@ -131,15 +131,15 @@ if (iter != null) iter.accept(visitor); if (body != null) { - for (int i = 0; i < body.length; i++) { - if (body[i] != null) - body[i].accept(visitor); + for (PythonTree t : body) { + if (t != null) + t.accept(visitor); } } if (orelse != null) { - for (int i = 0; i < orelse.length; i++) { - if (orelse[i] != null) - orelse[i].accept(visitor); + for (PythonTree t : orelse) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/FunctionDef.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/FunctionDef.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/FunctionDef.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -9,84 +9,84 @@ public class FunctionDef extends stmtType { public String name; public argumentsType args; - public stmtType[] body; - public exprType[] decorators; + public java.util.List<stmtType> body; + public java.util.List<exprType> decorators; private final static String[] fields = new String[] {"name", "args", "body", "decorators"}; public String[] get_fields() { return fields; } - public FunctionDef(String name, argumentsType args, stmtType[] body, - exprType[] decorators) { + public FunctionDef(String name, argumentsType args, + java.util.List<stmtType> body, java.util.List<exprType> decorators) { this.name = name; this.args = args; this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.decorators = decorators; if (decorators != null) { - for(int idecorators=0;idecorators<decorators.length;idecorators++) { - addChild(decorators[idecorators]); + for(PythonTree t : decorators) { + addChild(t); } } } - public FunctionDef(Token token, String name, argumentsType args, stmtType[] - body, exprType[] decorators) { + public FunctionDef(Token token, String name, argumentsType args, + java.util.List<stmtType> body, java.util.List<exprType> decorators) { super(token); this.name = name; this.args = args; this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.decorators = decorators; if (decorators != null) { - for(int idecorators=0;idecorators<decorators.length;idecorators++) { - addChild(decorators[idecorators]); + for(PythonTree t : decorators) { + addChild(t); } } } public FunctionDef(int ttype, Token token, String name, argumentsType args, - stmtType[] body, exprType[] decorators) { + java.util.List<stmtType> body, java.util.List<exprType> decorators) { super(ttype, token); this.name = name; this.args = args; this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.decorators = decorators; if (decorators != null) { - for(int idecorators=0;idecorators<decorators.length;idecorators++) { - addChild(decorators[idecorators]); + for(PythonTree t : decorators) { + addChild(t); } } } public FunctionDef(PythonTree tree, String name, argumentsType args, - stmtType[] body, exprType[] decorators) { + java.util.List<stmtType> body, java.util.List<exprType> decorators) { super(tree); this.name = name; this.args = args; this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.decorators = decorators; if (decorators != null) { - for(int idecorators=0;idecorators<decorators.length;idecorators++) { - addChild(decorators[idecorators]); + for(PythonTree t : decorators) { + addChild(t); } } } @@ -121,15 +121,15 @@ if (args != null) args.accept(visitor); if (body != null) { - for (int i = 0; i < body.length; i++) { - if (body[i] != null) - body[i].accept(visitor); + for (PythonTree t : body) { + if (t != null) + t.accept(visitor); } } if (decorators != null) { - for (int i = 0; i < decorators.length; i++) { - if (decorators[i] != null) - decorators[i].accept(visitor); + for (PythonTree t : decorators) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/GeneratorExp.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/GeneratorExp.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/GeneratorExp.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -8,57 +8,58 @@ public class GeneratorExp extends exprType { public exprType elt; - public comprehensionType[] generators; + public java.util.List<comprehensionType> generators; private final static String[] fields = new String[] {"elt", "generators"}; public String[] get_fields() { return fields; } - public GeneratorExp(exprType elt, comprehensionType[] generators) { + public GeneratorExp(exprType elt, java.util.List<comprehensionType> + generators) { this.elt = elt; addChild(elt); this.generators = generators; if (generators != null) { - for(int igenerators=0;igenerators<generators.length;igenerators++) { - addChild(generators[igenerators]); + for(PythonTree t : generators) { + addChild(t); } } } - public GeneratorExp(Token token, exprType elt, comprehensionType[] - generators) { + public GeneratorExp(Token token, exprType elt, + java.util.List<comprehensionType> generators) { super(token); this.elt = elt; addChild(elt); this.generators = generators; if (generators != null) { - for(int igenerators=0;igenerators<generators.length;igenerators++) { - addChild(generators[igenerators]); + for(PythonTree t : generators) { + addChild(t); } } } public GeneratorExp(int ttype, Token token, exprType elt, - comprehensionType[] generators) { + java.util.List<comprehensionType> generators) { super(ttype, token); this.elt = elt; addChild(elt); this.generators = generators; if (generators != null) { - for(int igenerators=0;igenerators<generators.length;igenerators++) { - addChild(generators[igenerators]); + for(PythonTree t : generators) { + addChild(t); } } } - public GeneratorExp(PythonTree tree, exprType elt, comprehensionType[] - generators) { + public GeneratorExp(PythonTree tree, exprType elt, + java.util.List<comprehensionType> generators) { super(tree); this.elt = elt; addChild(elt); this.generators = generators; if (generators != null) { - for(int igenerators=0;igenerators<generators.length;igenerators++) { - addChild(generators[igenerators]); + for(PythonTree t : generators) { + addChild(t); } } } @@ -87,9 +88,9 @@ if (elt != null) elt.accept(visitor); if (generators != null) { - for (int i = 0; i < generators.length; i++) { - if (generators[i] != null) - generators[i].accept(visitor); + for (PythonTree t : generators) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/Global.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Global.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/Global.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -7,26 +7,26 @@ import java.io.IOException; public class Global extends stmtType { - public String[] names; + public java.util.List<String> names; private final static String[] fields = new String[] {"names"}; public String[] get_fields() { return fields; } - public Global(String[] names) { + public Global(java.util.List<String> names) { this.names = names; } - public Global(Token token, String[] names) { + public Global(Token token, java.util.List<String> names) { super(token); this.names = names; } - public Global(int ttype, Token token, String[] names) { + public Global(int ttype, Token token, java.util.List<String> names) { super(ttype, token); this.names = names; } - public Global(PythonTree tree, String[] names) { + public Global(PythonTree tree, java.util.List<String> names) { super(tree); this.names = names; } Modified: branches/astwrite/src/org/python/antlr/ast/If.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/If.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/If.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -8,82 +8,84 @@ public class If extends stmtType { public exprType test; - public stmtType[] body; - public stmtType[] orelse; + public java.util.List<stmtType> body; + public java.util.List<stmtType> orelse; private final static String[] fields = new String[] {"test", "body", "orelse"}; public String[] get_fields() { return fields; } - public If(exprType test, stmtType[] body, stmtType[] orelse) { + public If(exprType test, java.util.List<stmtType> body, + java.util.List<stmtType> orelse) { this.test = test; addChild(test); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.orelse = orelse; if (orelse != null) { - for(int iorelse=0;iorelse<orelse.length;iorelse++) { - addChild(orelse[iorelse]); + for(PythonTree t : orelse) { + addChild(t); } } } - public If(Token token, exprType test, stmtType[] body, stmtType[] orelse) { + public If(Token token, exprType test, java.util.List<stmtType> body, + java.util.List<stmtType> orelse) { super(token); this.test = test; addChild(test); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.orelse = orelse; if (orelse != null) { - for(int iorelse=0;iorelse<orelse.length;iorelse++) { - addChild(orelse[iorelse]); + for(PythonTree t : orelse) { + addChild(t); } } } - public If(int ttype, Token token, exprType test, stmtType[] body, - stmtType[] orelse) { + public If(int ttype, Token token, exprType test, java.util.List<stmtType> + body, java.util.List<stmtType> orelse) { super(ttype, token); this.test = test; addChild(test); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.orelse = orelse; if (orelse != null) { - for(int iorelse=0;iorelse<orelse.length;iorelse++) { - addChild(orelse[iorelse]); + for(PythonTree t : orelse) { + addChild(t); } } } - public If(PythonTree tree, exprType test, stmtType[] body, stmtType[] - orelse) { + public If(PythonTree tree, exprType test, java.util.List<stmtType> body, + java.util.List<stmtType> orelse) { super(tree); this.test = test; addChild(test); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } this.orelse = orelse; if (orelse != null) { - for(int iorelse=0;iorelse<orelse.length;iorelse++) { - addChild(orelse[iorelse]); + for(PythonTree t : orelse) { + addChild(t); } } } @@ -115,15 +117,15 @@ if (test != null) test.accept(visitor); if (body != null) { - for (int i = 0; i < body.length; i++) { - if (body[i] != null) - body[i].accept(visitor); + for (PythonTree t : body) { + if (t != null) + t.accept(visitor); } } if (orelse != null) { - for (int i = 0; i < orelse.length; i++) { - if (orelse[i] != null) - orelse[i].accept(visitor); + for (PythonTree t : orelse) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/Import.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Import.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/Import.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -7,46 +7,46 @@ import java.io.IOException; public class Import extends stmtType { - public aliasType[] names; + public java.util.List<aliasType> names; private final static String[] fields = new String[] {"names"}; public String[] get_fields() { return fields; } - public Import(aliasType[] names) { + public Import(java.util.List<aliasType> names) { this.names = names; if (names != null) { - for(int inames=0;inames<names.length;inames++) { - addChild(names[inames]); + for(PythonTree t : names) { + addChild(t); } } } - public Import(Token token, aliasType[] names) { + public Import(Token token, java.util.List<aliasType> names) { super(token); this.names = names; if (names != null) { - for(int inames=0;inames<names.length;inames++) { - addChild(names[inames]); + for(PythonTree t : names) { + addChild(t); } } } - public Import(int ttype, Token token, aliasType[] names) { + public Import(int ttype, Token token, java.util.List<aliasType> names) { super(ttype, token); this.names = names; if (names != null) { - for(int inames=0;inames<names.length;inames++) { - addChild(names[inames]); + for(PythonTree t : names) { + addChild(t); } } } - public Import(PythonTree tree, aliasType[] names) { + public Import(PythonTree tree, java.util.List<aliasType> names) { super(tree); this.names = names; if (names != null) { - for(int inames=0;inames<names.length;inames++) { - addChild(names[inames]); + for(PythonTree t : names) { + addChild(t); } } } @@ -70,9 +70,9 @@ public void traverse(VisitorIF visitor) throws Exception { if (names != null) { - for (int i = 0; i < names.length; i++) { - if (names[i] != null) - names[i].accept(visitor); + for (PythonTree t : names) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/ImportFrom.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/ImportFrom.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/ImportFrom.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -8,58 +8,59 @@ public class ImportFrom extends stmtType { public String module; - public aliasType[] names; + public java.util.List<aliasType> names; public int level; private final static String[] fields = new String[] {"module", "names", "level"}; public String[] get_fields() { return fields; } - public ImportFrom(String module, aliasType[] names, int level) { + public ImportFrom(String module, java.util.List<aliasType> names, int + level) { this.module = module; this.names = names; if (names != null) { - for(int inames=0;inames<names.length;inames++) { - addChild(names[inames]); + for(PythonTree t : names) { + addChild(t); } } this.level = level; } - public ImportFrom(Token token, String module, aliasType[] names, int level) - { + public ImportFrom(Token token, String module, java.util.List<aliasType> + names, int level) { super(token); this.module = module; this.names = names; if (names != null) { - for(int inames=0;inames<names.length;inames++) { - addChild(names[inames]); + for(PythonTree t : names) { + addChild(t); } } this.level = level; } - public ImportFrom(int ttype, Token token, String module, aliasType[] names, - int level) { + public ImportFrom(int ttype, Token token, String module, + java.util.List<aliasType> names, int level) { super(ttype, token); this.module = module; this.names = names; if (names != null) { - for(int inames=0;inames<names.length;inames++) { - addChild(names[inames]); + for(PythonTree t : names) { + addChild(t); } } this.level = level; } - public ImportFrom(PythonTree tree, String module, aliasType[] names, int - level) { + public ImportFrom(PythonTree tree, String module, java.util.List<aliasType> + names, int level) { super(tree); this.module = module; this.names = names; if (names != null) { - for(int inames=0;inames<names.length;inames++) { - addChild(names[inames]); + for(PythonTree t : names) { + addChild(t); } } this.level = level; @@ -90,9 +91,9 @@ public void traverse(VisitorIF visitor) throws Exception { if (names != null) { - for (int i = 0; i < names.length; i++) { - if (names[i] != null) - names[i].accept(visitor); + for (PythonTree t : names) { + if (t != null) + t.accept(visitor); } } } Modified: branches/astwrite/src/org/python/antlr/ast/Interactive.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Interactive.java 2008-11-17 21:48:50 UTC (rev 5586) +++ branches/astwrite/src/org/python/antlr/ast/Interactive.java 2008-11-17 21:50:26 UTC (rev 5587) @@ -7,46 +7,46 @@ import java.io.IOException; public class Interactive extends modType { - public stmtType[] body; + public java.util.List<stmtType> body; private final static String[] fields = new String[] {"body"}; public String[] get_fields() { return fields; } - public Interactive(stmtType[] body) { + public Interactive(java.util.List<stmtType> body) { this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } } - public Interactive(Token token, stmtType[] body) { + public Interactive(Token token, java.util.List<stmtType> body) { super(token); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } } - public Interactive(int ttype, Token token, stmtType[] body) { + public Interactive(int ttype, Token token, java.util.List<stmtType> body) { super(ttype, token); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.length;ibody++) { - addChild(body[ibody]); + for(PythonTree t : body) { + addChild(t); } } } - public Interactive(PythonTree tree, stmtType[] body) { + public Interactive(PythonTree tree, java.util.List<stmtType> body) { super(tree); this.body = body; if (body != null) { - for(int ibody=0;ibody<body.l... [truncated message content] |