Forums

Cobra Compiler WinForms Explorer

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Cobra Compiler WinForms Explorer

Postby Charles » Sat May 31, 2008 12:51 am

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
Charles
 
Posts: 2510
Location: Los Angeles, CA

Re: Cobra Compiler WinForms Explorer

Postby Charles » Sun Jun 01, 2008 2:40 am

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.
Charles
 
Posts: 2510
Location: Los Angeles, CA

Re: Cobra Compiler WinForms Explorer

Postby Charles » Sun Jun 01, 2008 2:42 am

And here's a screenshot.
Attachments
CobraCompilerWinFormsExplorer-20080601a.png
CobraCompilerWinFormsExplorer-20080601a.png (53.46 KiB) Viewed 1388 times
Charles
 
Posts: 2510
Location: Los Angeles, CA

Re: Cobra Compiler WinForms Explorer

Postby Charles » Wed Jun 11, 2008 10:03 pm

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.
Charles
 
Posts: 2510
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron