286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2001-2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A/*
286N/A * $Id: NotCall.java,v 1.2.4.1 2005/09/02 10:32:18 pvedula Exp $
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xalan.internal.xsltc.compiler;
286N/A
286N/Aimport java.util.Vector;
286N/A
286N/Aimport com.sun.org.apache.bcel.internal.generic.BranchHandle;
286N/Aimport com.sun.org.apache.bcel.internal.generic.GOTO;
286N/Aimport com.sun.org.apache.bcel.internal.generic.InstructionList;
286N/Aimport com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
286N/Aimport com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
286N/A
286N/A/**
286N/A * @author Jacek Ambroziak
286N/A * @author Santiago Pericas-Geertsen
286N/A */
286N/Afinal class NotCall extends FunctionCall {
286N/A public NotCall(QName fname, Vector arguments) {
286N/A super(fname, arguments);
286N/A }
286N/A
286N/A public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
286N/A final InstructionList il = methodGen.getInstructionList();
286N/A argument().translate(classGen, methodGen);
286N/A il.append(ICONST_1);
286N/A il.append(IXOR);
286N/A }
286N/A
286N/A public void translateDesynthesized(ClassGenerator classGen,
286N/A MethodGenerator methodGen) {
286N/A final InstructionList il = methodGen.getInstructionList();
286N/A final Expression exp = argument();
286N/A exp.translateDesynthesized(classGen, methodGen);
286N/A final BranchHandle gotoh = il.append(new GOTO(null));
286N/A _trueList = exp._falseList; // swap flow lists
286N/A _falseList = exp._trueList;
286N/A _falseList.add(gotoh);
286N/A }
286N/A}