Lines Matching defs:root
215 * @param root array the tree to transform
220 function constructQuery(&$root, &$typemap, $projection) {
233 $ordering = $this->extractGroups($root, 'sort');
236 $grouping = $this->extractGroups($root, 'group');
239 $considering = $this->extractGroups($root, 'consider');
242 $where = $this->extractGroups($root, 'where');
245 $tree =& $root;
248 if(count($root['cs'])) {
249 $this->_fail($this->getLang('error_query_outofwhere'), $root['cs']);
348 * @param root array the tree to transform
352 function transformGroup(&$root, &$typemap) {
354 $patterns = $this->extractText($root);
357 $unions = $this->extractGroups($root, 'union');
360 $minuses = $this->extractGroups($root,'minus');
363 $optionals = $this->extractGroups($root,'optional');
366 if(count($root['cs'])) {
367 $this->_fail(sprintf($this->getLang('error_query_group'),( isset($root['cs'][0]['tag']) ? sprintf($this->getLang('named_group'), utf8_tohtml(hsc($root['cs'][0]['tag']))) : $this->getLang('unnamed_group'))), $root['cs']);
381 $this->_fail(sprintf($this->getLang('error_query_grouppattern')), $root);
449 * @param root array the union group to transform
453 function transformUnion(&$root, &$typemap) {
455 $subs = $this->extractGroups($root,null);
458 if(count($root['cs'])) {
459 $this->_fail($this->getLang('error_query_unionblocks'), $root['cs']);
463 $this->_fail($this->getLang('error_query_unionreq'), $root);
784 $root = array(
792 $stack[] =& $root;
827 if(count($stack) != 1 || $stack[0] != $root) {
831 $root['end'] = $lineCount;
833 return $root;
881 * the given root.
883 * @param root array the tree to operate on
887 function extractGroups(&$root, $tag) {
890 foreach($root['cs'] as $i=>&$tree) {
900 array_splice($root['cs'],$i,1);
908 * of the root.
910 * @param root array the tree to operate on
913 function extractText(&$root) {
916 foreach($root['cs'] as $i=>&$tree) {
924 array_splice($root['cs'],$i,1);