Module

Represents a semantic D module and a source file.

Constructors

this
this(cstring filePath, CompilationContext cc)

Constructs a Module object.

this
this(SourceText src, CompilationContext cc)

Constructs from a ready-to-use SourceText instance.

Members

Functions

fileExtension
cstring fileExtension()

Returns the file extension: "d" or "di".

filePath
cstring filePath()

Returns the file path of the source text.

filePathEsc
cstring filePathEsc()

Returns filePath and escapes '/' or '\' with '_'.

firstToken
Token* firstToken()

Returns the first token of the module's source text.

getFQN
cstring getFQN()

Returns the fully qualified name of this module. E.g.: dil.ast.Node

getFQNPath
cstring getFQNPath()

Returns the module's FQN with slashes instead of dots. E.g.: dil.ast.Node -> dil/ast/Node

getImportPaths
cstring[] getImportPaths()

Returns a list of import paths. E.g.: ["dil/ast/Node", "dil/semantic/Module"]

hasErrors
bool hasErrors()

Returns true if there are errors in the source file.

parse
void parse()

Parses the module.

setFQN
void setFQN(cstring moduleFQN)

Sets the module's FQN.

setParser
void setParser(Parser parser)

Sets the parser to be used for parsing the source text.

Variables

ID
size_t ID;

A unique 1-based ID. Useful for graph traversing.

cc
CompilationContext cc;

The compilation context.

dlxFilePath
string dlxFilePath;

Set when the Lexer should load the tokens from a file.

failedLoading
bool failedLoading;

True if loading the source file failed.

imports
ImportDecl[] imports;

ImportDeclarations found in this file.

moduleDecl
ModuleDecl moduleDecl;

The optional ModuleDecl in this file.

moduleFQN
cstring moduleFQN;

Fully qualified name of the module. E.g.: dil.ast.Node

moduleName
cstring moduleName;

E.g.: Node

modules
Module[] modules;

The imported modules.

packageName
cstring packageName;

E.g.: dil.ast

parser
Parser parser;

The parser used to parse this file.

root
CompoundDecl root;

The root of the parse tree.

semanticPass
uint semanticPass;

Indicates which passes have been run on this module.

sourceText
SourceText sourceText;

The source file of this module.

Inherited Members

From ModuleSymbol

varminfo
ModuleInfoSymbol varminfo;

The ModuleInfo for this module.

Meta