public virtual void visit(IForNode value) { }
public void visit(IForNode value) { string s = value.GetType().Name + "."; prepare_node(value.body, s + "body "); prepare_node(value.increment_statement, s + "increment_statement "); prepare_node(value.initialization_statement, s + "initialization_statemennt "); prepare_node(value.while_expr, s + "while_expr "); }
public void visit(IForNode value) { StringBuilder bodyBlock = new StringBuilder(""); StringBuilder parameters = new StringBuilder(""); value.body.visit(this); if (value.initialization_statement != null) { value.initialization_statement.visit(this); bodyBlock.Append(ISemanticNodeConverter.SourceTextBuilder.GetNodeFromStack()); } bodyBlock.Append(";"); //bodyBlock.Append(" "); if (value.while_expr != null) { value.while_expr.visit(this); bodyBlock.Append(ISemanticNodeConverter.SourceTextBuilder.GetNodeFromStack()); } bodyBlock.Append(";"); //bodyBlock.Append(" "); if (value.increment_statement != null) { value.increment_statement.visit(this); bodyBlock.Append(ISemanticNodeConverter.SourceTextBuilder.GetNodeFromStack()); } ISemanticNodeConverter.SourceTextBuilder.AddNodeInToStack(bodyBlock.ToString()); ISemanticNodeConverter.SourceTextBuilder.AddNodeInToStack(ISemanticNodeConverter.ConvertPABCNETNodeFor("for", value)); }