[cm_fidl_analyzer] Define tree walker and node visitor traits

Defines traits ComponentTreeWalker and ComponentNodeVisitor.
Given a ComponentTree whose nodes are ComponentNodes, an
implementation of ComponentNodeVisitor does some operation
or analysis at each node, and an implementation of
ComponentTreeWalker iterates over some subset of the tree
while supplying each node to a ComponentNodeVisitor.

These abstractions will be implemented by linters and analyzers
which operate on ComponentDecls and, possibly, relations
between ComponentDecls.

Also defines a concrete implementation of ComponentTreeWalker
which traverses a full ComponentTree in breadth-first order.

Bug: 65840, 65842

Change-Id: Id27a54587a64317b6f3e7b7902d34e14a20dd940
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/461476
Commit-Queue: Laura Peskin <pesk@google.com>
Reviewed-by: Benjamin Wright <benwright@google.com>
2 files changed
tree: f6661e4cf5f3b32f34bce50c55f5b0270c474eb0
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. garnet/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .git-blame-ignore-revs
  17. .gitattributes
  18. .gitignore
  19. .gn
  20. .style.yapf
  21. AUTHORS
  22. BUILD.gn
  23. CODE_OF_CONDUCT.md
  24. CONTRIBUTING.md
  25. LICENSE
  26. OWNERS
  27. PATENTS
  28. README.md
  29. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.