Example #1
0
        /// <summary>
        ///     Creates a XLExpressionParser instance
        /// </summary>
        /// <param name="context">XL Context</param>
        /// <param name="reader">Expression Reader</param>
        /// <returns></returns>
        public static HlExpressionParser Create(HlExpressionReader reader)
        {
            HlExpressionOperator[] operators =
            {
                new ArraySubscriptOperator(),
                new AssignmentOperators(),
                new BitAndOperators(),
                new BitOrOperators(),
                new BitXOrOperators(),
                new InEqualityOperators(),
                new EqualityOperators(),
                new InvocationSelectorOperator(),
                new LogicalAndOperators(),
                new LogicalOrOperators(),
                new MemberSelectorOperator(),
                new MulDivModOperators(),
                new PlusMinusOperators(),
                new RelationOperators(),
                new UnaryOperators(),
                new BitShiftOperators(),
                new AssignmentPlusMinusOperators(),
                new AssignmentByOperators()
            };

            HlExpressionValueCreator valueCreator = new HlExpressionValueCreator();

            return(new HlExpressionParser(reader, valueCreator, operators));
        }
Example #2
0
 /// <summary>
 ///     Public Constructor
 /// </summary>
 /// <param name="context">XL Context</param>
 /// <param name="reader">Token Reader</param>
 /// <param name="valueCreator">XLExpression Value Creator</param>
 /// <param name="operators">Operator Collection</param>
 public HlExpressionParser(
     HlExpressionReader reader,
     HlExpressionValueCreator valueCreator,
     HlExpressionOperator[] operators)
 {
     m_OpCollection = new HlExpressionOperatorCollection(operators);
     ValueCreator   = valueCreator;
     Reader         = reader;
     CurrentToken   = reader.GetNext();
 }