001: /*
002: * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025: /*
026: * COMPONENT_NAME: idl.parser
027: *
028: * ORIGINS: 27
029: *
030: * Licensed Materials - Property of IBM
031: * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999
032: * RMI-IIOP v1.0
033: *
034: * @(#)IncludeEntry.java 1.20 07/05/05
035: */
036:
037: package com.sun.tools.corba.se.idl;
038:
039: // NOTES:
040:
041: import java.io.PrintWriter;
042: import java.util.Hashtable;
043: import java.util.Vector;
044:
045: /**
046: * This is the symbol table entry for the #include statement.
047: **/
048: public class IncludeEntry extends SymtabEntry {
049: protected IncludeEntry() {
050: super ();
051: repositoryID(Util.emptyID);
052: } // ctor
053:
054: protected IncludeEntry(SymtabEntry that) {
055: super (that, new IDLID());
056: module(that.name());
057: name("");
058: } // ctor
059:
060: protected IncludeEntry(IncludeEntry that) {
061: super (that);
062: } // ctor
063:
064: public Object clone() {
065: return new IncludeEntry(this );
066: } // clone
067:
068: /** Invoke the Include type generator.
069: @param symbolTable the symbol table is a hash table whose key is
070: a fully qualified type name and whose value is a SymtabEntry or
071: a subclass of SymtabEntry.
072: @param stream the stream to which the generator should sent its output.
073: @see SymtabEntry */
074: public void generate(Hashtable symbolTable, PrintWriter stream) {
075: includeGen.generate(symbolTable, this , stream);
076: } // generate
077:
078: /** Access the Include type generator.
079: @returns an object which implements the IncludeGen interface.
080: @see IncludeGen */
081: public Generator generator() {
082: return includeGen;
083: } // generator
084:
085: //d44810
086: /** Set the fully-qualified file specification of this include file. */
087: public void absFilename(String afn) {
088: _absFilename = afn;
089: }
090:
091: //d44810
092: /** Access the fully-qualified file specification of this include.
093: @returns a string containing the path of the include file. */
094: public String absFilename() {
095: return _absFilename;
096: }
097:
098: /** Add an IncludeEntry to the list of files which this included
099: file includes. */
100: public void addInclude(IncludeEntry entry) {
101: includeList.addElement(entry);
102: } // addInclude
103:
104: /** Get the list of files which this file includes. */
105: public Vector includes() {
106: return includeList;
107: } // includes
108:
109: static IncludeGen includeGen;
110: /** List of files this file includes */
111: private Vector includeList = new Vector();
112: //d44810
113: /** Absolute file name for .u file generation. */
114: private String _absFilename = null;
115: } // class IncludeEntry
|