#include <Scope.h>
Inheritance diagram for Scope:
Public Member Functions | |
Scope () | |
Scope (token_v &) | |
~Scope () | |
void | Add (Sequence *p) |
void | Display () |
bool | Trail () |
void | AddTrail (token_v &) |
std::string | GetTrail () |
sequence_v::iterator | ScopeBegin () |
sequence_v::iterator | ScopeEnd () |
Private Attributes | |
sequence_v | m_sts |
token_v | m_trail |
Definition at line 29 of file Scope.h.
|
File ......... Scope.cpp Published .... 2004-05-17 Author ....... grymse@alhem.net Definition at line 35 of file Scope.cpp.
00036 :Sequence() 00037 { 00038 } |
|
Definition at line 41 of file Scope.cpp. References token_v.
00042 :Sequence(tok) 00043 { 00044 } |
|
Definition at line 47 of file Scope.cpp. References m_sts.
|
|
Definition at line 36 of file Scope.h. References m_sts.
00036 { m_sts.push_back(p); } |
|
Definition at line 140 of file Scope.cpp. References m_trail, and token_v.
00141 { 00142 m_trail = tok; 00143 } |
|
Reimplemented from Sequence. Definition at line 59 of file Scope.cpp. References config, Sequence::GetExpr(), Sequence::GetFile(), Sequence::GetLine(), Sequence::GetParent(), GetTrail(), Sequence::IsExtern(), m_sts, Sequence::Tab(), and Trail().
00060 { 00061 if (IsExtern()) 00062 return; 00063 if (config["-xml"] == "true") 00064 { 00065 if (Trail()) 00066 { 00067 printf("<scope filename=\"%s\" line=\"%d\" value=\"%s\" trail=\"%s\">\n", 00068 GetFile().c_str(), 00069 GetLine(), 00070 GetExpr().c_str(), 00071 GetTrail().c_str()); 00072 } 00073 else 00074 printf("<scope filename=\"%s\" line=\"%d\" value=\"%s\">\n", 00075 GetFile().c_str(), 00076 GetLine(), 00077 GetExpr().c_str()); 00078 for (sequence_v::iterator it = m_sts.begin(); it != m_sts.end(); it++) 00079 { 00080 Sequence *s = *it; 00081 s -> Display(); 00082 } 00083 printf("</scope>\n"); 00084 return; 00085 } 00086 if (config["-dot"] == "true") 00087 return; 00088 if (GetParent()) // root Scope has parent NULL 00089 { 00090 Tab(); 00091 printf("%s\n",GetExpr().c_str()); 00092 Tab(); 00093 printf("{\n"); 00094 } 00095 for (sequence_v::iterator it = m_sts.begin(); it != m_sts.end(); it++) 00096 { 00097 Sequence *s = *it; 00098 s -> Display(); 00099 } 00100 if (GetParent()) 00101 { 00102 Tab(); 00103 printf("}"); 00104 if (Trail()) 00105 { 00106 printf(" %s",GetTrail().c_str()); 00107 /* 00108 for (token_v::iterator it = m_trail.begin(); it != m_trail.end(); it++) 00109 { 00110 Token *t = *it; 00111 printf(" %s",t -> GetVal().c_str()); 00112 } 00113 // printf(";"); 00114 */ 00115 } 00116 printf(" // %s\n",GetExpr().c_str()); 00117 } 00118 } |
|
Definition at line 146 of file Scope.cpp. References config, m_trail, and Sequence::xmlsafestr(). Referenced by Display().
00147 { 00148 std::string tmp; 00149 for (token_v::iterator it = m_trail.begin(); it != m_trail.end(); it++) 00150 { 00151 Token *t = *it; 00152 std::string str = t -> GetVal(); 00153 // if (tmp.size() && (isalpha(str[0]) || str[0] == '<') ) 00154 // tmp += " "; 00155 tmp += str; 00156 } 00157 if (config["-xml"] == "true") 00158 xmlsafestr(tmp); 00159 return tmp; 00160 } |
|
Definition at line 42 of file Scope.h. References m_sts.
00042 { return m_sts.begin(); } |
|
Definition at line 43 of file Scope.h. References m_sts.
00043 { return m_sts.end(); } |
|
Definition at line 121 of file Scope.cpp. References Class, Enum, Sequence::GetFirstToken(), Struct, and Typedef. Referenced by Display().
|
|
Definition at line 46 of file Scope.h. Referenced by Add(), Display(), ScopeBegin(), ScopeEnd(), and ~Scope(). |
|
Definition at line 47 of file Scope.h. Referenced by AddTrail(), and GetTrail(). |