public static Dictionary <string, Func <string[], string> > getMessages(IndentationErrors theLogicOrder) { Dictionary <string, Func <string[], string> > messages = new Dictionary <string, Func <string[], string> > (); messages.Add(IndentationErrorType.unknownIndentStarter.ToString(), theLogicOrder.unknownIndentStarter); messages.Add(IndentationErrorType.firstLineIndentError.ToString(), theLogicOrder.firstLineIndentError); messages.Add(IndentationErrorType.indentationError.ToString(), theLogicOrder.indentationError); messages.Add(IndentationErrorType.expectingBodyAfterScopeStarter.ToString(), theLogicOrder.expectingBodyAfterScopeStarter); return(messages); }
public static void setLanguage() { currentLanguage = new SwedishLanguage(); IErrorSender theSender = (currentLanguage as IErrorSender); IfStatementErrors ifError = theSender.ifStatementErrors; ElseStatementErrors elseError = theSender.elseStatementErrors; ForLoopErrors forError = theSender.forLoopErrors; IndentationErrors indentError = theSender.indentErrors; TextErrors txtError = theSender.textErrors; VariableErrors varError = theSender.variableErrors; WhileLoopErrors whileError = theSender.whileLoopErrors; NumberErrors numError = theSender.numberErrors; KeywordErrors keywordError = theSender.keywordErrors; FunctionErrors funcError = theSender.functionErrors; OtherErrors otherError = theSender.otherErrors; SystemFailureErrors systemErrors = theSender.systemErrors; currentLanguage.initLanguageErrors1(ifError, elseError, forError, indentError, txtError, varError); currentLanguage.initLanguageErrors2(whileError, numError, keywordError, funcError, otherError, systemErrors); }
/// Inits first part of the language errors. Stores error messages in dictionary. public void initLanguageErrors1(IfStatementErrors If, ElseStatementErrors Else, ForLoopErrors For, IndentationErrors Indent, TextErrors Text, VariableErrors Variable) { errorMessages.Add(ErrorType.IfStatements, IfErrorsOrder.getMessages(If)); errorMessages.Add(ErrorType.ElseStatements, ElseErrorsOrder.getMessages(Else)); errorMessages.Add(ErrorType.ForLoop, ForErrorsOrder.getMessages(For)); errorMessages.Add(ErrorType.Indentation, IndentationErrorsOrder.getMessages(Indent)); errorMessages.Add(ErrorType.Text, TextErrorsOrder.getMessages(Text)); errorMessages.Add(ErrorType.Variable, VariableErrorsOrder.getMessages(Variable)); }