Skip to content

DescribeGrammar dot notation

Viktor Chernev edited this page May 24, 2023 · 12 revisions

The idea with 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 does not contain a dot or 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 see that it is customary to name folders after namespaces, and that each folder is customary to have one root source file, that is prefixed with at '@' symbol, and that root file contains one root element, which can be tagged with the id rnode, which stands for "root node".

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

Clone this wiki locally