Add support for DMS angles to Expressions
This commit is contained in:
committed by
Yorik van Havre
parent
60b9936a35
commit
1b854e029b
@@ -244,6 +244,10 @@ EXPO [eE][-+]?[0-9]+
|
||||
"deg" COUNTCHARS; yylval.quantity.scaler = Quantity::Degree; yylval.quantity.unitStr = yytext; return UNIT; // degree (internal standard angle)
|
||||
"rad" COUNTCHARS; yylval.quantity.scaler = Quantity::Radian; yylval.quantity.unitStr = yytext; return UNIT; // radian
|
||||
"gon" COUNTCHARS; yylval.quantity.scaler = Quantity::Gon; yylval.quantity.unitStr = yytext; return UNIT; // gon
|
||||
"M" COUNTCHARS; yylval.quantity.scaler = Quantity::AngMinute; yylval.quantity.unitStr = yytext; return UNIT; // angminute
|
||||
"\xE2\x80\xB2" COUNTCHARS; yylval.quantity.scaler = Quantity::AngMinute; yylval.quantity.unitStr = yytext; return UNIT; // angminute U+2032 ′ ′ ′
|
||||
"S" COUNTCHARS; yylval.quantity.scaler = Quantity::AngSecond; yylval.quantity.unitStr = yytext; return UNIT; // angsecond
|
||||
"\xE2\x80\xB3" COUNTCHARS; yylval.quantity.scaler = Quantity::AngSecond; yylval.quantity.unitStr = yytext; return UNIT; // angsecond U+2033 ″ ″ ″
|
||||
|
||||
{DIGIT}*"."{DIGIT}+{EXPO}? COUNTCHARS; yylval.fvalue = num_change(yytext,'.',','); return yylval.fvalue == 1 ? ONE : NUM;
|
||||
{DIGIT}*","{DIGIT}+{EXPO}? COUNTCHARS; yylval.fvalue = num_change(yytext,',','.'); return yylval.fvalue == 1 ? ONE : NUM;
|
||||
|
||||
2
src/App/ExpressionParser.sh
Executable file
2
src/App/ExpressionParser.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
flex -olex.ExpressionParser.c < ExpressionParser.l
|
||||
bison -oExpressionParser.tab.c ExpressionParser.y
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user