Lines Matching refs:token

123 //printf("next token (recycled): '%s'\n", fCurrentToken.string.String());
281 //printf("next token: '%s'\n", fCurrentToken.string.String());
381 Token token = fTokenizer->NextToken();
382 if (token.type != TOKEN_END_OF_LINE)
383 throw ParseException("parse error", token.position);
413 Token token = fTokenizer->NextToken();
414 if (token.type != TOKEN_END_OF_LINE)
415 throw ParseException("parse error", token.position);
430 Token token = fTokenizer->NextToken();
431 if (token.type != TOKEN_END_OF_LINE)
432 throw ParseException("parse error", token.position);
451 // Token token = fTokenizer->NextToken();
452 // switch (token.type) {
475 Token token = fTokenizer->NextToken();
476 switch (token.type) {
499 Token token = fTokenizer->NextToken();
500 switch (token.type) {
507 throw ParseException("division by zero", token.position);
514 throw ParseException("modulo by zero", token.position);
533 Token token = fTokenizer->NextToken();
534 if (token.type != TOKEN_POWER) {
546 Token token = fTokenizer->NextToken();
547 if (token.type == TOKEN_END_OF_LINE)
548 throw ParseException("unexpected end of expression", token.position);
550 switch (token.type) {
560 return _ParseFunction(token);
592 ExpressionParser::_ParseFunction(const Token& token)
594 if (strcmp("e", token.string.String()) == 0)
596 else if (strcasecmp("pi", token.string.String()) == 0
597 || ((unsigned char)token.string.String()[0] == 0xCF
598 && (unsigned char)token.string.String()[1] == 0x80)) {
608 if (strcasecmp("abs", token.string.String()) == 0) {
611 } else if (strcasecmp("acos", token.string.String()) == 0) {
617 throw ParseException("out of domain", token.position);
620 } else if (strcasecmp("asin", token.string.String()) == 0) {
626 throw ParseException("out of domain", token.position);
629 } else if (strcasecmp("atan", token.string.String()) == 0) {
635 } else if (strcasecmp("atan2", token.string.String()) == 0) {
644 } else if (strcasecmp("cbrt", token.string.String()) == 0) {
647 } else if (strcasecmp("ceil", token.string.String()) == 0) {
650 } else if (strcasecmp("cos", token.string.String()) == 0) {
656 } else if (strcasecmp("cosh", token.string.String()) == 0) {
660 } else if (strcasecmp("exp", token.string.String()) == 0) {
663 } else if (strcasecmp("floor", token.string.String()) == 0) {
666 } else if (strcasecmp("ln", token.string.String()) == 0) {
669 throw ParseException("out of domain", token.position);
672 } else if (strcasecmp("log", token.string.String()) == 0) {
675 throw ParseException("out of domain", token.position);
678 } else if (strcasecmp("pow", token.string.String()) == 0) {
681 } else if (strcasecmp("sin", token.string.String()) == 0) {
687 } else if (strcasecmp("sinh", token.string.String()) == 0) {
691 } else if (strcasecmp("sqrt", token.string.String()) == 0) {
694 throw ParseException("out of domain", token.position);
697 } else if (strcasecmp("tan", token.string.String()) == 0) {
704 throw ParseException("out of domain", token.position);
707 } else if (strcasecmp("tanh", token.string.String()) == 0) {
713 throw ParseException("unknown identifier", token.position);
720 Token token = fTokenizer->NextToken();
721 if (token.type == TOKEN_END_OF_LINE)
722 throw ParseException("unexpected end of expression", token.position);
724 if (token.type == TOKEN_CONSTANT)
725 return _ParseFactorial(token.value);
756 Token token = fTokenizer->NextToken();
757 if (token.type != type) {
759 temp << (char)type << "' got '" << token.string << "'";
760 throw ParseException(temp.String(), token.position);