* bit string literal
* extended C-style comments
* delimited identifiers (double-quoted identifiers)
- * hexadecimal numeric string
+ * hexadecimal byte string
* standard quoted strings
* quote stop (detect continued strings)
* extended quoted strings (support backslash escape sequences)
xbstart [bB]{quote}
xbinside [^']*
-/* Hexadecimal number */
+/* Hexadecimal byte string */
xhstart [xX]{quote}
xhinside [^']*
xcstop \*+\/
xcinside [^*/]+
-digit [0-9]
ident_start [A-Za-z\200-\377_]
ident_cont [A-Za-z\200-\377_0-9\$]
op_chars [\~\!\@\#\^\&\|\`\?\+\-\*\/\%\<\>\=]
operator {op_chars}+
-/* we no longer allow unary minus in numbers.
- * instead we pass it separately to parser. there it gets
- * coerced via doNegate() -- Leon aug 20 1999
+/*
+ * Numbers
+ *
+ * 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.
*
* {realfail1} and {realfail2} are added to prevent the need for scanner
* backup when the {real} rule fails to match completely.
*/
+digit [0-9]
integer {digit}+
decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*))
* bit string literal
* extended C-style comments
* delimited identifiers (double-quoted identifiers)
- * hexadecimal numeric string
+ * hexadecimal byte string
* standard quoted strings
* quote stop (detect continued strings)
* extended quoted strings (support backslash escape sequences)
xbstart [bB]{quote}
xbinside [^']*
-/* Hexadecimal number */
+/* Hexadecimal byte string */
xhstart [xX]{quote}
xhinside [^']*
xcstop \*+\/
xcinside [^*/]+
-digit [0-9]
ident_start [A-Za-z\200-\377_]
ident_cont [A-Za-z\200-\377_0-9\$]
op_chars [\~\!\@\#\^\&\|\`\?\+\-\*\/\%\<\>\=]
operator {op_chars}+
-/* we no longer allow unary minus in numbers.
- * instead we pass it separately to parser. there it gets
- * coerced via doNegate() -- Leon aug 20 1999
+/*
+ * Numbers
+ *
+ * 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.
*
* {realfail1} and {realfail2} are added to prevent the need for scanner
* backup when the {real} rule fails to match completely.
*/
+digit [0-9]
integer {digit}+
decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*))
* extended C-style comments
* delimited identifiers (double-quoted identifiers)
* double-quoted strings in C
- * hexadecimal numeric string
+ * hexadecimal byte string
* national character quoted strings
* standard quoted strings
* quote stop (detect continued strings)
xbstart [bB]{quote}
xbinside [^']*
-/* Hexadecimal number */
+/* Hexadecimal byte string */
xhstart [xX]{quote}
xhinside [^']*
xcstop \*+\/
xcinside [^*/]+
-digit [0-9]
ident_start [A-Za-z\200-\377_]
ident_cont [A-Za-z\200-\377_0-9\$]
op_chars [\~\!\@\#\^\&\|\`\?\+\-\*\/\%\<\>\=]
operator {op_chars}+
-/* we no longer allow unary minus in numbers.
- * instead we pass it separately to parser. there it gets
- * coerced via doNegate() -- Leon aug 20 1999
+/*
+ * Numbers
+ *
+ * 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.
*
* {realfail1} and {realfail2} are added to prevent the need for scanner
* backup when the {real} rule fails to match completely.
*/
+digit [0-9]
integer {digit}+
decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*))
return BCONST;
case xh:
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);
return XCONST;
case xq: