fixes #0002460: Use keyword 'explicit' for Quantity constructor

This commit is contained in:
wmayer
2016-11-05 23:21:42 +01:00
parent 96e1b3b16f
commit 9fe82bfbb9
13 changed files with 157 additions and 122 deletions

View File

@@ -37,26 +37,26 @@
| quantity quantity { QuantResult = $1 + $2; }
;
num: NUM { $$ = $1; }
| num '+' num { $$ = $1.getValue() + $3.getValue(); }
| num MINUSSIGN num { $$ = $1.getValue() - $3.getValue(); }
| num '*' num { $$ = $1.getValue() * $3.getValue(); }
| num '/' num { $$ = $1.getValue() / $3.getValue(); }
| MINUSSIGN num %prec NEG { $$ = -$2.getValue(); }
| num '^' num { $$ = pow ($1.getValue(), $3.getValue());}
| num '+' num { $$ = Quantity($1.getValue() + $3.getValue()); }
| num MINUSSIGN num { $$ = Quantity($1.getValue() - $3.getValue()); }
| num '*' num { $$ = Quantity($1.getValue() * $3.getValue()); }
| num '/' num { $$ = Quantity($1.getValue() / $3.getValue()); }
| MINUSSIGN num %prec NEG { $$ = Quantity(-$2.getValue()); }
| num '^' num { $$ = Quantity(pow ($1.getValue(), $3.getValue()));}
| '(' num ')' { $$ = $2; }
| ACOS '(' num ')' { $$ = acos($3.getValue()); }
| ASIN '(' num ')' { $$ = asin($3.getValue()); }
| ATAN '(' num ')' { $$ = atan($3.getValue()); }
| ABS '(' num ')' { $$ = fabs($3.getValue()); }
| EXP '(' num ')' { $$ = exp($3.getValue()); }
| LOG '(' num ')' { $$ = log($3.getValue()); }
| LOG10 '(' num ')' { $$ = log10($3.getValue()); }
| SIN '(' num ')' { $$ = sin($3.getValue()); }
| SINH '(' num ')' { $$ = sinh($3.getValue()); }
| TAN '(' num ')' { $$ = tan($3.getValue()); }
| TANH '(' num ')' { $$ = tanh($3.getValue()); }
| SQRT '(' num ')' { $$ = sqrt($3.getValue()); }
| COS '(' num ')' { $$ = cos($3.getValue()); }
| ACOS '(' num ')' { $$ = Quantity(acos($3.getValue())); }
| ASIN '(' num ')' { $$ = Quantity(asin($3.getValue())); }
| ATAN '(' num ')' { $$ = Quantity(atan($3.getValue())); }
| ABS '(' num ')' { $$ = Quantity(fabs($3.getValue())); }
| EXP '(' num ')' { $$ = Quantity(exp($3.getValue())); }
| LOG '(' num ')' { $$ = Quantity(log($3.getValue())); }
| LOG10 '(' num ')' { $$ = Quantity(log10($3.getValue())); }
| SIN '(' num ')' { $$ = Quantity(sin($3.getValue())); }
| SINH '(' num ')' { $$ = Quantity(sinh($3.getValue())); }
| TAN '(' num ')' { $$ = Quantity(tan($3.getValue())); }
| TANH '(' num ')' { $$ = Quantity(tanh($3.getValue())); }
| SQRT '(' num ')' { $$ = Quantity(sqrt($3.getValue())); }
| COS '(' num ')' { $$ = Quantity(cos($3.getValue())); }
;
unit: UNIT { $$ = $1; }