Lines Matching defs:Generator
80 Init(g *Generator)
343 GenerateAlias(g *Generator, filename string, pkg GoPackageName)
402 type Generator struct { struct
403 *bytes.Buffer
405 Request *plugin.CodeGeneratorRequest // The input.
406 Response *plugin.CodeGeneratorResponse // The output.
408 Param map[string]string // Command-line parameters.
409 PackageImportPath string // Go import path of the package we're generating code for
410 ImportPrefix string // String to prefix to imported package file names.
411 ImportMap map[string]string // Mapping from .proto file name to import path
413 Pkg map[string]string // The names under which we import support packages
415 outputImportPath GoImportPath // Package we're generating code for.
416 allFiles []*FileDescriptor // All files in the tree
417 allFilesByName map[string]*FileDescriptor // All files by filename.
418 genFiles []*FileDescriptor // Those files we will generate output for.
419 file *FileDescriptor // The file we are compiling now.
420 packageNames map[GoImportPath]GoPackageName // Imported package names in the current file.
421 usedPackages map[GoImportPath]bool // Packages used in current file.
422 usedPackageNames map[GoPackageName]bool // Package names used in the current file.
423 addedImports map[GoImportPath]bool // Additional imports to emit.
424 typeNameToObject map[string]Object // Key is a fully-qualified name in input syntax.
425 init []string // Lines to emit in the init function.
426 indent string
427 pathType pathType // How to generate output filenames.
428 writeOutput bool
429 annotateCode bool // whether to store annotations
430 annotations []*descriptor.GeneratedCodeInfo_Annotation // annotations to store
450 func (g *Generator) Error(err error, msgs ...string) {
457 func (g *Generator) Fail(msgs ...string) {
466 func (g *Generator) CommandLineParameters(parameter string) {
524 func (g *Generator) DefaultPackageName(obj Object) string {
533 func (g *Generator) GoPackageName(importPath GoImportPath) GoPackageName {
548 func (g *Generator) AddImport(importPath GoImportPath) GoPackageName {
655 func (g *Generator) defaultGoPackage() GoPackageName {
666 func (g *Generator) SetPackageNames() {
723 func (g *Generator) WrapTypes() {
784 func (g *Generator) buildNestedDescriptors(descs []*Descriptor) {
799 func (g *Generator) buildNestedEnums(descs []*Descriptor, enums []*EnumDescriptor) {
912 func wrapImported(file *FileDescriptor, g *Generator) (sl []*ImportedDescriptor) {
948 func (g *Generator) BuildTypeNameMap() {
971 func (g *Generator) ObjectNamed(typeName string) Object {
993 func (g *Generator) printAtom(v interface{}) {
1026 func (g *Generator) P(str ...interface{}) {
1064 func (g *Generator) addInitf(stmt string, a ...interface{}) {
1069 func (g *Generator) In() { g.indent += "\t" }
1072 func (g *Generator) Out() {
1079 func (g *Generator) GenerateAllFiles() {
1116 func (g *Generator) runPlugins(file *FileDescriptor) {
1124 func (g *Generator) generate(file *FileDescriptor) {
1223 func (g *Generator) generateHeader() {
1245 func (g *Generator) PrintComments(path string) bool {
1257 func (g *Generator) makeComments(path string) (string, bool) {
1271 func (g *Generator) fileByName(filename string) *FileDescriptor {
1276 func (g *Generator) weak(i int32) bool {
1286 func (g *Generator) generateImports() {
1339 func (g *Generator) generateImported(id *ImportedDescriptor) {
1359 func (g *Generator) generateEnum(enum *EnumDescriptor) {
1465 …rator) goTag(message *Descriptor, field *descriptor.FieldDescriptorProto, wiretype string) string {
1596 func (g *Generator) TypeName(obj Object) string {
1601 …or) GoType(message *Descriptor, field *descriptor.FieldDescriptorProto) (typ string, wire string) {
1658 func (g *Generator) RecordTypeUse(t string) {
1709 …(g *Generator) getterDefault(field *descriptor.FieldDescriptorProto, goMessageType string) string {
1752 func (g *Generator) defaultConstantName(goMessageType, protoFieldName string) string {
1960 decl(g *Generator, mc *msgCtx) // print declaration within the struct
1961 getter(g *Generator, mc *msgCtx) // print getter
1962 setter(g *Generator, mc *msgCtx) // print setter if applicable
1976 func (g *Generator) generateDefaultConstants(mc *msgCtx, topLevelFields []topLevelField) {
2051 func (g *Generator) generateInternalStructFields(mc *msgCtx, topLevelFields []topLevelField) {
2066 func (g *Generator) generateOneofFuncs(mc *msgCtx, topLevelFields []topLevelField) {
2092 func (g *Generator) generateMessageStruct(mc *msgCtx, topLevelFields []topLevelField) {
2114 func (g *Generator) generateGetters(mc *msgCtx, topLevelFields []topLevelField) {
2121 func (g *Generator) generateSetters(mc *msgCtx, topLevelFields []topLevelField) {
2128 func (g *Generator) generateCommonMethods(mc *msgCtx) {
2195 func (g *Generator) generateMessage(message *Descriptor) {
2522 func (g *Generator) generateExtension(ext *ExtensionDescriptor) {
2581 func (g *Generator) generateInitFunction() {
2593 func (g *Generator) generateFileDescriptor(file *FileDescriptor) {
2632 func (g *Generator) generateEnumRegistration(enum *EnumDescriptor) {