Skip to content

DescribeGrammar dot notation

Viktor Chernev edited this page Nov 11, 2024 · 12 revisions

The idea behind the "dot notation" scheme is to use namespaces to form complex dot "." separated ids. Instead of writing long ids though, we can use the namespace directive to set the namespace for the current file, and it will then be added as prefix to every id that starts with a dot. This is so because if we have a namespaced id, we need the ability to tell if it is a child namespace we are referring to and needs to be added to the current namespace - so we prefix it with a dot, like <.cars.rnode>, or if it is a full path of its own <cars.rnode> e.g.

Looking at the example 3 files below, we can observe that:

  • it is customary to name folders after namespaces,
  • it is customary that each folder contains one root source file, that is prefixed with dot ',' symbol,
  • root file contains one root element, which can be tagged with the id rnode, which stands for "root node"
  • namespace directive is used to add to id's:

Example (file-path: Public\.public.ds):
dot notation 1

file-path: Public\Culture\.culture.ds:
dot notation 3

file-path: Public\Science\.science.ds:
dot notation 2

Links

Next
Prev

Clone this wiki locally