UNPKG

coffee-fmt

Version:

a `gofmt` inspired Coffeescript formatter/beautifier.

42 lines (37 loc) 847 B
/** * Backend.js * * The framework class the represents the back end component. */ var EventEmitter = require('events').EventEmitter , _ = require('lodash') , process , sendMessage ; /** * Process the intermediate code and the symbol table generated by the * parser. To be implemented by a compiler or an interpreter subclass. * @param iCode the intermediate code * @param symTab the symbol table. * @throws Error if an error occurred. */ process = function (iCode, symTab) { }; /** * Send a message to listeners. * @param message the message to send to listeners. */ sendMessage = function (message) { this.emit('message', message); }; /** * Constructor. */ exports.Backend = function () { return _.extend({ symTab: null , iCode: null , process: process , sendMessage: sendMessage }, EventEmitter.prototype); };