Kaydet (Commit) 3b269d6d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

API CHANGE: Remove support for individual constants from UNOIDL

...i.e., "const X = N;" declarations outside of constant groups.  This appears
to be unused in practice, and removing it will allow to simplify future code
related to UNO type information.

This removes the definition of "constant-decl", and the branch mentioning
"constant-decl" from the definition of "declaration" at
<http://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/AppendixD/UNOIDL_Syntax_Specification&oldid=137490>.

Change-Id: I218626f02ebd46ee438bf5453ca1510c9ed8e5f0
üst 147b7f0d
...@@ -361,7 +361,7 @@ bool includes(AstDeclaration const * type1, AstDeclaration const * type2) { ...@@ -361,7 +361,7 @@ bool includes(AstDeclaration const * type1, AstDeclaration const * type2) {
/* /*
* These are production names: * These are production names:
*/ */
%type <dclval> type_dcl const_dcl %type <dclval> type_dcl
%type <dclval> array_declarator %type <dclval> array_declarator
%type <dclval> exception_name %type <dclval> exception_name
%type <cdclval> array_type constructed_type_spec enum_type op_type_spec %type <cdclval> array_type constructed_type_spec enum_type op_type_spec
...@@ -448,14 +448,6 @@ publishable_definition: ...@@ -448,14 +448,6 @@ publishable_definition:
{ {
idlc()->setParseState(PS_NoState); idlc()->setParseState(PS_NoState);
} }
| const_dcl
{
idlc()->setParseState(PS_ConstantDeclSeen);
}
';'
{
idlc()->setParseState(PS_NoState);
}
| exception_dcl | exception_dcl
{ {
idlc()->setParseState(PS_ExceptionDeclSeen); idlc()->setParseState(PS_ExceptionDeclSeen);
...@@ -1288,13 +1280,6 @@ constants_exports : ...@@ -1288,13 +1280,6 @@ constants_exports :
; ;
constants_export : constants_export :
const_dcl
{
idlc()->setParseState(PS_ConstantDeclSeen);
}
';' {};
const_dcl :
IDL_CONST IDL_CONST
{ {
idlc()->setParseState(PS_ConstSeen); idlc()->setParseState(PS_ConstSeen);
...@@ -1331,7 +1316,10 @@ const_dcl : ...@@ -1331,7 +1316,10 @@ const_dcl :
} }
} }
delete $5; delete $5;
idlc()->setParseState(PS_ConstantDeclSeen);
} }
';' {};
; ;
constants_dcl : constants_dcl :
......
...@@ -31,7 +31,7 @@ constants C { ...@@ -31,7 +31,7 @@ constants C {
}; };
EXPECT SUCCESS "constant.tests 2": EXPECT FAILURE "constant.tests 2":
module m { module m {
const boolean C1 = FALSE; const boolean C1 = FALSE;
const byte C2 = 0; const byte C2 = 0;
...@@ -75,7 +75,7 @@ constants C {}; ...@@ -75,7 +75,7 @@ constants C {};
EXPECT SUCCESS "constant.tests 8": EXPECT SUCCESS "constant.tests 8":
module m { constants C {
const byte C1 = -128; const byte C1 = -128;
const byte C2 = -0200; const byte C2 = -0200;
const byte C3 = -0x80; const byte C3 = -0x80;
...@@ -119,168 +119,168 @@ module m { ...@@ -119,168 +119,168 @@ module m {
EXPECT FAILURE "constant.tests 9": EXPECT FAILURE "constant.tests 9":
module m { const byte C = -129; }; constants C { const byte C1 = -129; };
EXPECT FAILURE "constant.tests 10": EXPECT FAILURE "constant.tests 10":
module m { const byte C = -0201; }; constants C { const byte C1 = -0201; };
EXPECT FAILURE "constant.tests 11": EXPECT FAILURE "constant.tests 11":
module m { const byte C = -0x81; }; constants C { const byte C1 = -0x81; };
EXPECT FAILURE "constant.tests 12": EXPECT FAILURE "constant.tests 12":
module m { const byte C = 256; }; constants C { const byte C1 = 256; };
EXPECT FAILURE "constant.tests 13": EXPECT FAILURE "constant.tests 13":
module m { const byte C = 0400; }; constants C { const byte C1 = 0400; };
EXPECT FAILURE "constant.tests 14": EXPECT FAILURE "constant.tests 14":
module m { const byte C = 0x100; }; constants C { const byte C1 = 0x100; };
EXPECT FAILURE "constant.tests 15": EXPECT FAILURE "constant.tests 15":
module m { const short C = -32769; }; constants C { const short C1 = -32769; };
EXPECT FAILURE "constant.tests 16": EXPECT FAILURE "constant.tests 16":
module m { const short C = -0100001; }; constants C { const short C1 = -0100001; };
EXPECT FAILURE "constant.tests 17": EXPECT FAILURE "constant.tests 17":
module m { const short C = -0x8001; }; constants C { const short C1 = -0x8001; };
EXPECT FAILURE "constant.tests 18": EXPECT FAILURE "constant.tests 18":
module m { const short C = 32768; }; constants C { const short C1 = 32768; };
EXPECT FAILURE "constant.tests 19": EXPECT FAILURE "constant.tests 19":
module m { const short C = 0100000; }; constants C { const short C1 = 0100000; };
EXPECT FAILURE "constant.tests 20": EXPECT FAILURE "constant.tests 20":
module m { const short C = 0x8000; }; constants C { const short C1 = 0x8000; };
EXPECT FAILURE "constant.tests 21": EXPECT FAILURE "constant.tests 21":
module m { const unsigned short C = -1; }; constants C { const unsigned short C1 = -1; };
EXPECT FAILURE "constant.tests 22": EXPECT FAILURE "constant.tests 22":
module m { const unsigned short C = -01; }; constants C { const unsigned short C1 = -01; };
EXPECT FAILURE "constant.tests 23": EXPECT FAILURE "constant.tests 23":
module m { const unsigned short C = -0x1; }; constants C { const unsigned short C1 = -0x1; };
EXPECT FAILURE "constant.tests 24": EXPECT FAILURE "constant.tests 24":
module m { const unsigned short C = 65536; }; constants C { const unsigned short C1 = 65536; };
EXPECT FAILURE "constant.tests 25": EXPECT FAILURE "constant.tests 25":
module m { const unsigned short C = 0200000; }; constants C { const unsigned short C1 = 0200000; };
EXPECT FAILURE "constant.tests 26": EXPECT FAILURE "constant.tests 26":
module m { const unsigned short C = 0x10000; }; constants C { const unsigned short C1 = 0x10000; };
EXPECT FAILURE "constant.tests 27": EXPECT FAILURE "constant.tests 27":
module m { const long C = -2147483649; }; constants C { const long C1 = -2147483649; };
EXPECT FAILURE "constant.tests 28": EXPECT FAILURE "constant.tests 28":
module m { const long C = -020000000001; }; constants C { const long C1 = -020000000001; };
EXPECT FAILURE "constant.tests 29": EXPECT FAILURE "constant.tests 29":
module m { const long C = -0x80000001; }; constants C { const long C1 = -0x80000001; };
EXPECT FAILURE "constant.tests 30": EXPECT FAILURE "constant.tests 30":
module m { const long C = 2147483648; }; constants C { const long C1 = 2147483648; };
EXPECT FAILURE "constant.tests 31": EXPECT FAILURE "constant.tests 31":
module m { const long C = 020000000000; }; constants C { const long C1 = 020000000000; };
EXPECT FAILURE "constant.tests 32": EXPECT FAILURE "constant.tests 32":
module m { const long C = 0x80000000; }; constants C { const long C1 = 0x80000000; };
EXPECT FAILURE "constant.tests 33": EXPECT FAILURE "constant.tests 33":
module m { const unsigned long C = -1; }; constants C { const unsigned long C1 = -1; };
EXPECT FAILURE "constant.tests 34": EXPECT FAILURE "constant.tests 34":
module m { const unsigned long C = -01; }; constants C { const unsigned long C1 = -01; };
EXPECT FAILURE "constant.tests 35": EXPECT FAILURE "constant.tests 35":
module m { const unsigned long C = -0x1; }; constants C { const unsigned long C1 = -0x1; };
EXPECT FAILURE "constant.tests 36": EXPECT FAILURE "constant.tests 36":
module m { const unsigned long C = 4294967296; }; constants C { const unsigned long C1 = 4294967296; };
EXPECT FAILURE "constant.tests 37": EXPECT FAILURE "constant.tests 37":
module m { const unsigned long C = 040000000000; }; constants C { const unsigned long C1 = 040000000000; };
EXPECT FAILURE "constant.tests 38": EXPECT FAILURE "constant.tests 38":
module m { const unsigned long C = 0x100000000; }; constants C { const unsigned long C1 = 0x100000000; };
EXPECT FAILURE "constant.tests 39": EXPECT FAILURE "constant.tests 39":
module m { const hyper C = -9223372036854775809; }; constants C { const hyper C1 = -9223372036854775809; };
EXPECT FAILURE "constant.tests 40": EXPECT FAILURE "constant.tests 40":
module m { const hyper C = -01000000000000000000001; }; constants C { const hyper C1 = -01000000000000000000001; };
EXPECT FAILURE "constant.tests 41": EXPECT FAILURE "constant.tests 41":
module m { const hyper C = -0x8000000000000001; }; constants C { const hyper C1 = -0x8000000000000001; };
EXPECT FAILURE "constant.tests 42": EXPECT FAILURE "constant.tests 42":
module m { const hyper C = 9223372036854775808; }; constants C { const hyper C1 = 9223372036854775808; };
EXPECT FAILURE "constant.tests 43": EXPECT FAILURE "constant.tests 43":
module m { const hyper C = 01000000000000000000000; }; constants C { const hyper C1 = 01000000000000000000000; };
EXPECT FAILURE "constant.tests 44": EXPECT FAILURE "constant.tests 44":
module m { const hyper C = 0x8000000000000000; }; constants C { const hyper C1 = 0x8000000000000000; };
EXPECT FAILURE "constant.tests 45": EXPECT FAILURE "constant.tests 45":
module m { const unsigned hyper C = -1; }; constants C { const unsigned hyper C1 = -1; };
EXPECT FAILURE "constant.tests 46": EXPECT FAILURE "constant.tests 46":
module m { const unsigned hyper C = -01; }; constants C { const unsigned hyper C1 = -01; };
EXPECT FAILURE "constant.tests 47": EXPECT FAILURE "constant.tests 47":
module m { const unsigned hyper C = -0x1; }; constants C { const unsigned hyper C1 = -0x1; };
EXPECT FAILURE "constant.tests 48": EXPECT FAILURE "constant.tests 48":
module m { const unsigned hyper C = 18446744073709551616; }; constants C { const unsigned hyper C1 = 18446744073709551616; };
EXPECT FAILURE "constant.tests 49": EXPECT FAILURE "constant.tests 49":
module m { const unsigned hyper C = 02000000000000000000000; }; constants C { const unsigned hyper C1 = 02000000000000000000000; };
EXPECT FAILURE "constant.tests 50": EXPECT FAILURE "constant.tests 50":
module m { const unsigned hyper C = 0x10000000000000000; }; constants C { const unsigned hyper C1 = 0x10000000000000000; };
...@@ -23,7 +23,6 @@ published struct Struct2<T> { T member; }; ...@@ -23,7 +23,6 @@ published struct Struct2<T> { T member; };
published exception E1 {}; published exception E1 {};
published interface I1 {}; published interface I1 {};
published typedef long Typedef; published typedef long Typedef;
published const long Constant = 1;
published constants Constants { const long Constant = 1; }; published constants Constants { const long Constant = 1; };
published service Service1: I1 {}; published service Service1: I1 {};
published service Service2 { interface I1; }; published service Service2 { interface I1; };
...@@ -413,26 +412,6 @@ published typedef E T; ...@@ -413,26 +412,6 @@ published typedef E T;
published struct S { T m; }; published struct S { T m; };
EXPECT SUCCESS "published.tests 69":
const long C1 = 1;
const long C2 = C1 + 1;
EXPECT FAILURE "published.tests 70":
const long C1 = 1;
published const long C2 = C1 + 1;
EXPECT SUCCESS "published.tests 71":
published const long C1 = 1;
const long C2 = C1 + 1;
EXPECT SUCCESS "published.tests 72":
published const long C1 = 1;
published const long C2 = C1 + 1;
EXPECT SUCCESS "published.tests 73": EXPECT SUCCESS "published.tests 73":
constants Cs { constants Cs {
const long C1 = 1; const long C1 = 1;
...@@ -447,46 +426,6 @@ published constants Cs { ...@@ -447,46 +426,6 @@ published constants Cs {
}; };
EXPECT SUCCESS "published.tests 75":
constants Cs { const long C1 = 1; };
const long C2 = Cs::C1 + 1;
EXPECT FAILURE "published.tests 76":
constants Cs { const long C1 = 1; };
published const long C2 = Cs::C1 + 1;
EXPECT SUCCESS "published.tests 77":
published constants Cs { const long C1 = 1; };
const long C2 = Cs::C1 + 1;
EXPECT SUCCESS "published.tests 78":
published constants Cs { const long C1 = 1; };
published const long C2 = Cs::C1 + 1;
EXPECT SUCCESS "published.tests 79":
const long C1 = 1;
constants Cs { const long C2 = C1 + 1; };
EXPECT FAILURE "published.tests 80":
const long C1 = 1;
published constants Cs { const long C2 = C1 + 1; };
EXPECT SUCCESS "published.tests 81":
published const long C1 = 1;
constants Cs { const long C2 = C1 + 1; };
EXPECT SUCCESS "published.tests 82":
published const long C1 = 1;
published constants Cs { const long C2 = C1 + 1; };
EXPECT SUCCESS "published.tests 83": EXPECT SUCCESS "published.tests 83":
constants Cs1 { const long C1 = 1; }; constants Cs1 { const long C1 = 1; };
constants Cs2 { const long C2 = Cs1::C1 + 1; }; constants Cs2 { const long C2 = Cs1::C1 + 1; };
...@@ -509,22 +448,22 @@ published constants Cs2 { const long C2 = Cs1::C1 + 1; }; ...@@ -509,22 +448,22 @@ published constants Cs2 { const long C2 = Cs1::C1 + 1; };
EXPECT SUCCESS "published.tests 87": EXPECT SUCCESS "published.tests 87":
typedef long T; typedef long T;
const T C = 1; constants Cs { const T C = 1; };
EXPECT FAILURE "published.tests 88": EXPECT FAILURE "published.tests 88":
typedef long T; typedef long T;
published const T C = 1; published constants Cs { const T C = 1; };
EXPECT SUCCESS "published.tests 89": EXPECT SUCCESS "published.tests 89":
published typedef long T; published typedef long T;
const T C = 1; constants Cs { const T C = 1; };
EXPECT SUCCESS "published.tests 90": EXPECT SUCCESS "published.tests 90":
published typedef long T; published typedef long T;
published const T C = 1; published constants Cs { const T C = 1; };
EXPECT SUCCESS "published.tests 91": EXPECT SUCCESS "published.tests 91":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment