bool LparseParser::doParse() { std::auto_ptr<Asp::Rule> active(new Asp::Rule()); active_ = active.get(); return parseRules() && parseSymbolTable() && parseComputeStatement() && parseModels() && endParse(); }
void ParseExtVerb::parse(ParserIO& io, Language& lang) { beginParse(io); if (VerbNum == 0) lang.ExtVerb1 = parseInt(io); else if (VerbNum == 1) lang.ExtVerb2 = parseInt(io); else if (VerbNum == 2) lang.ExtVerb3 = parseInt(io); else throw ParseException(std::string("Unknown VerbNum: ") + std::to_string(VerbNum) + ", while parsing " + name,io.getInput(),io.getCurPos()); endParse(io); }
/***************************************************** ** ** XmlWorkerPrintoutConfig --- readConfig ** ******************************************************/ bool readConfig( vector<PrintoutConfig*> &defs ) { if ( ! parseFile()) return false; wxXmlNode *cur = doc->GetRoot()->GetChildren(); while ( cur != 0 ) { if ( cur->GetName() == XML_NODE_PRINTOUT ) defs.push_back( this->parsePrintoutConfig( cur )); else reportWrongRootNode( cur->GetName() ); cur = cur->GetNext(); } endParse(); return true; }
void parse( std::string const& str ) { std::size_t pos = 0; while( pos < str.size() ) { char c = str[pos]; if( c == '[' ) { std::size_t end = str.find_first_of( ']', pos ); if( end != std::string::npos ) { acceptTag( str.substr( pos+1, end-pos-1 ) ); pos = end+1; } else { acceptChar( c ); pos++; } } else { acceptChar( c ); pos++; } } endParse(); }
void ParseDef::parse(ParserIO& io, Language& lang) { beginParse(io); endParse(io); }