示例#1
0
 public SlicedExpression(IExpression targetExpression, SliceExpression sliceExpression)
 {
     this.targetExpression = targetExpression;
     this.sliceExpression = sliceExpression;
 }
示例#2
0
 public SlicedExpression(IExpression targetExpression, SliceExpression sliceExpression)
 {
     this.targetExpression = targetExpression;
     this.sliceExpression  = sliceExpression;
 }
示例#3
0
        private IExpression CompileIndexedExpression(IExpression term)
        {
            IExpression indexpr = null;
            IExpression endexpr = null;

            if (!this.TryCompile(TokenType.Separator, ":"))
            {
                indexpr = this.CompileExpression();

                if (!this.TryCompile(TokenType.Separator, ":"))
                {
                    this.CompileToken(TokenType.Separator, "]");

                    if (indexpr != null)
                        return new IndexedExpression(term, indexpr);

                    return new SlicedExpression(term, new SliceExpression(null, null));
                }

                if (this.TryCompile(TokenType.Separator, "]"))
                    return new SlicedExpression(term, new SliceExpression(indexpr, endexpr));

                endexpr = this.CompileExpression();
            }
            else
                endexpr = this.CompileExpression();

            this.CompileToken(TokenType.Separator, "]");

            SliceExpression sexpr = new SliceExpression(indexpr, endexpr);
            return new SlicedExpression(term, sexpr);
        }