From: <otm...@us...> - 2008-03-20 00:20:30
|
Revision: 4234 http://jython.svn.sourceforge.net/jython/?rev=4234&view=rev Author: otmarhumbel Date: 2008-03-19 17:20:27 -0700 (Wed, 19 Mar 2008) Log Message: ----------- removal of @Override for interface implementing methods (only legal in java 6) Modified Paths: -------------- trunk/sandbox/pyasm/compiler/org/python/bytecode/BytecodeInfo.java trunk/sandbox/pyasm/compiler/org/python/bytecode/BytecodeInstruction.java trunk/sandbox/pyasm/compiler/org/python/bytecode/LineNumberBuilder.java trunk/sandbox/pyasm/compiler/org/python/bytecode/ReferenceResolver.java trunk/sandbox/pyasm/compiler/org/python/newcompiler/AbstractEnvironment.java trunk/sandbox/pyasm/compiler/org/python/newcompiler/ClassEnvironment.java trunk/sandbox/pyasm/compiler/org/python/newcompiler/FunctionEnvironment.java trunk/sandbox/pyasm/compiler/org/python/newcompiler/GlobalEnvironment.java trunk/sandbox/pyasm/compiler/org/python/newcompiler/YieldPoint.java trunk/sandbox/pyasm/compiler/org/python/newcompiler/ast/AstToBytecode.java trunk/sandbox/pyasm/compiler/org/python/newcompiler/ast/ContextBuilder.java Modified: trunk/sandbox/pyasm/compiler/org/python/bytecode/BytecodeInfo.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/bytecode/BytecodeInfo.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/bytecode/BytecodeInfo.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -33,27 +33,22 @@ this.flags = CompilerFlag.parseFlags(flags); } - @Override public int getArgumentCount() { return argcount; } - @Override public String getFilename() { return filename; } - @Override public int getLocalsCount() { return nlocals; } - @Override public int getMaxStackSize() { return stacksize; } - @Override public String getName() { return name; } Modified: trunk/sandbox/pyasm/compiler/org/python/bytecode/BytecodeInstruction.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/bytecode/BytecodeInstruction.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/bytecode/BytecodeInstruction.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -967,7 +967,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitUnpackSequence(argument, false, 0); } @@ -998,7 +997,6 @@ final int before = argument % (1 << 8); visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitUnpackSequence(before, true, after); } @@ -1076,7 +1074,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitDup(argument); } @@ -1120,7 +1117,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitBuildTuple(argument); } @@ -1139,7 +1135,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitBuildList(argument); } @@ -1157,7 +1152,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitBuildMap(argument); } @@ -1173,7 +1167,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitBuildSet(argument); } @@ -1215,7 +1208,6 @@ final ComparisonOperator operator = ComparisonOperator.values()[argument]; visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitCompareOperator(operator); } @@ -1454,7 +1446,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitRaise(argument); } @@ -1476,7 +1467,6 @@ final int numKey = argument % (1 << 8); visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitCall(false, false, numPos, numKey); } @@ -1495,7 +1485,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitBuildFunction(false, argument); } @@ -1513,7 +1502,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitBuildSlice(argument); } @@ -1534,7 +1522,6 @@ protected void acceptRaw(RawBytecodeVisitor visitor, final int argument) { visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitBuildFunction(true, argument); } @@ -1596,7 +1583,6 @@ final int numKey = argument % (1 << 8); visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitCall(true, false, numPos, numKey); } @@ -1618,7 +1604,6 @@ final int numKey = argument % (1 << 8); visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitCall(false, true, numPos, numKey); } @@ -1640,7 +1625,6 @@ final int numKey = argument % (1 << 8); visitor.visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitCall(true, true, numPos, numKey); } @@ -1704,12 +1688,10 @@ throw new RuntimeException("Unimplemented OpCode: " + this + " (arg=" + argument + ")"); } - @Override public void acceptRaw(RawBytecodeVisitor visitor) { visitor.visitInstruction(this); } - @Override public void accept(BytecodeVisitor visitor) { throw new RuntimeException("Unimplemented OpCode: " + this + " (without argument)"); } Modified: trunk/sandbox/pyasm/compiler/org/python/bytecode/LineNumberBuilder.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/bytecode/LineNumberBuilder.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/bytecode/LineNumberBuilder.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -20,7 +20,6 @@ } } - @Override public void visitInstruction(BytecodeVisitor visitor, int offset) { Integer lineNumber = table.get(offset); if(lineNumber != null) { Modified: trunk/sandbox/pyasm/compiler/org/python/bytecode/ReferenceResolver.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/bytecode/ReferenceResolver.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/bytecode/ReferenceResolver.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -68,7 +68,6 @@ this.kind = JumpKind.REGULAR_JUMP; } - @Override public void accept(BytecodeVisitor visitor) { kind.jump(visitor, label); } @@ -97,12 +96,10 @@ } } - @Override public boolean hasData() { return reader.hasData(); } - @Override public char read() { pos++; return reader.read(); @@ -192,219 +189,182 @@ } } - @Override public void visitInstruction(Instruction instr) { instructions.put(pos, instr); } - @Override public void visitStop(Instruction stop) { visitInstruction(stop); reader = null; store = null; } - @Override public void visitYield() { YieldPoint yield = new YieldPoint(new Label(), ++resumePoint); resumeTable.add(yield); visitInstruction(yield); } - @Override public void visitAbsouteJump(int addr) { visitInstruction(new JumpInstruction(label(addr))); } - @Override public void visitJumpIfFalse(int delta) { visitInstruction(new JumpInstruction(relative(delta), false)); } - @Override public void visitJumpIfTrue(int delta) { visitInstruction(new JumpInstruction(relative(delta), true)); } - @Override public void visitRelativeJump(int delta) { visitInstruction(new JumpInstruction(relative(delta))); } - @Override public void visitContinue(int addr) { final Label label = label(addr); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitContinue(label); } }); } - @Override public void visitDelete(final VariableContext context, int nameIndex) { final String name = lookup(context, nameIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitDelete(context, name); } }); } - @Override public void visitDeleteAttribute(int nameIndex) { final String name = lookupName(nameIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitDeleteAttribute(name); } }); } - @Override public void visitForIteration(int delta) { final Label label = relative(delta); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitForIteration(label); } }); } - @Override public void visitImportFrom(int nameIndex) { final String name = lookupName(nameIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitImportFrom(name); } }); } - @Override public void visitImportName(int nameIndex) { final String name = lookupName(nameIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitImportName(name); } }); } - @Override public void visitLoad(final VariableContext context, int nameIndex) { final String name = lookup(context, nameIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitLoad(context, name); } }); } - @Override public void visitLoadAttribute(int nameIndex) { final String name = lookupName(nameIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitLoadAttribute(name); } }); } - @Override public void visitLoadClosure(int nameIndex) { final String name = lookup(VariableContext.CLOSURE, nameIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitLoadClosure(name); } }); } - @Override public void visitLoadConstant(int constIndex) { final PyObject constant = lookupConstant(constIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitLoadConstant(constant); } }); } - @Override public void visitSetupExcept(int delta) { final Label label = relative(delta); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitSetupExcept(label); } }); } - @Override public void visitSetupFinally(int delta) { final Label label = relative(delta); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitSetupFinally(label); } }); } - @Override public void visitSetupLoop(int delta) { final Label label = relative(delta); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitSetupLoop(label); } }); } - @Override public void visitStore(final VariableContext context, int nameIndex) { final String name = lookup(context, nameIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitStore(context, name); } }); } - @Override public void visitStoreAttribute(int nameIndex) { final String name = lookupName(nameIndex); visitInstruction(new Instruction() { - @Override public void accept(BytecodeVisitor visitor) { visitor.visitStoreAttribute(name); } Modified: trunk/sandbox/pyasm/compiler/org/python/newcompiler/AbstractEnvironment.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/newcompiler/AbstractEnvironment.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/newcompiler/AbstractEnvironment.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -56,46 +56,38 @@ } } - @Override public void markHasExec() { flags.add(CompilerFlag.HAVE_EXEC); } - @Override public GlobalEnvironment getGlobalEnvironment() { return parent.getGlobalEnvironment(); } - @Override public void addAssignment(String name) { if (!(globals.contains(name) || nonlocals.contains(name))) { locals.add(name); } } - @Override public void addReference(String name) { if (!(globals.contains(name) || enclosing.contains(name))) { locals.add(name); } } - @Override public void addEntryPoint(Label entry) { error(EnvironmentError.ILLEGAL_GENERATOR); } - @Override public boolean isReenterable() { return false; } - @Override public Iterable<Label> getEntryPoints() { throw new NotImplementedException(); } - @Override public void markAsGlobal(String name) { if (nonlocals.contains(name)) { error(EnvironmentError.BOTH_NONLOCAL_AND_GLOBAL); @@ -107,7 +99,6 @@ } } - @Override public void markAsNonlocal(String name) { if (globals.contains(name)) { error(EnvironmentError.BOTH_NONLOCAL_AND_GLOBAL); @@ -118,7 +109,6 @@ } } - @Override public void addFuture(String feature) throws Exception { error(EnvironmentError.FUTURE_OUT_OF_CONTEXT); } @@ -133,19 +123,16 @@ } // EnvironmentInfo - @Override public VariableContext getVariableContextFor(String id) { // TODO Auto-generated method stub return null; } - @Override public Iterable<String> closureVariables() { // TODO Auto-generated method stub return null; } - @Override public Set<CompilerFlag> getCompilerFlags() { return Collections.unmodifiableSet(flags); } Modified: trunk/sandbox/pyasm/compiler/org/python/newcompiler/ClassEnvironment.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/newcompiler/ClassEnvironment.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/newcompiler/ClassEnvironment.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -8,7 +8,6 @@ super(parent); } - @Override public void addParameter(String name) { error(EnvironmentError.CANNOT_HAVE_PARAMETERS); } Modified: trunk/sandbox/pyasm/compiler/org/python/newcompiler/FunctionEnvironment.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/newcompiler/FunctionEnvironment.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/newcompiler/FunctionEnvironment.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -35,7 +35,6 @@ parameters.add(name); } - @Override public void addParameter(String name) { if (parameters.add(name)) { locals.add(name); Modified: trunk/sandbox/pyasm/compiler/org/python/newcompiler/GlobalEnvironment.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/newcompiler/GlobalEnvironment.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/newcompiler/GlobalEnvironment.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -15,7 +15,6 @@ return this; } - @Override public void addParameter(String name) { error(EnvironmentError.CANNOT_HAVE_PARAMETERS); } Modified: trunk/sandbox/pyasm/compiler/org/python/newcompiler/YieldPoint.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/newcompiler/YieldPoint.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/newcompiler/YieldPoint.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -15,7 +15,6 @@ this.index = index; } - @Override public void accept(BytecodeVisitor visitor) { visitor.visitYield(index, label); } Modified: trunk/sandbox/pyasm/compiler/org/python/newcompiler/ast/AstToBytecode.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/newcompiler/ast/AstToBytecode.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/newcompiler/ast/AstToBytecode.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -152,7 +152,6 @@ private static final CompileAction printResult = new CompileAction() { - @Override public boolean perform(BytecodeVisitor compiler) { compiler.visitPrintExpression(); return false; @@ -161,7 +160,6 @@ private static final CompileAction popResult = new CompileAction() { - @Override public boolean perform(BytecodeVisitor compiler) { compiler.visitPop(); return false; @@ -170,7 +168,6 @@ private static final CompileAction returnResult = new CompileAction() { - @Override public boolean perform(BytecodeVisitor compiler) { compiler.visitReturn(); return true; @@ -179,7 +176,6 @@ private static final CompileAction returnNone = new CompileAction() { - @Override public boolean perform(BytecodeVisitor compiler) { compiler.visitLoadConstant(Py.None); compiler.visitReturn(); @@ -189,7 +185,6 @@ private static final ConditionalAction jumpIfTrue = new ConditionalAction() { - @Override public void perform(BytecodeVisitor compiler, Label dest) { compiler.visitJumpIfTrue(dest); } @@ -197,7 +192,6 @@ private static final ConditionalAction jumpIfFalse = new ConditionalAction() { - @Override public void perform(BytecodeVisitor compiler, Label dest) { compiler.visitJumpIfTrue(dest); } @@ -239,7 +233,6 @@ } // Top level items - @Override public BytecodeBundle visitModule(Module node) throws Exception { buildContext(node); EnvironmentInfo oldEnvironment = currentEnvironment; @@ -259,7 +252,6 @@ return bundle; } - @Override public BytecodeBundle visitExpression(Expression node) throws Exception { buildContext(node); EnvironmentInfo oldEnvironment = currentEnvironment; @@ -277,7 +269,6 @@ return bundle; } - @Override public BytecodeBundle visitInteractive(Interactive node) throws Exception { buildContext(node); EnvironmentInfo oldEnvironment = currentEnvironment; @@ -297,14 +288,12 @@ return bundle; } - @Override public BytecodeBundle visitSuite(Suite node) throws Exception { throw new RuntimeException("Hit a Suite element, what is this for?"); // return bundle; } // Scoping items - @Override public BytecodeBundle visitClassDef(ClassDef node) throws Exception { CompileAction old_action = expr_action; expr_action = popResult; @@ -349,7 +338,6 @@ return bundle; } - @Override public BytecodeBundle visitFunctionDef(FunctionDef node) throws Exception { CompileAction old_action = expr_action; expr_action = popResult; @@ -405,7 +393,6 @@ return bundle; } - @Override public BytecodeBundle visitLambda(Lambda node) throws Exception { CompileAction old_action = expr_action; expr_action = popResult; @@ -443,7 +430,6 @@ return bundle; } - @Override public BytecodeBundle visitGeneratorExp(GeneratorExp node) throws Exception { // FIXME: the semantics of this is quite hard, it is broken at the moment CompileAction old_action = expr_action; @@ -506,7 +492,6 @@ } // Receives special treatment depending on context - @Override public BytecodeBundle visitExpr(Expr node) throws Exception { node.value.accept(this); lastStatementWasReturn = expr_action.perform(compiler); @@ -514,7 +499,6 @@ } // The rest of the stuff :) - @Override public BytecodeBundle visitAssert(Assert node) throws Exception { Label ok = new Label(); node.test.accept(this); @@ -533,7 +517,6 @@ return bundle; } - @Override public BytecodeBundle visitAssign(Assign node) throws Exception { node.value.accept(this); int lastPos = node.targets.length - 1; @@ -547,7 +530,6 @@ return bundle; } - @Override public BytecodeBundle visitAttribute(Attribute node) throws Exception { node.value.accept(this); switch(node.ctx){ @@ -572,7 +554,6 @@ return bundle; } - @Override public BytecodeBundle visitAugAssign(AugAssign node) throws Exception { if (node.target instanceof Attribute) { Attribute attrib = (Attribute)node.target; @@ -605,7 +586,6 @@ return bundle; } - @Override public BytecodeBundle visitBinOp(BinOp node) throws Exception { node.left.accept(this); node.right.accept(this); @@ -613,7 +593,6 @@ return bundle; } - @Override public BytecodeBundle visitBoolOp(BoolOp node) throws Exception { ConditionalAction jump; switch(node.op){ @@ -638,14 +617,12 @@ return bundle; } - @Override public BytecodeBundle visitBreak(Break node) throws Exception { compiler.visitBreak(); lastStatementWasReturn = false; return bundle; } - @Override public BytecodeBundle visitCall(Call node) throws Exception { node.func.accept(this); int argCount = 0, kwCount = 0; @@ -671,7 +648,6 @@ return bundle; } - @Override public BytecodeBundle visitCompare(Compare node) throws Exception { if (node.comparators.length != node.ops.length) { // TODO: error! @@ -703,13 +679,11 @@ return bundle; } - @Override public BytecodeBundle visitContinue(Continue node) throws Exception { compiler.visitContinue(nearestLoop); return bundle; } - @Override public BytecodeBundle visitDelete(Delete node) throws Exception { for (exprType target : node.targets) { target.accept(this); @@ -718,7 +692,6 @@ return bundle; } - @Override public BytecodeBundle visitDict(Dict node) throws Exception { compiler.visitBuildMap(0); if (node.keys != null || node.values != null) { @@ -736,13 +709,11 @@ return bundle; } - @Override public BytecodeBundle visitEllipsis(Ellipsis node) throws Exception { compiler.visitLoadConstant(Py.Ellipsis); return bundle; } - @Override public BytecodeBundle visitExec(Exec node) throws Exception { node.body.accept(this); if (node.globals != null) { @@ -760,7 +731,6 @@ return bundle; } - @Override public BytecodeBundle visitExtSlice(ExtSlice node) throws Exception { for (sliceType slice : node.dims) { slice.accept(this); @@ -769,26 +739,22 @@ return bundle; } - @Override public BytecodeBundle visitFor(For node) throws Exception { // TODO Auto-generated method stub lastStatementWasReturn = false; return bundle; } - @Override public BytecodeBundle visitListComp(ListComp node) throws Exception { // TODO Auto-generated method stub return bundle; } - @Override public BytecodeBundle visitGlobal(Global node) throws Exception { // This is a pragma, handled by the pre-parser. return bundle; } - @Override public BytecodeBundle visitIf(If node) throws Exception { ConditionalAction jump; exprType test; @@ -820,7 +786,6 @@ return bundle; } - @Override public BytecodeBundle visitIfExp(IfExp node) throws Exception { node.test.accept(this); Label orelse = new Label(); @@ -836,27 +801,23 @@ return bundle; } - @Override public BytecodeBundle visitImport(Import node) throws Exception { // TODO Auto-generated method stub lastStatementWasReturn = false; return bundle; } - @Override public BytecodeBundle visitImportFrom(ImportFrom node) throws Exception { // TODO Auto-generated method stub lastStatementWasReturn = false; return bundle; } - @Override public BytecodeBundle visitIndex(Index node) throws Exception { node.value.accept(this); return bundle; } - @Override public BytecodeBundle visitList(List node) throws Exception { for (exprType value : node.elts) { value.accept(this); @@ -865,13 +826,11 @@ return bundle; } - @Override public BytecodeBundle visitName(Name node) throws Exception { compiler.visitLoad(currentEnvironment.getVariableContextFor(node.id), node.id); return bundle; } - @Override public BytecodeBundle visitNum(Num node) throws Exception { PyObject num; if (node.n instanceof PyObject) { @@ -889,13 +848,11 @@ return bundle; } - @Override public BytecodeBundle visitPass(Pass node) throws Exception { lastStatementWasReturn = false; return bundle; } - @Override public BytecodeBundle visitPrint(Print node) throws Exception { if (node.dest != null) { node.dest.accept(this); @@ -931,7 +888,6 @@ return bundle; } - @Override public BytecodeBundle visitRaise(Raise node) throws Exception { int numArgs = 0; if (node.type != null) { @@ -951,14 +907,12 @@ return bundle; } - @Override public BytecodeBundle visitRepr(Repr node) throws Exception { node.value.accept(this); compiler.visitUnaryOperator(UnaryOperator.CONVERT); return bundle; } - @Override public BytecodeBundle visitReturn(Return node) throws Exception { if (node.value != null) { node.value.accept(this); @@ -970,7 +924,6 @@ return bundle; } - @Override public BytecodeBundle visitSlice(Slice node) throws Exception { if (node.lower != null) { node.lower.accept(this); @@ -991,13 +944,11 @@ return bundle; } - @Override public BytecodeBundle visitStr(Str node) throws Exception { compiler.visitLoadConstant(new PyString(node.s)); return bundle; } - @Override public BytecodeBundle visitSubscript(Subscript node) throws Exception { node.value.accept(this); if (node.slice instanceof Slice) { @@ -1044,7 +995,6 @@ return bundle; } - @Override public BytecodeBundle visitTryExcept(TryExcept node) throws Exception { Label handle = new Label(); Label after = new Label(); @@ -1107,7 +1057,6 @@ return bundle; } - @Override public BytecodeBundle visitTryFinally(TryFinally node) throws Exception { Label handle = new Label(); compiler.visitSetupFinally(handle); @@ -1125,7 +1074,6 @@ return bundle; } - @Override public BytecodeBundle visitTuple(Tuple node) throws Exception { // NOTE: opportunity for constant folding for (exprType expr : node.elts) { @@ -1135,20 +1083,17 @@ return bundle; } - @Override public BytecodeBundle visitUnaryOp(UnaryOp node) throws Exception { node.operand.accept(this); compiler.visitUnaryOperator(unaryOperator(node.op)); return bundle; } - @Override public BytecodeBundle visitUnicode(Unicode node) throws Exception { compiler.visitLoadConstant(new PyUnicode(node.s)); return bundle; } - @Override public BytecodeBundle visitWhile(While node) throws Exception { Label start = new Label(); Label end = new Label(); @@ -1175,7 +1120,6 @@ return bundle; } - @Override public BytecodeBundle visitWith(With node) throws Exception { node.context_expr.accept(this); CompilerVariable exitTicket = compiler.storeContextManagerExit(); @@ -1198,7 +1142,6 @@ return bundle; } - @Override public BytecodeBundle visitYield(Yield node) throws Exception { if (node.value != null) { node.value.accept(this); Modified: trunk/sandbox/pyasm/compiler/org/python/newcompiler/ast/ContextBuilder.java =================================================================== --- trunk/sandbox/pyasm/compiler/org/python/newcompiler/ast/ContextBuilder.java 2008-03-20 00:07:50 UTC (rev 4233) +++ trunk/sandbox/pyasm/compiler/org/python/newcompiler/ast/ContextBuilder.java 2008-03-20 00:20:27 UTC (rev 4234) @@ -49,12 +49,10 @@ private int resumePoint = 0; - @Override public EnvironmentInfo getEnvironment(PythonTree tree) { return environmentMap.get(tree); } - @Override public YieldPoint getYieldPoint(exprType node) { return resumeTable.get(node); } @@ -65,7 +63,6 @@ resumeTable.put(node, new YieldPoint(label, resumePoint++)); } - @Override public EnvironmentHolder visitClassDef(ClassDef node) throws Exception { // Class name currentEnvironment.addAssignment(node.name); @@ -90,7 +87,6 @@ return unhandled_node(node); } - @Override public EnvironmentHolder visitFunctionDef(FunctionDef node) throws Exception { // Function name currentEnvironment.addAssignment(node.name); @@ -136,7 +132,6 @@ return unhandled_node(node); } - @Override public EnvironmentHolder visitLambda(Lambda node) throws Exception { // Argument defaults if (node.args != null && node.args.defaults != null) { @@ -172,7 +167,6 @@ return unhandled_node(node); } - @Override public EnvironmentHolder visitGeneratorExp(GeneratorExp node) throws Exception { for (comprehensionType comp : node.generators) { comp.iter.accept(this); @@ -199,13 +193,11 @@ return unhandled_node(node); } - @Override public EnvironmentHolder visitExec(Exec node) throws Exception { currentEnvironment.markHasExec(); return super.visitExec(node); } - @Override public EnvironmentHolder visitGlobal(Global node) throws Exception { for (String name : node.names) { currentEnvironment.markAsGlobal(name); @@ -213,7 +205,6 @@ return unhandled_node(node); } - @Override public EnvironmentHolder visitName(Name node) throws Exception { switch(node.ctx){ case AugLoad: @@ -241,7 +232,6 @@ return unhandled_node(node); } - @Override public EnvironmentHolder visitImport(Import node) throws Exception { for (aliasType alias : node.names) { String[] names = alias.name.split("."); @@ -251,7 +241,6 @@ return unhandled_node(node); } - @Override public EnvironmentHolder visitImportFrom(ImportFrom node) throws Exception { if (node.module.equals(Future.signature)) { if (node.names != null && node.names.length != 0) { @@ -273,34 +262,29 @@ return unhandled_node(node); } - @Override public EnvironmentHolder visitYield(Yield node) throws Exception { addYieldPoint(node); return super.visitYield(node); } - @Override public EnvironmentHolder visitInteractive(Interactive node) throws Exception { assertTopLevel("Interactive"); environmentMap.put(node, (EnvironmentInfo)currentEnvironment); return super.visitInteractive(node); } - @Override public EnvironmentHolder visitModule(Module node) throws Exception { assertTopLevel("Module"); environmentMap.put(node, (EnvironmentInfo)currentEnvironment); return super.visitModule(node); } - @Override public EnvironmentHolder visitExpression(Expression node) throws Exception { assertTopLevel("Expression"); environmentMap.put(node, (EnvironmentInfo)currentEnvironment); return super.visitExpression(node); } - @Override public EnvironmentHolder visitSuite(Suite node) throws Exception { assertTopLevel("Suite"); environmentMap.put(node, (EnvironmentInfo)currentEnvironment); @@ -314,12 +298,10 @@ } // Generic ones - @Override public void traverse(PythonTree node) throws Exception { node.traverse(this); } - @Override protected EnvironmentHolder unhandled_node(PythonTree node) throws Exception { return this; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |