public override int VisitAssignment(CAssignment node)
        {
            ExtractSubgraphs(node, CAssignment.CT_LEFT, CAssignment.ContextNames);
            ExtractSubgraphs(node, CAssignment.CT_RIGHT, CAssignment.ContextNames);

            base.VisitAssignment(node);

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

            return(0);
        }
        //..............
        public override int VisitAssignment(CAssignment node)
        {
            CEmmitableCodeContainer parent = m_parents.Peek() as CEmmitableCodeContainer;
            int context = m_parentContexts.Peek();

            CodeContainer rep = new CodeContainer(CodeBlockType.CB_CODEREPOSITORY, parent);

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

            m_parents.Push(rep);
            m_parentContexts.Push(context);

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

            rep.AddCode("=", context);

            m_parents.Push(rep);
            m_parentContexts.Push(context);
            // Visit Statements Context and emmit code to main functions
            foreach (ASTVisitableElement child in
                     node.GetChildrenContext(CAssignment.CT_RIGHT))
            {
                Visit(child);
            }
            m_parents.Pop();
            m_parentContexts.Pop();

            //..........
            if (m_for.Count == 0)
            {
                rep.AddCode(";");
                rep.AddNewLine();
            }
            //..........

            // rep.AddCode(";");
            // rep.AddNewLine();

            return(0);
        }
Beispiel #3
0
 //............
 public virtual T VisitAssignment(CAssignment node)
 {
     return(VisitChildren(node));
 }