dmd.statement
Defines AST nodes for statements.
Specification: Statements
License
Source: statement.d
Documentation: https://dlang.org/phobos/dmd_statement.html
-
Declaration
TypeIdentifiergetThrowable();Return Value
TypeIdentifiercorresponding toobject.Throwable -
Declaration
TypeIdentifiergetException();Return Value
TypeIdentifier corresponding to
object.Exception -
Declaration
abstract classStatement: dmd.ast_node.ASTNode;Specification: https://dlang.org/spec/statement.html
-
Declaration
static Statements*arraySyntaxCopy(Statements*a);Do syntax copy of an array of Statement's.
-
Declaration
const pure nothrow boolhasBreak();Determine if an enclosed
breakwould apply to this statement, such as if it is a loop or switch statement.Return Value
trueif it does -
Declaration
const pure nothrow boolhasContinue();Determine if an enclosed
continuewould apply to this statement, such as if it is a loop statement.Return Value
trueif it does -
Declaration
final boolusesEH();Return Value
trueif statement uses exception handling -
Declaration
final boolcomeFrom();Return Value
trueif statement 'comes from' somewhere else, like a goto -
Declaration
final boolhasCode();Return Value
trueif statement has executable code. -
Declaration
inout pure nothrow inout(Statement)last();Find
laststatement in a sequence of statements.Return Value
the
laststatement, ornullif there isn't one -
Declaration
voidaccept(Visitorv);Support Visitor Pattern
Parameters
Visitorvvisitor
-
Declaration
inout pure nothrow @nogc inout(ReturnStatement)endsWithReturnStatement();Does this statement end with a return statement?
Discussion
I.e. is it a single return statement or some compound statement that unconditionally hits a return statement.
Return Value
return statement it ends with, otherwise
null -
Declaration
final inout pure nothrow @nogc @safe inout(ErrorStatement)isErrorStatement();A cheaper method of doing downcasting of Statements.
Return Value
the downcast statement if it can be downcasted, otherwise
null
-
-
Declaration
classErrorStatement: dmd.statement.Statement;Any Statement that fails semantic() or has a component that is an ErrorExp or a TypeError should return an
ErrorStatementfrom semantic(). -
Declaration
classPeelStatement: dmd.statement.Statement; -
Declaration
classExpStatement: dmd.statement.Statement; -
Declaration
classDtorExpStatement: dmd.statement.ExpStatement; -
Declaration
classCompileStatement: dmd.statement.Statement; -
Declaration
classCompoundStatement: dmd.statement.Statement;-
Declaration
final this(const ref Locloc, Statements*statements);Construct a
CompoundStatementusing an already existing array ofStatementsParameters
LoclocInstantiation information
Statements*statementsAn array of
Statements, that will referenced by this class -
Declaration
final this(const ref Locloc, Statement[]sts...);Construct a
CompoundStatementfrom an array ofStatementsParameters
LoclocInstantiation information
Statement[]stsA variadic array of
Statements, that will copied in this class The entries themselves will not be copied.
-
-
Declaration
classCompoundDeclarationStatement: dmd.statement.CompoundStatement; -
Declaration
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.
-
Declaration
classScopeStatement: dmd.statement.Statement; -
Declaration
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.
Discussion
Also see:
dmd.attrib.ForwardingAttribDeclaration-
Declaration
ForwardingScopeDsymbolsym;The symbol containing the
static foreachvariables. -
Declaration
Statementstatement;The wrapped
statement.
-
-
Declaration
classWhileStatement: dmd.statement.Statement; -
Declaration
classDoStatement: dmd.statement.Statement; -
Declaration
classForStatement: dmd.statement.Statement; -
Declaration
classForeachStatement: dmd.statement.Statement; -
Declaration
classForeachRangeStatement: dmd.statement.Statement; -
Declaration
classIfStatement: dmd.statement.Statement; -
Declaration
classConditionalStatement: dmd.statement.Statement; -
Declaration
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); } }
-
Declaration
classPragmaStatement: dmd.statement.Statement; -
Declaration
classStaticAssertStatement: dmd.statement.Statement; -
Declaration
classSwitchStatement: dmd.statement.Statement;-
Declaration
Expressioncondition;switch(
condition) -
Declaration
Statement_body; -
Declaration
boolisFinal; -
Declaration
DefaultStatementsdefault;default:
-
Declaration
StatementtryBody;set to TryCatchStatement or TryFinallyStatement if in body portion
-
Declaration
TryFinallyStatementtf;set if in the 'finally' block of a TryFinallyStatement
-
Declaration
GotoCaseStatementsgotoCases;array of unresolved GotoCaseStatement's
-
Declaration
CaseStatements*cases;array of CaseStatement's
-
Declaration
inthasNoDefault;!=0 if no default statement
-
Declaration
inthasVars;!=0 if has variable case values
-
Declaration
VarDeclarationlastVar;last observed variable declaration in this statement
-
Declaration
boolcheckLabel();Return Value
trueif error
-
-
Declaration
classCaseStatement: dmd.statement.Statement; -
Declaration
classCaseRangeStatement: dmd.statement.Statement; -
Declaration
classDefaultStatement: dmd.statement.Statement; -
Declaration
classGotoDefaultStatement: dmd.statement.Statement; -
Declaration
classGotoCaseStatement: dmd.statement.Statement; -
Declaration
classSwitchErrorStatement: dmd.statement.Statement; -
Declaration
classReturnStatement: dmd.statement.Statement; -
Declaration
classBreakStatement: dmd.statement.Statement; -
Declaration
classContinueStatement: dmd.statement.Statement; -
Declaration
classSynchronizedStatement: dmd.statement.Statement; -
Declaration
classWithStatement: dmd.statement.Statement; -
Declaration
classTryCatchStatement: dmd.statement.Statement;-
Declaration
StatementtryBody;set to enclosing TryCatchStatement or TryFinallyStatement if in body portion
-
-
Declaration
classCatch: dmd.root.rootobject.RootObject; -
Declaration
classTryFinallyStatement: dmd.statement.Statement;-
Declaration
StatementtryBody;set to enclosing TryCatchStatement or TryFinallyStatement if in body portion
-
Declaration
boolbodyFallsThru;trueif body falls through to finally
-
-
Declaration
classScopeGuardStatement: dmd.statement.Statement; -
Declaration
classThrowStatement: dmd.statement.Statement; -
Declaration
classDebugStatement: dmd.statement.Statement; -
Declaration
classGotoStatement: dmd.statement.Statement;-
Declaration
StatementtryBody;set to TryCatchStatement or TryFinallyStatement if in body portion
-
Declaration
boolcheckLabel();Return Value
truefor error
-
-
Declaration
classLabelStatement: dmd.statement.Statement;-
Declaration
StatementtryBody;set to TryCatchStatement or TryFinallyStatement if in body portion
-
-
Declaration
classLabelDsymbol: dmd.dsymbol.Dsymbol; -
Declaration
classAsmStatement: dmd.statement.Statement; -
Declaration
classInlineAsmStatement: dmd.statement.AsmStatement; -
Declaration
classGccAsmStatement: dmd.statement.AsmStatement;https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html Assembler instructions with D expression operands.
-
Declaration
classCompoundAsmStatement: dmd.statement.CompoundStatement;a complete asm {} block
-
Declaration
classImportStatement: dmd.statement.Statement;