Class: Parser

Defined in: src/parser.coffee

Overview

This parser is responsible for converting each file into the intermediate /

Instance Method Summary

Constructor Details

.constructor(options)

Construct the parser

Parameters:

  • (Object) optionsAn {Object} of options

Instance Method Details

.convertComments(content)

Converts the comments to block comments, so they appear in the node structure.

Parameters:

  • (String) contentA {String} representing the CoffeeScript file content

.fileContents(file)

Array .getAllMethods()

Get all the parsed methods.

Returns:

  • (Array) — Returns an {Array} of {Method}s.

Array .getAllVariables()

Get all parsed variables.

Returns:

  • (Array) — Returns an {Array} of {Variable}s.

.linkAncestors(node)

Attach each parent to its children, so we are able

Parameters:

  • (Base) nodesA {Base} representing the CoffeeScript nodes

.parseContent(file = '', content)

Parse the given CoffeeScript content.

Parameters:

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

.parseFile(file, contents)

Parse the given CoffeeScript file.

Parameters:

  • (String) contentsA {String} representing the the CoffeeScript contents
  • (String) fileA {String} representing the the CoffeeScript filename

.showResult(generator)

Show the final parsing statistics.

Object .toJSON()

Get a JSON representation of the object.

Returns:

  • (Object) — Returns the JSON {Object}.