void Program::push_call(PlainId fn_name, term_v ¶ms) { if (tracing_enabled) program_profiler.push_call(fn_name); if (stack.size() > 200) { cout << "Stack overflow!\n"; print_stack(); halt; } stack.push_back(StackEntry(fn_name, params)); }
/*! Pushes \a filePath onto the file position stack. The current file position becomes (\a filePath, 1, 1). \sa pop() */ void Location::push(const QString& filePath) { if (stkDepth++ >= 1) { if (stk == 0) stk = new QStack<StackEntry>; stk->push(StackEntry()); stkTop = &stk->top(); } stkTop->filePath = filePath; stkTop->lineNo = INT_MIN; stkTop->columnNo = 1; }
void VariablesStack::pushVariable( const XalanQName& name, const ElemVariable* var, const ElemTemplateElement* e) { if(elementFrameAlreadyPushed(e) == false) { pushElementFrame(e); } push(StackEntry(&name, var)); }
void VariablesStack::pushVariable( const XalanQName& name, const XObjectPtr& val, const ElemTemplateElement* e) { if(elementFrameAlreadyPushed(e) == false) { XalanDOMString theBuffer(m_stack.getMemoryManager()); throw InvalidStackContextException(theBuffer); } push(StackEntry(&name, val)); }
/*! Pops the top of the internal stack. The current file position becomes the next one in the new top of stack. \sa push() */ void Location::pop() { if (--stkDepth == 0) { stkBottom = StackEntry(); } else { stk->pop(); if (stk->isEmpty()) { delete stk; stk = 0; stkTop = &stkBottom; } else { stkTop = &stk->top(); } } }
void PrefabUtility::restoreUnlinkedInstanceData(const HSceneObject& so, SceneObjectProxy& proxy) { struct StackEntry { HSceneObject so; SceneObjectProxy* proxy; }; Stack<StackEntry> todo; todo.push(StackEntry()); StackEntry& topEntry = todo.top(); topEntry.so = so; topEntry.proxy = &proxy; while (!todo.empty()) { StackEntry current = todo.top(); todo.pop(); if (current.proxy->linkId == -1) current.so->_setInstanceData(current.proxy->instanceData); Vector<HComponent>& components = current.so->mComponents; UINT32 componentProxyIdx = 0; UINT32 numComponentProxies = (UINT32)current.proxy->components.size(); for (auto& component : components) { if (component->getLinkId() == (UINT32)-1) { bool foundInstanceData = false; for (; componentProxyIdx < numComponentProxies; componentProxyIdx++) { if (current.proxy->components[componentProxyIdx].linkId != -1) continue; component->_setInstanceData(current.proxy->components[componentProxyIdx].instanceData); component._setHandleData(component.getInternalPtr()); foundInstanceData = true; break; } assert(foundInstanceData); } } UINT32 numChildren = current.so->getNumChildren(); UINT32 childProxyIdx = 0; UINT32 numChildProxies = (UINT32)current.proxy->children.size(); for (UINT32 i = 0; i < numChildren; i++) { HSceneObject child = current.so->getChild(i); if (child->getLinkId() == (UINT32)-1) { bool foundInstanceData = false; for (; childProxyIdx < numChildProxies; childProxyIdx++) { if (current.proxy->children[childProxyIdx].linkId != -1) continue; assert(current.proxy->children[childProxyIdx].linkId == -1); child->_setInstanceData(current.proxy->children[childProxyIdx].instanceData); if (child->mPrefabLinkUUID.empty()) { todo.push(StackEntry()); StackEntry& newEntry = todo.top(); newEntry.so = child; newEntry.proxy = ¤t.proxy->children[childProxyIdx]; } foundInstanceData = true; break; } assert(foundInstanceData); } else { if (!child->mPrefabLinkUUID.empty()) continue; for (UINT32 j = 0; j < numChildProxies; j++) { if (child->getLinkId() == current.proxy->children[j].linkId) { todo.push(StackEntry()); StackEntry& newEntry = todo.top(); newEntry.so = child; newEntry.proxy = ¤t.proxy->children[j]; break; } } } } } }
void Json_parser::feed_data(char* str, int len, Object& result) { char *beg = str; char *p = str, *pe = str + strlen(str); char* eof = NULL; if ((this->data_ptr + len) > this->buf_size) { this->data = (char*)realloc(this->data, this->data_ptr + len); this->buf_size = this->data_ptr + len; } memcpy(this->data, str, len); #line 103 "Json_parser.hpp" { if ( p == pe ) goto _test_eof; goto _resume; _again: switch ( this->cs ) { case 1: goto st1; case 0: goto st0; case 64: goto st64; case 2: goto st2; case 3: goto st3; case 4: goto st4; case 5: goto st5; case 6: goto st6; case 7: goto st7; case 8: goto st8; case 65: goto st65; case 9: goto st9; case 10: goto st10; case 11: goto st11; case 12: goto st12; case 13: goto st13; case 14: goto st14; case 15: goto st15; case 16: goto st16; case 17: goto st17; case 18: goto st18; case 19: goto st19; case 20: goto st20; case 21: goto st21; case 22: goto st22; case 23: goto st23; case 24: goto st24; case 25: goto st25; case 26: goto st26; case 27: goto st27; case 28: goto st28; case 29: goto st29; case 30: goto st30; case 31: goto st31; case 32: goto st32; case 33: goto st33; case 34: goto st34; case 35: goto st35; case 36: goto st36; case 37: goto st37; case 38: goto st38; case 39: goto st39; case 40: goto st40; case 41: goto st41; case 42: goto st42; case 43: goto st43; case 44: goto st44; case 45: goto st45; case 46: goto st46; case 47: goto st47; case 66: goto st66; case 48: goto st48; case 49: goto st49; case 50: goto st50; case 51: goto st51; case 52: goto st52; case 53: goto st53; case 54: goto st54; case 55: goto st55; case 56: goto st56; case 57: goto st57; case 58: goto st58; case 59: goto st59; case 60: goto st60; case 61: goto st61; case 62: goto st62; case 63: goto st63; default: break; } if ( ++p == pe ) goto _test_eof; _resume: switch ( this->cs ) { st1: if ( ++p == pe ) goto _test_eof1; case 1: switch( (*p) ) { case 13u: goto st1; case 32u: goto st1; case 91u: goto tr2; case 123u: goto tr3; } if ( 9u <= (*p) && (*p) <= 10u ) goto st1; goto tr0; tr0: #line 175 "parser.rl" { throw Exception("Parse error"); } goto st0; #line 205 "Json_parser.hpp" st0: this->cs = 0; goto _out; tr2: #line 22 "parser.rl" { #ifdef DEBUG std::cout << "pushing array " << this->current_name << " to stack" << std::endl; #endif this->o_stack.push_back(StackEntry(this->current_name, ARRAY)); this->reading_value = 0; this->value_written = 0; { this->stack[ this->top++] = 64; goto st37;} } #line 252 "parser.rl" { #ifdef DEBUG std::cout << "parser finish" << std::endl; #endif } goto st64; tr3: #line 7 "parser.rl" { if (this->current_name.length()) { #ifdef DEBUG std::cout << "pushing object " << this->current_name << " to stack" << std::endl; #endif this->o_stack.push_back(StackEntry(this->current_name, OBJECT)); this->reading_value = 0; this->value_written = 0; } { this->stack[ this->top++] = 64; goto st2;} } #line 252 "parser.rl" { #ifdef DEBUG std::cout << "parser finish" << std::endl; #endif } goto st64; tr88: #line 252 "parser.rl" { #ifdef DEBUG std::cout << "parser finish" << std::endl; #endif } goto st64; st64: if ( ++p == pe ) goto _test_eof64; case 64: #line 262 "Json_parser.hpp" switch( (*p) ) { case 13u: goto tr88; case 32u: goto tr88; } if ( 9u <= (*p) && (*p) <= 10u ) goto tr88; goto tr0; st2: if ( ++p == pe ) goto _test_eof2; case 2: switch( (*p) ) { case 13u: goto st2; case 32u: goto st2; case 34u: goto tr5; case 125u: goto tr6; } if ( 9u <= (*p) && (*p) <= 10u ) goto st2; goto tr0; tr5: #line 132 "parser.rl" { #ifdef DEBUG std::cout << "string start" << std::endl; #endif this->rec_start = p + 1; } goto st3; st3: if ( ++p == pe ) goto _test_eof3; case 3: #line 296 "Json_parser.hpp" switch( (*p) ) { case 34u: goto tr8; case 92u: goto st32; } if ( (*p) <= 31u ) goto tr0; goto st3; tr8: #line 34 "parser.rl" { if (!this->reading_value) { this->current_name = std::string(this->rec_start, (p - this->rec_start)); } else { if (!this->value_written) { std::string val = std::string(this->rec_start, (p - this->rec_start)); #ifdef DEBUG std::cout << "string val read: " << val << std::endl; #endif switch(this->o_stack.back().type) { case OBJECT: #ifdef DEBUG std::cout << "back of stack is object " << this->o_stack.back().name << std::endl; #endif this->o_stack.back().o.put(this->current_name, val); break; case ARRAY: #ifdef DEBUG std::cout << "back of stack is array" << std::endl; #endif this->o_stack.back().a.push_back(val); break; } this->value_written = 1; } } } goto st4; st4: if ( ++p == pe ) goto _test_eof4; case 4: #line 347 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st4; case 32u: goto st4; case 58u: goto st5; } if ( 9u <= (*p) && (*p) <= 10u ) goto st4; goto tr0; st5: if ( ++p == pe ) goto _test_eof5; case 5: switch( (*p) ) { case 13u: goto st5; case 32u: goto st5; case 34u: goto tr12; case 45u: goto tr13; case 48u: goto tr14; case 91u: goto tr16; case 102u: goto tr17; case 110u: goto tr18; case 116u: goto tr19; case 123u: goto tr20; } if ( (*p) > 10u ) { if ( 49u <= (*p) && (*p) <= 57u ) goto tr15; } else if ( (*p) >= 9u ) goto st5; goto tr0; tr12: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 132 "parser.rl" { #ifdef DEBUG std::cout << "string start" << std::endl; #endif this->rec_start = p + 1; } goto st6; st6: if ( ++p == pe ) goto _test_eof6; case 6: #line 399 "Json_parser.hpp" switch( (*p) ) { case 34u: goto tr22; case 92u: goto st9; } if ( (*p) <= 31u ) goto tr0; goto st6; tr16: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 22 "parser.rl" { #ifdef DEBUG std::cout << "pushing array " << this->current_name << " to stack" << std::endl; #endif this->o_stack.push_back(StackEntry(this->current_name, ARRAY)); this->reading_value = 0; this->value_written = 0; { this->stack[ this->top++] = 7; goto st37;} } #line 247 "parser.rl" { this->reading_value = 0; } goto st7; tr20: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 7 "parser.rl" { if (this->current_name.length()) { #ifdef DEBUG std::cout << "pushing object " << this->current_name << " to stack" << std::endl; #endif this->o_stack.push_back(StackEntry(this->current_name, OBJECT)); this->reading_value = 0; this->value_written = 0; } { this->stack[ this->top++] = 7; goto st2;} } #line 247 "parser.rl" { this->reading_value = 0; } goto st7; tr22: #line 34 "parser.rl" { if (!this->reading_value) { this->current_name = std::string(this->rec_start, (p - this->rec_start)); } else { if (!this->value_written) { std::string val = std::string(this->rec_start, (p - this->rec_start)); #ifdef DEBUG std::cout << "string val read: " << val << std::endl; #endif switch(this->o_stack.back().type) { case OBJECT: #ifdef DEBUG std::cout << "back of stack is object " << this->o_stack.back().name << std::endl; #endif this->o_stack.back().o.put(this->current_name, val); break; case ARRAY: #ifdef DEBUG std::cout << "back of stack is array" << std::endl; #endif this->o_stack.back().a.push_back(val); break; } this->value_written = 1; } } } #line 247 "parser.rl" { this->reading_value = 0; } goto st7; tr40: #line 157 "parser.rl" { if (!this->value_written) { switch(this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, false); break; case ARRAY: this->o_stack.back().a.push_back(false); break; } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st7; tr43: #line 234 "parser.rl" { } #line 247 "parser.rl" { this->reading_value = 0; } goto st7; tr46: #line 140 "parser.rl" { if (!this->value_written) { switch(this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, true); break; case ARRAY: this->o_stack.back().a.push_back(false); break; } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st7; st7: if ( ++p == pe ) goto _test_eof7; case 7: #line 561 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st7; case 32u: goto st7; case 44u: goto st8; case 125u: goto tr6; } if ( 9u <= (*p) && (*p) <= 10u ) goto st7; goto tr0; st8: if ( ++p == pe ) goto _test_eof8; case 8: switch( (*p) ) { case 13u: goto st8; case 32u: goto st8; case 34u: goto tr5; } if ( 9u <= (*p) && (*p) <= 10u ) goto st8; goto tr0; tr6: #line 72 "parser.rl" { int size = this->o_stack.size(); assert(size); if (size == 1) { assert(this->o_stack.back().type == OBJECT); result = this->o_stack.back().o; } else { assert(this->o_stack.back().type == OBJECT); #ifdef DEBUG std::cout << "Merging object " << this->o_stack.back().name << " upwards ----" << std::endl; #endif StackEntry& e = this->o_stack[size - 2]; switch(e.type) { case OBJECT: #ifdef DEBUG std::cout << "parent is object" << e.name << std::endl; #endif e.o.put(this->o_stack.back().name, this->o_stack.back().o); case ARRAY: e.a.push_back(this->o_stack.back().o); } this->o_stack.pop_back(); } { this->cs = this->stack[-- this->top];goto _again;} } goto st65; st65: if ( ++p == pe ) goto _test_eof65; case 65: #line 623 "Json_parser.hpp" goto tr0; st9: if ( ++p == pe ) goto _test_eof9; case 9: switch( (*p) ) { case 34u: goto st6; case 47u: goto st6; case 92u: goto st6; case 98u: goto st6; case 102u: goto st6; case 110u: goto st6; case 114u: goto st6; case 116u: goto st6; case 117u: goto st10; } goto tr0; st10: if ( ++p == pe ) goto _test_eof10; case 10: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st11; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st11; } else goto st11; goto tr0; st11: if ( ++p == pe ) goto _test_eof11; case 11: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st12; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st12; } else goto st12; goto tr0; st12: if ( ++p == pe ) goto _test_eof12; case 12: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st13; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st13; } else goto st13; goto tr0; st13: if ( ++p == pe ) goto _test_eof13; case 13: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st6; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st6; } else goto st6; goto tr0; tr13: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 187 "parser.rl" { #ifdef DEBUG std::cout << "num start" << std::endl; #endif this->rec_start = p; } goto st14; st14: if ( ++p == pe ) goto _test_eof14; case 14: #line 714 "Json_parser.hpp" if ( (*p) == 48u ) goto tr30; if ( 49u <= (*p) && (*p) <= 57u ) goto tr31; goto tr0; tr14: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 187 "parser.rl" { #ifdef DEBUG std::cout << "num start" << std::endl; #endif this->rec_start = p; } #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st15; tr30: #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st15; st15: if ( ++p == pe ) goto _test_eof15; case 15: #line 827 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st7; case 32u: goto st7; case 44u: goto st8; case 46u: goto st16; case 69u: goto st18; case 101u: goto st18; case 125u: goto tr6; } if ( 9u <= (*p) && (*p) <= 10u ) goto st7; goto tr0; st16: if ( ++p == pe ) goto _test_eof16; case 16: if ( 48u <= (*p) && (*p) <= 57u ) goto tr34; goto tr0; tr34: #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st17; st17: if ( ++p == pe ) goto _test_eof17; case 17: #line 895 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st7; case 32u: goto st7; case 44u: goto st8; case 69u: goto st18; case 101u: goto st18; case 125u: goto tr6; } if ( (*p) > 10u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto tr34; } else if ( (*p) >= 9u ) goto st7; goto tr0; st18: if ( ++p == pe ) goto _test_eof18; case 18: switch( (*p) ) { case 43u: goto st19; case 45u: goto st19; } if ( 48u <= (*p) && (*p) <= 57u ) goto tr36; goto tr0; st19: if ( ++p == pe ) goto _test_eof19; case 19: if ( 48u <= (*p) && (*p) <= 57u ) goto tr36; goto tr0; tr36: #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st20; st20: if ( ++p == pe ) goto _test_eof20; case 20: #line 976 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st7; case 32u: goto st7; case 44u: goto st8; case 125u: goto tr6; } if ( (*p) > 10u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto tr36; } else if ( (*p) >= 9u ) goto st7; goto tr0; tr15: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 187 "parser.rl" { #ifdef DEBUG std::cout << "num start" << std::endl; #endif this->rec_start = p; } #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st21; tr31: #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st21; st21: if ( ++p == pe ) goto _test_eof21; case 21: #line 1096 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st7; case 32u: goto st7; case 44u: goto st8; case 46u: goto st16; case 69u: goto st18; case 101u: goto st18; case 125u: goto tr6; } if ( (*p) > 10u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto tr31; } else if ( (*p) >= 9u ) goto st7; goto tr0; tr17: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } goto st22; st22: if ( ++p == pe ) goto _test_eof22; case 22: #line 1126 "Json_parser.hpp" if ( (*p) == 97u ) goto st23; goto tr0; st23: if ( ++p == pe ) goto _test_eof23; case 23: if ( (*p) == 108u ) goto st24; goto tr0; st24: if ( ++p == pe ) goto _test_eof24; case 24: if ( (*p) == 115u ) goto st25; goto tr0; st25: if ( ++p == pe ) goto _test_eof25; case 25: if ( (*p) == 101u ) goto tr40; goto tr0; tr18: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } goto st26; st26: if ( ++p == pe ) goto _test_eof26; case 26: #line 1165 "Json_parser.hpp" if ( (*p) == 117u ) goto st27; goto tr0; st27: if ( ++p == pe ) goto _test_eof27; case 27: if ( (*p) == 108u ) goto st28; goto tr0; st28: if ( ++p == pe ) goto _test_eof28; case 28: if ( (*p) == 108u ) goto tr43; goto tr0; tr19: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } goto st29; st29: if ( ++p == pe ) goto _test_eof29; case 29: #line 1197 "Json_parser.hpp" if ( (*p) == 114u ) goto st30; goto tr0; st30: if ( ++p == pe ) goto _test_eof30; case 30: if ( (*p) == 117u ) goto st31; goto tr0; st31: if ( ++p == pe ) goto _test_eof31; case 31: if ( (*p) == 101u ) goto tr46; goto tr0; st32: if ( ++p == pe ) goto _test_eof32; case 32: switch( (*p) ) { case 34u: goto st3; case 47u: goto st3; case 92u: goto st3; case 98u: goto st3; case 102u: goto st3; case 110u: goto st3; case 114u: goto st3; case 116u: goto st3; case 117u: goto st33; } goto tr0; st33: if ( ++p == pe ) goto _test_eof33; case 33: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st34; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st34; } else goto st34; goto tr0; st34: if ( ++p == pe ) goto _test_eof34; case 34: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st35; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st35; } else goto st35; goto tr0; st35: if ( ++p == pe ) goto _test_eof35; case 35: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st36; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st36; } else goto st36; goto tr0; st36: if ( ++p == pe ) goto _test_eof36; case 36: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st3; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st3; } else goto st3; goto tr0; st37: if ( ++p == pe ) goto _test_eof37; case 37: switch( (*p) ) { case 13u: goto st37; case 32u: goto st37; case 34u: goto tr52; case 45u: goto tr53; case 48u: goto tr54; case 91u: goto tr56; case 93u: goto tr57; case 102u: goto tr58; case 110u: goto tr59; case 116u: goto tr60; case 123u: goto tr61; } if ( (*p) > 10u ) { if ( 49u <= (*p) && (*p) <= 57u ) goto tr55; } else if ( (*p) >= 9u ) goto st37; goto tr0; tr52: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 132 "parser.rl" { #ifdef DEBUG std::cout << "string start" << std::endl; #endif this->rec_start = p + 1; } goto st38; st38: if ( ++p == pe ) goto _test_eof38; case 38: #line 1327 "Json_parser.hpp" switch( (*p) ) { case 34u: goto tr63; case 92u: goto st59; } if ( (*p) <= 31u ) goto tr0; goto st38; tr56: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 22 "parser.rl" { #ifdef DEBUG std::cout << "pushing array " << this->current_name << " to stack" << std::endl; #endif this->o_stack.push_back(StackEntry(this->current_name, ARRAY)); this->reading_value = 0; this->value_written = 0; { this->stack[ this->top++] = 39; goto st37;} } #line 247 "parser.rl" { this->reading_value = 0; } goto st39; tr61: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 7 "parser.rl" { if (this->current_name.length()) { #ifdef DEBUG std::cout << "pushing object " << this->current_name << " to stack" << std::endl; #endif this->o_stack.push_back(StackEntry(this->current_name, OBJECT)); this->reading_value = 0; this->value_written = 0; } { this->stack[ this->top++] = 39; goto st2;} } #line 247 "parser.rl" { this->reading_value = 0; } goto st39; tr63: #line 34 "parser.rl" { if (!this->reading_value) { this->current_name = std::string(this->rec_start, (p - this->rec_start)); } else { if (!this->value_written) { std::string val = std::string(this->rec_start, (p - this->rec_start)); #ifdef DEBUG std::cout << "string val read: " << val << std::endl; #endif switch(this->o_stack.back().type) { case OBJECT: #ifdef DEBUG std::cout << "back of stack is object " << this->o_stack.back().name << std::endl; #endif this->o_stack.back().o.put(this->current_name, val); break; case ARRAY: #ifdef DEBUG std::cout << "back of stack is array" << std::endl; #endif this->o_stack.back().a.push_back(val); break; } this->value_written = 1; } } } #line 247 "parser.rl" { this->reading_value = 0; } goto st39; tr77: #line 157 "parser.rl" { if (!this->value_written) { switch(this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, false); break; case ARRAY: this->o_stack.back().a.push_back(false); break; } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st39; tr80: #line 234 "parser.rl" { } #line 247 "parser.rl" { this->reading_value = 0; } goto st39; tr83: #line 140 "parser.rl" { if (!this->value_written) { switch(this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, true); break; case ARRAY: this->o_stack.back().a.push_back(false); break; } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st39; st39: if ( ++p == pe ) goto _test_eof39; case 39: #line 1489 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st39; case 32u: goto st39; case 44u: goto st40; case 93u: goto tr57; } if ( 9u <= (*p) && (*p) <= 10u ) goto st39; goto tr0; st40: if ( ++p == pe ) goto _test_eof40; case 40: switch( (*p) ) { case 13u: goto st40; case 32u: goto st40; case 34u: goto tr52; case 45u: goto tr53; case 48u: goto tr54; case 91u: goto tr56; case 102u: goto tr58; case 110u: goto tr59; case 116u: goto tr60; case 123u: goto tr61; } if ( (*p) > 10u ) { if ( 49u <= (*p) && (*p) <= 57u ) goto tr55; } else if ( (*p) >= 9u ) goto st40; goto tr0; tr53: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 187 "parser.rl" { #ifdef DEBUG std::cout << "num start" << std::endl; #endif this->rec_start = p; } goto st41; st41: if ( ++p == pe ) goto _test_eof41; case 41: #line 1542 "Json_parser.hpp" if ( (*p) == 48u ) goto tr67; if ( 49u <= (*p) && (*p) <= 57u ) goto tr68; goto tr0; tr54: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 187 "parser.rl" { #ifdef DEBUG std::cout << "num start" << std::endl; #endif this->rec_start = p; } #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st42; tr67: #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st42; st42: if ( ++p == pe ) goto _test_eof42; case 42: #line 1655 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st39; case 32u: goto st39; case 44u: goto st40; case 46u: goto st43; case 69u: goto st45; case 93u: goto tr57; case 101u: goto st45; } if ( 9u <= (*p) && (*p) <= 10u ) goto st39; goto tr0; st43: if ( ++p == pe ) goto _test_eof43; case 43: if ( 48u <= (*p) && (*p) <= 57u ) goto tr71; goto tr0; tr71: #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st44; st44: if ( ++p == pe ) goto _test_eof44; case 44: #line 1723 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st39; case 32u: goto st39; case 44u: goto st40; case 69u: goto st45; case 93u: goto tr57; case 101u: goto st45; } if ( (*p) > 10u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto tr71; } else if ( (*p) >= 9u ) goto st39; goto tr0; st45: if ( ++p == pe ) goto _test_eof45; case 45: switch( (*p) ) { case 43u: goto st46; case 45u: goto st46; } if ( 48u <= (*p) && (*p) <= 57u ) goto tr73; goto tr0; st46: if ( ++p == pe ) goto _test_eof46; case 46: if ( 48u <= (*p) && (*p) <= 57u ) goto tr73; goto tr0; tr73: #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st47; st47: if ( ++p == pe ) goto _test_eof47; case 47: #line 1804 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st39; case 32u: goto st39; case 44u: goto st40; case 93u: goto tr57; } if ( (*p) > 10u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto tr73; } else if ( (*p) >= 9u ) goto st39; goto tr0; tr57: #line 107 "parser.rl" { int size = this->o_stack.size(); assert(this->o_stack.back().type == ARRAY); assert(size > 1); // Root item shall be an object #ifdef DEBUG std::cout << "Merging array " << this->o_stack.back().name << " upwards ----" << std::endl; #endif StackEntry& e = this->o_stack[size - 2]; switch(e.type) { case OBJECT: e.o.put(this->o_stack.back().name, this->o_stack.back().a); case ARRAY: e.a.push_back(this->o_stack.back().a); } this->o_stack.pop_back(); { this->cs = this->stack[-- this->top];goto _again;} } goto st66; st66: if ( ++p == pe ) goto _test_eof66; case 66: #line 1847 "Json_parser.hpp" goto tr0; tr55: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } #line 187 "parser.rl" { #ifdef DEBUG std::cout << "num start" << std::endl; #endif this->rec_start = p; } #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st48; tr68: #line 195 "parser.rl" { if (!this->value_written) { std::string the_string = std::string(this->rec_start, (p - this->rec_start)); if (strchr(the_string.c_str(), '.')) { double num = strtod(the_string.c_str(), NULL); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } else { int num = strtol(the_string.c_str(), NULL, 10); switch (this->o_stack.back().type) { case OBJECT: this->o_stack.back().o.put(this->current_name, num); break; case ARRAY: this->o_stack.back().a.push_back(num); break; } } this->value_written = 1; } } #line 247 "parser.rl" { this->reading_value = 0; } goto st48; st48: if ( ++p == pe ) goto _test_eof48; case 48: #line 1956 "Json_parser.hpp" switch( (*p) ) { case 13u: goto st39; case 32u: goto st39; case 44u: goto st40; case 46u: goto st43; case 69u: goto st45; case 93u: goto tr57; case 101u: goto st45; } if ( (*p) > 10u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto tr68; } else if ( (*p) >= 9u ) goto st39; goto tr0; tr58: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } goto st49; st49: if ( ++p == pe ) goto _test_eof49; case 49: #line 1986 "Json_parser.hpp" if ( (*p) == 97u ) goto st50; goto tr0; st50: if ( ++p == pe ) goto _test_eof50; case 50: if ( (*p) == 108u ) goto st51; goto tr0; st51: if ( ++p == pe ) goto _test_eof51; case 51: if ( (*p) == 115u ) goto st52; goto tr0; st52: if ( ++p == pe ) goto _test_eof52; case 52: if ( (*p) == 101u ) goto tr77; goto tr0; tr59: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } goto st53; st53: if ( ++p == pe ) goto _test_eof53; case 53: #line 2025 "Json_parser.hpp" if ( (*p) == 117u ) goto st54; goto tr0; st54: if ( ++p == pe ) goto _test_eof54; case 54: if ( (*p) == 108u ) goto st55; goto tr0; st55: if ( ++p == pe ) goto _test_eof55; case 55: if ( (*p) == 108u ) goto tr80; goto tr0; tr60: #line 238 "parser.rl" { #ifdef DEBUG std::cout << "val start" << std::endl; #endif this->reading_value = 1; this->value_written = 0; } goto st56; st56: if ( ++p == pe ) goto _test_eof56; case 56: #line 2057 "Json_parser.hpp" if ( (*p) == 114u ) goto st57; goto tr0; st57: if ( ++p == pe ) goto _test_eof57; case 57: if ( (*p) == 117u ) goto st58; goto tr0; st58: if ( ++p == pe ) goto _test_eof58; case 58: if ( (*p) == 101u ) goto tr83; goto tr0; st59: if ( ++p == pe ) goto _test_eof59; case 59: switch( (*p) ) { case 34u: goto st38; case 47u: goto st38; case 92u: goto st38; case 98u: goto st38; case 102u: goto st38; case 110u: goto st38; case 114u: goto st38; case 116u: goto st38; case 117u: goto st60; } goto tr0; st60: if ( ++p == pe ) goto _test_eof60; case 60: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st61; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st61; } else goto st61; goto tr0; st61: if ( ++p == pe ) goto _test_eof61; case 61: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st62; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st62; } else goto st62; goto tr0; st62: if ( ++p == pe ) goto _test_eof62; case 62: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st63; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st63; } else goto st63; goto tr0; st63: if ( ++p == pe ) goto _test_eof63; case 63: if ( (*p) < 65u ) { if ( 48u <= (*p) && (*p) <= 57u ) goto st38; } else if ( (*p) > 70u ) { if ( 97u <= (*p) && (*p) <= 102u ) goto st38; } else goto st38; goto tr0; } _test_eof1: this->cs = 1; goto _test_eof; _test_eof64: this->cs = 64; goto _test_eof; _test_eof2: this->cs = 2; goto _test_eof; _test_eof3: this->cs = 3; goto _test_eof; _test_eof4: this->cs = 4; goto _test_eof; _test_eof5: this->cs = 5; goto _test_eof; _test_eof6: this->cs = 6; goto _test_eof; _test_eof7: this->cs = 7; goto _test_eof; _test_eof8: this->cs = 8; goto _test_eof; _test_eof65: this->cs = 65; goto _test_eof; _test_eof9: this->cs = 9; goto _test_eof; _test_eof10: this->cs = 10; goto _test_eof; _test_eof11: this->cs = 11; goto _test_eof; _test_eof12: this->cs = 12; goto _test_eof; _test_eof13: this->cs = 13; goto _test_eof; _test_eof14: this->cs = 14; goto _test_eof; _test_eof15: this->cs = 15; goto _test_eof; _test_eof16: this->cs = 16; goto _test_eof; _test_eof17: this->cs = 17; goto _test_eof; _test_eof18: this->cs = 18; goto _test_eof; _test_eof19: this->cs = 19; goto _test_eof; _test_eof20: this->cs = 20; goto _test_eof; _test_eof21: this->cs = 21; goto _test_eof; _test_eof22: this->cs = 22; goto _test_eof; _test_eof23: this->cs = 23; goto _test_eof; _test_eof24: this->cs = 24; goto _test_eof; _test_eof25: this->cs = 25; goto _test_eof; _test_eof26: this->cs = 26; goto _test_eof; _test_eof27: this->cs = 27; goto _test_eof; _test_eof28: this->cs = 28; goto _test_eof; _test_eof29: this->cs = 29; goto _test_eof; _test_eof30: this->cs = 30; goto _test_eof; _test_eof31: this->cs = 31; goto _test_eof; _test_eof32: this->cs = 32; goto _test_eof; _test_eof33: this->cs = 33; goto _test_eof; _test_eof34: this->cs = 34; goto _test_eof; _test_eof35: this->cs = 35; goto _test_eof; _test_eof36: this->cs = 36; goto _test_eof; _test_eof37: this->cs = 37; goto _test_eof; _test_eof38: this->cs = 38; goto _test_eof; _test_eof39: this->cs = 39; goto _test_eof; _test_eof40: this->cs = 40; goto _test_eof; _test_eof41: this->cs = 41; goto _test_eof; _test_eof42: this->cs = 42; goto _test_eof; _test_eof43: this->cs = 43; goto _test_eof; _test_eof44: this->cs = 44; goto _test_eof; _test_eof45: this->cs = 45; goto _test_eof; _test_eof46: this->cs = 46; goto _test_eof; _test_eof47: this->cs = 47; goto _test_eof; _test_eof66: this->cs = 66; goto _test_eof; _test_eof48: this->cs = 48; goto _test_eof; _test_eof49: this->cs = 49; goto _test_eof; _test_eof50: this->cs = 50; goto _test_eof; _test_eof51: this->cs = 51; goto _test_eof; _test_eof52: this->cs = 52; goto _test_eof; _test_eof53: this->cs = 53; goto _test_eof; _test_eof54: this->cs = 54; goto _test_eof; _test_eof55: this->cs = 55; goto _test_eof; _test_eof56: this->cs = 56; goto _test_eof; _test_eof57: this->cs = 57; goto _test_eof; _test_eof58: this->cs = 58; goto _test_eof; _test_eof59: this->cs = 59; goto _test_eof; _test_eof60: this->cs = 60; goto _test_eof; _test_eof61: this->cs = 61; goto _test_eof; _test_eof62: this->cs = 62; goto _test_eof; _test_eof63: this->cs = 63; goto _test_eof; _test_eof: {} if ( p == eof ) { switch ( this->cs ) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37: case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: case 58: case 59: case 60: case 61: case 62: case 63: #line 175 "parser.rl" { throw Exception("Parse error"); } break; #line 2283 "Json_parser.hpp" } } _out: {} } #line 101 "Json_parser.rl" this->data_ptr += len; }
void VariablesStack::pushContextMarker() { push(StackEntry()); }