Menu

- Learn
- Documentation
  - Language Reference
  - Library Reference
  - Command-line Reference
  - Feature Overview
  - Articles
- Downloads
- Packages
- Community
  - Blog
  - Orgs using D
  - Twitter
  - Forums
  - IRC
  - Wiki
  - GitHub
  - Issues
  - Get involved
  - Contributors
  - Foundation
  - Donate
  - Sponsors
- Resources
  - Tour
  - Books
  - Tutorials
  - Tools
  - Editors
  - IDEs
  - Visual D
  - Acknowledgments
  - D Style
  - Glossary
  - Sitemap

Search
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

# dmd.frontend

Compiler implementation of the D programming language.
This module contains high-level interfaces for interacting with DMD as a library.
Authors:
Walter Bright
License:
Boost License 1.0

Source id.d

Documentation https://dlang.org/phobos/dmd_frontend.html

Coverage https://codecov.io/gh/dlang/dmd/src/master/src/dmd/frontend.d

void `addImport`(string `path`);
  Add import `path` to the global.`path`.
  Parameters:

  string `path` | import to add

string `findDMDConfig`(string `dmdFilePath`);
  Searches for a dmd.conf.
  Parameters:

  string `dmdFilePath` | path to the current DMD executable

  Returns:
  full path to the found dmd.conf, null otherwise.
string `findLDCConfig`(string `ldcFilePath`);
  Searches for a ldc2.conf.
  Parameters:

  string `ldcFilePath` | path to the current LDC executable

  Returns:
  full path to the found ldc2.conf, null otherwise.
string `determineDefaultCompiler`();
  Detect the currently active compiler.
  Returns:
  full path to the executable of the found compiler, null otherwise.
auto `parseImportPathsFromConfig`(string `iniFile`, string `execDir`);
  Parses a dmd.conf or ldc2.conf config file and returns defined import paths.
  Parameters:

  string `iniFile` | `iniFile` to parse imports from
  string `execDir` | directory of the compiler binary

  Returns:
  forward range of import paths found in `iniFile`
auto `findImportPaths`();
  Finds a dmd.conf and parses it for import paths. This depends on the $DMD environment variable. If $DMD is set to ldmd, it will try to detect and parse a ldc2.conf instead.
  Returns:
  A forward range of normalized import paths.
  See Also:
  determineDefaultCompiler, parseImportPathsFromConfig
Module `parseModule`(string `fileName`, string `code` = null);
  Parse a module from a string.
  Parameters:

  string `fileName` | file to parse
  string `code` | text to use instead of opening the file

  Returns:
  the parsed module object
void `fullSemantic`(Module `m`);
  Run full semantic analysis on a module.
string `prettyPrint`(Module `m`);
  Pretty print a module.
  Returns:
  Pretty printed module as string.

Copyright © 1999-2018 by the D Language Foundation | Page generated by Ddoc on Sat Apr 14 16:39:21 2018