示例#1
0
        private void AddSheetReferenceToken(string sheet)
        {
            string cell = this.GetCell();

            if (cell == string.Empty)
            {
                this.Expected("3d sheet cell reference.");
            }
            sheet = sheet + "!" + cell;
            if (this.GetNextOnDemand(':'))
            {
                string match = this.GetCell();
                if (RefFormulaToken.IsCell(match))
                {
                    FormulaTokenCode code = this.isFunctionArgumentsProcessed ? FormulaTokenCode.Area3d1 : FormulaTokenCode.Area3d2;
                    this.AddToken(code, new object[] { sheet + ":" + match, this.worksheet.Parent });
                }
                else
                {
                    this.Expected("3d area reference.");
                }
            }
            else
            {
                FormulaTokenCode code2 = this.isFunctionArgumentsProcessed ? FormulaTokenCode.Ref3d1 : FormulaTokenCode.Ref3d2;
                this.AddToken(code2, new object[] { sheet, this.worksheet.Parent });
            }
        }
示例#2
0
 private bool IsCell(string cellValue)
 {
     if (this.buffer.Peek() != RefFormulaToken.AbsoluteCellMark)
     {
         return(RefFormulaToken.IsCell(cellValue));
     }
     return(true);
 }
示例#3
0
        private string GetCell()
        {
            string match = string.Empty;

            if (this.GetNextOnDemand(RefFormulaToken.AbsoluteCellMark))
            {
                match = RefFormulaToken.AbsoluteCellMark + this.buffer.GetNextString(false);
            }
            else
            {
                match = this.buffer.GetNextString(false);
            }
            if (this.GetNextOnDemand(RefFormulaToken.AbsoluteCellMark, false))
            {
                match = match + RefFormulaToken.AbsoluteCellMark + this.buffer.GetNextString(false);
            }
            if (!RefFormulaToken.IsCell(match))
            {
                this.Expected("Cell.");
            }
            return(match);
        }
示例#4
0
 private void AddCellOrRangeToken(string cellValue)
 {
     if (this.buffer.Peek() == RefFormulaToken.AbsoluteCellMark)
     {
         cellValue = this.GetCell();
     }
     if (this.GetNextOnDemand(':'))
     {
         string cell = this.GetCell();
         if (RefFormulaToken.IsCell(cell))
         {
             this.AddArea(cellValue + ":" + cell);
         }
         else
         {
             this.Expected("Area.");
         }
     }
     else
     {
         this.AddToken(FormulaTokenCode.Ref2, cellValue);
     }
 }