コード例 #1
0
        internal static LogicalRow CreateFromVariablesValues(LogicalReport report, LogicalGrammarResult result, List <LogicalVariable> variables)
        {
            var logicalRow = new LogicalRow(report);

            logicalRow.VariablesValues = variables.Select(variable => variable.Value).ToList();
            logicalRow.Result          = result.LogicalOperation.GetValue();
            return(logicalRow);
        }
コード例 #2
0
        internal static LogicalReport CreateFromResults(LogicalGrammarResult result)
        {
            LogicalReport report = new LogicalReport();

            if (result.Variables.Count == 0)
            {
                report.UniqueResult = result.LogicalOperation.GetValue();
                return(report);
            }

            List <LogicalVariable> variablesList = result.Variables.Values.OrderBy(v => v.ID).ToList();

            report.ColumnNames = variablesList.Select(variable => variable.ID).ToList();
            report.PopulateFromVariables(result, variablesList);
            bool r1 = report.Rows[0].Result;

            if (report.Rows.All(row => row.Result == r1))
            {
                report.UniqueResult = r1;
            }

            return(report);
        }
コード例 #3
0
 private LogicalRow(LogicalReport report)
 {
     _report = report;
 }
コード例 #4
0
        public LogicalReport Analyze()
        {
            LogicalGrammarResult result = _grammarAnalyzer.Analyze();

            return(LogicalReport.CreateFromResults(result));
        }