#ifndef __BALLOON_PARSE_H__ #define __BALLOON_PARSE_H__ class balloon_parse { private: std::stack parse; token this_token; int error; int warning; abstract_syntax_tree root; public: void get_token() { if(!parse.empty()) { this_token=parse.top(); parse.pop(); } else this_token.type=0; return; } void get_detail_token_stream(std::list& tk_list) { root.set_clear(); while(!parse.empty()) parse.pop(); if(tk_list.empty()) return; std::stack temp; for(std::list::iterator i=tk_list.begin();i!=tk_list.end();++i) temp.push(*i); while(!temp.empty()) { parse.push(temp.top()); temp.pop(); } return; } void print_parse_stack() { if(parse.empty()) return; std::stack temp; int line=parse.top().line; std::cout<>[Abstract-syntax-tree]"<>[Runtime] process begins at addr:"<<(void*)(&root)<<"."<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-warning] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse-error] line "<>[Parse] complete generating."<