Support all valid unit-addresses

The Devicetree Specification v0.4, section 2.2.1 "Node Names", says

> The unit-address component of the name is specific to the bus type on
> which the node sits. It consists of one or more ASCII characters from
> the set of characters in Table 2.1.

Table 2.1 allows for all a-z characters, ',', '.', '_', '+', and '-'.

In normal use the unit-address is just a hex number and the devicetree
spec technically requires this by saying

> The unit-address must match the first address specified in the reg
> property of the node.

However the devicetree compiler supports the full ASCII table, and there
are a significant number of devicetrees in the Linux kernel that use the
unit-address as a "name" field. For example see
https://elixir.bootlin.com/linux/v6.7.4/source/arch/arm/boot/dts/marvell/armada-xp-crs328-4c-20s-4s.dtsi#L91
3 files changed
tree: dc41371e817bd942bc55e96eaa92a8e76251c125
  1. .github/
  2. .vscode/
  3. bindings/
  4. queries/
  5. src/
  6. test/
  7. .editorconfig
  8. .eslintrc.json
  9. .gitattributes
  10. .gitignore
  11. .npmignore
  12. .prettierignore
  13. .prettierrc.json
  14. binding.gyp
  15. Cargo.toml
  16. CHANGELOG.md
  17. grammar.js
  18. LICENSE
  19. package-lock.json
  20. package.json
  21. README.md
README.md

tree-sitter-devicetree

A tree-sitter grammar for Devicetree with support for Zephyr's superset of Devicetree syntax.

Some parts of the grammar are adapted from tree-sitter-c.