You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.7 KiB

  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package analysis
  5. // This file defines types used by client-side JavaScript.
  6. type anchorJSON struct {
  7. Text string // HTML
  8. Href string // URL
  9. }
  10. type commOpJSON struct {
  11. Op anchorJSON
  12. Fn string
  13. }
  14. // JavaScript's onClickComm() expects a commJSON.
  15. type commJSON struct {
  16. Ops []commOpJSON
  17. }
  18. // Indicates one of these forms of fact about a type T:
  19. // T "is implemented by <ByKind> type <Other>" (ByKind != "", e.g. "array")
  20. // T "implements <Other>" (ByKind == "")
  21. type implFactJSON struct {
  22. ByKind string `json:",omitempty"`
  23. Other anchorJSON
  24. }
  25. // Implements facts are grouped by form, for ease of reading.
  26. type implGroupJSON struct {
  27. Descr string
  28. Facts []implFactJSON
  29. }
  30. // JavaScript's onClickIdent() expects a TypeInfoJSON.
  31. type TypeInfoJSON struct {
  32. Name string // type name
  33. Size, Align int64
  34. Methods []anchorJSON
  35. ImplGroups []implGroupJSON
  36. }
  37. // JavaScript's onClickCallees() expects a calleesJSON.
  38. type calleesJSON struct {
  39. Descr string
  40. Callees []anchorJSON // markup for called function
  41. }
  42. type callerJSON struct {
  43. Func string
  44. Sites []anchorJSON
  45. }
  46. // JavaScript's onClickCallers() expects a callersJSON.
  47. type callersJSON struct {
  48. Callee string
  49. Callers []callerJSON
  50. }
  51. // JavaScript's cgAddChild requires a global array of PCGNodeJSON
  52. // called CALLGRAPH, representing the intra-package call graph.
  53. // The first element is special and represents "all external callers".
  54. type PCGNodeJSON struct {
  55. Func anchorJSON
  56. Callees []int // indices within CALLGRAPH of nodes called by this one
  57. }