From: <fwi...@us...> - 2008-11-18 20:21:23
|
Revision: 5592 http://jython.svn.sourceforge.net/jython/?rev=5592&view=rev Author: fwierzbicki Date: 2008-11-18 20:21:20 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Changes all field access on ast nodes to get/set access. One unfortunate wrinkle: getType() is actually part of Antlr's Tree interface, so for the moment I have changed the two "type" fields (Raise and excepthandler) to excepttype. Modified Paths: -------------- branches/astwrite/ast/Python.asdl branches/astwrite/ast/asdl_antlr.py branches/astwrite/grammar/Python.g branches/astwrite/src/org/python/antlr/GrammarActions.java branches/astwrite/src/org/python/antlr/ast/Assert.java branches/astwrite/src/org/python/antlr/ast/Assign.java branches/astwrite/src/org/python/antlr/ast/Attribute.java branches/astwrite/src/org/python/antlr/ast/AugAssign.java branches/astwrite/src/org/python/antlr/ast/BinOp.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/Exec.java branches/astwrite/src/org/python/antlr/ast/Expr.java branches/astwrite/src/org/python/antlr/ast/Expression.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/IfExp.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/Index.java branches/astwrite/src/org/python/antlr/ast/Interactive.java branches/astwrite/src/org/python/antlr/ast/Lambda.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/Name.java branches/astwrite/src/org/python/antlr/ast/Num.java branches/astwrite/src/org/python/antlr/ast/Print.java branches/astwrite/src/org/python/antlr/ast/Raise.java branches/astwrite/src/org/python/antlr/ast/Repr.java branches/astwrite/src/org/python/antlr/ast/Return.java branches/astwrite/src/org/python/antlr/ast/Slice.java branches/astwrite/src/org/python/antlr/ast/Str.java branches/astwrite/src/org/python/antlr/ast/Subscript.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/UnaryOp.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/Yield.java branches/astwrite/src/org/python/antlr/ast/aliasType.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 branches/astwrite/src/org/python/antlr/ast/keywordType.java branches/astwrite/src/org/python/compiler/ArgListCompiler.java branches/astwrite/src/org/python/compiler/CodeCompiler.java branches/astwrite/src/org/python/compiler/Future.java branches/astwrite/src/org/python/compiler/ScopesCompiler.java Modified: branches/astwrite/ast/Python.asdl =================================================================== --- branches/astwrite/ast/Python.asdl 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/ast/Python.asdl 2008-11-18 20:21:20 UTC (rev 5592) @@ -29,7 +29,7 @@ | With(expr context_expr, expr? optional_vars, stmt* body) -- 'type' is a bad name - | Raise(expr? type, expr? inst, expr? tback) + | Raise(expr? excepttype, expr? inst, expr? tback) | TryExcept(stmt* body, excepthandler* handlers, stmt* orelse) | TryFinally(stmt* body, stmt* finalbody) | Assert(expr test, expr? msg) @@ -102,7 +102,7 @@ -- TODO(jhylton): Figure out if there is a better way to handle -- lineno and col_offset fields, particularly when -- ast is exposed to Python. - excepthandler = (expr? type, expr? name, stmt* body, int lineno, + excepthandler = (expr? excepttype, expr? name, stmt* body, int lineno, int col_offset) arguments = (expr* args, identifier? vararg, Modified: branches/astwrite/ast/asdl_antlr.py =================================================================== --- branches/astwrite/ast/asdl_antlr.py 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/ast/asdl_antlr.py 2008-11-18 20:21:20 UTC (rev 5592) @@ -399,7 +399,16 @@ self.emit("", 0) def visitField(self, field, depth): - self.emit("public %s;" % self.fieldDef(field), depth) + self.emit("private %s;" % self.fieldDef(field), depth) + self.emit("public %s get%s() {" % (self.javaType(field), + str(field.name).capitalize()), depth) + self.emit("return %s;" % field.name, depth+1) + self.emit("}", depth) + self.emit("public void set%s(%s) {" % (str(field.name).capitalize(), + self.fieldDef(field)), depth) + self.emit("this.%s = %s;" % (field.name, field.name), depth+1) + self.emit("}", depth) + self.emit("", 0) bltinnames = { 'int' : 'int', Modified: branches/astwrite/grammar/Python.g =================================================================== --- branches/astwrite/grammar/Python.g 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/grammar/Python.g 2008-11-18 20:21:20 UTC (rev 5592) @@ -1189,16 +1189,16 @@ } if (o instanceof Call) { Call c = (Call)o; - c.func = $etype; + c.setFunc($etype); $etype = c; } else if (o instanceof Subscript) { Subscript c = (Subscript)o; - c.value = $etype; + c.setValue($etype); $etype = c; } else if (o instanceof Attribute) { Attribute c = (Attribute)o; c.setCharStartIndex($etype.getCharStartIndex()); - c.value = $etype; + c.setValue($etype); $etype = c; } } Modified: branches/astwrite/src/org/python/antlr/GrammarActions.java =================================================================== --- branches/astwrite/src/org/python/antlr/GrammarActions.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/GrammarActions.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -135,7 +135,7 @@ List<exprType> result = new ArrayList<exprType>(); if (etype != null) { if (etype instanceof Tuple) { - return ((Tuple)etype).elts; + return ((Tuple)etype).getElts(); } result.add(etype); } @@ -314,10 +314,10 @@ } if (tree instanceof GeneratorExp) { GeneratorExp g = (GeneratorExp)tree; - recurseSetContext(g.elt, context); + recurseSetContext(g.getElt(), context); } else if (tree instanceof ListComp) { ListComp lc = (ListComp)tree; - recurseSetContext(lc.elt, context); + recurseSetContext(lc.getElt(), context); } else if (!(tree instanceof ListComp)) { for (int i=0; i<tree.getChildCount(); i++) { recurseSetContext(tree.getChild(i), context); @@ -357,7 +357,7 @@ checkAssign(castExpr(e.get(0))); if (e.get(0) instanceof Name) { Name arg = (Name)e.get(0); - k.add(new keywordType(arg, arg.id, castExpr(e.get(1)))); + k.add(new keywordType(arg, arg.getId(), castExpr(e.get(1)))); } else { errorHandler.error("keyword must be a name", (PythonTree)e.get(0)); } @@ -588,28 +588,28 @@ exprType negate(PythonTree t, exprType o) { if (o instanceof Num) { Num num = (Num)o; - if (num.n instanceof PyInteger) { - int v = ((PyInteger)num.n).getValue(); + if (num.getN() instanceof PyInteger) { + int v = ((PyInteger)num.getN()).getValue(); if (v > 0) { - num.n = new PyInteger(-v); + num.setN(new PyInteger(-v)); return num; } - } else if (num.n instanceof PyLong) { - BigInteger v = ((PyLong)num.n).getValue(); + } else if (num.getN() instanceof PyLong) { + BigInteger v = ((PyLong)num.getN()).getValue(); if (v.compareTo(BigInteger.ZERO) == 1) { - num.n = new PyLong(v.negate()); + num.setN(new PyLong(v.negate())); return num; } - } else if (num.n instanceof PyFloat) { - double v = ((PyFloat)num.n).getValue(); + } else if (num.getN() instanceof PyFloat) { + double v = ((PyFloat)num.getN()).getValue(); if (v > 0) { - num.n = new PyFloat(-v); + num.setN(new PyFloat(-v)); return num; } - } else if (num.n instanceof PyComplex) { - double v = ((PyComplex)num.n).imag; + } else if (num.getN() instanceof PyComplex) { + double v = ((PyComplex)num.getN()).imag; if (v > 0) { - num.n = new PyComplex(0,-v); + num.setN(new PyComplex(0,-v)); return num; } } @@ -631,7 +631,7 @@ } void checkAssign(exprType e) { - if (e instanceof Name && ((Name)e).id.equals("None")) { + if (e instanceof Name && ((Name)e).getId().equals("None")) { errorHandler.error("assignment to None", e); } else if (e instanceof GeneratorExp) { errorHandler.error("can't assign to generator expression", e); @@ -653,7 +653,7 @@ errorHandler.error("can't assign to conditional expression", e); } else if (e instanceof Tuple) { //XXX: performance problem? Any way to do this better? - List<exprType> elts = ((Tuple)e).elts; + List<exprType> elts = ((Tuple)e).getElts(); if (elts.size() == 0) { errorHandler.error("can't assign to ()", e); } @@ -662,7 +662,7 @@ } } else if (e instanceof org.python.antlr.ast.List) { //XXX: performance problem? Any way to do this better? - List<exprType> elts = ((org.python.antlr.ast.List)e).elts; + List<exprType> elts = ((org.python.antlr.ast.List)e).getElts(); for (int i=0;i<elts.size();i++) { checkAssign(elts.get(i)); } @@ -781,7 +781,7 @@ for (Object o : sltypes) { if (o instanceof Index) { Index i = (Index)o; - etypes.add(i.value); + etypes.add(i.getValue()); } else { extslice = true; break; Modified: branches/astwrite/src/org/python/antlr/ast/Assert.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Assert.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Assert.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class Assert extends stmtType { - public exprType test; - public exprType msg; + private exprType test; + public exprType getTest() { + return test; + } + public void setTest(exprType test) { + this.test = test; + } + private exprType msg; + public exprType getMsg() { + return msg; + } + public void setMsg(exprType msg) { + this.msg = msg; + } + + private final static String[] fields = new String[] {"test", "msg"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Assign.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Assign.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Assign.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class Assign extends stmtType { - public java.util.List<exprType> targets; - public exprType value; + private java.util.List<exprType> targets; + public java.util.List<exprType> getTargets() { + return targets; + } + public void setTargets(java.util.List<exprType> targets) { + this.targets = targets; + } + private exprType value; + public exprType getValue() { + return value; + } + public void setValue(exprType value) { + this.value = value; + } + + private final static String[] fields = new String[] {"targets", "value"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Attribute.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Attribute.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Attribute.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class Attribute extends exprType implements Context { - public exprType value; - public String attr; - public expr_contextType ctx; + private exprType value; + public exprType getValue() { + return value; + } + public void setValue(exprType value) { + this.value = value; + } + private String attr; + public String getAttr() { + return attr; + } + public void setAttr(String attr) { + this.attr = attr; + } + + private expr_contextType ctx; + public expr_contextType getCtx() { + return ctx; + } + public void setCtx(expr_contextType ctx) { + this.ctx = ctx; + } + + private final static String[] fields = new String[] {"value", "attr", "ctx"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/AugAssign.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/AugAssign.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/AugAssign.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class AugAssign extends stmtType { - public exprType target; - public operatorType op; - public exprType value; + private exprType target; + public exprType getTarget() { + return target; + } + public void setTarget(exprType target) { + this.target = target; + } + private operatorType op; + public operatorType getOp() { + return op; + } + public void setOp(operatorType op) { + this.op = op; + } + + private exprType value; + public exprType getValue() { + return value; + } + public void setValue(exprType value) { + this.value = value; + } + + private final static String[] fields = new String[] {"target", "op", "value"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/BinOp.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/BinOp.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/BinOp.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class BinOp extends exprType { - public exprType left; - public operatorType op; - public exprType right; + private exprType left; + public exprType getLeft() { + return left; + } + public void setLeft(exprType left) { + this.left = left; + } + private operatorType op; + public operatorType getOp() { + return op; + } + public void setOp(operatorType op) { + this.op = op; + } + + private exprType right; + public exprType getRight() { + return right; + } + public void setRight(exprType right) { + this.right = right; + } + + private final static String[] fields = new String[] {"left", "op", "right"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/BoolOp.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/BoolOp.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/BoolOp.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class BoolOp extends exprType { - public boolopType op; - public java.util.List<exprType> values; + private boolopType op; + public boolopType getOp() { + return op; + } + public void setOp(boolopType op) { + this.op = op; + } + private java.util.List<exprType> values; + public java.util.List<exprType> getValues() { + return values; + } + public void setValues(java.util.List<exprType> values) { + this.values = values; + } + + private final static String[] fields = new String[] {"op", "values"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Call.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Call.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Call.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,12 +7,47 @@ import java.io.IOException; public class Call extends exprType { - public exprType func; - public java.util.List<exprType> args; - public java.util.List<keywordType> keywords; - public exprType starargs; - public exprType kwargs; + private exprType func; + public exprType getFunc() { + return func; + } + public void setFunc(exprType func) { + this.func = func; + } + private java.util.List<exprType> args; + public java.util.List<exprType> getArgs() { + return args; + } + public void setArgs(java.util.List<exprType> args) { + this.args = args; + } + + private java.util.List<keywordType> keywords; + public java.util.List<keywordType> getKeywords() { + return keywords; + } + public void setKeywords(java.util.List<keywordType> keywords) { + this.keywords = keywords; + } + + private exprType starargs; + public exprType getStarargs() { + return starargs; + } + public void setStarargs(exprType starargs) { + this.starargs = starargs; + } + + private exprType kwargs; + public exprType getKwargs() { + return kwargs; + } + public void setKwargs(exprType kwargs) { + this.kwargs = kwargs; + } + + private final static String[] fields = new String[] {"func", "args", "keywords", "starargs", "kwargs"}; Modified: branches/astwrite/src/org/python/antlr/ast/ClassDef.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/ClassDef.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/ClassDef.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,11 +7,39 @@ import java.io.IOException; public class ClassDef extends stmtType { - public String name; - public java.util.List<exprType> bases; - public java.util.List<stmtType> body; - public java.util.List<exprType> decorators; + private String name; + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + private java.util.List<exprType> bases; + public java.util.List<exprType> getBases() { + return bases; + } + public void setBases(java.util.List<exprType> bases) { + this.bases = bases; + } + + private java.util.List<stmtType> body; + public java.util.List<stmtType> getBody() { + return body; + } + public void setBody(java.util.List<stmtType> body) { + this.body = body; + } + + private java.util.List<exprType> decorators; + public java.util.List<exprType> getDecorators() { + return decorators; + } + public void setDecorators(java.util.List<exprType> decorators) { + this.decorators = decorators; + } + + private final static String[] fields = new String[] {"name", "bases", "body", "decorators"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Compare.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Compare.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Compare.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class Compare extends exprType { - public exprType left; - public java.util.List<cmpopType> ops; - public java.util.List<exprType> comparators; + private exprType left; + public exprType getLeft() { + return left; + } + public void setLeft(exprType left) { + this.left = left; + } + private java.util.List<cmpopType> ops; + public java.util.List<cmpopType> getOps() { + return ops; + } + public void setOps(java.util.List<cmpopType> ops) { + this.ops = ops; + } + + private java.util.List<exprType> comparators; + public java.util.List<exprType> getComparators() { + return comparators; + } + public void setComparators(java.util.List<exprType> comparators) { + this.comparators = comparators; + } + + private final static String[] fields = new String[] {"left", "ops", "comparators"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Delete.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Delete.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Delete.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Delete extends stmtType { - public java.util.List<exprType> targets; + private java.util.List<exprType> targets; + public java.util.List<exprType> getTargets() { + return targets; + } + public void setTargets(java.util.List<exprType> targets) { + this.targets = targets; + } + private final static String[] fields = new String[] {"targets"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Dict.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Dict.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Dict.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class Dict extends exprType { - public java.util.List<exprType> keys; - public java.util.List<exprType> values; + private java.util.List<exprType> keys; + public java.util.List<exprType> getKeys() { + return keys; + } + public void setKeys(java.util.List<exprType> keys) { + this.keys = keys; + } + private java.util.List<exprType> values; + public java.util.List<exprType> getValues() { + return values; + } + public void setValues(java.util.List<exprType> values) { + this.values = values; + } + + private final static String[] fields = new String[] {"keys", "values"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Exec.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Exec.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Exec.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class Exec extends stmtType { - public exprType body; - public exprType globals; - public exprType locals; + private exprType body; + public exprType getBody() { + return body; + } + public void setBody(exprType body) { + this.body = body; + } + private exprType globals; + public exprType getGlobals() { + return globals; + } + public void setGlobals(exprType globals) { + this.globals = globals; + } + + private exprType locals; + public exprType getLocals() { + return locals; + } + public void setLocals(exprType locals) { + this.locals = locals; + } + + private final static String[] fields = new String[] {"body", "globals", "locals"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Expr.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Expr.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Expr.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Expr extends stmtType { - public exprType value; + private exprType value; + public exprType getValue() { + return value; + } + public void setValue(exprType value) { + this.value = value; + } + private final static String[] fields = new String[] {"value"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Expression.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Expression.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Expression.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Expression extends modType { - public exprType body; + private exprType body; + public exprType getBody() { + return body; + } + public void setBody(exprType body) { + this.body = body; + } + private final static String[] fields = new String[] {"body"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/ExtSlice.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/ExtSlice.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/ExtSlice.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class ExtSlice extends sliceType { - public java.util.List<sliceType> dims; + private java.util.List<sliceType> dims; + public java.util.List<sliceType> getDims() { + return dims; + } + public void setDims(java.util.List<sliceType> dims) { + this.dims = dims; + } + private final static String[] fields = new String[] {"dims"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/For.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/For.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/For.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,11 +7,39 @@ import java.io.IOException; public class For extends stmtType { - public exprType target; - public exprType iter; - public java.util.List<stmtType> body; - public java.util.List<stmtType> orelse; + private exprType target; + public exprType getTarget() { + return target; + } + public void setTarget(exprType target) { + this.target = target; + } + private exprType iter; + public exprType getIter() { + return iter; + } + public void setIter(exprType iter) { + this.iter = iter; + } + + private java.util.List<stmtType> body; + public java.util.List<stmtType> getBody() { + return body; + } + public void setBody(java.util.List<stmtType> body) { + this.body = body; + } + + private java.util.List<stmtType> orelse; + public java.util.List<stmtType> getOrelse() { + return orelse; + } + public void setOrelse(java.util.List<stmtType> orelse) { + this.orelse = orelse; + } + + private final static String[] fields = new String[] {"target", "iter", "body", "orelse"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/FunctionDef.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/FunctionDef.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/FunctionDef.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,11 +7,39 @@ import java.io.IOException; public class FunctionDef extends stmtType { - public String name; - public argumentsType args; - public java.util.List<stmtType> body; - public java.util.List<exprType> decorators; + private String name; + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + private argumentsType args; + public argumentsType getArgs() { + return args; + } + public void setArgs(argumentsType args) { + this.args = args; + } + + private java.util.List<stmtType> body; + public java.util.List<stmtType> getBody() { + return body; + } + public void setBody(java.util.List<stmtType> body) { + this.body = body; + } + + private java.util.List<exprType> decorators; + public java.util.List<exprType> getDecorators() { + return decorators; + } + public void setDecorators(java.util.List<exprType> decorators) { + this.decorators = decorators; + } + + private final static String[] fields = new String[] {"name", "args", "body", "decorators"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/GeneratorExp.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/GeneratorExp.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/GeneratorExp.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class GeneratorExp extends exprType { - public exprType elt; - public java.util.List<comprehensionType> generators; + private exprType elt; + public exprType getElt() { + return elt; + } + public void setElt(exprType elt) { + this.elt = elt; + } + private java.util.List<comprehensionType> generators; + public java.util.List<comprehensionType> getGenerators() { + return generators; + } + public void setGenerators(java.util.List<comprehensionType> generators) { + this.generators = generators; + } + + private final static String[] fields = new String[] {"elt", "generators"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Global.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Global.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Global.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Global extends stmtType { - public java.util.List<String> names; + private java.util.List<String> names; + public java.util.List<String> getNames() { + return names; + } + public void setNames(java.util.List<String> names) { + this.names = names; + } + private final static String[] fields = new String[] {"names"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/If.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/If.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/If.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class If extends stmtType { - public exprType test; - public java.util.List<stmtType> body; - public java.util.List<stmtType> orelse; + private exprType test; + public exprType getTest() { + return test; + } + public void setTest(exprType test) { + this.test = test; + } + private java.util.List<stmtType> body; + public java.util.List<stmtType> getBody() { + return body; + } + public void setBody(java.util.List<stmtType> body) { + this.body = body; + } + + private java.util.List<stmtType> orelse; + public java.util.List<stmtType> getOrelse() { + return orelse; + } + public void setOrelse(java.util.List<stmtType> orelse) { + this.orelse = orelse; + } + + private final static String[] fields = new String[] {"test", "body", "orelse"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/IfExp.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/IfExp.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/IfExp.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class IfExp extends exprType { - public exprType test; - public exprType body; - public exprType orelse; + private exprType test; + public exprType getTest() { + return test; + } + public void setTest(exprType test) { + this.test = test; + } + private exprType body; + public exprType getBody() { + return body; + } + public void setBody(exprType body) { + this.body = body; + } + + private exprType orelse; + public exprType getOrelse() { + return orelse; + } + public void setOrelse(exprType orelse) { + this.orelse = orelse; + } + + private final static String[] fields = new String[] {"test", "body", "orelse"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Import.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Import.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Import.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Import extends stmtType { - public java.util.List<aliasType> names; + private java.util.List<aliasType> names; + public java.util.List<aliasType> getNames() { + return names; + } + public void setNames(java.util.List<aliasType> names) { + this.names = names; + } + private final static String[] fields = new String[] {"names"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/ImportFrom.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/ImportFrom.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/ImportFrom.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class ImportFrom extends stmtType { - public String module; - public java.util.List<aliasType> names; - public int level; + private String module; + public String getModule() { + return module; + } + public void setModule(String module) { + this.module = module; + } + private java.util.List<aliasType> names; + public java.util.List<aliasType> getNames() { + return names; + } + public void setNames(java.util.List<aliasType> names) { + this.names = names; + } + + private int level; + public int getLevel() { + return level; + } + public void setLevel(int level) { + this.level = level; + } + + private final static String[] fields = new String[] {"module", "names", "level"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Index.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Index.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Index.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Index extends sliceType { - public exprType value; + private exprType value; + public exprType getValue() { + return value; + } + public void setValue(exprType value) { + this.value = value; + } + private final static String[] fields = new String[] {"value"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Interactive.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Interactive.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Interactive.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Interactive extends modType { - public java.util.List<stmtType> body; + private java.util.List<stmtType> body; + public java.util.List<stmtType> getBody() { + return body; + } + public void setBody(java.util.List<stmtType> body) { + this.body = body; + } + private final static String[] fields = new String[] {"body"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Lambda.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Lambda.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Lambda.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class Lambda extends exprType { - public argumentsType args; - public exprType body; + private argumentsType args; + public argumentsType getArgs() { + return args; + } + public void setArgs(argumentsType args) { + this.args = args; + } + private exprType body; + public exprType getBody() { + return body; + } + public void setBody(exprType body) { + this.body = body; + } + + private final static String[] fields = new String[] {"args", "body"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/List.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/List.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/List.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class List extends exprType implements Context { - public java.util.List<exprType> elts; - public expr_contextType ctx; + private java.util.List<exprType> elts; + public java.util.List<exprType> getElts() { + return elts; + } + public void setElts(java.util.List<exprType> elts) { + this.elts = elts; + } + private expr_contextType ctx; + public expr_contextType getCtx() { + return ctx; + } + public void setCtx(expr_contextType ctx) { + this.ctx = ctx; + } + + private final static String[] fields = new String[] {"elts", "ctx"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/ListComp.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/ListComp.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/ListComp.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class ListComp extends exprType { - public exprType elt; - public java.util.List<comprehensionType> generators; + private exprType elt; + public exprType getElt() { + return elt; + } + public void setElt(exprType elt) { + this.elt = elt; + } + private java.util.List<comprehensionType> generators; + public java.util.List<comprehensionType> getGenerators() { + return generators; + } + public void setGenerators(java.util.List<comprehensionType> generators) { + this.generators = generators; + } + + private final static String[] fields = new String[] {"elt", "generators"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Module.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Module.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Module.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Module extends modType { - public java.util.List<stmtType> body; + private java.util.List<stmtType> body; + public java.util.List<stmtType> getBody() { + return body; + } + public void setBody(java.util.List<stmtType> body) { + this.body = body; + } + private final static String[] fields = new String[] {"body"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Name.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Name.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Name.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class Name extends exprType implements Context { - public String id; - public expr_contextType ctx; + private String id; + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + private expr_contextType ctx; + public expr_contextType getCtx() { + return ctx; + } + public void setCtx(expr_contextType ctx) { + this.ctx = ctx; + } + + private final static String[] fields = new String[] {"id", "ctx"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Num.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Num.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Num.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Num extends exprType { - public Object n; + private Object n; + public Object getN() { + return n; + } + public void setN(Object n) { + this.n = n; + } + private final static String[] fields = new String[] {"n"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Print.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Print.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Print.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class Print extends stmtType { - public exprType dest; - public java.util.List<exprType> values; - public boolean nl; + private exprType dest; + public exprType getDest() { + return dest; + } + public void setDest(exprType dest) { + this.dest = dest; + } + private java.util.List<exprType> values; + public java.util.List<exprType> getValues() { + return values; + } + public void setValues(java.util.List<exprType> values) { + this.values = values; + } + + private boolean nl; + public boolean getNl() { + return nl; + } + public void setNl(boolean nl) { + this.nl = nl; + } + + private final static String[] fields = new String[] {"dest", "values", "nl"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Raise.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Raise.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Raise.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,49 +7,71 @@ import java.io.IOException; public class Raise extends stmtType { - public exprType type; - public exprType inst; - public exprType tback; + private exprType excepttype; + public exprType getExcepttype() { + return excepttype; + } + public void setExcepttype(exprType excepttype) { + this.excepttype = excepttype; + } - private final static String[] fields = new String[] {"type", "inst", + private exprType inst; + public exprType getInst() { + return inst; + } + public void setInst(exprType inst) { + this.inst = inst; + } + + private exprType tback; + public exprType getTback() { + return tback; + } + public void setTback(exprType tback) { + this.tback = tback; + } + + + private final static String[] fields = new String[] {"excepttype", "inst", "tback"}; public String[] get_fields() { return fields; } - public Raise(exprType type, exprType inst, exprType tback) { - this.type = type; - addChild(type); + public Raise(exprType excepttype, exprType inst, exprType tback) { + this.excepttype = excepttype; + addChild(excepttype); this.inst = inst; addChild(inst); this.tback = tback; addChild(tback); } - public Raise(Token token, exprType type, exprType inst, exprType tback) { + public Raise(Token token, exprType excepttype, exprType inst, exprType + tback) { super(token); - this.type = type; - addChild(type); + this.excepttype = excepttype; + addChild(excepttype); this.inst = inst; addChild(inst); this.tback = tback; addChild(tback); } - public Raise(int ttype, Token token, exprType type, exprType inst, exprType - tback) { + public Raise(int ttype, Token token, exprType excepttype, exprType inst, + exprType tback) { super(ttype, token); - this.type = type; - addChild(type); + this.excepttype = excepttype; + addChild(excepttype); this.inst = inst; addChild(inst); this.tback = tback; addChild(tback); } - public Raise(PythonTree tree, exprType type, exprType inst, exprType tback) - { + public Raise(PythonTree tree, exprType excepttype, exprType inst, exprType + tback) { super(tree); - this.type = type; - addChild(type); + this.excepttype = excepttype; + addChild(excepttype); this.inst = inst; addChild(inst); this.tback = tback; @@ -62,8 +84,8 @@ public String toStringTree() { StringBuffer sb = new StringBuffer("Raise("); - sb.append("type="); - sb.append(dumpThis(type)); + sb.append("excepttype="); + sb.append(dumpThis(excepttype)); sb.append(","); sb.append("inst="); sb.append(dumpThis(inst)); @@ -80,8 +102,8 @@ } public void traverse(VisitorIF visitor) throws Exception { - if (type != null) - type.accept(visitor); + if (excepttype != null) + excepttype.accept(visitor); if (inst != null) inst.accept(visitor); if (tback != null) Modified: branches/astwrite/src/org/python/antlr/ast/Repr.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Repr.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Repr.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Repr extends exprType { - public exprType value; + private exprType value; + public exprType getValue() { + return value; + } + public void setValue(exprType value) { + this.value = value; + } + private final static String[] fields = new String[] {"value"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Return.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Return.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Return.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Return extends stmtType { - public exprType value; + private exprType value; + public exprType getValue() { + return value; + } + public void setValue(exprType value) { + this.value = value; + } + private final static String[] fields = new String[] {"value"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Slice.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Slice.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Slice.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class Slice extends sliceType { - public exprType lower; - public exprType upper; - public exprType step; + private exprType lower; + public exprType getLower() { + return lower; + } + public void setLower(exprType lower) { + this.lower = lower; + } + private exprType upper; + public exprType getUpper() { + return upper; + } + public void setUpper(exprType upper) { + this.upper = upper; + } + + private exprType step; + public exprType getStep() { + return step; + } + public void setStep(exprType step) { + this.step = step; + } + + private final static String[] fields = new String[] {"lower", "upper", "step"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Str.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Str.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Str.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Str extends exprType { - public Object s; + private Object s; + public Object getS() { + return s; + } + public void setS(Object s) { + this.s = s; + } + private final static String[] fields = new String[] {"s"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Subscript.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Subscript.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Subscript.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class Subscript extends exprType implements Context { - public exprType value; - public sliceType slice; - public expr_contextType ctx; + private exprType value; + public exprType getValue() { + return value; + } + public void setValue(exprType value) { + this.value = value; + } + private sliceType slice; + public sliceType getSlice() { + return slice; + } + public void setSlice(sliceType slice) { + this.slice = slice; + } + + private expr_contextType ctx; + public expr_contextType getCtx() { + return ctx; + } + public void setCtx(expr_contextType ctx) { + this.ctx = ctx; + } + + private final static String[] fields = new String[] {"value", "slice", "ctx"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Suite.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Suite.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Suite.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,8 +7,15 @@ import java.io.IOException; public class Suite extends modType { - public java.util.List<stmtType> body; + private java.util.List<stmtType> body; + public java.util.List<stmtType> getBody() { + return body; + } + public void setBody(java.util.List<stmtType> body) { + this.body = body; + } + private final static String[] fields = new String[] {"body"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/TryExcept.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/TryExcept.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/TryExcept.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,10 +7,31 @@ import java.io.IOException; public class TryExcept extends stmtType { - public java.util.List<stmtType> body; - public java.util.List<excepthandlerType> handlers; - public java.util.List<stmtType> orelse; + private java.util.List<stmtType> body; + public java.util.List<stmtType> getBody() { + return body; + } + public void setBody(java.util.List<stmtType> body) { + this.body = body; + } + private java.util.List<excepthandlerType> handlers; + public java.util.List<excepthandlerType> getHandlers() { + return handlers; + } + public void setHandlers(java.util.List<excepthandlerType> handlers) { + this.handlers = handlers; + } + + private java.util.List<stmtType> orelse; + public java.util.List<stmtType> getOrelse() { + return orelse; + } + public void setOrelse(java.util.List<stmtType> orelse) { + this.orelse = orelse; + } + + private final static String[] fields = new String[] {"body", "handlers", "orelse"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/TryFinally.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/TryFinally.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/TryFinally.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class TryFinally extends stmtType { - public java.util.List<stmtType> body; - public java.util.List<stmtType> finalbody; + private java.util.List<stmtType> body; + public java.util.List<stmtType> getBody() { + return body; + } + public void setBody(java.util.List<stmtType> body) { + this.body = body; + } + private java.util.List<stmtType> finalbody; + public java.util.List<stmtType> getFinalbody() { + return finalbody; + } + public void setFinalbody(java.util.List<stmtType> finalbody) { + this.finalbody = finalbody; + } + + private final static String[] fields = new String[] {"body", "finalbody"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/Tuple.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/Tuple.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/Tuple.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class Tuple extends exprType implements Context { - public java.util.List<exprType> elts; - public expr_contextType ctx; + private java.util.List<exprType> elts; + public java.util.List<exprType> getElts() { + return elts; + } + public void setElts(java.util.List<exprType> elts) { + this.elts = elts; + } + private expr_contextType ctx; + public expr_contextType getCtx() { + return ctx; + } + public void setCtx(expr_contextType ctx) { + this.ctx = ctx; + } + + private final static String[] fields = new String[] {"elts", "ctx"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/UnaryOp.java =================================================================== --- branches/astwrite/src/org/python/antlr/ast/UnaryOp.java 2008-11-18 16:02:41 UTC (rev 5591) +++ branches/astwrite/src/org/python/antlr/ast/UnaryOp.java 2008-11-18 20:21:20 UTC (rev 5592) @@ -7,9 +7,23 @@ import java.io.IOException; public class UnaryOp extends exprType { - public unaryopType op; - public exprType operand; + private unaryopType op; + public unaryopType getOp() { + return op; + } + public void setOp(unaryopType op) { + this.op = op; + } + private exprType operand; + public exprType getOperand() { + return operand; + } + public void setOperand(exprType operand) { + this.operand = operand; + } + + private final static String[] fields = new String[] {"op", "operand"}; public String[] get_fields() { return fields; } Modified: branches/astwrite/src/org/python/antlr/ast/While.java ===================================================... [truncated message content] |