summaryrefslogtreecommitdiffstats
path: root/src/parser.yy
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-09 19:45:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-09 19:45:27 +0000
commitf4f8ac034fa04404e2fcd5029ba050c537c07d7a (patch)
tree0daa81b0533ce203c33d5571dcb842257dba4cd0 /src/parser.yy
parent4488b6112c4e22493ed88c68035b980a5b42228d (diff)
downloadabakus-f4f8ac034fa04404e2fcd5029ba050c537c07d7a.tar.gz
abakus-f4f8ac034fa04404e2fcd5029ba050c537c07d7a.zip
TQt4 port Abakus
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/abakus@1231045 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/parser.yy')
-rw-r--r--src/parser.yy40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/parser.yy b/src/parser.yy
index b1540d7..4410843 100644
--- a/src/parser.yy
+++ b/src/parser.yy
@@ -100,7 +100,7 @@ S: error '=' {
// Can't assign to a function.
S: FUNC '=' {
- QString s(i18n("You can't assign to function %1").arg($1->name()));
+ TQString s(i18n("You can't assign to function %1").tqarg($1->name()));
Result::setLastResult(s);
YYABORT;
@@ -116,14 +116,14 @@ ASSIGN: '(' { --gCheckIdents; } IDENT ')' '=' {
// since normally functions and variables with the same name can coexist, but
// I don't want to duplicate code all over the place.
S: SET DERIV {
- QString s(i18n("Function %1 is built-in and cannot be overridden.").arg("deriv"));
+ TQString s(i18n("Function %1 is built-in and cannot be overridden.").tqarg("deriv"));
Result::setLastResult(s);
YYABORT;
}
S: DERIV '=' {
- QString s(i18n("Function %1 is built-in and cannot be overridden.").arg("deriv"));
+ TQString s(i18n("Function %1 is built-in and cannot be overridden.").tqarg("deriv"));
Result::setLastResult(s);
YYABORT;
@@ -134,12 +134,12 @@ S: SET FUNC ASSIGN EXP {
// We're trying to reassign an already defined function, make sure it's
// not a built-in.
- QString funcName = $2->name();
- QString ident = $3->name();
+ TQString funcName = $2->name();
+ TQString ident = $3->name();
FunctionManager *manager = FunctionManager::instance();
if(manager->isFunction(funcName) && !manager->isFunctionUserDefined(funcName)) {
- QString s(i18n("Function %1 is built-in and cannot be overridden.").arg(funcName));
+ TQString s(i18n("Function %1 is built-in and cannot be overridden.").tqarg(funcName));
Result::setLastResult(s);
YYABORT;
@@ -150,7 +150,7 @@ S: SET FUNC ASSIGN EXP {
BaseFunction *newFn = new UserDefinedFunction(funcName, $4);
if(!manager->addFunction(newFn, ident)) {
- QString s(i18n("Unable to define function %1 because it is recursive.").arg(funcName));
+ TQString s(i18n("Unable to define function %1 because it is recursive.").tqarg(funcName));
Result::setLastResult(s);
YYABORT;
@@ -165,8 +165,8 @@ S: SET FUNC ASSIGN EXP {
S: SET IDENT ASSIGN EXP {
++gCheckIdents;
- QString funcName = $2->name();
- QString ident = $3->name();
+ TQString funcName = $2->name();
+ TQString ident = $3->name();
// No need to check if the function is already defined, because the
// lexer checked for us before returning the IDENT token.
@@ -188,14 +188,14 @@ S: REMOVE FUNC '(' ')' {
// Can't remove an ident using remove-func syntax.
S: REMOVE IDENT '(' ')' {
// This is an error
- Result::setLastResult(Result(i18n("Function %1 is not defined.").arg($2->name())));
+ Result::setLastResult(Result(i18n("Function %1 is not defined.").tqarg($2->name())));
YYABORT;
}
// This happens when the user tries to remove a function that's not defined.
S: REMOVE IDENT '(' IDENT ')' {
// This is an error
- Result::setLastResult(Result(i18n("Function %1 is not defined.").arg($2->name())));
+ Result::setLastResult(Result(i18n("Function %1 is not defined.").tqarg($2->name())));
YYABORT;
}
@@ -209,11 +209,11 @@ S: REMOVE IDENT {
YYACCEPT;
}
else {
- QString s;
+ TQString s;
if(manager->isValueSet($2->name()))
- s = i18n("Can't remove predefined variable %1.").arg($2->name());
+ s = i18n("Can't remove predefined variable %1.").tqarg($2->name());
else
- s = i18n("Can't remove undefined variable %1.").arg($2->name());
+ s = i18n("Can't remove undefined variable %1.").tqarg($2->name());
Result::setLastResult(s);
@@ -228,7 +228,7 @@ S: SET IDENT '=' EXP {
if($2->name() == "pi" && $4->value() == Abakus::number_t("3.0"))
Result::setLastResult(i18n("This isn't Indiana, you can't just change pi"));
else
- Result::setLastResult(i18n("%1 is a constant").arg($2->name()));
+ Result::setLastResult(i18n("%1 is a constant").tqarg($2->name()));
YYABORT;
}
@@ -247,7 +247,7 @@ S: IDENT '=' EXP {
if($1->name() == "pi" && $3->value() == Abakus::number_t("3.0"))
Result::setLastResult(i18n("This isn't Indiana, you can't just change pi"));
else
- Result::setLastResult(i18n("%1 is a constant").arg($1->name()));
+ Result::setLastResult(i18n("%1 is a constant").tqarg($1->name()));
YYABORT;
}
@@ -259,13 +259,13 @@ S: IDENT '=' EXP {
}
S: NUMBER '=' {
- Result::setLastResult(i18n("Can't assign to %1").arg($1->value().toString()));
+ Result::setLastResult(i18n("Can't assign to %1").tqarg($1->value().toString()));
YYABORT;
}
// Can't call this as a function.
TERM: IDENT '(' {
- Result::setLastResult(i18n("%1 isn't a function (or operator expected)").arg($1->name()));
+ Result::setLastResult(i18n("%1 isn't a function (or operator expected)").tqarg($1->name()));
YYABORT;
}
@@ -351,7 +351,7 @@ TERM: NUMBER '(' EXP ')' {
TERM: NUMBER IDENT {
if(gCheckIdents > 0 && !ValueManager::instance()->isValueSet($2->name())) {
- Result::setLastResult(i18n("Unknown variable %1").arg($2->name()));
+ Result::setLastResult(i18n("Unknown variable %1").tqarg($2->name()));
YYABORT;
}
@@ -362,7 +362,7 @@ VALUE: IDENT {
if(gCheckIdents <= 0 || ValueManager::instance()->isValueSet($1->name()))
$$ = $1;
else {
- Result::setLastResult(i18n("Unknown variable %1").arg($1->name()));
+ Result::setLastResult(i18n("Unknown variable %1").tqarg($1->name()));
YYABORT;
}
}