public BuiltInType() { BuildInTypeType = BuiltInTypeType.Int; isUnsigned = false; IndirectionLevels = 0; this.Size = 4; }
private void InitializeType(ref List <Token> .Enumerator tokens) { if (tokens.Current.Text == "unsigned") { isUnsigned = true; tokens.MoveNext(); } else { isUnsigned = false; } switch (tokens.Current.Text) { case "char": BuildInTypeType = BuiltInTypeType.Char; this.Size = 1; break; case "int": BuildInTypeType = BuiltInTypeType.Int; this.Size = 4; break; case "void": BuildInTypeType = BuiltInTypeType.Void; this.Size = 0; break; default: throw new System.Exception("No type for this"); } IndirectionLevels = 0; while ((tokens.MoveNext()) && (tokens.Current.Text == "*")) { IndirectionLevels++; this.Size = 4; } }