30 #ifndef __NCML_MODULE__SCOPE_STACK_H__ 31 #define __NCML_MODULE__SCOPE_STACK_H__ 63 enum ScopeType { GLOBAL=0, VARIABLE_ATOMIC, VARIABLE_CONSTRUCTOR, ATTRIBUTE_ATOMIC, ATTRIBUTE_CONTAINER, NUM_SCOPE_TYPES};
74 Entry() : type(GLOBAL) , name(
"") {}
76 string getTypedName()
const 78 return name + toString(type);
81 static const string& toString(
ScopeType theType)
83 return sTypeStrings[theType];
88 static const string sTypeStrings[NUM_SCOPE_TYPES];
98 void push(
const string& name,
ScopeType type) { push(
Entry(type, name)); }
100 const Entry& top()
const;
102 ScopeType topType()
const {
return top().type; }
103 const string& topName()
const {
return top().name; }
117 string getFullyQualifiedName()
const {
return getScopeString(); }
123 string getScopeString()
const;
132 string getTypedScopeString()
const;
138 bool isCurrentScope(ScopeType type)
const;
142 void push(
const Entry& entry);
146 vector<Entry> _scope;
NcML Parser for adding/modifying/removing metadata (attributes) to existing local datasets using NcML...