From: Mike B. <mi...@bo...> - 2007-08-27 16:05:16
|
I don't think there was any rationale for the single global callback function except that it kept things simple at first. Now that the program is much more sophisticated, I think that multiple callbacks would be fine. The #exit directive seems useful as well. Thanks, Mike Michael Geng wrote: > Hi Mike, > > In the genparse info file in the description of the global functions I found: > "Only 1 global callback function is allowed." In the example in the info pages > I found "There may be more than one global callback - all will be called in > the parser function." > > I do not remember if I was the one who wrote that only 1 global callback > function is allowed - but that's how I always thought about it. Is there a > reason for more than 1 global callback function? The user can program what > he wants in that callback function, he can of course also call other > functions from there if he likes. > > ---------------------- > > Another topic: I'm proposing to add an #exit_value macro to the list of > possible global definitions in the genparse file. For example > > #exit_value -2 > > in case of a failure the generated parser would then call exit(-2). > > Or with > > #exit_value MY_EXIT_CODE > > the program would call exit(MY_EXIT_CODE) which makes sense if MY_EXIT_CODE > is defined in one of the include files. > > Michael > -- Mike Borella http://www.borella.net/mike |