internal ESIR_LoopStatement( ESIR_List <ESIR_Expression> condExpr, ESIR_List <ESIR_Expression>?iterExpr, ESIR_Statement bodyStmt ) { condNode = condExpr; iterNode = iterExpr; bodyNode = bodyStmt; }
private static ESIR_LabeledStatement LabeledStatement(ESIR_ValueNode label, ESIR_Statement statement) { var node = ESIR_NodeCache.Shared.TryGetNode(ESIR_NodeKind.LabeledStatement, label, statement, out var hash); if (node is not null) { return((ESIR_LabeledStatement)node); } var ret = new ESIR_LabeledStatement(label, statement); if (hash >= 0) { ESIR_NodeCache.Shared.AddNode(ret, hash); } return(ret); }
public static ESIR_LoopStatement LoopStatement( ESIR_List <ESIR_Expression> condExpr, ESIR_List <ESIR_Expression>?iterExprs, ESIR_Statement bodyStmt ) { var node = ESIR_NodeCache.Shared.TryGetNode(ESIR_NodeKind.LoopStatement, condExpr, iterExprs, bodyStmt, out var hash); if (node is not null) { return((ESIR_LoopStatement)node); } var ret = new ESIR_LoopStatement(condExpr, iterExprs, bodyStmt); if (hash >= 0) { ESIR_NodeCache.Shared.AddNode(ret, hash); } return(ret); }
internal ESIR_ConditionalStatement(ESIR_Expression condition, ESIR_Statement thenStmt, ESIR_Statement?elseStmt) { conditionNode = condition; thenNode = thenStmt; elseNode = elseStmt; }
public static ESIR_ConditionalStatement ConditionalStatement(ESIR_Expression condition, ESIR_Statement thenStmt, ESIR_Statement?elseStmt) { var node = ESIR_NodeCache.Shared.TryGetNode(ESIR_NodeKind.ConditionalStatement, condition, thenStmt, elseStmt, out var hash); if (node is not null) { return((ESIR_ConditionalStatement)node); } var ret = new ESIR_ConditionalStatement(condition, thenStmt, elseStmt); if (hash >= 0) { ESIR_NodeCache.Shared.AddNode(ret, hash); } return(ret); }
public static ESIR_LabeledStatement LabeledStatement(ArrayPointer <byte> label, ESIR_Statement statement) => LabeledStatement(ValueNode(label), statement);