471,317 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Compiler in C# (.NET)

Hi.

Hello, i want doing simple compiler in C# (.NET).
I have lexer and parse file. What kind of tools should I use? And what to
do??

Thanks!
pawel

Dec 6 '05 #1
8 1418
Not sure I understand the question fully, but if you just want to compile C#
code, "csc" is the C# compiler and is part of the .NET framework (SDK maybe)
(it is not dependent on VisualStudio etc)... just search on your HDD for csc
and try csc /?
Alternatively - MSDN to the rescue:
http://msdn2.microsoft.com/en-us/library/2fdbz5xd.aspx and
http://msdn2.microsoft.com/en-us/library/78f4aasd.aspx

(apparently the path is set correctly to use CSC if you use the .NET
Framework SDK Command Prompt)

Easier option, though, is to grab e.g. an Express Edition and use that!

Marc

"Pawel" <si*******@op.pl> wrote in message news:dn**********@news.onet.pl...
Hi.

Hello, i want doing simple compiler in C# (.NET).
I have lexer and parse file. What kind of tools should I use? And what to
do??

Thanks!
pawel

Dec 6 '05 #2
Hi,
no idea if you have the same tools that C does, take a look at
http://en.wikipedia.org/wiki/Compiler-compiler you may find there what you
want

A good book of compilers will help you here, I did this LONG time ago when I
was @ school

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Pawel" <si*******@op.pl> wrote in message news:dn**********@news.onet.pl...
Hi.

Hello, i want doing simple compiler in C# (.NET).
I have lexer and parse file. What kind of tools should I use? And what to
do??

Thanks!
pawel

Dec 6 '05 #3
Pawel wrote:
Hi.

Hello, i want doing simple compiler in C# (.NET).
I have lexer and parse file. What kind of tools should I use? And what to
do??


Try the comp.compilers newsgroup.

Try http://groups.google.com/advanced_search with C# as the text search
and comp.compilers as the target newsgroup. Plenty of interesting hits
occur.

http://www.mono-project.com/CSharp_Compiler is of interest after skimming
through the google search hits. http://www.mono-project.com/Compiling_Mono
states:

"This document describes how to compile and install Mono from its source
code, the source code is available from our download page. ..."

Hmm. Why do you want to re-invent the wheel? Why not dig into the mono
project if you want to get under the hood of a C# compiler? (Rhetorical
questions.)

Doug


Dec 6 '05 #4
Pawel,

ANTLR is a compiler compiler that can work with C# code.

<http://www.antlr.org>

Brian

Pawel wrote:
Hi.

Hello, i want doing simple compiler in C# (.NET).
I have lexer and parse file. What kind of tools should I use? And what to
do??

Thanks!
pawel


Dec 6 '05 #5
Pawel,

Here is one free compiler generator.
http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/

It has a version that generates c# code as well as it comes with sample
grammar file for the c# language.

I kind of dislike that they use recursive descent method (I'd rather prefer
LALR or some other LR(k)) parser, but this is the best free one that I've
found so far.

I'll appreciate if someone else in the group that knows other parser
generator tools that generates c# post some links.
--
HTH
Stoitcho Goutsev (100) [C# MVP]

"Pawel" <si*******@op.pl> wrote in message news:dn**********@news.onet.pl...
Hi.

Hello, i want doing simple compiler in C# (.NET).
I have lexer and parse file. What kind of tools should I use? And what to
do??

Thanks!
pawel

Dec 6 '05 #6
Stoitcho Goutsev (100) [C# MVP] wrote:
Pawel,

Here is one free compiler generator.
http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/

It has a version that generates c# code as well as it comes with sample
grammar file for the c# language.

I kind of dislike that they use recursive descent method (I'd rather prefer
LALR or some other LR(k)) parser, but this is the best free one that I've
found so far.

I'll appreciate if someone else in the group that knows other parser
generator tools that generates c# post some links.


I have managed to adapt flex/bison output for use in C# quite easily. I
am using it for over three years now and it works just fine, not
requiring you to use any extra runtime libraries (like ANTLR etc.). I'll
try to put it together and post it soon. Just watch my sourceforge
project at http://sourceforge.net/projects/nscript

(I know nothing is there yet, but I promise it's in the works, I just
haven't had too much time/mood lately)

Stefan
Dec 6 '05 #7
Stefan,

That would be great.
I believe the whole community can benefit from it

Thanks
Stoitcho Goutsev (100) [C# MVP]
"Stefan Simek" <no****@nospam.nospam> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
Stoitcho Goutsev (100) [C# MVP] wrote:
Pawel,

Here is one free compiler generator.
http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/

It has a version that generates c# code as well as it comes with sample
grammar file for the c# language.

I kind of dislike that they use recursive descent method (I'd rather
prefer LALR or some other LR(k)) parser, but this is the best free one
that I've found so far.

I'll appreciate if someone else in the group that knows other parser
generator tools that generates c# post some links.


I have managed to adapt flex/bison output for use in C# quite easily. I am
using it for over three years now and it works just fine, not requiring
you to use any extra runtime libraries (like ANTLR etc.). I'll try to put
it together and post it soon. Just watch my sourceforge project at
http://sourceforge.net/projects/nscript

(I know nothing is there yet, but I promise it's in the works, I just
haven't had too much time/mood lately)

Stefan

Dec 6 '05 #8

Stefan Simek wrote:
I have managed to adapt flex/bison output for use in C# quite easily. I
am using it for over three years now and it works just fine, not
requiring you to use any extra runtime libraries (like ANTLR etc.). I'll
try to put it together and post it soon. Just watch my sourceforge
project at http://sourceforge.net/projects/nscript

Great. That's one thing I disliked about ANTLR.
(I know nothing is there yet, but I promise it's in the works, I just
haven't had too much time/mood lately)

Stefan


Dec 6 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mike Fisher | last post: by
2 posts views Thread by Scott Moore | last post: by
8 posts views Thread by Spar-Q | last post: by
3 posts views Thread by Mark Rockman | last post: by
4 posts views Thread by Patrick Olurotimi Ige | last post: by
3 posts views Thread by =?Utf-8?B?Ukxvc2tp?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.