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.statement
Defines AST nodes for statements.
Specification Statements
Authors:
License:
Source statement.d
Documentation https://dlang.org/phobos/dmd_statement.html
- abstract class
Statement: dmd.ast_node.ASTNode; Specification https://dlang.org/spec/statement.html
- static Statements*
arraySyntaxCopy(Statements*a); - Do syntax copy of an array of Statement's.
- pure nothrow bool
hasBreak() const; - Determine if an enclosed break would apply to this statement, such as if it is a loop or switch statement.Returns:true if it does
- pure nothrow bool
hasContinue() const; - Determine if an enclosed continue would apply to this statement, such as if it is a loop statement.Returns:true if it does
- final bool
usesEH(); - Returns:true if statement uses exception handling
- final bool
comeFrom(); - Returns:true if statement 'comes from' somewhere else, like a goto
- final bool
hasCode(); - Returns:true if statement has executable code.
- pure nothrow inout(Statement)
last() inout; - Find last statement in a sequence of statements.Returns:the last statement, or null if there isn't one
- void
accept(Visitorv); - Support Visitor PatternParameters:
Visitor vvisitor - pure nothrow @nogc inout(ReturnStatement)
endsWithReturnStatement() inout; - Does this statement end with a return statement?I.e. is it a single return statement or some compound statement that unconditionally hits a return statement.Returns:return statement it ends with, otherwise null
- final pure nothrow @nogc @trusted inout(ErrorStatement)
isErrorStatement() inout; - A cheaper method of doing downcasting of Statements.Returns:the downcast statement if it can be downcasted, otherwise null
- class
ErrorStatement: dmd.statement.Statement; - Any Statement that fails semantic() or has a component that is an ErrorExp or a TypeError should return an ErrorStatement from semantic().
- class
PeelStatement: dmd.statement.Statement; - class
ExpStatement: dmd.statement.Statement; - class
DtorExpStatement: dmd.statement.ExpStatement; - class
MixinStatement: dmd.statement.Statement; - class
CompoundStatement: dmd.statement.Statement; -
- final @safe this(Loc
loc, Statements*statements); - Construct a CompoundStatement using an already existing array of StatementsParameters:
Loc locInstantiation information Statements* statementsAn array of Statements, that will referenced by this class - final this(Loc
loc, Statement[]sts...); - Construct a CompoundStatement from an array of StatementsParameters:
Loc locInstantiation information Statement[] stsA variadic array of Statements, that will copied in this class The entries themselves will not be copied.
- class
CompoundDeclarationStatement: dmd.statement.CompoundStatement; - class
UnrolledLoopStatement: dmd.statement.Statement; - The purpose of this is so that continue will go to the next of the statements, and break will go to the end of the statements.
- class
ScopeStatement: dmd.statement.Statement; - class
ForwardingStatement: dmd.statement.Statement; - Statement whose symbol table contains foreach index variables in a local scope and forwards other members to the parent scope. This wraps a statement.Also see: dmd.attrib.ForwardingAttribDeclaration
- ForwardingScopeDsymbol
sym; - The symbol containing the static foreach variables.
- Statement
statement; - The wrapped statement.
- class
WhileStatement: dmd.statement.Statement; - class
DoStatement: dmd.statement.Statement; - class
ForStatement: dmd.statement.Statement; - class
ForeachStatement: dmd.statement.Statement; - class
ForeachRangeStatement: dmd.statement.Statement; - class
IfStatement: dmd.statement.Statement; -
- bool
isIfCtfeBlock(); - Returns:true if if (__ctfe)
- class
ConditionalStatement: dmd.statement.Statement; - class
StaticForeachStatement: dmd.statement.Statement; - https://dlang.org/spec/version.html#StaticForeachStatement Static foreach statements, like: void main() { static foreach(i; 0 .. 10) { pragma(msg, i); } }
- class
PragmaStatement: dmd.statement.Statement; - class
StaticAssertStatement: dmd.statement.Statement; - class
SwitchStatement: dmd.statement.Statement; -
- Expression
condition; - switch(condition)
- Statement
_body; - bool
isFinal; - bool
hasDefault; - true if has default statement
- bool
hasVars; - true if has variable case values
- DefaultStatement
sdefault; - default:
- Statement
tryBody; - set to TryCatchStatement or TryFinallyStatement if in body portion
- TryFinallyStatement
tryFinally; - set if in the 'finally' block of a TryFinallyStatement
- GotoCaseStatements
gotoCases; - array of unresolved GotoCaseStatement's
- CaseStatements*
cases; - array of CaseStatement's
- VarDeclaration
lastVar; - last observed variable declaration in this statement
- class
CaseStatement: dmd.statement.Statement; - class
CaseRangeStatement: dmd.statement.Statement; - class
DefaultStatement: dmd.statement.Statement; - class
GotoDefaultStatement: dmd.statement.Statement; - class
GotoCaseStatement: dmd.statement.Statement; - class
SwitchErrorStatement: dmd.statement.Statement; - class
ReturnStatement: dmd.statement.Statement; - class
BreakStatement: dmd.statement.Statement; - class
ContinueStatement: dmd.statement.Statement; - class
SynchronizedStatement: dmd.statement.Statement; - class
WithStatement: dmd.statement.Statement; - class
TryCatchStatement: dmd.statement.Statement; -
- Statement
tryBody; - set to enclosing TryCatchStatement or TryFinallyStatement if in body portion
- class
Catch: dmd.rootobject.RootObject; - class
TryFinallyStatement: dmd.statement.Statement; -
- Statement
tryBody; - set to enclosing TryCatchStatement or TryFinallyStatement if in body portion
- bool
bodyFallsThru; - true if body falls through to finally
- class
ScopeGuardStatement: dmd.statement.Statement; - class
ThrowStatement: dmd.statement.Statement; - class
DebugStatement: dmd.statement.Statement; - class
GotoStatement: dmd.statement.Statement; -
- Statement
tryBody; - set to TryCatchStatement or TryFinallyStatement if in body portion
- bool
inCtfeBlock; - set if goto is inside an if (__ctfe) block
- class
LabelStatement: dmd.statement.Statement; -
- Statement
tryBody; - set to TryCatchStatement or TryFinallyStatement if in body portion
- class
LabelDsymbol: dmd.dsymbol.Dsymbol; - class
AsmStatement: dmd.statement.Statement; - class
InlineAsmStatement: dmd.statement.AsmStatement; - class
GccAsmStatement: dmd.statement.AsmStatement; - https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html Assembler instructions with D expression operands.
- class
CompoundAsmStatement: dmd.statement.CompoundStatement; - a complete asm {} block
- class
ImportStatement: dmd.statement.Statement; - pure @safe string
visitStmtCase(stringhandler); - CTFE-only helper function for VisitInitializer.Parameters:
string handlerstring for the name of the visit handler Returns:boilerplate code for a case
Copyright © 1999-2025 by the D Language Foundation | Page generated by
Ddoc on Mon Mar 31 10:28:02 2025