Exemplo n.º 1
0
 internal ESIR_LoopStatement(
     ESIR_List <ESIR_Expression> condExpr,
     ESIR_List <ESIR_Expression>?iterExpr,
     ESIR_Statement bodyStmt
     )
 {
     condNode = condExpr;
     iterNode = iterExpr;
     bodyNode = bodyStmt;
 }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
 internal ESIR_ConditionalStatement(ESIR_Expression condition, ESIR_Statement thenStmt, ESIR_Statement?elseStmt)
 {
     conditionNode = condition;
     thenNode      = thenStmt;
     elseNode      = elseStmt;
 }
Exemplo n.º 5
0
    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);
    }
Exemplo n.º 6
0
 public static ESIR_LabeledStatement LabeledStatement(ArrayPointer <byte> label, ESIR_Statement statement)
 => LabeledStatement(ValueNode(label), statement);