public void Visit(StatementsNode n) { PrintDOTIDLabel(n); PrintDOTParentChild(n); foreach (var child in n.GetChildren()) { child.Accept(this); } }
public void Visit(StatementsNode n) { var children = n.GetChildren(); foreach (var child in children) { child.Accept(this); } }
public void Visit(StatementsNode n) { var children = n.GetChildren(); var table = (FunctionSymbolTableEntry)n.SymTable; var returnType = table.ReturnType?.Lexeme ?? ""; if (!string.Equals(returnType, TypeConstants.VoidType) && !string.IsNullOrEmpty(returnType) && children.Where(x => x is ReturnNode).Count() == 0) { _errorStream.WriteLine($"Function {table.ToStringSignature()} returns an {returnType}, however no return statement was found."); Console.WriteLine($"Error: Function {table.ToStringSignature()} returns an {returnType}, however no return statement was found."); } foreach (var node in children) { node.SymTable = n.SymTable; node.Accept(this); } }