Avoid singleton Settings; make internal

Utilities.Keywords now accepts an explicit parameter, instead of
accessing Settings directly. This allows us to use multiple
configurations in the same process.

Additionally, the Utilities class is no longer public (the Bind project
is not meant to be consumed as a dll.)
This commit is contained in:
Stefanos A. 2013-11-01 09:03:36 +01:00
parent f00c2e0527
commit f000bda891

View file

@ -67,7 +67,7 @@ namespace Bind
#endregion
public static class Utilities
static class Utilities
{
public static readonly char[] Separators = { ' ', '\n', ',', '(', ')', ';', '#' };
public static Regex Extensions { get; private set; }
@ -117,17 +117,14 @@ namespace Bind
#region Keywords
public static List<string> Keywords
public static List<string> Keywords(GeneratorLanguage language)
{
get
switch (language)
{
switch (Settings.Language)
{
case GeneratorLanguage.CSharp: return CSharpKeywords;
case GeneratorLanguage.Cpp: return CppKeywords;
case GeneratorLanguage.Java: return JavaKeywords;
default: throw new NotImplementedException();
}
case GeneratorLanguage.CSharp: return CSharpKeywords;
case GeneratorLanguage.Cpp: return CppKeywords;
case GeneratorLanguage.Java: return JavaKeywords;
default: throw new NotImplementedException();
}
}