1 16 19 20 package com.sun.org.apache.xalan.internal.xsltc.compiler; 21 22 import java.util.Vector ; 23 24 import com.sun.org.apache.bcel.internal.generic.InstructionList; 25 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator; 26 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; 27 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator; 28 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type; 29 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError; 30 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util; 31 32 class TopLevelElement extends SyntaxTreeNode { 33 34 38 protected Vector _dependencies = null; 39 40 43 public Type typeCheck(SymbolTable stable) throws TypeCheckError { 44 return typeCheckContents(stable); 45 } 46 47 50 public void translate(ClassGenerator classGen, MethodGenerator methodGen) { 51 ErrorMsg msg = new ErrorMsg(ErrorMsg.NOT_IMPLEMENTED_ERR, 52 getClass(), this); 53 getParser().reportError(FATAL, msg); 54 } 55 56 60 public InstructionList compile(ClassGenerator classGen, 61 MethodGenerator methodGen) { 62 final InstructionList result, save = methodGen.getInstructionList(); 63 methodGen.setInstructionList(result = new InstructionList()); 64 translate(classGen, methodGen); 65 methodGen.setInstructionList(save); 66 return result; 67 } 68 69 public void display(int indent) { 70 indent(indent); 71 Util.println("TopLevelElement"); 72 displayContents(indent + IndentIncrement); 73 } 74 75 79 public void addDependency(TopLevelElement other) { 80 if (_dependencies == null) { 81 _dependencies = new Vector (); 82 } 83 if (!_dependencies.contains(other)) { 84 _dependencies.addElement(other); 85 } 86 } 87 88 92 public Vector getDependencies() { 93 return _dependencies; 94 } 95 } 96 | Popular Tags |