Class Parser
Defined in: | src/parser.coffee |
Overview
Public: This parser is responsible for converting each file into the intermediate /
AST representation as a JSON node.
Instance Method Summary
- ::constructor(options) 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
Instance Method Details
::convertComments(content) Source
Public: Converts the comments to block comments, so they appear in the node structure.
Only block comments are considered by Biscotto.
content - A String representing the CoffeeScript file content
::linkAncestors(node) Source
Public: 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`.
nodes - A Base representing the CoffeeScript nodes
::parseContent(content, file = '') Source
::parseFile(file) Source
Public: Parse the given CoffeeScript file.
file - A String representing the the CoffeeScript filename
::showResult(generator) Source
Public: Show the final parsing statistics.