/// <summary> /// Initializes a new instance of class InvokeGroupItem /// </summary> /// <param name="identifier">the identifier of the thing being invoked</param> /// <param name="callParameters">the parameters</param> public InvokeGroupItem(GroupItem identifier, GroupItem callParameters) { var token = ((TokenGroupItem)identifier).Token; this.identifier = (IdentifierToken)token; this.callParameters = (ParentheticGroup)callParameters; }
/// <summary> /// Reads a group from the given stream of tokens /// </summary> /// <param name="enumerator"></param> /// <returns></returns> public static ParentheticGroup Read(IEnumerator <Token> enumerator) { var result = new ParentheticGroup(); result.ReadGroupUntil( enumerator, (Token token) => { var symbolToken = token as SymbolToken; return(symbolToken != null && symbolToken.Symbol == Symbol.RightParen); } ); return(result); }