print out a subclass definition with this object's members embedded
@param string name of extended class
@param array optional doc block meta data, e.g. [ 'package' => 'parsing'  ]
@return void
356268
function class_export( $classname, array $commentData = array() ){
		echo 
		"/**\n * Auto-generated file containing class $classname";
		foreach( $commentData as $tag => $value ){
			echo "\n * @$tag $value";
		}
		echo 
		"\n */\n",
		"\n",
		"import('PLUG.parsing.Grammar');\n",
		"\n",
		"/**\n * Auto-generated Grammar subclass";
		// unset page level doc block tags we don't want against the class
		unset (
			$commentData['author'], $commentData['version']
		);
		foreach( $commentData as $tag => $value ){
			echo "\n * @$tag $value";
		}
		echo 
		"\n */\n",
		"class $classname extends Grammar {\n",
		"\n";
		
		// overload all non-null members
		// no way to auto-detect access level ??
		$protected = get_object_vars($this);
		unset( $protected['uindex'] );
		foreach( $protected as $var => $val ){
			if( is_null($val) ){
				continue;
			}
			echo 
			"/** @override \${$var} */\n",
			"protected \${$var} = ",var_export($val,1),";\n\n";
		}
		// end vars
		echo
		"}\n";
	}
1073320
public function actionIndex($name)
    {
        // First we will check to see if the class already exists. If it does, we don't want
        // to create the class and overwrite the user's code. So, we will bail out so the
        // code is untouched. Otherwise, we will continue generating this class' files.
        if ($this->alreadyExists($name)) {
            $this->stderr("Notification {$name} already exists!");
            return false;
        }

        // Make sure the directory exists
        $dir = CRAFT_BASE_PATH . '/notifications';
        if (! is_dir($dir)) {
            FileHelper::createDirectory($dir);
        }

        FileHelper::writeToFile($dir . "/{$name}.php", $this->buildClass($name));

        $this->stdout("Notification created successfully.");
    }
1181446
protected function _interClassName($name)
    {
        $definition = null;
        if (isset($this->_definitions[$name])) {
            $definition = $this->_definitions[$name];
        } elseif (strpos($name, '\\') !== false) {
            $definition = $name;
        } elseif ($pos = strrpos($name, '_')) {
            $maybe = substr($name, $pos + 1);
            if (isset($this->_definitions[$maybe])) {
                $definition = $this->_definitions[$maybe];
            }
        } elseif (preg_match('#^(.+)([A-Z].+?)$#', $name, $match)) {
            $maybe = lcfirst($match[2]);
            if (isset($this->_definitions[$maybe])) {
                $definition = $this->_definitions[$maybe];
            } else {
                $definition = $this->_getPatterned($name);
            }
        }

        if ($definition === null) {
            throw new InvalidValueException(['`:definition` definition is invalid: missing class field', 'definition' => $name]);
        }

        return is_string($definition) ? $definition : $definition['class'];
    }
59531
function class_export( $classname, array $commentData = array() ){
		echo 
		"/**\n * Auto-generated file containing class $classname";
		foreach( $commentData as $tag => $value ){
			echo "\n * @$tag $value";
		}
		echo 
		"\n */\n",
		"\n",
		"import('PLUG.parsing.LR.LRParseTable');\n",
		"\n",
		"/**\n * Auto-generated LRParseTable subclass";
		// unset page level doc block tags we don't want against the class
		unset (
			$commentData['author'], $commentData['version']
		);
		foreach( $commentData as $tag => $value ){
			echo "\n * @$tag $value";
		}
		echo 
		"\n */\n",
		"class $classname extends LRParseTable {\n",
		"\n",
		"/** @var array */\n",
		"protected \$table = ",var_export($this->table,1),";\n\n",
		"}\n";
	}
1160162
public static void print(String name, List<?> list) {
		JK.line();
		print(String.format("List (%s):", name));
		int index = 1;
		for (Object object : list) {
			JK.print(String.format("\t%d) %s", index++, object));
		}
		JK.line();
	}
1329458
public function format($name, array $data) {
        if (!isset($this->_compiled[$name])) {
            throw new RuntimeException("Cannot find template named '$name'.");
        }
        list($template, $placeholders) = $this->_compiled[$name];
        // If there is a {{attrs.xxxx}} block in $template, remove the xxxx attribute
        // from $data['attrs'] and add its content to $data['attrs.class'].
        if (isset($data['attrs'])) {
            foreach ($placeholders as $placeholder) {
                if (substr($placeholder, 0, 6) == 'attrs.'
                    && preg_match('#'.substr($placeholder, 6).'="([^"]*)"#',
                                  $data['attrs'], $matches) > 0) {
                    $data['attrs'] = preg_replace('#'.substr($placeholder, 6).'="[^"]*"#',
                                                  '', $data['attrs']);
                    $data[$placeholder] = trim($matches[1]);
                    if ($data[$placeholder]) {
                        $data[$placeholder] = ' '.$data[$placeholder];
                    }
                }
            }
            $data['attrs'] = trim($data['attrs']);
            if ($data['attrs']) {
                $data['attrs'] = ' '.$data['attrs'];
            }
        }
        return parent::format($name, $data);
    }
