public void Visit(BaijiMethod method) { AppendDocStringLines(method.DocStringLines); sb.Append(" "); // identation VisitType(method.ReturnType); sb.Append(" ").Append(method.Name).Append("("); VisitType(method.ArgumentType); sb.Append(" ").Append(method.ArgumentName); sb.Append(") "); }
public MethodContext MethodFromTrip(BaijiMethod method) { if (!typeConverter.IsStructIdentifier(method.ReturnType)) { throw new ArgumentException( string.Format("Return type of method must be a struct type, method {0}, return type {1}.", method.Name, method.ReturnType.Name)); } if (!typeConverter.IsStructIdentifier(method.ArgumentType)) { throw new ArgumentException( string.Format("Argument type of method must be a struct type, method {0}, argument type {1}.", method.Name, method.ArgumentType.Name)); } return(new MethodContext(method.DocStringLines, method.Name, false, MangleCSharpMethodName(method.Name), typeConverter.ConvertToString(method.ReturnType), MangleCSharpArgumentName(method.ArgumentName), typeConverter.ConvertToString(method.ArgumentType))); }
public static IList <BaijiMethod> BuildMethods(ParseTreeNode methodNodes) { List <BaijiMethod> methods = new List <BaijiMethod>(); foreach (var methodNode in methodNodes.ChildNodes) { string[] docStringLines = null; var docStringNode = methodNode.ChildNodes[0]; if (docStringNode.ChildNodes.Count != 0) { docStringLines = ParseDocStringLines(docStringNode.ChildNodes[0].Token.Text); } IdentifierType returnType = new IdentifierType(methodNode.ChildNodes[1].Token.Text); string name = methodNode.ChildNodes[2].Token.Text; IdentifierType argumentType = new IdentifierType(methodNode.ChildNodes[3].Token.Text); string argumentName = methodNode.ChildNodes[4].Token.Text; var method = new BaijiMethod(docStringLines, name, returnType, argumentType, argumentName); methods.Add(method); } return(methods); }
public void Visit(BaijiMethod method) { throw new NotImplementedException(); }
public void Visit(BaijiMethod method) { throw new NotSupportedException(); }
protected void PrepareByMethod(BaijiMethod method) { TryEnqueue(method.ArgumentType.Name); TryEnqueue(method.ReturnType.Name); }