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 Details

::constructor(options) Source

Public: Construct the parser options - An Object of options

Parameters:

  • (Object) optionsAn Object of options

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

Parameters:

  • (String) contentA String representing the CoffeeScript file content

Array ::getAllMethods() Source

Public: Get all the parsed methods. Returns an Array of Methods.

Returns:

Array ::getAllVariables() Source

Public: Get all parsed variables. Returns an Array of Variables.

Returns:

::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

Parameters:

  • (Base) nodesA Base representing the CoffeeScript nodes

::parseContent(content, file = '') Source

Public: Parse the given CoffeeScript content. content - A String representing the CoffeeScript file content file - A String representing the CoffeeScript file name

Parameters:

  • (String) contentA String representing the CoffeeScript file content
  • (String) fileA String representing the CoffeeScript file name

::parseFile(file) Source

Public: Parse the given CoffeeScript file. file - A String representing the the CoffeeScript filename

Parameters:

  • (String) fileA String representing the the CoffeeScript filename

::showResult(generator) Source

Public: Show the final parsing statistics.

Object ::toJSON() Source

Public: Get a JSON representation of the object. Returns the JSON Object.

Returns:

  • (Object) — Returns the JSON Object.