compiler-theory Questions
2
Solved
I'm curious about which (if any) real-world programming languages have a regular grammar (i.e. the set of all syntactically correct programs is regular).
See also this question: What programming l...
Pelpel asked 11/4, 2011 at 12:34
7
An off-side language is the one where
...the scope of declarations (a block) in that language is expressed by their indentation.
Examples of such languages are Python, Boo, Nemerle, YAML and ...
Glance asked 1/2, 2010 at 16:52
2
Solved
I'm trying to understand how LR1 Parsers work but I came up with a strange problem: What if the grammar contains Epsilons? For instance: if I have the grammar:
S -> A
A -> a A | B
B -> a
...
Juster asked 28/1, 2009 at 8:45
4
Solved
From the Reversible Computing FAQ:
Achieving the maximum possible computational performance for a given
rate of bit dissipation generally requires explicit reversibility not
only at the lowest...
Billbillabong asked 25/4, 2012 at 10:47
9
Solved
Or, to be a little more precise: which programming languages are defined by a context-free grammar?
From what I gather C++ is not context-free due to things like macros and templates. My gut tells...
Millhon asked 22/5, 2009 at 15:31
4
Solved
I saw a question somewhere asking the difference between LL(0) and LR(0) parsers. Is there such a thing as LL(0) parsers? If so, how do they parse without looking at any token?
Kisser asked 9/3, 2011 at 23:51
5
Solved
As is explained in Removing left recursion , there are two ways to remove the left recursion.
Modify the original grammar to remove the left recursion using some procedure
Write the grammar origi...
Michell asked 8/6, 2010 at 17:34
5
Solved
I have a program which is configured by the user by using C++ classes and
the same class should be used to configure a program which
can only use a subset of C99 (Open CL Language).
So my q...
Petrochemical asked 19/2, 2011 at 10:54
3
Solved
I'm having issues 'describing each step' when creating an NFA from a regular expression. The question is as follows:
Convert the following regular expression to a non-deterministic finite-state aut...
Stover asked 5/8, 2012 at 18:58
8
Solved
Are they generated by different phases of a compiling process? Or are they just different names for the same thing?
Enlistee asked 17/2, 2011 at 8:19
1
I'm having trouble building the collection of sets of items for LR(1) parsers with a grammar containing epsilon productions. For example, given the following grammar (where eps stands for epsilon)
...
Godforsaken asked 17/5, 2018 at 14:16
4
Solved
My understanding is like this, definitions:
Translation - having code in some language, generating code in some other language.
Compilaton - translation to a machine code.
Machine code - direct ...
Telegu asked 18/5, 2013 at 9:33
2
Solved
I am writing a parser for a pet project, and for educational purposes, would like to do it by hand instead of using a parser generator. Unfortunately, many online resources (and the compiler course...
Tauto asked 29/7, 2013 at 14:23
2
What are the minimum pumping length for the following languages ?
The empty language
(01)*
10(11*0)*0
1011
011 U 0*1*
Here are my solutions. Please correct me if I'm wrong.
p = 0 because the...
Aishaaisle asked 9/10, 2015 at 0:36
2
I'm reading a compiler book and kinda confused when it says "a S-attribute grammar is also a L-attribute grammar". Couldn't understand. Can someone make it clear (an example should be great). Thank...
Enshrine asked 16/3, 2010 at 22:15
13
Solved
The compilers I've been using in C or Java have dead code prevention (warning when a line won't ever be executed). My professor says that this problem can never be fully solved by compilers though....
Indent asked 21/10, 2015 at 18:14
2
Solved
It came up in another question: What are the programs and parts called by gcc (particularly when compiling C or C++) so that someone might engineer some scheme of intercepting and altering the flow...
Jiva asked 7/2, 2012 at 0:23
5
Solved
Can anyone tell me how I can implement Call By Name in C#?
Convent asked 25/10, 2010 at 21:57
1
Solved
Is it computationally more performant to compare less/greater than over less/greater than or equal to?
Intuitively one could think that less/greater than is marginally better.
Can a compiler use...
Zibet asked 19/11, 2014 at 12:24
4
Solved
for our compiler theory class, we are tasked with creating a simple interpreter for our own designed programming language. I am using jflex and cup as my generators but i'm a bit stuck with what a ...
Rositaroskes asked 14/8, 2010 at 18:57
1
Solved
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...
Closestool asked 18/5, 2014 at 2:36
1
Solved
I am trying to create an example using lambda expression in java and i am using offical JDK8. My example was run successfully. But when i trying to check how the compiler translate lambda expressio...
Stoecker asked 17/4, 2014 at 12:34
9
Solved
According to this http://steve-yegge.blogspot.com/2007/06/rich-programmer-food.html article, I defnitely should.
Quote Gentle, yet insistent executive
summary: If you don't know how
compilers...
Nettie asked 9/4, 2009 at 6:55
1
On the web, there is a lot of examples showing how to construct parsing tables for a context-free grammar from first/follow sets for LL(1) parser.
But I haven't found anything useful related to k>...
Wieren asked 25/1, 2012 at 10:17
2
Solved
What is considered the best approach to unit test a complex unit such as a compiler?
I've written a few compilers and interpreters over the years, and I do find this kind of code quite hard to tes...
Dornick asked 14/3, 2013 at 10:0
1 Next >
© 2022 - 2025 — McMap. All rights reserved.