Get FOLLOW set for a single given symbol
@param int scalar symbol
@return array set of terminal symbols
10925
function follow_set( $s ){
		if( ! isset($this->follows[$s]) ){
			$type = $this->is_terminal($s) ? 'terminal' : 'non-terminal';
			trigger_error("No follow set for $type $s", E_USER_WARNING );
			return array();
		}
		return $this->follows[$s];
	}
860361
function getval()
		{
			// UNSTABLE
			reset($this->me);
			list($a,$b)=each($this->me);
			// contributed by I Sofer, 2001-03-24
			// add support for nested arrays to scalarval
			// i've created a new method here, so as to
			// preserve back compatibility

			if(is_array($b))
			{
				@reset($b);
				while(list($id,$cont) = @each($b))
				{
					$b[$id] = $cont->scalarval();
				}
			}

			// add support for structures directly encoding php objects
			if(is_object($b))
			{
				$t = get_object_vars($b);
				@reset($t);
				while(list($id,$cont) = @each($t))
				{
					$t[$id] = $cont->scalarval();
				}
				@reset($t);
				while(list($id,$cont) = @each($t))
				{
					@$b->$id = $cont;
				}
			}
			// end contrib
			return $b;
		}
44719
public function getFormatPattern()
    {
        static $kyr = self::KYR_CHARS;

        switch (true) {
            // X000XX77_OR_X000XX777
            case \preg_match("~^[{$kyr}]{1}\d{3}[{$kyr}]{2}\d{2,3}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_1;

            // X000XX
            case \preg_match("~^[{$kyr}]{1}\d{3}[{$kyr}]{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_2;

            // XX00077
            case \preg_match("~^[{$kyr}]{2}\d{3}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_3;

            // 0000XX77
            case \preg_match("~^\d{4}[{$kyr}]{2}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_4;

            // XX000077
            case \preg_match("~^[{$kyr}]{2}\d{4}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_5;

            // X000077
            case \preg_match("~^[{$kyr}]{1}\d{4}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_6;

            // 000X77
            case \preg_match("~^\d{3}[{$kyr}]{1}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_7;

            // 0000X77
            case \preg_match("~^\d{4}[{$kyr}]{1}\d{2}$~iu", $this->value) === 1:
                return self::FORMAT_PATTERN_8;
        }
    }
1218293
private static function getAnsiCon()
    {
        if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
            // extract [w, H] from "wxh (WxH)"
            // or [w, h] from "wxh"
            return [
                (int) $matches[1],
                isset($matches[4]) ? (int) $matches[4] : (int) $matches[2],
            ];
        }

        return [];
    }
208694
protected function getCallbackPatterns()
    {
        $holder = $this->keyBag;

        return [
            // Header lines in the request sent to the server (e.g., User-Agent, Referer)
            '/%\{([^\}]+)\}i/' => function (array $matches) use ($holder) {
                $index = $holder->add('request_headers', $matches[1]);
                $pattern = strcasecmp($matches[1], 'referer') == 0 ? '[^\"]*' : '.+';

                return "(?<request_headers__{$index}>{$pattern})";
            },
            // The contents of cookies in the request sent to the server
            '/%\{([^\}]+)\}C/' => function (array $matches) use ($holder) {
                $index = $holder->add('cookies', $matches[1]);

                return "(?<cookies__{$index}>.+)";
            },
            // The contents of the environment variable
            '/%\{([^\}]+)\}e/' => function (array $matches) use ($holder) {
                $index = $holder->add('env_vars', $matches[1]);

                return "(?<env_vars__{$index}>.+)";
            },
            // The contents of notes from another modules
            '/%\{([^\}]+)\}n/' => function (array $matches) use ($holder) {
                $index = $holder->add('mod_vars', $matches[1]);

                return "(?<mod_vars__{$index}>.+)";
            },
            // Header lines in the response sent from the server
            '/%\{([^\}]+)\}o/' => function (array $matches) use ($holder) {
                $index = $holder->add('response_headers', $matches[1]);

                return "(?<response_headers__{$index}>.+)";
            },
            // The process ID or thread ID of the child that serviced the request
            '/%\{(pid|tid|hextid)\}P/' => function (array $matches) {
                return '(?<' . $matches[1] . '>\S+)';
            },
            // The canonical port of the server serving the request, or the server's actual port,
            // or the client's actual port
            '/%\{(canonical|local|remote)\}p/' => function (array $matches) {
                return '(?<' . $matches[1] . '_port>\d+)';
            },
        ];
    }
263921
public function getIconBounds() 
    {
        // Round padding to nearest integer
        $padding = (int)($this->style->getPadding() * $this->size + 0.5);
        
        return new Rectangle(
            $padding, $padding,
            $this->size - $padding * 2,
            $this->size - $padding * 2);
    }
986054
public static ImmutableSet<Symbol> findReferencedIdentifiers(Tree tree) {
    ImmutableSet.Builder<Symbol> builder = ImmutableSet.builder();
    createFindIdentifiersScanner(builder, null).scan(tree, null);
    return builder.build();
  }
396909
public function getMacKey()
    {
        $key = $this->config['key'];

        $hexStrKey = substr($key, 0, 38);
        $hexFinal = "" . substr($key, 38, 2) . "00";

        $cca0 = ord($hexFinal);

        if ($cca0 > 70 && $cca0 < 97) {
            $hexStrKey .= chr($cca0 - 23) . substr($hexFinal, 1, 1);
        } else {
            if (substr($hexFinal, 1, 1) == "M") {
                $hexStrKey .= substr($hexFinal, 0, 1) . "0";
            } else {
                $hexStrKey .= substr($hexFinal, 0, 2);
            }
        }

        return pack("H*", $hexStrKey);
    }
26068
private function build_first_sets(){
		$firsts = array();
		do {
			$changes = 0;
			foreach( $this->rules as $rule ){
				list( $nt, $rhs ) = $rule;
				$s = reset( $rhs );
				// get any special rule processing for this non-terminal
				//$excludela = isset($this->excludela[$nt]) ? $this->excludela[$nt] : null;
				do {
					// add terminal to first set of $nt
					if( $this->is_terminal( $s ) ){
						if( ! isset($firsts[$nt][$s]) ){
							$firsts[$nt][$s] = $s;
							$changes++;
						}
						continue 2;
					}
					// else inherit from first set of this non-terminal
					if( ! isset($firsts[$s]) ){
						// throw new Exception( sprintf("FIRST(%s) not defined", $s) );
						$changes++;
						continue 2;
					}
					// collect all terminal symbols in this non-terminal's set
					// except the empty string which we do not inherit.
					$derives_e = isset( $firsts[$s][P_EPSILON] );
					foreach( $firsts[$s] as $t ){
						// Omit any lookahead symbols denied by special rule
						//if( $excludela && in_array( $t, $excludela,true ) ){
						//	// ignored
						//}
						//else 
						if( $t !== P_EPSILON && ! isset( $firsts[$nt][$t] ) ){
							$firsts[$nt][$t] = $t;
							$changes++;
						}
					}
					// we move to next in sequence if non-terminal can derive empty 
				}
				while( $derives_e && $s = next($rhs) );
			}
		}
		while( $changes > 0 );
		return $firsts;
	}
24266
function cloneNumberPatternSymbols() {
    $clone = array(
      self::POSITIVE => array(
        self::MAJOR => array(),
        self::MINOR => array(),
      ),
      self::NEGATIVE => array(
        self::MAJOR => array(),
        self::MINOR => array(),
      ),
    );
    foreach ($this->symbols as $sign => $sign_symbols) {
      foreach ($sign_symbols as $fragment => $fragment_symbols) {
        foreach ($fragment_symbols as $symbol) {
          $clone[$sign][$fragment][] = clone $symbol;
        }
      }
    }

    return $clone;
  }
1006773
public function findReferencesToSymbol($symbol)
    {
        if (!$this->collect_locations) {
            throw new \UnexpectedValueException('Should not be checking references');
        }

        if (strpos($symbol, '::$') !== false) {
            return $this->findReferencesToProperty($symbol);
        }

        if (strpos($symbol, '::') !== false) {
            return $this->findReferencesToMethod($symbol);
        }

        return $this->findReferencesToClassLike($symbol);
    }
427119
def bound_symbols(self):
        """"""
        if self._bound_symbols is None:
            res = set()
            self._bound_symbols = res.union(
                *[sym.free_symbols for sym in self._vals.keys()])
        return self._bound_symbols
1222937
public function isOne($symbols)
    {
        if ($this->type !== self::TYPE_SYMBOL) {
            return false;
        }

        if (!is_array($symbols)) {
            $symbols = func_get_args();
        }

        return in_array($this->value, $symbols);
    }
249074
public function getSymbols(): iterable
    {
        return new \CallbackFilterIterator(
            new \RecursiveIteratorIterator(
                new \RecursiveArrayIterator($this->symbols, \RecursiveArrayIterator::CHILD_ARRAYS_ONLY)
            ),
            function ($each): bool {
                return $each !== false;
            }
        );
    }
1172586
public static function charAsciiControlArray()
    {
        static $result = array();

        if (!$result) {
            for ($i = 0; $i < 32; ++$i) {
                $result[] = \chr($i);
            }
            $result[] = \chr(127);
        }

        return $result;
    }
449135
function(symbol){

            var self = this,
            firsts = [];

            if(_.isString(symbol)){
                if(_.indexOf(self.terminals,symbol) !== -1){
                    firsts.push(symbol);
                    return firsts;
                }
                if(self.nonterminals[symbol]){
                    return self.nonterminals[symbol].firsts;
                }
            }else if(_.isArray(symbol)){
                var rhs = symbol;

                for(var i=0; symbol=rhs[i]; i++){
                    firsts = _.union(firsts, self._first(symbol));
                    if(self.nonterminals[symbol] && !self.nonterminals[symbol].nullable || _.indexOf(self.terminals,symbol) !== -1){
                        return firsts;
                    }
                }
            }
            return firsts;
        }
122655
public function getGitHooksDir(): string
    {
        $gitPath = $this->getGitDir();
        $absoluteGitPath = $this->getAbsolutePath($gitPath);
        $gitRepoPath = $absoluteGitPath.'/.git';

        if (is_file($gitRepoPath)) {
            $fileContent = $this->fileSystem->readFromFileInfo(new SplFileInfo($gitRepoPath));
            if (preg_match('/gitdir:\s+(\S+)/', $fileContent, $matches)) {
                $relativePath = $this->getRelativePath($matches[1]);
                return $this->getRelativePath($gitPath.$relativePath.'/hooks/');
            }
        }

        return $gitPath.'.git/hooks/';
    }