I want to explore the objects in the compiler interactively rather than imagining what their values are by interpreting the code, or sprinkling print/trace statements here and there. Consequently, I've added a WinForms window that let's one browse through the compiler, modules, namespaces, declarations, statements, expressions, etc. These are .NET objects, so what you're seeing are their properties (names and values). For properties that have complex values (e.g., another interesting kind of object), you can drill down via the tree view.
You can use this out of a workspace. See http://cobra-language.com/source/ on how to get one.
In CobraWorkspace\Source, use "win-comp" to build and "cobra-win hello.cobra" to run.
See WinFormsExplorer.cobra for doc string and implementation.
It's not very impressive yet as I just got started today, but once we knock out the TO DO items in the doc string, I think it will be very useful. Also, it's fairly generic right now. It might be possible to break it out as a general tool.
-Chuck
Forums
Cobra Compiler WinForms Explorer
4 posts
• Page 1 of 1
Re: Cobra Compiler WinForms Explorer
I've made the following improvements:
Tree view on the left:
-- Sort the properties alphabetically.
-- Display the contents of lists.
-- Display the contests of dictionaries.
-- Add the CommandLine instance.
Details view on the right:
-- Show the type, serial number and name of the currently chosen object.
Other:
-- Add the current navigation path to the top of the form.
-- Added new button strip with: Copy, Next, Quit, Reset
-- Fix window positioning.
-- Minor fixes.
-- Refactor code: break out ObjectExplorer
-- Code cleanup.
Although the Object Explorer is quite capable now, I think having a search capability is going to be key to making this a productive tool. Forthcoming.
Tree view on the left:
-- Sort the properties alphabetically.
-- Display the contents of lists.
-- Display the contests of dictionaries.
-- Add the CommandLine instance.
Details view on the right:
-- Show the type, serial number and name of the currently chosen object.
Other:
-- Add the current navigation path to the top of the form.
-- Added new button strip with: Copy, Next, Quit, Reset
-- Fix window positioning.
-- Minor fixes.
-- Refactor code: break out ObjectExplorer
-- Code cleanup.
Although the Object Explorer is quite capable now, I think having a search capability is going to be key to making this a productive tool. Forthcoming.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Cobra Compiler WinForms Explorer
And here's a screenshot.
- Attachments
-
- CobraCompilerWinFormsExplorer-20080601a.png (53.46 KiB) Viewed 7211 times
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Cobra Compiler WinForms Explorer
Improvements checked into Subversion:
-- Add a search feature
-- Add a "Key / Value" tab on the right with a Cobra-centric display
-- Break the Object Explorer out to a separate .cobra file so it can be used from any program
-- Add a doc string up top with instructions on usage
-- Minor fixes and refinements
This is what I'm using now to examine objects in the compiler when I fix bugs.
-- Add a search feature
-- Add a "Key / Value" tab on the right with a Cobra-centric display
-- Break the Object Explorer out to a separate .cobra file so it can be used from any program
-- Add a doc string up top with instructions on usage
-- Minor fixes and refinements
This is what I'm using now to examine objects in the compiler when I fix bugs.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 22 guests