Tags "compiler-construction" Result

Compiler Construction: Explicit Parse trees

How can a compiler do without constructing an explicit parse tree? What are the benefits and drawbacks of explicit parse tree construction? I know that compiler can do construction without explicit parse tree by using SDT and running the semantics associated with it during parsing. But i want to know the benefits and drawbacks of the explicit pars

it1352 2 2020-07-02

return type of the constructor in C

I know that there is no return type of the constructors in C However, the code below compiles right. What is returned by the constructor in the code below? class A{ public: A() {} } A a = A(); //what is returned by A() here, why? Is there any conflict here? Solution Nothing is returned from the constructor. The syntax A() is not a co

it1352 1 2019-05-11

static member object initialization

Consider the following program: #include <iostream> using namespace std; class Test { static Test t; static Test init_Test( ) { return t; } Test(const Test & rhs) { cout << "copy ctor" << endl; } }; Test Test::t = init_Test( ); int main() { return 0; } This program compiles fine under both g and VC 2005 Expr

it1352 0 2019-06-25

Different compilers, different output?

I have a bit of c code that I've been working on in Xcode on my mac. I then wanted to work with it on a Windows machine and compile it with TinyC. When I run it, the output is different. Is it possible that this is due to using different compilers? Thanks! EDIT 1 The code is a simple script that opens up a wav file to throw all the samples i

it1352 3 2019-05-14

How to code a compiler in C?

I am coding a compiler in C, and I have read all about compilers in the Dragon book. But I am finding it really hard to implement, and I have no clue as to where to start. Even when it comes to lexer part, so would love to know a step by step method on the basis of code writing to write a compiler in C!! What would you suggest I do next? Solutio

it1352 2 2019-05-14

Are there any ASM compilers?

I know ASM is generaly run through an assembler and result in a more or less one to one mapping to the final binary but that's not what I'm thinking of. Does anyone make a tool that treats ASM (or object files) as a complied language that it can perform the full gamut of optimizations on? While such a tool might not be particularly useful in and o

it1352 0 2020-10-06

ambiguous grammer Dangling-Else

in compiler constructions one of the main ambiguity problems is Dangling-Else as mentioned in compiler principles and techniques book by Aho that the grammar for the Dangling-Else can't be used with ll(1) parser. and my question is it true that it cant handled to be ll(1) Solution Its true, it can't be parsed by LL(k) or by LALR(k) in their pure

it1352 2 2019-05-14

frame pointer omitting ? Any risk?

I do always turn on this feature in my compilers, it helps a lot in debugging while reading through the assembly code which is more clean. I think it doesnt have a big impact on speed optimization side, giving CPUs ability to pipelining, but at least it does open a new opportunity for register allocation, as such, gaining a new free register EBP (n

it1352 0 2019-05-14

compiler design

Possible Duplicate: Learning to Write a Compiler How to design simple compiler? I want to design compiler for MCA project. Solution Read: The Dragon Book

it1352 1 2019-05-14

What is the *conceptually* smallest *compiler* that can compile itself?

In the spirit of this question, I'd like to ask a similar question, but about compilers, not about interpreters. What is the conceptually smallest compiler that can compile its own code? When I say "conceptually smallest" I mean that it uses only very basic concepts and builds up from there, rather than that it contains very short code. An examp

it1352 0 2020-10-06