compiler

Building a Compiler for a DSL using ANTLR and the Antlr CSharp Target

I'm in the job of writing a compiler which compiles a project-specific DSL (with the features of a basic scripting language) into an project-specific assembler language. The platform is written in C#, so a native .NET-Compiler would be the perfect solution. I already did a lot of research and it seems ANTLR would fit in the job of build...

compiler and linker difference

what is the difference between compiler and linker in c? ...

ASP.Net 4.0 App Builds Successfully But Has Errors (?)

I have an annoyance, not really a problem. In my ASP.Net 4.0 app, when I compile I get some errors of the type "Validation (CSS 2.1)". These fill up my Error List but yet the build still succeeds. So two questions: 1. Why does my build succeed if it lists errors? If it truly is a successful build, why are these errors reported as Wa...

Mac OS X Mono ASP.NET and C# compilation process

Hey everyone, I am trying to (temporarily!) do some ASP.NET and C# compiling on my iMac. Haha, it's so funny trying to do this on an iMac, it feels so.. wrong! Anyway, I've found that Mono is the best way to do this, in my opinion. I have a simple ASP.NET page with the following code: 1 <%@ Page Language="C#" %> 2 <html> 3 ...

ASP.NET and C# compilation error while attempting to instantiate a new object from a class

I have this simple ASP.NET page here: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Tree.aspx.cs" Inherits="CoconutTree.One" %> <html> <head> <title>Planting Trees</title> <script runat="server"> protected void Page_Load(Object Source, EventArgs E) { string msg = "Let's plant some trees!<br/>"; ...

Is this a bug in the C# 4.0 compiler?

This code compiles successfully, but I think it should fail to compile. Also, when you run it you get a NullReferenceException. The missing code is the "new Bar" in the initialization of the Bar property. class Bar { public string Name { get; set; } } class Foo { public Bar Bar { get; set; } } class Program { static void ...

a macro to extract characters of its input text and generate a code using them.

Is there any macro that can get a text as input like "abc" and by text I literally mean text like the one mentioned not an array or anything else, then extract characters of that text and generate a selective piece of code like ones below at compile time: first example of a piece of code : Func1(a); Func2(b); Func3(c); second example ...

user defined data type/operations to CPU instruction set

Hi, In any programming environment,what ever the data type I am going to choose finally the CPU will do only the Arithmetic operations(addition/logical operations). How this transition(from user defined data type/operations to CPU instruction set) happens and what is the role of compiler,interpreter,assembler and linker in this life cy...

Extending the Mono C# compiler: is there any documentation or precedent?

I am currently involved in some interesting programming language research which has, up until now, centred around extending the upcoming Java 7.0 compiler with some very powerful programmer-productivity-based features. The work should be equally applicable to related programming languages such as C#. I'm currently scoping out the option...

Deocde and dispatch interpretation vs Threaded interpretation

Hi, I am trying to understand the practical difference during the execution of a program in Deocde and dispatch interpretation and Threaded interpretation. Example of both will really help. I understand how Java bytecode works and how an assembly language works. But where does DDI and TI fit in? Context: Virtual machines: versatile ...

Can't get Janino compiler to compile files in same directory as jar.

I'm using Janino to compile java files at runtime to use in a program. I'm using netbeans and I can only get it to compile at runtime when I put the directory in the src folder. If I try to compile it using relative paths It won't work. I'm following the example at http://docs.codehaus.org/display/JANINO/Advanced#Advanced-compiler Her...

Compile-time error or runtime error

for example Class B extends A. An object A test= new B (x,y); Then a method that there is only on Class B is invoked on the test object. Will it be a Compile time error or a run time error? Overall what are the different between both errors. ...

Unsafe coerce and more efficient Agda code (-ftrust-me-im-agda)

On the Agda mailing list, Conor McBride asked: is there any way to get hold of operations like a putative trustFromJust :: Maybe x -> x which doesn't actually check for Just and Goes Wrong (in Milner's sense) if fed Nothing? Agda might prove Maybe a == Just1 a, and the intermediate constructor for the sum type could b...

Is there a easier / clearer syntax like Markdown that can compile into LaTeX?

I love LaTeX. Let's get that straight right off the bat. The only thing I'm wishing for is a clearer syntax that compiles into LaTeX, like Markdown for HTML. This is because most of the simple document creation that I do (like taking notes in class), could be faster and improved if I could just type 1/2 instead of \frac{1}{2} and it com...

Why does this divide-by-zero error only occur in optimized code?

I just found a bug that, strangely, occurred only when optimization was turned on (g++ -O2). It was an Arithmetic exception in the following code, when interval was set to zero (from a command line argument): for(int i = 0; i < n; ++i) { if((i + 1) % interval == 0) { // exception here DoSomething(); } } It's obvious that modul...

Open Source Programming Language online interpreter

How can I integrate programming language interpreter / compiler into a website like Codepad.org or Ideone.com? Is there any opensource solution? How do they ensure that the users do not write destructive code? I know that Ideone has an API, but I am more interested in a self hosted solution. ...

Can C++ compilers automatically eliminate duplicate code?

Code duplication is usually bad and often quite easy to spot. I suppose that compilers could detect it automatically in easiest cases - they already parse the text and get the intermediate representation that they analyze in various ways - detect suspicious patterns like uninitialized variables, optimize emitted code, etc. I guess they c...

Is this an F# compiler bug? #2

open System type Foo() = interface Collections.IEnumerable with member x.GetEnumerator () = null type Bar() = interface Collections.IEnumerable with member x.GetEnumerator () = null interface Collections.Generic.IEnumerable<int> with member x.GetEnumerator () = null let xs, ys = Foo(), Bar() ...

Visual Studio 2010 won't compile LINQ properly after power outage reboot

I had a rather large solution properly compiling until my power went out. Now, I have a standard Linq to Sql DataContext class defined in one project, and it compiles properly, however another project that references that assembly refuses to compile Linq properly. I'm getting compile errors like 'DataLayer.AdminDataContext': type use...

How to create a .Net programming language?

I have created a few different full programming languages using some of the various parsing tools available. However, how would someone create a programming language that runs the .Net framework? Would I have to output the .Net IL and compile that or is there a higher level of abstraction? Also, is there an easy way to get the language ...