Visualizing the Value Tree

To fully understand how name paths work, it helps to see a real configuration file and its corresponding value tree.

Here is a sample ELCL configuration:

[main]
user: "example"

[server]
threads: 4
startup delay: 20 s

*[server.connection]
port: 8080
interface: "web"

*[server.connection]
port: 9000
interface: "api"

[server.backend.filter]
reject: "bad"
accept: "good"

This configuration is transformed into the following value tree:

(root)                    <== Document ( size=2 ) 
├── [main]                  <== SectionWithNames ( size=1 ) 
└── user                    <== Text ( "example" ) 
└── [server]                <== SectionWithNames ( size=4 ) 
    ├── [backend]               <== IntermediateSection (  ) 
    └── [filter]                <== SectionWithNames ( size=2 ) 
        ├── accept                  <== Text ( "good" ) 
        └── reject                  <== Text ( "bad" ) 
    ├── *[connection]           <== SectionList ( size=2 ) 
    ├── [0]                     <== SectionWithNames ( size=2 ) 
    ├── interface               <== Text ( "web" ) 
    └── port                    <== Integer ( 8080 ) 
    └── [1]                     <== SectionWithNames ( size=2 ) 
        ├── interface               <== Text ( "api" ) 
        └── port                    <== Integer ( 9000 ) 
    ├── startup_delay           <== TimeDelta ( Not supported ) 
    └── threads                 <== Integer ( 4 ) 

From the example above:

  • The configuration defines two root sections named main and server.

  • Under server.connection there’s a section list.

  • The name path server.backend.filter introduces a subsection, which implicitly creates the intermediate section server.backend.

On the left-hand side of the tree, the hierarchical structure of the configuration is shown. On the right-hand side, the actual values appear, annotated with type information in the form Type(...). These type names are recommended for use by parser implementations.