void ExcpectFunctionCall(Token t) { if (t.type == Token.Type.IdSingle) { CallFunction(new Id(t.lexema)); exptFuCallFlag = false; } else if (t.type == Token.Type.IdHead) { pStack.Push(new Id(t.lexema)); } else if (t.type == Token.Type.IdTail) { Id before = (Id)pStack.Peek(); before.AddPath(t.lexema); } else if (t.type == Token.Type.IdEnd) { Id before = (Id)pStack.Pop(); before.AddPath(t.lexema); CallFunction(before); exptFuCallFlag = false; } else { throw new Exception("invalid function call"); } }
private void Process(Token t) { if (exptFuCallFlag) { ExcpectFunctionCall(t); } else if (opBlockFlag) { if (t.type == Token.Type.Operator && t.lexema == "}") { opBlockFlag = false; this.pStack.Push(newblock); } else { newblock.Append(t); } } else { switch (t.type) { case Token.Type.Indexer: pStack.Push(int.Parse(t.lexema)); CallFunction(new Id("~indexer")); break; case Token.Type.Operator: ProcessOperator(t.lexema); break; case Token.Type.FunctionCall: CallFunction(new Id(t.lexema)); break; case Token.Type.String: pStack.Push(t.lexema); break; case Token.Type.Double: pStack.Push(Double.Parse(t.lexema)); break; case Token.Type.Integer: pStack.Push(Double.Parse(t.lexema)); break; case Token.Type.IdHead: pStack.Push(new Id(t.lexema)); break; case Token.Type.IdSingle: pStack.Push(new Id(t.lexema)); break; case Token.Type.IdTail: Id before = (Id)pStack.Peek(); before.AddPath(t.lexema); break; case Token.Type.EOS: break; } } }