class TokenList inherits System { token: IToken; next: TokenList; init(value: IToken, tail: Object) : TokenList {{ assert(not (isvoid value), "init", "value argument cannot be void!"); assert(isvoid token, "init", "List has already been initialised!"); token <- value; if isvoid tail then void else case tail of tl: TokenList => next <- tl; o: Object => assert(false, "init", "tail argument can be either a TokenList or void!"); esac fi; self; }}; push(value: IToken) : TokenList {{ assert(not (isvoid value), "push", "value argument cannot be void!"); if isvoid token then token <- value else if isvoid next then next <- (new TokenList).init(value, void) else next.push(value) fi fi; self; }}; out() : Object {{ if isvoid token then void else out_string("<") .out_string(token.name()) .out_string(">") fi; if isvoid next then void else { out_string(" "); next.out(); } fi; }}; };