Exemple #1
0
        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);
        }
Exemple #2
0
 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));
 }