From: Tom H. <tom...@us...> - 2003-03-19 18:59:45
|
Update of /cvsroot/rccparser/rccparser/src In directory sc8-pr-cvs1:/tmp/cvs-serv7331/src Modified Files: rcclexer.lpp rccparse.ypp rccparser.h Log Message: 2003-03-19 Tom Howard <tom...@us...> * ./src/rcclexer.lpp * ./src/rccparse.ypp * ./src/rccparser.h More docs added. V8 Player audios no longer call redundant side functions Index: rcclexer.lpp =================================================================== RCS file: /cvsroot/rccparser/rccparser/src/rcclexer.lpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rcclexer.lpp 14 Feb 2003 11:50:10 -0000 1.6 --- rcclexer.lpp 19 Mar 2003 18:40:31 -0000 1.7 *************** *** 151,154 **** --- 151,158 ---- free_kick_fault_l { return FREE_KICK_FAULT_LEFT_KW; } free_kick_fault_r { return FREE_KICK_FAULT_RIGHT_KW; } + catch_fault_l { return CATCH_FAULT_LEFT_KW; } + cacth_fault_r { return CATCH_FAULT_RIGHT_KW; } + indirect_free_kick_l { return INDIRECT_FREE_KICK_LEFT_KW; } + indirect_free_kick_r { return INDIRECT_FREE_KICK_RIGHT_KW; } penalty_setup_l { return PENALTY_SETUP_LEFT_KW; } penalty_setup_r { return PENALTY_SETUP_RIGHT_KW; } Index: rccparse.ypp =================================================================== RCS file: /cvsroot/rccparser/rccparser/src/rccparse.ypp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rccparse.ypp 14 Feb 2003 11:50:10 -0000 1.8 --- rccparse.ypp 19 Mar 2003 18:40:32 -0000 1.9 *************** *** 237,240 **** --- 237,244 ---- %token FREE_KICK_FAULT_LEFT_KW %token FREE_KICK_FAULT_RIGHT_KW + %token CATCH_FAULT_LEFT_KW + %token CATCH_FAULT_RIGHT_KW + %token INDIRECT_FREE_KICK_LEFT_KW + %token INDIRECT_FREE_KICK_RIGHT_KW %token PENALTY_SETUP_LEFT_KW %token PENALTY_SETUP_RIGHT_KW *************** *** 433,436 **** --- 437,448 ---- | FREE_KICK_FAULT_RIGHT_KW { PARAM.buildFreeKickFaultRightPlayMode(); } + | CATCH_FAULT_LEFT_KW + { PARAM.buildCatchFaultLeftPlayMode(); } + | CATCH_FAULT_RIGHT_KW + { PARAM.buildCatchFaultRightPlayMode(); } + | INDIRECT_FREE_KICK_LEFT_KW + { PARAM.buildIndirectFreeKickLeftPlayMode(); } + | INDIRECT_FREE_KICK_RIGHT_KW + { PARAM.buildIndirectFreeKickRightPlayMode(); } | PENALTY_SETUP_LEFT_KW { PARAM.buildPenaltySetupLeftPlaymode(); } *************** *** 1290,1299 **** getString( $5 ) ); } ! | LP HEAR_KW INT REAL side QSTR RP { PARAM.buildPlayerAudio( getInt( $3 ), getDouble( $4 ), getString( $6 ) ); } ! | LP HEAR_KW INT REAL side INT QSTR RP { PARAM.buildPlayerAudio( getInt( $3 ), getDouble( $4 ), --- 1302,1311 ---- getString( $5 ) ); } ! | LP HEAR_KW INT REAL OPP_KW QSTR RP { PARAM.buildPlayerAudio( getInt( $3 ), getDouble( $4 ), getString( $6 ) ); } ! | LP HEAR_KW INT REAL OUR_KW INT QSTR RP { PARAM.buildPlayerAudio( getInt( $3 ), getDouble( $4 ), *************** *** 1301,1309 **** getString( $7 ) ); } ! | LP HEAR_KW INT side RP { PARAM.buildPlayerAudio( getInt( $3 ) ); } ! | LP HEAR_KW INT side INT RP { PARAM.buildPlayerAudio( getInt( $3 ), --- 1313,1321 ---- getString( $7 ) ); } ! | LP HEAR_KW INT OPP_KW RP { PARAM.buildPlayerAudio( getInt( $3 ) ); } ! | LP HEAR_KW INT OUR_KW INT RP { PARAM.buildPlayerAudio( getInt( $3 ), Index: rccparser.h =================================================================== RCS file: /cvsroot/rccparser/rccparser/src/rccparser.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** rccparser.h 14 Feb 2003 11:50:10 -0000 1.27 --- rccparser.h 19 Mar 2003 18:40:34 -0000 1.28 *************** *** 550,553 **** --- 550,569 ---- void + buildCatchFaultLeftPlayMode() + { M_parser.doBuildCatchFaultLeftPlayMode(); } + + void + buildCatchFaultRightPlayMode() + { M_parser.doBuildCatchFaultRightPlayMode(); } + + void + buildIndirectFreeKickLeftPlayMode() + { M_parser.doBuildIndirectFreeKickLeftPlayMode(); } + + void + buildIndirectFreeKickRightPlayMode() + { M_parser.doBuildIndirectFreeKickRightPlayMode(); } + + void buildPenaltySetupLeftPlaymode() { M_parser.doBuildPenaltySetupLeftPlaymode(); } *************** *** 3024,3027 **** --- 3040,3059 ---- virtual void + doBuildCatchFaultLeftPlayMode() {} + + virtual + void + doBuildCatchFaultRightPlayMode() {} + + virtual + void + doBuildIndirectFreeKickLeftPlayMode() {} + + virtual + void + doBuildIndirectFreeKickRightPlayMode() {} + + virtual + void doBuildPenaltySetupLeftPlaymode() {} *************** *** 6689,6700 **** --- 6721,6787 ---- //! \name Coach Visual Parsing Functions //@{ + /** This function is called after parsing a coach visual message. + * + * Override this function in your subclass to handle coach visual + * messages. + * + * \param time The time (in server cycles) that the coach visual + * message was sent by the simulator. + * + * \pre The client is a coach player. + * + * \pre An entire coach visual message has been parsed. + * + */ virtual void doBuildGlobalVisual( int time ) {} + /** This function is called after parsing a goal section + * of a coach visual message. + * + * Override this function in your subclass to handle goal + * sections of a coach visual message. + * + * \param x The x co-ordinate of the goal. + * \param y The y co-ordinate of the goal. + * + * \pre The client is a coach. + * + * \pre An entire goal section of coach visual message has + * been parsed. + * + * \pre A coach visual message is being parsed. + * + * \sa + * - doBuildGlobalVisual( int time ) + */ virtual void doBuildGlobalGoal( double x, double y ) {} + /** This function is called after parsing a ball section + * of a coach visual message. + * + * Override this function in your subclass to handle ball + * sections of a coach visual message. + * + * \param x The x co-ordinate of the ball. + * \param y The y co-ordinate of the ball. + * \param delta_x The magnitude of the ball's velociy along the + * x co-ordinate. + * \param delta_y The magnitude of the ball's velociy along the + * y co-ordinate. + * + * \pre The client is a coach. + * + * \pre An entire ball section of coach visual message has + * been parsed. + * + * \pre A coach visual message is being parsed. + * + * \sa + * - doBuildGlobalVisual( int time ) + */ virtual void *************** *** 6702,6705 **** --- 6789,6825 ---- double delta_x, double delta_y ) {} + /** This function is called after parsing a player section + * of a coach visual message, where the player is pointing. + * + * Override this function in your subclass to handle pointing player + * sections of a coach visual message. + * + * \note This function deprecates doBuildGlobalPlayer( x, y, + delta_x, delta_y, + orientation, head_orientation ). + * + * \param x The x co-ordinate of the player. + * \param y The y co-ordinate of the player. + * \param delta_x The magnitude of the player's velociy along the + * x co-ordinate. + * \param delta_y The magnitude of the player's velociy along the + * y co-ordinate. + * \param orientation The direction the player's body is facing. + * \param head_orientation The direction the player's head is facing. + * \param point_dir The direction the player is pointing in. + * \param tackle True if the player is tackling. False otherwise. + * + * \pre The player is pointing. + * + * \pre The client is a coach. + * + * \pre An entire player section of coach visual message has + * been parsed. + * + * \pre A coach visual message is being parsed. + * + * \sa + * - doBuildGlobalVisual( int time ) + */ virtual void *************** *** 6714,6717 **** --- 6834,6869 ---- } + /** This function is called after parsing a non-pointing player section + * of a coach visual message. + * + * Override this function in your subclass to handle non-pointing player + * sections of a coach visual message. + * + * \note This function deprecates doBuildGlobalPlayer( x, y, + delta_x, delta_y, + orientation, head_orientation ). + * + * \param x The x co-ordinate of the player. + * \param y The y co-ordinate of the player. + * \param delta_x The magnitude of the player's velociy along the + * x co-ordinate. + * \param delta_y The magnitude of the player's velociy along the + * y co-ordinate. + * \param orientation The direction the player's body is facing. + * \param head_orientation The direction the player's head is facing. + * \param tackle True if the player is tackling. False otherwise. + * + * \pre The player is not pointing. + * + * \pre The client is a coach. + * + * \pre An entire player section of coach visual message has + * been parsed. + * + * \pre A coach visual message is being parsed. + * + * \sa + * - doBuildGlobalVisual( int time ) + */ virtual void *************** *** 6727,6731 **** ! // kept for src compatibility virtual void --- 6879,6917 ---- ! /** This function is called after parsing a player section ! * of a coach visual message. ! * ! * Override this function in your subclass to handle player ! * sections of a coach visual message. ! * ! * \warning This function deprecated. Use ! doBuildGlobalPlayer( double x, double y, ! double delta_x, double delta_y, ! double orientation, double head_orientation, ! double point_dir, bool tackle ) and ! doBuildGlobalPlayer( double x, double y, ! double delta_x, double delta_y, ! double orientation, double head_orientation, ! bool tackle ) instead. ! * ! * \param x The x co-ordinate of the player. ! * \param y The y co-ordinate of the player. ! * \param delta_x The magnitude of the player's velociy along the ! * x co-ordinate. ! * \param delta_y The magnitude of the player's velociy along the ! * y co-ordinate. ! * \param orientation The direction the player's body is facing. ! * \param head_orientation The direction the player's head is facing. ! * ! * \pre The client is a coach. ! * ! * \pre An entire player section of coach visual message has ! * been parsed. ! * ! * \pre A coach visual message is being parsed. ! * ! * \sa ! * - doBuildGlobalVisual( int time ) ! */ virtual void *************** *** 6767,6794 **** --- 6953,7073 ---- doBuildFlagOffset( int offset ) {} + + /** This function is called after parsing a top location of + * a field object or a visual + * + * Override this function in your subclass to handle top + * field locations. + * + * \pre A top loation of a field object has been parsed. + * + * \pre A field object is being parsed. + * + * \pre A a visual message is being parsed. + * + */ virtual void doBuildTopLocation() {} + + /** This function is called after parsing a bottom location of + * a field object or a visual + * + * Override this function in your subclass to handle bottom + * field locations. + * + * \pre A bottom loation of a field object has been parsed. + * + * \pre A field object is being parsed. + * + * \pre A a visual message is being parsed. + * + */ virtual void doBuildBottomLocation() {} + /** This function is called after parsing a left location of + * a field object or a visual + * + * Override this function in your subclass to handle left + * field locations. + * + * \pre A left loation of a field object has been parsed. + * + * \pre A field object is being parsed. + * + * \pre A a visual message is being parsed. + * + */ virtual void doBuildLeftLocation() {} + /** This function is called after parsing a right location of + * a field object or a visual + * + * Override this function in your subclass to handle right + * field locations. + * + * \pre A right loation of a field object has been parsed. + * + * \pre A field object is being parsed. + * + * \pre A a visual message is being parsed. + * + */ virtual void doBuildRightLocation() {} + /** This function is called after parsing a center location of + * a field object or a visual + * + * Override this function in your subclass to handle center + * field locations. + * + * \pre A center loation of a field object has been parsed. + * + * \pre A field object is being parsed. + * + * \pre A a visual message is being parsed. + * + */ virtual void doBuildCenterLocation() {} + /** This function is called after parsing a penalty location of + * a field object or a visual + * + * Override this function in your subclass to handle penalty + * field locations. + * + * \pre A penalty loation of a field object has been parsed. + * + * \pre A field object is being parsed. + * + * \pre A a visual message is being parsed. + * + */ virtual void doBuildPenaltyLocation() {} + /** This function is called after parsing a goal location of + * a field object or a visual + * + * Override this function in your subclass to handle goal + * field locations. + * + * \pre A goal loation of a field object has been parsed. + * + * \pre A field object is being parsed. + * + * \pre A a visual message is being parsed. + * + */ virtual void *************** *** 6796,6811 **** --- 7075,7120 ---- //@} + /** This function is called after parsing a team name. + * + * Override this function in your subclass to handle team names. + * + * \pre A team name has been parsed. + * + */ virtual void doBuildTeamName( const std::string& name ) {} + /** This function is called after parsing a uniform number. + * + * Override this function in your subclass to handle uniform numbers. + * + * \pre A uniform number has been parsed. + * + */ virtual void doBuildUNum( int unum ) {} + /** This function is called after parsing a goalie indicator of a + * player name. + * + * Override this function in your subclass to handle goalie + * indicators. + * + * \pre A goalie inidicator has been parsed. + * + */ virtual void doBuildGoalie() {} + /** This function is called after parsing a score message + * + * Override this function in your subclass to handle score messages + * + * \pre An entire score message has been parsed. + * + */ virtual void *************** *** 6815,6826 **** --- 7124,7165 ---- //! \name Initialisation Parsing Functions //@{ + /** This function is called after parsing a player init message + * + * Override this function in your subclass to handle player + * init messages + * + * \pre The client is a field player + * + * \pre An entire player init message has been parsed. + * + */ virtual void doBuildInit( int unum ) {} + /** This function is called after parsing an online coach init message + * + * Override this function in your subclass to handle player + * online coach init messages + * + * \pre The client is an online coach + * + * \pre An entire online coach init message has been parsed. + * + */ virtual void doBuildInit() {} + /** This function is called after parsing an offline coach init message + * + * Override this function in your subclass to handle player + * offline coach init messages + * + * \pre The client is an offline coach + * + * \pre An entire offline coach init message has been parsed. + * + */ virtual void *************** *** 6832,6859 **** --- 7171,7280 ---- //! \name Audio Parsing Functions //@{ + /** This function is called after parsing an offline coach or + * non-CLang online coach audio message + * + * Override this function in your subclass to handle offline or + * non-CLang online coach audio messages. + * + * \pre An entire offline coach or non-Clang online coach audio + * message has been parsed. + * + */ virtual void doBuildCoachAudio( int time, const std::string& msg ) {} + /** This function is called after parsing a non-goal referee message + * + * Override this function in your subclass to handle non-goal referee + * messages. + * + * \pre An entire non-goal referee message has been parsed. + * + */ virtual void doBuildRefAudio( int time ) {} + /** This function is called after parsing a goal referee message + * + * Override this function in your subclass to handle goal referee + * messages. + * + * \pre An entire goal referee message has been parsed. + * + */ virtual void doBuildGoalRefAudio( int time, int score ) {} + /** This function is called after parsing an unknown referee message. + * This will normally only be called if new referee messages have + * been added to the simulator, but not to this parser. By using + * this function you can provide support in your team for the new + * messages without having to wait for the parser to be updated. + * + * Override this function in your subclass to handle unknown referee + * messages. + * + * \pre An entire unknown referee message has been parsed. + * + */ virtual void doBuildUnknownRefAudio( int time, const std::string& message ) {} + /** This function is called after parsing a version 7 player audio + * message or a version 8 opponent player audio message, where + * the client is a field player. + * + * Override this function in your subclass to handle version 7 player + * audio or version 8 opponent player audio messages. + * + * \pre The client is a field player + * + * \pre Either: + * - The client is using protocol version 7, or + * - The audio message is from an opponent + * + * \pre An entire version 7 player audio or version 8 opponent player + * audio message has been parsed. + * + */ virtual void doBuildPlayerAudio( int time, double dir, const std::string& msg ) {} + /** This function is called after parsing a player audio message, + * where the client is an online coach. + * + * Override this function in your subclass to player audio + * messages to online coaches + * + * \pre The client is an online coach + * + * \pre An entire player audio message has been parsed. + * + */ virtual void doBuildPlayerAudio( int time, const std::string& msg ) {} + /** This function is called after parsing a version 8 team-mate + * player audio message, where the client is a field player. + * + * Override this function in your subclass to handle version 8 + * team-mate player audio messages. + * + * \pre The client is a field player + * + * \pre The client is using protocol version 8 + * + * \pre The message is from a team-mate + * + * \pre An entire version 8 team-mate player audio message has + * been parsed. + * + */ virtual void *************** *** 6861,6872 **** --- 7282,7344 ---- const std::string& msg ) {} + /** This function is called after parsing a version 8 team-mate + * player audio message, where the client is a field player and + * the client has already received a team-mate player audio message + * this cycle + * + * Override this function in your subclass to handle version 8 + * incomplete team-mate player audio messages. + * + * \pre The client is a field player + * + * \pre The client is using protocol version 8 + * + * \pre The message is from a team-mate + * + * \pre An entire version 8 incomplete team-mate player audio + * message has been parsed. + * + */ virtual void doBuildPlayerAudio( int time, int unum ) {} + /** This function is called after parsing a version 8 opponent + * player audio message, where the client is a field player and + * the client has already received an opponent player audio message + * this cycle + * + * Override this function in your subclass to handle version 8 + * incomplete opponent player audio messages. + * + * \pre The client is a field player + * + * \pre The client is using protocol version 8 + * + * \pre The message is from an opponent + * + * \pre An entire version 8 incomplete opponent player audio + * message has been parsed. + * + */ virtual void doBuildPlayerAudio( int time ) {} + /** This function is called after parsing a player audio message, + * where the client is a field player and the message was sent by + * the client. + * + * Override this function in your subclass to handle self player audio + * messages + * + * \pre The client is a field player + * + * \pre The message is from the client + * + * \pre An entire self player audio + * message has been parsed. + * + */ virtual void *************** *** 6878,6885 **** --- 7350,7385 ---- //! \name Substitution Parsing Functions //@{ + /** This function is called after parsing a substitutution message, + * where the player being sub'ed is a team-mate + * + * Override this function in your subclass to handle team-mate + * substitution messages. + * + * \pre The client is a field player + * + * \pre A team-mate has been substituted. + * + * \pre An entire team-mate substitution + * message has been parsed. + * + */ virtual void doBuildSubstitution( int unum, int type ) {} + /** This function is called after parsing a substitutution message, + * where the player being sub'ed is an opponent + * + * Override this function in your subclass to handle opponent + * substitution messages. + * + * \pre The client is a field player + * + * \pre An opponent has been substituted. + * + * \pre An entire opponent substitution + * message has been parsed. + * + */ virtual void *************** *** 6891,6930 **** --- 7391,7604 ---- //! \name Error Parsing Functions //@{ + /** This function is called after parsing a can't reconnect error + * message. + * + * Override this function in your subclass to handle can't reconnect + * error messages. + * + * \pre The client is a field player + * + * \pre The client has sent a reconnect message. + * + * \pre The server is in play-on playmode + * + * \pre An entire can't reconnect error + * message has been parsed. + * + */ virtual void doBuildCantReconnect() {} + /** This function is called after parsing a reconnection error + * message. + * + * Override this function in your subclass to handle reconnection + * error messages. + * + * \pre The client is a field player + * + * \pre The client has sent a reconnect message. + * + * \pre Either: + * - There was an error in the reconnect message, + * - There was an error connecting to the clients socket, or + * - The team-name and uniform number do not match any + * field player + * + * \pre An entire reconnection error + * message has been parsed. + * + */ virtual void doBuildInitError() {} + /** This function is called after parsing a player initialisation error + * message. + * + * Override this function in your subclass to handle player initialisation + * error messages. + * + * \pre The client is a field player + * + * \pre The client has sent an init message. + * + * \pre Either: + * - There was an error in the init message, + * - There were illegal characters in the team-name, + * - The team-name was too long, + * - There are two teams already connected and the team-name + * matched neither, + * - There are already 11 players connected for the team + * specified, + * - The client tried to connect as a goalie and the team + * specified already has a goalie connected, + * - The client tried to connect with a non-existant protocol + * version, or + * - There was an error connecting to the clients socket. + * + * \pre An entire player initialisation error + * message has been parsed. + * + */ virtual void doBuildNoMoreTeamOrPlayerOrGoalieError() {} + /** This function is called after parsing an online coach + * initialisation error message. + * + * Override this function in your subclass to handle online coach + * initialisation error messages. + * + * \pre The client is an online coach. + * + * \pre The client has sent an init message. + * + * \pre Either: + * - There was an error in the init message, + * - The version number specified was less than 5, + * - The team-name specified was too long, + * - The team-name specified does not match any team that is + * connected, + * - The specified team already has a coach connected, + * - The client tried to connect with a non-existant protocol + * version, or + * - There was an error connecting to the clients socket. + * + * \pre An entire coach initialisation error + * message has been parsed. + * + */ virtual void doBuildNoSuchTeamOrAlreadyHaveCoachError() {} + /** This function is called after parsing a too many moves error message. + * + * Override this function in your subclass to handle too many moves + * error messages. + * + * \pre The client is a field player. + * + * \pre The client is a goalie. + * + * \pre The client has caught the ball. + * + * \pre The client has already moved the prescribed maximum amount of + * times while the ball is caught and another move command was + * sent. + * + * \pre An entire too many moves error + * message has been parsed. + * + */ virtual void doBuildTooManyMovesError() {} + /** This function is called after parsing an unknown command error message. + * + * Override this function in your subclass to handle unknown command + * error messages. + * + * \pre The client has send a command that the server does not + * recognise + * + * \pre An entire unknown commad error + * message has been parsed. + * + */ virtual void doBuildUnknownCommandError() {} + /** This function is called after parsing an illegal command form error message. + * + * Override this function in your subclass to handle illegal command form + * error messages. + * + * \pre The client has sent a command whoes format does not match + * that expected by the server + * + * \pre An entire illegal command form error + * message has been parsed. + * + */ virtual void doBuildIllegalCommandError() {} + /** This function is called after parsing a say too long error message. + * + * Override this function in your subclass to handle say too long + * error messages. + * + * \pre The client has sent a say command and the message is longer than those prescribed by the server. + * + * \pre An entire say too long error + * message has been parsed. + * + */ virtual void doBuildSayMessageTooLongError() {} + /** This function is called after parsing an illegal mode error + * message. + * + * Override this function in your subclass to handle illegal mode + * error messages. + * + * \pre The client is an offline coach + * + * \pre The client has sent a change_mode message with a playmode + * of PM_Null + * + * \pre An entire illegal mode + * message has been parsed. + * + */ virtual void doBuildIllegalModeError() {} + /** This function is called after parsing an illegal object form error + * message. + * + * Override this function in your subclass to handle illegal object + * form error messages. + * + * \pre The client is an offline coach + * + * \pre The client has sent a move message, where the the name of the + * object to be moved is not in the format expected by the + * server. + * + * \pre An entire illegal object form + * message has been parsed. + * + */ virtual void |