GithubHelp home page GithubHelp logo

pieroviano / codedomext Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tremaluca/codedomext

0.0 0.0 0.0 198 KB

A set of tools to extend CodeDom code generation functionality

License: Apache License 2.0

C# 99.97% Batchfile 0.03%

codedomext's Introduction

CodeDomExt aims to be an extension of CodeDOM, mainly focused on improving code generation from a CodeCompileUnit, representing the CodeDOM program as a graph.

Extensibility

One of the focus of CodeDomExt is to allow users to define a new node, which can be used in the program graph, and specify how the code generator should handle it, without having to write a new generator nor having to modify CodeDomExt source code. This was reached through the use of the Chain-of-responsibility pattern.
The main element of CodeDomExt is the generic interface ICodeObjectHandler<T>, which exposes a single method Handle, accepting an item of type T, and attempts to generate the code for it, returning if it was successfully generated.
A ChainOfResponsibilityHandler<T> is an ICodeObjectHandler<T> which holds a collection of ICodeObjectHandler<T>, and in its Handle method attempts to delegate the handling of an item to them, calling their Handle method in a specific order, until one of them was able to handle the item.
The code generators provided by the library contain multiple ChainOfResponsibilityHandlers, each capable of handling a specific group of nodes (e.g. one for type declaration, one for statements,...), and a user can add new handlers to any one of these.
Read the wiki for more information on how to customize a CodeGenerator

New nodes

There is a set of new CodeObjects providing support for generation of language features which are not supported by CodeDOM, like lambda expression and using statements.
CodeDomExt provide support for generating these new nodes both in vb.net and c# programs.

Helpers are utility classes which aim to improve the code responsible for the CodeDOM program graph generation, by making it more readable and easier to write.

Download

CodeDomExt is available as a nuget package on nuget.org. CodeDomExt helpers are available as a separate package.

codedomext's People

Contributors

tremaluca avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.