public static StructField ParseStructField(TokenIterator it) { StructField field = new StructField(); if (IntMatch.Match(it, ref field.Index)) { do { var typeEntity = ParseTypeEntity(it); if (typeEntity == null) { break; } field.Type = typeEntity; if (!VarNameMatch.Match(it, ref field.Name)) { break; } if (!SemicolonMatch.Match(it)) { break; } return(field); } while (false); ThrowError(it); } return(null); }
public static bool Check(this StructField field, string nameSpace) { if (field.Index.IntValue < 0) { Console.WriteLine(string.Format("{0} => Struct index must be equal or greater than 0", field.Index)); return(false); } return(field.Type.Check(nameSpace)); }