Package org.apache.xalan.xsltc.compiler.util

Examples of org.apache.xalan.xsltc.compiler.util.NamedMethodGenerator


              ClassGenerator classGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = new InstructionList();
  String methodName = Util.escape(template.getName().toString());

  final NamedMethodGenerator methodGen =
      new NamedMethodGenerator(ACC_PUBLIC,
             org.apache.bcel.generic.Type.VOID,
             new org.apache.bcel.generic.Type[] {
           Util.getJCRefType(DOM_INTF_SIG),
           Util.getJCRefType(NODE_ITERATOR_SIG),
           Util.getJCRefType(TRANSLET_OUTPUT_SIG),
           org.apache.bcel.generic.Type.INT
             },
             new String[] {
           DOCUMENT_PNAME,
           ITERATOR_PNAME,
           TRANSLET_OUTPUT_PNAME,
           NODE_PNAME
             },
             methodName,
             getClassName(),
             il, cpg);
 
  il.append(template.compile(classGen, methodGen));
  il.append(RETURN);
 
  methodGen.stripAttributes(true);
  methodGen.setMaxLocals();
  methodGen.setMaxStack();
  methodGen.removeNOPs();
  classGen.addMethod(methodGen.getMethod());
    }
View Full Code Here


  _compiled = true;
   
  // %OPT% Special handling for simple named templates.
  if (_isSimpleNamedTemplate && methodGen instanceof NamedMethodGenerator) {
      int numParams = _parameters.size();
      NamedMethodGenerator namedMethodGen = (NamedMethodGenerator)methodGen;
           
            // Update load/store instructions to access Params from the stack
      for (int i = 0; i < numParams; i++) {
        Param param = (Param)_parameters.elementAt(i);
        param.setLoadInstruction(namedMethodGen.loadParameter(i));
        param.setStoreInstruction(namedMethodGen.storeParameter(i));
      }
  }
       
        translateContents(classGen, methodGen);
  il.setPositions(true);
View Full Code Here

  _compiled = true;
   
  // %OPT% Special handling for simple named templates.
  if (_isSimpleNamedTemplate && methodGen instanceof NamedMethodGenerator) {
      int numParams = _parameters.size();
      NamedMethodGenerator namedMethodGen = (NamedMethodGenerator)methodGen;
           
            // Update load/store instructions to access Params from the stack
      for (int i = 0; i < numParams; i++) {
        Param param = (Param)_parameters.elementAt(i);
        param.setLoadInstruction(namedMethodGen.loadParameter(i));
        param.setStoreInstruction(namedMethodGen.storeParameter(i));
      }
  }
       
        translateContents(classGen, methodGen);
  il.setPositions(true);
View Full Code Here

  for (int i = 4; i < 4 + numParams; i++) {
      types[i] = Util.getJCRefType(OBJECT_SIG);
      names[i] = "param" + String.valueOf(i-4);
  }
 
  NamedMethodGenerator methodGen =
          new NamedMethodGenerator(ACC_PUBLIC,
             org.apache.bcel.generic.Type.VOID,
             types, names, methodName,
             getClassName(), il, cpg);     

  il.append(template.compile(classGen, methodGen));
View Full Code Here

  for (int i = 4; i < 4 + numParams; i++) {
      types[i] = Util.getJCRefType(OBJECT_SIG);
      names[i] = "param" + String.valueOf(i-4);
  }
 
  NamedMethodGenerator methodGen =
          new NamedMethodGenerator(ACC_PUBLIC,
             org.apache.bcel.generic.Type.VOID,
             types, names, methodName,
             getClassName(), il, cpg);     

  il.append(template.compile(classGen, methodGen));
  il.append(RETURN);
 
  methodGen.stripAttributes(true);
  methodGen.setMaxLocals();
  methodGen.setMaxStack();
  methodGen.removeNOPs();
  classGen.addMethod(methodGen.getMethod());
    }
