compiler

How do I make Microsoft VCC crash out on the first build-error?

My automated build process uses a command-line to build something like this: devenv.exe myproj.sln /build release It is a very long build-process which integrates components made by a team of developers. It takes about half an hour to run in release mode. Usually if one thing goes wrong then plenty of other dependancies will go wrong,...

JScript.Net compiler error

Hi, I do the following: I create a .js file containing print("Hello World!"); I save it as hello.js I open the Visual Studio 2008 Command Prompt jsc + Enter jsc \out:hello.exe C:\path\to\my\file.js + Enter I get an E_ACCESSDENIED error: what could it be? Thanks! ...

Suggestions for writing a programming language?

What tips can you give a person who is looking to write a programming or script language? I am not worried about how to program nor design a compiler but how to develop one quickly using tools and code generators. Last time i tried i coded it in c++ and the states and syntax took almost as long as writing the actual logic :(. I know the...

C++ Forward Declaration Problem when calling Method

I have a problem which I think is related to forward declarations, but perhaps not. Here is the relevant code: A.h #ifndef A_H_ #define A_H_ #include "B.h" class A { private: B b; public: A() : b(*this) {} void bar() {} }; #endif /*A_H_*/ B.h #ifndef B_H_ #define B_H_ #include "A.h" class A; class B {...

Viewing compiler expanded code - C++

I learned that compiler will expand macros while compiling. Templates are also expanded at the compile time. Is there any way to see this expanded code? I am compiling using Visual Studio 2008. any thoughts? ...

General Purpose Language to build a compiler for

Inspired by Eric Sink's interview on the stackoverflow podcast I would like to build a full compiler in my spare time for the learning experience. My initial thought was to build a C compiler but I'm not sure whether it would take too much time. I am wondering if there is a smaller general purpose language that would be more appropriat...

Are there some online resources about compiler principle?

I need some urgently. Thanks for any help. ...

Dealing with "C compiler cannot create executables" in Cygwin

Whatever I try to compile in Cygwin I get the following output: checking for mingw32 environment... no checking for EMX OS/2 environment... no checking how to run the C preprocessor... gcc -E checking for gcc... gcc checking whether the C compiler (gcc ) works... no configure: error: installation or configuration problem: C compiler ...

Adding a language to the AVM2

Hey there I'm interested in making a language to run on the AVM2 and I'm looking for advice on where to start. I do realize that this is by no means a trivial task, but I would like to give it a try and at the very least learn more about implementing a language along the way. I have messed around with ANTLR and have been reading up on ...

Is there any work being done to create a C# compiler to produce native exe's?

Is there any work being done to create a C# compiler to produce native exe's? e.g. the output is a native exe and NOT a .NET assembly. ...

Concepts required in building an IDE/compiler

When it comes to making an IDE (e.g. SharpDevelop) or a compiler/language parser, what topics of computer science do I need to know? I don't expect a full list of in depth tutorials but just a list of topics which would benefit me in improving. Am I right in thinking a parser has some rules about the syntax/semantics of a language, and ...

Class method and variable with same name, compile error in C++ not in Java?

class Test { bool isVal() const { return isVal; } private: bool isVal; }; On Compiling this file it says testClass.cpp:9: declaration of `bool Test::isVal' testClass.cpp:3: conflicts with previous declaration `bool Test::isVal()' Although the same would work for java class Test { ...

My C++ object file is too big

I am working on a C++ program and the compiled object code from a single 1200-line file (which initializes a rather complex state machine) comes out to nearly a megabyte. What could be making the file so large? Is there a way I can find what takes space inside the object file? ...

Why should I NOT use the /optimize switch to compile my C# code?

In Visual Studio 2008 there is an option "Optimize Code" that probably corresponds to the /optimize option. It is never enabled, not even when in "Release" mode. Why should I not want this option to be enabled at all times? ...

What is the difference between implementing a compiler and an interpreter?

I've read the whole Dragon Book recently (just for fun, I'm not really planning to implement an actual compiler), and I was left with this big question dangling in my head. What is different between implementing a compiler and an interpreter? To me a compiler is made up of: Lexer Parser (which builds the syntax tree) Generate Interme...

Would there be any point in designing a CPU that could handle IL directly?

If I understand this correctly: Current CPU developing companies like AMD and Intel have their own API codes (the assembly language) as what they see as the 2G language on top of the Machine code (1G language) Would it be possible or desirable (performance or otherwise) to have a CPU that would perform IL handling at it's core instead...

How to determine whether a grammar is LL(1) LR(0) SLR(1)

Is there a simple way to determine wether a grammar is LL1, LR0, SLR1... just from looking on the grammar without doing any complex analysis? For instance: To decide wether a BNF Grammar is LL1 you have to calculate First and Follow sets first - which can be very time consuming in some cases. Has anybody got an idea how to do this fast...

Calling mono c# code from Microsoft .net ?

I have some neural net code written in c# that would benefit from using SIMD support. Mono 2.2 just came out that supports SIMD but Microsoft's c# does not support this yet. Being happy with my c# setup I was wondering if I could write a lib in mono for that piece and call it from .net. Edit: I guess what I really want to know is it po...

Targeting ARM architecture with .NET compiler

When you compile windows application in .NET you can set "Platform Target" to be x86 or x64. This would optimize your code to a specific architecture of the processor and allow to escape IL. Does anyone know if there's something that would allow to achieve the same result for Windows Mobile application? I'm only interested in running my ...

Requirements for Compiler Design

The student adviser we were working with is suddenly on leave. The plan was to design a compiler for a program which is similar to C (the basic structure of C still exists but keywords have been changed for example : for(i=0;i<10;i++) would now look like : loop i from 0 to 9 up 1 . And things such as #include have been omitted entirely...