Archive for the ‘Visual Studio’ Category

Book: Lex & Yacc

Saturday, June 27th, 2009

I picked up a copy of Lex & Yacc off TradeMe the yesterday, and I’m quite excited.

I’m hoping it will help me get my head around parser writing, for my still to-be revealed side project…

For a while now I have been working on a side project to add editor support for Erlang in Visual Studio.

I have a Google Code project for it, and it currently has syntax colour highlighting, but I was getting stuck with writing othe parser.

This is where the project has stalled over the last few months as I have been reading lots.

Originally I was basing my work on Lua Langage Pack for Visual Sudio. This package is a C# based plug-in that uses the CSTools project by Malcolm Crowe.

With the help of Code Project documents, MSDN and Blogs I slowly got a plug-in that has colour highlighting working (if you run it in the debug Visual Studio).

I was also reviewing how the IronPython project does it’s parser, but that used seemed to use python to do some parsing.. so

I then was trying to get Antlr to work, via AntlrWorks, but was banging my head on the debuggers limited support.

The next problem was how do I actually define the grammar for Erlang.

Erlang ships with a  grammar defined in yecc, it’s version-thing of yacc.  So I started translating this to Antrl but was getting left-right recursion errors, even though the problem was not the standard definition of left-right recursion problem.  Yecc is recursive decent as Erlang does recursion so well, but this was not playing well with Antlr. I then discovered I was looking at a subset of the Erlang gramma, and the full yecc gramma was huge, so hand translations was not an option.

So I then found the yecc grammar for yecc, and thought that I could hand roll a C# recursive decent parser for yecc, which would allow the auto-writing of a proper grammar for CSTools. But I wasn’t so keen on the .dll dependency of that tool chain.

I started reading the dragon book (Compilers: Principles, Techniques, and Tools) around this time, so was starting to get my head a little better positioned.

I then stumbled on to the Irony project which is a Visual Studio language development framework.  Eek they have most of what I was trying to workout how to-do, mostly worked out. But they have their own lex and yacc like tools.  This project also refers to the Visual Studio’s lex and yacc tools called MPLex and MPPG (distributed in the Visual Studio SDK)

I have just found that the newer version of the Lua project for Visual Studio 2008 uses the Irony project, and is hosted on CodePlex.

So I was getting keen again to work out how to use lex and yacc correctly, thus why when I saw this book for $3, I bid and anxiously waited to se if I’d win.  Of the 19 counted page view on the auction, 17 were mine.

So I’m half way through the first chapter and have just realised I don’t need to write a hand parser of yecc, I just need to write a lex parser that translates yecc to yacc, and rebuild that with MPPG to get a C# Erlang parser that is not hand rolled. Which means if the Erlang language changes, I can just re-run the whole process on the new gramma, and still be compliant.

Installing Visual Studio 2008

Thursday, December 6th, 2007

I have finished now, but I have to say there was something creepy about the two male photos used. One looked too happy and the other too smooth.  What made it worse was that it kept changing and my attention would be pulled to smug guy or happy guy.

Visual Studio 2008 - Happy Guy Visual Studio 2008 - Smooth Guy

I’m not looking forward to having to do a repair, luckily I did a full install, so there are no extra features that I will have to install later……

Visual Studio: Multiple startup projects

Friday, October 5th, 2007

I have just been blessed with knowledge from 11 times MVP Chris Crowe. I was down in IS Land, complaining about how Visual Studio became unstable when debugging many instances of the same solution. And Chris drops the bombshell that you can launch and debug from the same instance.

Low and behold it’s true, and now I’m even considering moving more projects into the same solution, just to simplify the debug launch process…

So the steps are:

  1. right-click on your Solution in the Solution Explorer
  2. click of Properties
    Steps 1 - 2
  3. select Startup Project
  4. select Multiple startup projects:
  5. change the Action from None to Start or Start without debugging
  6. use the Arrow to change the order of the projects starting up
    Steps 3 - 6
  7. press F5 to run them all…

For more information here is the MSDN link

Visual Studio 2005 can do directory based search

Wednesday, August 22nd, 2007

One of the features I thought was lost in Visual Studio 2005, directory/file based searches, is not!

When you bring up Files In Files (Ctrl+Shift+F, Edit.FindinFiles) you can type in the path straight

Find_In_Files

Or you can click on the Epsilon button at the side and select many directories.

Folder_Choosing

Look you can even have named sets.

I take back all those bad word I said about you Microsoft. Well maybe I leave some the table, because it has taken me so long to re-find one of my favorite features.

Visual Studio 2008 Beta 2 is out…

Friday, July 27th, 2007

From Darryl I learnt Visual Studio 2008 Beta 2 is out. Damn it, I had only just gotten Beta 1 installed and working how I liked in my VPC at work.

Well I’m excited really about the new version, but more annoyed at all the system updates that wasted so much time this week, when all I want to do was experiment with Silverlight.

Now I’ve just got to not restart my dev machine over the next ~7 hours while it comes down.

I was wondering about Silverlight, but reading Soma’s details Silverlight 1.0 RC is due any day now also. Woot!