View Full Code Here

  _compiled = true;
   
  // %OPT% Special handling for simple named templates.
  if (_isSimpleNamedTemplate && methodGen instanceof NamedMethodGenerator) {
      int numParams = _parameters.size();
      NamedMethodGenerator namedMethodGen = (NamedMethodGenerator)methodGen;
           
            // Update load/store instructions to access Params from the stack
      for (int i = 0; i < numParams; i++) {
        Param param = (Param)_parameters.elementAt(i);
        param.setLoadInstruction(namedMethodGen.loadParameter(i));
        param.setStoreInstruction(namedMethodGen.storeParameter(i));
      }
  }
       
        translateContents(classGen, methodGen);
  il.setPositions(true);
View Full Code Here

              ClassGenerator classGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = new InstructionList();
  String methodName = Util.escape(template.getName().toString());

  final NamedMethodGenerator methodGen =
      new NamedMethodGenerator(ACC_PUBLIC,
             org.apache.bcel.generic.Type.VOID,
             new org.apache.bcel.generic.Type[] {
           Util.getJCRefType(DOM_INTF_SIG),
           Util.getJCRefType(NODE_ITERATOR_SIG),
           Util.getJCRefType(TRANSLET_OUTPUT_SIG),
           org.apache.bcel.generic.Type.INT
             },
             new String[] {
           DOCUMENT_PNAME,
           ITERATOR_PNAME,
           TRANSLET_OUTPUT_PNAME,
           NODE_PNAME
             },
             methodName,
             getClassName(),
             il, cpg);
 
  il.append(template.compile(classGen, methodGen));
  il.append(RETURN);
 
  methodGen.stripAttributes(true);
  methodGen.setMaxLocals();
  methodGen.setMaxStack();
  methodGen.removeNOPs();
  classGen.addMethod(methodGen.getMethod());
    }
View Full Code Here

  for (int i = 4; i < 4 + numParams; i++) {
      types[i] = Util.getJCRefType(OBJECT_SIG);
      names[i] = "param" + String.valueOf(i-4);
  }
 
  NamedMethodGenerator methodGen =
          new NamedMethodGenerator(ACC_PUBLIC,
             org.apache.bcel.generic.Type.VOID,
             types, names, methodName,
             getClassName(), il, cpg);     

  il.append(template.compile(classGen, methodGen));
  il.append(RETURN);
 
  methodGen.stripAttributes(true);
  methodGen.setMaxLocals();
  methodGen.setMaxStack();
  methodGen.removeNOPs();
  classGen.addMethod(methodGen.getMethod());
    }
View Full Code Here

  if (_compiled) return;
  _compiled = true;
   
  // %OPT% Special handling for simple named templates.
  if (_isSimpleNamedTemplate && methodGen instanceof NamedMethodGenerator) {
      NamedMethodGenerator namedMethodGen = (NamedMethodGenerator)methodGen;
      int numParams = _parameters.size();
      // Update the load instructions of the Params, so that they
      // are loaded from the method parameters.
      for (int i = 0; i < numParams; i++) {
        Param param = (Param)_parameters.elementAt(i);
        param.setLoadInstruction(namedMethodGen.loadParameter(i));
      }
      // Translate all children except the parameters.
      // The parameters are translated in CallTemplates if necessary.
      translateContentsWithoutParams(classGen, methodGen);
  }
View Full Code Here

  _compiled = true;
   
  // %OPT% Special handling for simple named templates.
  if (_isSimpleNamedTemplate && methodGen instanceof NamedMethodGenerator) {
      int numParams = _parameters.size();
      NamedMethodGenerator namedMethodGen = (NamedMethodGenerator)methodGen;
           
            // Update load/store instructions to access Params from the stack
      for (int i = 0; i < numParams; i++) {
        Param param = (Param)_parameters.elementAt(i);
        param.setLoadInstruction(namedMethodGen.loadParameter(i));
        param.setStoreInstruction(namedMethodGen.storeParameter(i));
      }
  }
       
        translateContents(classGen, methodGen);
  il.setPositions(true);
View Full Code Here

TOP

Related Classes of org.apache.xalan.xsltc.compiler.util.NamedMethodGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.