323960
public function name(string $name)
    {
        $this->name = $name;

        $this->eventDispatcher->emit(
            $this->packageName . '.' . $this->name . '.define', $this
        );
    }
1311118
public function handleMagicMethods($name, array $arguments)
    {
        $flag = false;
        $result = null;

        if (in_array($type = substr($name, 0, 3), ['set', 'get'])) {
            /*
             * We will first try to access the property written with
             * lowerCamelCase, which is the convention for many people. If this
             * property is not found, we try the real name of the property given
             * in the magic method.
             */
            $propertyLowerCase = lcfirst(substr($name, 3));
            $property = substr($name, 3);

            foreach ([$propertyLowerCase, $property] as $prop) {
                try {
                    $result = $this->handlePropertyMagicMethod($prop, $type, $arguments);
                    $flag = true;
                    break;
                } catch (PropertyNotAccessibleException $e) {
                    continue;
                }
            }
        }

        if (false === $flag) {
            throw new MethodNotFoundException(
                'The method "' . $name . '" does not exist in the class "' . get_class($this) . '".',
                1471043854
            );
        }

        return $result;
    }
948449
function indexWriter(&$doclet) {

        parent::MDWriter($doclet);

        $phpdoctor = & $this->_doclet->phpdoctor();
        $displayTree = $phpdoctor->getOption("tree");

        $rootDoc = & $this->_doclet->rootDoc();

        $classes = & $rootDoc->classes();
        if ($classes == NULL)
            $classes = array();

        $functions = & $rootDoc->functions();
        if ($functions == NULL)
            $functions = array();

        $globals = & $rootDoc->globals();
        if ($globals == NULL)
            $globals = array();

        $elements = array_merge($classes, $functions, $globals);
        uasort($elements, array($this, "compareElements"));

        ob_start();

        echo "#INDEX#";

        if(isset($this->_doclet->phpdoctor()->_options["github_sources_repository"])){
            echo "\n\n[View Source codes]({$this->getSourcesBaseURL()})";
        }
        
        if ($displayTree) {
            echo "\n\n[View class hierarchy]({$this->getDirBaseURL()}/overview-tree.md)";
        }
        
        echo "\n\n[View depreacted list]({$this->getDirBaseURL()}/deprecated-list.md)";

        echo "\n\n[View todo list]({$this->getDirBaseURL()}/todo-list.md)";

        echo "\n\n[View the list of all classes, functions and globals]({$this->getDirBaseURL()}/index-all.md)";

        $this->_output = ob_get_contents();
        ob_end_clean();

        $this->_write("README.md");

        ///------------------------------------------------------

        ob_start();

        $letter = 64;
        foreach ($elements as $name => $element) {
            $firstChar = strtoupper(substr($element->name(), 0, 1));
            if (is_object($element) && $firstChar != chr($letter)) {
                $letter = ord($firstChar);
                echo "<a href=\"#", strtolower(chr($letter)), "\">", chr($letter), "</a>\n";
            }
        }

        echo "- - -\n\n";

        $first = TRUE;
        foreach ($elements as $element) {
            if (is_object($element)) {
                if (strtoupper(substr($element->name(), 0, 1)) != chr($letter)) {
                    $letter = ord(strtoupper(substr($element->name(), 0, 1)));
                    if (!$first) {
                        echo "</dl>\n";
                    }
                    $first = FALSE;
                    echo "<h1 id=\"letter", chr($letter), "\">", chr($letter), "</h1>\n";
                    echo "<dl>\n";
                }
                $parent = & $element->containingClass();
                if ($parent && strtolower(get_class($parent)) != "rootdoc") {
                    $in = "class <a href=\"" . $this->_asURL($parent) . "\">" . $parent->qualifiedName() . "</a>";
                } else {
                    $package = & $element->containingPackage();
                    $in = "namespace <a href=\"" . $this->_asURL($package) . "/README.md\">" . $package->name() . "</a>";
                }
                switch (strtolower(get_class($element))) {
                    case "classdoc":
                        if ($element->isOrdinaryClass()) {
                            echo "<dt><a href=\"", $this->_asURL($element), "\">", $element->name(), "</a> - Class in ", $in, "</dt>\n";
                        } elseif ($element->isInterface()) {
                            echo "<dt><a href=\"", $this->_asURL($element), "\">", $element->name(), "</a> - Interface in ", $in, "</dt>\n";
                        } elseif ($element->isException()) {
                            echo "<dt><a href=\"", $this->_asURL($element), "\">", $element->name(), "</a> - Exception in ", $in, "</dt>\n";
                        }
                        break;
                    case 'methoddoc':
                        if ($element->isFunction()) {
                            echo '<dt><a href="', $this->_asURL($element), '">', $element->name(), '()</a> - Function in ', $in, "</dt>\n";
                        }
                        break;
                    case "fielddoc":
                        if ($element->isGlobal()) {
                            echo "<dt><a href=\"", $this->_asURL($element), "\">", $element->name(), "</a> - Global in ", $in, "</dt>\n";
                        }
                        break;
                }
                if ($textTag = & $element->tags("@text") && $firstSentenceTags = & $textTag->firstSentenceTags($this->_doclet)) {
                    echo "<dd>";
                    foreach ($firstSentenceTags as $firstSentenceTag) {
                        echo $firstSentenceTag->text($this->_doclet);
                    }
                    echo "</dd>\n";
                }
            }
        }
        echo "</dl>\n";

        $this->_output = ob_get_contents();
        ob_end_clean();

        $this->_write("index-all.md");
    }
