|
|
@ -130,7 +130,7 @@ static struct _if_value |
|
|
|
* <xc> extended C-style comments |
|
|
|
* <xc> extended C-style comments |
|
|
|
* <xd> delimited identifiers (double-quoted identifiers) |
|
|
|
* <xd> delimited identifiers (double-quoted identifiers) |
|
|
|
* <xdc> double-quoted strings in C |
|
|
|
* <xdc> double-quoted strings in C |
|
|
|
* <xh> hexadecimal numeric string |
|
|
|
* <xh> hexadecimal byte string |
|
|
|
* <xn> national character quoted strings |
|
|
|
* <xn> national character quoted strings |
|
|
|
* <xq> standard quoted strings |
|
|
|
* <xq> standard quoted strings |
|
|
|
* <xqs> quote stop (detect continued strings) |
|
|
|
* <xqs> quote stop (detect continued strings) |
|
|
@ -223,7 +223,7 @@ quotecontinuefail {whitespace}*"-"? |
|
|
|
xbstart [bB]{quote} |
|
|
|
xbstart [bB]{quote} |
|
|
|
xbinside [^']* |
|
|
|
xbinside [^']* |
|
|
|
|
|
|
|
|
|
|
|
/* Hexadecimal number */ |
|
|
|
/* Hexadecimal byte string */ |
|
|
|
xhstart [xX]{quote} |
|
|
|
xhstart [xX]{quote} |
|
|
|
xhinside [^']* |
|
|
|
xhinside [^']* |
|
|
|
|
|
|
|
|
|
|
@ -305,7 +305,6 @@ xcstart \/\*{op_chars}* |
|
|
|
xcstop \*+\/ |
|
|
|
xcstop \*+\/ |
|
|
|
xcinside [^*/]+ |
|
|
|
xcinside [^*/]+ |
|
|
|
|
|
|
|
|
|
|
|
digit [0-9] |
|
|
|
|
|
|
|
ident_start [A-Za-z\200-\377_] |
|
|
|
ident_start [A-Za-z\200-\377_] |
|
|
|
ident_cont [A-Za-z\200-\377_0-9\$] |
|
|
|
ident_cont [A-Za-z\200-\377_0-9\$] |
|
|
|
|
|
|
|
|
|
|
@ -346,15 +345,18 @@ self [,()\[\].;\:\+\-\*\/\%\^\<\>\=] |
|
|
|
op_chars [\~\!\@\#\^\&\|\`\?\+\-\*\/\%\<\>\=] |
|
|
|
op_chars [\~\!\@\#\^\&\|\`\?\+\-\*\/\%\<\>\=] |
|
|
|
operator {op_chars}+ |
|
|
|
operator {op_chars}+ |
|
|
|
|
|
|
|
|
|
|
|
/* we no longer allow unary minus in numbers. |
|
|
|
/* |
|
|
|
* instead we pass it separately to parser. there it gets |
|
|
|
* Numbers |
|
|
|
* coerced via doNegate() -- Leon aug 20 1999 |
|
|
|
* |
|
|
|
|
|
|
|
* Unary minus is not part of a number here. Instead we pass it separately to |
|
|
|
|
|
|
|
* the parser, and there it gets coerced via doNegate(). |
|
|
|
* |
|
|
|
* |
|
|
|
* {decimalfail} is used because we would like "1..10" to lex as 1, dot_dot, 10. |
|
|
|
* {decimalfail} is used because we would like "1..10" to lex as 1, dot_dot, 10. |
|
|
|
* |
|
|
|
* |
|
|
|
* {realfail1} and {realfail2} are added to prevent the need for scanner |
|
|
|
* {realfail1} and {realfail2} are added to prevent the need for scanner |
|
|
|
* backup when the {real} rule fails to match completely. |
|
|
|
* backup when the {real} rule fails to match completely. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
digit [0-9] |
|
|
|
|
|
|
|
|
|
|
|
integer {digit}+ |
|
|
|
integer {digit}+ |
|
|
|
decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*)) |
|
|
|
decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*)) |
|
|
@ -603,7 +605,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+ |
|
|
|
return BCONST; |
|
|
|
return BCONST; |
|
|
|
case xh: |
|
|
|
case xh: |
|
|
|
if (literalbuf[strspn(literalbuf, "0123456789abcdefABCDEF")] != '\0') |
|
|
|
if (literalbuf[strspn(literalbuf, "0123456789abcdefABCDEF")] != '\0') |
|
|
|
mmerror(PARSE_ERROR, ET_ERROR, "invalid hex string literal"); |
|
|
|
mmerror(PARSE_ERROR, ET_ERROR, "invalid hexadecimal string literal"); |
|
|
|
base_yylval.str = psprintf("x'%s'", literalbuf); |
|
|
|
base_yylval.str = psprintf("x'%s'", literalbuf); |
|
|
|
return XCONST; |
|
|
|
return XCONST; |
|
|
|
case xq: |
|
|
|
case xq: |
|
|
|