Example #1
0
        public override void ExitWhileStatement([NotNull] CmanParser.WhileStatementContext context)
        {
            ASTWhileStatementNode whileStmtNode;
            ASTBodyStatementNode  bodyNode = null;

            if (_nodes.Peek() is ASTBodyStatementNode)
            {
                bodyNode = (ASTBodyStatementNode)_nodes.Pop();
            }
            IASTExprNode condNode = (IASTExprNode)_nodes.Pop();

            whileStmtNode           = (ASTWhileStatementNode)_nodes.Peek();
            whileStmtNode.Body      = bodyNode;
            whileStmtNode.Condition = condNode;
        }
Example #2
0
 public override void EnterWhileStatement([NotNull] CmanParser.WhileStatementContext context)
 {
     _nodes.Push(new ASTWhileStatementNode(context, _nodes.Peek()));
 }