File: Exports.cs

package info (click to toggle)
lwip 2.2.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,008 kB
  • sloc: ansic: 109,524; cs: 6,714; sh: 115; makefile: 112; perl: 81
file content (56 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 * Created by SharpDevelop.
 * User: lextm
 * Date: 2008/6/7
 * Time: 17:34
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System.Collections.Generic;

namespace Lextm.SharpSnmpLib.Mib.Elements
{
    /// <summary>
    /// Description of Exports.
    /// </summary>
    public sealed class Exports: IElement
    {
        private IModule _module;
        private readonly IList<string> _types = new List<string>();

        public Exports(IModule module, ISymbolEnumerator s)
        {
            _module = module;

            Symbol previous = null;
            Symbol current;
            do
            {
                current = s.NextSymbol();

                if (current == Symbol.EOL)
                {
                    continue;
                }
                else if (((current == Symbol.Comma) || (current == Symbol.Semicolon)) && (previous != null))
                {
                    previous.AssertIsValidIdentifier();
                    _types.Add(previous.ToString());
                }

                previous = current;
            }
            while (current != Symbol.Semicolon);
        }

        #region IElement Member

        public IModule Module
        {
            get { return _module; }
        }

        #endregion
    }
}