public string ValueOf(YType type) { string include; if (type == YType.Int) { include = _includeFinder.FindInclude("int32_t"); if (include != null) { _includes.Add(include); return("int32_t"); } return("int"); } else if (type == YType.Void) { return("void"); } else if (type is YRefType) { var name = ((YRefType)type).Name; include = _includeFinder.FindInclude("shared_ptr"); if (include != null) { _includes.Add(include); include = _includeFinder.FindInclude(name); if (include != null) { _includes.Add(include); return($"std::shared_ptr<{name}>"); } } throw new TException("Can't find include for referenced type"); } throw new TException("Unsupported type"); }
public YParameter(string name, YType type) { Name = name; Type = type; }
public YFuncSignature(string name, YType returnType, YParameter[] @params) { Name = name; ReturnType = returnType; Parameters = @params; }
public YMethod(string name, YType returnType, YParameter[] @params) { Signature = new YFuncSignature(name, returnType, @params); }
public YMethod(string name, YType type) : this(name, type, null) { }