From: <fwi...@us...> - 2008-11-10 21:12:33
|
Revision: 5569 http://jython.svn.sourceforge.net/jython/?rev=5569&view=rev Author: fwierzbicki Date: 2008-11-10 21:12:29 +0000 (Mon, 10 Nov 2008) Log Message: ----------- Make lineno and col_offset writable. Modified Paths: -------------- trunk/jython/ast/asdl_antlr.py trunk/jython/src/org/python/antlr/ast/Assert.java trunk/jython/src/org/python/antlr/ast/Assign.java trunk/jython/src/org/python/antlr/ast/Attribute.java trunk/jython/src/org/python/antlr/ast/AugAssign.java trunk/jython/src/org/python/antlr/ast/BinOp.java trunk/jython/src/org/python/antlr/ast/BoolOp.java trunk/jython/src/org/python/antlr/ast/Break.java trunk/jython/src/org/python/antlr/ast/Call.java trunk/jython/src/org/python/antlr/ast/ClassDef.java trunk/jython/src/org/python/antlr/ast/Compare.java trunk/jython/src/org/python/antlr/ast/Continue.java trunk/jython/src/org/python/antlr/ast/Delete.java trunk/jython/src/org/python/antlr/ast/Dict.java trunk/jython/src/org/python/antlr/ast/Exec.java trunk/jython/src/org/python/antlr/ast/Expr.java trunk/jython/src/org/python/antlr/ast/For.java trunk/jython/src/org/python/antlr/ast/FunctionDef.java trunk/jython/src/org/python/antlr/ast/GeneratorExp.java trunk/jython/src/org/python/antlr/ast/Global.java trunk/jython/src/org/python/antlr/ast/If.java trunk/jython/src/org/python/antlr/ast/IfExp.java trunk/jython/src/org/python/antlr/ast/Import.java trunk/jython/src/org/python/antlr/ast/ImportFrom.java trunk/jython/src/org/python/antlr/ast/Lambda.java trunk/jython/src/org/python/antlr/ast/List.java trunk/jython/src/org/python/antlr/ast/ListComp.java trunk/jython/src/org/python/antlr/ast/Name.java trunk/jython/src/org/python/antlr/ast/Num.java trunk/jython/src/org/python/antlr/ast/Pass.java trunk/jython/src/org/python/antlr/ast/Print.java trunk/jython/src/org/python/antlr/ast/Raise.java trunk/jython/src/org/python/antlr/ast/Repr.java trunk/jython/src/org/python/antlr/ast/Return.java trunk/jython/src/org/python/antlr/ast/Str.java trunk/jython/src/org/python/antlr/ast/Subscript.java trunk/jython/src/org/python/antlr/ast/TryExcept.java trunk/jython/src/org/python/antlr/ast/TryFinally.java trunk/jython/src/org/python/antlr/ast/Tuple.java trunk/jython/src/org/python/antlr/ast/UnaryOp.java trunk/jython/src/org/python/antlr/ast/While.java trunk/jython/src/org/python/antlr/ast/With.java trunk/jython/src/org/python/antlr/ast/Yield.java Modified: trunk/jython/ast/asdl_antlr.py =================================================================== --- trunk/jython/ast/asdl_antlr.py 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/ast/asdl_antlr.py 2008-11-10 21:12:29 UTC (rev 5569) @@ -258,16 +258,32 @@ if str(name) in ('stmt', 'expr'): # The lineno property + self.emit("private int lineno = -1;", depth + 1) self.emit("public int getLineno() {", depth + 1) + self.emit("if (lineno != -1) {", depth + 2); + self.emit("return lineno;", depth + 3); + self.emit("}", depth + 2) self.emit('return getLine();', depth + 2) self.emit("}", depth + 1) self.emit("", 0) + self.emit("public void setLineno(int num) {", depth + 1) + self.emit("lineno = num;", depth + 2); + self.emit("}", depth + 1) + self.emit("", 0) # The col_offset property + self.emit("private int col_offset = -1;", depth + 1) self.emit("public int getCol_offset() {", depth + 1) + self.emit("if (col_offset != -1) {", depth + 2); + self.emit("return col_offset;", depth + 3); + self.emit("}", depth + 2) self.emit('return getCharPositionInLine();', depth + 2) self.emit("}", depth + 1) self.emit("", 0) + self.emit("public void setCol_offset(int num) {", depth + 1) + self.emit("col_offset = num;", depth + 2); + self.emit("}", depth + 1) + self.emit("", 0) self.emit("}", depth) self.close() Modified: trunk/jython/src/org/python/antlr/ast/Assert.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Assert.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Assert.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -71,12 +71,28 @@ msg.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Assign.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Assign.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Assign.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -91,12 +91,28 @@ value.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Attribute.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Attribute.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Attribute.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -81,12 +81,28 @@ this.ctx = c; } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/AugAssign.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AugAssign.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/AugAssign.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -83,12 +83,28 @@ value.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/BinOp.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BinOp.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/BinOp.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -81,12 +81,28 @@ right.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/BoolOp.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BoolOp.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/BoolOp.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -85,12 +85,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Break.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Break.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Break.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -40,12 +40,28 @@ public void traverse(VisitorIF visitor) throws Exception { } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Call.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Call.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Call.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -159,12 +159,28 @@ kwargs.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/ClassDef.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ClassDef.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/ClassDef.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -158,12 +158,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Compare.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Compare.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Compare.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -107,12 +107,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Continue.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Continue.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Continue.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -40,12 +40,28 @@ public void traverse(VisitorIF visitor) throws Exception { } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Delete.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Delete.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Delete.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -77,12 +77,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Dict.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Dict.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Dict.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -111,12 +111,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Exec.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Exec.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Exec.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -88,12 +88,28 @@ locals.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Expr.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Expr.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Expr.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -57,12 +57,28 @@ value.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/For.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/For.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/For.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -144,12 +144,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/FunctionDef.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/FunctionDef.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/FunctionDef.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -134,12 +134,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/GeneratorExp.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/GeneratorExp.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/GeneratorExp.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -94,12 +94,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Global.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Global.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Global.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -51,12 +51,28 @@ public void traverse(VisitorIF visitor) throws Exception { } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/If.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/If.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/If.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -128,12 +128,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/IfExp.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/IfExp.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/IfExp.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -88,12 +88,28 @@ orelse.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Import.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Import.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Import.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -77,12 +77,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/ImportFrom.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ImportFrom.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/ImportFrom.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -97,12 +97,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Lambda.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Lambda.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Lambda.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -67,12 +67,28 @@ body.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/List.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/List.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/List.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -89,12 +89,28 @@ this.ctx = c; } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/ListComp.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ListComp.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/ListComp.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -93,12 +93,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Name.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Name.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Name.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -63,12 +63,28 @@ this.ctx = c; } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Num.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Num.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Num.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -51,12 +51,28 @@ public void traverse(VisitorIF visitor) throws Exception { } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Pass.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Pass.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Pass.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -40,12 +40,28 @@ public void traverse(VisitorIF visitor) throws Exception { } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Print.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Print.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Print.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -102,12 +102,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Raise.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Raise.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Raise.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -88,12 +88,28 @@ tback.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Repr.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Repr.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Repr.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -57,12 +57,28 @@ value.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Return.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Return.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Return.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -57,12 +57,28 @@ value.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Str.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Str.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Str.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -51,12 +51,28 @@ public void traverse(VisitorIF visitor) throws Exception { } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Subscript.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Subscript.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Subscript.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -83,12 +83,28 @@ this.ctx = c; } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/TryExcept.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/TryExcept.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/TryExcept.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -150,12 +150,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/TryFinally.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/TryFinally.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/TryFinally.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -112,12 +112,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Tuple.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Tuple.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Tuple.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -90,12 +90,28 @@ this.ctx = c; } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/UnaryOp.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/UnaryOp.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/UnaryOp.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -65,12 +65,28 @@ operand.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/While.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/While.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/While.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -129,12 +129,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/With.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/With.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/With.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -111,12 +111,28 @@ } } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } Modified: trunk/jython/src/org/python/antlr/ast/Yield.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/Yield.java 2008-11-10 15:33:23 UTC (rev 5568) +++ trunk/jython/src/org/python/antlr/ast/Yield.java 2008-11-10 21:12:29 UTC (rev 5569) @@ -57,12 +57,28 @@ value.accept(visitor); } + private int lineno = -1; public int getLineno() { + if (lineno != -1) { + return lineno; + } return getLine(); } + public void setLineno(int num) { + lineno = num; + } + + private int col_offset = -1; public int getCol_offset() { + if (col_offset != -1) { + return col_offset; + } return getCharPositionInLine(); } + public void setCol_offset(int num) { + col_offset = num; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |