.NET Framework Bookmark and Share   
 index > Microsoft Codename 'Oslo' > Any Conditionals, Tracing or Debug features in MGrammar?
 

Any Conditionals, Tracing or Debug features in MGrammar?

Are there any conditionals or debug features in MGrammar?

Are there any features that can help me with tracing the execution of the Parser easily?

Without such features, how do I easily trace the evaluation of the MGrammar to find a bug in the MGrammar specification or evaluation?

What would be very useful would be some trace printout actions that I can optionally activate with some simple switch, like "#debug=1". When the conditional switch is turned on, then the optional trace statements would be executed, otherwise not executed.

With a conditional switch(s) in the MGrammar I can instrument my MGrammar to display the data I need when debug is required.




DonBaechtel
We are working on debug features, but there's nothing in the PDC release that helps except to take subsets of the grammar and use different instances of ipad.exe.

We hope to make this much easier in the future.
-- pinky --/ http://www.tinyfinger.com/
  • Marked As Answer byDonBaechtel Saturday, January 17, 2009 6:48 PM
  •  
the Pinky
We are working on debug features, but there's nothing in the PDC release that helps except to take subsets of the grammar and use different instances of ipad.exe.

We hope to make this much easier in the future.
-- pinky --/ http://www.tinyfinger.com/
  • Marked As Answer byDonBaechtel Saturday, January 17, 2009 6:48 PM
  •  
the Pinky
The need is to be able to trace the progress of the parser through the rules in the case where input is improperly parsed, the parsing fails or the parser indicates that there is more than one possible output. In these cases, more spcific information is required by the developer in order to locate the problem in the syntax specification or to get more insight into how the Parser is interpreting the syntax rules.

Sometimes this is done by instrumenting the syntax specification to theparser to conditionally generate additional information in the parser output, and then activate a conditional switch that will enable the optional content. Sometimes it is done by having the parser generate an additional file that shows the input tokens and the syntax rules that have been matched along the way.

It would be very helpful if there was some way of relating the parser's progress with a specific rule in the Mg file. This would require that each rule be uniquely identified, perhaps by using source file line numbers or by printing out the entire rule that was matched.
DonBaechtel
I have developed one: http://sixpairs.com --> MGrammar Debugger

The screencast is a bit stale (as I made lots of amendments since its recording), but it gives an overall idea.

I also posted it here as well but there wasn't much interest in it:
http://social.msdn.microsoft.com/Forums/en-US/oslo/thread/98b26da3-6a86-40fd-a26f-8932e261e9fd

-Ceyhun
Ceyhun Ciper

You can use google to search for other answers

Custom Search

More Threads

• timestamp columns
• Getting rid of the extra { }
• Oslo and the DSL Toolkit
• Why not a constraint solver in Oslo
• MGrammar projections: numbers without inverted commas
• Produce Line Numbers in output
• Error: Expected one token, but found many
• Grammar with lots of freeform text
• Inconsistent output of parsed DSL
• Correct MGrammar projection for lists