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