7 cm( inst, this,
"JsonLex" ),
38 this->next = Next::Value;
39 this->layer_types = std::stack< LayerType >();
40 this->_lex.
Init( in );
45 return this->_lex.
Failed();
65 return this->next == Next::Value && this->_lex.
IsNextKeyword(
"null" );
67 case Token::ArrayBegin:
68 return this->next == Next::Value && this->_lex.
IsNextOperator(
"[" );
71 return this->next == Next::ArrayEnd && this->_lex.
IsNextOperator(
"]" );
73 case Token::TableBegin:
74 return this->next == Next::Value && this->_lex.
IsNextOperator(
"{" );
77 return this->next == Next::TableEnd && this->_lex.
IsNextOperator(
"}" );
90 void JsonLex::value_ended()
92 if( this->layer_types.empty() )
94 this->next = Next::Eof;
98 LayerType type = this->layer_types.top();
99 if( type == LayerType::Array )
104 this->next = Next::Value;
108 this->next = Next::ArrayEnd;
116 this->next = Next::TableKey;
120 this->next = Next::TableEnd;
126 void JsonLex::JsonFail()
134 if( !this->
IsNext( token ) )
170 case Token::ArrayBegin:
172 this->layer_types.push( LayerType::Array );
174 this->next = Next::ArrayEnd;
176 this->next = Next::Value;
179 case Token::ArrayEnd:
181 this->layer_types.pop();
185 case Token::TableKey:
188 this->next = Next::Value;
191 case Token::TableBegin:
193 this->layer_types.push( LayerType::Table );
195 this->next = Next::TableEnd;
197 this->next = Next::TableKey;
200 case Token::TableEnd:
202 this->layer_types.pop();
214 if( !this->
IsNext( Token::TableKey ) )
222 this->next = Next::Value;
228 if( !this->
IsNext( Token::Integer ) )
241 if( !this->
IsNext( Token::Double ) )
254 if( !this->
IsNext( Token::String ) )
267 if( !this->
IsNext( Token::Bool ) )
290 if( !this->
IsNext( Token::Null ) )