538019
function(o, name) {
			gui.Object.each(o, function(key, value) {
				if (key !== "$superclass" && gui.Type.isConstructor(value)) {
					if (value.$classname === gui.Class.ANONYMOUS) {
						Object.defineProperty(value, '$classname', {
							value: name + "." + key,
							enumerable: true,
							writable: false
						});
						this._spacename(value, name + "." + key);
					}
				}
			}, this);
		}
311476
public function a_class( $name, $content, $extends = null, $implements = null )
	{
		return $this->add( $this->closure( "class ".$name.
			( $extends ? ' extends '.$extends : '' ).
			( $implements ? ' implements '.$implements : '' ), $content ) );
	}
1186120
public void listArray(PdfArray array)
    {
        out.println('[');
        for (Iterator i = array.listIterator(); i.hasNext(); ) {
            PdfObject item = (PdfObject)i.next();
            listAnyObject(item);
        }
        out.println(']');
    }
648635
public void printClass(Class<?> cl) throws IOException
  {
    if (! cl.isArray())
      print(cl.getName().replace('$', '.'));
    else {
      printClass(cl.getComponentType());
      print("[]");
    }
  }
1209543
public function end($name) {

        $out = \ob_get_clean();

        if (isset($this->blocks[$name])){
            $this->blocks[$name][] = $out;
        }
    }
962315
protected function processMethodParams(array $method, string $file, string $name)
    {
        if (!empty($method['docblock']['inheritdoc'])) {
            return;
        }

        foreach ($method['params'] as $param => $type) {
            if (is_array($type)) {
                $type = implode('|', $type);
            }

            if (!isset($method['docblock']['params'][$param])) {
                $this->warnings[] = [
                    'type' => 'param-missing',
                    'file' => $file,
                    'class' => $name,
                    'method' => $name,
                    'line' => $method['line'],
                    'param' => $param,
                ];

                return;
            }

            if (empty($type)) {
                return;
            }

            $paramType = $method['docblock']['params'][$param];
            if ($paramType !== $type) {
                if (!($type == 'array' && substr($paramType, -2) == '[]')) {
                    $this->warnings[] = [
                        'type' => 'param-mismatch',
                        'file' => $file,
                        'class' => $name,
                        'method' => $name,
                        'line' => $method['line'],
                        'param' => $param,
                        'param-type' => $type,
                        'doc-type' => $method['docblock']['params'][$param],
                    ];
                }
            }
        }
    }
141700
public static void print(byte[] array) {
		String[] name = new String[] { "+0", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+a", "+b", "+c", "+d", "+e", "+f" };
		for (int i = 0; i < 16; i++) {
			System.out.print(name[i] + " ");
		}
		System.out.println();
		for (int i = 0; i < array.length; i++) {

			if (i != 0 && i % 16 == 0) {
				System.out.println();
			}
			byte b = array[i];

			System.out.print(String.format("%02x", b).toUpperCase() + " ");

		}
		System.out.println();

	}
1023655
function (name, params) {
			var result = '<pre class="prettyprint">new ';

			if (name) {
				result += name + '(';
			}

			if (params) {
				params.forEach(function (element, index, array) {
					result += element.name;

					if (element.optional) {
						result += '?';
					}

					if (index < array.length - 1) {
						result += ', ';
					}
				});
			}

			if (name) {
				result += ')</pre>';
			}

			return result;
		}