Top "Compiler-theory" questions

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).

What is an example of a lexical error and is it possible that a language has no lexical errors?

for our compiler theory class, we are tasked with creating a simple interpreter for our own designed programming language. I …

compiler-theory jflex
Steps to creating an NFA from a regular expression

I'm having issues 'describing each step' when creating an NFA from a regular expression. The question is as follows: Convert …

theory compiler-theory nfa
What's the difference between parse tree and AST?

Are they generated by different phases of a compiling process? Or are they just different names for the same thing?

compiler-construction terminology compiler-theory abstract-syntax-tree parse-tree
What does S-attributed and L-attributed grammar mean?

I'm reading a compiler book and kinda confused when it says "a S-attribute grammar is also a L-attribute grammar". Couldn't …

compiler-theory
What programming languages are context-free?

Or, to be a little more precise: which programming languages are defined by a context-free grammar? From what I gather …

compiler-theory context-free-grammar
Are there such a thing as LL(0) parsers?

I saw a question somewhere asking the difference between LL(0) and LR(0) parsers. Is there such a thing as LL(0) …

parsing compiler-theory
Is there a way to compile C++ to C Code?

I have a program which is configured by the user by using C++ classes and the same class should be …

c++ c compiler-construction compiler-theory
Scala "<-" for comprehension

I have found that Scala always has a "natural explanation" to anything. Always something like "ohh, but that's just a …

scala loops compiler-theory for-comprehension
Why can't dead code detection be fully solved by a compiler?

The compilers I've been using in C or Java have dead code prevention (warning when a line won't ever be …

compiler-theory
(When) Should I learn compilers?

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 …

compiler-theory