Re[2]: [cedet-semantic] Debugging EXPANDFULL rules.
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2004-02-17 17:20:57
|
>>> David PONCE <dav...@wa...> seems to think that: >> | id COLON type_or_nonempty_type_or_type_plus from_typeexpr_opt >> (let ((variables (cons $1 my-theoryformal-idops)) >> (result (VARIABLE-TAG variables $3 nil))) >> (message "%S:%S %S" $1 $3 $4) >> (message "variables = %S" variables) >> (message "result = %S" result) >> (setq my-theoryformal-idops nil) >> result) >> | id COLON typeexpr >> (let ((variables (cons $1 my-theoryformal-idops)) >> (result (VARIABLE-TAG variables $3 nil))) >> (message "%S:%S" $1 $3) >> (message "variables = %S" variables) >> (message "result = %S" result) >> (setq my-theoryformal-idops nil) >> result) >> | opsym COLON typeexpr >> (let ((variables (cons $1 my-theoryformal-idops)) >> (result (VARIABLE-TAG variables $3 nil))) >> (message "%S:%S" $1 $3) >> (message "variables = %S" variables) >> (message "result = %S" result) >> (setq my-theoryformal-idops nil) >> result) > >It looks that the `let' statements above have to be `let*' because >the value of `variables' is used to compute the value of `result'. > >IMO the `let' clauses above fail with a "(void-variable variables)" >error which is probably masked by a `condition-case' at a upper level >in semantic code. [ ... ] I have long wondered how to handle situations like this. I went this route because it allowed a user to throw complete garbage at a parser, and the parser would live through it. This lets you allow parsing to be pervasive in -hooks, -functions, and utilities that would suffer if the parser threw an error because some esoteric file the user doesn't care about got on some list. On the other hand, it makes development tricky if you don't know what to look for. I went for option 1 as I knew the tricks to find problems. In Emacs, you cannot hook into the debug system yourself. Perhaps when a compiler is made from a .wy or .by buffer with C-c C-c or a derivation, it could create it in some sort of instrumented fashion that allows errors to propagate out of the system more easily. For example, when an action is executed, instrumentation would make note of it's location, and errors would be caught jumping the developer to the correct buffer location. Eric -- Eric Ludlam: za...@gn..., er...@si... Home: http://www.ludlam.net Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net GNU: www.gnu.org |