docs: function addProperty(
  	topNode, scopePropPath, propPattern, clause, options, valuePropsTrees,
  	wcPatterns) {
  
  	// process the pattern parts
  	let expandChildren = false;
  	const propPatternParts = propPattern.split('.');
  	const numParts = propPatternParts.length;
  	let parentNode = topNode;
  	let patternPrefix = topNode.path, patternSuffix = '';
  	for (let i = 0; i < numParts; i++) {
  		const propName = propPatternParts[i];
  
  		// check if wildcard
  		if (propName === '*') {
  
  			// check if allowed
  			if (!wcPatterns)
  				throw new common.X2SyntaxError(
  					`Invalid property path "${propPattern}":` +
  						` wild cards are not allowed here.`);
  
  			// set up the expansion
  			expandChildren = true;
  			if (i < numParts - 1)
  				patternSuffix = '.' + propPatternParts.slice(i + 1).join('.');
  
  			// done looping through pattern parts
  			break;
  		}
  
  		// get the child node
  		let node = parentNode.getChild(propName);
  
  		// create new node if necessary
  		if (!node) {
  
  			// create new child node
  			node = parentNode.addChild(
  				propName, clause, scopePropPath, options, propPattern,
  				valuePropsTrees);
  
  		} else { // existing node
  
  			// include the existing node in the clause
  			node.addClause(clause);
  		}
  
  		// add part to the reconstructed pattern prefix
  		patternPrefix += propName + '.';
  
  		// advance down the tree
  		parentNode = node;
  	}
  
  	// expand selected object
  	if (!expandChildren && (parentNode.desc.scalarValueType === 'object')) {
  
  		// set up the expansion
  		if (wcPatterns)
  			expandChildren = true;
  		else if (!(options && options.allowLeafObjects)) // check if allowed
  			throw new common.X2SyntaxError(
  				`Invalid property path "${propPattern}":` +
  					` object properties are not allowed here.`);
  	}
  
  	// generate expanded patterns
  	if (expandChildren) {
  
  		// make sure there is a children container
  		if (!parentNode.childrenContainer)
  			throw new common.X2SyntaxError(
  				`Invalid property pattern "${propPattern}":` +
  					` property ${parentNode.desc.container.nestedPath}` +
  					`${parentNode.desc.name} of ` +
  					`${String(parentNode.desc.container.recordTypeName)}` +
  					` is not an object nor reference and cannot be used as an` +
  					` intermediate property in a path.`);
  
  		// generate patterns for all nested properties included by default
  		parentNode.childrenContainer.allPropertyNames.forEach(propName => {
  			const propDesc = parentNode.childrenContainer.getPropertyDesc(
  				propName);
  			if (propDesc.fetchByDefault)
  				wcPatterns.push(patternPrefix + propName + patternSuffix);
  		});
  	}
  
  	// return the leaf node
  	return parentNode;
  }