Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
guidelines:adding_gamebots_message_to_pogamut_java [2012/02/07 17:47]
martin.cerny
guidelines:adding_gamebots_message_to_pogamut_java [2012/02/07 17:50] (current)
martin.cerny
Line 250: Line 250:
 ===== Extending the Yylex parser ===== ===== Extending the Yylex parser =====
  
-The built in parser is created by JFlex and has a rather nasty internals. ​Unless ​you are trying to achieve something special, you will not need to look into it. Whenever the built-int parser encounters a message name it does not recognize, it calls protected method ''​tryParsingUnprocessedMessage''​ if it returns a message instance, the parser treats the message as recognized and passes all subsequent parameters of the message to ''​tryParsingUnprocessedMessageParameter''​ method. Note that, by design of gamebots protocol, all parameters are optional, so you cannot rely on the fact that all message parameters will be set, neither can you rely on the order of the parameters. Once the parser encounters the end of a message, it sends the message object as is for further processing (usually to the WorldView).+The built in parser is created by JFlex and has a rather nasty internals. ​However, unless ​you are trying to achieve something special, you will not need to look into it. Whenever the built-int parser encounters a message name it does not recognize, it calls protected method ''​tryParsingUnprocessedMessage''​ if it returns a message instance, the parser treats the message as recognized and passes all subsequent parameters of the message to ''​tryParsingUnprocessedMessageParameter''​ method. Note that, by design of gamebots protocol, all parameters are optional, so you cannot rely on the fact that all message parameters will be set, neither can you rely on the order of the parameters. Once the parser encounters the end of a message, it sends the message object as is for further processing (usually to the WorldView).
  
 An example parser, that allows to parse the above message follows: An example parser, that allows to parse the above message follows:
guidelines/adding_gamebots_message_to_pogamut_java.txt · Last modified: 2012/02/07 17:50 by martin.cerny