Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

stilentity.h

Go to the documentation of this file.
00001 /* $Revision: 159 $ */
00002 
00003 /* $Id: stilentity.h 159 2006-12-06 21:41:00Z joel1234567 $ */
00004 
00005 /*******************************************************************************
00006  * Copyright (c) 2006 International Business Machines Corporation
00007  * All rights reserved. This program and the accompanying materials
00008  * are made available under the terms of the Common Public License v1.0
00009  * which accompanies this distribution, and is available at
00010  * http://www.opensource.org/licenses/cpl1.0.php
00011  *
00012  * Contributors:
00013  *    Douglas Sprague, Joel Wheeler - initial API and implementation
00014  *
00015  * Modification Log:
00016  *     $Log: stilentity.h,v $
00017  *     Revision 1.1.1.1  2006/01/10 18:53:39  joel1234567
00018  *     Initial checkin
00019  *
00020  *
00021  *****************************************************************************/
00022 
00023 #ifndef STILEntity_H
00024 #define STILEntity_H
00025 
00026 
00027 #include "stilcom.h"               // Common include
00028 #include "stilcomstr.h"
00029 
00030 
00031 // STILEntity Class
00032 //---------------------------------------------------------------------------
00048 //---------------------------------------------------------------------------
00049 class STILEntity {
00050 
00051 
00052   // - Public members
00053   public:
00054 
00056     enum Type {
00063       UndefinedEntity,
00064 
00066       __SIMPLE__STIL__ENTITIES,
00067 
00068       Alignment,
00069       Ann,
00070       Base,
00071       BreakPoint,       //5
00072       CategoryRef,
00073       DataBitCount,
00074       Date,
00075       DefaultState,
00076       ScanIn,           //10
00077       ScanOut,
00078       Source,
00079       Start,
00080       Goto,
00081       X,                //15
00082       Stop,             //16
00083       IddqTestPoint,
00084       Title,
00085       Termination,
00086       UserKeywords,
00087       UserStatement,    //21
00088       UserBlock,
00089       MacroDefsRef,
00090       PatternBurstRef,
00091       ProceduresRef,
00092       ScanStructuresRef,//26
00093       SelectorRef,
00094       SignalGroupsRef,
00095       TimingRef,
00096       WaveformTableRef,
00097       ScanChainRef,        //31
00098 
00099       TimeUnit,
00100       ResourceTag,
00101 
00103       __COMPLEX__STIL__ENTITIES,
00104 
00105       Main,             //35 for STIL Main Top-level object
00106 
00107       Terminations,     // for STILTerminations objects- SigRef Term's in PatternBursts
00108       Breakpoint,       //37
00109       Call,
00110       Category,
00111       Condition,
00112       Fixed,
00113       Header,           //42
00114       History,
00115       Infinite,
00116       Loop,
00117       Macro,
00118       MacroDefs,        //47
00119       MacroDef,
00120       MatchLoop,
00121       PatList,
00122       Pattern,
00123       PatternBurst,     //52
00124       PatternExec,
00125       Pattern_or_PatternBurst,
00126       Procedures,
00127       Procedure,
00128       Selector,         //57
00129       Shift,
00130       Signals,
00131       Signal,
00132       SignalGroups,
00133       SignalGroup,       //62
00134       ScanStructures,
00135       ScanChain,
00136       Timing,
00137       Variable,
00138       Vector,           //67
00139       VectorItem,
00140       Spec,
00141 
00142       WaveformTable,
00143       SubWaveforms,
00144       SubWaveform,       //72
00145       WaveformEvent,
00146       TimingWaveformRef,
00147       Waveforms,
00148       Waveform,
00149       WaveformItem,     //77
00150       WFCS,
00151       WFCSItem,
00152 
00153       __END__STIL__ENTITIES  //80
00154     };
00155 
00156     // - Default Constructor
00157     STILEntity();
00158 
00159     // - Construct given a Type
00160     STILEntity(Type);
00161 
00162     // - Copy Constructor
00163     STILEntity(const STILEntity &);
00164 
00165     // - Destructor
00166     virtual ~STILEntity();
00167 
00168     // - Assignment Operator
00169     STILEntity & operator=(const STILEntity &);
00170 
00171     // - Equality Operator
00172     bool operator==(const STILEntity &) const;
00173 
00174     // - Less Than Operator
00175     bool operator<(const STILEntity &) const;
00176 
00177     // - Initialize this STILEntity object specifying the type
00178     void        init(Type t);
00179 
00180     // - Write out this object to a given FILE with the specified indentation
00181     virtual void write(FILE * pOutFile, LONG indentation=0) const;
00182 
00183     // - Get/Set the Name attribute
00184     const sstring & getName() const;
00185     void           setName(const sstring &);
00186 
00187     // - Get/Set the Value attribute
00188     const sstring & getValue() const;
00189     void           setValue(const sstring &);
00190 
00191     // - Get/Set the Type attribute
00192     Type           getType() const;
00193     const sstring  getTypeAsString() const;
00194     void           setType(const Type);
00195 
00196     // - Get/Set the Label attribute
00197     const sstring & getLabel() const;
00198     void           setLabel(const sstring &);
00199 
00200     // - Get/Set the FileName attribute
00201     const sstring & getFileName() const;
00202     void           setFileName(const sstring &);
00203 
00204     // - Get/Set the LineNumber attribute
00205     LONG          getLineNumber() const;
00206     void           setLineNumber(LONG);
00207 
00208     // - Get/Set the Referenced attribute (has this entity been referenced)
00209     //bool           getReferenced() const;
00210     //void           setReferenced(bool);
00211 
00212     // - Get/Set the Semantic error flag
00213     bool           getSemanticErrors() const;
00214     void           setSemanticErrors(bool);
00215 
00216     // - Is this entity a simple STIL statement type (I.E. Ann, Termination,...)
00217     bool           isSimple() const;
00218 
00219     // - Get the parsing trace information (filename/line number)
00220     sstring         getParseInfo() const;
00221 
00222   // Protected members (accessable to derived classes)
00223   protected:
00224 
00225     //----------------------- private members --------------------------------
00226 
00227     sstring        m_name;             // Name of this STIL entity
00228     sstring        m_value;            // Value (UserStatements, Annotations,...)
00229     Type           m_type;             // Type of this STIL entity
00230     sstring        m_label;            // Label for this entity (optional)
00231 
00232     sstring        m_filename;         // Name of associated STIL file
00233     LONG           m_linenumber;       // Line number in associated STIL file
00234     bool           m_semanticErrors;  // Does this entity have semantic errors
00235 
00236 
00237 }; // end STILEntity class
00238 
00239 //----------------------------- inline functions -----------------------------
00240 //--------------------------------------------------------------------------
00248 //--------------------------------------------------------------------------
00249 inline const sstring &   STILEntity::getName() const { return m_name; }
00250 
00251 //--------------------------------------------------------------------------
00259 //--------------------------------------------------------------------------
00260 inline void             STILEntity::setName(const sstring &n) { m_name = n; }
00261 
00262 //--------------------------------------------------------------------------
00270 //--------------------------------------------------------------------------
00271 inline const sstring &   STILEntity::getValue() const { return m_value; }
00272 
00273 //--------------------------------------------------------------------------
00281 //--------------------------------------------------------------------------
00282 inline void             STILEntity::setValue(const sstring &v) { m_value = v; }
00283 
00284 //--------------------------------------------------------------------------
00292 //--------------------------------------------------------------------------
00293 inline STILEntity::Type STILEntity::getType() const { return m_type; }
00294 
00295 //--------------------------------------------------------------------------
00303 //--------------------------------------------------------------------------
00304 inline void             STILEntity::setType(const Type t) { m_type = t; }
00305 
00306 //--------------------------------------------------------------------------
00314 //--------------------------------------------------------------------------
00315 inline const sstring &   STILEntity::getLabel() const { return m_label; }
00316 
00317 //--------------------------------------------------------------------------
00325 //--------------------------------------------------------------------------
00326 inline void             STILEntity::setLabel(const sstring &l) { m_label = l; }
00327 
00328 //--------------------------------------------------------------------------
00336 //--------------------------------------------------------------------------
00337 inline const sstring &   STILEntity::getFileName() const { return m_filename; }
00338 
00339 //--------------------------------------------------------------------------
00347 //--------------------------------------------------------------------------
00348 inline void             STILEntity::setFileName(const sstring &f) { m_filename = f; }
00349 
00350 //--------------------------------------------------------------------------
00358 //--------------------------------------------------------------------------
00359 inline LONG            STILEntity::getLineNumber() const { return m_linenumber; }
00360 
00361 //--------------------------------------------------------------------------
00369 //--------------------------------------------------------------------------
00370 inline void             STILEntity::setLineNumber(LONG l) { m_linenumber = l; }
00371 
00372 //--------------------------------------------------------------------------
00380 //--------------------------------------------------------------------------
00381 inline bool             STILEntity::getSemanticErrors() const { return m_semanticErrors; }
00382 
00383 //--------------------------------------------------------------------------
00391 //--------------------------------------------------------------------------
00392 inline void             STILEntity::setSemanticErrors(bool s) { m_semanticErrors = s; }
00393 
00394 //--------------------------------------------------------------------------
00402 //--------------------------------------------------------------------------
00403 inline bool             STILEntity::isSimple() const { return m_type < __COMPLEX__STIL__ENTITIES; }
00404 
00405 //--------------------------------------------------------------------------
00414 //--------------------------------------------------------------------------
00415 inline sstring           STILEntity::getParseInfo() const {
00416   char tmp[1024] = "";
00418   if (m_filename != "" || m_linenumber != 0) {
00419     sprintf(tmp,"[file=%s, line=%d]",m_filename.c_str(),m_linenumber);
00420   }
00421   return tmp;
00422 }
00423 
00424 #endif

This page last updated on 6 Jul 2007

SourceForge.net Logo