Description

DMD Compiler Frontend

Package Information

Version0.0.7 (2016-May-06)
Repository https://github.com/yebblies/ddmd
LicenseBSL-1.0
CopyrightCopyright © 1999-2015, Digital Mars
AuthorsWalter Bright
Registered byDaniel Murphy
Dependencies none

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

Overview:

This project is a port of the DMD frontend, automatically translated from C++ to D using magicport2. The current version is based on dmd 2.067.

This project is designed to be built with dub. (dub package)

Currently only the lexer and some support modules are included.

This project may eventually be merged into dmd upstream development. No stable API is provided.

As the code is automatically generated, pull requests should be made against upstream.

Warnings and deprecations currently need to be disabled for the code to compile successfully.

Example:

{
    "name": "ddmdlexertest",
    "dependencies": {
        "ddmd": ">=0.0.7"
    }
}
import std.stdio;
import std.file;

import ddmd.tokens;
import ddmd.lexer;

/////////////////////////

void main()
{
    string data = "void blah() {} // stuff";
    auto l = new Lexer("myfile", data.ptr, 0, data.length, 0, 0);
    l.nextToken();
    do
    {
        printf("token: %s\n", l.token.toChars());
    }
    while (l.nextToken() != TOKeof);
}

Available versions

0.0.7 0.0.6 0.0.5 0.0.4 0.0.3 0.0.2 0.0.1 ~master