# DMD Source code
This is the source code to the DMD compiler
for the D Programming Language defined in the documents at
https://dlang.org/
These sources are free, they are redistributable and modifiable
under the terms of the Boost Software License, Version 1.0.
The terms of this license are in the file boostlicense.txt,
or see https://www.boost.org/LICENSE_1_0.txt.
If a particular file has a different license in it, that overrides
this license for that file.
-Walter Bright
## Directory structure
| Folder | Purpose |
|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [dmd/](https://github.com/dlang/dmd/tree/master/compiler/src/dmd) | The dmd driver and front-end |
| [dmd/backend/](https://github.com/dlang/dmd/tree/master/compiler/src/dmd/backend) | Code generation for x86 or x86-64. Based on [DMC](https://github.com/DigitalMars/Compiler/)'s backend, but not kept in sync anymore. Not used by [LDC](https://github.com/ldc-developers/ldc) or [GDC](https://gdcproject.org/). |
| [dmd/common/](https://github.com/dlang/dmd/tree/master/compiler/src/dmd/common) | Code shared by the front-end and back-end |
| [dmd/root/](https://github.com/dlang/dmd/tree/master/compiler/src/dmd/root) | Meant as a portable utility library, but ["it wasn't very good and the only project left using it is dmd"](https://github.com/dlang/dmd/pull/9844#issuecomment-498479516). |
DMD has a mostly flat directory structure, so this section aims to divide all source files into logical groups for easier navigation.
The groups are roughly ordered by how late they appear in the compilation process.
Note that these groups have no strict meaning, the category assignments are a bit subjective.
### Driver
| File | Purpose |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [main.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/main.d) | The entry point. Contains `main`. |
| [mars.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/mars.d) | Argument parsing, path manipulation. |
| [cli.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/cli.d) | Define the command line interface |
| [dmdparams.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dmdparams.d) | DMD-specific parameters |
| [globals.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/globals.d) | Define a structure storing command line options |
| [dinifile.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dinifile.d) | Parse settings from .ini file (`sc.ini` / `dmd.conf`) |
| [vsoptions.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/vsoptions.d) | Detect the Microsoft Visual Studio toolchain for linking |
| [frontend.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/frontend.d) | An interface for using DMD as a library |
| [errors.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/errors.d) | Error reporting implementation |
| [errorsink.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/errorsink.d) | Error reporting interface |
| [target.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/target.d) | Manage target-specific parameters for cross-compiling (for LDC/GDC) |
| [compiler.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/compiler.d) | Describe a back-end compiler and implements compiler-specific actions |
### Lexing / parsing
| File | Purpose |
|-----------------------------------------------------------------------|----------------------------------------------------------------------|
| [lexer.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lexer.d) | Convert source code into tokens for the D and ImportC parsers |
| [location.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/location.d)| Encapsulate file/line/column info for error messages, etc. |
| [entity.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/entity.d) | Define "\\&Entity;" escape sequence for strings / character literals |
| [tokens.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/tokens.d) | Define lexical tokens. |
| [parse.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/parse.d) | D parser, converting tokens into an Abstract Syntax Tree (AST) |
| [cparse.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/cparse.d) | ImportC parser, converting tokens into an Abstract Syntax Tree (AST) |
### Semantic analysis
**Symbols and declarations**
| File | Purpose |
|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| [dsymbol.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dsymbol.d) | Base class for a D symbol, e.g. a variable, function, module, enum etc. |
| [identifier.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/identifier.d) | Represents the name of a `Dsymbol` |
| [id.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/id.d) | Define strings for pre-defined identifiers (e.g. `sizeof`, `string`) |
| [dscope.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dscope.d) | Define a 'scope' on which symbol lookup can be performed |
| [dtemplate.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dtemplate.d) | A template declaration or instance |
| [dmodule.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dmodule.d) | Define a package and module |
| [mtype.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/mtype.d) | Define expression types such as `int`, `char[]`, `void function()` |
| [arraytypes.d](http
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
著名的开源的C/C++编译器:GCC! (2000个子文件)
decNumber.c 321KB
regex.c 253KB
cp-demangle.c 194KB
elf.c 188KB
dlmalloc.c 179KB
decBasic.c 157KB
bid128_to_uint32.c 127KB
transfer.c 125KB
bid128_to_int64.c 106KB
dwarf.c 105KB
test-callback.c 102KB
bid128_add.c 101KB
single.c 92KB
bid64_to_int32.c 88KB
fpioconst.c 86KB
matmul_c10.c 86KB
matmul_i16.c 86KB
matmul_c16.c 86KB
matmul_c17.c 86KB
matmul_c4.c 85KB
matmul_i1.c 85KB
matmul_c8.c 85KB
matmul_i2.c 85KB
matmul_i8.c 85KB
matmul_i4.c 85KB
matmul_r16.c 85KB
matmul_r17.c 85KB
matmul_r10.c 85KB
matmul_r8.c 85KB
matmul_r4.c 85KB
bid64_to_int64.c 84KB
list_read.c 80KB
bid64_to_uint64.c 80KB
deflate.c 77KB
libgcc2.c 73KB
decCommon.c 73KB
unzip.c 69KB
zip.c 64KB
write.c 56KB
inflate.c 54KB
test-call.c 52KB
sincos_table.c 51KB
simple-object-elf.c 49KB
strtod_l.c 48KB
unix.c 47KB
d-demangle.c 47KB
bid64_div.c 46KB
trees.c 43KB
lto-plugin.c 43KB
c99_functions.c 42KB
gzlog.c 41KB
xcoff.c 40KB
simple-object-mach-o.c 40KB
inffas86.c 40KB
unwind-dw2.c 40KB
libgcov-util.c 39KB
ffi_darwin.c 39KB
bid_round.c 39KB
sendmsg.c 37KB
puff.c 37KB
generic-morestack.c 37KB
fp-bit.c 36KB
macho.c 35KB
printf_fp.c 35KB
rust-demangle.c 35KB
bid_convert_data.c 34KB
init.c 34KB
matmulavx128_i16.c 34KB
matmulavx128_c16.c 34KB
matmulavx128_c10.c 34KB
matmulavx128_c17.c 34KB
matmulavx128_i2.c 34KB
matmulavx128_c4.c 34KB
matmulavx128_i8.c 34KB
matmulavx128_i4.c 34KB
matmulavx128_i1.c 34KB
matmulavx128_c8.c 34KB
matmulavx128_r17.c 34KB
matmulavx128_r10.c 34KB
matmulavx128_r16.c 34KB
matmulavx128_r4.c 34KB
matmulavx128_r8.c 34KB
format.c 33KB
unwind-dw2-fde.c 33KB
decimal64.c 32KB
j1q.c 32KB
lgammaq.c 31KB
j0q.c 31KB
bid128_2_str_tables.c 31KB
encoding.c 30KB
ffi_linux64.c 30KB
erfq.c 30KB
simple-object-xcoff.c 30KB
getopt.c 29KB
hashtab.c 29KB
read.c 28KB
ffi.c 28KB
bid64_minmax.c 28KB
fixed-bit.c 28KB
closures.c 28KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
wangzhaohan2910
- 粉丝: 1
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功