Author: Dieter Buerssner
Date: 16:16:39 08/21/02
Go up one level in this thread
On August 21, 2002 at 19:05:44, Dann Corbit wrote: >The protocol and parser I suggest does not solve that problem. It solves the >problem of: >Someone sent me a string. What does it mean? >Answer from parser: >Perform command x with parameters a, b, c >So parser calls: >x(a,b,c); >You still have to write the callback. And your engine has to know how to handle >the callback. Dann, isn't this trivial without a yacc/lex parser? In WB, a line from the GUI is either a move, a command, or something unknown. On can loop (or if/else if/...)over a list of strings, that's all. You know my implementation, which actually uses callbacks. It is only rather few lines of code. One could make it fancier - for example as you suggested by ordering the strings and doing a binary search. Or even hashing the strings (easy at least when one does not allow abbrevations and/or case insensitivity). I think lex/yacc for this would be overkill, and actually more work than a straightforward implementation in high level language. Regards, Dieter
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.