public override int VisitProg(RASTElement currentNode) { scopeSystem.EnterEnviroment("Global"); base.VisitProg(currentNode); scopeSystem.LeaveEnviroment(); scopeSystem.WriteToFile(m_outputStream); return(0); }
/// <summary> /// Visits the children of the specified context in the currentNode /// </summary> /// <param name="currentNode">The current node.</param> /// <returns></returns> public virtual Return VisitContext(RASTElement currentNode, ContextType context) { RAbstractIterator <RASTElement> it = m_iteratorFactory.CreateIteratorASTElementDescentantsContext(currentNode); // Call Accept to all children in the specified context of the current node for (it.ItBegin(context); !it.ItEnd(); it.ITNext()) { it.M_item.AcceptVisitor(this); } return(default(Return)); }
/// <summary> /// <c>VisitChildren</c> method is used to visit child nodes of the node given /// as a parameter. This method provides default functionality for /// </summary> /// <param name="currentNode">The current node.</param> /// <returns></returns> public virtual Return VisitChildren(RASTElement currentNode) { RAbstractIterator <RASTElement> it = m_iteratorFactory.CreateIteratorASTElementDescentantsFlatten(currentNode); // Call Accept to all children of the current node for (it.ItBegin(); !it.ItEnd(); it.ITNext()) { it.M_item.AcceptVisitor(this); } return(default(Return)); }
public override int VisitAssignmentOpetators(RASTElement currentNode) { RASTComposite current = currentNode as RASTComposite; // Visit assignment opetator left context if (current.GetNumberOfContextElements(ContextType.CT_EXPR_ASSIGNMENT_OPETATORS_LEFT) > 0) { foreach (RASTElement element in current.GetContextChildren(ContextType.CT_EXPR_ASSIGNMENT_OPETATORS_LEFT)) { scopeSystem.AddSymbol(element.M_Label, "Local Variable"); } } base.VisitAssignmentOpetators(currentNode); return(0); }
public override int VisitDefineFunction(RASTElement currentNode) { RASTComposite current = currentNode as RASTComposite; scopeSystem.EnterEnviroment(currentNode.M_Label); // Visit function's definition params context if (current.GetNumberOfContextElements(ContextType.CT_EXPR_DEFINE_FUNCTION_PARAMS) > 0) { foreach (RASTElement element in current.GetContextChildren(ContextType.CT_EXPR_DEFINE_FUNCTION_PARAMS)) { scopeSystem.AddSymbol(element.M_Label, "Formal Parameter"); } } base.VisitDefineFunction(currentNode); scopeSystem.LeaveEnviroment(); return(0); }
public virtual Return VisitWrappedWithPercent(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitMultiplicationOrDivisionBinary(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitProg(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual RAbstractIterator <RASTElement> CreateParenthesisIteratorEvents(RASTElement element, RASTGenericIteratorEvents events, object info = null) { return(CreateIteratorASTElementDescentantsFlattenEvents(element, events, info)); }
public virtual Return VisitBreakStatement(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitCOMPLEX(RASTElement currentNode) { return(base.VisitTerminal(currentNode)); }
public virtual Return VisitTildeBinary(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitCallFunction(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitMinusOrPlusBinary(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
/// <summary> /// Visits the specified node by calling its Accept function. The method /// can be used to start a new traversal from the specified node /// </summary> /// <param name="node">The node.</param> /// <returns></returns> public virtual Return Visit(RASTElement node) { // Call Accept of the specific node return(node.AcceptVisitor <Return>(this)); }
public virtual void OnContextLeave(RASTElement node, RASTVisitorEventArgs args) { m_OnContextLeave?.Invoke(node, args); }
public virtual void OnNodeEnter(RASTElement node, RASTVisitorEventArgs args) { m_OnNodeEnter?.Invoke(node, args); }
/// <summary> /// Visits the terminal. It doen't go any further since this is a leaf node /// </summary> /// <param name="node">The node.</param> /// <returns></returns> public virtual Return VisitTerminal(RASTElement node) { return(default(Return)); }
public virtual Return VisitComparisons(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public override int VisitIDENTIFIER(RASTElement currentNode) { scopeSystem.AddSymbol(currentNode.M_Label, "Check Type"); return(base.VisitIDENTIFIER(currentNode)); }
public virtual Return VisitAssignmentOpetators(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitSingleDoubleColonsOperators(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitHelpForMethods(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitDollarAtOperators(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitINTEGER(RASTElement currentNode) { return(base.VisitTerminal(currentNode)); }
public virtual Return VisitExponentiationBinary(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitLITERALSPECIFIER(RASTElement currentNode) { return(base.VisitTerminal(currentNode)); }
public virtual Return VisitColonOperator(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual Return VisitIndexingByVectors(RASTElement currentNode) { return(base.VisitChildren(currentNode)); }
public virtual RAbstractIterator <RASTElement> CreateParenthesisIterator(RASTElement element) { return(CreateIteratorASTElementDescentantsFlatten(element)); }