Documentation ¶
Index ¶
- func FirstLower(s string) string
- func FirstUpper(s string) string
- func IsNumber(k string) bool
- type GoTarget
- func (t *GoTarget) ExitArr(typeStr, valStr string) string
- func (t *GoTarget) ExitJson(typeStr, valStr string) string
- func (t *GoTarget) ExitObj(typeStr, valStr string, isEnd bool, bIsMap bool) string
- func (t *GoTarget) ExitPair(index int, keyStr, typeStr, valStr, valType string) (string, string)
- func (t *GoTarget) ExitValue(typeStr, valStr string) string
- func (t *GoTarget) PostExitObj(typeStr, valStr string) string
- func (t *GoTarget) PreExitObj(typeStr, valStr string) string
- type Listener
- func (l *Listener) EnterArr(ctx *parser.ArrContext)
- func (l *Listener) EnterEveryRule(ctx antlr.ParserRuleContext)
- func (l *Listener) EnterJson(ctx *parser.JsonContext)
- func (l *Listener) EnterObj(ctx *parser.ObjContext)
- func (l *Listener) EnterPair(ctx *parser.PairContext)
- func (l *Listener) EnterValue(ctx *parser.ValueContext)
- func (l *Listener) ExitArr(ctx *parser.ArrContext)
- func (l *Listener) ExitEveryRule(ctx antlr.ParserRuleContext)
- func (l *Listener) ExitJson(ctx *parser.JsonContext)
- func (l *Listener) ExitObj(ctx *parser.ObjContext)
- func (l *Listener) ExitPair(ctx *parser.PairContext)
- func (l *Listener) ExitValue(ctx *parser.ValueContext)
- func (l *Listener) PrintGocodeMap()
- func (l *Listener) VisitErrorNode(node antlr.ErrorNode)
- func (l *Listener) VisitTerminal(node antlr.TerminalNode)
- type Node
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GoTarget ¶
func (*GoTarget) PostExitObj ¶
func (*GoTarget) PreExitObj ¶
func (t*GoTarget)ExitObj is called when production obj is exited.
type Listener ¶
type Listener struct { *parser.BaseJSONListener JsonStr string Target Target SubStructs []string // contains filtered or unexported fields }
func NewJsonToGoListener ¶
func (*Listener) EnterArr ¶
func (l *Listener) EnterArr(ctx *parser.ArrContext)
EnterArr is called when production arr is entered.
func (*Listener) EnterEveryRule ¶
func (l *Listener) EnterEveryRule(ctx antlr.ParserRuleContext)
EnterEveryRule is called when any rule is entered.
func (*Listener) EnterJson ¶
func (l *Listener) EnterJson(ctx *parser.JsonContext)
EnterJson is called when production json is entered.
func (*Listener) EnterObj ¶
func (l *Listener) EnterObj(ctx *parser.ObjContext)
EnterObj is called when production obj is entered.
func (*Listener) EnterPair ¶
func (l *Listener) EnterPair(ctx *parser.PairContext)
EnterPair is called when production pair is entered.
func (*Listener) EnterValue ¶
func (l *Listener) EnterValue(ctx *parser.ValueContext)
EnterValue is called when production value is entered.
func (*Listener) ExitArr ¶
func (l *Listener) ExitArr(ctx *parser.ArrContext)
ExitArr is called when production arr is exited.
func (*Listener) ExitEveryRule ¶
func (l *Listener) ExitEveryRule(ctx antlr.ParserRuleContext)
ExitEveryRule is called when any rule is exited.
func (*Listener) ExitJson ¶
func (l *Listener) ExitJson(ctx *parser.JsonContext)
ExitJson is called when production json is exited.
func (*Listener) ExitObj ¶
func (l *Listener) ExitObj(ctx *parser.ObjContext)
ExitObj is called when production obj is exited.
func (*Listener) ExitPair ¶
func (l *Listener) ExitPair(ctx *parser.PairContext)
ExitPair is called when production pair is exited.
func (*Listener) ExitValue ¶
func (l *Listener) ExitValue(ctx *parser.ValueContext)
ExitValue is called when production value is exited.
func (*Listener) PrintGocodeMap ¶
func (l *Listener) PrintGocodeMap()
func (*Listener) VisitErrorNode ¶
func (l *Listener) VisitErrorNode(node antlr.ErrorNode)
VisitErrorNode is called when an error node is visited.
func (*Listener) VisitTerminal ¶
func (l *Listener) VisitTerminal(node antlr.TerminalNode)
VisitTerminal is called when a terminal node is visited.
type Target ¶
type Target interface { // ExitJson is called when production json is exited. ExitJson(typeStr, valStr string) string // ExitObj is called when production obj is exited. PreExitObj(typeStr, valStr string) string ExitObj(typeStr, valStr string, isEnd bool, bIsMap bool) string PostExitObj(typeStr, valStr string) string // ExitPair is called when production pair is exited. ExitPair(index int, ketStr, typeStr, valStr, valType string) (string, string) // ExitArr is called when production arr is exited. ExitArr(typeStr, valStr string) string // ExitValue is called when production value is exited. ExitValue(typeStr, valStr string) string }