本文整理汇总了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();
}
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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--;
}
}
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}