Esempio n. 1
0
            public override void Visit(ComputationalData computationalData)
            {
                switch (computationalData.Tag)
                {
                case ComputationalData.TagValue.ByteConst:
                    result = new AcpiObject.Integer(computationalData.GetAsByteConst());
                    break;

                case ComputationalData.TagValue.WordConst:
                    result = new AcpiObject.Integer(computationalData.GetAsWordConst());
                    break;

                case ComputationalData.TagValue.DWordConst:
                    result = new AcpiObject.Integer(computationalData.GetAsDWordConst());
                    break;

                case ComputationalData.TagValue.QWordConst:
                    result = new AcpiObject.Integer(computationalData.GetAsQWordConst());
                    break;

                case ComputationalData.TagValue.StringConst:
                    result = new AcpiObject.String(computationalData.GetAsStringConst());
                    break;

                case ComputationalData.TagValue.RevisionOp:
                    result = AcpiObject.IntegerConstant.Revision.GetAsInt();
                    break;

                default:
                    base.Visit(computationalData);
                    break;
                }
            }
Esempio n. 2
0
        public override void Visit(ComputationalData computationalData)
        {
            switch (computationalData.Tag)
            {
            case ComputationalData.TagValue.ByteConst:
                byte byteConst = computationalData.GetAsByteConst();
                result.Add(new PushConst(new AcpiObject.Integer(byteConst)));
                break;

            case ComputationalData.TagValue.WordConst:
                UInt16 wordConst = computationalData.GetAsWordConst();
                result.Add(new PushConst(new AcpiObject.Integer(wordConst)));
                break;

            case ComputationalData.TagValue.DWordConst:
                UInt32 dWordConst = computationalData.GetAsDWordConst();
                result.Add(new PushConst(new AcpiObject.Integer(dWordConst)));
                break;

            case ComputationalData.TagValue.QWordConst:
                UInt64 qWordConst = computationalData.GetAsQWordConst();
                result.Add(new PushConst(new AcpiObject.Integer(qWordConst)));
                break;

            case ComputationalData.TagValue.StringConst:
                string stringConst = computationalData.GetAsStringConst();
                result.Add(new PushConst(new AcpiObject.String(stringConst)));
                break;

            case ComputationalData.TagValue.ConstObj:
                AmlParser.ConstObj constObj = computationalData.GetAsConstObj();
                switch (constObj.op)
                {
                case AmlParser.ZeroOp:
                    result.Add(new PushConst(AcpiObject.IntegerConstant.Zero));
                    break;

                case AmlParser.OneOp:
                    result.Add(new PushConst(AcpiObject.IntegerConstant.One));
                    break;

                case AmlParser.OnesOp:
                    result.Add(new PushConst(AcpiObject.IntegerConstant.Ones));
                    break;
                }
                break;

            case ComputationalData.TagValue.RevisionOp:
                result.Add(new PushConst(AcpiObject.IntegerConstant.Revision));
                break;

            case ComputationalData.TagValue.DefBuffer:
                AmlParser.DefBuffer defBuffer = computationalData.GetAsDefBuffer();
                defBuffer.Accept(this);
                break;

            default:
                Debug.Assert(false, "Unhandled alternative in switch over 'ComputationalData'");
                break;
            }
        }