compiler

Stipulating that a property is required in a class - compile time

Is there a way to stipulate that the clients of a class should specify a value for a set of properties in a class. For example (see below code), Can i stipulate that "EmploymentType" property in Employment class should be specified at compile time? I know i can use parametrized constructor and such. I am specifically looking for outp...

[C#] What does this compiler-generated enumerator mean?

I wrote a fairly complex method that yield-returns IEnumerable<string>, but when I inspected the compiler output in Reflector, I didn't understand a specific part of the compiler-generated implementation of IEnumerator: void IDisposable.Dispose() { switch (this.<>1__state) { case 1: case 2: case 3: ...

Why is building a cross-compiler harder than building a regular compiler?

Everything I've read seems to imply that building a cross-compiler is significantly harder than building a compiler that targets the platform it runs on. Is this true? If so, why? It seems like generating assembly code and system calls for an arbitrary platform shouldn't be any harder than generating such code and system calls for the...

Mono mkbundle tool unable to create binary with complaint that output file is unavailable.

As per suggestions from this thread on running C# apps sans .NET I've compiled my app using mono. I built the original app using the latest Visual C# .NET Express Edition. It runs fine on .NET on Windows. I then opened up Cygwin and navigated to my source where I compiled the project again, under mono using the following command: $ m...

Compiler-Programming: What are the most fundamental ingredients?

I am interested in writing a very minimalistic compiler. I want to write a small piece of software (in C/C++) that fulfills the following criteria: output in ELF format (*nix) input is a single textfile C-like grammar and syntax no linker no preprocessor very small (max. 1-2 KLOC) Language features: native data types: char, int an...

Overriding function with enum/int

If there was a base class DeriveMe that had a function virtual void DoSomething(int) and a class that inherits DeriveMe called DerivedThat that had a function void DoSomething(SomeEnum)...would the DerivedThat override the base class DoSomething because enums evaluate to ints during compile time in C++? I could try this by making DoSome...

Events in lambda expressions - C# compiler bug?

I was looking at using a lamba expression to allow events to be wired up in a strongly typed manner, but with a listener in the middle, e.g. given the following classes class Producer { public event EventHandler MyEvent; } class Consumer { public void MyHandler(object sender, EventArgs e) { /* ... */ } } class Listener { p...

STM32 Compiler/Debugger Chain?

I'm starting a project with a STMicro STM32. I've done the Google searches, looking for solid compiler/debugger chains but would prefer answers with success stories. Open Source Compilers/Linkers would be ideal, I just don't know if their STM32 toolchains are stable yet. (Both C, C++ compilers are acceptable). -- So commercial options...

Options for dynamic compilation in Java 5

Are there any options other than Janino for on-the-fly compiliation and execution of Java code in v5? I know v6 has the Compiler API, but I need to work with the v5 VM. I essentially need to take a string containing a complete Java class, compile it and load it into memory. ...

mono mkbundle utility on windows

Hello, There has been a fair amount of mention of the mono utility mkbundle which is supposed to (among other things) allow you to create a bundle (standalone exe) with a c# project compiled with mono. This works when i run it in cygwin, however what i really would like to do is use the --deps option and --static option to pull in all ...

Online compilers/runtime for Java, C++, Python and ObjC?

Does anyone know of a good online compiler/runtime (for C++, Java, Python, ObjC etc.) that I can access on the web? What I'm looking for is something that would allow me to type in a program in a web form and to run the program and see the results online. (Let's not get into the why for now. Suffice it to say for the moment that I don...

Help with C++ preprocessor compilation errors

Please look at the following file: (it is a complete file) #ifndef TEES_ALGORITHM_LIBRARY_WRAPPER_H #define TEES_ALGORITHM_LIBRARY_WRAPPER_H #ifdef _TEES_COMPILE_AS_LIB #include <dfa\Includes\DFC_algorithms.hpp> #include <DFA\FuzzyClassifier\FuzzyAlgorithmIntialization\InitFuzzyAlgorithm.hpp> typedef teesalgorithm::tees_fuzzy_algorithm...

What's your favorite g++ option?

Hi, I am a newbie in C++ programming. When compiling I never use any option. This is my day to day command: g++ MyCode.cc -o MyCode For safety practice what's the best option to use? ...

How to compile a C program?

I haven't done C in a long time. I'd like to compile this program, but I have no idea how to proceed. It seems like the makefile refers to GCC a lot and I've never used GCC. I just want an executable that will run on windows. ...

Using new MS C++ compiler with old Visual Studio

I want to use a recent MS C++ compiler (I need TR1) with old IDE (Visual C 6.0). I heard that I can download free command line MS C++ compiler only. Is it possible? Can I use new compiler with old IDE? If so what additional problems may arise? I want to keep VS6 cause I'm familiar with it. I want to use MS implementation of TR1 cause I ...

Can any Flash compiler put scripts on multiple frames?

Can any Flash compiler put specific scripts on specific frames of the Flash movie SWF? Like you can do from within the Flash IDE, just place a script on the required frame using the Timeline panel, and the script gets compiled to that frame of the Flash movie SWF. Eg. script on frame 1 : trace("Reached frame 1"); Eg. script on frame...

Writing my own C++ compiler

I want to write my own c++ compiler in c++. Let´s say I´m going to build it in VS. The main idea is that it must have been able to compile itself, which means I cannot use STL, boost, etc. libraries, can I? So, does it mean that I must do everything from scratch - from lexical analyser to binary code generation? ...

Which C Compiler do you recommend for windows

Which C Compiler do you recommend for Windows (Not C++, C ANSI) Related: c compiler for windows C/C++ Compiler for windows ...

how to minimize a programming language compile time?

I was thinking more about the programming language i am designing. and i was wondering, what are ways i could minimize its compile time? ...

Why can't a null-reference exception name the object that has a null reference?

It seems to me that a lot of my debugging time is spent chasing down null-reference exceptions in complex statements. For instance: For Each game As IHomeGame in _GamesToOpen.GetIterator() Why, when I get a NullReferenceException, can I get the line number in the stack trace, but not the name of the object that equals null. In other w...