当前位置: 首页>>代码示例>>C#>>正文


C# IEnumerator.NextNonEOLSymbol方法代码示例

本文整理汇总了C#中IEnumerator.NextNonEOLSymbol方法的典型用法代码示例。如果您正苦于以下问题:C# IEnumerator.NextNonEOLSymbol方法的具体用法?C# IEnumerator.NextNonEOLSymbol怎么用?C# IEnumerator.NextNonEOLSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEnumerator的用法示例。


在下文中一共展示了IEnumerator.NextNonEOLSymbol方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UnsignedType

        public UnsignedType(string module, string name, IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            _module = module;
            _name = name;

            temp = enumerator.NextNonEOLSymbol();
            if (temp == Symbol.OpenParentheses)
            {
                _ranges = DecodeRanges(enumerator);
                temp = enumerator.NextNonEOLSymbol();
            }
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:12,代码来源:UnsignedType.cs

示例2: IntegerType

 public IntegerType(string module, string name, IEnumerator<Symbol> enumerator, ref Symbol temp)
 {
     _name = name;
     temp = enumerator.NextNonEOLSymbol();
     if (temp == Symbol.OpenBracket)
     {
         _isEnumeration = true;
         _map = DecodeEnumerations(enumerator);
         temp = enumerator.NextNonEOLSymbol();
     }
     else if (temp == Symbol.OpenParentheses)
     {
         _isEnumeration = false;
         _ranges = DecodeRanges(enumerator);
         temp = enumerator.NextNonEOLSymbol();
     }
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:17,代码来源:IntegerType.cs

示例3: ParseAugments

        private static string ParseAugments(IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            string augment = null;
            if (temp == Symbol.Augments)
            {
                temp = enumerator.NextNonEOLSymbol();

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

                augment = temp.ToString();
                temp = enumerator.NextNonEOLSymbol();

                temp.Expect(Symbol.CloseBracket);
                temp = enumerator.NextNonEOLSymbol();
            }
            return augment;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:18,代码来源:ObjectType.cs

示例4: TypeAssignment

        public TypeAssignment(string module, string name, IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            _module = module;
            _name = name;
            Value = temp.ToString();

            temp = enumerator.NextNonEOLSymbol();

            if (temp == Symbol.OpenBracket)
            {
                DecodeEnumerations(enumerator);
                temp = enumerator.NextNonEOLSymbol();
            }
            else if (temp == Symbol.OpenParentheses)
            {
                DecodeRanges(enumerator);
                temp = enumerator.NextNonEOLSymbol();
            }
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:19,代码来源:TypeAssignment.cs

示例5: Sequence

 public Sequence(string module, string name, IEnumerator<Symbol> enumerator)
 {
     // parse between ( )
     Symbol temp = enumerator.NextNonEOLSymbol();
     int bracketSection = 0;
     temp.Expect(Symbol.OpenBracket);
     bracketSection++;
     while (bracketSection > 0)
     {
         temp = enumerator.NextNonEOLSymbol();
         if (temp == Symbol.OpenBracket)
         {
             bracketSection++;
         }
         else if (temp == Symbol.CloseBracket)
         {
             bracketSection--;
         }
     }
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:20,代码来源:Sequence.cs

示例6: OctetStringType

        public OctetStringType(string module, string name, IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            _module = module;
            _name = name;
            _size = new List<ValueRange>();

            temp = enumerator.NextSymbol();
            if (temp == Symbol.OpenParentheses)
            {
                _size = DecodeRanges(enumerator);
                temp = enumerator.NextNonEOLSymbol();
            }
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:13,代码来源:OctetStringType.cs

示例7: ParseDefVal

        private static Symbol ParseDefVal(IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            Symbol defVal = null;
            if (temp == Symbol.DefVal)
            {
                temp = enumerator.NextNonEOLSymbol();

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

                if (temp == Symbol.OpenBracket)
                {
                    var depth = 1;
                    // TODO: decode this.
                    while (depth > 0)
                    {
                        temp = enumerator.NextNonEOLSymbol();
                        if (temp == Symbol.OpenBracket)
                        {
                            depth++;
                        }
                        else if (temp == Symbol.CloseBracket)
                        {
                            depth--;
                        }

                    }
                }
                else
                {
                    defVal = temp;
                    temp = enumerator.NextNonEOLSymbol();
                }
            }
            return defVal;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:36,代码来源:ObjectType.cs

示例8: ParseUnits

        private static string ParseUnits(IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            string units = null;

            if (temp == Symbol.Units)
            {
                temp = enumerator.NextNonEOLSymbol();

                units = temp.ToString();
                temp = enumerator.NextNonEOLSymbol();
            }

            return units;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:14,代码来源:ObjectType.cs

示例9: ParseSyntax

        private static ITypeAssignment ParseSyntax(string module, string name, IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            ITypeAssignment syntax;

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

            if (temp == Symbol.Bits)
            {
                syntax = new BitsType(string.Empty, string.Empty, enumerator);
                temp = enumerator.NextNonEOLSymbol();
            }
            else if (temp == Symbol.Integer || temp == Symbol.Integer32)
            {
                syntax = new IntegerType(module, name, enumerator, ref temp);
            }
            else if (temp == Symbol.Octet)
            {
                temp = enumerator.NextNonEOLSymbol();

                temp.Expect(Symbol.String);
                syntax = new OctetStringType(string.Empty, string.Empty, enumerator, ref temp);
            }
            else if (temp == Symbol.Opaque)
            {
                syntax = new OctetStringType(string.Empty, string.Empty, enumerator, ref temp);
            }
            else if (temp == Symbol.IpAddress)
            {
                syntax = new IpAddressType(string.Empty, string.Empty, enumerator);
                temp = enumerator.NextNonEOLSymbol();
            }
            else if (temp == Symbol.Counter64)
            {
                syntax = new Counter64Type(string.Empty, string.Empty, enumerator);
                temp = enumerator.NextNonEOLSymbol();
            }
            else if (temp == Symbol.Unsigned32 || temp == Symbol.Counter32 || temp == Symbol.Gauge32 || temp == Symbol.TimeTicks)
            {
                syntax = new UnsignedType(string.Empty, string.Empty, enumerator, ref temp);
            }
            else if (temp == Symbol.Object)
            {
                temp = enumerator.NextNonEOLSymbol();

                temp.Expect(Symbol.Identifier);
                syntax = new ObjectIdentifierType(string.Empty, string.Empty, enumerator);
                temp = enumerator.NextNonEOLSymbol();
            }
            else if (temp == Symbol.Sequence)
            {
                temp = enumerator.NextNonEOLSymbol();

                if (temp == Symbol.Of)
                {
                    temp = enumerator.NextNonEOLSymbol();
                    syntax = new TypeAssignment(string.Empty, string.Empty, enumerator, ref temp);
                }
                else
                {
                    syntax = new Sequence(string.Empty, string.Empty, enumerator);
                    temp = enumerator.NextNonEOLSymbol();
                }
            }
            else
            {
                syntax = new TypeAssignment(string.Empty, string.Empty, enumerator, ref temp);
            }

            return syntax;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:71,代码来源:ObjectType.cs

示例10: ParseAccess

        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;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:41,代码来源:ObjectType.cs

示例11: ParseStatus

        private static Status ParseStatus(IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            Status status = Status.Obsolete;

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

            try
            {
                status = StatusHelper.CreateStatus(temp.ToString());
                temp = enumerator.NextNonEOLSymbol();
            }
            catch (ArgumentException)
            {
                temp.Throw("Invalid status");
            }
            return status;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:18,代码来源:ObjectType.cs

示例12: ParseDescription

        private static string ParseDescription(IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            string description = null;
            if (temp == Symbol.Description)
            {
                temp = enumerator.NextNonEOLSymbol();

                description = temp.ToString().Trim(new[] { '"' });
                temp = enumerator.NextNonEOLSymbol();
            }
            return description;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:12,代码来源:ObjectType.cs

示例13: ParseReference

        private static string ParseReference(IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            string reference = null;
            if (temp == Symbol.Reference)
            {
                temp = enumerator.NextNonEOLSymbol();

                reference = temp.ToString();
                temp = enumerator.NextNonEOLSymbol();
            }
            return reference;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:12,代码来源:ObjectType.cs

示例14: ParseIndices

        private static IList<string> ParseIndices(IEnumerator<Symbol> enumerator, ref Symbol temp)
        {
            IList<string> indices = null;
            if (temp == Symbol.Index)
            {
                temp = enumerator.NextNonEOLSymbol();

                indices = new List<string>();

                while (temp != Symbol.CloseBracket)
                {
                    if (temp != Symbol.Comma)
                    {
                        indices.Add(temp.ToString());
                    }
                    temp = enumerator.NextNonEOLSymbol();
                }

                temp = enumerator.NextNonEOLSymbol();
            }
            return indices;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:22,代码来源:ObjectType.cs


注:本文中的IEnumerator.NextNonEOLSymbol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。