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 classStatement: 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 boolhasBreak() 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 boolhasContinue() 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 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, or null if there isn't one
- voidaccept(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
 
- 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;
- classDtorExpStatement: dmd.statement.ExpStatement;
- classMixinStatement: dmd.statement.Statement;
- classCompoundStatement: dmd.statement.Statement;
- 
- final @safe this(Locloc, 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(Locloc, 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. 
 
- 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 the static foreach variables.
- Statementstatement;
- The wrapped statement.
 
- classWhileStatement: dmd.statement.Statement;
- classDoStatement: dmd.statement.Statement;
- classForStatement: dmd.statement.Statement;
- classForeachStatement: dmd.statement.Statement;
- classForeachRangeStatement: dmd.statement.Statement;
- classIfStatement: dmd.statement.Statement;
- 
- boolisIfCtfeBlock();
- Returns:true if if (__ctfe)
 
- classConditionalStatement: dmd.statement.Statement;
- 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;
- classStaticAssertStatement: dmd.statement.Statement;
- classSwitchStatement: dmd.statement.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;
- classCaseRangeStatement: dmd.statement.Statement;
- classDefaultStatement: dmd.statement.Statement;
- classGotoDefaultStatement: dmd.statement.Statement;
- classGotoCaseStatement: dmd.statement.Statement;
- classSwitchErrorStatement: dmd.statement.Statement;
- classReturnStatement: dmd.statement.Statement;
- classBreakStatement: dmd.statement.Statement;
- classContinueStatement: dmd.statement.Statement;
- classSynchronizedStatement: dmd.statement.Statement;
- classWithStatement: dmd.statement.Statement;
- classTryCatchStatement: dmd.statement.Statement;
- 
- StatementtryBody;
- set to enclosing TryCatchStatement or TryFinallyStatement if in body portion
 
- classCatch: dmd.rootobject.RootObject;
- classTryFinallyStatement: dmd.statement.Statement;
- 
- StatementtryBody;
- set to enclosing TryCatchStatement or TryFinallyStatement if in body portion
- boolbodyFallsThru;
- true if body falls through to finally
 
- classScopeGuardStatement: dmd.statement.Statement;
- classThrowStatement: dmd.statement.Statement;
- classDebugStatement: dmd.statement.Statement;
- classGotoStatement: dmd.statement.Statement;
- 
- StatementtryBody;
- set to TryCatchStatement or TryFinallyStatement if in body portion
- boolinCtfeBlock;
- set if goto is inside an if (__ctfe) block
 
- classLabelStatement: dmd.statement.Statement;
- 
- StatementtryBody;
- set to TryCatchStatement or TryFinallyStatement if in body portion
 
- classLabelDsymbol: dmd.dsymbol.Dsymbol;
- classAsmStatement: dmd.statement.Statement;
- classInlineAsmStatement: dmd.statement.AsmStatement;
- 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;
- pure @safe stringvisitStmtCase(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