Parser
MMO\doc\js ยท 1 symbol ยท generated 30 Sep 2026
Parser
Parser.php:35Extracts documentation from javascript sources, the way reflection extracts it from php.
- Namespace
MMO\doc\js
Index
| comments | ||
| count | ||
| filename | ||
| language | ||
| provides | ||
| source | ||
| symbols | ||
| tokens | ||
| accessorSignature($name, $getter, $setter, $modifiers) | ||
| comment($doc) | ||
| continuesExpression($i) | ||
| endsOpen($i) | ||
| examplesOf($comment) | ||
| fieldSignature($name, $value, $modifiers) | ||
| getProvides() | ||
| isArrowHeader($i) | ||
| isOpening($i) | ||
| lineCommentsDoc($texts, $first, $i, $line, $doc) | Turn a kept run of // lines into a doc-comment-shaped token, or give the pending one back when there is nothing worth keeping. | |
| looksLikeConstant($name) | ||
| matchBracket($i) | ||
| mergeAccessors($members) | Fold each get x()/set x() pair into the single property it really is, the way a reader thinks of it -- with the getter's own doc comment and @return {T} type (a setter's jsdoc is discardeโฆ | |
| methodSignature($name, $params, $modifiers) | ||
| newMember($kind, $name, $comment, $line, $modifiers, $owner) | ||
| newSymbol($kind, $name, $doc, $line) | ||
| paramTag($comment, $name) | ||
| parse($source, $filename) | ||
| parseAssignment($start, $name, $i, $doc) | Parse <name> = <value> once the left-hand side is known, and turn the right-hand side into the matching kind of symbol. | |
| parseClass($i, $name, $doc) | ||
| parseFile($filename) | ||
| parseFunction($i, $name, $doc, $async) | ||
| parseMembers($i, $end, $owner) | Parse a class body or an object literal into members. | |
| parseParam($from, $to, $comment) | ||
| parseParams($i, $end, $comment) | Split a parameter list into DocParam, merging in whatever the jsdoc @param tags say about each one. | |
| parseStatement($i, $doc) | Parse one top-level statement, registering whatever symbol it declares. | |
| readLineComments($i, $doc) | Collect a run of consecutive // lines as a doc comment, so constants documented that way are not lost. | |
| readPath($i) | Read a dotted path (MMO.core.Map) starting at $i. | |
| reference($name) | ||
| register($symbol) | Register a symbol, merging it into a same-named one already found (a class re-opened, a namespace extended). | |
| returnOf($comment) | ||
| skipArrowHeader($i) | ||
| skipSemicolon($i) | ||
| skipStatement($i) | ||
| split($name) | A symbol declared under an already-known namespace object becomes one of its members instead of a page of its own -- that is what makes MMO.core.strings.bytesize show up on the MMO.core.stringsโฆ | |
| statementEnd($i, $limit) | Find where a statement (or an object-literal entry) ends: the first ; or , at depth 0, the first token on a new line when nothing is left open (javascript's automatic semicolon insertion), or $โฆ | |
| stringAt($i) | ||
| StripBanner($text) static | Drop the section banners this codebase draws with comments, which would otherwise be read as the documentation of whatever follows them -- and, worse, turn into setext <h1>s once rendered as markโฆ | |
| tagsOf($comment) | Every doc tag that is not already rendered as a first-class part of the model, kept in source order so the page can show @see, @deprecated, @todo, @since, @author... | |
| tagType($tag) | ||
| text($from, $to) | ||
| throwsOf($comment) | ||
| type($text) | Build a DocType from a jsdoc type expression ({number|string}, {Array<MMO.core.Map>}). | |
| typeAt($i) | ||
| value($i) |
Properties8
comments
- Type
- array
count
- Type
- int
filename
- Type
- string
language
- Type
- string
provides
- Type
- array
source
- Type
- string
symbols
- Type
- array
tokens
- Type
- array
Methods45
accessorSignature($name, $getter, $setter, $modifiers)
Parser.php:438comment($doc)
Parser.php:564| $doc | null | array | |
| returns | DocComment | the parsed doc comment (empty when there is none), banner rules stripped. |
continuesExpression($i)
Parser.php:916endsOpen($i)
Parser.php:922examplesOf($comment)
Parser.php:652| $comment | DocComment | |
| returns | array | the @example blocks of a doc comment, as {code, language} entries. |
fieldSignature($name, $value, $modifiers)
Parser.php:809getProvides()
Parser.php:97| returns | array | the namespaces declared by the last parsed file. |
isArrowHeader($i)
Parser.php:874isOpening($i)
Parser.php:836lineCommentsDoc($texts, $first, $i, $line, $doc)
Parser.php:542Turn a kept run of // lines into a doc-comment-shaped token, or give the pending one back when there is nothing worth keeping.
looksLikeConstant($name)
Parser.php:794matchBracket($i)
Parser.php:844mergeAccessors($members)
Parser.php:392Fold each get x()/set x() pair into the single property it really is, the way a reader thinks of it -- with the getter's own doc comment and @return {T} type (a setter's jsdoc is discarded, matching what JHSCompiler's own documentation() extractor does), and marked readonly when no setter exists. Without this, every accessor pair would show up twice, under the same anchor.
methodSignature($name, $params, $modifiers)
Parser.php:799newMember($kind, $name, $comment, $line, $modifiers, $owner)
Parser.php:711newSymbol($kind, $name, $doc, $line)
Parser.php:670paramTag($comment, $name)
Parser.php:599| $comment | DocComment | |
| $name | string | |
| returns | null | DocTag | the @param tag documenting $name, matched with or without brackets. |
parse($source, $filename)
Parser.php:65parseAssignment($start, $name, $i, $doc)
Parser.php:156Parse <name> = <value> once the left-hand side is known, and turn the right-hand side into the matching kind of symbol.
parseClass($i, $name, $doc)
Parser.php:213parseFile($filename)
Parser.php:56parseFunction($i, $name, $doc, $async)
Parser.php:254parseMembers($i, $end, $owner)
Parser.php:299Parse a class body or an object literal into members.
parseParam($from, $to, $comment)
Parser.php:469| $from | int | |
| $to | int | |
| $comment | DocComment | |
| returns | DocParam | one parameter, from the tokens in [$from, $to]. |
parseParams($i, $end, $comment)
Parser.php:453Split a parameter list into DocParam, merging in whatever the jsdoc @param tags say about each one.
| $i | int | the index just past the opening ( |
| $end | int | the index of the matching ) |
| $comment | DocComment | |
| returns | array |
parseStatement($i, $doc)
Parser.php:110Parse one top-level statement, registering whatever symbol it declares.
readLineComments($i, $doc)
Parser.php:510Collect a run of consecutive // lines as a doc comment, so constants documented that way are not lost.
readPath($i)
Parser.php:933Read a dotted path (MMO.core.Map) starting at $i.
reference($name)
Parser.php:788register($symbol)
Parser.php:741Register a symbol, merging it into a same-named one already found (a class re-opened, a namespace extended).
returnOf($comment)
Parser.php:611| $comment | DocComment | |
| returns | null | array | the {type, description} the @return/@returns tag declares. |
skipArrowHeader($i)
Parser.php:866skipSemicolon($i)
Parser.php:947skipStatement($i)
Parser.php:952split($name)
Parser.php:764A symbol declared under an already-known namespace object becomes one of its members instead of a page of its own -- that is what makes MMO.core.strings.bytesize show up on the MMO.core.strings page.
statementEnd($i, $limit)
Parser.php:885Find where a statement (or an object-literal entry) ends: the first ; or , at depth 0, the first token on a new line when nothing is left open (javascript's automatic semicolon insertion), or $limit.
stringAt($i)
Parser.php:825StripBanner($text)
staticParser.php:579Drop the section banners this codebase draws with comments, which would otherwise be read as the documentation of whatever follows them -- and, worse, turn into setext <h1>s once rendered as markdown (a line of = right under a line of text *is* a heading).
| $text | string | the raw comment, delimiters included |
| returns | string | the comment body, without its delimiters or leading asterisks |
tagsOf($comment)
Parser.php:633Every doc tag that is not already rendered as a first-class part of the model, kept in source order so the page can show @see, @deprecated, @todo, @since, @author... without this parser having to know what each of them means.
| $comment | DocComment | |
| returns | array | string, text: string}> |
tagType($tag)
Parser.php:556text($from, $to)
Parser.php:831throwsOf($comment)
Parser.php:618| $comment | DocComment | |
| returns | array | the {type, description} of every @throws tag. |
type($text)
Parser.php:776Build a DocType from a jsdoc type expression ({number|string}, {Array<MMO.core.Map>}). Nothing is resolved here -- linking is the documentor's job, since only it knows which symbols exist across the whole package (JSDocumentor::link).