Esempio n. 1
0
        public override int VisitWhile(CWhile node)
        {
            CEmmitableCodeContainer parent = m_parents.Peek() as CEmmitableCodeContainer;
            CWhileStatement         rep    = new CWhileStatement(CodeBlockType.CB_WHILESTATEMENT, 2, parent);

            parent.AddCode(rep, m_parentContexts.Peek());

            m_parents.Push(rep);
            m_parentContexts.Push(CWhileStatement.CC_WHILESTATEMENT_CONDITION);

            foreach (ASTVisitableElement child in
                     node.GetChildrenContext(CWhile.CT_CONDITION))
            {
                Visit(child);
            }
            m_parents.Pop();
            m_parentContexts.Pop();

            m_parents.Push(rep);
            m_parentContexts.Push(CWhileStatement.CC_WHILESTATEMENT_BODY);

            // Visit Function Definitions and emmit code to distinct functions
            foreach (ASTVisitableElement child in node.GetChildrenContext(CWhile.CT_BODY))
            {
                Visit(child);
            }

            m_parents.Pop();
            m_parentContexts.Pop();

            return(0);
        }
Esempio n. 2
0
        public override int VisitWhile(CWhile node)
        {
            ExtractSubgraphs(node, CWhile.CT_CONDITION, CWhile.ContextNames);
            ExtractSubgraphs(node, CWhile.CT_BODY, CWhile.ContextNames);

            base.VisitWhile(node);

            m_ostream.WriteLine("{0}->{1}", currentParent.M_GraphVizName, node.M_GraphVizName);

            return(0);
        }
Esempio n. 3
0
 public virtual T VisitWhile(CWhile node)
 {
     return(VisitChildren(node));
 }