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); }
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); }
private LogicalRow(LogicalReport report) { _report = report; }
public LogicalReport Analyze() { LogicalGrammarResult result = _grammarAnalyzer.Analyze(); return(LogicalReport.CreateFromResults(result)); }