void AssignStat() { /* AssignStat -> designator := expr */ if ( debugMode) printf( "In AssignStat\n"); designator(); accept( assign, 133); expr(); if ( debugMode) printf( "Out AssignStat\n"); }
void factor() { /* factor -> num | string | NIL | TRUE | FALSE | set | designator [ ActParams ] | '(' expr ')' */ if ( debugMode) printf( "In factor\n"); if ( isNumber( sym)) { writesym(); nextsym(); } else { switch( sym) { case string: writesym(); nextsym(); break; case NIL_SYM: writesym(); nextsym(); break; case TRUE_SYM: writesym(); nextsym(); break; case FALSE_SYM: writesym(); nextsym(); break; case lparen: writesym(); nextsym(); expr(); accept( rparen, 1); break; case lcurb: set(); break; default: designator(); if ( sym == lparen) { ActParams(); } } } if ( debugMode) printf( "Out factor\n"); }
void stat() { /* stat -> [ AssignStat | ProcCall | IfStat | CaseStat | WhileStat | RepeatStat | ForStat ] */ if ( debugMode) printf( "In stat\n"); if ( sym == IF_SYM) { IfStat(); } else if ( sym == CASE_SYM) { CaseStat(); } else if ( sym == WHILE_SYM) { WhileStat(); } else if ( sym == REPEAT_SYM) { RepeatStat(); } else if ( sym == FOR_SYM) { ForStat(); } else if ( sym == ident) { designator(); if ( sym == assign) { // then it was AssignStat writesym(); nextsym(); expr(); } else { // then it was ProcCall if ( sym == lparen) { ActParams(); } } } if ( debugMode) printf( "Out stat\n"); }
void ProcCall() { /* ProcCall -> designator [ ActParams ] */ if ( debugMode) printf( "In ProcCall\n"); designator(); if ( sym == lparen) // first char in ActParams { ActParams(); // don't call nextsym here since '(' part of ActParams } if ( debugMode) printf( "Out ProcCall\n"); }
/** * Recursive descent subprogram for the following EBNF rule: * * <initializer> -> "{" <designator> { <designator> } = <expression> "}" */ void initializer() { if (nextToken == "{") { lex(); while (nextToken != "=") { designator(); } lex(); expression(); if (nextToken == "}") { lex(); } else { error(); } } else { error(); } }
void Node::parseAll() { n(); dn(); d2n(); i(); Omega(); omega(); M(); e(); bstar(); satelliteNumber(); satelliteName(); designator(); classification(); ephemerisType(); elementNumber(); revolutionNumber(); preciseEpoch(); }
std::string Node::secondString() const { std::string res = "1 "; res += string2string(satelliteNumber(), 5); const char cl = classification(); res += (isprint(cl) ? std::string(1, cl) : " ") + " "; res += string2string(designator(), 8) + " "; res += date2string(preciseEpoch(), 14) + " "; res += double2string(dn(), 10, 8, false, false, false) + " "; res += double2string(d2n(), 8, 3, true, true, false) + " "; res += double2string(bstar(), 8, 3, true, true, false) + " "; const char eph = ephemerisType(); res += (isprint(eph) ? std::string(1, eph) : " ") + " "; res += int2string(elementNumber(), 4, false); // Checksum int sum = checksum(res); res += int2string(sum, 1); return res; }
TAO_EC_Filter* TAO_EC_Kokyu_Filter_Builder::build ( TAO_EC_ProxyPushSupplier *supplier, RtecEventChannelAdmin::ConsumerQOS& qos) const { CORBA::ULong i=0,found=0; CORBA::ULong pos = 0; CORBA::Long npos = -1; int establish_final_consumer_dependency=0; CORBA::Object_var tmp = this->event_channel_->scheduler (); RtecScheduler::Scheduler_var scheduler = RtecScheduler::Scheduler::_narrow (tmp.in ()); #ifdef EC_KOKYU_LOGGING for (i=0; i<qos.dependencies.length (); ++i) { ORBSVCS_DEBUG ((LM_DEBUG, "consumerqos[%d] event.header.type = %s," "rt_info = %d\n", i, designator (qos.dependencies[i].event.header.type), qos.dependencies[i].rt_info)); } #endif //find the first entry which is not a designator. We are going to //assume that this entry will have the rt_info of the connecting //consumer (ProxyPushSupplier), which is passed into this function. for (i=0; !found && i<qos.dependencies.length (); ++i) { switch (qos.dependencies[i].event.header.type) { case ACE_ES_CONJUNCTION_DESIGNATOR: case ACE_ES_DISJUNCTION_DESIGNATOR: case ACE_ES_NEGATION_DESIGNATOR: case ACE_ES_LOGICAL_AND_DESIGNATOR: case ACE_ES_BITMASK_DESIGNATOR: case ACE_ES_MASKED_TYPE_DESIGNATOR: case ACE_ES_NULL_DESIGNATOR: establish_final_consumer_dependency = 1; continue; case ACE_ES_GLOBAL_DESIGNATOR: case ACE_ES_EVENT_TIMEOUT: case ACE_ES_EVENT_INTERVAL_TIMEOUT: case ACE_ES_EVENT_DEADLINE_TIMEOUT: continue; default: npos = i; found = 1; break; } } ACE_CString final_consumer_rep_name; RtecScheduler::handle_t h_final_consumer_rt_info = 0; RtecScheduler::handle_t h_final_consumer_rep_rt_info = 0; #ifdef EC_KOKYU_LOGGING ORBSVCS_DEBUG ((LM_DEBUG, "consumer rt_info found in consumerqos[%d]\n", npos)); #endif if (npos >= 0 && establish_final_consumer_dependency == 1) { //Hopefully this will have the final consumer's rt_info h_final_consumer_rt_info = qos.dependencies[npos].rt_info; #ifdef EC_KOKYU_LOGGING ORBSVCS_DEBUG ((LM_DEBUG, "about to get rt_info = %d\n", h_final_consumer_rep_rt_info)); #endif RtecScheduler::RT_Info_var final_consumer_rt_info = scheduler->get ( h_final_consumer_rt_info); final_consumer_rep_name = final_consumer_rt_info->entry_point.in (); final_consumer_rep_name += "#rep"; #ifdef EC_KOKYU_LOGGING ORBSVCS_DEBUG ((LM_DEBUG, "about to create consumer rep %s\n", final_consumer_rep_name.c_str ())); #endif //create an rt_info corresponding to this rep. h_final_consumer_rep_rt_info = scheduler->create (final_consumer_rep_name.c_str ()); #ifdef EC_KOKYU_LOGGING ORBSVCS_DEBUG ((LM_DEBUG, "consumer rep created\n")); #endif } //We are passing the final consumer as the parent. The final //consumer is the one which is connecting to the ProxyPushSupplier //passed in to this function. TAO_EC_Filter* filter = this->recursive_build (supplier, qos, pos, scheduler.in (), h_final_consumer_rep_rt_info //parent_info ); #ifdef EC_KOKYU_LOGGING ORBSVCS_DEBUG ((LM_DEBUG, "Filter_Builder::Verifying whether root filter" " dependency can be established\n")); #endif if (npos >= 0 && establish_final_consumer_dependency == 1) { #ifdef EC_KOKYU_LOGGING ORBSVCS_DEBUG ((LM_DEBUG, "Filter_Builder::root filter dependency " "can be established\n")); #endif TAO_EC_Kokyu_Filter* kokyu_filter = dynamic_cast<TAO_EC_Kokyu_Filter*> (filter); //add the dependency between the root in the filter hierarchy and //the final consumer TAO_EC_QOS_Info qos_info; kokyu_filter->get_qos_info (qos_info); scheduler->add_dependency (h_final_consumer_rt_info, qos_info.rt_info, 1, RtecBase::ONE_WAY_CALL); } return filter; }