Dynamic source code generation and compilation

Source: Internet
Author: User

.net Framework Contains a mechanism called the Code Document Object Model (CodeDOM), which enables developers of programs that write source code to generate source code in multiple programming languages at run time, based on a single model that represents the rendered code.     

system.codedom namespace defines types that represent the logical structure of the source code that is independent of the specific programming language.   System.CodeDom.Compiler namespace defines the type of source code generated from the CodeDom graph, and the type of source code compilation that is managed in the supported languages.   compiler vendors or developers can extend the collection of supported languages.  

For example, if the CodeDom support for a language is available, some designers use the CodeDom as a language abstraction interface to generate source code in the correct programming language.  

The. NET Framework contains code generators and code compilers for C #, JScript, and Visual Basic.

The content of this section
Using the CodeDOM

Describes general purpose and shows how to use CodeDOM to generate a simple object graph.

Generate the source code and compile the program in the CodeDOM diagram

Describes how to use the classes defined in the System.CodeDom.Compiler namespace to generate source code and compile the generated code using an external compiler.

How to: Create an XML document file using CodeDOM

Describes how to use CodeDOM to generate code that contains comments for XML documents, and how to compile the generated code before you can create an XML document output.

How to: Create a class using CodeDOM

Describes how to use CodeDOM to generate classes that contain fields, properties, methods, constructors, and entry points.

Reference
System.CodeDom

Defines an element that represents a code element in a programming language that targets the common language runtime.

System.CodeDom.Compiler

Defines an interface that generates and compiles code at run time.

Related chapters
CodeDOM Quick Reference

Provides a quick way for developers to find CodeDOM elements that represent source code elements.

Dynamic source code generation and compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.