Exemplo n.º 1
0
        public override (bool success, string validationError) VisitConnectionLine(ConnectionLine connectionLine)
        {
            if (!AfterEmptyLine(connectionLine.Line))
            {
                return(false, "Encountered connection before empty line. (line: '" + connectionLine.Line + "')");
            }

            return(true, "");
        }
Exemplo n.º 2
0
        public override (bool success, string validationError) VisitConnectionLine(ConnectionLine connectionLine)
        {
            if (!RecurseToOutput(connectionLine.Line, connectionLine.Line, WholeFile.Split('\n').Length, 0))
            {
                return(false, "Node: '" + connectionLine.Line.Split(':')[0] + "' leads to an infinite loop.");
            }

            return(true, "");
        }
Exemplo n.º 3
0
        public override (bool success, string validationError) VisitConnectionLine(ConnectionLine connectionLine)
        {
            // valid line syntax
            var regex = new Regex(@"(^#.*$)|((^\w+):(\s*)(\w+,)*(\w+;$))");

            if (!regex.Match(connectionLine.Line).Success)
            {
                return(false, "Line doesn't conform to syntax: '" + connectionLine.Line + "'");
            }

            // nodeName validation
            string nodeName = connectionLine.Line.Split(':')[0];

            if (!NodeNames.Contains(nodeName))
            {
                return(false, "Node wasn't defined: '" + connectionLine.Line + "'");
            }

            return(true, "");
        }
 public override (bool success, string validationError) VisitConnectionLine(ConnectionLine connectionLine)
 {
     return(true, "");
 }