compiler

Is there any way to determine the available stack space at run time?

I know that stack size is fixed. So we can not store large objects on stack and we shift to dynamic allocations (e.g. malloc). Also, stack gets used when there is nesting of function calls so we avoid recursive functions as well for this reason. Is there any way at runtime to determine how much stack memory is used so far and how much is...

How to begin approach of creating a small lazily-evaluated language.

I'm trying to build a small language with similar syntax and grammatical structure to Java, with List Comprehension and Lambda Functions and such (already made). What I'm trying to do now is instead of having it do eager evaluation, I want to make this language lazily-evaluate expressions. I'm not entirely sure how to go about it, becau...

Need help with scanner class for creating tokens

Errors im getting: cannot find symbol constructor method Token. but i do have a constructor in Token class cannot find symbol variable tokenCode. i clearly use it alll over and i think i initialized it properly so whats wrong? cannot find symbol variable scantest. i have that in same folder where all classes ar...

Easy Python ASync. Precompiler?

Hi, imagine you have an io heavy function like this: def getMd5Sum(path): with open(path) as f: return md5(f.read()).hexdigest() Do you think Python is flexible enough to allow code like this (notice the $): def someGuiCallback(filebutton): ... path = filebutton.getPath() md5sum = $getMd5Sum() showNotifica...

What's the difference between a derived object and a base object in c++?

What's the difference between a derived object and a base object in c++, especially, when there is a virtual function in the class. Does the derived object maintain additional tables to hold the pointers to functions? ...

Modify dll exports (symbol table). I want to obfuscate the function names.

I have a third party dll that I want to change the symbol names. Is this possible? I dont want the competition to know what component my product uses. I don't have the source for the dll. ...

Is there any alternative to gcc to do pratical development under *nix?

I have once heard a saying,we could live without linux,but we definitely could not live without gcc.It seems there is only one c compiler in the Linux world.Is there any alternatives to gcc and does programmers under AIX/HPUX/Solaris use gcc to develop programs? thanks. ...

negative number in the stack

Hello everyone, I am a new student in the compilers world ^_^ and I want to know is legal represent negative number in the stack. For example: infix: 1-5=-4 postfix: 15- The statements are: push(1) push(5) x=pop() y=pop() t=sub(y,x) push(t) The final result in the stack will be (-4) How can i represent this if it is legal?? ...

How can I write this statement from infix to postfix?

How can I write this statement: 9-3/(1+2) ... from infix to postfix? ...

What extensions to the language does the C# compiler implement?

In Eric Lippert's blog entry on umpires and the C# compiler and spec, he makes this statement: (or deliberately; we implement a small number of extensions to the formal C# language) And that got me wondering, what extensions is he referring to, exactly? ...

Compiler compiling external includes

Hello, I have a little problem in my project. I have build static library(e.g. test.lib) . Included it into my binary project linker and included #include "test.h" into stdafx.h. But when binary starts to build, C error occurs on CSomeObject test: "error C2146: syntax error : missing ';' before identifier 'test'". What could be wr...

Compiling a .ss file

I heard that you can compile .ss files with DrScheme, and even remember doing it once to result in some good speedups on my code, since it doesn't need to put in all the debugging info necessary for the GUI. How does one go about doing this? ...

Why doesn't gcc allow a const int as a case expression?

I was looking at this SO question and got to thinking about const ints versus #defines and realized I don't actually understand why the compiler can't deal with this. Could someone shed some light as to why the following code const int FOO = 10; int main(int argc, char** argv) { switch(argc) { case FOO: { printf("foo\n"...

suppress C++ compiler warning from a specific line

I have the following warning: "controlling expression is constant" because of assert statement like this: assert(... && "error message"); how can I suppress warning from this particular line? The compiler I use is NVIDIA cuda compiler. I think it is llvm based. okay, it may not be llvm, as the pragma's do not have any affect. The B...

"g++" and "c++" compiler

Hi, I just found on my Ubuntu, there are two different C++ compiler: /usr/bin/g++ and /usr/bin/c++. I am not familiar with the latter, but man c++ just jumps to the manpage of gcc. I wonder what is their difference as C++ compilers? Thanks and regards! ...

why does Blend suck at compiling?

about 10% of the time when I go to compile code that should compile, blend fails. I know the code should compile because w/o changing a thing it will compile in VS just fine. The really weird thing is that about 50% or more of the time, after compiling in VS and I come back to blend, it compiles. >_< So, why does blend suck at compiling...

First chance exception - long at memory location?

What is this and how can I handle/fix it? First-chance exception at 0x756fb727 in Program.exe: Microsoft C++ exception: long at memory location 0x0018f7a4. I am getting about a thousand of these each time I run my application. How can I track this down and fix it/ ...

Flex Compiler Api: Adding images in Java

Hi there, I have a very specific question. I want to compile an ActionScript project within Java in-memory with the help of the Flex Compiler API ( http://livedocs.adobe.com/flex/3/compilerAPI%5Fflex3.pdf ). My last problem is to add images (jpg, png) that are embedded in the project to the compiler. I don´t see a possibility to do thi...

Can Go compiler be installed on Windows?

I've been looking on golang.org for a Windows compiler, but I can't seem to find it. I can only see Linux and OS X compilers. Does anyone know if Go programming can be done on Windows, or is it something that Google hasn't implemented yet? ...

Which general purpose programming languages/implementations compile to C

I'm currently using Eiffel (SmartEiffel/ISE Eiffel) which is compiling to c. I found it much easier to extend the language yourself with new features or tool support if the output is going into the portable assember language also known as C. Which general purpose, non functional language have this feature too. I know that there have b...