public override int VisitExprNextStatement(RParser.ExprNextStatementContext context) { string label = "NextStatement_" + ms_ASTElementCounter.ToString(); m_outputStream.WriteLine("\"{0}\"->\"{1}\";", m_PTPath.Peek(), label); ms_ASTElementCounter++; m_PTPath.Push(label); base.VisitExprNextStatement(context); // POSTORDER ACTIONS m_PTPath.Pop(); return(0); }
public override int VisitExprNextStatement(RParser.ExprNextStatementContext context) { RASTComposite parent = m_parents.Peek(); // PREORDER ACTIONS // Create new element RASTComposite newElement = new RNextStatement(parent); // Update parents stack m_parents.Push(newElement); // Add new element to the parent's descentants parent.AddChild(newElement, m_currentContext.Peek()); // VISIT CHILDREN // POSTORDER ACTIONS // Update parents stack m_parents.Pop(); return(0); }