Exemplo n.º 1
0
        public ScientificCalculator(

            IInputBuffer buffer,
            IOperatorLookup lookup,
            IUnitConverter unitConverter,
            IOperatorConverter operatorConverter,
            IExpressionBuilder builder,
            IExpressionParser parser,
            IEvaluate evaluator,
            IMemoryStorage memory

            ) : base(

                buffer,
                lookup,
                unitConverter,
                operatorConverter,
                builder,
                parser,
                evaluator,
                memory

                )
        {
        }
Exemplo n.º 2
0
        public Evaluator(

            IUnitConverter unitConverter,
            IOperatorConverter operatorConverter,
            IOperatorLookup operatorLookup

            )
        {
            UnitConverter     = unitConverter;
            OperatorConverter = operatorConverter;
            Lookup            = operatorLookup;
            Initialize();
        }
Exemplo n.º 3
0
        public StandardCalculator(

            IInputBuffer buffer,
            IOperatorLookup lookup,
            IUnitConverter unitConverter,
            IOperatorConverter operatorConverter,
            IExpressionBuilder builder,
            IExpressionParser parser,
            IEvaluate evaluator,
            IMemoryStorage memory

            ) : base(buffer)
        {
            Lookup            = lookup;
            UnitConverter     = unitConverter;
            OperatorConverter = operatorConverter;
            Builder           = builder;
            Parser            = parser;
            Evaluator         = evaluator;
            Memory            = memory;
        }
        public void Setup()
        {
            buffer            = new InputBuffer();
            lookup            = new OperatorLookup();
            unitConverter     = new AngleConverter();
            operatorConverter = new OperatorConverter(lookup.Operators, lookup.Unary);
            parenthesizer     = new Parenthesizer(lookup.Precedence);
            builder           = new ExpressionBuilder(parenthesizer);
            parser            = new ExpressionParser(operatorConverter);
            evaluator         = new Evaluator(unitConverter, operatorConverter, lookup);
            memory            = new MemoryStorage();

            calculator = new ScientificCalculator(

                buffer,
                lookup,
                unitConverter,
                operatorConverter,
                builder,
                parser,
                evaluator,
                memory
                );
        }