00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef STILEntity_H
00024 #define STILEntity_H
00025
00026
00027 #include "stilcom.h"
00028 #include "stilcomstr.h"
00029
00030
00031
00032
00048
00049 class STILEntity {
00050
00051
00052
00053 public:
00054
00056 enum Type {
00063 UndefinedEntity,
00064
00066 __SIMPLE__STIL__ENTITIES,
00067
00068 Alignment,
00069 Ann,
00070 Base,
00071 BreakPoint,
00072 CategoryRef,
00073 DataBitCount,
00074 Date,
00075 DefaultState,
00076 ScanIn,
00077 ScanOut,
00078 Source,
00079 Start,
00080 Goto,
00081 X,
00082 Stop,
00083 IddqTestPoint,
00084 Title,
00085 Termination,
00086 UserKeywords,
00087 UserStatement,
00088 UserBlock,
00089 MacroDefsRef,
00090 PatternBurstRef,
00091 ProceduresRef,
00092 ScanStructuresRef,
00093 SelectorRef,
00094 SignalGroupsRef,
00095 TimingRef,
00096 WaveformTableRef,
00097 ScanChainRef,
00098
00099 TimeUnit,
00100 ResourceTag,
00101
00103 __COMPLEX__STIL__ENTITIES,
00104
00105 Main,
00106
00107 Terminations,
00108 Breakpoint,
00109 Call,
00110 Category,
00111 Condition,
00112 Fixed,
00113 Header,
00114 History,
00115 Infinite,
00116 Loop,
00117 Macro,
00118 MacroDefs,
00119 MacroDef,
00120 MatchLoop,
00121 PatList,
00122 Pattern,
00123 PatternBurst,
00124 PatternExec,
00125 Pattern_or_PatternBurst,
00126 Procedures,
00127 Procedure,
00128 Selector,
00129 Shift,
00130 Signals,
00131 Signal,
00132 SignalGroups,
00133 SignalGroup,
00134 ScanStructures,
00135 ScanChain,
00136 Timing,
00137 Variable,
00138 Vector,
00139 VectorItem,
00140 Spec,
00141
00142 WaveformTable,
00143 SubWaveforms,
00144 SubWaveform,
00145 WaveformEvent,
00146 TimingWaveformRef,
00147 Waveforms,
00148 Waveform,
00149 WaveformItem,
00150 WFCS,
00151 WFCSItem,
00152
00153 __END__STIL__ENTITIES
00154 };
00155
00156
00157 STILEntity();
00158
00159
00160 STILEntity(Type);
00161
00162
00163 STILEntity(const STILEntity &);
00164
00165
00166 virtual ~STILEntity();
00167
00168
00169 STILEntity & operator=(const STILEntity &);
00170
00171
00172 bool operator==(const STILEntity &) const;
00173
00174
00175 bool operator<(const STILEntity &) const;
00176
00177
00178 void init(Type t);
00179
00180
00181 virtual void write(FILE * pOutFile, LONG indentation=0) const;
00182
00183
00184 const sstring & getName() const;
00185 void setName(const sstring &);
00186
00187
00188 const sstring & getValue() const;
00189 void setValue(const sstring &);
00190
00191
00192 Type getType() const;
00193 const sstring getTypeAsString() const;
00194 void setType(const Type);
00195
00196
00197 const sstring & getLabel() const;
00198 void setLabel(const sstring &);
00199
00200
00201 const sstring & getFileName() const;
00202 void setFileName(const sstring &);
00203
00204
00205 LONG getLineNumber() const;
00206 void setLineNumber(LONG);
00207
00208
00209
00210
00211
00212
00213 bool getSemanticErrors() const;
00214 void setSemanticErrors(bool);
00215
00216
00217 bool isSimple() const;
00218
00219
00220 sstring getParseInfo() const;
00221
00222
00223 protected:
00224
00225
00226
00227 sstring m_name;
00228 sstring m_value;
00229 Type m_type;
00230 sstring m_label;
00231
00232 sstring m_filename;
00233 LONG m_linenumber;
00234 bool m_semanticErrors;
00235
00236
00237 };
00238
00239
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