コード例 #1
0
 private void ResetCategoryFiltering(IConstantDB db)
 {
     VisibleConstants         = db.GetCategory(db.Categories.First());
     ConstantCategories       = db.Categories;
     Categories.SelectedIndex = 0;
 }
コード例 #2
0
 public ConstantParser(IConstantDB db)
 {
     _db = db;
 }
コード例 #3
0
ファイル: Preprocessor.cs プロジェクト: rajeshwarn/Thingy
        public Preprocessor(IDictionary <string, FunctionInformation> functionReplcaceTable, IConstantDB constantDB)
        {
            _functionReplaceTable = functionReplcaceTable;
            _operators            = new string[] { @"\+", @"\-", @"\*\*", @"\*", @"\/\/", @"\/", @"\%", @"\&", @"\|", @"\^", @"\~", @"\(", @"\)", @"\," };
            _processors           = new List <IProcessor>
            {
                new BinaryNumberParser(),
                new HexaNumberParser(),
                new OctalNumberParser(),
                new RomanNumberParser(),
                new PrefixedNumberParser(),
                new CustomNumberSystemParser(),
            };

            if (constantDB != null)
            {
                _processors.Add(new ConstantParser(constantDB));
            }

            StringBuilder regex = new StringBuilder();

            foreach (var @operator in _operators)
            {
                regex.AppendFormat("({0})|", @operator);
            }
            regex.Remove(regex.Length - 1, 1);
            _tokenizerregex = regex.ToString();
        }