Search in sources :

Example 1 with SequenceNode

use of st.gravel.support.compiler.ast.SequenceNode in project gravel by gravel-st.

the class IntermediateNodeRewriter method produce_whileFalse_.

public WhileFalseNode produce_whileFalse_(final Expression _testExpr, final Expression _loopExpr) {
    final BlockNode _testBlockNode;
    final BlockNode _loopBlockNode;
    if (!_testExpr.isBlockNode()) {
        return null;
    }
    if (!_loopExpr.isBlockNode()) {
        return null;
    }
    _testBlockNode = ((BlockNode) _testExpr);
    _loopBlockNode = ((BlockNode) _loopExpr);
    return WhileFalseNode.factory.testSequence_doSequence_(((SequenceNode) this.visit_(_testBlockNode.body())), ((SequenceNode) this.visit_(_loopBlockNode.body())));
}
Also used : BlockNode(st.gravel.support.compiler.ast.BlockNode) SequenceNode(st.gravel.support.compiler.ast.SequenceNode)

Example 2 with SequenceNode

use of st.gravel.support.compiler.ast.SequenceNode in project gravel by gravel-st.

the class IntermediateNodeRewriter method produce_to_do_.

public ToDoNode produce_to_do_(final Expression _start, final Expression _stop, final Expression _loopExpr) {
    final BlockNode _loopBlockNode;
    if (!_loopExpr.isBlockNode()) {
        return null;
    }
    _loopBlockNode = ((BlockNode) _loopExpr);
    return ToDoNode.factory.start_stop_step_counterName_doSequence_(((Expression) this.visit_(_start)), ((Expression) this.visit_(_stop)), IntegerLiteralNode.factory.integer_(((java.math.BigInteger) java.math.BigInteger.ONE)), _loopBlockNode.arguments()[0].name(), ((SequenceNode) this.visit_(_loopBlockNode.body())));
}
Also used : BlockNode(st.gravel.support.compiler.ast.BlockNode) Expression(st.gravel.support.compiler.ast.Expression) SequenceNode(st.gravel.support.compiler.ast.SequenceNode)

Example 3 with SequenceNode

use of st.gravel.support.compiler.ast.SequenceNode in project gravel by gravel-st.

the class IntermediateNodeRewriter method produce_and_.

public BooleanAndNode produce_and_(final Node _receiver, final Expression _testExpr) {
    final BlockNode _testBlockNode;
    if (!_testExpr.isBlockNode()) {
        return null;
    }
    _testBlockNode = ((BlockNode) _testExpr);
    return BooleanAndNode.factory.left_right_(((Expression) this.visit_(_receiver)), ((SequenceNode) this.visit_(_testBlockNode.body())));
}
Also used : BlockNode(st.gravel.support.compiler.ast.BlockNode) Expression(st.gravel.support.compiler.ast.Expression) SequenceNode(st.gravel.support.compiler.ast.SequenceNode)

Example 4 with SequenceNode

use of st.gravel.support.compiler.ast.SequenceNode in project gravel by gravel-st.

the class IntermediateNodeRewriter method produce_whileTrue_.

public WhileTrueNode produce_whileTrue_(final Expression _testExpr, final Expression _loopExpr) {
    final BlockNode _testBlockNode;
    final BlockNode _loopBlockNode;
    if (!_testExpr.isBlockNode()) {
        return null;
    }
    if (!_loopExpr.isBlockNode()) {
        return null;
    }
    _testBlockNode = ((BlockNode) _testExpr);
    _loopBlockNode = ((BlockNode) _loopExpr);
    return WhileTrueNode.factory.testSequence_doSequence_(((SequenceNode) this.visit_(_testBlockNode.body())), ((SequenceNode) this.visit_(_loopBlockNode.body())));
}
Also used : BlockNode(st.gravel.support.compiler.ast.BlockNode) SequenceNode(st.gravel.support.compiler.ast.SequenceNode)

Example 5 with SequenceNode

use of st.gravel.support.compiler.ast.SequenceNode in project gravel by gravel-st.

the class IntermediateNodeRewriter method produce_to_by_do_.

public ToDoNode produce_to_by_do_(final Expression _start, final Expression _stop, final Expression _step, final Expression _loopExpr) {
    final BlockNode _loopBlockNode;
    if (!_loopExpr.isBlockNode()) {
        return null;
    }
    if (!_step.isIntegerLiteralNode()) {
        return null;
    }
    _loopBlockNode = ((BlockNode) _loopExpr);
    return ToDoNode.factory.start_stop_step_counterName_doSequence_(((Expression) this.visit_(_start)), ((Expression) this.visit_(_stop)), ((Expression) this.visit_(_step)), _loopBlockNode.arguments()[0].name(), ((SequenceNode) this.visit_(_loopBlockNode.body())));
}
Also used : BlockNode(st.gravel.support.compiler.ast.BlockNode) Expression(st.gravel.support.compiler.ast.Expression) SequenceNode(st.gravel.support.compiler.ast.SequenceNode)

Aggregations

SequenceNode (st.gravel.support.compiler.ast.SequenceNode)14 BlockNode (st.gravel.support.compiler.ast.BlockNode)9 Expression (st.gravel.support.compiler.ast.Expression)6 VariableDeclarationNode (st.gravel.support.compiler.ast.VariableDeclarationNode)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 BlockTypeNode (st.gravel.support.compiler.ast.BlockTypeNode)3 InstanceTypeNode (st.gravel.support.compiler.ast.InstanceTypeNode)3 PragmaNode (st.gravel.support.compiler.ast.PragmaNode)3 SelfTypeNode (st.gravel.support.compiler.ast.SelfTypeNode)3 TypeCast (st.gravel.support.compiler.ast.TypeCast)3 TypeNode (st.gravel.support.compiler.ast.TypeNode)3 Statement (st.gravel.support.compiler.ast.Statement)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 VariableNode (st.gravel.support.compiler.ast.VariableNode)1 VariableScopeAnalyzerState (st.gravel.support.compiler.ast.VariableScopeAnalyzerState)1