compiler

Syntax directed translation, unable to understand the concept

Hya , I am currently studying compiler creation , in which i am studying a chapter called "syntax Directed Translation" and unable to grasp one concept from this chapter. I have already attached the scanned pages of book and the topic in the book is "Top-Down translation" Here are the scanned pages: http://rapidshare.com/files/31480...

Compiling Twice with Delphi 6 and getting the same checksum on the binary

For the purposes of binary / source code verification, i'd like to be able to make two compiles on the same computer 2 weeks apart and have the binaries be identical and thus pass some checksum test. So far I've found that most likely the timestamp will be written by the compiler into the binary. I can work around this by doing the com...

Which most common extensions are there (or used) to ANSI C?

You can put a link to comparison matrix or lists of extensions available to main compilers. If none of this is available, you could write a list of extension you use or like in your favorite compiler. ...

boost::any test code compiles with Sun CC but not g++

The following noddy test code: #include <iostream> #include <list> #include <boost/any.hpp> #include <boost/foreach.hpp> #include <typeinfo.h> using boost::any_cast; using std::cout; using std::cerr; typedef std::list<boost::any> many; template <typename T> inline bool is_any(const boost::any& op) { return (op.type() == typeid(T)); ...

C++ CPU Register Usage

In C++, local variables are always allocated on the stack. The stack is a part of the allowed memory that your application can occupy. That memory is kept in your RAM (if not swapped out to disk). Now, does a C++ compiler always create assembler code that stores local variables on the stack? Take, for example, the following simple code:...

Preserving the Execution pipeline

Return types are frequently checked for errors. But, the code that will continue to execute may be specified in different ways. if(!ret) { doNoErrorCode(); } exit(1); or if(ret) { exit(1); } doNoErrorCode(); One way heavyweight CPU's can speculate about the branches taken in near proximity/locality using simple statistics - I...

Hash tables optimization

Hi In several hash table implementations I've seen the usage of heuristics like "transpose" or "move to front" for items in a bucket. What are the advantages of using such heuristics? I could't figure it out myself. Which other optimizations can be done at the hash table / bucket level, why, and under which circumstances? Optimizing...

Grammatica Parsing Error, Wrong Expected Encoding?

I'm trying to use grammatica to generate a C# parser for a language I'm attempting to build (hobby project). However, everytime I run the grammatica parser, I get an error at line 1 position 1, "unexpected character 'x'" where x is some strange ASCII character (looks kind of like an 'n') The grammatica output shows 3 such strange charac...

How can I learn about compiler theory - online/free resources

I'm interested in learning - at depth - about compiler theory... parsing EBNF LALR? Are all terms I'm familiar with but don't really understand how to actually implement/use.. I'm looking for links, tutorials, and other resources; all online, preferably all free... I'm more interested in simple / complete implementations, than comp...

Cache java compilation

Is there any posibility to cache java compilation like ccache does for C or C++ compilation? I have a lot code to compile, and I compile the same code many times, so it took a lot of time. So I thought to cached it to speed up. ...

Error in building project

Hi, While building a c++ project for windows mobile 6.0 , i am getting an error fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'THUMB' i don't no the reason why this error is coming.. i do Google a bit.. since i hv not much idea about instruction set, its tough for me to find.. it will be helpful if ...

Compiling for both Intel and PPC CPUs on OSX

I have a MacBook Pro with a 64-bit Intel Core 2 Duo processor, and I'm using gcc (i686-apple-darwin9-gcc-4.0.1) to compile executables which I can run ok on my own machine. Recently someone tried to run my application on a PowerBook G4 and got a 'Bad CPU type in executable' error, which I think is because their CPU is PPC rather than Int...

c statements not recognized in yacc file

On some linux machines when I compile my yacc program it works fine. However, on other machines, I noticed that none of the c statements that are interspersed with the grammar rules are ever executed, even printf. What could be the problem? I noticed that on these machines I have to take out the -ly option because it gives an error if...

Similar syntax causes strange, repeated compile errors when building PHP from source on Windows

I am trying to build PHP from source per these instructions. The configure works really well, but when I get to the nmake part, things fall apart. I have no idea why I am getting errors about struct's, the lines referenced are functions! I have put the problematic zend_interfaces.c here. Zend\zend_interfaces.c(320) : error C2332: 'str...

Why won't OpenCV compile in NVCC?

Hi there I am trying to integrate CUDA and openCV in a project. Problem is openCV won't compile when NVCC is used, while a normal c++ project compiles just fine. This seems odd to me, as I thought NVCC passed all host code to the c/c++ compiler, in this case the visual studio compiler. The errors I get are? c:\opencv2.0\include\open...

A proposal to add statemachine support to C++-like language

Lately as part of my day job I've been learning IBM Rhapsody and using it to generate code in C++ from the UML. Yesterday it struck me that it might be cool to think about adding state machine support to my C++ compiler, so I jotted a few notes here: http://ellcc.org/wiki/index.php/State%5Fmachines%5Fand%5FActive%5FClasses My motivatio...

Can gcc on Ubuntu on a 64-bit machine generate an executable where long is 32-bits?

In other words is compilation with data-model LLP64 possible in this environment? Please note that my pointers should be 64-bit. ...

C++0x, Compiler hooks and hard coded languages features.

I'm a little curious about some of the new features of C++0x. In particular range-based for loops and initializer lists. Both features require a user-defined class in order to function correctly. I came accross this post, and while the top-answer was helpful. I don't know if it's entirely correct (I'm probably just completely misunderst...

Error during compiling android source code using make command

Hi, I m trying build android source code 1.6. I got following error. frameworks/base/core/java/com/avaya/endpoint/socialnetwork/TwitterService.java:198: package IListTwitterService does not exist private final IListTwitterService.Stub myListTwitterServiceStub = new IListTwitterService.Stub() { ...

How to reference on cobol projects without compiler?

Is it possible to make different Configuration of one project one with and other without a installed cobol compiler? I have a big project general written in VB.Net with some underprojects written in cobol. Is it possible to create different Configs like "DebugVB" for the VB-Programmers and "DebugCob" for the cobol cracks? I think of a...