A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for wanting to transform source code is to create an executable program.
Questions tagged [compiler-theory]
200 questions
0
votes
1 answer
In GNU GCC 4.5.3 type casting int to short
I would like to know, when two integers are multiplied and result is typecast to short and assigned to short, what will the compiler resolves it to? Below is the code snippet
int a=1,b=2,c;
short x=3,y=4,z;
int p;
short q;
int main()
{
c = a*b;…
![](../../users/profiles/1235791.webp)
user1235791
- 41
- 1
- 5
-1
votes
1 answer
May multi-Pass compilers compile big programs in memory without running out of it?
I’m designing a multi-pass compiler for a language and the AST is completely kept in memory.
This means that I’m saving the entire AST in memory, no matter how many files the program is composed of.
I’m thinking about potential BIG programs that are…
![](../../users/profiles/4767670.webp)
NoImaginationGuy
- 1,669
- 10
- 22
-2
votes
1 answer
Interpreter and Compiler
Can any one help me in figuring out what compilers and interpreters are? And what their difference is ? Appreciate it if explained for Java beginner as I am one.
![](../../users/profiles/11428060.webp)
Amanuel Getachew
- 105
- 2
-2
votes
2 answers
unique synthesised name
I would like to generate various data types in C++ with unique deterministic names. For example:
struct struct_int_double { int mem0; double mem1; };
At present my compiler synthesises names using a counter, which means the names don't agree when…
![](../../users/profiles/518287.webp)
Yttrill
- 4,405
- 1
- 16
- 26
-4
votes
3 answers
Confusion regarding Handling of Different Pointers by Compiler
I have a couple of confusions regarding pointers.
I am putting all of them in the form of question.
1) How does compiler handle various pointers?
2) How does a compiler figure out the data type of pointers passed at compile time?
All I know,…
![](../../users/profiles/806418.webp)
sarthak
- 303
- 1
- 11