public IncorrectValueFormatException(TextualOperation operation, TextualTable table) { TextualOperation = operation; TextualTable = table; message = MESSAGE_FORMAT; }
private TextualWhereCondition parseCondition(TextualOperation operation) { // column1 string column = expectToken(TokenType.Identifier).Value; // = string op = expectToken(TokenType.Comparison).Value; object val; // 1 if (matchToken(TokenType.Number)) { val = Convert.ToDouble(expectToken(TokenType.Number).Value); } // "val1" else { val = expectToken(TokenType.String).Value; } return(new TextualWhereCondition(TextualWhereCondition.ParseWhereOperation(operation, op), column, val)); }
public void Run() { while (true) { try { Console.Write(state.Prompt); string line = Console.ReadLine(); string[] parts = line.Split(' '); if (parts[0].ToUpper() == "UI") { handleUICommand(parts.Skip(1).ToArray()); } else { handleResult(TextualOperation.ExecuteOperation(state.Database, line)); } if (state.PersistChanges) { state.SaveDatabase(); } } catch (CommandLineException cle) { Console.WriteLine(cle.Message); } catch (ComponentException ce) { Console.WriteLine(ce.Message); } catch (OperationException oe) { Console.WriteLine(oe.Message); } } }
public ColumnValueCountMismatchException(TextualOperation operation, int columnCount, int valueCount) { TextualOperation = operation; message = string.Format(MESSAGE_FORMAT, columnCount, valueCount); }
public UnknownWhereOperationException(TextualOperation operation, string op) { TextualOperation = operation; message = string.Format(MESSAGE_FORMAT, op); }