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.dsymbol
Compiler implementation of the
D programming language.
Authors:
License:
Source dsymbol.d
Documentation https://dlang.org/phobos/dmd_dsymbol.html
- class
Dsymbol: dmd.root.rootobject.RootObject; -
- final Module
getModule(); - Determine which Module a Dsymbol is in.
- final Module
getAccessModule(); - Determine which Module a Dsymbol is in, as far as access rights go.
- final inout inout(Dsymbol)
toParent();
final inout inout(Dsymbol)toParent2(); - parent field returns a lexically enclosing scope symbol this is a member of.
toParent() returns a logically enclosing scope symbol this is a member of. It skips over TemplateMixin's.toParent2() returns an enclosing scope symbol this is living at runtime. It skips over both TemplateInstance's and TemplateMixin's. It's used when looking for the 'this' pointer of the enclosing function/class.Examples:module mod; template Foo(alias a) { mixin Bar!(); } mixin template Bar() { public { // ProtDeclaration void baz() { a = 2; } } } void test() { int v = 1; alias foo = Foo!(v); foo.baz(); assert(v == 2); } // s == FuncDeclaration('mod.test.Foo!().Bar!().baz()') // s.parent == TemplateMixin('mod.test.Foo!().Bar!()') // s.toParent() == TemplateInstance('mod.test.Foo!()') // s.toParent2() == FuncDeclaration('mod.test') - static Dsymbols*
arraySyntaxCopy(Dsymbols*a); - Do syntax copy of an array of Dsymbol's.
- Dsymbol
toAlias(); - If this symbol is really an alias for another, return that other. If needed, semantic() is invoked due to resolve forward reference.
- Dsymbol
toAlias2(); - Resolve recursive tuple expansion in eponymous template.
- int
apply(Dsymbol_apply_ft_tfp, void*param); - Iterate this dsymbol or members of this scoped dsymbol, then call
fpwith the found symbol andparam.Parameters:Dsymbol_apply_ft_t fpfunction pointer to process the iterated symbol. If it returns nonzero, the iteration will be aborted. void* parama parameter passed to fp.Returns:nonzero if the iteration is aborted by the return value offp, or 0 if it's completed. - void
setScope(Scope*sc); - Set scope for future semantic analysis so we can deal better with forward references.
- Dsymbol
search(ref const Locloc, Identifierident, intflags= IgnoreNone); - Search for
identas member of s.Parameters:Loc loclocation to print for error messages Identifier identidentifier to searchforint flagsIgnoreXXXX Returns:nullif not found - final Dsymbol
searchX(ref const Locloc, Scope*sc, RootObjectid, intflags); - Search for identifier
idas a member of this.idmay be a template instance.Parameters:Loc loclocation to print the error messages Scope* scthe scope where the symbol is located RootObject idthe idof the symbolint flagsthe search flagswhich can be SearchLocalsOnly or IgnorePrivateImportsReturns:symbol found, NULL if not - d_uns64
size(ref const Locloc); - Returns:SIZE_INVALID when the
sizecannot be determined - final inout inout(AggregateDeclaration)
isMember(); - Returns an AggregateDeclaration when toParent() is that.
- final inout inout(AggregateDeclaration)
isMember2(); - Returns an AggregateDeclaration when toParent2() is that.
- Prot
prot(); - Dsymbol
syntaxCopy(Dsymbols); - Copy the syntax. Used for template instantiations. If
sis NULL, allocate the new object, otherwise fill it in. - bool
oneMember(Dsymbol*ps, Identifierident); - Determine if this symbol is only one.Returns:
false, *ps= NULL: There are 2 or more symbolstrue, *ps= NULL: There are zero symbolstrue, *ps= symbol: The one and only one symbol - static bool
oneMembers(Dsymbols*members, Dsymbol*ps, Identifierident); - Same as Dsymbol::oneMember(), but look at an array of Dsymbols.
- bool
hasPointers(); - Is Dsymbol a variable that contains pointers?
- void
addComment(const(char)*comment); - Add documentation
commentto Dsymbol. Ignore NULL comments. - final bool
inNonRoot(); - Returns
trueif this symbol is defined in a non-root module without instantiation. - void
accept(Visitorv);
- class
ScopeDsymbol: dmd.dsymbol.Dsymbol; - Dsymbol that generates a scope
- Dsymbol
search(ref const Locloc, Identifierident, intflags= SearchLocalsOnly); - This function is #1 on the list of functions that eat cpu time. Be very, very careful about slowing it down.
- final FuncDeclaration
findGetMembers(); - Look for member of the form: const(MemberInfo)[] getMembers(string); Returns NULL if not found
- Dsymbol
symtabLookup(Dsymbols, Identifierid); - Look up identifier in symbol table.
- bool
hasStaticCtorOrDtor(); - Return
trueif any of the members are static ctors or static dtors, or if any members have members that are. - static size_t
dim(Dsymbols*members); - Determine number of Dsymbols, folding in AttribDeclaration
members. - static Dsymbol
getNth(Dsymbols*members, size_tnth, size_t*pn= null); - Get
nthDsymbol, folding in AttribDeclarationmembers.Returns:Dsymbol*nthDsymbol NULL not found, *pngets incremented by the number of Dsymbols - static int
_foreach(Scope*sc, Dsymbols*members, scope ForeachDgdg, size_t*pn= null); - Expands attribute declarations in
membersin depth first order. Callsdg(size_t symidx, Dsymbol *sym) for each member. Ifdgreturns !=0, stops and returns that value else returns 0. Use this function to avoid the O(N + N^2/2) complexity of calculating dim and calling N times getNth.Returns:last value returned bydg()
- class
WithScopeSymbol: dmd.dsymbol.ScopeDsymbol; - With statement scope
- class
ArrayScopeSymbol: dmd.dsymbol.ScopeDsymbol; - Array Index/Slice scope
- class
OverloadSet: dmd.dsymbol.Dsymbol; - Overload Sets
- class
ForwardingScopeDsymbol: dmd.dsymbol.ScopeDsymbol; - Forwarding ScopeDsymbol. Used by ForwardingAttribDeclaration and ForwardingScopeDeclaration to forward symbol insertions to another scope. See dmd.attrib.ForwardingAttribDeclaration for more details.
- ScopeDsymbol
forward; - Symbol to
forwardinsertions to. Can be null before being lazily initialized. - Dsymbol
symtabLookup(Dsymbols, Identifierid); - This override handles the following two cases: static foreach (i, i; [0]) { ... } and static foreach (i; [0]) { enum i = 2; }
- class
DsymbolTable: dmd.root.rootobject.RootObject; - Table of Dsymbol's
- const pure uint
len(); - Returns:number of symbols in symbol table
Copyright © 1999-2018 by the D Language Foundation | Page generated by
Ddoc on Tue Mar 13 17:31:12 2018