All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.prompto.grammar.SymbolList.js Maven / Gradle / Ivy

var ObjectList = require("../utils/ObjectList").ObjectList;
var MissingType = require("../type/MissingType").MissingType;

function SymbolList(symbol) {
    ObjectList.call(this, MissingType.instance);
	if(symbol)
        this.add(symbol);
	return this;
}

SymbolList.prototype = Object.create(ObjectList.prototype);
SymbolList.prototype.constructor = SymbolList;

SymbolList.prototype.getIterator = function(context) {
    return new SymbolListIterator(this, context);
};


SymbolList.prototype.toString = function() {
    var names = this.map(function(s) { return s.name;});
    return "[" + names.join(", ") + "]";
};

function SymbolListIterator(symbols, context) {
    this.symbols = symbols;
    this.context = context;
    this.idx = 0;
    return this;
};

SymbolListIterator.prototype.hasNext = function() {
    return this.idx




© 2015 - 2025 Weber Informatics LLC | Privacy Policy