MyCEE Sample

The MyCEE sample demonstrates one implementation approach to creating an expression evaluator for the MyC language. Programs compiled by the MyC compiler with debug information can be debugged in Visual Studio. The debugging package will automatically invoke the MyC expression evaluator to display locals and handle expressions written in the MyC language.

To run the MyCEE sample

  1. Run Visual Studio.

  2. From the File menu, select Open -> Project/Solution.

    The Open Project dialog box appears.

  3. Open the file from the Visual Studio 2008 SDK install location; for example, C:\Program Files\Visual Studio 2008 SDK\<version>\Archive\MyCpkgs\MyCpkgs.sln.

    The Mycpkgs solution, which consists of five projects, appears in Solution Explorer.

  4. From the Build menu, select Build Solution.

    The five projects are built, including the expression evaluator.

  5. Launches Visual Studio in the experimental hive (from the shortcut installed with VSIP or from the Visual Studio command prompt by typing devenv /rootsuffix Exp).

  6. In the second instance of Visual Studio, from the File menu, select New, and then Project.

    The New Project dialog box appears.

  7. From the Project Types tree, choose Other Project Types, and then MyC Projects.

  8. In the Templates window, choose MyC Project and click OK

    An empty MyC project appears in Solution Explorer.

  9. Right-click the empty MyC project in Solution Explorer, select Add, and then select Add New Item.

    The Add New Item dialog box appears.

  10. Select the MyC Source File template and click OK.

    The template opens.

  11. Type in the following simple MyC program:

    void main()
    {
      int x;
      int y;
      x = 4;
      y = 5;
    }
    
  12. Set a breakpoint on the sixth line (y = 5).

  13. From the Build menu, choose Build Solution.

    The new MyC program is built.

  14. From the Debug menu, choose Start, or press F5.

    The program runs, then stops at the sixth line. The variable x appears in the Locals window, along with its value (4) and type (__int32).

See Also

Concepts

Visual Studio Debugging Samples