예제 #1
0
        public Grammar() : this(true) { } //case sensitive by default

        public Grammar(bool caseSensitive)
        {
            _currentGrammar        = this;
            this.CaseSensitive     = caseSensitive;
            LanguageStringComparer = caseSensitive ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase;
            KeyTerms = new KeyTermTable(LanguageStringComparer);
            //Initialize console attributes
            ConsoleTitle           = Resources.MsgDefaultConsoleTitle;
            ConsoleGreeting        = string.Format(Resources.MsgDefaultConsoleGreeting, this.GetType().Name);
            ConsolePrompt          = ">";
            ConsolePromptMoreInput = ".";
        }
예제 #2
0
파일: Grammar.cs 프로젝트: joewan/xenko
    public Grammar() : this(true) { } //case sensitive by default

    public Grammar(bool caseSensitive) {
      _currentGrammar = this;
      this.CaseSensitive = caseSensitive;
      bool ignoreCase =  !this.CaseSensitive;
      LanguageStringComparer = StringComparer.Create(System.Globalization.CultureInfo.InvariantCulture, ignoreCase);
      KeyTerms = new KeyTermTable(LanguageStringComparer);
      //Initialize console attributes
      ConsoleTitle = Resources.MsgDefaultConsoleTitle;
      ConsoleGreeting = string.Format(Resources.MsgDefaultConsoleGreeting, this.GetType().Name);
      ConsolePrompt = ">"; 
      ConsolePromptMoreInput = "."; 
    }
예제 #3
0
파일: Grammar.cs 프로젝트: wanglong/irony
        public Grammar() : this(true) { } //case sensitive by default

        public Grammar(bool caseSensitive)
        {
            _currentGrammar    = this;
            this.CaseSensitive = caseSensitive;
            bool ignoreCase     = !this.CaseSensitive;
            var  stringComparer = ignoreCase ? StringComparer.CurrentCultureIgnoreCase : StringComparer.CurrentCulture;

            KeyTerms = new KeyTermTable(stringComparer);
            //Initialize console attributes
            ConsoleTitle           = Resources.MsgDefaultConsoleTitle;
            ConsoleGreeting        = string.Format(Resources.MsgDefaultConsoleGreeting, this.GetType().Name);
            ConsolePrompt          = ">";
            ConsolePromptMoreInput = ".";
        }
예제 #4
0
파일: Grammar.cs 프로젝트: hozuki/irony-vs
        public Grammar(bool caseSensitive)
        {
            _currentGrammar = this;
            CaseSensitive   = caseSensitive;
            var ignoreCase     = !CaseSensitive;
            var stringComparer = StringComparer.Create(CultureInfo.InvariantCulture, ignoreCase);

            KeyTerms = new KeyTermTable(stringComparer);
            //Initialize console attributes
            ConsoleTitle           = Resources.MsgDefaultConsoleTitle;
            ConsoleGreeting        = string.Format(Resources.MsgDefaultConsoleGreeting, GetType().Name);
            ConsolePrompt          = ">";
            ConsolePromptMoreInput = ".";
        }
예제 #5
0
        public Grammar() : this(true) { } //case sensitive by default

        public Grammar(bool caseSensitive)
        {
            _currentGrammar    = this;
            this.CaseSensitive = caseSensitive;
#if !SILICONSTUDIO_RUNTIME_CORECLR
            bool ignoreCase = !this.CaseSensitive;
            LanguageStringComparer = StringComparer.Create(CultureInfo.InvariantCulture, ignoreCase);
#else
            LanguageStringComparer = CultureInfo.InvariantCulture.CompareInfo.GetStringComparer(caseSensitive ? CompareOptions.None : CompareOptions.IgnoreCase);
#endif
            KeyTerms = new KeyTermTable(LanguageStringComparer);
            //Initialize console attributes
            ConsoleTitle           = Resources.MsgDefaultConsoleTitle;
            ConsoleGreeting        = string.Format(Resources.MsgDefaultConsoleGreeting, this.GetType().Name);
            ConsolePrompt          = ">";
            ConsolePromptMoreInput = ".";
        }