Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I have three projects written with VB.NET (2005) and have to convert them to C# code. (I know that i don't need to convert codes of .net languages at all). I have no time to rewrite them, need a tool or script to convert.
Note: they are console applications.
Reflector lets you inspect compiled assemblies in several different .Net languages. I've known people to cut and paste the output to convert between languages. Apparently it also has an export feature.
SharpDevelop can do this, but depending you your vb.net code a lot of manual work will remain.
http://converter.telerik.com/
Another option is using Carlos Aguilar's converter. Converts from VB.NET to C# and viceversa.
Experience shows me that different converters are better than others in certain areas so I'd recommend you to use more than one, if possible, and compare their output.
There is a cool .net code conveter tool available online here. Try this if it helps to you.
Free Online .Net Code Converter
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have a large C# library that I need to convert to Python. Python is a customer requirement, I can not use any other language.
Any automatic C# to Python converter?
Edit: I need a pure Python solution. .Net is not an option for me.
Assuming IronPython will meet their requirement, SharpDevelop can do that for you. I have a feeling it will still be quite painful.
Here's a link:
http://community.sharpdevelop.net/blogs/mattward/archive/2009/05/11/ConvertingCSharpVBNetCodeToIronPython.aspx
You should convince your costumer that Python language can interact with .Net using some libraries. It would be a waste of time to re write the whole library in Python and then test the Python code for any bugs.
There is a library called Python for .NET, by which you can call .net classes and functions inside your Python code, you can create a wrapper code for calling the .Net code.
If you write a wrapper class, it would be just like calling Python classes and functions to other Python programmers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
For my diploma thesis I need to implement certain static C code analysis and I am desperately looking for a framework/library that would allow me to parse C source code, split it up into single functions, for every function determine what variables are changed in the function body and derive certain annotations for the code automatically.
Is there any good framework written in C# or generally as .Net class for this purpose?
What about googling for "C Parser written in C#"?
I got this as first link: http://code.google.com/p/cpp-ripper/
Also, I think the C grammar can be found in quite a lot of places, so you might just want to open up your .NET variant of lex/yacc and go from there?
You might like to check ANTLR. It comes with versions of several versions, included C and C#. There are some free grammars on ANTLR web site, including C.
I had a similiar problem and having done a research about YACC tools for C# I have chosen Gold Parsing System with Semantic Engine. My project was parsing SQL queries and generating logical query plans (from T-SQL grammar subset).
I really recommend it. Those 2 libraries make parsing stuff painless and allow to map grammar to the object model in your code. It feels very intuitive and made my project successful :) However, it may lack some advanced ANTLR features, so recognize your needs carefully.
Gold Project http://www.devincook.com/goldparser/
Semantic Engine Lib http://code.google.com/p/bsn-goldparser
If you're ok with using GPL'd code, you might want to take a look at the GCC source code. If you need to do it within .Net, you can always use p/invoke to call code from the GCC libraries.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I want to know, is this possible to use C# language syntax in own platform? I know that C# is ECMA standartized language. So how can it be implemented?
I know there are examples such as Mono & Unity3D who implemented C#.
So for example : One common class library (own, written in C) & C# as a programming language.
The problem is that I never did that before, so I am interested what should I read & where to start. Any other articles about implementing syntax will be good.
If you want to write a compiler for C#, the place to start is the Dragon Book, alongside a copy of the C# 4 spec. It's an awful lot of work though, and not for the faint of heart; you generally need years of experience to write a compiler for something as complicated as C#.
I recommend starting with a smaller language, maybe a trivial language like brainfuck, or looking at existing toy compilers.
imho there are a very few cases when you need to write your on parser / compiler etc.
I would do it in a different way.
First option would be to run .Net from your C application. You can for instance use Mono for that. Here is a description: http://www.mono-project.com/Embedding_Mono
The second option would be to use your c class library directly from C# applications. Check http://www.pinvoke.net/ for example on how to declare them.
One obvious option is to retarget the Mono AOT. This is how MonoTouch works, for example.
The hard route is to implement your own C# parser, compiler and a large part of its standard library.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Is there a free code to html syntax highlighter written in C#? I am looking for something I can host in an .net mvc app
New answer
These days I just use highlightjs which works perfectly well with C#.
Old answer
While I haven't open-sourced it yet, you'd be welcome to the formatter I use for the C# in Depth web site. Give it a try, and let me know if you'd like to use it. (This is no longer available.)
If you can access a command line tool, you can get pygments (it is python), but just pipe the output back into your app.
http://pygments.org/
It's has a multitude of output formats.
I wrote a C# syntax highlighter using regex and a mini "state machine" (a few if statements) here, it could be adapted for C, C++ and Java fairly easily. It produces the inline styles by default and a pre tag.
The source is there in C#.
(Cross pollination answer)
ColorCode-Universal, which used to power syntax highlighting in Codeplex, works pretty well.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I've been working on a really large project for almost 2 years and the client requirements keep changing. These changes, of course, effect everything and I would like to find a way to work with the CSS in a more dynamic fashion.
I assume I could get one of the ruby or python CSS DSLs running under ironRuby/Python but this client is very very particular about what software/frameworks are installed.
I have not found a CSS DSL where the base programming language is vb or c#.
reference:
http://sandbox.pocoo.org/clevercss/ and http://nubyonrails.com/articles/dynamic-css
Less CSS for .NET was recently released.
http://www.dotlesscss.org/
I am not sure about any publicly available products, but I have written an ASP.NET HttpHandler for .css files a few times. Its a pretty simple task, and I usually add things like variable and basic expression support, realtime minification, comment stripping, etc. Is this what your looking for? If so, I think each time its taken maybe 10 hours of work max to write, debug, and implement the handler...not too bad given all the benefits.
You could also write your own DSL, using either the DSL Toolkit that's part of the Visual Studio SDK, or using Oslo. In the former case, the result could be .css files plus whatever else you needed, including API code for your ASP.NET application to call upon.