compiler

visual description for data structure

i have a data structure for my compiler (such as ast) , and i need a method to print it (like ms visio) and verify its contents (i need to verify the contents of the ast nodes) note : i dont want to print it to the console , i am using c++ & qt thanks ...

How to write the Visitor Pattern for Abstract Syntax Tree in Python?

My collegue suggested me to write a visitor pattern to navigate the AST. Can anyone tell me more how would I start writing it? As far as I understand, each Node in AST would have visit() method (?) that would somehow get called (from where?). That about concludes my understanding. To simplify everything, suppose I have nodes Root, Expr...

Odd compiler error on if-clause without braces

The following Java code is throwing a compiler error: if ( checkGameTitle(currGame) ) ArrayList<String> items = parseColumns( tRows.get(rowOffset+1), currGame, time, method ); checkGameTitle is a public static function, returning a boolean. The errors are all of the type "cannot find symbol" with the symbols being variable ArrayL...

Xcode linker error on iPhone app (Only on simulator)

Im getting this linker error that won't let me compile. It only happens on the simulator. KEY POINTS: - Happens only in simulator - Similar to THIS question, but found no FRAMEWORK_SEARCH_PATHS in my .pbxproj file - Though my OS is 10.6.2, I had to build target 1.5 to avoid other linker errors - libxml2.dylib IS required and is in my ...

default maven compiler setting

Hello Maven gurus, Right now, I'm writing a small java application by my own, with few maven pom.xml files. I want to make all my maven packages to compile with jdk 1.6, and I can't find a good way to do it without manually setting it on every single POMs - I'm sick of copy-and-pasting <groupId>org.apache.maven.plugins</groupId> <artif...

On which platforms does libc store stack cookie values somewhere other than __stack_chk_guard?

e.g glibc on Linux/i386 stores the cookie at %gs:0x14. Are there any other platforms on which I need to look somewhere other than at the __stack_chk_guard symbol to find the cookie? (This is where the value that gcc -fstack-protector-generated code stores onto the stack in function prologues and checks before return to defend against st...

What are modern and old compilers written in?

As a compiler, other than an interpreter, only needs to translate the input and not run it the performance of itself should be not that problematic as with an interpreter. Therefore, you wouldn't write an interpreter in, let's say Ruby or PHP because it would be far too slow. However, what about compilers? If you would write a compiler...

problem understanding templates in c++

Template code is not compiled until the template function is used. But where does it save the compiled code, is it saved in the object file from which used the template function in the first place? For example, main.cpp is calling a template function from the file test.h, the compiler generates an object file main.o, Is the template fu...

Enum exeeding the 65535 bytes limit of static initializer... what's best to do?

I've started a rather large Enum of so called Descriptors that I've wanted to use as a reference list in my model. But now I've come across a compiler/VM limit the first time and so I'm looking for the best solution to handle this. Here is my error : The code for the static initializer is exceeding the 65535 bytes limit It is clear whe...

How to compile x64 code with Visual Studio in command line?

I want to compile a simple hello-world-style program using the Windows command line. cl file_name.c is easy enough. Now I want to do the same thing in 64 Bit. What should I do? ...

VERY simple C program won't compile with VC 64

Here is a very simple C program: #include <stdio.h> int main (int argc, char *argv[]) { printf("sizeof(short) = %d\n",(int)sizeof(short)); printf("sizeof(int) = %d\n",(int)sizeof(int)); printf("sizeof(long) = %d\n",(int)sizeof(long)); printf("sizeof(long long) = %d\n",(int)sizeof(long long)); printf("sizeof(float) ...

IR tree representation of binary operation

I have a simple operation like so: k + 1 What would be a IR tree representation of it? So far I came up with: BINOP(+, MEM(NAME(k)), CONST(1)) but I am not sure if I need the MEM for NAME or not. Any help welcome. The notation we use is exactly the same as in this pdf: http://www.computing.dcu.ie/~hamilton/teaching/CA449/notes/tr...

why won't Eclipse use the compiler I specify for my project?

I'm using Eclipse 3.3. In my project, I've set the compiler compliance level to 5.0 In the build path for the project. I've added the Java 1.5 JDK in the Installed JREs section and am referencing that System Library in my project build path. However, I'm getting compile errors for a class that implements PreparedStatement for not implem...

C++ Performance/memory optimization guidelines

Hi All, Does anyone have a resource for C++ memory optimization guidelines? Best practices, tuning, etc? As an example: Class xxx { public: xxx(); virtual ~xxx(); protected: private: }; Would there be ANY benefit on the compiler or memory allocation to get rid of protected and private since there the...

How do shader compilers work?

Does anyone have references to documents and research specific on the inner workings of shader compilers/graphics drivers compilers? ...

Get rid of redundant cast to javax.xml.bind.JAXBElement<java.lang.Boolean> warning from CXF-generated code

I generate some code using CXF from a WSDL-file. When compiling the code with version "1.6.0_16" with the flag -Xlint I get the following warning: warning: [cast] redundant cast to javax.xml.bind.JAXBElement<java.lang.Boolean> [javac] this.r = ((JAXBElement<Boolean> ) value); What does the warning mean, should I be worried?...

Xcode: Is there a location/flag to prevent a Class from compiling?

Is there a place (or flag) in Xcode for files that you don't want to compile? There are some classes that are/may become part of a project but currently won't compile. The main project doesn't link to them but Xcode still tries to compile them. Is there a way to prevent blocking the rest of project from compiling until these new Classes ...

unable to use turboc through xp. why? solution?

Hi, I'm having problems opening directly TurboC++ compiler(dos version) on Windows X. if I click on the TurboC++ icon through windows GUI it opens for a sec(a blank dos screen) and shuts down. so i have to access it through the command line i.e., cmd (enter) c:\tc\bin (enter) tc.exe This way TurboC++ opens and I'm able to program and...

Is there any way to compile our PHP code into executable file

i'm wondering about this possibility. Is it possible to make our code written in code and string compile and make it become Executable and can operate without the use of server such as Apache. The OS environment will be Windows family. ...

How to see the code generated by the compiler

Guys in one of excersises (ch.5,e.8) from TC++PL Bjarne asks to do following: '"Run some tests to see if your compiler really generates equivalent code for iteration using pointers and iteration using indexing. If different degrees of optimization can be requested, see if and how that affects the quality of the generated code"' Any ...