20
голосов
3ответов
6582 просмотров

Как написать компоновщик

Я написал компилятор для C, который выводит байтовый код. Причина этого заключалась в том, чтобы иметь возможность писать приложения для встроенной платформы, которая работает на нескольких платформах. У меня есть компилятор и ассемблер. Мне нужно написать компоновщик, и я застрял. Форм...

3
голосов
3ответов
364 просмотров

Написание компилятора на родном языке

Мне нужно реализовать свой собственный скомпилированный язык программирования Windows. Есть ли более простой способ перевести его в ASM или перевести на C / C ++, а затем использовать компилятор C / C ++? Есть ли SDK или что-то в этом роде? Спасибо.

24
голосов
2ответов
5212 просмотров

Does anyone have a working B compiler?

Does anyone know where I could get a good B compiler? I have searched for a B compiler for some time now, but have been having some difficulty finding anything complete for a Windows or Linux system. Here is an example of B: main( ) { auto a, b, c, sum; a = 1; b = 2; c = 3; sum = a+b+c; putnu...

9
голосов
2ответов
415 просмотров

Why is non-type template parameter expression handling inconsistent across compilers?

Here is something I observed across various compilers. It seems there are compiler bugs. template <int I> struct X { }; int main(void) { X<(16 > 1)> a; // Works on vc9, works on g++ 4.1.2, works on Comeau 4.3.10.1 X<(int(16) > 1)> b; // Works on vc9, works on ...

1
голосов
2ответов
405 просмотров

problem while compiling java code on network drive, it creating class files in lowercase

i am using clear-case source control, i created my vob repository(which has my java source code) on the network drive, when i rum my javac compiler on the source it compiles fine but it is generating class files in lowercase where it should start with uppercase letter. i have seen the code every ...

3
голосов
5ответов
887 просмотров

Compilers targeting .pyc files?

Out of curiosity, are there many compilers out there which target .pyc files? After a bit of Googling, the only two I can find are: unholy: why_'s Ruby-to-pyc compiler Python: The PSF's Python to pyc compiler So… Are there any more? (as a side note, I got thinking about this because I wan...

3
голосов
1ответов
509 просмотров

What is the problem when javac compiler creates a jarfile with lowercase class file names?

When I run the javac compiler it compiles code and creates a JAR file, but the names of the class files inside the JAR are all in lower case. However, the classes within the source files have both lower and upper case names. The result of this is that I cannot compile other projects which are dep...

2
голосов
2ответов
1359 просмотров

High, Fluctuating '% Time in JIT' on Precompiled ASP.NET Website

With a 150 *.dll ASP.NET website that's precompiled (updatable), what are some possible causes for a '% Time in JIT' that is often quite high (> 60%) and fluctuating long after the application has warmed-up (all functionality accessed) and without app restarts or file changes that might gener...

0
голосов
3ответов
480 просмотров

What does fatal compile error C1083: Cannot open source file mean?

Error 1 fatal error C1083: Cannot open source file: 'FpDebug/BalanceGrabber.pch': No such file or directory c1xx

6
голосов
3ответов
405 просмотров

Is it possible to write code that will cause long compile times?

I'm working on our continuous integration system, and I'm interested in simulating our systems handling of unexpectedly long compile times. Is there any way to cause the compilation to take a long time to complete? Or perhaps force it into some sort of loop that would take a large amount of time ...

14
голосов
8ответов
974 просмотров

Is there any self-improving compiler around?

I am not aware of any self-improving compiler, but then again I am not much of a compiler-guy. Is there ANY self-improving compiler out there? Please note that I am talking about a compiler that improves itself - not a compiler that improves the code it compiles. Any pointers appreciated! Side-no...

0
голосов
2ответов
561 просмотров

The C# compiler and memory management

I'm doing a compiler design class on the topic of memory management. I am reading about garbage collection and noticed that most of that low level stuff takes place with C/C++ code. I have a few questions about the c# compiler. Was .net framework part for memory management written in c/c++? How...

2
голосов
4ответов
204 просмотров

Write a compiler for a language that looks ahead and multiple files?

In my language I can use a class variable in my method when the definition appears below the method. It can also call methods below my method and etc. There are no 'headers'. Take this C# example. class A { public void callMethods() { print(); B b; b.notYetSeen(); public void print() { C...

6
голосов
7ответов
4301 просмотров

Using a pure C++ compiler versus Visual C++

I searched around for the answers to these questions, but I have had little luck. So, I thought I would post them here to get some clarification. If this is a duplicate, please let me know, and I will close this. Okay, with that said, I would like to begin learning C++. I come from a C# backg...

5
голосов
3ответов
1695 просмотров

g++ doesn't like template method chaining on template var?

I'm trying to compile with g++ some code previously developed under Visual C++ 2008 Express Edition, and it looks like g++ won't let me call a template method on a reference returned by a method of a template variable. I was able to narrow the problem down to the following code: class Inner { pu...

18
голосов
4ответов
86887 просмотров

Error: expected constructor, destructor, or type conversion before ';' token?

I'm trying to compile my code to test a function to read and print a data file, but I get a compiling error that I don't understand - "error: expected constructor, destructor, or type conversion before ';' token". Wall of relevant code-text is below. struct Day { int DayNum; int TempMax; ...

3
голосов
3ответов
385 просмотров

what is the most unobtrusive way of using precompiled headers in Visual C++?

Say I have a single project, with files A.cpp, B.cpp, C.ppp and matching header files (and that's it). The C++ files include system headers or headers from other modules. I want to compile them to a library with command line actions (e.g., using Make), using 'cl', with the precompiled headers fe...

1
голосов
1ответов
510 просмотров

Compiling MATLAB 2009b applications to Windows Executables

Does anyone know how to add full (n.n.n.n) Windows file version information to COM dlls and .Net Assemblies compiled from MATLAB? The resulting dlls do not seem to contain a VersionInfo structure and so utilities like Resource Hacker don't work.

2
голосов
2ответов
245 просмотров

Compilation error while compiling class within another

I have two classes Hello1 and Hello, and I'm calling class Hello1 constructor within Hello class, but when I trying to compile the Hello class with command javac Hello.java I'm getting compile time error: Hello.java:6:cannot find the symbol symbol: class Hello1 location: class Hello Hello1=ne...

1
голосов
4ответов
297 просмотров

Do Implict Function Declarations in C Actually Generate Object Code?

In the course of this discussion about casting the return value of malloc many people have claimed that the implicit declaration of malloc would cause the return value to be converted to int then reconverted back to T* possibly resulting in truncation of the pointer in situations where: sizeof(i...

27
голосов
4ответов
2678 просмотров

Where can I find C# 3.0 grammar?

I'm planning to write a C# 3.0 compiler in C#. Where can I get the grammar for parser generation? Preferably one that works with ANTLR v3 without modification.

1
голосов
1ответов
266 просмотров

C# assembly has different sizes after each compilation (Visual Studio)

Here is a little something we noticed today and we do not have an explanation for it. My co worker compiled his current project (C#/WinForms/Visual Studio) and the dll was about 170 kb in size. He compiled the same project again and the dll was 220 kb in size. He did not touch anything else just...

9
голосов
3ответов
5321 просмотров

self-taught compiler courses / good introductory compiler books?

Does anyone know of online course / university lectures that comprise a typical compiler course? I've had theory of computing but unfortunately my school didn't offer a course in compiler construction. I know there are lectures out there; I was hoping for recommendations for particularly good...

2
голосов
9ответов
553 просмотров

C# Compiler Behavior Question?

Hey everyone, in the following code, what should the result of d be after the second expression? int d = 1; d += d++; One would assume d is 3 afterwards but the unary increment d++ doesn't seem to take effect and d retains a value of 2. Is there a name for this bug? Does it ...

17
голосов
4ответов
750 просмотров

Shouldn't you treat the bin folder as being transient?

I've always taught myself and others to think of the bin folder as being transient. That is you should be able to delete it and next time you rebuild it gets recreated and any references get copied into it without any hassle And not to put your eggs all in one basket. Or in this case don't put ...

5
голосов
4ответов
488 просмотров

Is there any none .NET/CLI based implementation of a C# compiler?

I just want the ECMA language translated into native code with the fundamental runtime (garbage collector) etc. I'm not talking about .NET just the language specification of C#. Using C# like any other native compiling language as a langauge alternative for Delphi, D or C++ because it offers gen...

6
голосов
4ответов
1342 просмотров

What is the good approach to build a new compiler?

I have an experience about the compiler phrases and I interested in Programming Languages & Compilers field and I hope somebody gives me some explanation about what is the good approach to write a new compiler from scratch for a new programming language ? (I mean STEPS).

1
голосов
6ответов
6717 просмотров

Conditional Jump instructions?

Doing a compiler design course: What is meant by a conditional jump instruction? I am C/C++ based programmer so if there is any code samples in that paradigm you could share to help me understand this better. What do they mean by unlimited conditional jump instructions? An example of a stateme...

2
голосов
2ответов
326 просмотров

hardware environment for compilation performance

This is a rather general question .. What hardware setup is best for large C/C++ compile jobs, like a Linux kernel or Applications ? I remember reading a post by Joel Spolsky on experiments with solid state disks and stuff like that. Do I have to have rather more CPU power or more RAM or a f...

9
голосов
19ответов
2346 просмотров

How to create a language these days?

I need to get around to writing that programming language I've been meaning to write. How do you kids do it these days? I've been out of the loop for over a decade; are you doing it any differently now than we did back in the pre-internet, pre-windows days? You know, back when "real" coders coded...