Exemplo n.º 1
0
        private static MaxAccess ParseAccess(IEnumerator <Symbol> enumerator, ref Symbol temp)
        {
            MaxAccess access = MaxAccess.NotAccessible;

            if (temp == Symbol.MaxAccess || temp == Symbol.Access)
            {
                temp = enumerator.NextNonEOLSymbol();

                switch (temp.ToString())
                {
                case "not-accessible":
                    access = MaxAccess.NotAccessible;
                    break;

                case "accessible-for-notify":
                    access = MaxAccess.AccessibleForNotify;
                    break;

                case "read-only":
                    access = MaxAccess.ReadOnly;
                    break;

                case "read-write":
                    access = MaxAccess.ReadWrite;
                    break;

                case "read-create":
                    access = MaxAccess.ReadCreate;
                    break;

                case "write-only":
                    access = MaxAccess.ReadWrite;
                    break;

                default:
                    temp.Throw("Invalid access");
                    break;
                }
            }
            else
            {
                temp.Throw("missing access");
            }

            temp = enumerator.NextNonEOLSymbol();
            return(access);
        }
Exemplo n.º 2
0
        private void ParseProperties(SymbolList header)
        {
            ISymbolEnumerator headerSymbols = header.GetSymbolEnumerator();
            Symbol temp = headerSymbols.NextNonEOLSymbol();

            // Skip name
            temp = headerSymbols.NextNonEOLSymbol();
            temp.Expect(Symbol.ObjectType);

            _syntax         = ParseSyntax       (Module, headerSymbols);
            _units          = ParseUnits        (headerSymbols);
            _access         = ParseAccess       (headerSymbols);
            _status         = ParseStatus       (headerSymbols);
            _description    = ParseDescription  (headerSymbols);
            _reference      = ParseReference    (headerSymbols);
            _indices        = ParseIndices      (headerSymbols);
            _augments        = ParseAugments     (headerSymbols);
            _defVal         = ParseDefVal       (headerSymbols);
        }
        private void ParseProperties(SymbolList header)
        {
            ISymbolEnumerator headerSymbols = header.GetSymbolEnumerator();
            Symbol            temp          = headerSymbols.NextNonEOLSymbol();

            // Skip name
            temp = headerSymbols.NextNonEOLSymbol();
            temp.Expect(Symbol.ObjectType);

            _syntax      = ParseSyntax(Module, headerSymbols);
            _units       = ParseUnits(headerSymbols);
            _access      = ParseAccess(headerSymbols);
            _status      = ParseStatus(headerSymbols);
            _description = ParseDescription(headerSymbols);
            _reference   = ParseReference(headerSymbols);
            _indices     = ParseIndices(headerSymbols);
            _augments    = ParseAugments(headerSymbols);
            _defVal      = ParseDefVal(headerSymbols);
        }
        private static MaxAccess ParseAccess(ISymbolEnumerator symbols)
        {
            MaxAccess access = MaxAccess.notAccessible;

            Symbol current = symbols.NextNonEOLSymbol();

            current.Expect(Symbol.MaxAccess, Symbol.Access);

            current = symbols.NextNonEOLSymbol();
            switch (current.ToString())
            {
            case "not-accessible":
                access = MaxAccess.notAccessible;
                break;

            case "accessible-for-notify":
                access = MaxAccess.accessibleForNotify;
                break;

            case "read-only":
                access = MaxAccess.readOnly;
                break;

            case "read-write":
                access = MaxAccess.readWrite;
                break;

            case "read-create":
                access = MaxAccess.readCreate;
                break;

            case "write-only":
                access = MaxAccess.readWrite;
                break;

            default:
                current.Assert(false, "Invalid/Unknown access");
                break;
            }

            return(access);
        }
Exemplo n.º 5
0
        private void ParseProperties(IEnumerable <Symbol> header)
        {
            IEnumerator <Symbol> enumerator = header.GetEnumerator();
            Symbol temp = enumerator.NextNonEOLSymbol();

            // Skip name
            temp = enumerator.NextNonEOLSymbol();

            temp.Expect(Symbol.ObjectType);
            temp = enumerator.NextNonEOLSymbol();

            _syntax      = ParseSyntax(_module, _name, enumerator, ref temp);
            _units       = ParseUnits(enumerator, ref temp);
            _access      = ParseAccess(enumerator, ref temp);
            _status      = ParseStatus(enumerator, ref temp);
            _description = ParseDescription(enumerator, ref temp);
            _reference   = ParseReference(enumerator, ref temp);
            _indices     = ParseIndices(enumerator, ref temp);
            _augment     = ParseAugments(enumerator, ref temp);
            _defVal      = ParseDefVal(enumerator, ref temp);
        }
Exemplo n.º 6
0
        private void ParseProperties(IEnumerable<Symbol> header)
        {
            IEnumerator<Symbol> enumerator = header.GetEnumerator();
            Symbol temp = enumerator.NextNonEOLSymbol();

            // Skip name
            temp = enumerator.NextNonEOLSymbol();

            temp.Expect(Symbol.ObjectType);
            temp = enumerator.NextNonEOLSymbol();

            _syntax         = ParseSyntax       (_module, _name, enumerator, ref temp);
            _units          = ParseUnits        (enumerator, ref temp);
            _access         = ParseAccess       (enumerator, ref temp);
            _status         = ParseStatus       (enumerator, ref temp);
            _description    = ParseDescription  (enumerator, ref temp);
            _reference      = ParseReference    (enumerator, ref temp);
            _indices        = ParseIndices      (enumerator, ref temp);
            _augment        = ParseAugments     (enumerator, ref temp);
            _defVal         = ParseDefVal       (enumerator, ref temp);
        }
Exemplo n.º 7
0
        //--------------------------------------------
        public CResultAErreur Serialize(C2iSerializer serializer)
        {
            int            nVersion = GetNumVersion();
            CResultAErreur result   = serializer.TraiteVersion(ref nVersion);

            serializer.TraiteString(ref _module);
            serializer.TraiteString(ref _parent);

            long nLong = (long)_value;

            serializer.TraiteLong(ref nLong);
            _value = (uint)nLong;

            serializer.TraiteString(ref _name);

            result = serializer.TraiteObject <ITypeAssignment>(ref _syntax);
            if (!result)
            {
                return(result);
            }

            serializer.TraiteString(ref _units);

            int nInt = (int)_access;

            serializer.TraiteInt(ref nInt);
            _access = (MaxAccess)nInt;

            nInt = (int)_status;
            serializer.TraiteInt(ref nInt);
            _status = (Status)nInt;

            serializer.TraiteString(ref _description);
            serializer.TraiteString(ref _reference);

            int nNb = _indices != null?_indices.Count:0;

            serializer.TraiteInt(ref nNb);
            switch (serializer.Mode)
            {
            case ModeSerialisation.Ecriture:
                if (_indices != null)
                {
                    foreach (string strVal in _indices)
                    {
                        string strTmp = strVal;
                        serializer.TraiteString(ref strTmp);
                    }
                }
                break;

            case ModeSerialisation.Lecture:
                _indices = new List <string>();
                for (int i = 0; i < nNb; i++)
                {
                    string strTmp = "";
                    serializer.TraiteString(ref strTmp);
                    _indices.Add(strTmp);
                }
                break;
            }
            serializer.TraiteString(ref _augment);
            result = serializer.TraiteObject <Symbol>(ref _defVal);
            if (!result)
            {
                return(result);
            }
            return(result);
        }