Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

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 usinga local clone.

dmd.statement

Defines AST nodes for statements.

SpecificationStatements

Authors:
Walter Bright
License:
Boost License 1.0

Sourcestatement.d

Documentationhttps://dlang.org/phobos/dmd_statement.html

Coveragehttps://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/statement.d

abstract classStatement:dmd.ast_node.ASTNode;

Specificationhttps://dlang.org/spec/statement.html

static Statements*arraySyntaxCopy(Statements*a);
Do syntax copy of an array of Statement's.
pure nothrow boolhasBreak() const;
Determine if an enclosedbreak would apply to this statement, such as if it is a loop or switch statement.
Returns:
true if it does
pure nothrow boolhasContinue() const;
Determine if an enclosedcontinue would apply to this statement, such as if it is a loop statement.
Returns:
true if it does
final boolusesEH();
Returns:
true if statement uses exception handling
final boolcomeFrom();
Returns:
true if statement 'comes from' somewhere else, like a goto
final boolhasCode();
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, ornull if there isn't one
voidaccept(Visitorv);
Support Visitor Pattern
Parameters:
Visitorvvisitor
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, otherwisenull
classErrorStatement: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().
classPeelStatement:dmd.statement.Statement;
classExpStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#ExpressionStatement
classDtorExpStatement:dmd.statement.ExpStatement;
classMixinStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#mixin-statement
classCompoundStatement:dmd.statement.Statement;
final @safe this(Locloc, Statements*statements);
Construct aCompoundStatement using an already existing array ofStatements
Parameters:
LoclocInstantiation information
Statements*statementsAn array ofStatements, that will referenced by this class
final this(Locloc, Statement[]sts...);
Construct aCompoundStatement from an array ofStatements
Parameters:
LoclocInstantiation information
Statement[]stsA variadic array ofStatements, that will copied in this class The entries themselves will not be copied.
classCompoundDeclarationStatement:dmd.statement.CompoundStatement;
classUnrolledLoopStatement: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.
classScopeStatement:dmd.statement.Statement;
classForwardingStatement: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
ForwardingScopeDsymbolsym;
The symbol containing thestatic foreach variables.
Statementstatement;
The wrapped statement.
classWhileStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#while-statement
classDoStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#do-statement
classForStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#for-statement
classForeachStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#foreach-statement
classForeachRangeStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#foreach-range-statement
classIfStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#if-statement
boolisIfCtfeBlock();
Returns:
true ifif (__ctfe)
classConditionalStatement:dmd.statement.Statement;
https://dlang.org/spec/version.html#ConditionalStatement
classStaticForeachStatement:dmd.statement.Statement;
https://dlang.org/spec/version.html#StaticForeachStatement Static foreach statements, like: void main() { static foreach(i; 0 .. 10) { pragma(msg, i); } }
classPragmaStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#pragma-statement
classStaticAssertStatement:dmd.statement.Statement;
https://dlang.org/spec/version.html#StaticAssert
classSwitchStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#switch-statement
Expressioncondition;
switch(condition)
Statement_body;
boolisFinal;
boolhasDefault;
true if has default statement
boolhasVars;
true if has variable case values
DefaultStatementsdefault;
default:
StatementtryBody;
set to TryCatchStatement or TryFinallyStatement if in body portion
TryFinallyStatementtryFinally;
set if in the 'finally' block of a TryFinallyStatement
GotoCaseStatementsgotoCases;
array of unresolved GotoCaseStatement's
CaseStatements*cases;
array of CaseStatement's
VarDeclarationlastVar;
last observed variable declaration in this statement
classCaseStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#CaseStatement
classCaseRangeStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#CaseRangeStatement
classDefaultStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#DefaultStatement
classGotoDefaultStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#GotoStatement
classGotoCaseStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#GotoStatement
classSwitchErrorStatement:dmd.statement.Statement;
classReturnStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#return-statement
classBreakStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#break-statement
classContinueStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#continue-statement
classSynchronizedStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#SynchronizedStatement
classWithStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#with-statement
classTryCatchStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#try-statement
StatementtryBody;
set to enclosing TryCatchStatement or TryFinallyStatement if in body portion
classCatch:dmd.rootobject.RootObject;
https://dlang.org/spec/statement.html#Catch
classTryFinallyStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#try-statement
StatementtryBody;
set to enclosing TryCatchStatement or TryFinallyStatement if in body portion
boolbodyFallsThru;
true if body falls through to finally
classScopeGuardStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#scope-guard-statement
classThrowStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#throw-statement
classDebugStatement:dmd.statement.Statement;
classGotoStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#goto-statement
StatementtryBody;
set to TryCatchStatement or TryFinallyStatement if in body portion
boolinCtfeBlock;
set if goto is inside anif (__ctfe) block
classLabelStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#LabeledStatement
StatementtryBody;
set to TryCatchStatement or TryFinallyStatement if in body portion
classLabelDsymbol:dmd.dsymbol.Dsymbol;
classAsmStatement:dmd.statement.Statement;
https://dlang.org/spec/statement.html#asm
classInlineAsmStatement:dmd.statement.AsmStatement;
https://dlang.org/spec/iasm.html
classGccAsmStatement:dmd.statement.AsmStatement;
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html Assembler instructions with D expression operands.
classCompoundAsmStatement:dmd.statement.CompoundStatement;
a complete asm {} block
classImportStatement:dmd.statement.Statement;
https://dlang.org/spec/module.html#ImportDeclaration
pure @safe stringvisitStmtCase(stringhandler);
CTFE-only helper function for VisitInitializer.
Parameters:
stringhandlerstring for the name of the visit handler
Returns:
boilerplate code for a case
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Sat Feb 21 04:05:57 2026

[8]ページ先頭

©2009-2026 Movatter.jp