[CMake] Dependency checking for D

Tim Burrell tim.burrell at gmail.com
Thu Feb 7 18:18:27 EST 2008


> Date: Thu, 7 Feb 2008 19:38:18 +0100
> From: Maik Beckmann <beckmann.maik at googlemail.com>
>   
> While C and C++ dependency tracking uses regular expressions the java and 
> fortran pendants use lex/yacc generated parsers.  
>
> I don't know D very well, but if the language specification forces the import 
> directives to be at the very top of each file like does java, well, than the 
> java parser might be a good bet.
>   

The D imports mostly work exactly like Java:

import module.submodule.Class;

That'll look for the file "module/submodule/Class.d" from all of the 
compiler include paths.

At the top of nearly every D file is a line:

module ModuleName;

Then after that comes the import statements.  Would this module 
declaration cause problems for the Java scanner?

There are some other potential problems though, like D's imports are a 
bit more flexible than Java's, allowing things like public and private 
imports:

public import module.Class;

It also has the ability to rename imports:

import RenamedModule = module.Class;

Even if these do cause problems, I still think that any dependency 
checking would be better than no dependency checking, so... given that 
I'd like to give this a shot, is there a way to convince the Java dep 
checker to look for D files instead of Java?

Thanks,

Tim.


More information about the CMake mailing list