Export (0) Print
Expand All

Managed Language Services Technology Overview

Visual Studio 2005
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

By using Managed Language Services, you can integrate a programming language, especially a custom language that you have developed, into Visual Studio 2005. After you have integrated your language, you can use it just like the languages that are included with Visual Studio.

Managed Language Services require the following:

  • Visual Studio 2005 SDK.

  • The Managed Package Framework (MPF), a C#-based framework.

  • A scanner to tokenize code written in your language and a parser to interpret the tokens to take advantage of Visual Studio 2005 language-service features.

When you use Managed Language Services, you can access the following features:

  • Syntax highlighting

  • Outlining

  • Commenting blocks of code

  • Brace matching

  • Code Snippets

  • Custom Document Properties

  • IntelliSense Parameter Info

  • IntelliSense Quick Info

  • IntelliSense Member Completion

  • IntelliSense Complete Word

Visual Studio 2005 SDK

Visual Studio 2005 SDK lets you write VSPackages in C# for your language service.

It also lets you start Visual Studio in an experimental hive so that you can experiment with your VSPackages without contaminating your production version of Visual Studio.

The Managed Package Framework

You can use the MPF classes to create VSPackages by using managed code. The MPF provides default implementations for many VSPackage interfaces. Because the MPF already contains implementation details, it lets you create VSPackages with a minimum amount of additional code.

The following table lists the MPF namespaces provided by the Visual Studio 2005 SDK.

Name space Contents

Microsoft.VisualStudio

Contains classes for handling COM errors, Visual Studio constants, and Win32 windows.

Microsoft.VisualStudio.Package

Includes managed code wrappers for Visual Studio projects, editors, and MSBuild.

Microsoft.VisualStudio.Package.Automation

Contains the wrappers for automation objects.

Microsoft.VisualStudio.Shell

Includes MPF base classes from which you can derive an implementation of many common Visual Studio objects. 

Microsoft.VisualStudio.Shell.Design

Contains Visual Studio designer extensions.

Microsoft.VisualStudio.Shell.Design.Serialization

Contains Visual Studio serialization designer extensions.

Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom

Contains Visual Studio CodeDom designer extensions.

Microsoft.VisualStudio.Shell.Flavor

Supports project subtypes (also known as "flavors").

The Scanner and Parser

The default scanner and parser expected by Visual Studio 2005 are Flex and Bison. When you create a new language service by using the Extensibility Wizard, it will ask you to specify their location. Flex and Bison are open-source tools and are freely downloadable from the Internet, but they are covered by the GPL. Under the GPL, if you modify Flex or Bison source code, you must publish your modifications.

Flex

Flex is a tool for generating scanners, which are programs that recognize lexical patterns in text. Flex reads the given input files, or standard input if no file names are given, for a description of a scanner to generate. The description is in the form of pairs of regular expressions called rules. flex generates a source file output. When you run flex, it analyzes its input for occurrences of the regular expressions.

Bison

Bison parses input streams consisting of tokens with certain values. This clearly describes the relation bison has with flex, YACC has no idea what "input streams" are--it requires preprocessed tokens.

When bison was first created, it was used to parse input files for compilers that generated programs. Programs written in a programming language for computers are typically not ambiguous--they have just one meaning. As such, bison does not cope with ambiguity, so you must be sure to specify exactly the tokens that you expect bison to process.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft