public override (bool success, string validationError) VisitNodeLine(NodeLine nodeLine) { if (AfterEmptyLine(nodeLine.Line)) { return(false, "Encountered node after empty line. (line: '" + nodeLine.Line + "')"); } return(true, ""); }
public override (bool success, string validationError) VisitNodeLine(NodeLine nodeLine) { string nodeName = nodeLine.Line.Split(':')[0]; int occurrences = new Regex(Regex.Escape(nodeName + ":")).Matches(WholeFile).Count; if ( !nodeLine.Line.Contains("PROBE") && !nodeLine.Line.Contains("INPUT_HIGH") && !nodeLine.Line.Contains("INPUT_LOW") && occurrences < 2 ) { return(false, nodeName + " has no outputs."); } return(true, ""); }
public override (bool success, string validationError) VisitNodeLine(NodeLine nodeLine) { // valid line syntax var regex = new Regex(@"(^#.*$)|((^\w+):(\s*)(\w+,)*(\w+;$))"); if (!regex.Match(nodeLine.Line).Success) { return(false, "Line doesn't conform to syntax: '" + nodeLine.Line + "'"); } string type = nodeLine.Line.Split(':')[1].Trim().Replace(";", ""); string[] types = GetInternalCircuitNames(); if ( !types.Contains(type) ) { return(false, "'" + type + "' is not a valid node type."); } NodeNames.Add(nodeLine.Line.Split(':')[0]); return(true, ""); }
public override (bool success, string validationError) VisitNodeLine(NodeLine nodeLine) { return(true, ""); }