Exemplo n.º 1
0
        private void SetCharacteristic(char c, IVariableAttr attr = null)
        {
            var cha = new CharacteristicInfo(EBAType.After, c.ToString() + c);

            if (attr == null)
            {
                attr = this.pVariableAttr;
            }
            attr.Characteristic = cha;
        }
Exemplo n.º 2
0
        public override void Init()
        {
            if (!(this.NEleme is IVariableAttr))
            {
                this.Error("NEleme 不是有效的 IVariableAttr");
            }
            pVariableAttr = this.NEleme as IVariableAttr;

            this.SetUpPoint();
            this.GetChar();
            switch (this._Char)
            {
            case '.':
                this.Property();
                break;

            case '[':
                this.Index();
                break;

            case '(':
                this.CallOwn();
                break;

            case ';':
                break;

            case '+':
            case '-':
                this.Increment(this._Char);
                break;

            default:
                this.ResetUpPoint();
                break;
            }
        }
Exemplo n.º 3
0
        private void End(EPType p, BEleme e)
        {
            this.SetUpPoint();
            this.GetChar();
            switch (this._Char)
            {
            case '+':
            case '-':
            case '.':
            case '[':
            case '(':
                if (this._Char == '+' || this._Char == '-')
                {
                    var c     = this._Char;
                    var point = new CPoint(this.UpPoint);
                    this.GetChar(false, null);
                    if (this._Char != c)
                    {
                        this.PBParser.Point.X = point.X;
                        this.PBParser.Point.Y = point.Y;
                        break;
                    }

                    if (p == EPType.Method)
                    {
                        this.Error();
                    }

                    IVariableAttr att    = null;
                    BEleme        father = this.NEleme.Father;
                    while (father is IVariableValue)
                    {
                        father = father.Father;
                        if (father is JVariableEleme)
                        {
                            if ((father as JVariableEleme).IsStart)
                            {
                                att = father as JVariableEleme;
                                break;
                            }
                            father = father.Father;
                        }
                    }
                    SetCharacteristic(c, att);
                    break;
                }

                this.ResetUpPoint();
                var varElem = new JVariableEleme();
                this.AddFather(e, varElem);
                var variableSpan = new VariableSpan(this.PBParser, varElem);
                variableSpan.Init();
                break;

            case ';':
                break;

            default:
                this.ResetUpPoint();
                break;
            }
        }