Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
3 answers
116 views

C Compilers -- Indirection with Multidim Arrays

By definition, in every standard of C, x[y] is equivalent to (and often compiled as) *((x)+(y)). Additionally, a name of an array is converted to an address operator to it -- so if x is an array, it ...
Popeye Otaku's user avatar
2 votes
1 answer
1k views

Writing a compiler in C#, generating C vs IL? [closed]

I have been wanting to create my own programming language and I am looking to start writing a basic compiler. I am doing this purely for learning purposes. I will be writing the compiler in C#. I ...
user3574076's user avatar
0 votes
3 answers
462 views

what compiler should I use as case study for self studying compiler principles techniques [closed]

I decided to start studying compiler theory but the problem is that I want a compiler for any language in order to track each of lexical analyzer output. syntax tree. intermediate representation. code ...
u185619's user avatar
  • 287
3 votes
0 answers
115 views

Where can I find a simple and easy to read x86 backend? [closed]

Currently I'm working in a simple code generator to output an assembly-like language. Background: I've already working part of a register allocator but now I need to deal with instructions like mul/...
The Mask's user avatar
  • 17.5k
9 votes
1 answer
806 views

Code generation for expressions with fixed/preassigned register

I'm using this (see below) algorithm(take idea from this answer) to code generation from a tree. I'm targeting x86 arch, now I need to deal with mul/div instructions which uses registers eax/ebx as ...
The Mask's user avatar
  • 17.5k
4 votes
1 answer
2k views

Code generator for expressions using Sethi-Ullman algorithm

Give a AST tree, I want to generate an assembly-like language. I'm trying using Sethi-Ullman algorithm but I have some questions in the algorithm implemetation. What should I do when I run out of ...
The Mask's user avatar
  • 17.5k
0 votes
2 answers
1k views

Generate C struct constructors automatically?

I want to implement a new language, and I would like to do it in C, with the famous flex+yacc combination. Well, the thing is, writing the whole AST code is very time consuming. Is there a tool that ...
Victor's user avatar
  • 385
1 vote
2 answers
287 views

What tools/IDE/languages exists for generating C-code

I wanted to know more about tools that assist in writing code-generators for C. Essentially how do we achieve functionality similar to c++ templates.
Kabira  K's user avatar
  • 2,007
15 votes
5 answers
4k views

What alternative syntax exist for C/C++? (think SPECS or Mirah)

I wondered if there are any simpler or more powerful syntax for C or C++. I have already come across SPECS. That is an alternative syntax for C++. But are there any others and what about C? It could ...
Erik Engheim's user avatar
  • 8,532
4 votes
4 answers
3k views

Compiler design- code generation for expressions with multiple operands

I am in the middle of coding up a compiler for a C like language. I have gotten past syntax and semantic checking and I am beginning the code generation phase. The final code that I have to ...
beanyblue's user avatar
  • 171
1 vote
2 answers
5k views

Code generation for "if" statements - compilers

I am in the middle of developing a compiler for a C like language and am having some difficulties in the semantic analysis and code generation phases. My questions are the following: 1) For an if ...
beanyblue's user avatar
  • 171
59 votes
1 answer
10k views

How does C-- compare to LLVM?

After learning a bit of how LLVM work I'm really excited about how portable low-level code can be generated and how modular this 'thing' is built. But I discovered today the existence of C-- that ...
Alois Cochard's user avatar