Class: Parser
Defined in: | src/parser.coffee |
Overview
This parser is responsible for converting each file into the intermediate / AST representation as a JSON node.
Instance Method Summary
- ::constructor(options) Constructor Construct the parser
- ::convertComments(content) Converts the comments to block comments, so they appear in the node structure.
- Array ::getAllMethods() Get all the parsed methods.
- Array ::getAllVariables() Get all parsed variables.
- ::linkAncestors(node) Attach each parent to its children, so we are able to traverse the ancestor parse tree.
- ::parseContent(content, file = '') Parse the given CoffeeScript content.
- ::parseFile(file) Parse the given CoffeeScript file.
- ::showResult(generator) Show the final parsing statistics.
- Object ::toJSON() Get a JSON representation of the object.
Constructor Details
::constructor(options) Source
Construct the parser
Instance Method Details
::convertComments(content) Source
Converts the comments to block comments, so they appear in the node structure. Only block comments are considered by Biscotto.
Array ::getAllMethods() Source
Get all the parsed methods.
Array ::getAllVariables() Source
Get all parsed variables.
::linkAncestors(node) Source
Attach each parent to its children, so we are able to traverse the ancestor parse tree. Since the parent attribute is already used in the class node, the parent is stored as ancestor
.
::parseContent(content, file = '') Source
Parse the given CoffeeScript content.
::parseFile(file) Source
Parse the given CoffeeScript file.
::showResult(generator) Source
Show the final parsing statistics.
Object ::toJSON() Source
Get a JSON representation of the object.