gogen

package
v0.4.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator implementation of generator.Generator for Go target

func NewGenerator

func NewGenerator(useString bool, goish *gotify.Gotify, externalTypes map[string]types.TypeRegistration) *Generator

NewGenerator constructor

func (*Generator) AddField

func (g *Generator) AddField(comment []string, name string, t antlr.Token, fieldType string) error

AddField ...

func (*Generator) AtEnd

func (g *Generator) AtEnd() error

AtEnd checks if the rest is empty

func (*Generator) CloseOptionalScope

func (g *Generator) CloseOptionalScope() error

CloseOptionalScope ...

func (*Generator) CloseSilentOptionalScope added in v0.1.1

func (g *Generator) CloseSilentOptionalScope() error

func (*Generator) ErrorToken

func (g *Generator) ErrorToken(token antlr.Token, format string, params ...interface{}) error

ErrorToken message

func (*Generator) Generate

func (g *Generator) Generate(pkgName string, dest io.Writer) error

Generate writes into io.Writer

func (*Generator) HeadChar

func (g *Generator) HeadChar(char string, ignore, pass bool) error

HeadChar checks if rest starts with the given char

func (*Generator) HeadString

func (g *Generator) HeadString(anchor string, ignore, pass bool) error

HeadString checks if the rest starts with the given string and passes it

func (*Generator) LookupChar

func (g *Generator) LookupChar(char string, lower, upper int, close, ignore, pass bool) error

LookupCharEx ...

func (*Generator) LookupFixedChar

func (g *Generator) LookupFixedChar(anchor string, offset int, ignore, pass bool) error

LookupFixedChar ...

func (*Generator) LookupFixedString

func (g *Generator) LookupFixedString(anchor string, offset int, ignore, pass bool) error

LookupFixedString ...

func (*Generator) LookupString

func (g *Generator) LookupString(anchor string, lower, upper int, close, ignore, pass bool) error

LookupString ...

func (*Generator) OpenOptionalScope

func (g *Generator) OpenOptionalScope(comment []string, name string, t antlr.Token) error

OpenOptionalScope ...

func (*Generator) OpenSilentOptionalScope added in v0.1.1

func (g *Generator) OpenSilentOptionalScope(comment []string, name string, t antlr.Token) error

func (*Generator) PassHeadCharacters

func (g *Generator) PassHeadCharacters(char string) error

func (*Generator) PassN

func (g *Generator) PassN(n int) error

PassN passes first N characters if they are there, otherwise signal a error

func (*Generator) PlatformType

func (g *Generator) PlatformType(t generator.PlatformType)

PlatformType holds an information what type of platform to generate code for:

  1. Little endiant
  2. Big endian
  3. Crossplatform

There's a difference for fast short (up to 8 bytes) prefix checks in strings.

func (*Generator) Push

func (g *Generator) Push() error

Push pushes data

func (*Generator) RegGravity

func (g *Generator) RegGravity(name string) error

RegGravity registers center of gravity

func (*Generator) RegImport added in v0.1.0

func (g *Generator) RegImport(importAs, path string) error

func (*Generator) Relax

func (g *Generator) Relax()

Relax ...

func (*Generator) RestLengthCheck

func (g *Generator) RestLengthCheck(operator string, length int) error

func (*Generator) Stress

func (g *Generator) Stress()

Stress mismatches should be treated as critical errors

func (*Generator) TakeBeforeChar

func (g *Generator) TakeBeforeChar(name, fieldType, char string, meta ast.FieldMeta, lower, upper int, close, expand, include bool) error

TakeBeforeChar ...

func (*Generator) TakeBeforeCharOnExactPosition added in v0.3.3

func (g *Generator) TakeBeforeCharOnExactPosition(name, fieldType, anchor string, meta ast.FieldMeta, off int, close, expand, include bool) error

TakeBeforeCharOnExactPosition ...

func (*Generator) TakeBeforeString

func (g *Generator) TakeBeforeString(name, fieldType, anchor string, meta ast.FieldMeta, lower, upper int, close, expand, include bool) error

TakeBeforeString ...

func (*Generator) TakeBeforeStringOnExactPosition added in v0.3.3

func (g *Generator) TakeBeforeStringOnExactPosition(name, fieldType, anchor string, meta ast.FieldMeta, off int, close, expand, include bool) error

TakeBeforeStringOnExactPosition ...

func (*Generator) TakeRest

func (g *Generator) TakeRest(name, fieldType string, meta ast.FieldMeta) error

TakeRest ...

func (*Generator) UseRule

func (g *Generator) UseRule(comment []string, t antlr.Token, name string) error

UseRule ...

type Name

type Name struct {
	// contains filtered or unexported fields
}

Name provides a link between token and string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL