compiler

How do i save an compile a program in befunge-93?

How do i save an compile a program in befunge-93? what do i need to save the file as? (like: fileName.what) How do i compile it? ...

ANTLR lexer mismatches tokens

I have a simple ANTLR grammar, which I have stripped down to its bare essentials to demonstrate this problem I'm having. I am using ANTLRworks 1.3.1. grammar sample; assignment : IDENT ':=' NUM ';' ; IDENT : ('a'..'z')+ ; NUM : ('0'..'9')+ ; WS : (' '|'\n'|'\t'|'\r')+ {$channel=HIDDEN;} ; Obviously, thi...

Java: Check if a given method name exist in compile time

I'm developing a utility class to handle Actions from Java Swing components; I would like to know if there is a way of checking if a given method name (that will be accessed by reflections) exists in compile time, and show a compiler error if not? --update Ok, looks like I was not clear, lets talk about the details: I have a class cal...

Why would the VB.NET compiler think an interface isn't implemented when it is?

Update I don't think I was clear enough when I originally posted this quesion. Take a look at these screenshots. (Link to bigger screenshot here) Notice the portions I've boxed in red. The class displayed here does implement INotifyPropertyChanged, but the VB compiler seems to think that the PropertyChanged event as declared does no...

Is it possible to call C# lexical/syntactic analyzers without compilation?

Considering this question of SO, where whole C# in-memory compiler is being called. When only lexical and syntactic analyzing is required: parse text as a stream of lexemes, check them and exit. Is it possible in current version of System.CodeDom.Compiler, if not - will it be? ...

Compiler: Translation to assembly

I've written an interpreter for my experimental language and know I want to move on and write a small compiler for it. It will probably take the source, go through the same steps as the interpreter (tokenizer, parser) and then translate the source to assembly. Now my questions: Can I expect that every command in my language can be 1:1...

C compiler producing lightweight executeables

I'm currently using MSVC for C++ but as I'm switching to C to write a very performance-intensive program (interpreter) I have to search for a fitting C compiler. I've looked at some binaries produced by Turbo-C and even if its old they seem pretty straigthforward and optimized. Now I don't know what the best compiler for building an in...

C++ compilers and back/front ends

Hello. for my own education I am curious what compilers use which C++ front-end and backend. Can you enlighten me where the following technologies are used and what hallmarks/advantages they have if any? Open64 - is it backend, front-end, or both? Which compilers use it? I encounter it in cuda compiler. EDG - as far as I can tell thi...

How do I remove the alert: "...may not respond to..."

In my .m file I call a method that is inside the same .m file. In the header I have the correct import for the header but I keep getting this alert: What am I doing wrong? What should I do in order to make this error disappear? I'm kinda lost here :-( Even if I changed this to: NSString *path = [[NSString alloc] initWithString:...

Is there a standard lexer/parser tool for Python?

A volunteer job requires us to convert a large number of LaTeX documents into ePub format. It's a series of open-source fiction book which has so far only been produced only on paper via a print on demand service. We'd like to be able to offer the book to users of book-reader devices (such as Kindle) which require the ePub format for bes...

Grammar that is LR(1) but not LL(1)

This might look like a basic question to some of you but I expect intelligent replies here. Why can't a LR(1) grammar with left recursion or the LR(1) grammar that is not left factored be LL(1)? ...

Knowledge for writing a compiler for Win32

I have created an interpreter for my programming language (educational) and now I'd like to go one step further and create a compiler for it. I know that this is pretty hard work. What I already know is: I need to translate my input language to assembler A lot, isn't it? Now what I don't know is: What assembler do I need to create...

Example compilers

I'm searching for the source code of a compiler capable of creating Win32 programs from an input program in a programming language (It doesn't matter which, maybe the simpler the better) Yet I can't find anything right for me and huge compilers like GCC make me extremely confused as they have so many features that I don't know where to ...

How is a lattice used by a compiler

In my graduate class on compiler construction we've been introduced to the concept of a lattice. Three lectures have been devoted to lattices and so far it seems like an interesting tangent, but the dilemma is that it doesn't really help explain how a compiler uses a lattice to solve a concrete problem. We have already covered parsing ...

Visual Studio 2010 + Target Framework 3.5. What version of c# compiler will be used?

Question is in title. 3.0 or 4.0? ...

Integrating a Custom Compiler with the Visual Studio IDE

Background: I want to create a custom VB compiler, extending the "original" compiler, to handle my custom compile-time attributes. Question: after I've created my custom compiler and I've got an executable file capable of compiling VB code via the standard command-line interface, how do I integrate this compiler with the Visual Studio I...

Table of Identifiers

I need to make a table of identifiers using the method - a combination of a binary tree and hash addressing, but I can not find the information on this method. Could you suggest where I can find information on this method or simple example in C/C++ or another programming language. . ...

Java: how to access assignments in try-catch -loop?

The problem drives me to the big try-catch loops. I want smaller. So how to access assignments in the loops? $ javac TestInit2.java TestInit2.java:13: variable unknown might not have been initialized System.out.println(unknown); ^ 1 error Code import java.util.*; import java.io.*; public class TestInit2 { p...

Why are forward declarations necessary?

Possible Duplicate: Should C++ eliminate header files? In languages like C# and Java there is no need to declare (for example) a class before using it. If I understand it correctly this is because the compiler does two passes on the code. In the first it just "collects the information available" and in the second one it check...

hand coding a parser

For all you compiler gurus, I wanna write a recursive descent parser and I wanna do it with just code. No generating lexers and parsers from some other grammar and don't tell me to read the dragon book, i'll come around to that eventually. I wanna get into the gritty details about implementing a lexer and parser for a reasonable simple ...