compiler

Compile simple string

Hello All, Was just wondering if there are any built in functions in c++ OR c# that lets you use the compiler at runtime? Like for example if i want to translate: !print "hello world"; into: MessageBox.Show("hello world"); and then generate an exe which will then be able to display the above message? I've seen sample project around ...

Free Compiler for Windows on x86_64

Hello all :) I'm writing a compiler which uses C as an intermediate code which is (Currently) passed out to MinGW for compilation into an EXE file. I'm looking for an x64 compiler that I can include in my releases, so that users of my application can get around Win64's "Windows on Windows" system to access native resources. MinGW allow...

Possible to Compile ASP.NET to Machine Code?

Is it possible to compile a ASP.NET web application to Machine language? If so, are there any performance benefits? ...

#include <> and #include ""

Possible Duplicate: what is the difference between #include <filename> and #include filename Is there a fundamental difference between the two #include syntax, apart from the way the path the compiler will search for? I have the feeling that Intel's compiler does not give exactly the same output. ...

Unrolling small loops with Visual Studio 2005

How do you tell the compiler to unroll loops based on the number of iterations or some other attribute? Or, how do you turn on loop unrolling optimization in Visual Studio 2005? EDIT: E.g. //Code Snippet 1 vector<int> b; for(int i=0;i<3;++i) b.push_back(i); As opposed to //Code Snippet 2 vector<int> b; b.push_back(0)...

Does PHP compile data?

I'm a student learning PHP. I basically make the stuff work, but never wondered about how the php.exe(on windows) works. Does it compile the stuff it has to handle or not? Reason I'm asking is because someone told me that ASP.NET has to compile all website-dependant data is has/receives, like everything that gets uploaded through a for...

Why Nullable<int> can't compile but int? do without 'using System;'

namespace ns { class Class1 { Nullable<int> a; } } will not compile: The type or namespace name 'Nullable' could not be found (are you missing a using directive or an assembly reference?) <-- missing 'using System;' but, namespace ns { class Class1 { int? a; } } will compile! (.Net 2) do you...

What binary rewriter is used to implement Microsoft's Code Contracts?

I am talking about those Code Contracts that will end up in .NET 4.0. What binary rewriter do they use to inject the code that makes it all work and is it publicly available? I hope it's not just a compiler thing because I would love to be able to use their binary rewriter for AOP. ...

Trouble with boost and Code::Blocks

I've been trying to get the boost library working with Code::Blocks and am having some trouble. When I first tried to get boost, all I did was download the latest zip file and extract it into the CodeBlocks folder. Then I set the compiler settings to look in the boost folder. This allowed me to compile, but not to link. I then read the ...

offsetof at compile time

Is there a way of finding the offset of a member of a structure at compile-time? I wish to create a constant containing the offset of a structure member. In the following code the offsetof() macro works in the first printf statement. However, the use in line 10 to declare 'ofs' generates the error "Cannot resolve '->' operator as a const...

Microsoft CCI - resources, references for writing compilers

Some time ago, I was working on compiler, I've used System.Reflection to generate code (IL) from my AST. Now, I've an idea for another compiler that I'd like to work on (it will be another pet project, nothing that will be used in production code, at least, not now). As you know, pet projects have one big advantage over production cod...

Find type parameter of method return type in Java 6 annotation processor

I'm writing a tool that uses the annotation processor to generate source code depending on the return type of methods of an annotated class. The return type is always some subtype (interface or class) of an interface A that defines a type variable T. interface A<T>{T m();}; I would like to find the type parameter for the method m() r...

Using the ASP Compiler in NAnt to build an ASP .Net MVC application

I am succesfully building ASP .Net applications in NAnt using the ASP Compiler, without a problem., as part of my Continuous Integration process. However, if I try exactly the same process on an ASP .NET MVC application, the build fails in NAnt, but will compile succesfully in Visual Studio. The error message I get in NAnt is: [Htt...

Delphi2010 Compiler error: F2084 Internal Error: L1737

When I compile our project use Delphi 2010 Trial, there has a fatal error : [DCC Fatal Error] F2084 Internal Error: L1737 Seem's a internal error. No hint at all. Is this a compiler bug or trial limit? Thanks. ...

How to work around Visual Studio Compiler crashes

We have a large Visual Studio 2005 C++/Mfc solution, 1 project with around 1300 source files (so about 650 .h and 650 .cpp files). We also use Boost and a few other libraries (COM: MSXML, Office). Recently, I've added a few instances of boost::multi_index to speed up things a bit. This all compiles most of the time. But now, when I'm d...

Singletons via static instance in C++ -- into source or into header files?

Cheers, I ran into this chunk of code in "Programming Game AI by Example": /* ------------------ MyClass.h -------------------- */ #ifndef MY_SINGLETON #define MY_SINGLETON class MyClass { private: // member data int m_iNum; //constructor is private MyClass(){} //copy ctor and assignment should be private MyClass(const ...

Why is sizeof an operator?

Why is sizeof considered an operator and not a function? What property is necessary for something to qualify as operator? ...

Understanding return value optimization and returning temporaries - C++

Please consider the three functions. std::string get_a_string() { return "hello"; } std::string get_a_string1() { return std::string("hello"); } std::string get_a_string2() { std::string str("hello"); return str; } Will RVO be applied in all the three cases? Is it OK to return a temporary like in the above code? I ...

Optional vs. mandatory terminators in context-free grammar definition

In a book chapter about compilers, there's the following grammar definition and example code. ... statement: whileStatement | ifStatement | ... // Other statement possibilities | '{' statementSequence '}' whileStatement: 'while' '(' expression ')' statement ifStatement: ... // Definition of "if" statemen...

How to have the Xcode 3.1 compiler warn of assignment operator in an if statement?

I've tried searching the documentation and the internet as best as I'm able, but I haven't been able to get the Xcode compiler to issue a warning if the assignment operator is used in an if statement. I'm coming from RealBasic, where I've got an extremely strong habit of typing this sort of comparison: if x = 5 then ... In C, of cour...