dsymbol.scope_
This file is part of DCD, a development tool for the D programming language. Copyright (C) 2014 Brian Schott
Discussion
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
-
Declaration
structScope;Contains symbols and supports lookup of symbols by cursor position.
-
Declaration
this(uintbegin, uintend);Parameters
uintbeginthe beginning byte index
uintendthe ending byte index
-
Declaration
pure @nogc Scope*getScopeByCursor(size_tcursorPosition);Parameters
size_tcursorPositionthe cursor position in bytes
Return Value
the innermost scope that contains the given cursor position
-
Declaration
DSymbol*[]getSymbolsInCursorScope(size_tcursorPosition);Parameters
size_tcursorPositionthe cursor position in bytes
Return Value
all symbols in the scope containing the cursor position, as well as the symbols in parent scopes of that scope.
-
Declaration
inout inout(DSymbol)*[]getSymbolsByName(istringname);Parameters
istringnamethe symbol
nameto search forReturn Value
all symbols in this scope or parent scopes with the given
name -
Declaration
DSymbol*[]getSymbolsByNameAndCursor(istringname, size_tcursorPosition);Parameters
istringnamethe symbol
nameto search forsize_tcursorPositionthe cursor position in bytes
Return Value
all symbols with the given
namein the scope containing the cursor and its parent scopes -
Declaration
inout inout(DSymbol)*[]getSymbolsAtGlobalScope(istringname);Returns an array of symbols that are present at global scope
-
Declaration
Scope*parent;The scope that contains this one
-
Declaration
UnrolledList!(Scope*, Mallocator, false)children;Child scopes
-
Declaration
uintstartLocation;Start location of this scope in bytes
-
Declaration
uintendLocation;End location of this scope in bytes
-
Declaration
voidaddSymbol(DSymbol*symbol, boolowns);Adds the given
symbolto this scope.Parameters
DSymbol*symbolthe
symbolto addboolownsif
true, thesymbol's destructor will be called when this scope's destructor is called.
-