1 /* 2 * Created by SharpDevelop. 3 * User: lextm 4 * Date: 2008/5/21 5 * Time: 19:43 6 * 7 * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 */ 9 10 11 namespace Lextm.SharpSnmpLib.Mib.Elements.Types 12 { 13 /// <summary> 14 /// The SEQUENCE type represents a set of specified types. This is roughly analogous to a <code>struct</code> in C. 15 /// </summary> 16 public sealed class Sequence : BaseType 17 { 18 /// <summary> 19 /// Creates a <see cref="Sequence" /> instance. 20 /// </summary> 21 /// <param name="module">The module.</param> 22 /// <param name="name">The name.</param> 23 /// <param name="symbols">The enumerator.</param> Sequence(IModule module, string name, ISymbolEnumerator symbols)24 public Sequence(IModule module, string name, ISymbolEnumerator symbols) 25 : base(module, name) 26 { 27 // parse between ( ) 28 Symbol temp = symbols.NextNonEOLSymbol(); 29 int bracketSection = 0; 30 temp.Expect(Symbol.OpenBracket); 31 bracketSection++; 32 while (bracketSection > 0) 33 { 34 temp = symbols.NextNonEOLSymbol(); 35 if (temp == Symbol.OpenBracket) 36 { 37 bracketSection++; 38 } 39 else if (temp == Symbol.CloseBracket) 40 { 41 bracketSection--; 42 } 43 } 44 } 45 } 46 }