├── AUTHORS ├── COPYING ├── README.md ├── data ├── dilconf.d ├── html.css ├── html_map.d ├── lang_de.d ├── lang_en.d ├── lang_fi.d ├── lang_tr.d ├── macros_dil.ddoc ├── pdf.css ├── predefined.ddoc ├── predefined_xml.ddoc ├── xml.css └── xml_map.d ├── ide ├── monod │ ├── dil.dproj │ └── dil.sln └── sublime │ └── dil.sublime-project ├── kandil ├── css │ └── style.css ├── img │ ├── icon_alias.png │ ├── icon_alias.svg │ ├── icon_class.png │ ├── icon_class.svg │ ├── icon_enum.png │ ├── icon_enum.svg │ ├── icon_enummem.png │ ├── icon_enummem.svg │ ├── icon_function.png │ ├── icon_function.svg │ ├── icon_funnel.png │ ├── icon_funnel.svg │ ├── icon_interface.png │ ├── icon_interface.svg │ ├── icon_magnifier.png │ ├── icon_magnifier.svg │ ├── icon_module.png │ ├── icon_module.svg │ ├── icon_package.png │ ├── icon_package.svg │ ├── icon_struct.png │ ├── icon_struct.svg │ ├── icon_template.png │ ├── icon_template.svg │ ├── icon_tv_dot.png │ ├── icon_tv_dot.svg │ ├── icon_tv_minus.png │ ├── icon_tv_minus.svg │ ├── icon_tv_plus.png │ ├── icon_tv_plus.svg │ ├── icon_typedef.png │ ├── icon_typedef.svg │ ├── icon_union.png │ ├── icon_union.svg │ ├── icon_variable.png │ ├── icon_variable.svg │ └── loading.gif ├── js │ ├── jquery.js │ ├── navigation.js │ ├── quicksearch.js │ ├── symbols.js │ ├── treeview.js │ └── utilities.js └── kandil.ddoc ├── package.json ├── scripts ├── __init__.py ├── build.py ├── common.py ├── dil │ ├── __init__.py │ ├── macro.py │ ├── module.py │ ├── nodes.py │ ├── nodes_gen.py │ ├── package.py │ ├── symbol.py │ ├── token.py │ ├── token_gen.py │ ├── token_list.py │ └── visitor.py ├── doc_funcs.py ├── env_path.py ├── html2chm.py ├── html2pdf.py ├── make_tango.py ├── path.py ├── phobos_doc.py ├── release.py ├── svg2png.sh ├── symbols.py ├── tango_doc.py ├── targets.py ├── typerules.d ├── utils.py └── w3centities.py ├── src ├── Settings.d ├── SettingsLoader.d ├── cmd │ ├── ASTStats.d │ ├── Command.d │ ├── Compile.d │ ├── DDoc.d │ ├── Highlight.d │ ├── ImportGraph.d │ └── Statistics.d ├── common.d ├── dil │ ├── AArray.d │ ├── Array.d │ ├── ChunkAllocator.d │ ├── Compilation.d │ ├── Complex.d │ ├── Converter.d │ ├── Diagnostics.d │ ├── Enums.d │ ├── FileBOM.d │ ├── Float.d │ ├── Highlighter.d │ ├── HtmlEntities.d │ ├── Information.d │ ├── Location.d │ ├── ModuleManager.d │ ├── SourceText.d │ ├── String.d │ ├── StringSet.d │ ├── Tables.d │ ├── Time.d │ ├── Unicode.d │ ├── Version.d │ ├── ast │ │ ├── ASTPrinter.d │ │ ├── ASTSerializer.d │ │ ├── Declaration.d │ │ ├── Declarations.d │ │ ├── DefaultVisitor.d │ │ ├── Expression.d │ │ ├── Expressions.d │ │ ├── Meta.d │ │ ├── Node.d │ │ ├── NodeCopier.d │ │ ├── NodesEnum.d │ │ ├── Parameters.d │ │ ├── Precedence.d │ │ ├── Statement.d │ │ ├── Statements.d │ │ ├── Type.d │ │ ├── Types.d │ │ └── Visitor.d │ ├── code │ │ ├── Interpreter.d │ │ ├── Methods.d │ │ └── NotAResult.d │ ├── doc │ │ ├── DDocEmitter.d │ │ ├── DDocHTML.d │ │ ├── DDocXML.d │ │ ├── Doc.d │ │ ├── Macro.d │ │ └── Parser.d │ ├── i18n │ │ ├── Messages.d │ │ └── ResourceBundle.d │ ├── lexer │ │ ├── Funcs.d │ │ ├── IDs.d │ │ ├── IDsEnum.d │ │ ├── IDsList.d │ │ ├── IdTable.d │ │ ├── Identifier.d │ │ ├── Lexer.d │ │ ├── Tables.d │ │ ├── Token.d │ │ ├── TokenSerializer.d │ │ └── TokensEnum.d │ ├── parser │ │ ├── ImportParser.d │ │ └── Parser.d │ ├── semantic │ │ ├── Analysis.d │ │ ├── Mangler.d │ │ ├── Module.d │ │ ├── Package.d │ │ ├── Pass.d │ │ ├── Pass1.d │ │ ├── Pass2.d │ │ ├── Passes.d │ │ ├── Scope.d │ │ ├── Symbol.d │ │ ├── SymbolTable.d │ │ ├── Symbols.d │ │ ├── Types.d │ │ └── TypesEnum.d │ └── translator │ │ └── PyTreeEmitter.d ├── main.d ├── tests │ ├── cstyle_decls.d │ ├── forward01.d │ ├── forward02.d │ ├── forward03.d │ ├── forward04.d │ └── forward05.d ├── translator │ ├── about.ui │ ├── closing_project.ui │ ├── errors.py │ ├── langfile.py │ ├── langfile_properties.ui │ ├── make_ui.sh │ ├── make_uis.sh │ ├── msg_form.ui │ ├── new_project.ui │ ├── project.py │ ├── project_properties.ui │ ├── translator.py │ ├── translator.ui │ ├── ui_about.py │ ├── ui_closing_project.py │ ├── ui_langfile_properties.py │ ├── ui_msg_form.py │ ├── ui_new_project.py │ ├── ui_project_properties.py │ └── ui_translator.py └── util │ ├── Format.d │ ├── OptParser.d │ ├── Path.d │ └── uni.d └── wiki ├── codingrules.wiki ├── d2syntax.wiki ├── kandil.wiki ├── main.wiki ├── projecttree.wiki ├── semantics.wiki ├── source.wiki └── todo.wiki /AUTHORS: -------------------------------------------------------------------------------- 1 | Founder: 2 | Aziz Köksal 3 | Testament: 4 | "In the event of my death I wish that all the rights to the source code 5 | I have written shall pass over to the public domain. 6 | 7 | My death will most probably not be announced anywhere on the internet, 8 | therefore my testament will become effective if I don't 9 | show any signs of life for 6 months on the internet (i.e. 10 | commits to the repository, e-Mails, IRC etc.) 11 | 12 | Within this time limit I may always revoke or edit this testament, 13 | by committing to the git repository at http://github.com/azizk/dil/. 14 | Only the latest revision of this file is to be considered valid." 15 | - Aziz Köksal 16 | Former contributors: 17 | Jari-Matti Mäkelä 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DIL 2 | === 3 | Copyright (c) 2007-2014 by Aziz Köksal 4 | This program is free software, licensed under the GPL3. 5 | Please, read the license file "COPYING" for further information. 6 | 7 | Description 8 | =========== 9 | This software is a command line utility, a compiler written in D v2 10 | for the D programming language supporting versions 1.0 and 2.0. 11 | 12 | Status 13 | ====== 14 | * Lexing: `[░░░99%░░░░]` 15 | * Parsing: `[░░░99%░░░░]` 16 | * Doc gen: `[░░░80%░░░ ]` 17 | * Semantics: `[░░  20%   ]` 18 | * Code gen: `[    0%    ]` 19 | 20 | Installation 21 | ============ 22 | Download and install from: 23 | 24 | * *.deb files for Debian-based Linux distributions. 25 | * Compressed archives.
26 | After extracting an archive, you can simply run DIL. 27 | No extra configuration needed (except, you might want to add the binary dir 28 | to your PATH variable.) 29 | 30 | Not available yet: 31 | 32 | * Windows installer. 33 | 34 | Contributing 35 | ============ 36 | If you are interested in contributing code to this project, 37 | you have to be in agreement with two conditions: 38 | 39 | 1. You must adhere to the [coding guidelines](wiki/codingrules.wiki). 40 | 2. Code that you submit is considered to be under a liberal/compatible 41 | license. For now, this license is "Public Domain" until I think of a 42 | more suitable and agreeable one very soon. 43 | This allows me to possibly change the license of the whole project 44 | in the future without having to ask every single person for permission. 45 | Reasonable exceptions can be made. 46 | 47 | How To Compile DIL 48 | ================== 49 | In order to compile DIL you must have: 50 | 51 | * [DMD 2.064.2](http://dlang.org/changelog.html#new2_064) 52 | * [Tango D2](https://github.com/SiegeLord/Tango-D2/) 53 | * [Python 2.7.5](http://www.python.org/getit/releases/2.7.5/) 54 | (older versions might work, too.) 55 | 56 | Newer versions of these tools may not compile DIL. The newest version of DMD 57 | or Tango is not always used, because of regressions or unavoidable bugs. 58 | 59 | Compile With Python 60 | ----------------------- 61 | Note: The binary is placed in the bin/ folder. 62 | 63 | Change to the root directory of DIL. E.g.: 64 | 65 | $ cd git/dil/ 66 | 67 | Print help. 68 | 69 | $ scripts/build.py -h 70 | 71 | Compile a release binary. 72 | 73 | $ scripts/build.py 74 | 75 | Compile a debug binary. 76 | 77 | $ scripts/build.py --debug 78 | 79 | Pass additional parameters to the compiler like this: 80 | 81 | $ scripts/build.py -- -L-L/path/to/Tango/lib -L-ltango-dmd 82 | 83 | 84 | On Windows you probably have to call python explicitly. 85 | 86 | > python scripts\build.py 87 | 88 | Run like this: 89 | 90 | * On Linux: 91 | 92 | $ bin/dil 93 | 94 | * On Windows: 95 | 96 | > bin\dil.exe 97 | 98 | Executing DIL without parameters will print the main help message. 99 | 100 | The language of the compiler messages can be set in the configuration file. 101 | Many messages are still untranslated. This task has low priority at the moment. 102 | 103 | Bugs And Patches 104 | ================ 105 | Users can report problems with this software or submit patches by: 106 | 107 | * [filing a bug report on github](https://github.com/azizk/dil/issues), 108 | * contacting me at , 109 | * messaging me at [#dil](irc://freenode.net:8001/dil). 110 | -------------------------------------------------------------------------------- /data/dilconf.d: -------------------------------------------------------------------------------- 1 | /// The configuration file of DIL. 2 | /// 3 | /// The file is searched for in the following order: 4 | /// $(OL 5 | /// $(LI The file path set in the environment variable DILCONF.) 6 | /// $(LI The current working directory.) 7 | /// $(LI The directory set in the environment variable HOME.) 8 | /// $(LI The executable's directory.) 9 | /// $(LI The /etc directory on Linux.) 10 | /// ) 11 | /// The program will fail with an error msg if this file couldn't be found.$(BR) 12 | /// 13 | /// Any environment variable used inside a string is expanded to its value. 14 | /// The variables BINDIR and DATADIR are set by DIL. Examples: 15 | /// $(UL 16 | /// $(LI ${HOME} -> the home directory (e.g. "/home/name" or "C:\Documents and Settings\name").) 17 | /// $(LI ${BINDIR} -> the absolute path to the executable's directory (e.g. "/home/name/dil/bin" or "C:\dil\bin").) 18 | /// $(LI ${DATADIR} -> the data directory of DIL (e.g. "/home/name/dil/data" or "C:\dil\data").) 19 | /// ) 20 | /// 21 | /// Relative paths are resolved and made absolute using the current working directory. 22 | module dilconf; 23 | 24 | /// Files needed by DIL are located in this directory. 25 | var DATADIR = "${BINDIR}/../../data"; 26 | 27 | /// Predefined version identifiers. 28 | var VERSION_IDS = []; 29 | 30 | /// An array of import paths to look for modules. 31 | var IMPORT_PATHS = []; /// E.g.: ["src/", "import/"] 32 | 33 | /// DDoc macro file paths. 34 | /// 35 | /// Macro definitions in ddoc_files[n] override the ones in ddoc_files[n-1].$(BR) 36 | /// 37 | /// E.g.: ["src/mymacros.ddoc", "othermacros.ddoc"] 38 | var DDOC_FILES = ["${DATADIR}/predefined.ddoc"]; 39 | 40 | /// Path to the language file. 41 | var LANG_FILE = "${DATADIR}/lang_en.d"; 42 | /// Path to the xml map. 43 | var XML_MAP = "${DATADIR}/xml_map.d"; 44 | /// Path to the html map. 45 | var HTML_MAP = "${DATADIR}/html_map.d"; 46 | 47 | /// Path to the files of kandil. 48 | var KANDILDIR = "${DATADIR}/../kandil"; 49 | 50 | /// Customizable formats for error messages. 51 | /// 52 | /// $(UL 53 | /// $(LI 0: file path to the source text.) 54 | /// $(LI 1: line number.) 55 | /// $(LI 2: column number.) 56 | /// $(LI 3: error message.) 57 | /// ) 58 | var LEXER_ERROR = "{0}({1},{2})L: {3}"; 59 | var PARSER_ERROR = "{0}({1},{2})P: {3}"; /// ditto 60 | var SEMANTIC_ERROR = "{0}({1},{2})S: {3}"; /// ditto 61 | 62 | /// The width of the tabulator character set in your editor. 63 | /// 64 | /// Important for calculating correct column numbers for compiler messages. 65 | var TAB_WIDTH = 4; 66 | -------------------------------------------------------------------------------- /data/html.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | .compilerinfo, .sourcecode, .linescolumn { 3 | white-space: pre; 4 | font-family: Monospace; 5 | font-size: 0.8em; 6 | margin:0; 7 | padding:0; 8 | } 9 | .compilerinfo { 10 | white-space: normal; 11 | border: 1px solid #A22; 12 | padding: 0.5em; 13 | margin: 1em; 14 | } 15 | .compilerinfo .error { display: block; } 16 | .linescolumn { 17 | text-align: right; 18 | padding-right: 0.3em; 19 | border-right: 1px dotted gray; 20 | } 21 | .linescolumn a { 22 | display: block; 23 | color: #44B; 24 | text-decoration: none; 25 | } 26 | .linescolumn a:target { background-color: yellow; } 27 | /* Number */ 28 | .n { color: teal; } 29 | /* Keyword */ 30 | .k { color: darkblue; font-weight: bold; } 31 | /* Line, block and nested comments */ 32 | .lc, .bc, .nc { color: gray; } 33 | /* Identifier */ 34 | .i { color: black; } 35 | /* String literal */ 36 | .sl { color: firebrick; } 37 | /* Character literal */ 38 | .cl { color: purple; } 39 | /* All bracket types */ 40 | .br { color: orange; } 41 | /* Special tokens */ 42 | .st { color: green; font-weight: bold; } 43 | /* #line, hash line */ 44 | .hl { color: green; } 45 | /* filespec (e.g. #line number [filespec]) */ 46 | .fs { color: purple;} 47 | /* Escape sequences. */ 48 | .es { color: teal; } 49 | /* When the first line starts with #! it's a "shebang" */ 50 | .shebang { color: gray; } 51 | /* Operator */ 52 | /*.op { color: royalblue; }*/ 53 | /* Particular operators */ 54 | /*.opaa { content: "and"; }*/ /*&& ∧*/ 55 | /*.opoo { content: "or"; }*/ /*|| ∨*/ 56 | /*.opn { content: "¬"; }*/ /*!*/ 57 | /*.opne { content: "≠"; }*/ /*!=*/ 58 | /*.ople { content: "≤"; }*/ /*<=*/ 59 | /*.opge { content: "≥"; }*/ /*>=*/ 60 | /*.oplg { content: "≶"; }*/ /*<>*/ 61 | /* 62 | d = Declaration 63 | s = Statement 64 | e = Expression 65 | t = Type 66 | o = Other 67 | */ 68 | /* .d { background-color: #FFDDDD; } */ 69 | /* .e { background-color: #DDDDFF; } */ 70 | .d.Module .i, .d.Import .i { color: blue; } 71 | /*.t .i,*/ .t.Identifier .i, .TemplateTypeParameter .i { color: DarkRed; } 72 | .t .br, .t .op { color: DarkRed; } 73 | .t .k { color: DarkRed; font-weight: normal; } 74 | .d > .i { color: ForestGreen; } 75 | .o.Parameter > .i { color: OliveDrab; font-style: italic; } 76 | -------------------------------------------------------------------------------- /data/html_map.d: -------------------------------------------------------------------------------- 1 | /// A map of document elements and D tokens to format strings. 2 | string[string] map = [ 3 | "DocHead" : ` 4 | 5 | 6 | 7 | {0} 8 | 12 | 13 | 14 | 15 | `, 16 | "CompBegin" : `", 18 | "LexerError" : `

{0}({1},{2})L: {3}

`"\n", 19 | "ParserError" : `

{0}({1},{2})P: {3}

`"\n", 20 | 21 | "LineNumberBegin" : `\n", 27 | 28 | "DocEnd" : "\n
`"\n", 17 | "CompEnd" : "
\n
`, 22 | "LineNumberEnd" : "", 23 | "LineNumber" : `{0}`, 24 | 25 | "SourceBegin" : `
`"\n",
 26 |   "SourceEnd"   : "\n
" 29 | "\n" 30 | "\n", 31 | 32 | // Node categories: 33 | "Declaration" : "d", 34 | "Statement" : "s", 35 | "Expression" : "e", 36 | "Type" : "t", 37 | "Other" : "o", 38 | 39 | // {0} = node category. 40 | // {1} = node class name: "Call", "If", "Class" etc. 41 | // E.g.: ... 42 | "NodeBegin" : ``, 43 | "NodeEnd" : ``, 44 | 45 | "Identifier" : `{0}`, 46 | "String" : `{0}`, 47 | "Char" : `{0}`, 48 | "Number" : `{0}`, 49 | "Keyword" : `{0}`, 50 | 51 | "LineC" : `{0}`, 52 | "BlockC" : `{0}`, 53 | "NestedC" : `{0}`, 54 | 55 | "Shebang" : `{0}`, 56 | "HLine" : `{0}`, // #line 57 | "Filespec" : `{0}`, // #line N "filespec" 58 | "Newline" : "{0}", // \n | \r | \r\n | LS | PS 59 | "Illegal" : `{0}`, // A character not recognized by the lexer. 60 | 61 | "SpecialToken" : `{0}`, // __FILE__, __LINE__ etc. 62 | 63 | "Escape" : `{0}`, // \" \&xxx; \uxxxx \xXX 64 | 65 | "(" : "(", 66 | ")" : ")", 67 | "[" : "[", 68 | "]" : "]", 69 | "{" : "{", 70 | "}" : "}", 71 | "." : ".", 72 | ".." : "..", 73 | "..." : "...", 74 | "!<>=" : "!<>=", // Unordered 75 | "!<>" : "!<>", // UorE 76 | "!<=" : "!<=", // UorG 77 | "!<" : "!<", // UorGorE 78 | "!>=" : "!>=", // UorL 79 | "!>" : "!>", // UorLorE 80 | "<>=" : "<>=", // LorEorG 81 | "<>" : "<>", // LorG 82 | "=" : "=", 83 | "==" : "==", 84 | "!" : "!", 85 | "!=" : "!=", 86 | "<=" : "<=", 87 | "<" : "<", 88 | ">=" : ">=", 89 | ">" : ">", 90 | "<<=" : "<<=", 91 | "<<" : "<<", 92 | ">>=" : ">>=", 93 | ">>" : ">>", 94 | ">>>=" : ">>>=", 95 | ">>>" : ">>>", 96 | "|" : "|", 97 | "||" : "||", 98 | "|=" : "|=", 99 | "&" : "&", 100 | "&&" : "&&", 101 | "&=" : "&=", 102 | "+" : "+", 103 | "++" : "++", 104 | "+=" : "+=", 105 | "-" : "-", 106 | "--" : "--", 107 | "-=" : "-=", 108 | "/" : "/", 109 | "/=" : "/=", 110 | "*" : "*", 111 | "*=" : "*=", 112 | "%" : "%", 113 | "%=" : "%=", 114 | "^" : "^", 115 | "^=" : "^=", 116 | "^^" : "^^", // D2 117 | "^^=" : "^^=", // D2 118 | "~" : "~", 119 | "~=" : "~=", 120 | "@" : "@", // D2 121 | ":" : ":", 122 | ";" : ";", 123 | "?" : "?", 124 | "," : ",", 125 | "$" : "$", 126 | "EOF" : "" 127 | ]; 128 | -------------------------------------------------------------------------------- /data/macros_dil.ddoc: -------------------------------------------------------------------------------- 1 | COPYRIGHT = Copyright © 2007-$(YEAR), Aziz Köksal. All rights reserved. 2 | Maturity =

Maturity: $1.

3 | BNF =
$0
4 | -------------------------------------------------------------------------------- /data/predefined.ddoc: -------------------------------------------------------------------------------- 1 | DDOC = 2 | 3 | 4 | $(TITLE) 5 | 6 | 7 |

$(TITLE)

8 | $(BODY) 9 |
10 | 11 | 12 | 13 | 14 | LP = ( 15 | RP = ) 16 | B = $0 17 | I = $0 18 | U = $0 19 | P =

$0

20 | DL =
$0
21 | DT =
$0
22 | DD =
$0
23 | TABLE = $0
24 | TR = $0 25 | TH = $0 26 | TD = $0 27 | OL =
    $0
28 | UL =
    $0
29 | LI =
  • $0
  • 30 | BIG = $0 31 | SMALL = $0 32 | BR =
    33 | LINK = $0 34 | LINK2 = $+ 35 | 36 | RED = $0 37 | BLUE = $0 38 | GREEN = $0 39 | YELLOW = $0 40 | BLACK = $0 41 | WHITE = $0 42 | 43 | D_CODE = 44 | 45 |
    $1$2
    46 | D_COMMENT = $(GREEN $0) 47 | D_STRING = $(RED $0) 48 | D_KEYWORD = $(BLUE $0) 49 | D_PSYMBOL = $(U $0) 50 | D_PARAM = $(I $0) 51 | 52 | DIL_CODELINES =
    $0
    53 | DIL_CODETEXT =
     54 | $0
    55 | 56 | DDOC_COMMENT = 57 | DDOC_DECL = $(DT $(BIG $0)) 58 | DDOC_DECL_DD = $(DD $0) 59 | DDOC_DITTO = $(BR)$0 60 | 61 | DDOC_SECTIONS = $0 62 | DDOC_SUMMARY = $0$(BR)$(BR) 63 | DDOC_DESCRIPTION = $0$(BR)$(BR) 64 | DDOC_AUTHOR = $(B Author:)$(BR) 65 | $0$(BR)$(BR) 66 | DDOC_AUTHORS = $(B Authors:)$(BR) 67 | $0$(BR)$(BR) 68 | DDOC_BUGS = $(RED BUGS:)$(BR) 69 | $0$(BR)$(BR) 70 | DDOC_COPYRIGHT = $(B Copyright:)$(BR) 71 | $0$(BR)$(BR) 72 | DDOC_DATE = $(B Date:)$(BR) 73 | $0$(BR)$(BR) 74 | DDOC_DEPRECATED = $(RED Deprecated:)$(BR) 75 | $0$(BR)$(BR) 76 | DDOC_EXAMPLES = $(B Examples:)$(BR) 77 | $0$(BR)$(BR) 78 | DDOC_HISTORY = $(B History:)$(BR) 79 | $0$(BR)$(BR) 80 | DDOC_LICENSE = $(B License:)$(BR) 81 | $0$(BR)$(BR) 82 | DDOC_RETURNS = $(B Returns:)$(BR) 83 | $0$(BR)$(BR) 84 | DDOC_SEE_ALSO = $(B See Also:)$(BR) 85 | $0$(BR)$(BR) 86 | DDOC_STANDARDS = $(B Standards:)$(BR) 87 | $0$(BR)$(BR) 88 | DDOC_THROWS = $(B Throws:)$(BR) 89 | $0$(BR)$(BR) 90 | DDOC_VERSION = $(B Version:)$(BR) 91 | $0$(BR)$(BR) 92 | DDOC_SECTION_H = $(B $0)$(BR) 93 | DDOC_SECTION = $0$(BR)$(BR) 94 | 95 | DDOC_MEMBERS = $(DL $0) 96 | DDOC_MODULE_MEMBERS = $(DDOC_MEMBERS $0) 97 | DDOC_CLASS_MEMBERS = $(DDOC_MEMBERS $0) 98 | DDOC_INTERFACE_MEMBERS = $(DDOC_MEMBERS $0) 99 | DDOC_STRUCT_MEMBERS = $(DDOC_MEMBERS $0) 100 | DDOC_UNION_MEMBERS = $(DDOC_MEMBERS $0) 101 | DDOC_TEMPLATE_MEMBERS = $(DDOC_MEMBERS $0) 102 | DDOC_ENUM_MEMBERS = $(DDOC_MEMBERS $0) 103 | 104 | DDOC_PARAMS = $(B Params:)$(BR) 105 | $(TABLE $0)$(BR) 106 | DDOC_PARAM_ROW = $(TR $0) 107 | DDOC_PARAM_ID = $(TD $0) 108 | DDOC_PARAM_DESC = $(TD $0) 109 | DDOC_BLANKLINE = $(BR)$(BR) 110 | 111 | DDOC_PSYMBOL = $(U $0) 112 | DDOC_KEYWORD = $(B $0) 113 | DDOC_PARAM = $(I $0) 114 | 115 | DIL_SYMBOL = $(U $1) 116 | DIL_NOCMNT = 117 | DIL_CMT = $0 118 | DIL_KW = $0 119 | DIL_ATTRIBUTES = [$0] 120 | DIL_PROT = $0 121 | DIL_STC = $0 122 | DIL_LINKAGE = $0 123 | DIL_RETTYPE = $0 124 | DIL_DEFVAL = $0 125 | DIL_SPEC = $0 126 | DIL_PARAMS = ($0) 127 | DIL_TEMPLATE_PARAMS = ($0) 128 | DIL_TPALIAS = alias $0 129 | DIL_TPTYPE = $0 130 | DIL_TPTUPLE = $0... 131 | DIL_TPVALUE = $0 132 | DIL_TPTHIS = this $0 133 | DIL_TPID = $(I $0) 134 | DIL_BASECLASSES = : $0 135 | DIL_BASECLASS = $0 136 | DIL_SYMEND = 137 | DIL_SC = ; 138 | -------------------------------------------------------------------------------- /data/predefined_xml.ddoc: -------------------------------------------------------------------------------- 1 | DDOC = 2 | $(TITLE) 3 | $(BODY) 4 | $(COPYRIGHT) 5 | $(GENERATOR) 6 | 7 | 8 | GENERATOR = 9 | 10 | DIL 11 | 12 | http://code.google.com/p/dil 13 | $(DATETIME) 14 | 15 | 16 | B = $0 17 | I = $0 18 | U = $0 19 | P =

    $0

    20 | DL =
    $0
    21 | DT =
    $0
    22 | DD =
    $0
    23 | TABLE = $0
    24 | TR = $0 25 | TH = $0 26 | TD = $0 27 | OL =
      $0
    28 | UL =
      $0
    29 | LI =
  • $0
  • 30 | BIG = $0 31 | SMALL = $0 32 | BR =
    33 | LINK = $0 34 | LINK2 = $+ 35 | SPAN = $+ 36 | 37 | RED = $(SPAN red, $0) 38 | BLUE = $(SPAN blue, $0) 39 | GREEN = $(SPAN green, $0) 40 | YELLOW = $(SPAN yellow, $0) 41 | BLACK = $(SPAN black, $0) 42 | WHITE = $(SPAN white, $0) 43 | 44 | D_CODE = $0 45 | D_COMMENT = $0 46 | D_STRING = $0 47 | D_COMMENT = $0 48 | D_PSYMBOL = $0 49 | D_PARAM = $0 50 | 51 | DDOC_COMMENT = 52 | DDOC_DECL = $2 53 | DDOC_DECL_DD = $0 54 | DDOC_DITTO = $0 55 | 56 | DDOC_SECTIONS = $0 57 | DDOC_SECTION_T =
    $2
    58 | DDOC_SUMMARY = $(DDOC_SECTION_T summary, $0) 59 | DDOC_DESCRIPTION = $(DDOC_SECTION_T description, $0) 60 | DDOC_AUTHORS = $(DDOC_SECTION_T authors, $0) 61 | DDOC_BUGS = $(DDOC_SECTION_T bugs, $0) 62 | DDOC_COPYRIGHT = $(DDOC_SECTION_T copyright, $0) 63 | DDOC_DATE = $(DDOC_SECTION_T date, $0) 64 | DDOC_DEPRECATED = $(DDOC_SECTION_T deprecated, $0) 65 | DDOC_EXAMPLES = $(DDOC_SECTION_T examples, $0) 66 | DDOC_HISTORY = $(DDOC_SECTION_T history, $0) 67 | DDOC_LICENSE = $(DDOC_SECTION_T license, $0) 68 | DDOC_RETURNS = $(DDOC_SECTION_T returns, $0) 69 | DDOC_SEE_ALSO = $(DDOC_SECTION_T seealso, $0) 70 | DDOC_STANDARDS = $(DDOC_SECTION_T standards, $0) 71 | DDOC_THROWS = $(DDOC_SECTION_T throws, $0) 72 | DDOC_VERSION = $(DDOC_SECTION_T version, $0) 73 | DDOC_SECTION_H = $(B $0)$(BR) 74 | DDOC_SECTION = $0 75 | 76 | DDOC_MEMBERS = $0 77 | DDOC_MODULE_MEMBERS = $(DDOC_MEMBERS $0) 78 | DDOC_CLASS_MEMBERS = $(DDOC_MEMBERS $0) 79 | DDOC_INTERFACE_MEMBERS = $(DDOC_MEMBERS $0) 80 | DDOC_STRUCT_MEMBERS = $(DDOC_MEMBERS $0) 81 | DDOC_UNION_MEMBERS = $(DDOC_MEMBERS $0) 82 | DDOC_TEMPLATE_MEMBERS = $(DDOC_MEMBERS $0) 83 | DDOC_ENUM_MEMBERS = $(DDOC_MEMBERS $0) 84 | 85 | DDOC_PARAMS = $0 86 | DDOC_PARAM_ROW = $0 87 | DDOC_PARAM_ID = $0 88 | DDOC_PARAM_DESC = $0 89 | DDOC_BLANKLINE = 90 | 91 | DDOC_PSYMBOL = $(U $0) 92 | DDOC_KEYWORD = $(B $0) 93 | DDOC_PARAM = $0 94 | 95 | ATTRIBUTE = $2 96 | TYPE = $0 97 | RETURNS = $0 98 | DIL_SYMBOL = $1 99 | DIL_ATTRIBUTES = $0 100 | DIL_PROT = $(ATTRIBUTE protection, $0) 101 | DIL_STC = $(ATTRIBUTE storage, $0) 102 | DIL_LINKAGE = $(ATTRIBUTE linkage, $0) 103 | DIL_BASE_CLASSES = $0 104 | DIL_PARAMS = $0 105 | DIL_TEMPLATE_PARAMS = $0 106 | -------------------------------------------------------------------------------- /data/xml.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | compilerinfo, sourcecode, linescolumn { 3 | white-space: pre; 4 | font-family: Monospace; 5 | font-size: 0.8em; 6 | } 7 | compilerinfo, sourcecode { 8 | display: block; 9 | } 10 | compilerinfo { 11 | white-space: normal; 12 | border: 1px solid #A22; 13 | padding: 0.5em; 14 | margin: 1em; 15 | } 16 | compilerinfo error { display: block; } 17 | linescolumn { 18 | display: block; 19 | float: left; 20 | text-align: right; 21 | margin-right: 0.2em; 22 | border-right: 1px solid gray; 23 | } 24 | linescolumn a { display: block; color: #555; } 25 | linescolumn a:target { background-color: yellow; } 26 | /* Number */ 27 | n { color: teal; } 28 | /* Keyword */ 29 | k { color: darkblue; font-weight: bold; } 30 | /* Line, block and nested comments */ 31 | lc, bc, nc { color: gray; } 32 | /* Identifier */ 33 | i { color: black; } 34 | /* String literal */ 35 | sl { color: firebrick; } 36 | /* Character literal */ 37 | cl { color: purple; } 38 | /* All bracket types */ 39 | br { color: orange; } 40 | /* Special tokens */ 41 | st { color: green; font-weight: bold; } 42 | /* #line, hash line */ 43 | hl { color: green; } 44 | /* filespec (e.g. #line number [filespec]) */ 45 | fs { color: purple;} 46 | /* Escape sequences. */ 47 | es { color: teal; } 48 | /* When the first line starts with #! it's a "shebang" */ 49 | shebang { color: gray; } 50 | /* Deprecated styles. */ 51 | /* Operator */ 52 | /*op { color: royalblue; }*/ 53 | /* Particular operators */ 54 | /*op[t=aa] { content: "and"; }*/ /*&& ∧*/ 55 | /*op[t=oo] { content: "or"; }*/ /*|| ∨*/ 56 | /*op[t=n] { content: "¬"; }*/ /*!*/ 57 | /*op[t=ne] { content: "≠"; }*/ /*!=*/ 58 | /*op[t=le] { content: "≤"; }*/ /*<=*/ 59 | /*op[t=ge] { content: "≥"; }*/ /*>=*/ 60 | /*op[t=lg] { content: "≶"; }*/ /*<>*/ 61 | /* 62 | d = Declaration 63 | s = Statement 64 | e = Expression 65 | t = Type 66 | o = Other 67 | */ 68 | /* d { background-color: #FFDDDD; } */ 69 | /* e { background-color: #DDDDFF; } */ 70 | d[t=Illegal], s[t=Illegal] { background-color: #DD4422; } 71 | d[t=Module] i, d[t=Import] i { color: blue; } 72 | t > i { color: DarkRed; } 73 | t > br, t > op { color: DarkRed; } 74 | t[t=Integral] k { color: DarkRed; font-weight: normal; } 75 | d > i { color: ForestGreen; } 76 | o[t=Parameter] > i { color: OliveDrab; font-style: italic; } 77 | -------------------------------------------------------------------------------- /data/xml_map.d: -------------------------------------------------------------------------------- 1 | /// A map of document elements and D tokens to format strings. 2 | string[string] map = [ 3 | "DocHead" : ``"\n" 4 | ``"\n" 5 | "\n", 6 | "DocEnd" : "\n", 7 | "SourceBegin" : "", 8 | "SourceEnd" : "\n", 9 | "CompBegin" : "\n", 10 | "CompEnd" : "\n", 11 | "LexerError" : `{0}({1},{2})L: {3}`"\n", 12 | "ParserError" : `{0}({1},{2})P: {3}`"\n", 13 | "LineNumberBegin" : ``, 14 | "LineNumberEnd" : ``, 15 | "LineNumber" : `{0}`, 16 | 17 | // Node categories: 18 | "Declaration" : "d", 19 | "Statement" : "s", 20 | "Expression" : "e", 21 | "Type" : "t", 22 | "Other" : "o", 23 | 24 | // {0} = node category. 25 | // {1} = node class name: "Call", "If", "Class" etc. 26 | // E.g.: ... 27 | "NodeBegin" : `<{0} t="{1}">`, 28 | "NodeEnd" : ``, 29 | 30 | "Identifier" : "{0}", 31 | "String" : "{0}", 32 | "Char" : "{0}", 33 | "Number" : "{0}", 34 | "Keyword" : "{0}", 35 | 36 | "LineC" : "{0}", 37 | "BlockC" : "{0}", 38 | "NestedC" : "{0}", 39 | 40 | "Shebang" : "{0}", 41 | "HLine" : "{0}", // #line 42 | "Filespec" : "{0}", // #line N "filespec" 43 | "Newline" : "{0}", // \n | \r | \r\n | LS | PS 44 | "Illegal" : "{0}", // A character not recognized by the lexer. 45 | 46 | "SpecialToken" : "{0}", // __FILE__, __LINE__ etc. 47 | 48 | "Escape" : `{0}`, // \" \&xxx; \uxxxx \xXX 49 | 50 | "(" : "
    (
    ", 51 | ")" : "
    )
    ", 52 | "[" : "
    [
    ", 53 | "]" : "
    ]
    ", 54 | "{" : "
    {
    ", 55 | "}" : "
    }
    ", 56 | "." : ".", 57 | ".." : "..", 58 | "..." : "...", 59 | "!<>=" : "!<>=", // Unordered 60 | "!<>" : "!<>", // UorE 61 | "!<=" : "!<=", // UorG 62 | "!<" : "!<", // UorGorE 63 | "!>=" : "!>=", // UorL 64 | "!>" : "!>", // UorLorE 65 | "<>=" : "<>=", // LorEorG 66 | "<>" : "<>", // LorG 67 | "=" : "=", 68 | "==" : "==", 69 | "!" : "!", 70 | "!=" : "!=", 71 | "<=" : "<=", 72 | "<" : "<", 73 | ">=" : ">=", 74 | ">" : ">", 75 | "<<=" : "<<=", 76 | "<<" : "<<", 77 | ">>=" : ">>=", 78 | ">>" : ">>", 79 | ">>>=" : ">>>=", 80 | ">>>" : ">>>", 81 | "|" : "|", 82 | "||" : "||", 83 | "|=" : "|=", 84 | "&" : "&", 85 | "&&" : "&&", 86 | "&=" : "&=", 87 | "+" : "+", 88 | "++" : "++", 89 | "+=" : "+=", 90 | "-" : "-", 91 | "--" : "--", 92 | "-=" : "-=", 93 | "/" : "/", 94 | "/=" : "/=", 95 | "*" : "*", 96 | "*=" : "*=", 97 | "%" : "%", 98 | "%=" : "%=", 99 | "^" : "^", 100 | "^=" : "^=", 101 | "^^" : "^^", // D2 102 | "^^=" : "^^=", // D2 103 | "~" : "~", 104 | "~=" : "~=", 105 | "@" : "@", // D2 106 | ":" : ":", 107 | ";" : ";", 108 | "?" : "?", 109 | "," : ",", 110 | "$" : "$", 111 | "EOF" : "" 112 | ]; 113 | -------------------------------------------------------------------------------- /ide/monod/dil.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "dil", "dil.dproj", "{37C836E6-3EDA-46A3-93E8-13FBE0A7D722}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | Unittest|Any CPU = Unittest|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {37C836E6-3EDA-46A3-93E8-13FBE0A7D722}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 14 | {37C836E6-3EDA-46A3-93E8-13FBE0A7D722}.Debug|Any CPU.Build.0 = Debug|Any CPU 15 | {37C836E6-3EDA-46A3-93E8-13FBE0A7D722}.Release|Any CPU.ActiveCfg = Release|Any CPU 16 | {37C836E6-3EDA-46A3-93E8-13FBE0A7D722}.Release|Any CPU.Build.0 = Release|Any CPU 17 | {37C836E6-3EDA-46A3-93E8-13FBE0A7D722}.Unittest|Any CPU.ActiveCfg = Unittest|Any CPU 18 | {37C836E6-3EDA-46A3-93E8-13FBE0A7D722}.Unittest|Any CPU.Build.0 = Unittest|Any CPU 19 | EndGlobalSection 20 | GlobalSection(MonoDevelopProperties) = preSolution 21 | BaseDirectory = ..\.. 22 | StartupItem = dil.dproj 23 | EndGlobalSection 24 | EndGlobal 25 | -------------------------------------------------------------------------------- /ide/sublime/dil.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "folders": 3 | [ 4 | { 5 | "path": "../../src", 6 | "name": "DIL Source Code", 7 | "file_exclude_patterns": [".directory"], 8 | "folder_exclude_patterns": [] 9 | }, 10 | { 11 | "path": "../../kandil", 12 | "name": "Kandil", 13 | "file_exclude_patterns": [".directory"], 14 | "folder_exclude_patterns": [] 15 | }, 16 | { 17 | "path": "../../scripts", 18 | "name": "Scripts", 19 | "file_exclude_patterns": [".directory"], 20 | "folder_exclude_patterns": [] 21 | }, 22 | { 23 | "path": "../../data", 24 | "name": "Data", 25 | "file_exclude_patterns": [".directory"], 26 | "folder_exclude_patterns": [] 27 | } 28 | ], 29 | "settings": 30 | { 31 | "tab_size": 2, 32 | "translate_tabs_to_spaces": true, 33 | "rulers": [80], 34 | "trim_trailing_white_space_on_save": true 35 | }, 36 | "build_systems": 37 | [ 38 | { // Debug version (Ctrl+B.) 39 | "name": "Build DIL (Debug)", 40 | "cmd": ["scripts/build.py", "--debug"], 41 | "file_regex": "^(.*?)\\(([0-9]+)\\):()(.+)$", 42 | "working_dir": "$project_path/../..", 43 | "selector": "source.d", 44 | "variants": 45 | [ 46 | { 47 | "name": "DIL Release", 48 | "cmd": ["scripts/build.py", "--release"] 49 | }, 50 | { 51 | "name": "DIL Release ProfileCode", 52 | "cmd": ["scripts/build.py", "--release", "--", "-profile"] 53 | }, 54 | { 55 | "name": "DIL Release Coverage Analysis", 56 | "cmd": ["scripts/build.py", "--release", "--", "-cov"] 57 | }, 58 | { // Run binary. (Ctrl+Shift+B.) 59 | "cmd": ["bin/dil"], 60 | "name": "Run" 61 | } 62 | ] 63 | } 64 | ] 65 | } 66 | -------------------------------------------------------------------------------- /kandil/img/icon_alias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_alias.png -------------------------------------------------------------------------------- /kandil/img/icon_alias.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | a 33 | 42 | 43 | -------------------------------------------------------------------------------- /kandil/img/icon_class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_class.png -------------------------------------------------------------------------------- /kandil/img/icon_class.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | C 33 | 42 | 43 | -------------------------------------------------------------------------------- /kandil/img/icon_enum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_enum.png -------------------------------------------------------------------------------- /kandil/img/icon_enum.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | E 33 | 42 | 43 | -------------------------------------------------------------------------------- /kandil/img/icon_enummem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_enummem.png -------------------------------------------------------------------------------- /kandil/img/icon_enummem.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | 27 | 36 | 37 | -------------------------------------------------------------------------------- /kandil/img/icon_function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_function.png -------------------------------------------------------------------------------- /kandil/img/icon_function.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | 27 | 36 | 37 | -------------------------------------------------------------------------------- /kandil/img/icon_funnel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_funnel.png -------------------------------------------------------------------------------- /kandil/img/icon_funnel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 25 | 29 | 30 | 32 | 36 | 37 | 45 | 46 | 50 | 54 | 58 | 59 | -------------------------------------------------------------------------------- /kandil/img/icon_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_interface.png -------------------------------------------------------------------------------- /kandil/img/icon_interface.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | I 33 | 42 | 43 | -------------------------------------------------------------------------------- /kandil/img/icon_magnifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_magnifier.png -------------------------------------------------------------------------------- /kandil/img/icon_module.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_module.png -------------------------------------------------------------------------------- /kandil/img/icon_package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_package.png -------------------------------------------------------------------------------- /kandil/img/icon_struct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_struct.png -------------------------------------------------------------------------------- /kandil/img/icon_struct.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | S 33 | 42 | 43 | -------------------------------------------------------------------------------- /kandil/img/icon_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_template.png -------------------------------------------------------------------------------- /kandil/img/icon_template.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | T 33 | 42 | 43 | -------------------------------------------------------------------------------- /kandil/img/icon_tv_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_tv_dot.png -------------------------------------------------------------------------------- /kandil/img/icon_tv_dot.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 13 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /kandil/img/icon_tv_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_tv_minus.png -------------------------------------------------------------------------------- /kandil/img/icon_tv_minus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 13 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /kandil/img/icon_tv_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_tv_plus.png -------------------------------------------------------------------------------- /kandil/img/icon_tv_plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 13 | 21 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /kandil/img/icon_typedef.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_typedef.png -------------------------------------------------------------------------------- /kandil/img/icon_typedef.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | t 33 | 42 | 43 | -------------------------------------------------------------------------------- /kandil/img/icon_union.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_union.png -------------------------------------------------------------------------------- /kandil/img/icon_union.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | U 33 | 42 | 43 | -------------------------------------------------------------------------------- /kandil/img/icon_variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/icon_variable.png -------------------------------------------------------------------------------- /kandil/img/icon_variable.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 15 | 17 | 21 | 22 | 23 | 27 | 36 | 37 | -------------------------------------------------------------------------------- /kandil/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/kandil/img/loading.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DIL", 3 | "description": "A compiler for D written in D.", 4 | "authors": ["Aziz Köksal"], 5 | "homepage": "http://code.google.com/p/dil/", 6 | "license": "GPL-3.0", 7 | "dependencies": { 8 | "tango": "~d2port" 9 | }, 10 | "configurations": [ 11 | { 12 | "name": "dil", 13 | "targetType": "executable", 14 | "versions": ["D2"], 15 | }, 16 | { 17 | "name": "dil", 18 | "targetType": "library", 19 | "versions": ["D2"], 20 | "excludedSourceFiles": "src/main.d", 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/scripts/__init__.py -------------------------------------------------------------------------------- /scripts/dil/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azizk/dil/36485d5866a7eed89c82287fe21bc2dc3e74424a/scripts/dil/__init__.py -------------------------------------------------------------------------------- /scripts/dil/macro.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Aziz Köksal 3 | from __future__ import unicode_literals 4 | import re 5 | 6 | class Macro: 7 | rx = re.compile(r"^([^\W0-9]\w*)\s*=" "|^", re.M | re.U) 8 | def __init__(self, name, text, pos, src=""): 9 | self.pos = pos 10 | self.name = name 11 | self.text = text 12 | self.src = src 13 | def __repr__(self): 14 | return self.name + "@(%d,%d)" % self.pos + "='" + self.text[:5] + "'" 15 | __unicode__ = __str__ = __repr__ 16 | 17 | @staticmethod 18 | def parse(text, src, skip=1): 19 | """ Parses a text and returns a list of macros. """ 20 | prev_end = 0 21 | prev_name = "" 22 | prev_pos = (1, 1) 23 | macros = [] 24 | macros_add = macros.append 25 | linnum = 0 26 | for m in Macro.rx.finditer(text): 27 | linnum += 1 # Increment line number. 28 | whole_match = m.group() # Whole matched text. 29 | if not whole_match: # Empty only when a newline was matched. 30 | continue 31 | # value = text[prev_end : m.start()] 32 | macros_add(Macro(prev_name, text[prev_end:m.start()], prev_pos, src)) 33 | # Update variables. 34 | prev_end = m.end() 35 | prev_name = m.group(1) 36 | # column = whole_match.find(prev_name[0]) + 1 37 | prev_pos = (linnum, whole_match.find(prev_name[0]) + 1) 38 | macros_add(Macro(prev_name, text[prev_end:], prev_pos, src)) 39 | return macros[skip:] 40 | 41 | class MacroTable: 42 | def __init__(self, parent=None): 43 | self.parent = parent 44 | self.table = {} 45 | def search(self, name): 46 | macro = self.table.get(name, None) 47 | if not macro and self.parent: self.parent.search(name) 48 | return macro 49 | def insert(self, macro): 50 | self.table[macro.name] = macro 51 | def insert2(self, name, text, pos=(0,0), src=""): 52 | self.insert(Macro(name, text, pos, src)) 53 | -------------------------------------------------------------------------------- /scripts/dil/module.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Aziz Köksal 3 | from dil.symbol import Symbol 4 | 5 | class Module(Symbol): 6 | def __init__(self, fqn="", tokens=[], ext="", root=None): 7 | self.tokens = tokens 8 | self.fqn = fqn 9 | self.ext = ext 10 | self.root = root 11 | -------------------------------------------------------------------------------- /scripts/dil/package.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Aziz Köksal 3 | from dil.symbol import Symbol 4 | 5 | class Package(Symbol): 6 | def __init__(self, name): 7 | Symbol.__init__(self, name) 8 | self.name = name 9 | self.packages = [] 10 | self.modules = [] 11 | 12 | insert(modul, modul.name); 13 | 14 | def addModule(self, m): 15 | m.parent = self 16 | self.modules.append(m) 17 | self.insert(m) 18 | 19 | def addPackage(self, p): 20 | p.parent = self 21 | self.packages.append(p) 22 | self.insert(p) 23 | -------------------------------------------------------------------------------- /scripts/dil/symbol.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Aziz Köksal 3 | 4 | class Symbol(object): 5 | def __init__(self, name): 6 | self.name = name 7 | self.parent = None 8 | 9 | class ScopeSymbol(Symbol): 10 | def __init__(self, name): 11 | Symbol.__init__(self, name) 12 | self.table = {} 13 | 14 | def insert(self, symbol): 15 | self.table[symbol.name] = symbol 16 | 17 | def lookup(self, name): 18 | self.table.get(name) 19 | -------------------------------------------------------------------------------- /scripts/dil/token_gen.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # Author: Aziz Köksal 4 | from __future__ import print_function 5 | from sys import stdout 6 | 7 | toks = ( 8 | "Invalid","Illegal","Comment","#! /shebang/","#line","\"filespec\"","\n", 9 | "Empty","Identifier","String","CharLiteral","__FILE__","__LINE__","__DATE__", 10 | "__TIME__","__TIMESTAMP__","__VENDOR__","__VERSION__","Int32","Int64", 11 | "Uint32","Uint64","Float32","Float64","Float80","Imaginary32","Imaginary64", 12 | "Imaginary80","(",")","[","]","{","}",".","..","...","!<>=","!<>","!<=","!<", 13 | "!>=","!>","<>=","<>","=","==","!=","!","<=","<",">=",">","<<=","<<",">>=", 14 | ">>",">>>=",">>>","|=","||","|","&=","&&","&","+=","++","+","-=","--","-", 15 | "/=","/","*=","*","%=","%","^=","^","~=","~",":",";","?",",","$", 16 | ) 17 | ids = ( 18 | "Invalid","Illegal","Comment","Shebang","HashLine","Filespec","Newline", 19 | "Empty","Identifier","String","CharLiteral","FILE","LINE","DATE","TIME", 20 | "TIMESTAMP","VENDOR","VERSION","Int32","Int64","Uint32","Uint64", 21 | "Float32","Float64","Float80","Imaginary32","Imaginary64","Imaginary80", 22 | "LParen","RParen","LBracket","RBracket","LBrace","RBrace","Dot","Slice", 23 | "Ellipses","Unordered","UorE","UorG","UorGorE","UorL","UorLorE","LorEorG", 24 | "LorG","Assign","Equal","NotEqual","Not","LessEqual","Less", 25 | "GreaterEqual","Greater","LShiftAssign","LShift","RShiftAssign","RShift", 26 | "URShiftAssign","URShift","OrAssign","OrLogical","OrBinary","AndAssign", 27 | "AndLogical","AndBinary","PlusAssign","PlusPlus","Plus","MinusAssign", 28 | "MinusMinus","Minus","DivAssign","Div","MulAssign","Mul","ModAssign","Mod", 29 | "XorAssign","Xor","CatAssign","Tilde","Colon","Semicolon","Question","Comma", 30 | "Dollar", 31 | ) 32 | 33 | tokens = zip(ids, toks) 34 | 35 | keywords = ( 36 | "abstract","alias","align","asm","assert","auto","body","break","case", 37 | "cast","catch","class","const","continue","debug","default","delegate", 38 | "delete","deprecated","do","else","enum","export","extern","false","final", 39 | "finally","for","foreach","foreach_reverse","function","goto","__gshared", 40 | "if","immutable","import","in","inout","interface","invariant","is","lazy","macro", 41 | "mixin","module","new","nothrow","null","out","__overloadset","override", 42 | "package","pragma","private","protected","public","pure","ref","return", 43 | "shared","scope","static","struct","super","switch","synchronized", 44 | "template","this","__thread","throw","__traits","true","try","typedef", 45 | "typeid","typeof","union","unittest","version","volatile","while","with", 46 | "char","wchar","dchar","bool","byte","ubyte","short","ushort","int","uint", 47 | "long","ulong","cent","ucent","float","double","real","ifloat", 48 | "idouble","ireal","cfloat","cdouble","creal","void","HEAD","EOF" 49 | ) 50 | for kw in keywords: 51 | kw2 = kw.lstrip('_') 52 | tokens += [(kw2[0].upper()+kw2[1:], kw)] 53 | 54 | def main(): 55 | def write(text, maxlen=80, term="\n", flush=False, line=[""]): 56 | if (len(line[0]) + len(text)) >= maxlen or flush: 57 | stdout.write(line[0] + term) 58 | line[0] = text 59 | else: 60 | line[0] += text 61 | 62 | print("class TOK:") 63 | stdout.write(" ") 64 | for tok, tokstr in tokens[:-1]: 65 | write('%s,' % tok, 76, "\\\n ") 66 | write(tokens[-1][0]+" = range(0,%s)" % len(tokens)) 67 | write("", flush=True) 68 | print(" MAX = %s" % len(tokens)) 69 | 70 | stdout.write(" str = (\n ") 71 | for tok, tokstr in tokens: 72 | write("'%s'," % tokstr.replace("\n", "\\n"), 76, "\n ") 73 | write("", flush=True) 74 | print(" )") 75 | 76 | if __name__ == '__main__': 77 | main() 78 | -------------------------------------------------------------------------------- /scripts/dil/token_list.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Aziz Köksal 3 | 4 | class TOK: 5 | Invalid,Illegal,Comment,Shebang,HashLine,Filespec,Newline,Empty,Identifier,\ 6 | String,CharLiteral,FILE,LINE,DATE,TIME,TIMESTAMP,VENDOR,VERSION,Int32,\ 7 | Int64,Uint32,Uint64,Float32,Float64,Float80,Imaginary32,Imaginary64,\ 8 | Imaginary80,LParen,RParen,LBracket,RBracket,LBrace,RBrace,Dot,Slice,\ 9 | Ellipses,Unordered,UorE,UorG,UorGorE,UorL,UorLorE,LorEorG,LorG,Assign,\ 10 | Equal,NotEqual,Not,LessEqual,Less,GreaterEqual,Greater,LShiftAssign,LShift,\ 11 | RShiftAssign,RShift,URShiftAssign,URShift,OrAssign,OrLogical,OrBinary,\ 12 | AndAssign,AndLogical,AndBinary,PlusAssign,PlusPlus,Plus,MinusAssign,\ 13 | MinusMinus,Minus,DivAssign,Div,MulAssign,Mul,ModAssign,Mod,XorAssign,Xor,\ 14 | CatAssign,Tilde,Colon,Semicolon,Question,Comma,Dollar,Abstract,Alias,Align,\ 15 | Asm,Assert,Auto,Body,Break,Case,Cast,Catch,Class,Const,Continue,Debug,\ 16 | Default,Delegate,Delete,Deprecated,Do,Else,Enum,Export,Extern,False,Final,\ 17 | Finally,For,Foreach,Foreach_reverse,Function,Goto,Gshared,If,Immutable,\ 18 | Import,In,Inout,Interface,Invariant,Is,Lazy,Macro,Mixin,Module,New,Nothrow,\ 19 | Null,Out,Overloadset,Override,Package,Pragma,Private,Protected,Public,Pure,\ 20 | Ref,Return,Shared,Scope,Static,Struct,Super,Switch,Synchronized,Template,\ 21 | This,Thread,Throw,Traits,True,Try,Typedef,Typeid,Typeof,Union,Unittest,\ 22 | Version,Volatile,While,With,Char,Wchar,Dchar,Bool,Byte,Ubyte,Short,Ushort,\ 23 | Int,Uint,Long,Ulong,Cent,Ucent,Float,Double,Real,Ifloat,Idouble,Ireal,\ 24 | Cfloat,Cdouble,Creal,Void,HEAD,EOF = range(0,194) 25 | str = ( 26 | 'Invalid','Illegal','Comment','#! /shebang/','#line','"filespec"','\n', 27 | 'Empty','Identifier','String','CharLiteral','__FILE__','__LINE__', 28 | '__DATE__','__TIME__','__TIMESTAMP__','__VENDOR__','__VERSION__','Int32', 29 | 'Int64','Uint32','Uint64','Float32','Float64','Float80','Imaginary32', 30 | 'Imaginary64','Imaginary80','(',')','[',']','{','}','.','..','...','!<>=', 31 | '!<>','!<=','!<','!>=','!>','<>=','<>','=','==','!=','!','<=','<','>=','>', 32 | '<<=','<<','>>=','>>','>>>=','>>>','|=','||','|','&=','&&','&','+=','++', 33 | '+','-=','--','-','/=','/','*=','*','%=','%','^=','^','~=','~',':',';','?', 34 | ',','$','abstract','alias','align','asm','assert','auto','body','break', 35 | 'case','cast','catch','class','const','continue','debug','default', 36 | 'delegate','delete','deprecated','do','else','enum','export','extern', 37 | 'false','final','finally','for','foreach','foreach_reverse','function', 38 | 'goto','__gshared','if','immutable','import','in','inout','interface', 39 | 'invariant','is','lazy','macro','mixin','module','new','nothrow','null', 40 | 'out','__overloadset','override','package','pragma','private','protected', 41 | 'public','pure','ref','return','shared','scope','static','struct','super', 42 | 'switch','synchronized','template','this','__thread','throw','__traits', 43 | 'true','try','typedef','typeid','typeof','union','unittest','version', 44 | 'volatile','while','with','char','wchar','dchar','bool','byte','ubyte', 45 | 'short','ushort','int','uint','long','ulong','cent','ucent','float', 46 | 'double','real','ifloat','idouble','ireal','cfloat','cdouble','creal', 47 | 'void','HEAD','EOF', 48 | ) 49 | -------------------------------------------------------------------------------- /scripts/dil/visitor.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Aziz Köksal 3 | 4 | class NodeVisitor: 5 | def visit(self, node): 6 | """ Calls a visit method for this node. """ 7 | method = getattr(self, node.__class__.visit_name, self.default_visit) 8 | return method(node) 9 | 10 | def default_visit(self, node): 11 | """ Calls visit() on the subnodes of this node. """ 12 | for n in node: 13 | self.visit(n) 14 | -------------------------------------------------------------------------------- /scripts/doc_funcs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Aziz Köksal 3 | # License: zlib/libpng 4 | from __future__ import unicode_literals, print_function 5 | import re 6 | 7 | def insert_svn_info(FILES, SRC_ROOT, DEST, 8 | rev_link, author_link, template=None): 9 | """ Fetches information about Tango source files using 'svn info' 10 | and inserts that into the generated HTML files. """ 11 | from subprocess import Popen, PIPE 12 | 13 | rx = re.compile("Last Changed (?:Author|Rev|Date): (.+)") 14 | 15 | if template == None: # Use default: 16 | # {0}=Author; {1}=Revision; {2}=Date 17 | template = """

    SVN info:

    18 | Last Author: {0}
    20 | Last Revision: {1}
    22 | Last Changed Date: 23 | {2}
    \n""" 24 | 25 | print("Querying SVN...") 26 | 27 | file_paths = [f['path'] for f in FILES] 28 | p = Popen(["svn", "info"] + file_paths, stdout=PIPE) 29 | all_info = p.communicate()[0] 30 | # "\n\n" is the separator. The regexp makes extraction easy. 31 | file_infos = [rx.findall(info) for info in all_info.split("\n\n")[:-1]] 32 | 33 | assert(len(file_infos) == len(FILES)) 34 | SRC_ROOT = SRC_ROOT / "" # Ensure trailing '/'. 35 | 36 | print("Inserting SVN information into the HTML files.") 37 | 38 | for i, source in enumerate(FILES): 39 | # 1. E.g.: /svn/tango/tango/core/BitManip.d -> tango/core/BitManip.d 40 | src_file = source['path'].replace(SRC_ROOT, "") # Remove root dir. 41 | # 2. E.g.: /dest/tangodoc/ + tango.core.BitManip + .html -> 42 | # /dest/tangodoc/tango.core.BitManip.html 43 | path = DEST/(source['fqn']+".html") 44 | if not path.exists: 45 | print("Warning: file inexistent: '%s'. Not adding SVN info to it." % path) 46 | continue 47 | # 3. Open the file in update mode. 48 | # No encoding is used to make seeking and inserting uncomplicated. 49 | f = path.open("r+", encoding=None) 50 | text = f.read() 51 | # 4. Find the insertion position. 52 | div = '