Ejemplo n.º 1
0
 private void ResetCategoryFiltering(IConstantDB db)
 {
     VisibleConstants         = db.GetCategory(db.Categories.First());
     ConstantCategories       = db.Categories;
     Categories.SelectedIndex = 0;
 }
Ejemplo n.º 2
0
 public ConstantParser(IConstantDB db)
 {
     _db = db;
 }
Ejemplo n.º 3
0
        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();
        }