|
|
@@ -160,6 +160,7 @@ dc_cleanup_parser() {
|
|
|
%type <str> optional_name
|
|
|
%type <u.s_uint> char_or_uint
|
|
|
%type <u.s_uint> small_unsigned_integer
|
|
|
+%type <u.s_uint> small_negative_integer
|
|
|
%type <u.int64> signed_integer
|
|
|
%type <u.uint64> unsigned_integer
|
|
|
%type <u.real> char_or_number
|
|
|
@@ -779,6 +780,13 @@ uint_range:
|
|
|
if (!uint_range.add_range($1, $3)) {
|
|
|
yyerror("Overlapping range");
|
|
|
}
|
|
|
+}
|
|
|
+ | char_or_uint small_negative_integer
|
|
|
+{
|
|
|
+ uint_range.clear();
|
|
|
+ if (!uint_range.add_range($1, $2)) {
|
|
|
+ yyerror("Overlapping range");
|
|
|
+ }
|
|
|
}
|
|
|
| uint_range ',' char_or_uint
|
|
|
{
|
|
|
@@ -791,6 +799,12 @@ uint_range:
|
|
|
if (!uint_range.add_range($3, $5)) {
|
|
|
yyerror("Overlapping range");
|
|
|
}
|
|
|
+}
|
|
|
+ | uint_range ',' char_or_uint small_negative_integer
|
|
|
+{
|
|
|
+ if (!uint_range.add_range($3, $4)) {
|
|
|
+ yyerror("Overlapping range");
|
|
|
+ }
|
|
|
}
|
|
|
;
|
|
|
|
|
|
@@ -856,6 +870,20 @@ small_unsigned_integer:
|
|
|
}
|
|
|
;
|
|
|
|
|
|
+small_negative_integer:
|
|
|
+ SIGNED_INTEGER
|
|
|
+{
|
|
|
+ $$ = (unsigned int)-$1;
|
|
|
+ if ($1 >= 0) {
|
|
|
+ yyerror("Syntax error.");
|
|
|
+
|
|
|
+ } else if ($$ != -$1) {
|
|
|
+ yyerror("Number out of range.");
|
|
|
+ $$ = 1;
|
|
|
+ }
|
|
|
+}
|
|
|
+ ;
|
|
|
+
|
|
|
signed_integer:
|
|
|
SIGNED_INTEGER
|
|
|
;
|