From 518158f835e7ad29b70242476670117fbc4245bc Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 19 Dec 2023 15:13:26 +0100 Subject: [PATCH] Slice grammar improvements (#1590) This is a backport of the Slice grammar improvements made by @InsertCreativityHere in https://github.com/zeroc-ice/ice/commit/865ff422fb4c935726b859d79b73f2788e3add70#diff-3c507567a987cdf989038742a6964ad6d947511ef75ea5ab823136035205722dR67 --- config/Make.project.rules | 7 +- cpp/include/IceUtil/ScannerConfig.h | 8 +- cpp/src/Glacier2/Instrumentation.ice | 109 +- cpp/src/IceGrid/Internal.ice | 603 +- cpp/src/IceStorm/DBTypes.ice | 15 +- cpp/src/IceStorm/Election.ice | 469 +- cpp/src/IceStorm/IceStormInternal.ice | 86 +- cpp/src/IceStorm/Instrumentation.ice | 153 +- cpp/src/IceStorm/LLURecord.ice | 18 +- cpp/src/IceStorm/LinkRecord.ice | 23 +- cpp/src/IceStorm/SubscriberRecord.ice | 89 +- cpp/src/Slice/Grammar.cpp | 5334 +++++++++-------- cpp/src/Slice/Grammar.h | 183 +- cpp/src/Slice/Grammar.y | 547 +- cpp/src/Slice/GrammarUtil.h | 66 +- cpp/src/Slice/Parser.cpp | 95 +- cpp/src/Slice/Parser.h | 6 +- cpp/src/Slice/Scanner.cpp | 2243 ++++--- cpp/src/Slice/Scanner.l | 1000 +-- cpp/src/icegriddb/DBTypes.ice | 20 +- cpp/test/Slice/errorDetection/ConstDef.err | 2 +- .../Slice/errorDetection/OptionalMembers.err | 66 +- .../Slice/errorDetection/OptionalParams.err | 40 - .../Slice/errorDetection/TaggedMembers.err | 33 + ...{OptionalMembers.ice => TaggedMembers.ice} | 0 .../Slice/errorDetection/TaggedParams.err | 40 + .../{OptionalParams.ice => TaggedParams.ice} | 0 .../test/src/main/java/test/Ice/impl/Test.ice | 6 +- .../src/main/java/test/Ice/impl/TestAMD.ice | 6 +- .../main/java/test/Ice/operations/Test.ice | 6 +- .../main/java/test/Ice/operations/TestAMD.ice | 6 +- .../test/src/main/java/test/Ice/impl/Test.ice | 6 +- .../src/main/java/test/Ice/impl/TestAMD.ice | 6 +- .../main/java/test/Ice/operations/Test.ice | 6 +- .../main/java/test/Ice/operations/TestAMD.ice | 6 +- slice/Glacier2/Metrics.ice | 70 +- slice/Glacier2/PermissionsVerifier.ice | 117 +- slice/Glacier2/Router.ice | 178 +- slice/Glacier2/SSLInfo.ice | 42 +- slice/Glacier2/Session.ice | 358 +- slice/Ice/BuiltinSequences.ice | 42 +- slice/Ice/Communicator.ice | 743 +-- slice/Ice/Connection.ice | 451 +- slice/Ice/Current.ice | 139 +- slice/Ice/Endpoint.ice | 225 +- slice/Ice/EndpointF.ice | 6 +- slice/Ice/EndpointTypes.ice | 16 +- slice/Ice/FacetMap.ice | 6 +- slice/Ice/Identity.ice | 41 +- slice/Ice/ImplicitContext.ice | 109 +- slice/Ice/Instrumentation.ice | 487 +- slice/Ice/LocalException.ice | 787 +-- slice/Ice/Locator.ice | 207 +- slice/Ice/LocatorF.ice | 6 +- slice/Ice/Logger.ice | 74 +- slice/Ice/Metrics.ice | 378 +- slice/Ice/ObjectAdapter.ice | 860 +-- slice/Ice/ObjectFactory.ice | 41 +- slice/Ice/Plugin.ice | 99 +- slice/Ice/Process.ice | 51 +- slice/Ice/ProcessF.ice | 4 +- slice/Ice/Properties.ice | 242 +- slice/Ice/PropertiesAdmin.ice | 83 +- slice/Ice/RemoteLogger.ice | 291 +- slice/Ice/Router.ice | 80 +- slice/Ice/RouterF.ice | 4 +- slice/Ice/ServantLocator.ice | 137 +- slice/Ice/ValueFactory.ice | 124 +- slice/Ice/Version.ice | 12 +- slice/IceBT/ConnectionInfo.ice | 20 +- slice/IceBT/EndpointInfo.ice | 24 +- slice/IceBT/Types.ice | 14 +- slice/IceBox/IceBox.ice | 165 +- slice/IceDiscovery/IceDiscovery.ice | 107 +- slice/IceGrid/Admin.ice | 1981 ++---- slice/IceGrid/Descriptor.ice | 841 +-- slice/IceGrid/Exception.ice | 299 +- slice/IceGrid/FileParser.ice | 60 +- slice/IceGrid/PluginFacade.ice | 332 +- slice/IceGrid/Registry.ice | 348 +- slice/IceGrid/Session.ice | 136 +- slice/IceGrid/UserAccountMapper.ice | 58 +- slice/IceIAP/ConnectionInfo.ice | 42 +- slice/IceIAP/EndpointInfo.ice | 39 +- .../IceLocatorDiscovery.ice | 80 +- slice/IcePatch2/FileInfo.ice | 40 +- slice/IcePatch2/FileServer.ice | 164 +- slice/IceSSL/ConnectionInfo.ice | 12 +- slice/IceSSL/EndpointInfo.ice | 12 +- slice/IceStorm/IceStorm.ice | 357 +- slice/IceStorm/Metrics.ice | 74 +- 91 files changed, 8804 insertions(+), 14214 deletions(-) delete mode 100644 cpp/test/Slice/errorDetection/OptionalParams.err create mode 100644 cpp/test/Slice/errorDetection/TaggedMembers.err rename cpp/test/Slice/errorDetection/{OptionalMembers.ice => TaggedMembers.ice} (100%) create mode 100644 cpp/test/Slice/errorDetection/TaggedParams.err rename cpp/test/Slice/errorDetection/{OptionalParams.ice => TaggedParams.ice} (100%) diff --git a/config/Make.project.rules b/config/Make.project.rules index ea357346d87..0e7ed7c142c 100644 --- a/config/Make.project.rules +++ b/config/Make.project.rules @@ -178,8 +178,7 @@ endef define make-bison $1/%.h $1/%.cpp: $1/%.y @$(RM) $$*.h $$*.cpp - bison -dvt $2 -o $1/$$*.cpp $$< - @$(MV) $1/$$*.hpp $1/$$*.h + bison -tv $2 --header=$1/$$*.h -o $1/$$*.cpp $$< @$(RM) $1/$$*.output endef @@ -190,10 +189,6 @@ define make-flex $1/%.cpp: $1/%.l @$(RM) $$@ flex $2 -o $$@ $$< - @$(MV) $$@ $$@.tail - @echo '#include ' >> $$@ - @cat $$@.tail >> $$@ - @$(RM) $$@.tail endef # diff --git a/cpp/include/IceUtil/ScannerConfig.h b/cpp/include/IceUtil/ScannerConfig.h index 561dd98e9d4..d0fa04985f4 100644 --- a/cpp/include/IceUtil/ScannerConfig.h +++ b/cpp/include/IceUtil/ScannerConfig.h @@ -13,7 +13,7 @@ // in flex generated Scanners are defined. // // in C99 conformant compilers we don't need to include it because the -// header is included by inttypes.h, that is included by the gernated +// header is included by inttypes.h, that is included by the generated // Scanners. // #if defined(_MSC_VER) && (_MSC_VER >= 1600) @@ -37,4 +37,10 @@ # pragma clang diagnostic ignored "-Wunused-but-set-variable" #endif + +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wunused-function" +# pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#endif + #endif diff --git a/cpp/src/Glacier2/Instrumentation.ice b/cpp/src/Glacier2/Instrumentation.ice index 4f644f6c439..875ecb3c71f 100644 --- a/cpp/src/Glacier2/Instrumentation.ice +++ b/cpp/src/Glacier2/Instrumentation.ice @@ -16,107 +16,50 @@ module Instrumentation local interface SessionObserver extends Ice::Instrumentation::Observer { - /** - * - * Notification of a forwarded request. This also implies removing - * the event from the queue. - * - * @param client True if client request, false if server request. - * - **/ + /// Notification of a forwarded request. This also implies removing the event from the queue. + /// @param client True if client request, false if server request. void forwarded(bool client); - /** - * - * Notification of a queued request. - * - * @param client True if client request, false if server request. - * - **/ + /// Notification of a queued request. + /// @param client True if client request, false if server request. void queued(bool client); - /** - * - * Notification of a overridden request. This implies adding and - * removing an event to the queue. - * - * @param client True if client request, false if server request. - * - **/ + /// Notification of a overridden request. This implies adding and removing an event to the queue. + /// @param client True if client request, false if server request. void overridden(bool client); - /** - * - * Notification of a routing table size change. - * - * @param delta The size adjustement. - * - **/ + /// Notification of a routing table size change. + /// @param delta The size adjustement. void routingTableSize(int delta); } -/** - * - * The ObserverUpdater interface is implemented by Glacier2 and an - * instance of this interface is provided on initialization to the - * RouterObserver object. - * - * This interface can be used by add-ins imlementing the - * RouterObserver interface to update the obsevers of observed - * objects. - * - **/ +/// The ObserverUpdater interface is implemented by Glacier2 and an instance of this interface is provided on +/// initialization to the RouterObserver object. +/// This interface can be used by add-ins imlementing the RouterObserver interface to update the obsevers of observed +/// objects. local interface ObserverUpdater { - /** - * - * Update the router sessions. - * - * When called, this method goes through all the sessions and for - * each session RouterObserver::getSessionObserver is - * called. The implementation of getSessionObserver has the - * possibility to return an updated observer if necessary. - * - **/ + /// Update the router sessions. + /// When called, this method goes through all the sessions and for each session RouterObserver::getSessionObserver + /// is called. The implementation of getSessionObserver has the possibility to return an updated observer if + /// necessary. void updateSessionObservers(); } -/** - * - * The router observer interface used by Glacier2 to obtain and update - * observers for its observeable objects. This interface should be - * implemented by add-ins that wish to observe Glacier2 objects in - * order to collect statistics. - * - **/ +/// The router observer interface used by Glacier2 to obtain and update observers for its observeable objects. This +/// interface should be implemented by add-ins that wish to observe Glacier2 objects in order to collect statistics. local interface RouterObserver { - /** - * - * This method should return an observer for the given session. - * - * @param id The id of the session (the user id or the SSL DN). - * - * @param con The connection associated to the session. - * - * @param routingTableSize The size of the routing table for this - * session. - * - * @param old The previous observer, only set when updating an - * existing observer. - * - **/ + /// This method should return an observer for the given session. + /// @param id The id of the session (the user id or the SSL DN). + /// @param con The connection associated to the session. + /// @param routingTableSize The size of the routing table for this session. + /// @param old The previous observer, only set when updating an existing observer. SessionObserver getSessionObserver(string id, Ice::Connection con, int routingTableSize, SessionObserver old); - /** - * - * Glacier2 calls this method on initialization. The add-in - * implementing this interface can use this object to get Glacier2 - * to re-obtain observers for topics and subscribers. - * - * @param updater The observer updater object. - * - **/ + /// Glacier2 calls this method on initialization. The add-in implementing this interface can use this object to get + /// Glacier2 to re-obtain observers for topics and subscribers. + /// @param updater The observer updater object. void setObserverUpdater(ObserverUpdater updater); } diff --git a/cpp/src/IceGrid/Internal.ice b/cpp/src/IceGrid/Internal.ice index 17bd88d7fa1..4c6bcb690a7 100644 --- a/cpp/src/IceGrid/Internal.ice +++ b/cpp/src/IceGrid/Internal.ice @@ -23,33 +23,32 @@ local exception SynchronizationException } // This class is no longer used. We keep it only for interop with IceGrid 3.7. -// class InternalDbEnvDescriptor { - /** The name of the database environment. */ + /// The name of the database environment. string name; - /** The database properties. */ + /// The database properties. PropertyDescriptorSeq properties; } sequence InternalDbEnvDescriptorSeq; class InternalAdapterDescriptor { - /** The identifier of the server. */ + /// The identifier of the server. string id; - /** Specifies if the lifetime of the adapter is the same as the server. */ + /// Specifies if the lifetime of the adapter is the same as the server. bool serverLifetime; } sequence InternalAdapterDescriptorSeq; class InternalDistributionDescriptor { - /** The proxy of the IcePatch2 server. */ + /// The proxy of the IcePatch2 server. string icepatch; - /** The source directories. */ + /// The source directories. ["java:type:java.util.LinkedList"] Ice::StringSeq directories; } @@ -57,134 +56,104 @@ dictionary PropertyDescriptorSeqDict; class InternalServerDescriptor { - /** The server ID. */ + /// The server ID. string id; - /** The server application */ + /// The server application string application; - /** The application uuid. */ + /// The application uuid. string uuid; - /** The application revision. */ + /// The application revision. int revision; - /** The id of the session which allocated the server. */ + /// The id of the session which allocated the server. string sessionId; - /** The server executable. */ + /// The server executable. string exe; - /** The server working directory. */ + /// The server working directory. string pwd; - /** The user ID to use to run the server. */ + /// The user ID to use to run the server. string user; - /** The server activation mode. */ + /// The server activation mode. string activation; - /** The server activation timeout. */ + /// The server activation timeout. string activationTimeout; - /** The server deactivation timeout. */ + /// The server deactivation timeout. string deactivationTimeout; - /** Specifies if the server depends on the application distrib. */ + /// Specifies if the server depends on the application distrib. bool applicationDistrib; - /** The distribution descriptor of this server. */ + /// The distribution descriptor of this server. InternalDistributionDescriptor distrib; - /** Specifies if a process object is registered. */ + /// Specifies if a process object is registered. bool processRegistered; - /** The server command line options. */ + /// The server command line options. Ice::StringSeq options; - /** The server environment variables. */ + /// The server environment variables. Ice::StringSeq envs; - /** The path of the server logs. */ + /// The path of the server logs. Ice::StringSeq logs; - /** The indirect object adapters. */ + /// The indirect object adapters. InternalAdapterDescriptorSeq adapters; // Not used, always empty. Kept only for interop with IceGrid 3.7. InternalDbEnvDescriptorSeq dbEnvs; - /** The configuration files of the server. */ + /// The configuration files of the server. PropertyDescriptorSeqDict properties; - /** IceBox service names */ + /// IceBox service names optional(1) Ice::StringSeq services; } -/** - * - * This exception is raised if an adapter is active. - * - **/ +/// This exception is raised if an adapter is active. exception AdapterActiveException { } exception AdapterNotActiveException { - /** True if the adapter can be activated on demand. */ + /// True if the adapter can be activated on demand. bool activatable; } interface Adapter { - /** - * - * Activate this adapter. If this adapter can be activated, this - * will activate the adapter and return the direct proxy of the - * adapter once it's active. If this adapter can be activated on - * demand, this will return 0 if the adapter is inactive or the - * adapter direct proxy it's active. - * - **/ + /// Activate this adapter. If this adapter can be activated, this will activate the adapter and return the direct + /// proxy of the adapter once it's active. If this adapter can be activated on demand, this will return 0 if the + /// adapter is inactive or the adapter direct proxy it's active. ["amd"] Object* activate(); - /** - * - * Get the adapter direct proxy. The adapter direct proxy is a - * proxy created with the object adapter. The proxy contains the - * last known adapter endpoints. - * - * @return A direct proxy containing the last known adapter - * endpoints if the adapter is already active. - * - **/ + /// Get the adapter direct proxy. The adapter direct proxy is a proxy created with the object adapter. The proxy + /// contains the last known adapter endpoints. + /// @return A direct proxy containing the last known adapter endpoints if the adapter is already active. ["nonmutating", "cpp:const"] idempotent Object* getDirectProxy() throws AdapterNotActiveException; - /** - * - * Set the direct proxy for this adapter. - * - * @param The direct proxy. The direct proxy should be created - * with the object adapter and should contain the object adapter - * endpoints. - * - * @throws AdapterActiveException The adapter is already - * active. It's not possible to override the direct proxy of an - * active adapter. - * - **/ + /// Set the direct proxy for this adapter. + /// @param The direct proxy. The direct proxy should be created with the object adapter and should contain the + /// object adapter endpoints. + /// @throws AdapterActiveException The adapter is already active. It's not possible to override the direct proxy of + /// an active adapter. void setDirectProxy(Object* proxy) throws AdapterActiveException; } -/** - * - * This exception is raised if an adapter with the same name already - * exists. - * - **/ +/// This exception is raised if an adapter with the same name already exists. exception AdapterExistsException { string id; @@ -194,111 +163,55 @@ dictionary AdapterPrxDict; interface FileReader { - /** - * - * Count the number of given lines from the end of the file and - * return the file offset. - * - **/ + /// Count the number of given lines from the end of the file and return the file offset. ["cpp:const"] idempotent long getOffsetFromEnd(string filename, int lines) throws FileNotAvailableException; - /** - * - * Read lines (or size bytes) at the specified position from the given file. - * - **/ + /// Read lines (or size bytes) at the specified position from the given file. ["cpp:const"] idempotent bool read(string filename, long pos, int size, out long newPos, out Ice::StringSeq lines) throws FileNotAvailableException; } interface Server extends FileReader { - /** - * - * Start the server. - * - **/ + /// Start the server. ["amd"] void start() throws ServerStartException; - /** - * - * Stop the server. This methods returns only when the server is - * deactivated. If the server doesn't stop after a configurable - * amount of time, it will be killed. - * - **/ + /// Stop the server. This methods returns only when the server is deactivated. If the server doesn't stop after a + /// configurable amount of time, it will be killed. ["amd"] void stop() throws ServerStopException; - /** - * - * Check if the given server can be loaded on this node. - * - * @return True if the server is inactive. - * - * @throws DeploymentException Raised if the server can't be updated. - * - **/ + /// Check if the given server can be loaded on this node. + /// @return True if the server is inactive. + /// @throws DeploymentException Raised if the server can't be updated. bool checkUpdate(InternalServerDescriptor svr, bool noRestart) throws DeploymentException; - /** - * - * Enable or disable the server. - * - **/ + /// Enable or disable the server. void setEnabled(bool enable); - /** - * - * Check if the server is enabled. - * - **/ + /// Check if the server is enabled. ["nonmutating", "cpp:const"] idempotent bool isEnabled(); - /** - * - * Send signal to the server - * - **/ + /// Send signal to the server void sendSignal(string signal) throws BadSignalException; - /** - * - * Write message on servers' stdout or stderr. - * - **/ + /// Write message on servers' stdout or stderr. void writeMessage(string message, int fd); - /** - * - * Return the server state. - * - * @return The server state. - * - * @see ServerState - * - **/ + /// Return the server state. + /// @return The server state. + /// @see ServerState ["nonmutating", "cpp:const"] idempotent ServerState getState(); - /** - * - * Get the server pid. Note that the value returned by this method - * is system dependant. On Unix operating systems, it's the pid - * value returned by the fork() system call and converted to an - * integer. - * - **/ + /// Get the server pid. Note that the value returned by this method is system dependant. On Unix operating systems, + /// it's the pid value returned by the fork() system call and converted to an integer. ["nonmutating", "cpp:const"] idempotent int getPid(); - /** - * - * Set the process proxy. - * - **/ + /// Set the process proxy. ["amd"] void setProcess(Ice::Process* proc); } @@ -307,56 +220,29 @@ sequence InternalRegistryPrxSeq; interface ReplicaObserver { - /** - * - * Initialization of the replica observer. - * - **/ + /// Initialization of the replica observer. void replicaInit(InternalRegistryPrxSeq replicas); - /** - * - * Notification that a replica has been added. The node should - * establish a session with this new replica. - * - **/ + /// Notification that a replica has been added. The node should establish a session with this new replica. void replicaAdded(InternalRegistry* replica); - /** - * - * Notification that a replica has been removed. The node should - * destroy the session to this replica. - * - **/ + /// Notification that a replica has been removed. The node should destroy the session to this replica. void replicaRemoved(InternalRegistry* replica); } interface PatcherFeedback { - /** - * - * The patch completed successfully. - * - **/ + /// The patch completed successfully. void finished(); - /** - * - * The patch on the given node failed for the given reason. - * - **/ + /// The patch on the given node failed for the given reason. void failed(string reason); } interface Node extends FileReader, ReplicaObserver { - /** - * - * Load the given server. If the server resources weren't already - * created (database environment directories, property files, etc), - * they will be created. - * - **/ + /// Load the given server. If the server resources weren't already created (database environment directories, + /// property files, etc), they will be created. ["amd"] idempotent Server* loadServer(InternalServerDescriptor svr, string replicaName, out AdapterPrxDict adapters, @@ -364,15 +250,9 @@ interface Node extends FileReader, ReplicaObserver out int deactTimeout) throws DeploymentException; - /** - * - * Load the given server and ensure the server won't be - * restarted. If the server resources weren't already created - * (database environment directories, property files, etc), they - * will be created. If the server can't be updated without a - * restart, a DeploymentException is raised. - * - **/ + /// Load the given server and ensure the server won't be restarted. If the server resources weren't already created + /// (database environment directories, property files, etc), they will be created. If the server can't be updated + /// without a restart, a DeploymentException is raised. ["amd"] idempotent Server* loadServerWithoutRestart(InternalServerDescriptor svr, string replicaName, out AdapterPrxDict adapters, @@ -380,165 +260,81 @@ interface Node extends FileReader, ReplicaObserver out int deactTimeout) throws DeploymentException; - /** - * - * Destroy the given server. - * - **/ + /// Destroy the given server. ["amd"] idempotent void destroyServer(string name, string uuid, int revision, string replicaName) throws DeploymentException; - /** - * - * Destroy the server if it's not active. - * - **/ + /// Destroy the server if it's not active. ["amd"] idempotent void destroyServerWithoutRestart(string name, string uuid, int revision, string replicaName) throws DeploymentException; - /** - * - * Patch application and server distributions. If some servers - * using a distribution directory to patch are active, this method - * will raise a PatchException unless shutdown is set to true. In - * which case the servers will be shutdown. - * - **/ + /// Patch application and server distributions. If some servers using a distribution directory to patch are active, + /// this method will raise a PatchException unless shutdown is set to true. In which case the servers will be + /// shutdown. ["amd"] idempotent void patch(PatcherFeedback* feedback, string application, string server, InternalDistributionDescriptor appDistrib, bool shutdown); - /** - * - * Establish a session to the given replica, this method only - * returns once the registration was attempted (unlike - * replicaAdded below). - * - **/ + /// Establish a session to the given replica, this method only returns once the registration was attempted (unlike + /// replicaAdded below). void registerWithReplica(InternalRegistry* replica); - /** - * - * Get the node name. - * - **/ + /// Get the node name. ["nonmutating", "cpp:const"] idempotent string getName(); - /** - * - * Get the node hostname. - * - **/ + /// Get the node hostname. ["nonmutating", "cpp:const"] idempotent string getHostname(); - /** - * - * Get the node load. - * - **/ + /// Get the node load. ["nonmutating", "cpp:const"] idempotent LoadInfo getLoad(); - /** - * - * Get the number of processor sockets for the machine where this - * node is running. - * - **/ + /// Get the number of processor sockets for the machine where this node is running. ["nonmutating", "cpp:const"] idempotent int getProcessorSocketCount(); - /** - * - * Shutdown the node. - * - **/ + /// Shutdown the node. ["nonmutating", "cpp:const"] idempotent void shutdown(); } sequence NodePrxSeq; -/** - * - * This exception is raised if a node is already registered and - * active. - * - **/ +/// This exception is raised if a node is already registered and active. exception NodeActiveException { } interface NodeSession { - /** - * - * The node call this method to keep the session alive. - * - **/ + /// The node call this method to keep the session alive. void keepAlive(LoadInfo load); - /** - * - * Set the replica observer. The node calls this method when it's - * ready to receive notifications for the replicas. It only calls - * this for the session with the master. - * - **/ + /// Set the replica observer. The node calls this method when it's ready to receive notifications for the replicas. + /// It only calls this for the session with the master. void setReplicaObserver(ReplicaObserver* observer); - /** - * - * Return the node session timeout. - * - **/ + /// Return the node session timeout. ["nonmutating", "cpp:const"] idempotent int getTimeout(); - /** - * - * Return the node observer. - * - **/ + /// Return the node observer. ["nonmutating", "cpp:const"] idempotent NodeObserver* getObserver(); - /** - * - * Ask the registry to load the servers on the node. - * - **/ + /// Ask the registry to load the servers on the node. ["amd", "nonmutating", "cpp:const"] idempotent void loadServers(); - /** - * - * Get the name of the servers deployed on the node. - * - **/ + /// Get the name of the servers deployed on the node. ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getServers(); - /** - * - * Wait for the application update to complete (the application is - * completely updated once all the registry replicas have been - * updated). This is used by the node to ensure that before to - * start a server all the replicas have the up-to-date descriptor - * of the server. - * - **/ + /// Wait for the application update to complete (the application is completely updated once all the registry + /// replicas have been updated). This is used by the node to ensure that before to start a server all the + /// replicas have the up-to-date descriptor of the server. ["amd", "cpp:const"] void waitForApplicationUpdate(string application, int revision); - /** - * - * Destroy the session. - * - **/ + /// Destroy the session. void destroy(); } -/** - * - * This exception is raised if a replica is already registered and - * active. - * - **/ +/// This exception is raised if a replica is already registered and active. exception ReplicaActiveException { } @@ -560,240 +356,111 @@ dictionary StringLongDict; interface ReplicaSession { - /** - * - * The replica call this method to keep the session alive. - * - **/ + /// The replica call this method to keep the session alive. void keepAlive(); - /** - * - * Return the replica session timeout. - * - **/ + /// Return the replica session timeout. ["cpp:const"] idempotent int getTimeout(); - /** - * - * Set the database observer. Once the observer is subscribed, it - * will receive the database and database updates. - * - **/ + /// Set the database observer. Once the observer is subscribed, it will receive the database and database updates. idempotent void setDatabaseObserver(DatabaseObserver* dbObs, optional(1) StringLongDict serials) throws ObserverAlreadyRegisteredException, DeploymentException; - /** - * - * This method sets the endpoints of the replica. This allows the - * master to create proxies with multiple endpoints for replicated - * objects (e.g.: IceGrid::Query object). - * - **/ + /// This method sets the endpoints of the replica. This allows the master to create proxies with multiple endpoints + /// for replicated objects (e.g.: IceGrid::Query object). idempotent void setEndpoints(StringObjectProxyDict endpoints); - /** - * - * Registers the replica well-known objects with the master. - * - **/ + /// Registers the replica well-known objects with the master. idempotent void registerWellKnownObjects(ObjectInfoSeq objects); - /** - * - * Set the adapter direct proxy of the given adapter in the - * master. This is used to support dynamic registration with - * the locator registry interface. - * - **/ + /// Set the adapter direct proxy of the given adapter in the master. This is used to support dynamic registration + /// with the locator registry interface. idempotent void setAdapterDirectProxy(string adapterId, string replicaGroupId, Object* proxy) throws AdapterNotExistException, AdapterExistsException; - /** - * - * Notify the master that an update was received. The master might - * wait for replication updates to be received by all the replicas - * before to continue. - * - **/ + /// Notify the master that an update was received. The master might wait for replication updates to be received by + /// all the replicas before to continue. void receivedUpdate(TopicName name, int serial, string failure); - /** - * - * Destroy the session. - * - **/ + /// Destroy the session. void destroy(); } -/** - * - * Information about an IceGrid node. - * - **/ +/// Information about an IceGrid node. class InternalNodeInfo { - /** - * - * The name of the node. - * - **/ + /// The name of the node. string name; - /** - * - * The operating system name. - * - **/ + /// The operating system name. string os; - /** - * - * The network name of the host running this node (as defined in - * uname()). - * - **/ + /// The network name of the host running this node (as defined in uname()). string hostname; - /** - * - * The operation system release level (as defined in uname()). - * - **/ + /// The operation system release level (as defined in uname()). string release; - /** - * - * The operation system version (as defined in uname()). - * - **/ + /// The operation system version (as defined in uname()). string version; - /** - * - * The machine hardware type (as defined in uname()). - * - **/ + /// The machine hardware type (as defined in uname()). string machine; - /** - * - * The number of processor threads (e.g. 8 on - * system with 1 quad-core CPU, with 2 threads per core) - * - **/ + /// The number of processor threads (e.g. 8 on system with 1 quad-core CPU, with 2 threads per core) int nProcessors; - /** - * - * The path to the node data directory. - * - **/ + /// The path to the node data directory. string dataDir; } -/** - * - * Information about an IceGrid registry replica. - * - **/ +/// Information about an IceGrid registry replica. class InternalReplicaInfo { - /** - * - * The name of the registry. - * - **/ + /// The name of the registry. string name; - /** - * - * The network name of the host running this registry (as defined in - * uname()). - * - **/ + /// The network name of the host running this registry (as defined in uname()). string hostname; } interface InternalRegistry extends FileReader { - /** - * - * Register a node with the registry. If a node with the same name - * is already registered, [registerNode] will overide the previous - * node only if it's not active. - * - * @param info Some information on the node. - * - * @param prx The proxy of the node. - * - * @param loadInf The load information of the node. - * - * @return The node session proxy. - * - * @throws NodeActiveException Raised if the node is already - * registered and currently active. - * - **/ + /// Register a node with the registry. If a node with the same name is already registered, [registerNode] will + /// overide the previous node only if it's not active. + /// @param info Some information on the node. + /// @param prx The proxy of the node. + /// @param loadInf The load information of the node. + /// @return The node session proxy. + /// @throws NodeActiveException Raised if the node is already registered and currently active. NodeSession* registerNode(InternalNodeInfo info, Node* prx, LoadInfo loadInf) throws NodeActiveException, PermissionDeniedException; - /** - * - * Register a replica with the registry. If a replica with the - * same name is already registered, [registerReplica] will overide - * the previous replica only if it's not active. - * - * @param info Some information on the replica. - * - * @param prx The proxy of the replica. - * - * @return The replica session proxy. - * - * @throws ReplicaActiveException Raised if the replica is already - * registered and currently active. - * - **/ + /// Register a replica with the registry. If a replica with the same name is already registered, [registerReplica] + /// will overide the previous replica only if it's not active. + /// @param info Some information on the replica. + /// @param prx The proxy of the replica. + /// @return The replica session proxy. + /// @throws ReplicaActiveException Raised if the replica is already registered and currently active. ReplicaSession* registerReplica(InternalReplicaInfo info, InternalRegistry* prx) throws ReplicaActiveException, PermissionDeniedException; - /** - * - * Create a session with the given registry replica. This method - * returns only once the session creation has been attempted. - * - **/ + /// Create a session with the given registry replica. This method returns only once the session creation has been + /// attempted. void registerWithReplica(InternalRegistry* prx); - /** - * - * Return the proxies of all the nodes known by this registry. - * - **/ + /// Return the proxies of all the nodes known by this registry. ["cpp:const"] idempotent NodePrxSeq getNodes(); - /** - * - * Return the proxies of all the registry replicas known by this - * registry. - * - **/ + /// Return the proxies of all the registry replicas known by this registry. ["cpp:const"] idempotent InternalRegistryPrxSeq getReplicas(); - /** - * - * Return applications, adapters, objects from this replica. - * - **/ + /// Return applications, adapters, objects from this replica. ["cpp:const"] idempotent ApplicationInfoSeq getApplications(out long serial); ["cpp:const"] idempotent AdapterInfoSeq getAdapters(out long serial); ["cpp:const"] idempotent ObjectInfoSeq getObjects(out long serial); - /** - * - * Shutdown this registry. - * - **/ + /// Shutdown this registry. ["cpp:const"] idempotent void shutdown(); } diff --git a/cpp/src/IceStorm/DBTypes.ice b/cpp/src/IceStorm/DBTypes.ice index 5d5c2a7a85f..d142b0b7ac2 100644 --- a/cpp/src/IceStorm/DBTypes.ice +++ b/cpp/src/IceStorm/DBTypes.ice @@ -11,17 +11,16 @@ module IceStormElection { -dictionary StringLogUpdateDict; + dictionary StringLogUpdateDict; } module IceStorm { -dictionary SubscriberRecordDict; - -struct AllData -{ - IceStormElection::StringLogUpdateDict llus; - IceStorm::SubscriberRecordDict subscribers; -} + dictionary SubscriberRecordDict; + struct AllData + { + IceStormElection::StringLogUpdateDict llus; + IceStorm::SubscriberRecordDict subscribers; + } } diff --git a/cpp/src/IceStorm/Election.ice b/cpp/src/IceStorm/Election.ice index 8b175c9b6ff..6b49bf9deb5 100644 --- a/cpp/src/IceStorm/Election.ice +++ b/cpp/src/IceStorm/Election.ice @@ -13,290 +13,187 @@ module IceStormElection { - -/** The contents of topic. */ -struct TopicContent -{ - /** The topic identity. */ - Ice::Identity id; - /** The topic subscribers. */ - IceStorm::SubscriberRecordSeq records; -} - -/** A sequence of topic content. */ -sequence TopicContentSeq; - -/** Thrown if an observer detects an inconsistency. */ -exception ObserverInconsistencyException -{ - /** The reason for the inconsistency. */ - string reason; -} - -/** The replica observer. */ -interface ReplicaObserver -{ - /** - * - * Initialize the observer. - * - * @param llu The last log update seen by the master. - * - * @param content The topic content. - * - * @throws ObserverInconsistencyException Raised if an - * inconsisency was detected. - * - **/ - void init(LogUpdate llu, TopicContentSeq content) - throws ObserverInconsistencyException; - - /** - * - * Create the topic with the given name. - * - * @param llu The log update token. - * - * @param name The topic name. - * - * @throws ObserverInconsistencyException Raised if an - * inconsisency was detected. - * - **/ - void createTopic(LogUpdate llu, string name) - throws ObserverInconsistencyException; - - /** - * - * Destroy the topic with the given name. - * - * @param llu The log update token. - * - * @param name The topic name. - * - * @throws ObserverInconsistencyException Raised if an - * inconsisency was detected. - * - **/ - void destroyTopic(LogUpdate llu, string name) - throws ObserverInconsistencyException; - - /** - * - * Add a subscriber to a topic. - * - * @param llu The log update token. - * - * @param topic The topic name to which to add the subscriber. - * - * @param record The subscriber information. - * - * @throws ObserverInconsistencyException Raised if an - * inconsisency was detected. - * - **/ - void addSubscriber(LogUpdate llu, string topic, IceStorm::SubscriberRecord record) - throws ObserverInconsistencyException; - - /** - * - * Remove a subscriber from a topic. - * - * @param llu The log update token. - * - * @param name The topic name. - * - * @param subscribers The identities of the subscribers to remove. - * - * @throws ObserverInconsistencyException Raised if an - * inconsisency was detected. - * - **/ - void removeSubscriber(LogUpdate llu, string topic, Ice::IdentitySeq subscribers) - throws ObserverInconsistencyException; -} - -/** Interface used to sync topics. */ -interface TopicManagerSync -{ - /** - * Retrieve the topic content. - * - * @param llu The last log update token. - * - * @param content The topic content. - * - **/ - void getContent(out LogUpdate llu, out TopicContentSeq content); -} - -/** The node state. */ -enum NodeState -{ - /** The node is inactive and awaiting an election. */ - NodeStateInactive, - /** The node is electing a leader. */ - NodeStateElection, - /** The replica group is reorganizing. */ - NodeStateReorganization, - /** The replica group is active & replicating. */ - NodeStateNormal -} - -/** Forward declaration. */ -interface Node; - -/** All nodes in the replication group. */ -struct NodeInfo -{ - /** The identity of the node. */ - int id; - /** The node proxy. */ - Node* n; -} - -/** A sequence of node info. */ -sequence NodeInfoSeq; - -/** The group info. */ -struct GroupInfo -{ - /** The identity of the node. */ - int id; - /** The last known log update for this node. */ - LogUpdate llu; -} -/** A sequence of group info. */ -sequence GroupInfoSeq; - -struct QueryInfo -{ - /** The node id. */ - int id; - - /** The nodes coordinator. */ - int coord; - - /** The nodes group name. */ - string group; - - /** The replica the node is managing. */ - Object* replica; - - /** The node state. */ - NodeState state; - - /** The sequence of nodes in this nodes group. */ - GroupInfoSeq up; - - /** The highest priority node that this node has seen. */ - int max; -} - -/** A replica node. */ -interface Node -{ - /** - * - * Invite the node into a group with the given coordinator and - * group name. - * - * @param gn The group name. - * - * @param j The group coordinator. - * - **/ - void invitation(int j, string gn); - - /** - * - * Call from the group coordinator to a node to inform the node - * that the replica group is active. - * - * @param j The group coordinator. - * - * @param gn The group name. - * - * @param coordinator The proxy to the coordinator. - * - * @param max The highest priority node seen by this replica - * group. - * - * @param generation The current generation count. - */ - void ready(int j, string gn, Object* coordinator, int max, long generation); - - /** - * - * Called to accept an invitation into - * the given group. - * - * @param j The id of the node accepting the invitation. - * - * @param observer The observer. - * - * @param gn The group name. - * - * @param forwardedInvites The ids of the nodes to which - * invitations were forwarded. - * - * @param llu The last log update for the given node. - * - * @param max The highest priority node seen by this replica - * group. - * - **/ - void accept(int j, string gn, Ice::IntSeq forwardedInvites, Object* observer, LogUpdate llu, int max); - - /** - * - * Determine if this node is a coordinator. - * - * @return True if the node is a coordinator, false otherwise. - **/ - ["cpp:const"] idempotent bool areYouCoordinator(); - - /** - * - * Determine if the node is a member of the given group with the - * given coordinator. - * - * @param gn The group name. - * - * @param j The group coordinator. - * - * @return True if the node is a member, false otherwise. - * - **/ - ["cpp:const"] idempotent bool areYouThere(string gn, int j); - - /** - * - * Get the sync object for the replica hosted by this node. - * - * @return The sync object. - * - **/ - ["cpp:const"] idempotent Object* sync(); - - /** - * - * Get the replication group information. - * - * @return The set of configured nodes and the associated - * priority. - * - **/ - ["cpp:const"] idempotent NodeInfoSeq nodes(); - - /** - * - * Get the query information for the given node. - * - * @return The query information. - * - **/ - ["cpp:const"] idempotent QueryInfo query(); -} - + /// The contents of topic. + struct TopicContent + { + /// The topic identity. + Ice::Identity id; + /// The topic subscribers. + IceStorm::SubscriberRecordSeq records; + } + + /// A sequence of topic content. + sequence TopicContentSeq; + + /// Thrown if an observer detects an inconsistency. + exception ObserverInconsistencyException + { + /// The reason for the inconsistency. + string reason; + } + + /// The replica observer. + interface ReplicaObserver + { + /// Initialize the observer. + /// @param llu The last log update seen by the master. + /// @param content The topic content. + /// @throws ObserverInconsistencyException Raised if an + /// inconsisency was detected. + void init(LogUpdate llu, TopicContentSeq content) + throws ObserverInconsistencyException; + + /// Create the topic with the given name. + /// @param llu The log update token. + /// @param name The topic name. + /// @throws ObserverInconsistencyException Raised if an + /// inconsisency was detected. + void createTopic(LogUpdate llu, string name) + throws ObserverInconsistencyException; + + /// Destroy the topic with the given name. + /// @param llu The log update token. + /// @param name The topic name. + /// @throws ObserverInconsistencyException Raised if an + /// inconsisency was detected. + void destroyTopic(LogUpdate llu, string name) + throws ObserverInconsistencyException; + + /// Add a subscriber to a topic. + /// @param llu The log update token. + /// @param topic The topic name to which to add the subscriber. + /// @param record The subscriber information. + /// @throws ObserverInconsistencyException Raised if an + /// inconsisency was detected. + void addSubscriber(LogUpdate llu, string topic, IceStorm::SubscriberRecord record) + throws ObserverInconsistencyException; + + /// Remove a subscriber from a topic. + /// @param llu The log update token. + /// @param name The topic name. + /// @param subscribers The identities of the subscribers to remove. + /// @throws ObserverInconsistencyException Raised if an inconsisency was detected. + void removeSubscriber(LogUpdate llu, string topic, Ice::IdentitySeq subscribers) + throws ObserverInconsistencyException; + } + + /// Interface used to sync topics. + interface TopicManagerSync + { + /// Retrieve the topic content. + /// @param llu The last log update token. + /// @param content The topic content. + void getContent(out LogUpdate llu, out TopicContentSeq content); + } + + /// The node state. + enum NodeState + { + /// The node is inactive and awaiting an election. + NodeStateInactive, + /// The node is electing a leader. + NodeStateElection, + /// The replica group is reorganizing. + NodeStateReorganization, + /// The replica group is active & replicating. + NodeStateNormal + } + + /// Forward declaration. + interface Node; + + /// All nodes in the replication group. + struct NodeInfo + { + /// The identity of the node. + int id; + /// The node proxy. + Node* n; + } + + /// A sequence of node info. + sequence NodeInfoSeq; + + /// The group info. + struct GroupInfo + { + /// The identity of the node. + int id; + /// The last known log update for this node. + LogUpdate llu; + } + /// A sequence of group info. + sequence GroupInfoSeq; + + struct QueryInfo + { + /// The node id. + int id; + + /// The nodes coordinator. + int coord; + + /// The nodes group name. + string group; + + /// The replica the node is managing. + Object* replica; + + /// The node state. + NodeState state; + + /// The sequence of nodes in this nodes group. + GroupInfoSeq up; + + /// The highest priority node that this node has seen. + int max; + } + + /// A replica node. + interface Node + { + /// Invite the node into a group with the given coordinator and group name. + /// @param gn The group name. + /// @param j The group coordinator. + void invitation(int j, string gn); + + /// Call from the group coordinator to a node to inform the node that the replica group is active. + /// @param j The group coordinator. + /// @param gn The group name. + /// @param coordinator The proxy to the coordinator. + /// @param max The highest priority node seen by this replica group. + /// @param generation The current generation count. + void ready(int j, string gn, Object* coordinator, int max, long generation); + + /// Called to accept an invitation into the given group. + /// @param j The id of the node accepting the invitation. + /// @param observer The observer. + /// @param gn The group name. + /// @param forwardedInvites The ids of the nodes to which invitations were forwarded. + /// @param llu The last log update for the given node. + /// @param max The highest priority node seen by this replica group. + void accept(int j, string gn, Ice::IntSeq forwardedInvites, Object* observer, LogUpdate llu, int max); + + /// Determine if this node is a coordinator. + /// @return True if the node is a coordinator, false otherwise. + ["cpp:const"] idempotent bool areYouCoordinator(); + + /// Determine if the node is a member of the given group with the given coordinator. + /// @param gn The group name. + /// @param j The group coordinator. + /// @return True if the node is a member, false otherwise. + ["cpp:const"] idempotent bool areYouThere(string gn, int j); + + /// Get the sync object for the replica hosted by this node. + /// @return The sync object. + ["cpp:const"] idempotent Object* sync(); + + /// Get the replication group information. + /// @return The set of configured nodes and the associated priority. + ["cpp:const"] idempotent NodeInfoSeq nodes(); + + /// Get the query information for the given node. + /// @return The query information. + ["cpp:const"] idempotent QueryInfo query(); + } } diff --git a/cpp/src/IceStorm/IceStormInternal.ice b/cpp/src/IceStorm/IceStormInternal.ice index 302446d7070..9d36c6ff62b 100644 --- a/cpp/src/IceStorm/IceStormInternal.ice +++ b/cpp/src/IceStorm/IceStormInternal.ice @@ -17,20 +17,16 @@ module IceStorm { -/** - * - * The event data. - * - **/ +/// The event data. ["cpp:class"] struct EventData { - /** The operation name. */ + /// The operation name. string op; - /** The operation mode. */ + /// The operation mode. Ice::OperationMode mode; - /** The encoded data for the operation's input parameters. */ + /// The encoded data for the operation's input parameters. Ice::ByteSeq data; - /** The Ice::Current::Context data from the originating request. */ + /// The Ice::Current::Context data from the originating request. Ice::Context context; } @@ -38,81 +34,43 @@ local exception SendQueueSizeMaxReached { } -/** A sequence of EventData. */ +/// A sequence of EventData. ["cpp:type:std::deque< ::IceStorm::EventDataPtr>"] sequence EventDataSeq; -/** - * - * The TopicLink interface. This is used to forward events between - * federated Topic instances. - * - * @see TopicInternal - * - **/ +/// The TopicLink interface. This is used to forward events between federated Topic instances. +/// @see TopicInternal interface TopicLink { - /** - * - * Forward a sequence of events. - * - * @param events The events to forward. - * - **/ + /// Forward a sequence of events. + /// @param events The events to forward. void forward(EventDataSeq events); } -/** Thrown if the reap call would block. */ +/// Thrown if the reap call would block. exception ReapWouldBlock { } -/** - * - * Internal operations for a topic. - * - * @see Topic - * - **/ +/// Internal operations for a topic. +/// @see Topic interface TopicInternal extends Topic { - /** - * - * Retrieve a proxy to the TopicLink interface. - * - * @return The TopicLink for the Topic. - * - **/ + /// Retrieve a proxy to the TopicLink interface. + /// @return The TopicLink for the Topic. idempotent TopicLink* getLinkProxy(); - /** - * - * Reap the given identities. - * - * @param id The sequence of identities. - * - * @throws ReapWouldBlock Raised if the reap call would block. - * - **/ + /// Reap the given identities. + /// @param id The sequence of identities. + /// @throws ReapWouldBlock Raised if the reap call would block. void reap(Ice::IdentitySeq id) throws ReapWouldBlock; } -/** - * - * Internal operations for a topic manager. - * - * @see TopicManager - * - **/ +/// Internal operations for a topic manager. +/// @see TopicManager interface TopicManagerInternal extends TopicManager { - /** - * - * Return the replica node proxy for this topic manager. - * - * @return The replica proxy, or null if this instance is not - * replicated. - * - **/ + /// Return the replica node proxy for this topic manager. + /// @return The replica proxy, or null if this instance is not replicated. ["cpp:const"] idempotent IceStormElection::Node* getReplicaNode(); } diff --git a/cpp/src/IceStorm/Instrumentation.ice b/cpp/src/IceStorm/Instrumentation.ice index dab31321dd5..2d91cef689e 100644 --- a/cpp/src/IceStorm/Instrumentation.ice +++ b/cpp/src/IceStorm/Instrumentation.ice @@ -17,160 +17,79 @@ module Instrumentation local interface TopicObserver extends Ice::Instrumentation::Observer { - /** - * - * Notification of an event published on the topic by a publisher. - * - **/ + /// Notification of an event published on the topic by a publisher. void published(); - /** - * - * Notification of an event forwared on the topic by another topic. - * - **/ + /// Notification of an event forwared on the topic by another topic. void forwarded(); } local interface SubscriberObserver extends Ice::Instrumentation::Observer { - /** - * - * Notification of some events being queued. - * - **/ + /// Notification of some events being queued. void queued(int count); - /** - * - * Notification of a some events being sent. - * - **/ + /// Notification of a some events being sent. void outstanding(int count); - /** - * - * Notification of some events being delivered. - * - **/ + /// Notification of some events being delivered. void delivered(int count); } -/** - * - * The ObserverUpdater interface is implemented by IceStorm and an - * instance of this interface is provided on initialization to the - * TopicManagerObserver object. - * - * This interface can be used by add-ins imlementing the - * TopicManagerObserver interface to update the obsevers of observed - * objects. - * - **/ +/// The ObserverUpdater interface is implemented by IceStorm and an instance of this interface is provided on +/// initialization to the TopicManagerObserver object. +/// This interface can be used by add-ins imlementing the TopicManagerObserver interface to update the obsevers of +/// observed objects. local interface ObserverUpdater { - /** - * - * Update topic observers associated with each topics. - * - * When called, this method goes through all the topics and for - * each topic TopicManagerObserver::getTopicObserver is - * called. The implementation of getTopicObserver has the - * possibility to return an updated observer if necessary. - * - **/ + /// Update topic observers associated with each topics. + /// When called, this method goes through all the topics and for each topic TopicManagerObserver::getTopicObserver + /// is called. The implementation of getTopicObserver has the possibility to return an updated observer if + /// necessary. void updateTopicObservers(); - /** - * - * Update subscriber observers associated with each subscriber. - * - * When called, this method goes through all the subscribers and - * for each subscriber TopicManagerObserver::getSubscriberObserver - * is called. The implementation of getSubscriberObserver has the - * possibility to return an updated observer if necessary. - * - **/ + /// Update subscriber observers associated with each subscriber. + /// When called, this method goes through all the subscribers and for each subscriber + /// TopicManagerObserver::getSubscriberObserver is called. The implementation of getSubscriberObserver has the + /// possibility to return an updated observer if necessary. void updateSubscriberObservers(); } enum SubscriberState { - /** - * - * Online waiting to send events. - * - **/ + /// Online waiting to send events. SubscriberStateOnline, - /** - * - * Offline, retrying. - * - **/ + /// Offline, retrying. SubscriberStateOffline, - /** - * - * Error state, awaiting to be destroyed. - * - **/ + /// Error state, awaiting to be destroyed. SubscriberStateError } -/** - * - * The topic manager observer interface used by the Ice run-time to - * obtain and update observers for its observeable objects. This - * interface should be implemented by add-ins that wish to observe - * IceStorm objects in order to collect statistics. - * - **/ +/// The topic manager observer interface used by the Ice run-time to obtain and update observers for its observeable +/// objects. This interface should be implemented by add-ins that wish to observe IceStorm objects in order to collect +/// statistics. local interface TopicManagerObserver { - /** - * - * This method should return an observer for the given topic. - * - * @param svc The service name. - * - * @param name The topic name. - * - * @param old The previous observer, only set when updating an - * existing observer. - * - **/ + /// This method should return an observer for the given topic. + /// @param svc The service name. + /// @param name The topic name. + /// @param old The previous observer, only set when updating an existing observer. TopicObserver getTopicObserver(string svc, string name, TopicObserver old); - /** - * - * This method should return an observer for the given subscriber. - * - * @param topic The name of the topic subscribed. - * - * @param subscriber The proxy of the subscriber. - * - * @param qos The QoS configured for the subscriber. - * - * @param link The proxy of the linked topic if this subscriber - * forwards events to a linked topic. - * - * @param old The previous observer, only set when updating an - * existing observer. - * - **/ + /// This method should return an observer for the given subscriber. + /// @param topic The name of the topic subscribed. + /// @param subscriber The proxy of the subscriber. + /// @param qos The QoS configured for the subscriber. + /// @param link The proxy of the linked topic if this subscriber forwards events to a linked topic. + /// @param old The previous observer, only set when updating an existing observer. SubscriberObserver getSubscriberObserver(string svc, string topic, Object* prx, QoS q, IceStorm::Topic* link, SubscriberState s, SubscriberObserver old); - /** - * - * IceStorm calls this method on initialization. The add-in - * implementing this interface can use this object to get IceStorm - * to re-obtain observers for topics and subscribers. - * - * @param updater The observer updater object. - * - **/ + /// IceStorm calls this method on initialization. The add-in implementing this interface can use this object to + /// get IceStorm to re-obtain observers for topics and subscribers. + /// @param updater The observer updater object. void setObserverUpdater(ObserverUpdater updater); } diff --git a/cpp/src/IceStorm/LLURecord.ice b/cpp/src/IceStorm/LLURecord.ice index 701a3c98c18..5cca5e27f95 100644 --- a/cpp/src/IceStorm/LLURecord.ice +++ b/cpp/src/IceStorm/LLURecord.ice @@ -8,14 +8,12 @@ module IceStormElection { - -/** A struct used for marking the last log update. */ -struct LogUpdate -{ - /** The generation. */ - long generation; - /** The iteration within this generation. */ - long iteration; -} - + /// A struct used for marking the last log update. + struct LogUpdate + { + /// The generation. + long generation; + /// The iteration within this generation. + long iteration; + } } diff --git a/cpp/src/IceStorm/LinkRecord.ice b/cpp/src/IceStorm/LinkRecord.ice index c6f9c619057..159b5805fa7 100644 --- a/cpp/src/IceStorm/LinkRecord.ice +++ b/cpp/src/IceStorm/LinkRecord.ice @@ -11,17 +11,14 @@ module IceStorm { - -/** - * - * Used to store persistent information for Topic federation. - * - **/ -struct LinkRecord -{ - TopicLink* obj; // The topic link object. - int cost; // The cost. - Topic* theTopic; // The linked topic for getLinkInfoSeq + /// Used to store persistent information for Topic federation. + struct LinkRecord + { + /// The topic link object. + TopicLink* obj; + /// The cost. + int cost; + /// The linked topic for getLinkInfoSeq + Topic* theTopic; + } } - -} // End module IceStorm diff --git a/cpp/src/IceStorm/SubscriberRecord.ice b/cpp/src/IceStorm/SubscriberRecord.ice index 447c45f34f4..87e5f13f41b 100644 --- a/cpp/src/IceStorm/SubscriberRecord.ice +++ b/cpp/src/IceStorm/SubscriberRecord.ice @@ -11,52 +11,45 @@ module IceStorm { - -/** - * - * The key for persistent subscribers, or topics. - * - * If the subscriber identity is empty then the record is used as a - * place holder for the creation of a topic, otherwise the record - * holds a subscription record. - * - **/ -struct SubscriberRecordKey -{ - // The topic identity. - Ice::Identity topic; - - // The identity of the subscriber. If this is empty then the key - // is a placeholder for a topic. - Ice::Identity id; -} - -/** - * - * Used to store persistent information for persistent subscribers. - * - **/ -struct SubscriberRecord -{ - string topicName; // The name of the topic. - - Ice::Identity id; // The subscriber identity. - - // Is this a link record, or a subscriber record? - bool link; - - Object* obj; // The subscriber object. - - // We could simulate a union here with a class object. - - // Persistent subscriber data. - QoS theQoS; // The QoS. - - // Link subscriber data. - int cost; // The cost. - Topic* theTopic; // The linked topic. + /// The key for persistent subscribers, or topics. + /// If the subscriber identity is empty then the record is used as a place holder for the creation of a topic, + /// otherwise the record holds a subscription record. + struct SubscriberRecordKey + { + /// The topic identity. + Ice::Identity topic; + + /// The identity of the subscriber. If this is empty then the key is a placeholder for a topic. + Ice::Identity id; + } + + /// Used to store persistent information for persistent subscribers. + struct SubscriberRecord + { + /// The name of the topic. + string topicName; + + /// The subscriber identity. + Ice::Identity id; + + /// Is this a link record, or a subscriber record? + bool link; + + /// The subscriber object. + Object* obj; + + // We could simulate a union here with a class object. + + // Persistent subscriber data. + /// The QoS. + QoS theQoS; + + // Link subscriber data. + /// The cost. + int cost; + /// The linked topic. + Topic* theTopic; + } + + sequence SubscriberRecordSeq; } - -sequence SubscriberRecordSeq; - -} // End module IceStorm diff --git a/cpp/src/Slice/Grammar.cpp b/cpp/src/Slice/Grammar.cpp index 5a34b9445a5..3498f0af570 100644 --- a/cpp/src/Slice/Grammar.cpp +++ b/cpp/src/Slice/Grammar.cpp @@ -1,21 +1,22 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,13 +27,17 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -40,11 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Bison version. */ -#define YYBISON_VERSION "2.7" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -58,26 +63,61 @@ /* Pull parsers. */ #define YYPULL 1 +/* "%code top" blocks. */ +#line 1 "src/Slice/Grammar.y" + + +// +// Copyright (c) ZeroC, Inc. All rights reserved. +// + +// Included first to get 'TokenContext' which we need to define YYLTYPE before flex does. +#include + +#line 27 "src/Slice/Grammar.y" + + +// Defines the rule bison uses to reduce token locations. Bison asks that the macro should +// be one-line, and treatable as a single statement when followed by a semi-colon. +// `N` is the number of tokens that are being combined, and (Cur) is their combined location. +#define YYLLOC_DEFAULT(Cur, Rhs, N) \ +do \ + if(N == 1) \ + { \ + (Cur) = (YYRHSLOC((Rhs), 1)); \ + } \ + else \ + { \ + if(N) \ + { \ + (Cur).firstLine = (YYRHSLOC((Rhs), 1)).firstLine; \ + (Cur).firstColumn = (YYRHSLOC((Rhs), 1)).firstColumn; \ + } \ + else \ + { \ + (Cur).firstLine = (YYRHSLOC((Rhs), 0)).lastLine; \ + (Cur).firstColumn = (YYRHSLOC((Rhs), 0)).lastColumn; \ + } \ + (Cur).filename = (YYRHSLOC((Rhs), N)).filename; \ + (Cur).lastLine = (YYRHSLOC((Rhs), N)).lastLine; \ + (Cur).lastColumn = (YYRHSLOC((Rhs), N)).lastColumn; \ + } \ +while(0) + + +#line 109 "src/Slice/Grammar.cpp" /* Substitute the variable and function names. */ #define yyparse slice_parse #define yylex slice_lex #define yyerror slice_error -#define yylval slice_lval -#define yychar slice_char #define yydebug slice_debug #define yynerrs slice_nerrs -/* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 1 "src/Slice/Grammar.y" - +/* First part of user prologue. */ +#line 66 "src/Slice/Grammar.y" -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// -#include #include #include #include @@ -89,18 +129,17 @@ # pragma warning(disable:4065) // warning C4244: '=': conversion from 'int' to 'yytype_int16', possible loss of data # pragma warning(disable:4244) +// warning C4127: conditional expression is constant +# pragma warning(disable:4127) #endif -// // Avoid old style cast warnings in generated grammar -// #ifdef __GNUC__ # pragma GCC diagnostic ignored "-Wold-style-cast" +# pragma GCC diagnostic ignored "-Wunused-label" #endif -// -// Avoid clang conversion warnings -// +// Avoid clang warnings in generate grammar #if defined(__clang__) # pragma clang diagnostic ignored "-Wconversion" # pragma clang diagnostic ignored "-Wsign-conversion" @@ -127,148 +166,280 @@ slice_error(const char* s) } -/* Line 371 of yacc.c */ -#line 128 "src/Slice/Grammar.cpp" +#line 170 "src/Slice/Grammar.cpp" -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) # else -# define YY_NULL 0 +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) # endif # endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "Grammar.hpp". */ -#ifndef YY_SLICE_SRC_SLICE_GRAMMAR_HPP_INCLUDED -# define YY_SLICE_SRC_SLICE_GRAMMAR_HPP_INCLUDED -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int slice_debug; -#endif - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ICE_MODULE = 258, - ICE_CLASS = 259, - ICE_INTERFACE = 260, - ICE_EXCEPTION = 261, - ICE_STRUCT = 262, - ICE_SEQUENCE = 263, - ICE_DICTIONARY = 264, - ICE_ENUM = 265, - ICE_OUT = 266, - ICE_EXTENDS = 267, - ICE_IMPLEMENTS = 268, - ICE_THROWS = 269, - ICE_VOID = 270, - ICE_BYTE = 271, - ICE_BOOL = 272, - ICE_SHORT = 273, - ICE_INT = 274, - ICE_LONG = 275, - ICE_FLOAT = 276, - ICE_DOUBLE = 277, - ICE_STRING = 278, - ICE_OBJECT = 279, - ICE_LOCAL_OBJECT = 280, - ICE_LOCAL = 281, - ICE_CONST = 282, - ICE_FALSE = 283, - ICE_TRUE = 284, - ICE_IDEMPOTENT = 285, - ICE_OPTIONAL = 286, - ICE_VALUE = 287, - ICE_IDENTIFIER = 288, - ICE_SCOPED_IDENTIFIER = 289, - ICE_STRING_LITERAL = 290, - ICE_INTEGER_LITERAL = 291, - ICE_FLOATING_POINT_LITERAL = 292, - ICE_IDENT_OP = 293, - ICE_KEYWORD_OP = 294, - ICE_OPTIONAL_OP = 295, - ICE_METADATA_OPEN = 296, - ICE_METADATA_CLOSE = 297, - ICE_GLOBAL_METADATA_OPEN = 298, - ICE_GLOBAL_METADATA_CLOSE = 299, - BAD_CHAR = 300 - }; -#endif +#include "Grammar.h" +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_ICE_MODULE = 3, /* ICE_MODULE */ + YYSYMBOL_ICE_CLASS = 4, /* ICE_CLASS */ + YYSYMBOL_ICE_INTERFACE = 5, /* ICE_INTERFACE */ + YYSYMBOL_ICE_EXCEPTION = 6, /* ICE_EXCEPTION */ + YYSYMBOL_ICE_STRUCT = 7, /* ICE_STRUCT */ + YYSYMBOL_ICE_SEQUENCE = 8, /* ICE_SEQUENCE */ + YYSYMBOL_ICE_DICTIONARY = 9, /* ICE_DICTIONARY */ + YYSYMBOL_ICE_ENUM = 10, /* ICE_ENUM */ + YYSYMBOL_ICE_OUT = 11, /* ICE_OUT */ + YYSYMBOL_ICE_EXTENDS = 12, /* ICE_EXTENDS */ + YYSYMBOL_ICE_IMPLEMENTS = 13, /* ICE_IMPLEMENTS */ + YYSYMBOL_ICE_THROWS = 14, /* ICE_THROWS */ + YYSYMBOL_ICE_VOID = 15, /* ICE_VOID */ + YYSYMBOL_ICE_BYTE = 16, /* ICE_BYTE */ + YYSYMBOL_ICE_BOOL = 17, /* ICE_BOOL */ + YYSYMBOL_ICE_SHORT = 18, /* ICE_SHORT */ + YYSYMBOL_ICE_INT = 19, /* ICE_INT */ + YYSYMBOL_ICE_LONG = 20, /* ICE_LONG */ + YYSYMBOL_ICE_FLOAT = 21, /* ICE_FLOAT */ + YYSYMBOL_ICE_DOUBLE = 22, /* ICE_DOUBLE */ + YYSYMBOL_ICE_STRING = 23, /* ICE_STRING */ + YYSYMBOL_ICE_OBJECT = 24, /* ICE_OBJECT */ + YYSYMBOL_ICE_LOCAL_OBJECT = 25, /* ICE_LOCAL_OBJECT */ + YYSYMBOL_ICE_LOCAL = 26, /* ICE_LOCAL */ + YYSYMBOL_ICE_CONST = 27, /* ICE_CONST */ + YYSYMBOL_ICE_FALSE = 28, /* ICE_FALSE */ + YYSYMBOL_ICE_TRUE = 29, /* ICE_TRUE */ + YYSYMBOL_ICE_IDEMPOTENT = 30, /* ICE_IDEMPOTENT */ + YYSYMBOL_ICE_TAG = 31, /* ICE_TAG */ + YYSYMBOL_ICE_OPTIONAL = 32, /* ICE_OPTIONAL */ + YYSYMBOL_ICE_VALUE = 33, /* ICE_VALUE */ + YYSYMBOL_ICE_STRING_LITERAL = 34, /* ICE_STRING_LITERAL */ + YYSYMBOL_ICE_INTEGER_LITERAL = 35, /* ICE_INTEGER_LITERAL */ + YYSYMBOL_ICE_FLOATING_POINT_LITERAL = 36, /* ICE_FLOATING_POINT_LITERAL */ + YYSYMBOL_ICE_IDENTIFIER = 37, /* ICE_IDENTIFIER */ + YYSYMBOL_ICE_SCOPED_IDENTIFIER = 38, /* ICE_SCOPED_IDENTIFIER */ + YYSYMBOL_ICE_METADATA_OPEN = 39, /* ICE_METADATA_OPEN */ + YYSYMBOL_ICE_METADATA_CLOSE = 40, /* ICE_METADATA_CLOSE */ + YYSYMBOL_ICE_GLOBAL_METADATA_OPEN = 41, /* ICE_GLOBAL_METADATA_OPEN */ + YYSYMBOL_ICE_GLOBAL_METADATA_IGNORE = 42, /* ICE_GLOBAL_METADATA_IGNORE */ + YYSYMBOL_ICE_GLOBAL_METADATA_CLOSE = 43, /* ICE_GLOBAL_METADATA_CLOSE */ + YYSYMBOL_ICE_IDENT_OPEN = 44, /* ICE_IDENT_OPEN */ + YYSYMBOL_ICE_KEYWORD_OPEN = 45, /* ICE_KEYWORD_OPEN */ + YYSYMBOL_ICE_TAG_OPEN = 46, /* ICE_TAG_OPEN */ + YYSYMBOL_ICE_OPTIONAL_OPEN = 47, /* ICE_OPTIONAL_OPEN */ + YYSYMBOL_BAD_CHAR = 48, /* BAD_CHAR */ + YYSYMBOL_49_ = 49, /* ';' */ + YYSYMBOL_50_ = 50, /* '{' */ + YYSYMBOL_51_ = 51, /* '}' */ + YYSYMBOL_52_ = 52, /* ')' */ + YYSYMBOL_53_ = 53, /* ':' */ + YYSYMBOL_54_ = 54, /* '=' */ + YYSYMBOL_55_ = 55, /* ',' */ + YYSYMBOL_56_ = 56, /* '<' */ + YYSYMBOL_57_ = 57, /* '>' */ + YYSYMBOL_58_ = 58, /* '*' */ + YYSYMBOL_YYACCEPT = 59, /* $accept */ + YYSYMBOL_start = 60, /* start */ + YYSYMBOL_opt_semicolon = 61, /* opt_semicolon */ + YYSYMBOL_global_meta_data = 62, /* global_meta_data */ + YYSYMBOL_meta_data = 63, /* meta_data */ + YYSYMBOL_definitions = 64, /* definitions */ + YYSYMBOL_definition = 65, /* definition */ + YYSYMBOL_66_1 = 66, /* $@1 */ + YYSYMBOL_67_2 = 67, /* $@2 */ + YYSYMBOL_68_3 = 68, /* $@3 */ + YYSYMBOL_69_4 = 69, /* $@4 */ + YYSYMBOL_70_5 = 70, /* $@5 */ + YYSYMBOL_71_6 = 71, /* $@6 */ + YYSYMBOL_72_7 = 72, /* $@7 */ + YYSYMBOL_73_8 = 73, /* $@8 */ + YYSYMBOL_74_9 = 74, /* $@9 */ + YYSYMBOL_75_10 = 75, /* $@10 */ + YYSYMBOL_76_11 = 76, /* $@11 */ + YYSYMBOL_77_12 = 77, /* $@12 */ + YYSYMBOL_78_13 = 78, /* $@13 */ + YYSYMBOL_module_def = 79, /* module_def */ + YYSYMBOL_80_14 = 80, /* @14 */ + YYSYMBOL_exception_id = 81, /* exception_id */ + YYSYMBOL_exception_decl = 82, /* exception_decl */ + YYSYMBOL_exception_def = 83, /* exception_def */ + YYSYMBOL_84_15 = 84, /* @15 */ + YYSYMBOL_exception_extends = 85, /* exception_extends */ + YYSYMBOL_exception_exports = 86, /* exception_exports */ + YYSYMBOL_type_id = 87, /* type_id */ + YYSYMBOL_tag = 88, /* tag */ + YYSYMBOL_optional = 89, /* optional */ + YYSYMBOL_tagged_type_id = 90, /* tagged_type_id */ + YYSYMBOL_exception_export = 91, /* exception_export */ + YYSYMBOL_struct_id = 92, /* struct_id */ + YYSYMBOL_struct_decl = 93, /* struct_decl */ + YYSYMBOL_struct_def = 94, /* struct_def */ + YYSYMBOL_95_16 = 95, /* @16 */ + YYSYMBOL_struct_exports = 96, /* struct_exports */ + YYSYMBOL_struct_export = 97, /* struct_export */ + YYSYMBOL_class_name = 98, /* class_name */ + YYSYMBOL_class_id = 99, /* class_id */ + YYSYMBOL_class_decl = 100, /* class_decl */ + YYSYMBOL_class_def = 101, /* class_def */ + YYSYMBOL_102_17 = 102, /* @17 */ + YYSYMBOL_class_extends = 103, /* class_extends */ + YYSYMBOL_extends = 104, /* extends */ + YYSYMBOL_implements = 105, /* implements */ + YYSYMBOL_class_exports = 106, /* class_exports */ + YYSYMBOL_data_member = 107, /* data_member */ + YYSYMBOL_struct_data_member = 108, /* struct_data_member */ + YYSYMBOL_return_type = 109, /* return_type */ + YYSYMBOL_operation_preamble = 110, /* operation_preamble */ + YYSYMBOL_operation = 111, /* operation */ + YYSYMBOL_112_18 = 112, /* @18 */ + YYSYMBOL_113_19 = 113, /* @19 */ + YYSYMBOL_class_export = 114, /* class_export */ + YYSYMBOL_interface_id = 115, /* interface_id */ + YYSYMBOL_interface_decl = 116, /* interface_decl */ + YYSYMBOL_interface_def = 117, /* interface_def */ + YYSYMBOL_118_20 = 118, /* @20 */ + YYSYMBOL_interface_list = 119, /* interface_list */ + YYSYMBOL_interface_extends = 120, /* interface_extends */ + YYSYMBOL_interface_exports = 121, /* interface_exports */ + YYSYMBOL_interface_export = 122, /* interface_export */ + YYSYMBOL_exception_list = 123, /* exception_list */ + YYSYMBOL_exception = 124, /* exception */ + YYSYMBOL_sequence_def = 125, /* sequence_def */ + YYSYMBOL_dictionary_def = 126, /* dictionary_def */ + YYSYMBOL_enum_id = 127, /* enum_id */ + YYSYMBOL_enum_def = 128, /* enum_def */ + YYSYMBOL_129_21 = 129, /* @21 */ + YYSYMBOL_130_22 = 130, /* @22 */ + YYSYMBOL_enumerator_list = 131, /* enumerator_list */ + YYSYMBOL_enumerator = 132, /* enumerator */ + YYSYMBOL_enumerator_initializer = 133, /* enumerator_initializer */ + YYSYMBOL_out_qualifier = 134, /* out_qualifier */ + YYSYMBOL_parameters = 135, /* parameters */ + YYSYMBOL_throws = 136, /* throws */ + YYSYMBOL_scoped_name = 137, /* scoped_name */ + YYSYMBOL_type = 138, /* type */ + YYSYMBOL_string_literal = 139, /* string_literal */ + YYSYMBOL_string_list = 140, /* string_list */ + YYSYMBOL_local_qualifier = 141, /* local_qualifier */ + YYSYMBOL_const_initializer = 142, /* const_initializer */ + YYSYMBOL_const_def = 143, /* const_def */ + YYSYMBOL_keyword = 144 /* keyword */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif +/* Unqualified %code blocks. */ +#line 58 "src/Slice/Grammar.y" -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int slice_parse (void *YYPARSE_PARAM); -#else -int slice_parse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int slice_parse (void); -#else -int slice_parse (); -#endif -#endif /* ! YYPARSE_PARAM */ -#endif /* !YY_SLICE_SRC_SLICE_GRAMMAR_HPP_INCLUDED */ +// Forward declaration of the lexing function generated by flex, so bison knows about it. +// This must match the definition of 'yylex' (or 'slice_lex') in the generated scanner. +int slice_lex(YYSTYPE* lvalp, YYLTYPE* llocp); -/* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 238 "src/Slice/Grammar.cpp" +#line 357 "src/Slice/Grammar.cpp" #ifdef short # undef short #endif -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif #endif -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; #else -typedef short int yytype_int8; +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 #endif -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; #else -typedef unsigned short int yytype_uint16; +typedef short yytype_uint8; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; #else -typedef short int yytype_int16; +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif #endif #ifndef YYSIZE_T @@ -276,16 +447,28 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_int16 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS @@ -299,32 +482,71 @@ typedef short int yytype_int16; # endif #endif + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END #endif -#if ! defined yyoverflow || YYERROR_VERBOSE + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -341,8 +563,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -354,8 +575,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -371,7 +592,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -379,41 +600,41 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - +#endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; + yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; + YYLTYPE yyls_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + + YYSIZEOF (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 @@ -422,16 +643,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) #endif @@ -441,57 +662,62 @@ union yyalloc # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ - YYSIZE_T yyi; \ + YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 11 +#define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 869 +#define YYLAST 967 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 55 +#define YYNTOKENS 59 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 86 /* YYNRULES -- Number of rules. */ -#define YYNRULES 225 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 326 +#define YYNRULES 235 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 345 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 303 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 300 -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 49, 54, 2, 51, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 46, - 52, 50, 53, 2, 2, 2, 2, 2, 2, 2, + 2, 52, 58, 2, 55, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 53, 49, + 56, 54, 57, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 47, 2, 48, 2, 2, 2, 2, + 2, 2, 2, 50, 2, 51, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -509,644 +735,578 @@ static const yytype_uint8 yytranslate[] = 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45 + 45, 46, 47, 48 }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 7, 8, 12, 16, 17, 18, - 22, 23, 28, 29, 30, 34, 35, 39, 41, 42, - 46, 47, 51, 53, 54, 58, 59, 63, 65, 66, - 70, 71, 75, 77, 78, 82, 83, 87, 89, 90, - 94, 96, 97, 101, 102, 106, 108, 111, 112, 119, - 122, 125, 128, 129, 137, 140, 141, 146, 150, 153, - 154, 157, 161, 165, 168, 170, 173, 175, 177, 180, - 183, 186, 187, 194, 199, 203, 206, 207, 209, 212, - 215, 220, 225, 227, 230, 231, 240, 243, 244, 247, - 248, 253, 257, 260, 261, 263, 267, 270, 272, 274, - 278, 281, 286, 289, 291, 294, 296, 298, 301, 305, - 308, 312, 313, 319, 320, 326, 328, 330, 333, 336, - 339, 340, 348, 352, 354, 356, 358, 361, 362, 367, - 371, 374, 375, 377, 381, 383, 385, 387, 395, 403, - 414, 425, 428, 431, 432, 439, 440, 447, 451, 453, - 455, 459, 461, 462, 464, 466, 468, 469, 470, 474, - 480, 485, 492, 496, 502, 505, 506, 508, 510, 512, - 514, 516, 518, 520, 522, 524, 526, 528, 531, 533, - 535, 537, 540, 543, 545, 549, 551, 553, 554, 556, - 558, 560, 562, 564, 566, 573, 579, 581, 583, 585, - 587, 589, 591, 593, 595, 597, 599, 601, 603, 605, - 607, 609, 611, 613, 615, 617, 619, 621, 623, 625, - 627, 629, 631, 633, 635, 637 +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = +{ + 0, 184, 184, 192, 195, 203, 207, 217, 221, 230, + 238, 247, 256, 255, 261, 260, 265, 270, 269, 275, + 274, 279, 284, 283, 289, 288, 293, 298, 297, 303, + 302, 307, 312, 311, 317, 316, 321, 326, 325, 330, + 335, 334, 340, 339, 344, 348, 358, 357, 390, 394, + 405, 416, 415, 442, 450, 459, 468, 471, 475, 483, + 496, 514, 605, 611, 622, 640, 730, 736, 747, 756, + 765, 778, 784, 788, 799, 810, 809, 851, 860, 863, + 867, 875, 881, 885, 896, 921, 1023, 1035, 1049, 1048, + 1088, 1122, 1131, 1134, 1142, 1146, 1155, 1164, 1167, 1171, + 1179, 1201, 1228, 1250, 1276, 1285, 1296, 1305, 1314, 1323, + 1332, 1342, 1356, 1362, 1368, 1374, 1384, 1408, 1433, 1457, + 1488, 1487, 1510, 1509, 1532, 1533, 1539, 1543, 1554, 1569, + 1568, 1603, 1638, 1673, 1678, 1688, 1692, 1701, 1710, 1713, + 1717, 1725, 1731, 1738, 1750, 1762, 1773, 1782, 1797, 1808, + 1825, 1829, 1841, 1840, 1873, 1872, 1891, 1897, 1905, 1917, + 1937, 1944, 1954, 1958, 1997, 2003, 2014, 2017, 2033, 2049, + 2061, 2073, 2084, 2100, 2104, 2113, 2116, 2124, 2128, 2132, + 2136, 2140, 2144, 2148, 2152, 2156, 2160, 2164, 2168, 2172, + 2191, 2232, 2238, 2246, 2253, 2265, 2271, 2282, 2291, 2300, + 2340, 2347, 2354, 2366, 2375, 2389, 2392, 2395, 2398, 2401, + 2404, 2407, 2410, 2413, 2416, 2419, 2422, 2425, 2428, 2431, + 2434, 2437, 2440, 2443, 2446, 2449, 2452, 2455, 2458, 2461, + 2464, 2467, 2470, 2473, 2476, 2479 }; +#endif -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 56, 0, -1, 60, -1, 46, -1, -1, 43, 136, - 44, -1, 41, 136, 42, -1, -1, -1, 58, 61, - 60, -1, -1, 59, 63, 62, 60, -1, -1, -1, - 77, 64, 57, -1, -1, 97, 65, 46, -1, 97, - -1, -1, 98, 66, 57, -1, -1, 112, 67, 46, - -1, 112, -1, -1, 113, 68, 57, -1, -1, 80, - 69, 46, -1, 80, -1, -1, 81, 70, 57, -1, - -1, 90, 71, 46, -1, 90, -1, -1, 91, 72, - 57, -1, -1, 121, 73, 46, -1, 121, -1, -1, - 122, 74, 46, -1, 122, -1, -1, 124, 75, 57, - -1, -1, 139, 76, 46, -1, 139, -1, 1, 46, - -1, -1, 3, 33, 78, 47, 60, 48, -1, 6, - 33, -1, 6, 140, -1, 137, 79, -1, -1, 137, - 79, 83, 82, 47, 84, 48, -1, 12, 133, -1, - -1, 59, 88, 46, 84, -1, 1, 46, 84, -1, - 59, 88, -1, -1, 134, 33, -1, 40, 36, 49, - -1, 40, 133, 49, -1, 40, 49, -1, 31, -1, - 86, 85, -1, 85, -1, 103, -1, 7, 33, -1, - 7, 140, -1, 137, 89, -1, -1, 137, 89, 92, - 47, 93, 48, -1, 59, 94, 46, 93, -1, 1, - 46, 93, -1, 59, 94, -1, -1, 104, -1, 4, - 33, -1, 4, 140, -1, 4, 38, 36, 49, -1, - 4, 38, 133, 49, -1, 95, -1, 137, 95, -1, - -1, 137, 96, 100, 101, 99, 47, 102, 48, -1, - 12, 133, -1, -1, 13, 115, -1, -1, 59, 110, - 46, 102, -1, 1, 46, 102, -1, 59, 110, -1, - -1, 87, -1, 87, 50, 138, -1, 134, 140, -1, - 134, -1, 85, -1, 85, 50, 138, -1, 86, 85, - -1, 86, 85, 50, 138, -1, 134, 140, -1, 134, - -1, 86, 134, -1, 134, -1, 15, -1, 105, 38, - -1, 30, 105, 38, -1, 105, 39, -1, 30, 105, - 39, -1, -1, 106, 131, 49, 108, 132, -1, -1, - 106, 1, 49, 109, 132, -1, 103, -1, 107, -1, - 5, 33, -1, 5, 140, -1, 137, 111, -1, -1, - 137, 111, 116, 114, 47, 117, 48, -1, 133, 51, - 115, -1, 133, -1, 24, -1, 32, -1, 12, 115, - -1, -1, 59, 118, 46, 117, -1, 1, 46, 117, - -1, 59, 118, -1, -1, 107, -1, 120, 51, 119, - -1, 120, -1, 133, -1, 140, -1, 137, 8, 52, - 59, 134, 53, 33, -1, 137, 8, 52, 59, 134, - 53, 140, -1, 137, 9, 52, 59, 134, 51, 59, - 134, 53, 33, -1, 137, 9, 52, 59, 134, 51, - 59, 134, 53, 140, -1, 10, 33, -1, 10, 140, - -1, -1, 137, 123, 125, 47, 127, 48, -1, -1, - 137, 10, 126, 47, 127, 48, -1, 128, 51, 127, - -1, 128, -1, 33, -1, 33, 50, 129, -1, 140, - -1, -1, 36, -1, 133, -1, 11, -1, -1, -1, - 130, 59, 87, -1, 131, 51, 130, 59, 87, -1, - 130, 59, 134, 140, -1, 131, 51, 130, 59, 134, - 140, -1, 130, 59, 134, -1, 131, 51, 130, 59, - 134, -1, 14, 119, -1, -1, 33, -1, 34, -1, - 16, -1, 17, -1, 18, -1, 19, -1, 20, -1, - 21, -1, 22, -1, 23, -1, 24, -1, 24, 54, - -1, 25, -1, 32, -1, 133, -1, 133, 54, -1, - 35, 135, -1, 35, -1, 136, 51, 135, -1, 135, - -1, 26, -1, -1, 36, -1, 37, -1, 133, -1, - 35, -1, 28, -1, 29, -1, 27, 59, 134, 33, - 50, 138, -1, 27, 59, 134, 50, 138, -1, 3, - -1, 4, -1, 5, -1, 6, -1, 7, -1, 8, - -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, - -1, 14, -1, 15, -1, 16, -1, 17, -1, 18, - -1, 19, -1, 20, -1, 21, -1, 22, -1, 23, - -1, 24, -1, 25, -1, 26, -1, 27, -1, 28, - -1, 29, -1, 30, -1, 31, -1, 32, -1 -}; +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 115, 115, 123, 127, 134, 143, 148, 157, 156, - 166, 165, 176, 184, 183, 189, 188, 193, 198, 197, - 203, 202, 207, 212, 211, 217, 216, 221, 226, 225, - 231, 230, 235, 240, 239, 245, 244, 249, 254, 253, - 258, 263, 262, 268, 267, 272, 276, 286, 285, 319, - 323, 334, 345, 344, 371, 380, 388, 397, 400, 405, - 412, 425, 445, 538, 546, 559, 567, 582, 588, 592, - 603, 614, 613, 655, 664, 667, 672, 679, 685, 689, - 700, 725, 827, 839, 853, 852, 892, 927, 935, 940, - 948, 957, 960, 965, 972, 994, 1021, 1043, 1069, 1078, - 1089, 1098, 1107, 1117, 1131, 1137, 1145, 1157, 1181, 1206, - 1230, 1261, 1260, 1283, 1282, 1305, 1306, 1312, 1316, 1327, - 1342, 1341, 1376, 1411, 1446, 1451, 1461, 1466, 1474, 1483, - 1486, 1491, 1498, 1504, 1511, 1523, 1535, 1546, 1555, 1570, - 1581, 1598, 1602, 1614, 1613, 1646, 1645, 1664, 1670, 1678, - 1690, 1710, 1718, 1727, 1731, 1770, 1777, 1788, 1790, 1806, - 1822, 1834, 1846, 1857, 1873, 1878, 1886, 1889, 1897, 1901, - 1905, 1909, 1913, 1917, 1921, 1925, 1929, 1933, 1937, 1941, - 1945, 1964, 2005, 2011, 2019, 2026, 2038, 2045, 2055, 2068, - 2081, 2128, 2139, 2150, 2166, 2175, 2189, 2192, 2195, 2198, - 2201, 2204, 2207, 2210, 2213, 2216, 2219, 2222, 2225, 2228, - 2231, 2234, 2237, 2240, 2243, 2246, 2249, 2252, 2255, 2258, - 2261, 2264, 2267, 2270, 2273, 2276 -}; -#endif +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; -#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "ICE_MODULE", "ICE_CLASS", - "ICE_INTERFACE", "ICE_EXCEPTION", "ICE_STRUCT", "ICE_SEQUENCE", - "ICE_DICTIONARY", "ICE_ENUM", "ICE_OUT", "ICE_EXTENDS", "ICE_IMPLEMENTS", - "ICE_THROWS", "ICE_VOID", "ICE_BYTE", "ICE_BOOL", "ICE_SHORT", "ICE_INT", - "ICE_LONG", "ICE_FLOAT", "ICE_DOUBLE", "ICE_STRING", "ICE_OBJECT", - "ICE_LOCAL_OBJECT", "ICE_LOCAL", "ICE_CONST", "ICE_FALSE", "ICE_TRUE", - "ICE_IDEMPOTENT", "ICE_OPTIONAL", "ICE_VALUE", "ICE_IDENTIFIER", - "ICE_SCOPED_IDENTIFIER", "ICE_STRING_LITERAL", "ICE_INTEGER_LITERAL", - "ICE_FLOATING_POINT_LITERAL", "ICE_IDENT_OP", "ICE_KEYWORD_OP", - "ICE_OPTIONAL_OP", "ICE_METADATA_OPEN", "ICE_METADATA_CLOSE", - "ICE_GLOBAL_METADATA_OPEN", "ICE_GLOBAL_METADATA_CLOSE", "BAD_CHAR", - "';'", "'{'", "'}'", "')'", "'='", "','", "'<'", "'>'", "'*'", "$accept", - "start", "opt_semicolon", "global_meta_data", "meta_data", "definitions", - "$@1", "$@2", "definition", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", - "$@9", "$@10", "$@11", "$@12", "$@13", "$@14", "$@15", "module_def", - "@16", "exception_id", "exception_decl", "exception_def", "@17", - "exception_extends", "exception_exports", "type_id", "optional", - "optional_type_id", "exception_export", "struct_id", "struct_decl", - "struct_def", "@18", "struct_exports", "struct_export", "class_name", - "class_id", "class_decl", "class_def", "@19", "class_extends", - "implements", "class_exports", "data_member", "struct_data_member", - "return_type", "operation_preamble", "operation", "@20", "@21", - "class_export", "interface_id", "interface_decl", "interface_def", "@22", - "interface_list", "interface_extends", "interface_exports", - "interface_export", "exception_list", "exception", "sequence_def", - "dictionary_def", "enum_id", "enum_def", "@23", "@24", "enumerator_list", - "enumerator", "enumerator_initializer", "out_qualifier", "parameters", - "throws", "scoped_name", "type", "string_literal", "string_list", - "local_qualifier", "const_initializer", "const_def", "keyword", YY_NULL + "\"end of file\"", "error", "\"invalid token\"", "ICE_MODULE", + "ICE_CLASS", "ICE_INTERFACE", "ICE_EXCEPTION", "ICE_STRUCT", + "ICE_SEQUENCE", "ICE_DICTIONARY", "ICE_ENUM", "ICE_OUT", "ICE_EXTENDS", + "ICE_IMPLEMENTS", "ICE_THROWS", "ICE_VOID", "ICE_BYTE", "ICE_BOOL", + "ICE_SHORT", "ICE_INT", "ICE_LONG", "ICE_FLOAT", "ICE_DOUBLE", + "ICE_STRING", "ICE_OBJECT", "ICE_LOCAL_OBJECT", "ICE_LOCAL", "ICE_CONST", + "ICE_FALSE", "ICE_TRUE", "ICE_IDEMPOTENT", "ICE_TAG", "ICE_OPTIONAL", + "ICE_VALUE", "ICE_STRING_LITERAL", "ICE_INTEGER_LITERAL", + "ICE_FLOATING_POINT_LITERAL", "ICE_IDENTIFIER", "ICE_SCOPED_IDENTIFIER", + "ICE_METADATA_OPEN", "ICE_METADATA_CLOSE", "ICE_GLOBAL_METADATA_OPEN", + "ICE_GLOBAL_METADATA_IGNORE", "ICE_GLOBAL_METADATA_CLOSE", + "ICE_IDENT_OPEN", "ICE_KEYWORD_OPEN", "ICE_TAG_OPEN", + "ICE_OPTIONAL_OPEN", "BAD_CHAR", "';'", "'{'", "'}'", "')'", "':'", + "'='", "','", "'<'", "'>'", "'*'", "$accept", "start", "opt_semicolon", + "global_meta_data", "meta_data", "definitions", "definition", "$@1", + "$@2", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "$@10", "$@11", + "$@12", "$@13", "module_def", "@14", "exception_id", "exception_decl", + "exception_def", "@15", "exception_extends", "exception_exports", + "type_id", "tag", "optional", "tagged_type_id", "exception_export", + "struct_id", "struct_decl", "struct_def", "@16", "struct_exports", + "struct_export", "class_name", "class_id", "class_decl", "class_def", + "@17", "class_extends", "extends", "implements", "class_exports", + "data_member", "struct_data_member", "return_type", "operation_preamble", + "operation", "@18", "@19", "class_export", "interface_id", + "interface_decl", "interface_def", "@20", "interface_list", + "interface_extends", "interface_exports", "interface_export", + "exception_list", "exception", "sequence_def", "dictionary_def", + "enum_id", "enum_def", "@21", "@22", "enumerator_list", "enumerator", + "enumerator_initializer", "out_qualifier", "parameters", "throws", + "scoped_name", "type", "string_literal", "string_list", + "local_qualifier", "const_initializer", "const_def", "keyword", YY_NULLPTR }; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} #endif -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 59, 123, 125, 41, - 61, 44, 60, 62, 42 -}; -# endif +#define YYPACT_NINF (-297) -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 55, 56, 57, 57, 58, 59, 59, 61, 60, - 62, 60, 60, 64, 63, 65, 63, 63, 66, 63, - 67, 63, 63, 68, 63, 69, 63, 63, 70, 63, - 71, 63, 63, 72, 63, 73, 63, 63, 74, 63, - 63, 75, 63, 76, 63, 63, 63, 78, 77, 79, - 79, 80, 82, 81, 83, 83, 84, 84, 84, 84, - 85, 86, 86, 86, 86, 87, 87, 88, 89, 89, - 90, 92, 91, 93, 93, 93, 93, 94, 95, 95, - 96, 96, 96, 97, 99, 98, 100, 100, 101, 101, - 102, 102, 102, 102, 103, 103, 103, 103, 104, 104, - 104, 104, 104, 104, 105, 105, 105, 106, 106, 106, - 106, 108, 107, 109, 107, 110, 110, 111, 111, 112, - 114, 113, 115, 115, 115, 115, 116, 116, 117, 117, - 117, 117, 118, 119, 119, 120, 120, 121, 121, 122, - 122, 123, 123, 125, 124, 126, 124, 127, 127, 128, - 128, 128, 128, 129, 129, 130, 130, 131, 131, 131, - 131, 131, 131, 131, 132, 132, 133, 133, 134, 134, - 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, - 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, - 138, 138, 138, 138, 139, 139, 140, 140, 140, 140, - 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, - 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, - 140, 140, 140, 140, 140, 140 -}; +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 0, 3, 3, 0, 0, 3, - 0, 4, 0, 0, 3, 0, 3, 1, 0, 3, - 0, 3, 1, 0, 3, 0, 3, 1, 0, 3, - 0, 3, 1, 0, 3, 0, 3, 1, 0, 3, - 1, 0, 3, 0, 3, 1, 2, 0, 6, 2, - 2, 2, 0, 7, 2, 0, 4, 3, 2, 0, - 2, 3, 3, 2, 1, 2, 1, 1, 2, 2, - 2, 0, 6, 4, 3, 2, 0, 1, 2, 2, - 4, 4, 1, 2, 0, 8, 2, 0, 2, 0, - 4, 3, 2, 0, 1, 3, 2, 1, 1, 3, - 2, 4, 2, 1, 2, 1, 1, 2, 3, 2, - 3, 0, 5, 0, 5, 1, 1, 2, 2, 2, - 0, 7, 3, 1, 1, 1, 2, 0, 4, 3, - 2, 0, 1, 3, 1, 1, 1, 7, 7, 10, - 10, 2, 2, 0, 6, 0, 6, 3, 1, 1, - 3, 1, 0, 1, 1, 1, 0, 0, 3, 5, - 4, 6, 3, 5, 2, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, - 1, 2, 2, 1, 3, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 6, 5, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1 +#define YYTABLE_NINF (-197) + +#define yytable_value_is_error(Yyn) \ + 0 + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + -297, 37, 19, -297, 11, 11, 11, -297, 88, 11, + -297, -4, 28, 45, 18, 35, -297, 42, -297, -297, + 54, -297, 56, -297, 61, -297, 69, -297, 72, 77, + -297, 231, 94, -297, -297, 11, -297, -297, -297, -297, + 247, 101, 102, 101, 104, 101, 106, 101, 110, 101, + 125, 130, 101, 509, 587, 622, 657, 96, 124, 692, + 0, 131, 12, 6, 16, -297, 136, -297, 137, -297, + -297, -297, -297, -297, -297, -297, -297, 128, -297, -297, + -297, -297, 140, -10, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, 82, + -297, -297, -297, -297, -297, -297, -297, 42, 42, -297, + 139, -297, -297, -297, -297, 5, 149, 182, 5, 92, + -297, 150, -297, -297, -297, -297, 147, 103, 153, 155, + 247, 247, 727, 159, -297, 378, 92, -297, -297, -297, + -297, -297, 156, 162, 727, 60, 103, -297, -297, -297, + -297, -297, -297, -297, -297, -297, 158, 163, 165, 166, + 168, -297, 417, 167, 920, 169, -297, 174, 92, 145, + 178, -297, -297, 762, 42, 107, -297, 727, 176, 920, + 179, 378, -297, -297, -5, 38, 177, 247, 247, 183, + -297, 797, -297, 339, -297, 184, 855, 191, -297, -297, + -297, 247, -297, -297, -297, -297, 417, -297, 247, 247, + 189, 195, -297, 797, -297, -297, 194, -297, 196, 197, + -297, 198, 103, 193, 216, 200, 378, -297, -297, 206, + 855, 205, 145, -297, 888, 247, 247, 64, 298, -297, + 208, -297, -297, 202, -297, -297, -297, 103, 417, -297, + -297, -297, -297, -297, -297, 103, 103, -297, 339, 247, + 247, -297, -297, 212, 466, -297, -297, 83, -297, -297, + -297, -297, 210, -297, 42, 30, 145, 832, -297, -297, + -297, -297, -297, 216, 216, 339, -297, -297, -297, 920, + -297, 262, -297, -297, -297, -297, 260, -297, 797, 260, + 42, 551, -297, -297, -297, 920, -297, 220, -297, -297, + -297, 797, 551, -297, -297 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { - 7, 0, 0, 0, 8, 0, 2, 183, 185, 0, - 0, 1, 7, 0, 0, 186, 7, 10, 13, 27, - 28, 32, 33, 17, 18, 22, 23, 37, 40, 41, - 0, 45, 182, 6, 0, 5, 9, 46, 47, 0, - 7, 4, 0, 4, 0, 4, 0, 4, 0, 4, - 0, 0, 4, 0, 0, 0, 0, 0, 0, 145, - 51, 70, 83, 87, 119, 143, 0, 184, 0, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 178, 179, - 166, 167, 180, 0, 11, 3, 14, 26, 29, 31, - 34, 16, 19, 21, 24, 36, 39, 42, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 11, 0, 8, 1, 0, 0, 0, 9, 0, 192, + 194, 0, 0, 0, 0, 0, 195, 8, 10, 12, + 26, 27, 31, 32, 16, 17, 21, 22, 36, 39, + 40, 0, 44, 191, 7, 0, 5, 6, 45, 46, + 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, + 0, 0, 4, 0, 0, 0, 0, 0, 0, 154, + 50, 74, 87, 91, 128, 152, 0, 193, 0, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 187, 188, + 175, 176, 189, 0, 3, 13, 25, 28, 30, 33, + 15, 18, 20, 23, 35, 38, 41, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 78, 0, - 79, 117, 118, 49, 50, 68, 69, 7, 7, 141, - 0, 142, 0, 52, 0, 0, 89, 0, 120, 0, - 44, 7, 177, 181, 0, 0, 0, 0, 0, 0, - 152, 54, 0, 0, 86, 0, 84, 124, 125, 126, - 123, 0, 152, 0, 0, 192, 193, 191, 188, 189, - 190, 195, 80, 81, 0, 0, 149, 0, 148, 151, - 0, 0, 0, 0, 88, 0, 0, 0, 0, 48, - 194, 0, 7, 0, 146, 152, 0, 0, 0, 0, - 64, 0, 98, 0, 75, 77, 103, 72, 0, 122, - 0, 0, 0, 144, 137, 138, 0, 153, 150, 154, - 147, 0, 66, 0, 94, 58, 67, 97, 53, 74, - 0, 63, 0, 0, 100, 0, 0, 60, 102, 0, - 0, 0, 0, 106, 0, 0, 0, 0, 132, 130, - 105, 121, 0, 57, 65, 0, 0, 96, 61, 62, - 99, 0, 73, 0, 0, 115, 116, 92, 97, 85, - 129, 0, 104, 107, 109, 0, 155, 7, 0, 0, - 0, 95, 56, 101, 91, 104, 0, 108, 110, 113, - 0, 111, 156, 128, 139, 140, 90, 165, 158, 162, - 165, 7, 0, 114, 160, 112, 0, 164, 134, 135, - 136, 159, 163, 0, 161, 133 + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 82, 0, + 83, 126, 127, 48, 49, 72, 73, 8, 8, 150, + 0, 151, 92, 93, 51, 0, 0, 95, 0, 0, + 129, 0, 43, 11, 186, 190, 0, 0, 0, 0, + 0, 0, 161, 0, 53, 0, 0, 88, 90, 133, + 134, 135, 132, 0, 161, 8, 0, 201, 202, 200, + 197, 198, 199, 204, 84, 85, 0, 0, 158, 0, + 157, 160, 0, 0, 0, 0, 94, 0, 0, 0, + 0, 47, 203, 0, 8, 0, 155, 161, 0, 0, + 0, 0, 63, 67, 0, 0, 104, 0, 0, 79, + 81, 111, 76, 0, 131, 0, 0, 0, 153, 146, + 147, 0, 162, 159, 163, 156, 0, 70, 0, 0, + 100, 57, 71, 103, 52, 78, 0, 62, 0, 0, + 66, 0, 0, 106, 0, 108, 0, 59, 110, 0, + 0, 0, 0, 115, 0, 0, 0, 0, 0, 141, + 139, 114, 130, 0, 56, 68, 69, 0, 0, 102, + 60, 61, 64, 65, 105, 0, 0, 77, 0, 0, + 0, 124, 125, 98, 103, 89, 138, 0, 112, 113, + 116, 118, 0, 164, 8, 0, 0, 0, 101, 55, + 107, 109, 97, 112, 113, 0, 117, 119, 122, 0, + 120, 165, 137, 148, 149, 96, 174, 167, 171, 174, + 8, 0, 123, 169, 121, 0, 173, 143, 144, 145, + 168, 172, 0, 170, 142 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 3, 86, 4, 5, 6, 12, 40, 17, 41, - 46, 47, 48, 49, 42, 43, 44, 45, 50, 51, - 52, 66, 18, 68, 60, 19, 20, 162, 143, 208, - 232, 233, 234, 235, 61, 21, 22, 144, 193, 214, - 62, 63, 23, 24, 195, 146, 166, 251, 236, 215, - 256, 257, 258, 310, 307, 277, 64, 25, 26, 171, - 169, 148, 222, 259, 317, 318, 27, 28, 65, 29, - 149, 140, 187, 188, 228, 287, 288, 313, 82, 245, - 8, 9, 30, 181, 31, 189 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -278 -static const yytype_int16 yypact[] = +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = { - 13, 1, 1, 42, -278, 156, -278, 1, -278, -7, - -3, -278, 10, 4, 33, -278, 6, -278, -278, 28, - -278, 30, -278, 32, -278, 39, -278, 52, 68, -278, - 200, 77, -278, -278, 1, -278, -278, -278, -278, 835, - 10, 84, 85, 84, 87, 84, 89, 84, 92, 84, - 93, 94, 84, 455, 523, 554, 585, 80, 96, 616, - 12, 35, 16, 76, 14, -278, 100, -278, 95, -278, - -278, -278, -278, -278, -278, -278, -278, 82, -278, -278, - -278, -278, 101, -12, -278, -278, -278, -278, -278, -278, - -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, - -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, - -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, - -278, -278, -278, -278, -278, -278, -278, -278, -278, 59, - -278, -278, -278, -278, -278, -278, -278, 6, 6, -278, - 109, -278, 37, -278, 120, 37, 155, 57, -278, 123, - -278, 36, -278, -278, 121, 116, 126, 127, 835, 835, - 647, -278, 125, 338, -278, 57, -278, -278, -278, -278, - 128, 130, 647, 132, 116, -278, -278, -278, -278, -278, - -278, -278, -278, -278, 135, 134, 139, 143, 146, -278, - 372, 153, 810, 163, -278, 131, 57, 86, 164, -278, - -278, 678, 6, 63, -278, 647, 167, 810, 166, 338, - -278, 31, 168, 835, 171, -278, 709, -278, 304, -278, - 173, 759, 174, -278, -278, -278, 835, -278, -278, -278, - -278, 372, -278, 835, 175, 177, -278, 709, -278, -278, - 152, -278, 178, 116, 176, 191, 338, -278, -278, 182, - 759, 181, 86, -278, 785, 835, 74, 267, -278, 186, - -278, -278, 180, -278, -278, 116, 372, -278, -278, -278, - -278, 116, -278, 304, 835, -278, -278, 188, 418, -278, - -278, 90, -278, -278, -278, 189, -278, 6, -17, 86, - 740, -278, -278, -278, -278, 191, 304, -278, -278, -278, - 810, -278, 224, -278, -278, -278, -278, 223, -278, 709, - 223, 6, 491, -278, -278, -278, 810, -278, 190, -278, - -278, -278, 709, 491, -278, -278 + -297, -297, 161, -297, -2, 134, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -297, -297, -297, + -297, -297, -297, -297, -297, -297, -297, -214, -183, -186, + -180, -296, -297, -297, -297, -297, -297, -202, -297, -297, + -297, -297, -297, -297, -297, 70, -297, -247, 23, -297, + 13, -297, 29, -297, -297, -297, -297, -297, -297, -297, + -135, -297, -249, -297, -64, -297, -297, -297, -297, -297, + -297, -297, -158, -297, -297, -33, -297, -39, -128, -38, + 17, 142, -297, -173, -297, -49 }; -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { - -278, -278, 151, -278, -16, -10, -278, -278, -278, -278, - -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, - -278, -278, -278, -278, -278, -278, -278, -278, -278, -209, - -188, -181, -277, -278, -278, -278, -278, -278, -194, -278, - -278, -278, -278, -278, -278, -278, -278, -253, -11, -278, - -9, -278, -8, -278, -278, -278, -278, -278, -278, -278, - -134, -278, -234, -278, -79, -278, -278, -278, -278, -278, - -278, -278, -156, -278, -278, -56, -278, -63, -128, -34, - 26, 246, -278, -171, -278, -47 + 0, 1, 85, 7, 194, 2, 18, 41, 46, 47, + 48, 49, 42, 43, 44, 45, 50, 51, 52, 66, + 19, 68, 60, 20, 21, 163, 144, 210, 237, 238, + 239, 240, 241, 61, 22, 23, 146, 195, 219, 62, + 63, 24, 25, 197, 147, 145, 167, 261, 242, 220, + 267, 268, 269, 329, 326, 293, 64, 26, 27, 173, + 171, 150, 227, 270, 336, 337, 28, 29, 65, 30, + 151, 140, 189, 190, 233, 304, 305, 332, 82, 254, + 10, 11, 31, 183, 32, 191 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -188 static const yytype_int16 yytable[] = { - 39, 157, 36, 200, 212, 83, 130, 132, 134, 136, - -12, 213, 141, -12, 161, 239, 198, 164, 280, 170, - 294, 154, 263, 308, 142, 244, 147, 180, -82, -82, - 84, 194, 301, 32, 302, 33, 7, 170, 155, 321, - 255, 35, 11, 306, 34, 264, 180, 1, 34, 230, - 37, 1, 272, 2, 1, 303, 2, 292, -12, -55, - 67, -127, 219, -82, 80, 81, 38, 240, 170, 274, - 80, 81, 270, 255, -25, 229, -30, 1, -15, 2, - 241, 167, -71, 242, -12, -20, 264, 220, 145, 168, - 80, 81, 80, 81, 291, 156, 80, 81, -35, 227, - 293, -7, -7, -7, -7, -7, -7, -7, -7, -7, - -7, -7, 283, 284, -38, 180, -7, -7, -7, -7, - -7, 158, 159, -43, 184, 185, -7, 1, 297, 298, - 85, 87, 137, 89, -131, 91, 152, 180, 93, 95, - 96, 173, 151, 180, 175, 176, 150, 192, 138, 80, - 81, 177, 178, 179, 225, 153, 160, 13, 216, 14, - -187, -187, -187, -187, -187, -187, -187, 163, 165, 248, - 172, 174, 190, 237, 207, 182, 183, 197, 218, 196, - 199, 221, 15, 16, 319, 202, 226, 260, 201, 203, - 267, 204, 262, 192, 88, 319, 90, 205, 92, 209, - 94, 268, 250, 97, 53, 54, 55, 56, 57, 58, - 59, 217, 223, 231, 238, 207, 278, 246, 243, 252, - 260, 282, 261, 266, 247, 265, 271, 269, 273, 279, - 192, 267, 289, 290, 296, 286, 221, 312, 299, 275, - 295, 323, 276, 305, 325, 281, 311, 315, 10, 0, - 207, 0, 0, 0, 0, 0, 0, 250, 0, 0, - 0, 0, 314, 0, 0, 320, 309, 0, 285, 0, - 0, 300, 0, 221, 0, 324, 320, 0, 286, 0, - 250, 0, 322, -156, -156, -156, -156, -156, -156, -156, - -156, -156, -156, 0, 0, 316, 0, 0, -156, -156, - -156, -156, 0, 0, 0, 249, 0, -156, -156, 0, - 0, 0, 0, 0, 0, 0, -157, 0, -157, -7, - -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, - 0, 0, 0, 0, -7, -7, -7, -7, -7, 191, - 0, 0, 0, 0, -7, 1, 0, 0, 0, 0, - 0, 0, -93, 0, -7, -7, -7, -7, -7, -7, - -7, -7, -7, -7, 0, 0, 0, 0, 0, -7, - -7, -7, -7, 206, 0, 0, 0, 0, -7, 1, - 0, 0, 0, 0, 0, 0, -76, 0, -7, -7, - -7, -7, -7, -7, -7, -7, -7, -7, 0, 0, - 0, 0, 0, -7, -7, -7, -7, 0, 0, 0, - 0, 0, -7, 1, 0, 0, 0, 0, 0, 0, - -59, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 8, 159, 83, 202, 130, 132, 134, 136, 217, 245, + 141, 216, 142, 296, 218, 40, 200, 164, 142, -2, + 168, 172, 274, 327, -86, -86, 33, 156, 142, 182, + 246, 196, 80, 81, 253, 255, 34, 3, 172, 340, + 265, 312, 80, 81, 157, 9, 266, 247, 182, 235, + -54, 35, 67, 143, 287, 275, 276, 322, 4, 143, + 5, 6, -86, 224, 309, -86, -136, 38, 325, 143, + 172, 36, 39, 249, 289, 80, 81, 234, 265, 284, + 290, 4, 320, 35, 266, 321, 248, 251, 37, 14, + 250, 15, -196, -196, -196, -196, -196, -196, -196, 4, + 35, 5, 6, -24, 308, -29, 275, 276, 300, 301, + -14, 201, 310, 311, 16, 17, 169, 158, -19, 80, + 81, -34, 186, 187, 182, 170, -37, 316, 317, 80, + 81, 177, 178, 148, 149, 160, 161, 179, 180, 181, + 80, 81, 232, -42, 80, 81, 225, 12, 13, 182, + 84, 86, 137, 88, 230, 90, 221, 182, 182, 92, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, 243, 258, 8, 94, -8, -8, -8, -8, 95, + 138, -75, -8, -8, 4, 152, 154, 153, 271, 162, + 209, -8, -8, 273, 279, 166, -140, 226, 155, 165, + 174, 176, 231, 338, 87, 184, 89, 185, 91, 192, + 93, 198, 199, 96, 338, 203, 211, 206, 204, 205, + 222, 260, 294, 207, 223, 236, 271, 298, 299, 228, + 244, 252, 256, 262, 209, 53, 54, 55, 56, 57, + 58, 59, 272, 277, 278, 279, 280, 285, 281, 282, + 283, 313, 314, 257, 286, 288, 295, 306, 324, 307, + 226, 315, 318, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 303, 331, 342, 209, 297, 344, 333, + 79, 328, 339, 291, 80, 81, 260, 175, 330, 292, + 334, 0, 343, 339, 0, 0, 0, 341, 0, 302, + 0, 0, 319, 0, 226, 0, 0, 0, 0, 303, + 0, 0, 0, 260, -165, -165, -165, -165, -165, -165, + -165, -165, -165, -165, 0, 0, 0, 0, 335, -165, + -165, -165, 0, 0, 0, -165, -165, -165, 0, 0, + 259, 0, 0, 0, -165, -165, 0, 0, 0, 0, + -166, 0, 0, -166, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, 0, 0, 0, 0, -8, + -8, -8, -8, 0, 0, 0, -8, -8, 4, 193, + 0, 0, 0, 0, 0, -8, -8, 0, 0, 0, + -99, 0, 0, 0, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, 0, 0, 0, 0, 0, -8, + -8, -8, 0, 0, 0, -8, -8, 4, 208, 0, + 0, 0, 0, 0, -8, -8, 0, 0, 0, -80, + 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, 0, 0, 0, 0, 0, -8, -8, + -8, 0, 0, 0, -8, -8, 4, 0, 0, 0, + 0, 0, 0, -8, -8, 0, 0, 0, -58, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 0, 0, 0, 257, 0, 0, 0, 0, 0, 0, + -114, -114, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 0, 0, 0, 128, 0, 0, 0, + 0, 0, 0, 129, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 0, 0, 0, 80, 81, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 247, 0, 0, 0, 0, -105, -105, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 0, - 0, 0, 0, 129, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 80, 81, 98, 99, 100, 101, + 127, 0, 0, 0, 131, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 131, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 133, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 135, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 139, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 186, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 122, 123, 124, 125, 126, 127, 0, 0, 0, 133, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 224, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 247, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 304, 253, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 0, 0, 0, 0, 254, - 210, 79, 80, 81, 0, 0, 0, 0, 0, 211, - 253, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 0, 0, 0, 0, 0, 210, 79, 80, 81, - 0, 0, 0, 0, 0, 211, 69, 70, 71, 72, + 127, 0, 0, 0, 135, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 0, 0, 0, 139, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 0, 0, 0, 188, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 0, 0, 0, 229, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 0, 0, 0, 257, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 0, 0, 0, 323, + 263, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 0, 0, 0, 0, 264, 212, 213, 79, 0, + 0, 0, 80, 81, 0, 0, 0, 0, 0, 0, + 0, 214, 215, 263, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 0, 0, 0, 0, 0, 212, + 213, 79, 0, 0, 0, 80, 81, 0, 0, 0, + 0, 0, 0, 0, 214, 215, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, 0, 0, 0, - 0, 210, 79, 80, 81, 0, 0, 0, 0, 0, - 211, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 0, 0, 0, 0, 0, 0, 79, 80, 81 + 0, 212, 213, 79, 0, 0, 0, 80, 81, 0, + 0, 0, 0, 0, 0, 0, 214, 215 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-278))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { - 16, 129, 12, 174, 192, 39, 53, 54, 55, 56, - 0, 192, 59, 0, 142, 209, 172, 145, 252, 147, - 273, 33, 231, 300, 12, 213, 12, 155, 12, 13, - 40, 165, 49, 7, 51, 42, 35, 165, 50, 316, - 221, 44, 0, 296, 51, 233, 174, 41, 51, 205, - 46, 41, 246, 43, 41, 289, 43, 266, 48, 47, - 34, 47, 196, 47, 33, 34, 33, 36, 196, 250, - 33, 34, 243, 254, 46, 203, 46, 41, 46, 43, - 49, 24, 47, 211, 48, 46, 274, 1, 12, 32, - 33, 34, 33, 34, 265, 36, 33, 34, 46, 36, - 271, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 38, 39, 46, 243, 30, 31, 32, 33, - 34, 137, 138, 46, 158, 159, 40, 41, 38, 39, - 46, 46, 52, 46, 48, 46, 54, 265, 46, 46, - 46, 151, 47, 271, 28, 29, 46, 163, 52, 33, - 34, 35, 36, 37, 201, 54, 47, 1, 192, 3, - 4, 5, 6, 7, 8, 9, 10, 47, 13, 216, - 47, 50, 47, 207, 190, 49, 49, 47, 47, 51, - 48, 197, 26, 27, 312, 51, 202, 221, 53, 50, - 237, 48, 226, 209, 43, 323, 45, 51, 47, 46, - 49, 49, 218, 52, 4, 5, 6, 7, 8, 9, - 10, 48, 48, 46, 48, 231, 250, 46, 50, 46, - 254, 255, 48, 46, 33, 50, 50, 49, 46, 48, - 246, 278, 46, 53, 46, 11, 252, 14, 49, 250, - 274, 51, 250, 290, 323, 254, 302, 310, 2, -1, - 266, -1, -1, -1, -1, -1, -1, 273, -1, -1, - -1, -1, 309, -1, -1, 312, 300, -1, 1, -1, - -1, 287, -1, 289, -1, 322, 323, -1, 11, -1, - 296, -1, 316, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, -1, -1, 311, -1, -1, 31, 32, - 33, 34, -1, -1, -1, 1, -1, 40, 41, -1, - -1, -1, -1, -1, -1, -1, 49, -1, 51, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - -1, -1, -1, -1, 30, 31, 32, 33, 34, 1, - -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, - -1, -1, 48, -1, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, -1, -1, -1, -1, -1, 31, - 32, 33, 34, 1, -1, -1, -1, -1, 40, 41, - -1, -1, -1, -1, -1, -1, 48, -1, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, - -1, -1, -1, 31, 32, 33, 34, -1, -1, -1, - -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, - 48, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, -1, -1, -1, -1, 38, 39, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, - -1, -1, -1, 38, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 2, 129, 40, 176, 53, 54, 55, 56, 194, 211, + 59, 194, 12, 262, 194, 17, 174, 145, 12, 0, + 148, 149, 236, 319, 12, 13, 9, 37, 12, 157, + 35, 166, 37, 38, 217, 218, 40, 0, 166, 335, + 226, 288, 37, 38, 54, 34, 226, 52, 176, 207, + 50, 55, 35, 53, 256, 238, 239, 306, 39, 53, + 41, 42, 50, 198, 278, 53, 50, 49, 315, 53, + 198, 43, 37, 35, 260, 37, 38, 205, 264, 252, + 260, 39, 52, 55, 264, 55, 214, 215, 43, 1, + 52, 3, 4, 5, 6, 7, 8, 9, 10, 39, + 55, 41, 42, 49, 277, 49, 289, 290, 44, 45, + 49, 51, 285, 286, 26, 27, 24, 35, 49, 37, + 38, 49, 160, 161, 252, 33, 49, 44, 45, 37, + 38, 28, 29, 63, 64, 137, 138, 34, 35, 36, + 37, 38, 35, 49, 37, 38, 1, 5, 6, 277, + 49, 49, 56, 49, 203, 49, 194, 285, 286, 49, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 3, + 25, 209, 221, 175, 49, 30, 31, 32, 33, 49, + 56, 50, 37, 38, 39, 49, 58, 50, 226, 50, + 192, 46, 47, 231, 243, 13, 51, 199, 58, 50, + 50, 54, 204, 331, 43, 52, 45, 52, 47, 50, + 49, 55, 50, 52, 342, 57, 49, 51, 55, 54, + 51, 223, 260, 55, 50, 49, 264, 265, 266, 51, + 51, 54, 49, 49, 236, 4, 5, 6, 7, 8, + 9, 10, 51, 54, 49, 294, 52, 54, 52, 52, + 52, 289, 290, 37, 54, 49, 51, 49, 307, 57, + 262, 49, 52, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 11, 14, 55, 278, 264, 342, 328, + 33, 319, 331, 260, 37, 38, 288, 153, 321, 260, + 329, -1, 341, 342, -1, -1, -1, 335, -1, 1, + -1, -1, 304, -1, 306, -1, -1, -1, -1, 11, + -1, -1, -1, 315, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, -1, -1, -1, -1, 330, 31, + 32, 33, -1, -1, -1, 37, 38, 39, -1, -1, + 1, -1, -1, -1, 46, 47, -1, -1, -1, -1, + 52, -1, -1, 55, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, -1, -1, -1, -1, 30, + 31, 32, 33, -1, -1, -1, 37, 38, 39, 1, + -1, -1, -1, -1, -1, 46, 47, -1, -1, -1, + 51, -1, -1, -1, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, -1, -1, -1, -1, -1, 31, + 32, 33, -1, -1, -1, 37, 38, 39, 1, -1, + -1, -1, -1, -1, 46, 47, -1, -1, -1, 51, + -1, -1, -1, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, -1, -1, -1, -1, -1, 31, 32, + 33, -1, -1, -1, 37, 38, 39, -1, -1, -1, + -1, -1, -1, 46, 47, -1, -1, -1, 51, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, + 44, 45, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, + -1, -1, -1, 44, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, -1, -1, -1, 37, 38, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, -1, -1, -1, -1, 30, - 31, 32, 33, 34, -1, -1, -1, -1, -1, 40, + 33, -1, -1, -1, 37, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, -1, -1, -1, 37, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, -1, -1, -1, 37, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, -1, -1, -1, 37, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, 31, 32, 33, 34, - -1, -1, -1, -1, -1, 40, 16, 17, 18, 19, + 25, -1, -1, -1, -1, 30, 31, 32, 33, -1, + -1, -1, 37, 38, -1, -1, -1, -1, -1, -1, + -1, 46, 47, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, -1, -1, -1, -1, -1, 31, + 32, 33, -1, -1, -1, 37, 38, -1, -1, -1, + -1, -1, -1, -1, 46, 47, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, - -1, 31, 32, 33, 34, -1, -1, -1, -1, -1, - 40, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, 32, 33, 34 + -1, 31, 32, 33, -1, -1, -1, 37, 38, -1, + -1, -1, -1, -1, -1, -1, 46, 47 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 41, 43, 56, 58, 59, 60, 35, 135, 136, - 136, 0, 61, 1, 3, 26, 27, 63, 77, 80, - 81, 90, 91, 97, 98, 112, 113, 121, 122, 124, - 137, 139, 135, 42, 51, 44, 60, 46, 33, 59, - 62, 64, 69, 70, 71, 72, 65, 66, 67, 68, - 73, 74, 75, 4, 5, 6, 7, 8, 9, 10, - 79, 89, 95, 96, 111, 123, 76, 135, 78, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 32, - 33, 34, 133, 134, 60, 46, 57, 46, 57, 46, - 57, 46, 57, 46, 57, 46, 46, 57, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 38, - 140, 33, 140, 33, 140, 33, 140, 52, 52, 33, - 126, 140, 12, 83, 92, 12, 100, 12, 116, 125, - 46, 47, 54, 54, 33, 50, 36, 133, 59, 59, - 47, 133, 82, 47, 133, 13, 101, 24, 32, 115, - 133, 114, 47, 60, 50, 28, 29, 35, 36, 37, - 133, 138, 49, 49, 134, 134, 33, 127, 128, 140, - 47, 1, 59, 93, 115, 99, 51, 47, 127, 48, - 138, 53, 51, 50, 48, 51, 1, 59, 84, 46, - 31, 40, 85, 86, 94, 104, 134, 48, 47, 115, - 1, 59, 117, 48, 33, 140, 59, 36, 129, 133, - 127, 46, 85, 86, 87, 88, 103, 134, 48, 93, - 36, 49, 133, 50, 85, 134, 46, 33, 140, 1, - 59, 102, 46, 15, 30, 86, 105, 106, 107, 118, - 134, 48, 134, 84, 85, 50, 46, 140, 49, 49, - 138, 50, 93, 46, 86, 103, 107, 110, 134, 48, - 117, 105, 134, 38, 39, 1, 11, 130, 131, 46, - 53, 138, 84, 138, 102, 134, 46, 38, 39, 49, - 59, 49, 51, 117, 33, 140, 102, 109, 87, 134, - 108, 130, 14, 132, 140, 132, 59, 119, 120, 133, - 140, 87, 134, 51, 140, 119 + 0, 60, 64, 0, 39, 41, 42, 62, 63, 34, + 139, 140, 140, 140, 1, 3, 26, 27, 65, 79, + 82, 83, 93, 94, 100, 101, 116, 117, 125, 126, + 128, 141, 143, 139, 40, 55, 43, 43, 49, 37, + 63, 66, 71, 72, 73, 74, 67, 68, 69, 70, + 75, 76, 77, 4, 5, 6, 7, 8, 9, 10, + 81, 92, 98, 99, 115, 127, 78, 139, 80, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 33, + 37, 38, 137, 138, 49, 61, 49, 61, 49, 61, + 49, 61, 49, 61, 49, 49, 61, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 37, 44, + 144, 37, 144, 37, 144, 37, 144, 56, 56, 37, + 130, 144, 12, 53, 85, 104, 95, 103, 104, 104, + 120, 129, 49, 50, 58, 58, 37, 54, 35, 137, + 63, 63, 50, 84, 137, 50, 13, 105, 137, 24, + 33, 119, 137, 118, 50, 64, 54, 28, 29, 34, + 35, 36, 137, 142, 52, 52, 138, 138, 37, 131, + 132, 144, 50, 1, 63, 96, 119, 102, 55, 50, + 131, 51, 142, 57, 55, 54, 51, 55, 1, 63, + 86, 49, 31, 32, 46, 47, 87, 88, 89, 97, + 108, 138, 51, 50, 119, 1, 63, 121, 51, 37, + 144, 63, 35, 133, 137, 131, 49, 87, 88, 89, + 90, 91, 107, 138, 51, 96, 35, 52, 137, 35, + 52, 137, 54, 87, 138, 87, 49, 37, 144, 1, + 63, 106, 49, 15, 30, 88, 89, 109, 110, 111, + 122, 138, 51, 138, 86, 87, 87, 54, 49, 144, + 52, 52, 52, 52, 142, 54, 54, 96, 49, 88, + 89, 107, 111, 114, 138, 51, 121, 109, 138, 138, + 44, 45, 1, 11, 134, 135, 49, 57, 142, 86, + 142, 142, 106, 138, 138, 49, 44, 45, 52, 63, + 52, 55, 121, 37, 144, 106, 113, 90, 138, 112, + 134, 14, 136, 144, 136, 63, 123, 124, 137, 144, + 90, 138, 55, 144, 123 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_uint8 yyr1[] = +{ + 0, 59, 60, 61, 61, 62, 62, 63, 63, 64, + 64, 64, 66, 65, 67, 65, 65, 68, 65, 69, + 65, 65, 70, 65, 71, 65, 65, 72, 65, 73, + 65, 65, 74, 65, 75, 65, 65, 76, 65, 65, + 77, 65, 78, 65, 65, 65, 80, 79, 81, 81, + 82, 84, 83, 85, 85, 86, 86, 86, 86, 87, + 88, 88, 88, 88, 89, 89, 89, 89, 90, 90, + 90, 91, 92, 92, 93, 95, 94, 96, 96, 96, + 96, 97, 98, 98, 99, 99, 99, 100, 102, 101, + 103, 103, 104, 104, 105, 105, 106, 106, 106, 106, + 107, 107, 107, 107, 108, 108, 108, 108, 108, 108, + 108, 108, 109, 109, 109, 109, 110, 110, 110, 110, + 112, 111, 113, 111, 114, 114, 115, 115, 116, 118, + 117, 119, 119, 119, 119, 120, 120, 121, 121, 121, + 121, 122, 123, 123, 124, 124, 125, 125, 126, 126, + 127, 127, 129, 128, 130, 128, 131, 131, 132, 132, + 132, 132, 133, 133, 134, 134, 135, 135, 135, 135, + 135, 135, 135, 136, 136, 137, 137, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 139, 139, 140, 140, 141, 141, 142, 142, 142, + 142, 142, 142, 143, 143, 144, 144, 144, 144, 144, + 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, + 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, + 144, 144, 144, 144, 144, 144 +}; + +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 1, 1, 0, 3, 3, 3, 0, 2, + 3, 0, 0, 3, 0, 3, 1, 0, 3, 0, + 3, 1, 0, 3, 0, 3, 1, 0, 3, 0, + 3, 1, 0, 3, 0, 3, 1, 0, 3, 1, + 0, 3, 0, 3, 1, 2, 0, 6, 2, 2, + 2, 0, 7, 2, 0, 4, 3, 2, 0, 2, + 3, 3, 2, 1, 3, 3, 2, 1, 2, 2, + 1, 1, 2, 2, 2, 0, 6, 4, 3, 2, + 0, 1, 2, 2, 4, 4, 1, 2, 0, 8, + 2, 0, 1, 1, 2, 0, 4, 3, 2, 0, + 1, 3, 2, 1, 1, 3, 2, 4, 2, 4, + 2, 1, 2, 2, 1, 1, 2, 3, 2, 3, + 0, 5, 0, 5, 1, 1, 2, 2, 2, 0, + 7, 3, 1, 1, 1, 2, 0, 4, 3, 2, + 0, 1, 3, 1, 1, 1, 7, 7, 10, 10, + 2, 2, 0, 6, 0, 6, 3, 1, 1, 3, + 1, 0, 1, 1, 1, 0, 0, 3, 5, 4, + 6, 3, 5, 2, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, + 2, 2, 1, 3, 1, 1, 0, 1, 1, 1, + 1, 1, 1, 6, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1 +}; + + +enum { YYENOMEM = -2 }; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) #endif +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval) -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -1156,82 +1316,118 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + +/* YYLOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +# ifndef YYLOCATION_PRINT + +# if defined YY_LOCATION_PRINT + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) + +# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + +/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ + +YY_ATTRIBUTE_UNUSED +static int +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) { - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) + int res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) { - default: - break; + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); } + return res; } +# define YYLOCATION_PRINT yy_location_print_ + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) + +# else + +# define YYLOCATION_PRINT(File, Loc) ((void) 0) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT YYLOCATION_PRINT + +# endif +# endif /* !defined YYLOCATION_PRINT */ + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, Location); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + YY_USE (yylocationp); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); + YYLOCATION_PRINT (yyo, yylocationp); + YYFPRINTF (yyo, ": "); + yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -1239,16 +1435,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1259,63 +1447,57 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, + int yyrule) { + int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], + &(yylsp[(yyi + 1) - (yynrhs)])); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1331,479 +1513,215 @@ int yydebug; #endif -#if YYERROR_VERBOSE -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) { - YYUSE (yyvaluep); - + YY_USE (yyvaluep); + YY_USE (yylocationp); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END } + + /*----------. | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (void) -#else -int -yyparse () - -#endif -#endif { -/* The lookahead symbol. */ +/* Lookahead token kind. */ int yychar; -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else +/* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); +/* Location data for the lookahead symbol. */ +static YYLTYPE yyloc_default +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } +# endif +; +YYLTYPE yylloc = yyloc_default; /* Number of syntax errors so far. */ - int yynerrs; + int yynerrs = 0; - int yystate; + yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; + int yyerrstatus = 0; - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow + /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - /* The semantic value stack. */ + /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; - YYSIZE_T yystacksize; + /* The location stack: array, bottom, top. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp = yyls; int yyn; + /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; + YYLTYPE yyloc; + + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[3]; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ + + yylsp[0] = yylloc; goto yysetstate; + /*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | +| yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ - yynewstate: +yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; - yysetstate: - *yyssp = yystate; + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYPTRDIFF_T yysize = yyssp - yyss + 1; -#ifdef yyoverflow +# if defined yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yyls1, yysize * YYSIZEOF (*yylsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + yyls = yyls1; } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif -#endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; + yylsp = yyls + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; + /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ @@ -1814,18 +1732,30 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, &yylloc); } if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + yyerror_range[1] = yylloc; + goto yyerrlab1; + } else { yytoken = YYTRANSLATE (yychar); @@ -1853,15 +1783,14 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END + *++yylsp = yylloc; + /* Discard the shifted token. */ + yychar = YYEMPTY; goto yynewstate; @@ -1876,14 +1805,14 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); /*-----------------------------. -| yyreduce -- Do a reduction. | +| yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1892,426 +1821,572 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; - + /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + yyerror_range[1] = yyloc; YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -/* Line 1792 of yacc.c */ -#line 116 "src/Slice/Grammar.y" - { + case 2: /* start: definitions */ +#line 185 "src/Slice/Grammar.y" +{ } +#line 1835 "src/Slice/Grammar.cpp" break; - case 3: -/* Line 1792 of yacc.c */ -#line 124 "src/Slice/Grammar.y" - { + case 3: /* opt_semicolon: ';' */ +#line 193 "src/Slice/Grammar.y" +{ } +#line 1842 "src/Slice/Grammar.cpp" break; - case 4: -/* Line 1792 of yacc.c */ -#line 127 "src/Slice/Grammar.y" - { + case 4: /* opt_semicolon: %empty */ +#line 196 "src/Slice/Grammar.y" +{ } +#line 1849 "src/Slice/Grammar.cpp" break; - case 5: -/* Line 1792 of yacc.c */ -#line 135 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(2) - (3)]); + case 5: /* global_meta_data: ICE_GLOBAL_METADATA_OPEN string_list ICE_GLOBAL_METADATA_CLOSE */ +#line 204 "src/Slice/Grammar.y" +{ + yyval = yyvsp[-1]; } +#line 1857 "src/Slice/Grammar.cpp" break; - case 6: -/* Line 1792 of yacc.c */ -#line 144 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(2) - (3)]); + case 6: /* global_meta_data: ICE_GLOBAL_METADATA_IGNORE string_list ICE_GLOBAL_METADATA_CLOSE */ +#line 208 "src/Slice/Grammar.y" +{ + unit->error("global metadata must appear before any definitions"); + yyval = yyvsp[-1]; // Dummy } +#line 1866 "src/Slice/Grammar.cpp" break; - case 7: -/* Line 1792 of yacc.c */ -#line 148 "src/Slice/Grammar.y" - { - (yyval) = new StringListTok; + case 7: /* meta_data: ICE_METADATA_OPEN string_list ICE_METADATA_CLOSE */ +#line 218 "src/Slice/Grammar.y" +{ + yyval = yyvsp[-1]; } +#line 1874 "src/Slice/Grammar.cpp" break; - case 8: -/* Line 1792 of yacc.c */ -#line 157 "src/Slice/Grammar.y" - { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 8: /* meta_data: %empty */ +#line 222 "src/Slice/Grammar.y" +{ + yyval = new StringListTok; +} +#line 1882 "src/Slice/Grammar.cpp" + break; + + case 9: /* definitions: definitions global_meta_data */ +#line 231 "src/Slice/Grammar.y" +{ + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[0]); if(!metaData->v.empty()) { unit->addGlobalMetaData(metaData->v); } } +#line 1894 "src/Slice/Grammar.cpp" break; - case 10: -/* Line 1792 of yacc.c */ -#line 166 "src/Slice/Grammar.y" - { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (2)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (2)])); + case 10: /* definitions: definitions meta_data definition */ +#line 239 "src/Slice/Grammar.y" +{ + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-1]); + ContainedPtr contained = ContainedPtr::dynamicCast(yyvsp[0]); if(contained && !metaData->v.empty()) { contained->setMetaData(metaData->v); } } +#line 1907 "src/Slice/Grammar.cpp" break; - case 12: -/* Line 1792 of yacc.c */ -#line 176 "src/Slice/Grammar.y" - { + case 11: /* definitions: %empty */ +#line 248 "src/Slice/Grammar.y" +{ } +#line 1914 "src/Slice/Grammar.cpp" break; - case 13: -/* Line 1792 of yacc.c */ -#line 184 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || ModulePtr::dynamicCast((yyvsp[(1) - (1)]))); + case 12: /* $@1: %empty */ +#line 256 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || ModulePtr::dynamicCast(yyvsp[0])); } +#line 1922 "src/Slice/Grammar.cpp" break; - case 15: -/* Line 1792 of yacc.c */ -#line 189 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[(1) - (1)]))); + case 14: /* $@2: %empty */ +#line 261 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || ClassDeclPtr::dynamicCast(yyvsp[0])); } +#line 1930 "src/Slice/Grammar.cpp" break; - case 17: -/* Line 1792 of yacc.c */ -#line 194 "src/Slice/Grammar.y" - { + case 16: /* definition: class_decl */ +#line 266 "src/Slice/Grammar.y" +{ unit->error("`;' missing after class forward declaration"); } +#line 1938 "src/Slice/Grammar.cpp" break; - case 18: -/* Line 1792 of yacc.c */ -#line 198 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || ClassDefPtr::dynamicCast((yyvsp[(1) - (1)]))); + case 17: /* $@3: %empty */ +#line 270 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || ClassDefPtr::dynamicCast(yyvsp[0])); } +#line 1946 "src/Slice/Grammar.cpp" break; - case 20: -/* Line 1792 of yacc.c */ -#line 203 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[(1) - (1)]))); + case 19: /* $@4: %empty */ +#line 275 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || ClassDeclPtr::dynamicCast(yyvsp[0])); } +#line 1954 "src/Slice/Grammar.cpp" break; - case 22: -/* Line 1792 of yacc.c */ -#line 208 "src/Slice/Grammar.y" - { + case 21: /* definition: interface_decl */ +#line 280 "src/Slice/Grammar.y" +{ unit->error("`;' missing after interface forward declaration"); } +#line 1962 "src/Slice/Grammar.cpp" break; - case 23: -/* Line 1792 of yacc.c */ -#line 212 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || ClassDefPtr::dynamicCast((yyvsp[(1) - (1)]))); + case 22: /* $@5: %empty */ +#line 284 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || ClassDefPtr::dynamicCast(yyvsp[0])); } +#line 1970 "src/Slice/Grammar.cpp" break; - case 25: -/* Line 1792 of yacc.c */ -#line 217 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0); + case 24: /* $@6: %empty */ +#line 289 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0); } +#line 1978 "src/Slice/Grammar.cpp" break; - case 27: -/* Line 1792 of yacc.c */ -#line 222 "src/Slice/Grammar.y" - { + case 26: /* definition: exception_decl */ +#line 294 "src/Slice/Grammar.y" +{ unit->error("`;' missing after exception forward declaration"); } +#line 1986 "src/Slice/Grammar.cpp" break; - case 28: -/* Line 1792 of yacc.c */ -#line 226 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || ExceptionPtr::dynamicCast((yyvsp[(1) - (1)]))); + case 27: /* $@7: %empty */ +#line 298 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || ExceptionPtr::dynamicCast(yyvsp[0])); } +#line 1994 "src/Slice/Grammar.cpp" break; - case 30: -/* Line 1792 of yacc.c */ -#line 231 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0); + case 29: /* $@8: %empty */ +#line 303 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0); } +#line 2002 "src/Slice/Grammar.cpp" break; - case 32: -/* Line 1792 of yacc.c */ -#line 236 "src/Slice/Grammar.y" - { + case 31: /* definition: struct_decl */ +#line 308 "src/Slice/Grammar.y" +{ unit->error("`;' missing after struct forward declaration"); } +#line 2010 "src/Slice/Grammar.cpp" break; - case 33: -/* Line 1792 of yacc.c */ -#line 240 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || StructPtr::dynamicCast((yyvsp[(1) - (1)]))); + case 32: /* $@9: %empty */ +#line 312 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || StructPtr::dynamicCast(yyvsp[0])); } +#line 2018 "src/Slice/Grammar.cpp" break; - case 35: -/* Line 1792 of yacc.c */ -#line 245 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || SequencePtr::dynamicCast((yyvsp[(1) - (1)]))); + case 34: /* $@10: %empty */ +#line 317 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || SequencePtr::dynamicCast(yyvsp[0])); } +#line 2026 "src/Slice/Grammar.cpp" break; - case 37: -/* Line 1792 of yacc.c */ -#line 250 "src/Slice/Grammar.y" - { + case 36: /* definition: sequence_def */ +#line 322 "src/Slice/Grammar.y" +{ unit->error("`;' missing after sequence definition"); } +#line 2034 "src/Slice/Grammar.cpp" break; - case 38: -/* Line 1792 of yacc.c */ -#line 254 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || DictionaryPtr::dynamicCast((yyvsp[(1) - (1)]))); + case 37: /* $@11: %empty */ +#line 326 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || DictionaryPtr::dynamicCast(yyvsp[0])); } +#line 2042 "src/Slice/Grammar.cpp" break; - case 40: -/* Line 1792 of yacc.c */ -#line 259 "src/Slice/Grammar.y" - { + case 39: /* definition: dictionary_def */ +#line 331 "src/Slice/Grammar.y" +{ unit->error("`;' missing after dictionary definition"); } +#line 2050 "src/Slice/Grammar.cpp" break; - case 41: -/* Line 1792 of yacc.c */ -#line 263 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || EnumPtr::dynamicCast((yyvsp[(1) - (1)]))); + case 40: /* $@12: %empty */ +#line 335 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || EnumPtr::dynamicCast(yyvsp[0])); } +#line 2058 "src/Slice/Grammar.cpp" break; - case 43: -/* Line 1792 of yacc.c */ -#line 268 "src/Slice/Grammar.y" - { - assert((yyvsp[(1) - (1)]) == 0 || ConstPtr::dynamicCast((yyvsp[(1) - (1)]))); + case 42: /* $@13: %empty */ +#line 340 "src/Slice/Grammar.y" +{ + assert(yyvsp[0] == 0 || ConstPtr::dynamicCast(yyvsp[0])); } +#line 2066 "src/Slice/Grammar.cpp" break; - case 45: -/* Line 1792 of yacc.c */ -#line 273 "src/Slice/Grammar.y" - { + case 44: /* definition: const_def */ +#line 345 "src/Slice/Grammar.y" +{ unit->error("`;' missing after const definition"); } +#line 2074 "src/Slice/Grammar.cpp" break; - case 46: -/* Line 1792 of yacc.c */ -#line 277 "src/Slice/Grammar.y" - { + case 45: /* definition: error ';' */ +#line 349 "src/Slice/Grammar.y" +{ yyerrok; } +#line 2082 "src/Slice/Grammar.cpp" break; - case 47: -/* Line 1792 of yacc.c */ -#line 286 "src/Slice/Grammar.y" - { - unit->setSeenDefinition(); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 46: /* @14: %empty */ +#line 358 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); ModulePtr module = cont->createModule(ident->v); if(module) { cont->checkIntroduced(ident->v, module); unit->pushContainer(module); - (yyval) = module; + yyval = module; } else { - (yyval) = 0; + yyval = 0; } } +#line 2102 "src/Slice/Grammar.cpp" break; - case 48: -/* Line 1792 of yacc.c */ -#line 303 "src/Slice/Grammar.y" - { - if((yyvsp[(3) - (6)])) + case 47: /* module_def: ICE_MODULE ICE_IDENTIFIER @14 '{' definitions '}' */ +#line 374 "src/Slice/Grammar.y" +{ + if(yyvsp[-3]) { unit->popContainer(); - (yyval) = (yyvsp[(3) - (6)]); + yyval = yyvsp[-3]; } else { - (yyval) = 0; + yyval = 0; } } +#line 2118 "src/Slice/Grammar.cpp" break; - case 49: -/* Line 1792 of yacc.c */ -#line 320 "src/Slice/Grammar.y" + case 48: /* exception_id: ICE_EXCEPTION ICE_IDENTIFIER */ +#line 391 "src/Slice/Grammar.y" +{ + yyval = yyvsp[0]; +} +#line 2126 "src/Slice/Grammar.cpp" + break; + + case 49: /* exception_id: ICE_EXCEPTION keyword */ +#line 395 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); + unit->error("keyword `" + ident->v + "' cannot be used as exception name"); + yyval = yyvsp[0]; // Dummy +} +#line 2136 "src/Slice/Grammar.cpp" + break; + + case 50: /* exception_decl: local_qualifier exception_id */ +#line 406 "src/Slice/Grammar.y" +{ + unit->error("exceptions cannot be forward declared"); + yyval = 0; +} +#line 2145 "src/Slice/Grammar.cpp" + break; + + case 51: /* @15: %empty */ +#line 416 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-2]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[-1]); + ExceptionPtr base = ExceptionPtr::dynamicCast(yyvsp[0]); + ContainerPtr cont = unit->currentContainer(); + ExceptionPtr ex = cont->createException(ident->v, base, local->v); + if(ex) { - (yyval) = (yyvsp[(2) - (2)]); + cont->checkIntroduced(ident->v, ex); + unit->pushContainer(ex); + } + yyval = ex; } +#line 2163 "src/Slice/Grammar.cpp" break; - case 50: -/* Line 1792 of yacc.c */ -#line 324 "src/Slice/Grammar.y" + case 52: /* exception_def: local_qualifier exception_id exception_extends @15 '{' exception_exports '}' */ +#line 430 "src/Slice/Grammar.y" +{ + if(yyvsp[-3]) { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); - unit->error("keyword `" + ident->v + "' cannot be used as exception name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy + unit->popContainer(); + } + yyval = yyvsp[-3]; } +#line 2175 "src/Slice/Grammar.cpp" break; - case 51: -/* Line 1792 of yacc.c */ -#line 335 "src/Slice/Grammar.y" + case 53: /* exception_extends: extends scoped_name */ +#line 443 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); + ContainerPtr cont = unit->currentContainer(); + ContainedPtr contained = cont->lookupException(scoped->v); + cont->checkIntroduced(scoped->v); + yyval = contained; +} +#line 2187 "src/Slice/Grammar.cpp" + break; + + case 54: /* exception_extends: %empty */ +#line 451 "src/Slice/Grammar.y" +{ + yyval = 0; +} +#line 2195 "src/Slice/Grammar.cpp" + break; + + case 55: /* exception_exports: meta_data exception_export ';' exception_exports */ +#line 460 "src/Slice/Grammar.y" +{ + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); + ContainedPtr contained = ContainedPtr::dynamicCast(yyvsp[-2]); + if(contained && !metaData->v.empty()) { - unit->error("exceptions cannot be forward declared"); - (yyval) = 0; + contained->setMetaData(metaData->v); + } +} +#line 2208 "src/Slice/Grammar.cpp" + break; + + case 56: /* exception_exports: error ';' exception_exports */ +#line 469 "src/Slice/Grammar.y" +{ +} +#line 2215 "src/Slice/Grammar.cpp" + break; + + case 57: /* exception_exports: meta_data exception_export */ +#line 472 "src/Slice/Grammar.y" +{ + unit->error("`;' missing after definition"); +} +#line 2223 "src/Slice/Grammar.cpp" + break; + + case 58: /* exception_exports: %empty */ +#line 476 "src/Slice/Grammar.y" +{ +} +#line 2230 "src/Slice/Grammar.cpp" + break; + + case 59: /* type_id: type ICE_IDENTIFIER */ +#line 484 "src/Slice/Grammar.y" +{ + TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); + TypeStringTokPtr typestring = new TypeStringTok; + typestring->v = make_pair(type, ident->v); + yyval = typestring; +} +#line 2242 "src/Slice/Grammar.cpp" + break; + + case 60: /* tag: ICE_TAG_OPEN ICE_INTEGER_LITERAL ')' */ +#line 497 "src/Slice/Grammar.y" +{ + IntegerTokPtr i = IntegerTokPtr::dynamicCast(yyvsp[-1]); + + int tag; + if(i->v < 0 || i->v > Int32Max) + { + unit->error("tag is out of range"); + tag = -1; + } + else + { + tag = static_cast(i->v); + } + + TaggedDefTokPtr m = new TaggedDefTok(tag); + yyval = m; } +#line 2264 "src/Slice/Grammar.cpp" break; - case 52: -/* Line 1792 of yacc.c */ -#line 345 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); - ExceptionPtr base = ExceptionPtr::dynamicCast((yyvsp[(3) - (3)])); - ContainerPtr cont = unit->currentContainer(); - ExceptionPtr ex = cont->createException(ident->v, base, local->v); - if(ex) - { - cont->checkIntroduced(ident->v, ex); - unit->pushContainer(ex); + case 61: /* tag: ICE_TAG_OPEN scoped_name ')' */ +#line 515 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-1]); + + ContainerPtr cont = unit->currentContainer(); + assert(cont); + ContainedList cl = cont->lookupContained(scoped->v, false); + if(cl.empty()) + { + EnumeratorList enumerators = cont->enumerators(scoped->v); + if(enumerators.size() == 1) + { + // Found + cl.push_back(enumerators.front()); + scoped->v = enumerators.front()->scoped(); + unit->warning(Deprecated, string("referencing enumerator `") + scoped->v + + "' without its enumeration's scope is deprecated"); + } + else if(enumerators.size() > 1) + { + ostringstream os; + os << "enumerator `" << scoped->v << "' could designate"; + bool first = true; + for(EnumeratorList::iterator p = enumerators.begin(); p != enumerators.end(); ++p) + { + if(first) + { + first = false; + } + else + { + os << " or"; + } + + os << " `" << (*p)->scoped() << "'"; + } + unit->error(os.str()); + } + else + { + unit->error(string("`") + scoped->v + "' is not defined"); + } } - (yyval) = ex; -} - break; - case 53: -/* Line 1792 of yacc.c */ -#line 359 "src/Slice/Grammar.y" - { - if((yyvsp[(4) - (7)])) + if(cl.empty()) { - unit->popContainer(); + YYERROR; // Can't continue, jump to next yyerrok } - (yyval) = (yyvsp[(4) - (7)]); -} - break; - - case 54: -/* Line 1792 of yacc.c */ -#line 372 "src/Slice/Grammar.y" - { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); - ContainerPtr cont = unit->currentContainer(); - ContainedPtr contained = cont->lookupException(scoped->v); cont->checkIntroduced(scoped->v); - (yyval) = contained; -} - break; - - case 55: -/* Line 1792 of yacc.c */ -#line 380 "src/Slice/Grammar.y" - { - (yyval) = 0; -} - break; - case 56: -/* Line 1792 of yacc.c */ -#line 389 "src/Slice/Grammar.y" + int tag = -1; + EnumeratorPtr enumerator = EnumeratorPtr::dynamicCast(cl.front()); + ConstPtr constant = ConstPtr::dynamicCast(cl.front()); + if(constant) { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); - if(contained && !metaData->v.empty()) + BuiltinPtr b = BuiltinPtr::dynamicCast(constant->type()); + if(b) + { + switch(b->kind()) + { + case Builtin::KindByte: + case Builtin::KindShort: + case Builtin::KindInt: + case Builtin::KindLong: + { + IceUtil::Int64 l = IceUtilInternal::strToInt64(constant->value().c_str(), 0, 0); + if(l < 0 || l > Int32Max) + { + unit->error("tag is out of range"); + } + tag = static_cast(l); + break; + } + default: + break; + } + } + } + else if(enumerator) { - contained->setMetaData(metaData->v); + tag = enumerator->value(); } -} - break; - case 57: -/* Line 1792 of yacc.c */ -#line 398 "src/Slice/Grammar.y" + if(tag < 0) { -} - break; + unit->error("invalid tag `" + scoped->v + "'"); + } - case 58: -/* Line 1792 of yacc.c */ -#line 401 "src/Slice/Grammar.y" - { - unit->error("`;' missing after definition"); + TaggedDefTokPtr m = new TaggedDefTok(tag); + yyval = m; } +#line 2359 "src/Slice/Grammar.cpp" break; - case 59: -/* Line 1792 of yacc.c */ -#line 405 "src/Slice/Grammar.y" - { + case 62: /* tag: ICE_TAG_OPEN ')' */ +#line 606 "src/Slice/Grammar.y" +{ + unit->error("missing tag"); + TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy + yyval = m; } +#line 2369 "src/Slice/Grammar.cpp" break; - case 60: -/* Line 1792 of yacc.c */ -#line 413 "src/Slice/Grammar.y" - { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); - TypeStringTokPtr typestring = new TypeStringTok; - typestring->v = make_pair(type, ident->v); - (yyval) = typestring; + case 63: /* tag: ICE_TAG */ +#line 612 "src/Slice/Grammar.y" +{ + unit->error("missing tag"); + TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy + yyval = m; } +#line 2379 "src/Slice/Grammar.cpp" break; - case 61: -/* Line 1792 of yacc.c */ -#line 426 "src/Slice/Grammar.y" - { - IntegerTokPtr i = IntegerTokPtr::dynamicCast((yyvsp[(2) - (3)])); + case 64: /* optional: ICE_OPTIONAL_OPEN ICE_INTEGER_LITERAL ')' */ +#line 623 "src/Slice/Grammar.y" +{ + IntegerTokPtr i = IntegerTokPtr::dynamicCast(yyvsp[-1]); int tag; if(i->v < 0 || i->v > Int32Max) { - unit->error("tag for optional is out of range"); + unit->error("tag is out of range"); tag = -1; } else @@ -2319,19 +2394,16 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); tag = static_cast(i->v); } - OptionalDefTokPtr m = new OptionalDefTok; - m->v.optional = tag >= 0; - m->v.tag = tag; - (yyval) = m; + TaggedDefTokPtr m = new TaggedDefTok(tag); + yyval = m; } +#line 2401 "src/Slice/Grammar.cpp" break; - case 62: -/* Line 1792 of yacc.c */ -#line 446 "src/Slice/Grammar.y" - { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); - + case 65: /* optional: ICE_OPTIONAL_OPEN scoped_name ')' */ +#line 641 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-1]); ContainerPtr cont = unit->currentContainer(); assert(cont); ContainedList cl = cont->lookupContained(scoped->v, false); @@ -2396,7 +2468,7 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); IceUtil::Int64 l = IceUtilInternal::strToInt64(constant->value().c_str(), 0, 0); if(l < 0 || l > Int32Max) { - unit->error("tag for optional is out of range"); + unit->error("tag is out of range"); } tag = static_cast(l); break; @@ -2413,99 +2485,105 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); if(tag < 0) { - unit->error("invalid tag `" + scoped->v + "' for optional"); + unit->error("invalid tag `" + scoped->v + "'"); } - OptionalDefTokPtr m = new OptionalDefTok; - m->v.optional = tag >= 0; - m->v.tag = tag; - (yyval) = m; + TaggedDefTokPtr m = new TaggedDefTok(tag); + yyval = m; } +#line 2495 "src/Slice/Grammar.cpp" break; - case 63: -/* Line 1792 of yacc.c */ -#line 539 "src/Slice/Grammar.y" - { - unit->error("missing tag for optional"); - OptionalDefTokPtr m = new OptionalDefTok; // Dummy - m->v.optional = false; - m->v.tag = -1; - (yyval) = m; + case 66: /* optional: ICE_OPTIONAL_OPEN ')' */ +#line 731 "src/Slice/Grammar.y" +{ + unit->error("missing tag"); + TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy + yyval = m; } +#line 2505 "src/Slice/Grammar.cpp" break; - case 64: -/* Line 1792 of yacc.c */ -#line 547 "src/Slice/Grammar.y" - { - unit->error("missing tag for optional"); - OptionalDefTokPtr m = new OptionalDefTok; // Dummy - m->v.optional = false; - m->v.tag = -1; - (yyval) = m; + case 67: /* optional: ICE_OPTIONAL */ +#line 737 "src/Slice/Grammar.y" +{ + unit->error("missing tag"); + TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy + yyval = m; } +#line 2515 "src/Slice/Grammar.cpp" break; - case 65: -/* Line 1792 of yacc.c */ -#line 560 "src/Slice/Grammar.y" - { - OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(2) - (2)])); - m->v.type = ts->v.first; - m->v.name = ts->v.second; - (yyval) = m; + case 68: /* tagged_type_id: tag type_id */ +#line 748 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); + + m->type = ts->v.first; + m->name = ts->v.second; + yyval = m; } +#line 2528 "src/Slice/Grammar.cpp" break; - case 66: -/* Line 1792 of yacc.c */ -#line 568 "src/Slice/Grammar.y" - { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (1)])); - OptionalDefTokPtr m = new OptionalDefTok; - m->v.type = ts->v.first; - m->v.name = ts->v.second; - m->v.optional = false; - m->v.tag = -1; - (yyval) = m; + case 69: /* tagged_type_id: optional type_id */ +#line 757 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); + + m->type = ts->v.first; + m->name = ts->v.second; + yyval = m; } +#line 2541 "src/Slice/Grammar.cpp" break; - case 68: -/* Line 1792 of yacc.c */ -#line 589 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(2) - (2)]); + case 70: /* tagged_type_id: type_id */ +#line 766 "src/Slice/Grammar.y" +{ + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); + TaggedDefTokPtr m = new TaggedDefTok(-1); + m->type = ts->v.first; + m->name = ts->v.second; + yyval = m; } +#line 2553 "src/Slice/Grammar.cpp" break; - case 69: -/* Line 1792 of yacc.c */ -#line 593 "src/Slice/Grammar.y" - { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 72: /* struct_id: ICE_STRUCT ICE_IDENTIFIER */ +#line 785 "src/Slice/Grammar.y" +{ + yyval = yyvsp[0]; +} +#line 2561 "src/Slice/Grammar.cpp" + break; + + case 73: /* struct_id: ICE_STRUCT keyword */ +#line 789 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as struct name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy + yyval = yyvsp[0]; // Dummy } +#line 2571 "src/Slice/Grammar.cpp" break; - case 70: -/* Line 1792 of yacc.c */ -#line 604 "src/Slice/Grammar.y" - { + case 74: /* struct_decl: local_qualifier struct_id */ +#line 800 "src/Slice/Grammar.y" +{ unit->error("structs cannot be forward declared"); - (yyval) = 0; // Dummy + yyval = 0; // Dummy } +#line 2580 "src/Slice/Grammar.cpp" break; - case 71: -/* Line 1792 of yacc.c */ -#line 614 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 75: /* @16: %empty */ +#line 810 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-1]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); StructPtr st = cont->createStruct(ident->v, local->v); if(st) @@ -2519,90 +2597,90 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); assert(st); unit->pushContainer(st); } - (yyval) = st; + yyval = st; } +#line 2603 "src/Slice/Grammar.cpp" break; - case 72: -/* Line 1792 of yacc.c */ -#line 633 "src/Slice/Grammar.y" - { - if((yyvsp[(3) - (6)])) + case 76: /* struct_def: local_qualifier struct_id @16 '{' struct_exports '}' */ +#line 829 "src/Slice/Grammar.y" +{ + if(yyvsp[-3]) { unit->popContainer(); } - (yyval) = (yyvsp[(3) - (6)]); + yyval = yyvsp[-3]; // // Empty structures are not allowed // - StructPtr st = StructPtr::dynamicCast((yyval)); + StructPtr st = StructPtr::dynamicCast(yyval); assert(st); if(st->dataMembers().empty()) { unit->error("struct `" + st->name() + "' must have at least one member"); // $$ is a dummy } } +#line 2625 "src/Slice/Grammar.cpp" break; - case 73: -/* Line 1792 of yacc.c */ -#line 656 "src/Slice/Grammar.y" - { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + case 77: /* struct_exports: meta_data struct_export ';' struct_exports */ +#line 852 "src/Slice/Grammar.y" +{ + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); + ContainedPtr contained = ContainedPtr::dynamicCast(yyvsp[-2]); if(contained && !metaData->v.empty()) { contained->setMetaData(metaData->v); } } +#line 2638 "src/Slice/Grammar.cpp" break; - case 74: -/* Line 1792 of yacc.c */ -#line 665 "src/Slice/Grammar.y" - { + case 78: /* struct_exports: error ';' struct_exports */ +#line 861 "src/Slice/Grammar.y" +{ } +#line 2645 "src/Slice/Grammar.cpp" break; - case 75: -/* Line 1792 of yacc.c */ -#line 668 "src/Slice/Grammar.y" - { + case 79: /* struct_exports: meta_data struct_export */ +#line 864 "src/Slice/Grammar.y" +{ unit->error("`;' missing after definition"); } +#line 2653 "src/Slice/Grammar.cpp" break; - case 76: -/* Line 1792 of yacc.c */ -#line 672 "src/Slice/Grammar.y" - { + case 80: /* struct_exports: %empty */ +#line 868 "src/Slice/Grammar.y" +{ } +#line 2660 "src/Slice/Grammar.cpp" break; - case 78: -/* Line 1792 of yacc.c */ -#line 686 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(2) - (2)]); + case 82: /* class_name: ICE_CLASS ICE_IDENTIFIER */ +#line 882 "src/Slice/Grammar.y" +{ + yyval = yyvsp[0]; } +#line 2668 "src/Slice/Grammar.cpp" break; - case 79: -/* Line 1792 of yacc.c */ -#line 690 "src/Slice/Grammar.y" - { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 83: /* class_name: ICE_CLASS keyword */ +#line 886 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as class name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy + yyval = yyvsp[0]; // Dummy } +#line 2678 "src/Slice/Grammar.cpp" break; - case 80: -/* Line 1792 of yacc.c */ -#line 701 "src/Slice/Grammar.y" - { - IceUtil::Int64 id = IntegerTokPtr::dynamicCast((yyvsp[(3) - (4)]))->v; + case 84: /* class_id: ICE_CLASS ICE_IDENT_OPEN ICE_INTEGER_LITERAL ')' */ +#line 897 "src/Slice/Grammar.y" +{ + IceUtil::Int64 id = IntegerTokPtr::dynamicCast(yyvsp[-1])->v; if(id < 0) { unit->error("invalid compact id for class: id must be a positive integer"); @@ -2621,17 +2699,17 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); } ClassIdTokPtr classId = new ClassIdTok(); - classId->v = StringTokPtr::dynamicCast((yyvsp[(2) - (4)]))->v; + classId->v = StringTokPtr::dynamicCast(yyvsp[-2])->v; classId->t = static_cast(id); - (yyval) = classId; + yyval = classId; } +#line 2707 "src/Slice/Grammar.cpp" break; - case 81: -/* Line 1792 of yacc.c */ -#line 726 "src/Slice/Grammar.y" - { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(3) - (4)])); + case 85: /* class_id: ICE_CLASS ICE_IDENT_OPEN scoped_name ')' */ +#line 922 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-1]); ContainerPtr cont = unit->currentContainer(); assert(cont); @@ -2726,87 +2804,87 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); } ClassIdTokPtr classId = new ClassIdTok(); - classId->v = StringTokPtr::dynamicCast((yyvsp[(2) - (4)]))->v; + classId->v = StringTokPtr::dynamicCast(yyvsp[-2])->v; classId->t = id; - (yyval) = classId; + yyval = classId; } +#line 2813 "src/Slice/Grammar.cpp" break; - case 82: -/* Line 1792 of yacc.c */ -#line 828 "src/Slice/Grammar.y" - { + case 86: /* class_id: class_name */ +#line 1024 "src/Slice/Grammar.y" +{ ClassIdTokPtr classId = new ClassIdTok(); - classId->v = StringTokPtr::dynamicCast((yyvsp[(1) - (1)]))->v; + classId->v = StringTokPtr::dynamicCast(yyvsp[0])->v; classId->t = -1; - (yyval) = classId; + yyval = classId; } +#line 2824 "src/Slice/Grammar.cpp" break; - case 83: -/* Line 1792 of yacc.c */ -#line 840 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 87: /* class_decl: local_qualifier class_name */ +#line 1036 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-1]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); ClassDeclPtr cl = cont->createClassDecl(ident->v, false, local->v); - (yyval) = cl; + yyval = cl; } +#line 2836 "src/Slice/Grammar.cpp" break; - case 84: -/* Line 1792 of yacc.c */ -#line 853 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ClassIdTokPtr ident = ClassIdTokPtr::dynamicCast((yyvsp[(2) - (4)])); + case 88: /* @17: %empty */ +#line 1049 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-3]); + ClassIdTokPtr ident = ClassIdTokPtr::dynamicCast(yyvsp[-2]); ContainerPtr cont = unit->currentContainer(); - ClassDefPtr base = ClassDefPtr::dynamicCast((yyvsp[(3) - (4)])); - ClassListTokPtr bases = ClassListTokPtr::dynamicCast((yyvsp[(4) - (4)])); + ClassDefPtr base = ClassDefPtr::dynamicCast(yyvsp[-1]); + ClassListTokPtr bases = ClassListTokPtr::dynamicCast(yyvsp[0]); if(base) { - bases->v.push_front(base); + bases->v.push_front(base); } ClassDefPtr cl = cont->createClassDef(ident->v, ident->t, false, bases->v, local->v); if(cl) { cont->checkIntroduced(ident->v, cl); unit->pushContainer(cl); - (yyval) = cl; + yyval = cl; } else { - (yyval) = 0; + yyval = 0; } } +#line 2863 "src/Slice/Grammar.cpp" break; - case 85: -/* Line 1792 of yacc.c */ -#line 876 "src/Slice/Grammar.y" - { - if((yyvsp[(5) - (8)])) + case 89: /* class_def: local_qualifier class_id class_extends implements @17 '{' class_exports '}' */ +#line 1072 "src/Slice/Grammar.y" +{ + if(yyvsp[-3]) { unit->popContainer(); - (yyval) = (yyvsp[(5) - (8)]); + yyval = yyvsp[-3]; } else { - (yyval) = 0; + yyval = 0; } } +#line 2879 "src/Slice/Grammar.cpp" break; - case 86: -/* Line 1792 of yacc.c */ -#line 893 "src/Slice/Grammar.y" - { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 90: /* class_extends: extends scoped_name */ +#line 1089 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); TypeList types = cont->lookupType(scoped->v); - (yyval) = 0; + yyval = 0; if(!types.empty()) { ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); @@ -2830,395 +2908,441 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); else { cont->checkIntroduced(scoped->v); - (yyval) = def; + yyval = def; } } } } +#line 2917 "src/Slice/Grammar.cpp" break; - case 87: -/* Line 1792 of yacc.c */ -#line 927 "src/Slice/Grammar.y" - { - (yyval) = 0; + case 91: /* class_extends: %empty */ +#line 1123 "src/Slice/Grammar.y" +{ + yyval = 0; } +#line 2925 "src/Slice/Grammar.cpp" break; - case 88: -/* Line 1792 of yacc.c */ -#line 936 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(2) - (2)]); + case 92: /* extends: ICE_EXTENDS */ +#line 1132 "src/Slice/Grammar.y" +{ } +#line 2932 "src/Slice/Grammar.cpp" break; - case 89: -/* Line 1792 of yacc.c */ -#line 940 "src/Slice/Grammar.y" - { - (yyval) = new ClassListTok; + case 93: /* extends: ':' */ +#line 1135 "src/Slice/Grammar.y" +{ } +#line 2939 "src/Slice/Grammar.cpp" break; - case 90: -/* Line 1792 of yacc.c */ -#line 949 "src/Slice/Grammar.y" - { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + case 94: /* implements: ICE_IMPLEMENTS interface_list */ +#line 1143 "src/Slice/Grammar.y" +{ + yyval = yyvsp[0]; +} +#line 2947 "src/Slice/Grammar.cpp" + break; + + case 95: /* implements: %empty */ +#line 1147 "src/Slice/Grammar.y" +{ + yyval = new ClassListTok; +} +#line 2955 "src/Slice/Grammar.cpp" + break; + + case 96: /* class_exports: meta_data class_export ';' class_exports */ +#line 1156 "src/Slice/Grammar.y" +{ + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); + ContainedPtr contained = ContainedPtr::dynamicCast(yyvsp[-2]); if(contained && !metaData->v.empty()) { contained->setMetaData(metaData->v); } } +#line 2968 "src/Slice/Grammar.cpp" break; - case 91: -/* Line 1792 of yacc.c */ -#line 958 "src/Slice/Grammar.y" - { + case 97: /* class_exports: error ';' class_exports */ +#line 1165 "src/Slice/Grammar.y" +{ } +#line 2975 "src/Slice/Grammar.cpp" break; - case 92: -/* Line 1792 of yacc.c */ -#line 961 "src/Slice/Grammar.y" - { + case 98: /* class_exports: meta_data class_export */ +#line 1168 "src/Slice/Grammar.y" +{ unit->error("`;' missing after definition"); } +#line 2983 "src/Slice/Grammar.cpp" break; - case 93: -/* Line 1792 of yacc.c */ -#line 965 "src/Slice/Grammar.y" - { + case 99: /* class_exports: %empty */ +#line 1172 "src/Slice/Grammar.y" +{ } +#line 2990 "src/Slice/Grammar.cpp" break; - case 94: -/* Line 1792 of yacc.c */ -#line 973 "src/Slice/Grammar.y" - { - OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 100: /* data_member: tagged_type_id */ +#line 1180 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr def = TaggedDefTokPtr::dynamicCast(yyvsp[0]); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); DataMemberPtr dm; if(cl) { - dm = cl->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, 0, "", ""); + dm = cl->createDataMember(def->name, def->type, def->isTagged, def->tag, 0, "", ""); } StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - dm = st->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, 0, "", ""); + dm = st->createDataMember(def->name, def->type, def->isTagged, def->tag, 0, "", ""); } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) { - dm = ex->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, 0, "", ""); + dm = ex->createDataMember(def->name, def->type, def->isTagged, def->tag, 0, "", ""); } - unit->currentContainer()->checkIntroduced(def->v.name, dm); - (yyval) = dm; + unit->currentContainer()->checkIntroduced(def->name, dm); + yyval = dm; } +#line 3016 "src/Slice/Grammar.cpp" break; - case 95: -/* Line 1792 of yacc.c */ -#line 995 "src/Slice/Grammar.y" - { - OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (3)])); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); + case 101: /* data_member: tagged_type_id '=' const_initializer */ +#line 1202 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr def = TaggedDefTokPtr::dynamicCast(yyvsp[-2]); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast(yyvsp[0]); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); DataMemberPtr dm; if(cl) { - dm = cl->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + dm = cl->createDataMember(def->name, def->type, def->isTagged, def->tag, value->v, + value->valueAsString, value->valueAsLiteral); } StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - dm = st->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + dm = st->createDataMember(def->name, def->type, def->isTagged, def->tag, value->v, + value->valueAsString, value->valueAsLiteral); } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) { - dm = ex->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + dm = ex->createDataMember(def->name, def->type, def->isTagged, def->tag, value->v, + value->valueAsString, value->valueAsLiteral); } - unit->currentContainer()->checkIntroduced(def->v.name, dm); - (yyval) = dm; + unit->currentContainer()->checkIntroduced(def->name, dm); + yyval = dm; } +#line 3047 "src/Slice/Grammar.cpp" break; - case 96: -/* Line 1792 of yacc.c */ -#line 1022 "src/Slice/Grammar.y" - { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); - string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + case 102: /* data_member: type keyword */ +#line 1229 "src/Slice/Grammar.y" +{ + TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); + string name = StringTokPtr::dynamicCast(yyvsp[0])->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - (yyval) = cl->createDataMember(name, type, false, 0, 0, "", ""); // Dummy + yyval = cl->createDataMember(name, type, false, 0, 0, "", ""); // Dummy } StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - (yyval) = st->createDataMember(name, type, false, 0, 0, "", ""); // Dummy + yyval = st->createDataMember(name, type, false, 0, 0, "", ""); // Dummy } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) { - (yyval) = ex->createDataMember(name, type, false, 0, 0, "", ""); // Dummy + yyval = ex->createDataMember(name, type, false, 0, 0, "", ""); // Dummy } - assert((yyval)); + assert(yyval); unit->error("keyword `" + name + "' cannot be used as data member name"); } +#line 3073 "src/Slice/Grammar.cpp" break; - case 97: -/* Line 1792 of yacc.c */ -#line 1044 "src/Slice/Grammar.y" - { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); + case 103: /* data_member: type */ +#line 1251 "src/Slice/Grammar.y" +{ + TypePtr type = TypePtr::dynamicCast(yyvsp[0]); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - (yyval) = cl->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + yyval = cl->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy } StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - (yyval) = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + yyval = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) { - (yyval) = ex->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + yyval = ex->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy } - assert((yyval)); + assert(yyval); unit->error("missing data member name"); } +#line 3098 "src/Slice/Grammar.cpp" break; - case 98: -/* Line 1792 of yacc.c */ -#line 1070 "src/Slice/Grammar.y" - { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 104: /* struct_data_member: type_id */ +#line 1277 "src/Slice/Grammar.y" +{ + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, 0, "", ""); unit->currentContainer()->checkIntroduced(ts->v.second, dm); - (yyval) = dm; + yyval = dm; } +#line 3111 "src/Slice/Grammar.cpp" break; - case 99: -/* Line 1792 of yacc.c */ -#line 1079 "src/Slice/Grammar.y" - { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (3)])); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); + case 105: /* struct_data_member: type_id '=' const_initializer */ +#line 1286 "src/Slice/Grammar.y" +{ + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[-2]); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast(yyvsp[0]); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); - DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, value->v, + value->valueAsString, value->valueAsLiteral); unit->currentContainer()->checkIntroduced(ts->v.second, dm); - (yyval) = dm; + yyval = dm; } +#line 3126 "src/Slice/Grammar.cpp" break; - case 100: -/* Line 1792 of yacc.c */ -#line 1090 "src/Slice/Grammar.y" - { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 106: /* struct_data_member: tag type_id */ +#line 1297 "src/Slice/Grammar.y" +{ + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); - (yyval) = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert((yyval)); - unit->error("optional data members not supported in struct"); + yyval = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy + assert(yyval); + unit->error("tagged data members are not supported in structs"); } +#line 3139 "src/Slice/Grammar.cpp" break; - case 101: -/* Line 1792 of yacc.c */ -#line 1099 "src/Slice/Grammar.y" - { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(2) - (4)])); + case 107: /* struct_data_member: tag type_id '=' const_initializer */ +#line 1306 "src/Slice/Grammar.y" +{ + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[-2]); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); - (yyval) = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert((yyval)); - unit->error("optional data members not supported in struct"); + yyval = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy + assert(yyval); + unit->error("tagged data members are not supported in structs"); } +#line 3152 "src/Slice/Grammar.cpp" break; - case 102: -/* Line 1792 of yacc.c */ -#line 1108 "src/Slice/Grammar.y" - { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); - string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + case 108: /* struct_data_member: optional type_id */ +#line 1315 "src/Slice/Grammar.y" +{ + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); + StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); + assert(st); + yyval = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy + assert(yyval); + unit->error("tagged data members are not supported in structs"); +} +#line 3165 "src/Slice/Grammar.cpp" + break; + + case 109: /* struct_data_member: optional type_id '=' const_initializer */ +#line 1324 "src/Slice/Grammar.y" +{ + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[-2]); + StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); + assert(st); + yyval = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy + assert(yyval); + unit->error("tagged data members are not supported in structs"); +} +#line 3178 "src/Slice/Grammar.cpp" + break; + + case 110: /* struct_data_member: type keyword */ +#line 1333 "src/Slice/Grammar.y" +{ + TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); + string name = StringTokPtr::dynamicCast(yyvsp[0])->v; StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); - (yyval) = st->createDataMember(name, type, false, 0, 0, "", ""); // Dummy - assert((yyval)); + yyval = st->createDataMember(name, type, false, 0, 0, "", ""); // Dummy + assert(yyval); unit->error("keyword `" + name + "' cannot be used as data member name"); } +#line 3192 "src/Slice/Grammar.cpp" break; - case 103: -/* Line 1792 of yacc.c */ -#line 1118 "src/Slice/Grammar.y" - { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); + case 111: /* struct_data_member: type */ +#line 1343 "src/Slice/Grammar.y" +{ + TypePtr type = TypePtr::dynamicCast(yyvsp[0]); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); - (yyval) = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy - assert((yyval)); + yyval = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy + assert(yyval); unit->error("missing data member name"); } +#line 3205 "src/Slice/Grammar.cpp" break; - case 104: -/* Line 1792 of yacc.c */ -#line 1132 "src/Slice/Grammar.y" - { - OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); - m->v.type = TypePtr::dynamicCast((yyvsp[(2) - (2)])); - (yyval) = m; + case 112: /* return_type: tag type */ +#line 1357 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); + m->type = TypePtr::dynamicCast(yyvsp[0]); + yyval = m; } +#line 3215 "src/Slice/Grammar.cpp" break; - case 105: -/* Line 1792 of yacc.c */ -#line 1138 "src/Slice/Grammar.y" - { - OptionalDefTokPtr m = new OptionalDefTok(); - m->v.type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); - m->v.optional = false; - m->v.tag = -1; - (yyval) = m; + case 113: /* return_type: optional type */ +#line 1363 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); + m->type = TypePtr::dynamicCast(yyvsp[0]); + yyval = m; } +#line 3225 "src/Slice/Grammar.cpp" break; - case 106: -/* Line 1792 of yacc.c */ -#line 1146 "src/Slice/Grammar.y" - { - OptionalDefTokPtr m = new OptionalDefTok; - m->v.optional = false; - m->v.tag = -1; - (yyval) = m; + case 114: /* return_type: type */ +#line 1369 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr m = new TaggedDefTok(-1); + m->type = TypePtr::dynamicCast(yyvsp[0]); + yyval = m; } +#line 3235 "src/Slice/Grammar.cpp" break; - case 107: -/* Line 1792 of yacc.c */ -#line 1158 "src/Slice/Grammar.y" - { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); - string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + case 115: /* return_type: ICE_VOID */ +#line 1375 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr m = new TaggedDefTok(-1); + yyval = m; +} +#line 3244 "src/Slice/Grammar.cpp" + break; + + case 116: /* operation_preamble: return_type ICE_IDENT_OPEN */ +#line 1385 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); + string name = StringTokPtr::dynamicCast(yyvsp[0])->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); + OperationPtr op = cl->createOperation(name, returnType->type, returnType->isTagged, returnType->tag); if(op) { cl->checkIntroduced(name, op); unit->pushContainer(op); - (yyval) = op; + yyval = op; } else { - (yyval) = 0; + yyval = 0; } } else { - (yyval) = 0; + yyval = 0; } } +#line 3272 "src/Slice/Grammar.cpp" break; - case 108: -/* Line 1792 of yacc.c */ -#line 1182 "src/Slice/Grammar.y" - { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(2) - (3)])); - string name = StringTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v; + case 117: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_IDENT_OPEN */ +#line 1409 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); + string name = StringTokPtr::dynamicCast(yyvsp[0])->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, + OperationPtr op = cl->createOperation(name, returnType->type, returnType->isTagged, returnType->tag, Operation::Idempotent); if(op) { cl->checkIntroduced(name, op); unit->pushContainer(op); - (yyval) = op; + yyval = op; } else { - (yyval) = 0; + yyval = 0; } } else { - (yyval) = 0; + yyval = 0; } } +#line 3301 "src/Slice/Grammar.cpp" break; - case 109: -/* Line 1792 of yacc.c */ -#line 1207 "src/Slice/Grammar.y" - { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); - string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + case 118: /* operation_preamble: return_type ICE_KEYWORD_OPEN */ +#line 1434 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); + string name = StringTokPtr::dynamicCast(yyvsp[0])->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); + OperationPtr op = cl->createOperation(name, returnType->type, returnType->isTagged, returnType->tag); if(op) { unit->pushContainer(op); unit->error("keyword `" + name + "' cannot be used as operation name"); - (yyval) = op; // Dummy + yyval = op; // Dummy } else { - (yyval) = 0; + yyval = 0; } } else { - (yyval) = 0; + yyval = 0; } } +#line 3329 "src/Slice/Grammar.cpp" break; - case 110: -/* Line 1792 of yacc.c */ -#line 1231 "src/Slice/Grammar.y" - { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(2) - (3)])); - string name = StringTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v; + case 119: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_KEYWORD_OPEN */ +#line 1458 "src/Slice/Grammar.y" +{ + TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); + string name = StringTokPtr::dynamicCast(yyvsp[0])->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, + OperationPtr op = cl->createOperation(name, returnType->type, returnType->isTagged, returnType->tag, Operation::Idempotent); if(op) { unit->pushContainer(op); unit->error("keyword `" + name + "' cannot be used as operation name"); - (yyval) = op; // Dummy + yyval = op; // Dummy } else { @@ -3227,142 +3351,142 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); } else { - (yyval) = 0; + yyval = 0; } } +#line 3358 "src/Slice/Grammar.cpp" break; - case 111: -/* Line 1792 of yacc.c */ -#line 1261 "src/Slice/Grammar.y" - { - if((yyvsp[(1) - (3)])) + case 120: /* @18: %empty */ +#line 1488 "src/Slice/Grammar.y" +{ + if(yyvsp[-2]) { unit->popContainer(); - (yyval) = (yyvsp[(1) - (3)]); + yyval = yyvsp[-2]; } else { - (yyval) = 0; + yyval = 0; } } +#line 3374 "src/Slice/Grammar.cpp" break; - case 112: -/* Line 1792 of yacc.c */ -#line 1273 "src/Slice/Grammar.y" - { - OperationPtr op = OperationPtr::dynamicCast((yyvsp[(4) - (5)])); - ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[(5) - (5)])); + case 121: /* operation: operation_preamble parameters ')' @18 throws */ +#line 1500 "src/Slice/Grammar.y" +{ + OperationPtr op = OperationPtr::dynamicCast(yyvsp[-1]); + ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast(yyvsp[0]); assert(el); if(op) { op->setExceptionList(el->v); } } +#line 3388 "src/Slice/Grammar.cpp" break; - case 113: -/* Line 1792 of yacc.c */ -#line 1283 "src/Slice/Grammar.y" - { - if((yyvsp[(1) - (3)])) + case 122: /* @19: %empty */ +#line 1510 "src/Slice/Grammar.y" +{ + if(yyvsp[-2]) { unit->popContainer(); } yyerrok; } +#line 3400 "src/Slice/Grammar.cpp" break; - case 114: -/* Line 1792 of yacc.c */ -#line 1291 "src/Slice/Grammar.y" - { - OperationPtr op = OperationPtr::dynamicCast((yyvsp[(4) - (5)])); - ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[(5) - (5)])); + case 123: /* operation: operation_preamble error ')' @19 throws */ +#line 1518 "src/Slice/Grammar.y" +{ + OperationPtr op = OperationPtr::dynamicCast(yyvsp[-1]); + ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast(yyvsp[0]); assert(el); if(op) { op->setExceptionList(el->v); // Dummy } } +#line 3414 "src/Slice/Grammar.cpp" break; - case 117: -/* Line 1792 of yacc.c */ -#line 1313 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(2) - (2)]); + case 126: /* interface_id: ICE_INTERFACE ICE_IDENTIFIER */ +#line 1540 "src/Slice/Grammar.y" +{ + yyval = yyvsp[0]; } +#line 3422 "src/Slice/Grammar.cpp" break; - case 118: -/* Line 1792 of yacc.c */ -#line 1317 "src/Slice/Grammar.y" - { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 127: /* interface_id: ICE_INTERFACE keyword */ +#line 1544 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as interface name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy + yyval = yyvsp[0]; // Dummy } +#line 3432 "src/Slice/Grammar.cpp" break; - case 119: -/* Line 1792 of yacc.c */ -#line 1328 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 128: /* interface_decl: local_qualifier interface_id */ +#line 1555 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-1]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); ClassDeclPtr cl = cont->createClassDecl(ident->v, true, local->v); cont->checkIntroduced(ident->v, cl); - (yyval) = cl; + yyval = cl; } +#line 3445 "src/Slice/Grammar.cpp" break; - case 120: -/* Line 1792 of yacc.c */ -#line 1342 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); + case 129: /* @20: %empty */ +#line 1569 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-2]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[-1]); ContainerPtr cont = unit->currentContainer(); - ClassListTokPtr bases = ClassListTokPtr::dynamicCast((yyvsp[(3) - (3)])); + ClassListTokPtr bases = ClassListTokPtr::dynamicCast(yyvsp[0]); ClassDefPtr cl = cont->createClassDef(ident->v, -1, true, bases->v, local->v); if(cl) { - cont->checkIntroduced(ident->v, cl); - unit->pushContainer(cl); - (yyval) = cl; + cont->checkIntroduced(ident->v, cl); + unit->pushContainer(cl); + yyval = cl; } else { - (yyval) = 0; + yyval = 0; } } +#line 3467 "src/Slice/Grammar.cpp" break; - case 121: -/* Line 1792 of yacc.c */ -#line 1360 "src/Slice/Grammar.y" - { - if((yyvsp[(4) - (7)])) + case 130: /* interface_def: local_qualifier interface_id interface_extends @20 '{' interface_exports '}' */ +#line 1587 "src/Slice/Grammar.y" +{ + if(yyvsp[-3]) { - unit->popContainer(); - (yyval) = (yyvsp[(4) - (7)]); + unit->popContainer(); + yyval = yyvsp[-3]; } else { - (yyval) = 0; + yyval = 0; } } +#line 3483 "src/Slice/Grammar.cpp" break; - case 122: -/* Line 1792 of yacc.c */ -#line 1377 "src/Slice/Grammar.y" - { - ClassListTokPtr intfs = ClassListTokPtr::dynamicCast((yyvsp[(3) - (3)])); - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); + case 131: /* interface_list: scoped_name ',' interface_list */ +#line 1604 "src/Slice/Grammar.y" +{ + ClassListTokPtr intfs = ClassListTokPtr::dynamicCast(yyvsp[0]); + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-2]); ContainerPtr cont = unit->currentContainer(); TypeList types = cont->lookupType(scoped->v); if(!types.empty()) @@ -3392,16 +3516,16 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); } } } - (yyval) = intfs; + yyval = intfs; } +#line 3522 "src/Slice/Grammar.cpp" break; - case 123: -/* Line 1792 of yacc.c */ -#line 1412 "src/Slice/Grammar.y" - { + case 132: /* interface_list: scoped_name */ +#line 1639 "src/Slice/Grammar.y" +{ ClassListTokPtr intfs = new ClassListTok; - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); TypeList types = cont->lookupType(scoped->v); if(!types.empty()) @@ -3431,209 +3555,209 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); } } } - (yyval) = intfs; + yyval = intfs; } +#line 3561 "src/Slice/Grammar.cpp" break; - case 124: -/* Line 1792 of yacc.c */ -#line 1447 "src/Slice/Grammar.y" - { + case 133: /* interface_list: ICE_OBJECT */ +#line 1674 "src/Slice/Grammar.y" +{ unit->error("illegal inheritance from type Object"); - (yyval) = new ClassListTok; // Dummy + yyval = new ClassListTok; // Dummy } +#line 3570 "src/Slice/Grammar.cpp" break; - case 125: -/* Line 1792 of yacc.c */ -#line 1452 "src/Slice/Grammar.y" - { + case 134: /* interface_list: ICE_VALUE */ +#line 1679 "src/Slice/Grammar.y" +{ unit->error("illegal inheritance from type Value"); - (yyval) = new ClassListTok; // Dummy + yyval = new ClassListTok; // Dummy } +#line 3579 "src/Slice/Grammar.cpp" break; - case 126: -/* Line 1792 of yacc.c */ -#line 1462 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(2) - (2)]); + case 135: /* interface_extends: extends interface_list */ +#line 1689 "src/Slice/Grammar.y" +{ + yyval = yyvsp[0]; } +#line 3587 "src/Slice/Grammar.cpp" break; - case 127: -/* Line 1792 of yacc.c */ -#line 1466 "src/Slice/Grammar.y" - { - (yyval) = new ClassListTok; + case 136: /* interface_extends: %empty */ +#line 1693 "src/Slice/Grammar.y" +{ + yyval = new ClassListTok; } +#line 3595 "src/Slice/Grammar.cpp" break; - case 128: -/* Line 1792 of yacc.c */ -#line 1475 "src/Slice/Grammar.y" - { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + case 137: /* interface_exports: meta_data interface_export ';' interface_exports */ +#line 1702 "src/Slice/Grammar.y" +{ + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); + ContainedPtr contained = ContainedPtr::dynamicCast(yyvsp[-2]); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } } +#line 3608 "src/Slice/Grammar.cpp" break; - case 129: -/* Line 1792 of yacc.c */ -#line 1484 "src/Slice/Grammar.y" - { + case 138: /* interface_exports: error ';' interface_exports */ +#line 1711 "src/Slice/Grammar.y" +{ } +#line 3615 "src/Slice/Grammar.cpp" break; - case 130: -/* Line 1792 of yacc.c */ -#line 1487 "src/Slice/Grammar.y" - { + case 139: /* interface_exports: meta_data interface_export */ +#line 1714 "src/Slice/Grammar.y" +{ unit->error("`;' missing after definition"); } +#line 3623 "src/Slice/Grammar.cpp" break; - case 131: -/* Line 1792 of yacc.c */ -#line 1491 "src/Slice/Grammar.y" - { + case 140: /* interface_exports: %empty */ +#line 1718 "src/Slice/Grammar.y" +{ } +#line 3630 "src/Slice/Grammar.cpp" break; - case 133: -/* Line 1792 of yacc.c */ -#line 1505 "src/Slice/Grammar.y" - { - ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[(1) - (3)])); - ExceptionListTokPtr exceptionList = ExceptionListTokPtr::dynamicCast((yyvsp[(3) - (3)])); + case 142: /* exception_list: exception ',' exception_list */ +#line 1732 "src/Slice/Grammar.y" +{ + ExceptionPtr exception = ExceptionPtr::dynamicCast(yyvsp[-2]); + ExceptionListTokPtr exceptionList = ExceptionListTokPtr::dynamicCast(yyvsp[0]); exceptionList->v.push_front(exception); - (yyval) = exceptionList; + yyval = exceptionList; } +#line 3641 "src/Slice/Grammar.cpp" break; - case 134: -/* Line 1792 of yacc.c */ -#line 1512 "src/Slice/Grammar.y" - { - ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[(1) - (1)])); + case 143: /* exception_list: exception */ +#line 1739 "src/Slice/Grammar.y" +{ + ExceptionPtr exception = ExceptionPtr::dynamicCast(yyvsp[0]); ExceptionListTokPtr exceptionList = new ExceptionListTok; exceptionList->v.push_front(exception); - (yyval) = exceptionList; + yyval = exceptionList; } +#line 3652 "src/Slice/Grammar.cpp" break; - case 135: -/* Line 1792 of yacc.c */ -#line 1524 "src/Slice/Grammar.y" - { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 144: /* exception: scoped_name */ +#line 1751 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); ExceptionPtr exception = cont->lookupException(scoped->v); if(!exception) { - exception = cont->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy + exception = cont->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy } cont->checkIntroduced(scoped->v, exception); - (yyval) = exception; + yyval = exception; } +#line 3668 "src/Slice/Grammar.cpp" break; - case 136: -/* Line 1792 of yacc.c */ -#line 1536 "src/Slice/Grammar.y" - { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 145: /* exception: keyword */ +#line 1763 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as exception name"); - (yyval) = unit->currentContainer()->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy + yyval = unit->currentContainer()->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy } +#line 3678 "src/Slice/Grammar.cpp" break; - case 137: -/* Line 1792 of yacc.c */ -#line 1547 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (7)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(7) - (7)])); - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (7)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (7)])); + case 146: /* sequence_def: local_qualifier ICE_SEQUENCE '<' meta_data type '>' ICE_IDENTIFIER */ +#line 1774 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-6]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); + TypePtr type = TypePtr::dynamicCast(yyvsp[-2]); ContainerPtr cont = unit->currentContainer(); - (yyval) = cont->createSequence(ident->v, type, metaData->v, local->v); + yyval = cont->createSequence(ident->v, type, metaData->v, local->v); } +#line 3691 "src/Slice/Grammar.cpp" break; - case 138: -/* Line 1792 of yacc.c */ -#line 1556 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (7)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(7) - (7)])); - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (7)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (7)])); + case 147: /* sequence_def: local_qualifier ICE_SEQUENCE '<' meta_data type '>' keyword */ +#line 1783 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-6]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); + TypePtr type = TypePtr::dynamicCast(yyvsp[-2]); ContainerPtr cont = unit->currentContainer(); - (yyval) = cont->createSequence(ident->v, type, metaData->v, local->v); // Dummy + yyval = cont->createSequence(ident->v, type, metaData->v, local->v); // Dummy unit->error("keyword `" + ident->v + "' cannot be used as sequence name"); } +#line 3705 "src/Slice/Grammar.cpp" break; - case 139: -/* Line 1792 of yacc.c */ -#line 1571 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (10)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(10) - (10)])); - StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (10)])); - TypePtr keyType = TypePtr::dynamicCast((yyvsp[(5) - (10)])); - StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast((yyvsp[(7) - (10)])); - TypePtr valueType = TypePtr::dynamicCast((yyvsp[(8) - (10)])); + case 148: /* dictionary_def: local_qualifier ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' ICE_IDENTIFIER */ +#line 1798 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-9]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); + StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast(yyvsp[-6]); + TypePtr keyType = TypePtr::dynamicCast(yyvsp[-5]); + StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast(yyvsp[-3]); + TypePtr valueType = TypePtr::dynamicCast(yyvsp[-2]); ContainerPtr cont = unit->currentContainer(); - (yyval) = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v, local->v); + yyval = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v, local->v); } +#line 3720 "src/Slice/Grammar.cpp" break; - case 140: -/* Line 1792 of yacc.c */ -#line 1582 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (10)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(10) - (10)])); - StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (10)])); - TypePtr keyType = TypePtr::dynamicCast((yyvsp[(5) - (10)])); - StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast((yyvsp[(7) - (10)])); - TypePtr valueType = TypePtr::dynamicCast((yyvsp[(8) - (10)])); + case 149: /* dictionary_def: local_qualifier ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' keyword */ +#line 1809 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-9]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); + StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast(yyvsp[-6]); + TypePtr keyType = TypePtr::dynamicCast(yyvsp[-5]); + StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast(yyvsp[-3]); + TypePtr valueType = TypePtr::dynamicCast(yyvsp[-2]); ContainerPtr cont = unit->currentContainer(); - (yyval) = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v, local->v); // Dummy + yyval = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v, local->v); // Dummy unit->error("keyword `" + ident->v + "' cannot be used as dictionary name"); } +#line 3736 "src/Slice/Grammar.cpp" break; - case 141: -/* Line 1792 of yacc.c */ -#line 1599 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(2) - (2)]); + case 150: /* enum_id: ICE_ENUM ICE_IDENTIFIER */ +#line 1826 "src/Slice/Grammar.y" +{ + yyval = yyvsp[0]; } +#line 3744 "src/Slice/Grammar.cpp" break; - case 142: -/* Line 1792 of yacc.c */ -#line 1603 "src/Slice/Grammar.y" - { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 151: /* enum_id: ICE_ENUM keyword */ +#line 1830 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as enumeration name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy + yyval = yyvsp[0]; // Dummy } +#line 3754 "src/Slice/Grammar.cpp" break; - case 143: -/* Line 1792 of yacc.c */ -#line 1614 "src/Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 152: /* @21: %empty */ +#line 1841 "src/Slice/Grammar.y" +{ + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-1]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); EnumPtr en = cont->createEnum(ident->v, local->v); if(en) @@ -3645,72 +3769,72 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); en = cont->createEnum(IceUtil::generateUUID(), local->v, Dummy); } unit->pushContainer(en); - (yyval) = en; + yyval = en; } +#line 3775 "src/Slice/Grammar.cpp" break; - case 144: -/* Line 1792 of yacc.c */ -#line 1631 "src/Slice/Grammar.y" - { - EnumPtr en = EnumPtr::dynamicCast((yyvsp[(3) - (6)])); + case 153: /* enum_def: local_qualifier enum_id @21 '{' enumerator_list '}' */ +#line 1858 "src/Slice/Grammar.y" +{ + EnumPtr en = EnumPtr::dynamicCast(yyvsp[-3]); if(en) { - EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast((yyvsp[(5) - (6)])); + EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast(yyvsp[-1]); if(enumerators->v.empty()) { unit->error("enum `" + en->name() + "' must have at least one enumerator"); } unit->popContainer(); } - (yyval) = (yyvsp[(3) - (6)]); + yyval = yyvsp[-3]; } +#line 3793 "src/Slice/Grammar.cpp" break; - case 145: -/* Line 1792 of yacc.c */ -#line 1646 "src/Slice/Grammar.y" - { + case 154: /* @22: %empty */ +#line 1873 "src/Slice/Grammar.y" +{ unit->error("missing enumeration name"); - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); + BoolTokPtr local = BoolTokPtr::dynamicCast(yyvsp[-1]); ContainerPtr cont = unit->currentContainer(); EnumPtr en = cont->createEnum(IceUtil::generateUUID(), local->v, Dummy); unit->pushContainer(en); - (yyval) = en; + yyval = en; } +#line 3806 "src/Slice/Grammar.cpp" break; - case 146: -/* Line 1792 of yacc.c */ -#line 1655 "src/Slice/Grammar.y" - { + case 155: /* enum_def: local_qualifier ICE_ENUM @22 '{' enumerator_list '}' */ +#line 1882 "src/Slice/Grammar.y" +{ unit->popContainer(); - (yyval) = (yyvsp[(2) - (6)]); + yyval = yyvsp[-4]; } +#line 3815 "src/Slice/Grammar.cpp" break; - case 147: -/* Line 1792 of yacc.c */ -#line 1665 "src/Slice/Grammar.y" - { - EnumeratorListTokPtr ens = EnumeratorListTokPtr::dynamicCast((yyvsp[(1) - (3)])); - ens->v.splice(ens->v.end(), EnumeratorListTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v); - (yyval) = ens; + case 156: /* enumerator_list: enumerator ',' enumerator_list */ +#line 1892 "src/Slice/Grammar.y" +{ + EnumeratorListTokPtr ens = EnumeratorListTokPtr::dynamicCast(yyvsp[-2]); + ens->v.splice(ens->v.end(), EnumeratorListTokPtr::dynamicCast(yyvsp[0])->v); + yyval = ens; } +#line 3825 "src/Slice/Grammar.cpp" break; - case 148: -/* Line 1792 of yacc.c */ -#line 1671 "src/Slice/Grammar.y" - { + case 157: /* enumerator_list: enumerator */ +#line 1898 "src/Slice/Grammar.y" +{ } +#line 3832 "src/Slice/Grammar.cpp" break; - case 149: -/* Line 1792 of yacc.c */ -#line 1679 "src/Slice/Grammar.y" - { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 158: /* enumerator: ICE_IDENTIFIER */ +#line 1906 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); EnumeratorListTokPtr ens = new EnumeratorListTok; ContainerPtr cont = unit->currentContainer(); EnumeratorPtr en = cont->createEnumerator(ident->v); @@ -3718,18 +3842,18 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); { ens->v.push_front(en); } - (yyval) = ens; + yyval = ens; } +#line 3848 "src/Slice/Grammar.cpp" break; - case 150: -/* Line 1792 of yacc.c */ -#line 1691 "src/Slice/Grammar.y" - { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); + case 159: /* enumerator: ICE_IDENTIFIER '=' enumerator_initializer */ +#line 1918 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[-2]); EnumeratorListTokPtr ens = new EnumeratorListTok; ContainerPtr cont = unit->currentContainer(); - IntegerTokPtr intVal = IntegerTokPtr::dynamicCast((yyvsp[(3) - (3)])); + IntegerTokPtr intVal = IntegerTokPtr::dynamicCast(yyvsp[0]); if(intVal) { if(intVal->v < 0 || intVal->v > Int32Max) @@ -3742,43 +3866,43 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); ens->v.push_front(en); } } - (yyval) = ens; + yyval = ens; } +#line 3872 "src/Slice/Grammar.cpp" break; - case 151: -/* Line 1792 of yacc.c */ -#line 1711 "src/Slice/Grammar.y" - { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 160: /* enumerator: keyword */ +#line 1938 "src/Slice/Grammar.y" +{ + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as enumerator"); EnumeratorListTokPtr ens = new EnumeratorListTok; // Dummy - (yyval) = ens; + yyval = ens; } +#line 3883 "src/Slice/Grammar.cpp" break; - case 152: -/* Line 1792 of yacc.c */ -#line 1718 "src/Slice/Grammar.y" - { + case 161: /* enumerator: %empty */ +#line 1945 "src/Slice/Grammar.y" +{ EnumeratorListTokPtr ens = new EnumeratorListTok; - (yyval) = ens; // Dummy + yyval = ens; // Dummy } +#line 3892 "src/Slice/Grammar.cpp" break; - case 153: -/* Line 1792 of yacc.c */ -#line 1728 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(1) - (1)]); + case 162: /* enumerator_initializer: ICE_INTEGER_LITERAL */ +#line 1955 "src/Slice/Grammar.y" +{ + yyval = yyvsp[0]; } +#line 3900 "src/Slice/Grammar.cpp" break; - case 154: -/* Line 1792 of yacc.c */ -#line 1732 "src/Slice/Grammar.y" - { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 163: /* enumerator_initializer: scoped_name */ +#line 1959 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ContainedList cl = unit->currentContainer()->lookupContained(scoped->v); IntegerTokPtr tok; if(!cl.empty()) @@ -3808,84 +3932,84 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); unit->error(msg); // $$ is dummy } - (yyval) = tok; + yyval = tok; } +#line 3938 "src/Slice/Grammar.cpp" break; - case 155: -/* Line 1792 of yacc.c */ -#line 1771 "src/Slice/Grammar.y" - { + case 164: /* out_qualifier: ICE_OUT */ +#line 1998 "src/Slice/Grammar.y" +{ BoolTokPtr out = new BoolTok; out->v = true; - (yyval) = out; + yyval = out; } +#line 3948 "src/Slice/Grammar.cpp" break; - case 156: -/* Line 1792 of yacc.c */ -#line 1777 "src/Slice/Grammar.y" - { + case 165: /* out_qualifier: %empty */ +#line 2004 "src/Slice/Grammar.y" +{ BoolTokPtr out = new BoolTok; out->v = false; - (yyval) = out; + yyval = out; } +#line 3958 "src/Slice/Grammar.cpp" break; - case 157: -/* Line 1792 of yacc.c */ -#line 1788 "src/Slice/Grammar.y" - { + case 166: /* parameters: %empty */ +#line 2015 "src/Slice/Grammar.y" +{ } +#line 3965 "src/Slice/Grammar.cpp" break; - case 158: -/* Line 1792 of yacc.c */ -#line 1791 "src/Slice/Grammar.y" - { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); - OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); + case 167: /* parameters: out_qualifier meta_data tagged_type_id */ +#line 2018 "src/Slice/Grammar.y" +{ + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-2]); + TaggedDefTokPtr tsp = TaggedDefTokPtr::dynamicCast(yyvsp[0]); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); - unit->currentContainer()->checkIntroduced(tsp->v.name, pd); - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (3)])); + ParamDeclPtr pd = op->createParamDecl(tsp->name, tsp->type, isOutParam->v, tsp->isTagged, tsp->tag); + unit->currentContainer()->checkIntroduced(tsp->name, pd); + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-1]); if(!metaData->v.empty()) { pd->setMetaData(metaData->v); } } } +#line 3985 "src/Slice/Grammar.cpp" break; - case 159: -/* Line 1792 of yacc.c */ -#line 1807 "src/Slice/Grammar.y" - { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (5)])); - OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast((yyvsp[(5) - (5)])); + case 168: /* parameters: parameters ',' out_qualifier meta_data tagged_type_id */ +#line 2034 "src/Slice/Grammar.y" +{ + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-2]); + TaggedDefTokPtr tsp = TaggedDefTokPtr::dynamicCast(yyvsp[0]); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); - unit->currentContainer()->checkIntroduced(tsp->v.name, pd); - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (5)])); + ParamDeclPtr pd = op->createParamDecl(tsp->name, tsp->type, isOutParam->v, tsp->isTagged, tsp->tag); + unit->currentContainer()->checkIntroduced(tsp->name, pd); + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-1]); if(!metaData->v.empty()) { pd->setMetaData(metaData->v); } } } +#line 4005 "src/Slice/Grammar.cpp" break; - case 160: -/* Line 1792 of yacc.c */ -#line 1823 "src/Slice/Grammar.y" - { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (4)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(3) - (4)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(4) - (4)])); + case 169: /* parameters: out_qualifier meta_data type keyword */ +#line 2050 "src/Slice/Grammar.y" +{ + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-3]); + TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { @@ -3893,15 +4017,15 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } } +#line 4021 "src/Slice/Grammar.cpp" break; - case 161: -/* Line 1792 of yacc.c */ -#line 1835 "src/Slice/Grammar.y" - { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (6)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (6)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(6) - (6)])); + case 170: /* parameters: parameters ',' out_qualifier meta_data type keyword */ +#line 2062 "src/Slice/Grammar.y" +{ + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-3]); + TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { @@ -3909,14 +4033,14 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } } +#line 4037 "src/Slice/Grammar.cpp" break; - case 162: -/* Line 1792 of yacc.c */ -#line 1847 "src/Slice/Grammar.y" - { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(3) - (3)])); + case 171: /* parameters: out_qualifier meta_data type */ +#line 2074 "src/Slice/Grammar.y" +{ + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-2]); + TypePtr type = TypePtr::dynamicCast(yyvsp[0]); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { @@ -3924,14 +4048,14 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); unit->error("missing parameter name"); } } +#line 4052 "src/Slice/Grammar.cpp" break; - case 163: -/* Line 1792 of yacc.c */ -#line 1858 "src/Slice/Grammar.y" - { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (5)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (5)])); + case 172: /* parameters: parameters ',' out_qualifier meta_data type */ +#line 2085 "src/Slice/Grammar.y" +{ + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-2]); + TypePtr type = TypePtr::dynamicCast(yyvsp[0]); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { @@ -3939,139 +4063,139 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); unit->error("missing parameter name"); } } +#line 4067 "src/Slice/Grammar.cpp" break; - case 164: -/* Line 1792 of yacc.c */ -#line 1874 "src/Slice/Grammar.y" - { - (yyval) = (yyvsp[(2) - (2)]); + case 173: /* throws: ICE_THROWS exception_list */ +#line 2101 "src/Slice/Grammar.y" +{ + yyval = yyvsp[0]; } +#line 4075 "src/Slice/Grammar.cpp" break; - case 165: -/* Line 1792 of yacc.c */ -#line 1878 "src/Slice/Grammar.y" - { - (yyval) = new ExceptionListTok; + case 174: /* throws: %empty */ +#line 2105 "src/Slice/Grammar.y" +{ + yyval = new ExceptionListTok; } +#line 4083 "src/Slice/Grammar.cpp" break; - case 166: -/* Line 1792 of yacc.c */ -#line 1887 "src/Slice/Grammar.y" - { + case 175: /* scoped_name: ICE_IDENTIFIER */ +#line 2114 "src/Slice/Grammar.y" +{ } +#line 4090 "src/Slice/Grammar.cpp" break; - case 167: -/* Line 1792 of yacc.c */ -#line 1890 "src/Slice/Grammar.y" - { + case 176: /* scoped_name: ICE_SCOPED_IDENTIFIER */ +#line 2117 "src/Slice/Grammar.y" +{ } +#line 4097 "src/Slice/Grammar.cpp" break; - case 168: -/* Line 1792 of yacc.c */ -#line 1898 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindByte); + case 177: /* type: ICE_BYTE */ +#line 2125 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindByte); } +#line 4105 "src/Slice/Grammar.cpp" break; - case 169: -/* Line 1792 of yacc.c */ -#line 1902 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindBool); + case 178: /* type: ICE_BOOL */ +#line 2129 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindBool); } +#line 4113 "src/Slice/Grammar.cpp" break; - case 170: -/* Line 1792 of yacc.c */ -#line 1906 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindShort); + case 179: /* type: ICE_SHORT */ +#line 2133 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindShort); } +#line 4121 "src/Slice/Grammar.cpp" break; - case 171: -/* Line 1792 of yacc.c */ -#line 1910 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindInt); + case 180: /* type: ICE_INT */ +#line 2137 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindInt); } +#line 4129 "src/Slice/Grammar.cpp" break; - case 172: -/* Line 1792 of yacc.c */ -#line 1914 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindLong); + case 181: /* type: ICE_LONG */ +#line 2141 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindLong); } +#line 4137 "src/Slice/Grammar.cpp" break; - case 173: -/* Line 1792 of yacc.c */ -#line 1918 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindFloat); + case 182: /* type: ICE_FLOAT */ +#line 2145 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindFloat); } +#line 4145 "src/Slice/Grammar.cpp" break; - case 174: -/* Line 1792 of yacc.c */ -#line 1922 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindDouble); + case 183: /* type: ICE_DOUBLE */ +#line 2149 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindDouble); } +#line 4153 "src/Slice/Grammar.cpp" break; - case 175: -/* Line 1792 of yacc.c */ -#line 1926 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindString); + case 184: /* type: ICE_STRING */ +#line 2153 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindString); } +#line 4161 "src/Slice/Grammar.cpp" break; - case 176: -/* Line 1792 of yacc.c */ -#line 1930 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindObject); + case 185: /* type: ICE_OBJECT */ +#line 2157 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindObject); } +#line 4169 "src/Slice/Grammar.cpp" break; - case 177: -/* Line 1792 of yacc.c */ -#line 1934 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindObjectProxy); + case 186: /* type: ICE_OBJECT '*' */ +#line 2161 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindObjectProxy); } +#line 4177 "src/Slice/Grammar.cpp" break; - case 178: -/* Line 1792 of yacc.c */ -#line 1938 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindLocalObject); + case 187: /* type: ICE_LOCAL_OBJECT */ +#line 2165 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindLocalObject); } +#line 4185 "src/Slice/Grammar.cpp" break; - case 179: -/* Line 1792 of yacc.c */ -#line 1942 "src/Slice/Grammar.y" - { - (yyval) = unit->builtin(Builtin::KindValue); + case 188: /* type: ICE_VALUE */ +#line 2169 "src/Slice/Grammar.y" +{ + yyval = unit->builtin(Builtin::KindValue); } +#line 4193 "src/Slice/Grammar.cpp" break; - case 180: -/* Line 1792 of yacc.c */ -#line 1946 "src/Slice/Grammar.y" - { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 189: /* type: scoped_name */ +#line 2173 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); if(cont) { @@ -4081,20 +4205,20 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); YYERROR; // Can't continue, jump to next yyerrok } cont->checkIntroduced(scoped->v); - (yyval) = types.front(); + yyval = types.front(); } else { - (yyval) = 0; + yyval = 0; } } +#line 4216 "src/Slice/Grammar.cpp" break; - case 181: -/* Line 1792 of yacc.c */ -#line 1965 "src/Slice/Grammar.y" - { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (2)])); + case 190: /* type: scoped_name '*' */ +#line 2192 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-1]); ContainerPtr cont = unit->currentContainer(); if(cont) { @@ -4121,122 +4245,111 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); } *p = new Proxy(cl); } - (yyval) = types.front(); + yyval = types.front(); } else { - (yyval) = 0; + yyval = 0; } } +#line 4256 "src/Slice/Grammar.cpp" break; - case 182: -/* Line 1792 of yacc.c */ -#line 2006 "src/Slice/Grammar.y" - { - StringTokPtr str1 = StringTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr str2 = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + case 191: /* string_literal: ICE_STRING_LITERAL string_literal */ +#line 2233 "src/Slice/Grammar.y" +{ + StringTokPtr str1 = StringTokPtr::dynamicCast(yyvsp[-1]); + StringTokPtr str2 = StringTokPtr::dynamicCast(yyvsp[0]); str1->v += str2->v; } +#line 4266 "src/Slice/Grammar.cpp" break; - case 183: -/* Line 1792 of yacc.c */ -#line 2012 "src/Slice/Grammar.y" - { + case 192: /* string_literal: ICE_STRING_LITERAL */ +#line 2239 "src/Slice/Grammar.y" +{ } +#line 4273 "src/Slice/Grammar.cpp" break; - case 184: -/* Line 1792 of yacc.c */ -#line 2020 "src/Slice/Grammar.y" - { - StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[(3) - (3)])); - StringListTokPtr stringList = StringListTokPtr::dynamicCast((yyvsp[(1) - (3)])); + case 193: /* string_list: string_list ',' string_literal */ +#line 2247 "src/Slice/Grammar.y" +{ + StringTokPtr str = StringTokPtr::dynamicCast(yyvsp[0]); + StringListTokPtr stringList = StringListTokPtr::dynamicCast(yyvsp[-2]); stringList->v.push_back(str->v); - (yyval) = stringList; + yyval = stringList; } +#line 4284 "src/Slice/Grammar.cpp" break; - case 185: -/* Line 1792 of yacc.c */ -#line 2027 "src/Slice/Grammar.y" - { - StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + case 194: /* string_list: string_literal */ +#line 2254 "src/Slice/Grammar.y" +{ + StringTokPtr str = StringTokPtr::dynamicCast(yyvsp[0]); StringListTokPtr stringList = new StringListTok; stringList->v.push_back(str->v); - (yyval) = stringList; + yyval = stringList; } +#line 4295 "src/Slice/Grammar.cpp" break; - case 186: -/* Line 1792 of yacc.c */ -#line 2039 "src/Slice/Grammar.y" - { + case 195: /* local_qualifier: ICE_LOCAL */ +#line 2266 "src/Slice/Grammar.y" +{ BoolTokPtr local = new BoolTok; local->v = true; - (yyval) = local; + yyval = local; } +#line 4305 "src/Slice/Grammar.cpp" break; - case 187: -/* Line 1792 of yacc.c */ -#line 2045 "src/Slice/Grammar.y" - { + case 196: /* local_qualifier: %empty */ +#line 2272 "src/Slice/Grammar.y" +{ BoolTokPtr local = new BoolTok; local->v = false; - (yyval) = local; + yyval = local; } +#line 4315 "src/Slice/Grammar.cpp" break; - case 188: -/* Line 1792 of yacc.c */ -#line 2056 "src/Slice/Grammar.y" - { + case 197: /* const_initializer: ICE_INTEGER_LITERAL */ +#line 2283 "src/Slice/Grammar.y" +{ BuiltinPtr type = unit->builtin(Builtin::KindLong); - IntegerTokPtr intVal = IntegerTokPtr::dynamicCast((yyvsp[(1) - (1)])); + IntegerTokPtr intVal = IntegerTokPtr::dynamicCast(yyvsp[0]); ostringstream sstr; sstr << intVal->v; - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = sstr.str(); - def->v.valueAsLiteral = intVal->literal; - (yyval) = def; + ConstDefTokPtr def = new ConstDefTok(type, sstr.str(), intVal->literal); + yyval = def; } +#line 4328 "src/Slice/Grammar.cpp" break; - case 189: -/* Line 1792 of yacc.c */ -#line 2069 "src/Slice/Grammar.y" - { + case 198: /* const_initializer: ICE_FLOATING_POINT_LITERAL */ +#line 2292 "src/Slice/Grammar.y" +{ BuiltinPtr type = unit->builtin(Builtin::KindDouble); - FloatingTokPtr floatVal = FloatingTokPtr::dynamicCast((yyvsp[(1) - (1)])); + FloatingTokPtr floatVal = FloatingTokPtr::dynamicCast(yyvsp[0]); ostringstream sstr; sstr << floatVal->v; - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = sstr.str(); - def->v.valueAsLiteral = floatVal->literal; - (yyval) = def; + ConstDefTokPtr def = new ConstDefTok(type, sstr.str(), floatVal->literal); + yyval = def; } +#line 4341 "src/Slice/Grammar.cpp" break; - case 190: -/* Line 1792 of yacc.c */ -#line 2082 "src/Slice/Grammar.y" - { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); - ConstDefTokPtr def = new ConstDefTok; + case 199: /* const_initializer: scoped_name */ +#line 2301 "src/Slice/Grammar.y" +{ + StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); + ConstDefTokPtr def; ContainedList cl = unit->currentContainer()->lookupContained(scoped->v, false); if(cl.empty()) { // Could be an enumerator - def->v.type = TypePtr(0); - def->v.value = SyntaxTreeBasePtr(0); - def->v.valueAsString = scoped->v; - def->v.valueAsLiteral = scoped->v; + def = new ConstDefTok(SyntaxTreeBasePtr(0), scoped->v, scoped->v); } else { @@ -4245,20 +4358,16 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); if(enumerator) { unit->currentContainer()->checkIntroduced(scoped->v, enumerator); - def->v.type = enumerator->type(); - def->v.value = enumerator; - def->v.valueAsString = scoped->v; - def->v.valueAsLiteral = scoped->v; + def = new ConstDefTok(enumerator, scoped->v, scoped->v); } else if(constant) { unit->currentContainer()->checkIntroduced(scoped->v, constant); - def->v.value = constant; - def->v.valueAsString = constant->value(); - def->v.valueAsLiteral = constant->value(); + def = new ConstDefTok(constant, constant->value(), constant->value()); } else { + def = new ConstDefTok; string msg = "illegal initializer: `" + scoped->v + "' is a"; static const string vowels = "aeiou"; string kindOf = cl.front()->kindOf(); @@ -4270,294 +4379,290 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); unit->error(msg); // $$ is dummy } } - (yyval) = def; + yyval = def; } +#line 4385 "src/Slice/Grammar.cpp" break; - case 191: -/* Line 1792 of yacc.c */ -#line 2129 "src/Slice/Grammar.y" - { + case 200: /* const_initializer: ICE_STRING_LITERAL */ +#line 2341 "src/Slice/Grammar.y" +{ BuiltinPtr type = unit->builtin(Builtin::KindString); - StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = literal->v; - def->v.valueAsLiteral = literal->literal; - (yyval) = def; + StringTokPtr literal = StringTokPtr::dynamicCast(yyvsp[0]); + ConstDefTokPtr def = new ConstDefTok(type, literal->v, literal->literal); + yyval = def; } +#line 4396 "src/Slice/Grammar.cpp" break; - case 192: -/* Line 1792 of yacc.c */ -#line 2140 "src/Slice/Grammar.y" - { + case 201: /* const_initializer: ICE_FALSE */ +#line 2348 "src/Slice/Grammar.y" +{ BuiltinPtr type = unit->builtin(Builtin::KindBool); - StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = "false"; - def->v.valueAsLiteral = "false"; - (yyval) = def; + StringTokPtr literal = StringTokPtr::dynamicCast(yyvsp[0]); + ConstDefTokPtr def = new ConstDefTok(type, "false", "false"); + yyval = def; } +#line 4407 "src/Slice/Grammar.cpp" break; - case 193: -/* Line 1792 of yacc.c */ -#line 2151 "src/Slice/Grammar.y" - { + case 202: /* const_initializer: ICE_TRUE */ +#line 2355 "src/Slice/Grammar.y" +{ BuiltinPtr type = unit->builtin(Builtin::KindBool); - StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = "true"; - def->v.valueAsLiteral = "true"; - (yyval) = def; + StringTokPtr literal = StringTokPtr::dynamicCast(yyvsp[0]); + ConstDefTokPtr def = new ConstDefTok(type, "true", "true"); + yyval = def; } +#line 4418 "src/Slice/Grammar.cpp" break; - case 194: -/* Line 1792 of yacc.c */ -#line 2167 "src/Slice/Grammar.y" - { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (6)])); - TypePtr const_type = TypePtr::dynamicCast((yyvsp[(3) - (6)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(4) - (6)])); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(6) - (6)])); - (yyval) = unit->currentContainer()->createConst(ident->v, const_type, metaData->v, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + case 203: /* const_def: ICE_CONST meta_data type ICE_IDENTIFIER '=' const_initializer */ +#line 2367 "src/Slice/Grammar.y" +{ + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-4]); + TypePtr const_type = TypePtr::dynamicCast(yyvsp[-3]); + StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[-2]); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast(yyvsp[0]); + yyval = unit->currentContainer()->createConst(ident->v, const_type, metaData->v, value->v, + value->valueAsString, value->valueAsLiteral); } +#line 4431 "src/Slice/Grammar.cpp" break; - case 195: -/* Line 1792 of yacc.c */ -#line 2176 "src/Slice/Grammar.y" - { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (5)])); - TypePtr const_type = TypePtr::dynamicCast((yyvsp[(3) - (5)])); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(5) - (5)])); + case 204: /* const_def: ICE_CONST meta_data type '=' const_initializer */ +#line 2376 "src/Slice/Grammar.y" +{ + StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); + TypePtr const_type = TypePtr::dynamicCast(yyvsp[-2]); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast(yyvsp[0]); unit->error("missing constant name"); - (yyval) = unit->currentContainer()->createConst(IceUtil::generateUUID(), const_type, metaData->v, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral, Dummy); // Dummy + yyval = unit->currentContainer()->createConst(IceUtil::generateUUID(), const_type, metaData->v, value->v, + value->valueAsString, value->valueAsLiteral, Dummy); // Dummy } +#line 4444 "src/Slice/Grammar.cpp" break; - case 196: -/* Line 1792 of yacc.c */ -#line 2190 "src/Slice/Grammar.y" - { + case 205: /* keyword: ICE_MODULE */ +#line 2390 "src/Slice/Grammar.y" +{ } +#line 4451 "src/Slice/Grammar.cpp" break; - case 197: -/* Line 1792 of yacc.c */ -#line 2193 "src/Slice/Grammar.y" - { + case 206: /* keyword: ICE_CLASS */ +#line 2393 "src/Slice/Grammar.y" +{ } +#line 4458 "src/Slice/Grammar.cpp" break; - case 198: -/* Line 1792 of yacc.c */ -#line 2196 "src/Slice/Grammar.y" - { + case 207: /* keyword: ICE_INTERFACE */ +#line 2396 "src/Slice/Grammar.y" +{ } +#line 4465 "src/Slice/Grammar.cpp" break; - case 199: -/* Line 1792 of yacc.c */ -#line 2199 "src/Slice/Grammar.y" - { + case 208: /* keyword: ICE_EXCEPTION */ +#line 2399 "src/Slice/Grammar.y" +{ } +#line 4472 "src/Slice/Grammar.cpp" break; - case 200: -/* Line 1792 of yacc.c */ -#line 2202 "src/Slice/Grammar.y" - { + case 209: /* keyword: ICE_STRUCT */ +#line 2402 "src/Slice/Grammar.y" +{ } +#line 4479 "src/Slice/Grammar.cpp" break; - case 201: -/* Line 1792 of yacc.c */ -#line 2205 "src/Slice/Grammar.y" - { + case 210: /* keyword: ICE_SEQUENCE */ +#line 2405 "src/Slice/Grammar.y" +{ } +#line 4486 "src/Slice/Grammar.cpp" break; - case 202: -/* Line 1792 of yacc.c */ -#line 2208 "src/Slice/Grammar.y" - { + case 211: /* keyword: ICE_DICTIONARY */ +#line 2408 "src/Slice/Grammar.y" +{ } +#line 4493 "src/Slice/Grammar.cpp" break; - case 203: -/* Line 1792 of yacc.c */ -#line 2211 "src/Slice/Grammar.y" - { + case 212: /* keyword: ICE_ENUM */ +#line 2411 "src/Slice/Grammar.y" +{ } +#line 4500 "src/Slice/Grammar.cpp" break; - case 204: -/* Line 1792 of yacc.c */ -#line 2214 "src/Slice/Grammar.y" - { + case 213: /* keyword: ICE_OUT */ +#line 2414 "src/Slice/Grammar.y" +{ } +#line 4507 "src/Slice/Grammar.cpp" break; - case 205: -/* Line 1792 of yacc.c */ -#line 2217 "src/Slice/Grammar.y" - { + case 214: /* keyword: ICE_EXTENDS */ +#line 2417 "src/Slice/Grammar.y" +{ } +#line 4514 "src/Slice/Grammar.cpp" break; - case 206: -/* Line 1792 of yacc.c */ -#line 2220 "src/Slice/Grammar.y" - { + case 215: /* keyword: ICE_IMPLEMENTS */ +#line 2420 "src/Slice/Grammar.y" +{ } +#line 4521 "src/Slice/Grammar.cpp" break; - case 207: -/* Line 1792 of yacc.c */ -#line 2223 "src/Slice/Grammar.y" - { + case 216: /* keyword: ICE_THROWS */ +#line 2423 "src/Slice/Grammar.y" +{ } +#line 4528 "src/Slice/Grammar.cpp" break; - case 208: -/* Line 1792 of yacc.c */ -#line 2226 "src/Slice/Grammar.y" - { + case 217: /* keyword: ICE_VOID */ +#line 2426 "src/Slice/Grammar.y" +{ } +#line 4535 "src/Slice/Grammar.cpp" break; - case 209: -/* Line 1792 of yacc.c */ -#line 2229 "src/Slice/Grammar.y" - { + case 218: /* keyword: ICE_BYTE */ +#line 2429 "src/Slice/Grammar.y" +{ } +#line 4542 "src/Slice/Grammar.cpp" break; - case 210: -/* Line 1792 of yacc.c */ -#line 2232 "src/Slice/Grammar.y" - { + case 219: /* keyword: ICE_BOOL */ +#line 2432 "src/Slice/Grammar.y" +{ } +#line 4549 "src/Slice/Grammar.cpp" break; - case 211: -/* Line 1792 of yacc.c */ -#line 2235 "src/Slice/Grammar.y" - { + case 220: /* keyword: ICE_SHORT */ +#line 2435 "src/Slice/Grammar.y" +{ } +#line 4556 "src/Slice/Grammar.cpp" break; - case 212: -/* Line 1792 of yacc.c */ -#line 2238 "src/Slice/Grammar.y" - { + case 221: /* keyword: ICE_INT */ +#line 2438 "src/Slice/Grammar.y" +{ } +#line 4563 "src/Slice/Grammar.cpp" break; - case 213: -/* Line 1792 of yacc.c */ -#line 2241 "src/Slice/Grammar.y" - { + case 222: /* keyword: ICE_LONG */ +#line 2441 "src/Slice/Grammar.y" +{ } +#line 4570 "src/Slice/Grammar.cpp" break; - case 214: -/* Line 1792 of yacc.c */ -#line 2244 "src/Slice/Grammar.y" - { + case 223: /* keyword: ICE_FLOAT */ +#line 2444 "src/Slice/Grammar.y" +{ } +#line 4577 "src/Slice/Grammar.cpp" break; - case 215: -/* Line 1792 of yacc.c */ -#line 2247 "src/Slice/Grammar.y" - { + case 224: /* keyword: ICE_DOUBLE */ +#line 2447 "src/Slice/Grammar.y" +{ } +#line 4584 "src/Slice/Grammar.cpp" break; - case 216: -/* Line 1792 of yacc.c */ -#line 2250 "src/Slice/Grammar.y" - { + case 225: /* keyword: ICE_STRING */ +#line 2450 "src/Slice/Grammar.y" +{ } +#line 4591 "src/Slice/Grammar.cpp" break; - case 217: -/* Line 1792 of yacc.c */ -#line 2253 "src/Slice/Grammar.y" - { + case 226: /* keyword: ICE_OBJECT */ +#line 2453 "src/Slice/Grammar.y" +{ } +#line 4598 "src/Slice/Grammar.cpp" break; - case 218: -/* Line 1792 of yacc.c */ -#line 2256 "src/Slice/Grammar.y" - { + case 227: /* keyword: ICE_LOCAL_OBJECT */ +#line 2456 "src/Slice/Grammar.y" +{ } +#line 4605 "src/Slice/Grammar.cpp" break; - case 219: -/* Line 1792 of yacc.c */ -#line 2259 "src/Slice/Grammar.y" - { + case 228: /* keyword: ICE_LOCAL */ +#line 2459 "src/Slice/Grammar.y" +{ } +#line 4612 "src/Slice/Grammar.cpp" break; - case 220: -/* Line 1792 of yacc.c */ -#line 2262 "src/Slice/Grammar.y" - { + case 229: /* keyword: ICE_CONST */ +#line 2462 "src/Slice/Grammar.y" +{ } +#line 4619 "src/Slice/Grammar.cpp" break; - case 221: -/* Line 1792 of yacc.c */ -#line 2265 "src/Slice/Grammar.y" - { + case 230: /* keyword: ICE_FALSE */ +#line 2465 "src/Slice/Grammar.y" +{ } +#line 4626 "src/Slice/Grammar.cpp" break; - case 222: -/* Line 1792 of yacc.c */ -#line 2268 "src/Slice/Grammar.y" - { + case 231: /* keyword: ICE_TRUE */ +#line 2468 "src/Slice/Grammar.y" +{ } +#line 4633 "src/Slice/Grammar.cpp" break; - case 223: -/* Line 1792 of yacc.c */ -#line 2271 "src/Slice/Grammar.y" - { + case 232: /* keyword: ICE_IDEMPOTENT */ +#line 2471 "src/Slice/Grammar.y" +{ } +#line 4640 "src/Slice/Grammar.cpp" break; - case 224: -/* Line 1792 of yacc.c */ -#line 2274 "src/Slice/Grammar.y" - { + case 233: /* keyword: ICE_TAG */ +#line 2474 "src/Slice/Grammar.y" +{ } +#line 4647 "src/Slice/Grammar.cpp" break; - case 225: -/* Line 1792 of yacc.c */ -#line 2277 "src/Slice/Grammar.y" - { + case 234: /* keyword: ICE_OPTIONAL */ +#line 2477 "src/Slice/Grammar.y" +{ +} +#line 4654 "src/Slice/Grammar.cpp" + break; + + case 235: /* keyword: ICE_VALUE */ +#line 2480 "src/Slice/Grammar.y" +{ } +#line 4661 "src/Slice/Grammar.cpp" break; -/* Line 1792 of yacc.c */ -#line 4557 "src/Slice/Grammar.cpp" +#line 4665 "src/Slice/Grammar.cpp" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4571,96 +4676,60 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; - YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; + *++yylsp = yyloc; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif } - - + yyerror_range[1] = yylloc; if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -4672,14 +4741,13 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -4692,29 +4760,30 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; - + YYABORT; + yyerror_range[1] = *yylsp; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -4724,9 +4793,12 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END + yyerror_range[2] = yylloc; + ++yylsp; + YYLLOC_DEFAULT (*yylsp, yyerror_range, 2); /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -4737,57 +4809,55 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; + /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ -#endif + goto yyreturnlab; -yyreturn: + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + yytoken, &yylval, &yylloc); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} + return yyresult; +} -/* Line 2055 of yacc.c */ -#line 2281 "src/Slice/Grammar.y" +#line 2484 "src/Slice/Grammar.y" diff --git a/cpp/src/Slice/Grammar.h b/cpp/src/Slice/Grammar.h index f5792b4498e..dfab2b9f7d1 100644 --- a/cpp/src/Slice/Grammar.h +++ b/cpp/src/Slice/Grammar.h @@ -1,21 +1,22 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,93 +27,125 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -#ifndef YY_SLICE_SRC_SLICE_GRAMMAR_HPP_INCLUDED -# define YY_SLICE_SRC_SLICE_GRAMMAR_HPP_INCLUDED -/* Enabling traces. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_SLICE_SRC_SLICE_GRAMMAR_H_INCLUDED +# define YY_SLICE_SRC_SLICE_GRAMMAR_H_INCLUDED +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif #if YYDEBUG extern int slice_debug; #endif +/* "%code requires" blocks. */ +#line 12 "src/Slice/Grammar.y" + + +// Define a custom location type for storing the location (and filename) of tokens. +#define YYLTYPE Slice::TokenContext + +// I must set the initial stack depth to the maximum stack depth to +// disable bison stack resizing. The bison stack resizing routines use +// simple malloc/alloc/memcpy calls, which do not work for the +// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor, +// assignment operator, etc. +#define YYMAXDEPTH 10000 +#define YYINITDEPTH YYMAXDEPTH + -/* Tokens. */ +#line 64 "src/Slice/Grammar.h" + +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ICE_MODULE = 258, - ICE_CLASS = 259, - ICE_INTERFACE = 260, - ICE_EXCEPTION = 261, - ICE_STRUCT = 262, - ICE_SEQUENCE = 263, - ICE_DICTIONARY = 264, - ICE_ENUM = 265, - ICE_OUT = 266, - ICE_EXTENDS = 267, - ICE_IMPLEMENTS = 268, - ICE_THROWS = 269, - ICE_VOID = 270, - ICE_BYTE = 271, - ICE_BOOL = 272, - ICE_SHORT = 273, - ICE_INT = 274, - ICE_LONG = 275, - ICE_FLOAT = 276, - ICE_DOUBLE = 277, - ICE_STRING = 278, - ICE_OBJECT = 279, - ICE_LOCAL_OBJECT = 280, - ICE_LOCAL = 281, - ICE_CONST = 282, - ICE_FALSE = 283, - ICE_TRUE = 284, - ICE_IDEMPOTENT = 285, - ICE_OPTIONAL = 286, - ICE_VALUE = 287, - ICE_IDENTIFIER = 288, - ICE_SCOPED_IDENTIFIER = 289, - ICE_STRING_LITERAL = 290, - ICE_INTEGER_LITERAL = 291, - ICE_FLOATING_POINT_LITERAL = 292, - ICE_IDENT_OP = 293, - ICE_KEYWORD_OP = 294, - ICE_OPTIONAL_OP = 295, - ICE_METADATA_OPEN = 296, - ICE_METADATA_CLOSE = 297, - ICE_GLOBAL_METADATA_OPEN = 298, - ICE_GLOBAL_METADATA_CLOSE = 299, - BAD_CHAR = 300 - }; + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + ICE_MODULE = 258, /* ICE_MODULE */ + ICE_CLASS = 259, /* ICE_CLASS */ + ICE_INTERFACE = 260, /* ICE_INTERFACE */ + ICE_EXCEPTION = 261, /* ICE_EXCEPTION */ + ICE_STRUCT = 262, /* ICE_STRUCT */ + ICE_SEQUENCE = 263, /* ICE_SEQUENCE */ + ICE_DICTIONARY = 264, /* ICE_DICTIONARY */ + ICE_ENUM = 265, /* ICE_ENUM */ + ICE_OUT = 266, /* ICE_OUT */ + ICE_EXTENDS = 267, /* ICE_EXTENDS */ + ICE_IMPLEMENTS = 268, /* ICE_IMPLEMENTS */ + ICE_THROWS = 269, /* ICE_THROWS */ + ICE_VOID = 270, /* ICE_VOID */ + ICE_BYTE = 271, /* ICE_BYTE */ + ICE_BOOL = 272, /* ICE_BOOL */ + ICE_SHORT = 273, /* ICE_SHORT */ + ICE_INT = 274, /* ICE_INT */ + ICE_LONG = 275, /* ICE_LONG */ + ICE_FLOAT = 276, /* ICE_FLOAT */ + ICE_DOUBLE = 277, /* ICE_DOUBLE */ + ICE_STRING = 278, /* ICE_STRING */ + ICE_OBJECT = 279, /* ICE_OBJECT */ + ICE_LOCAL_OBJECT = 280, /* ICE_LOCAL_OBJECT */ + ICE_LOCAL = 281, /* ICE_LOCAL */ + ICE_CONST = 282, /* ICE_CONST */ + ICE_FALSE = 283, /* ICE_FALSE */ + ICE_TRUE = 284, /* ICE_TRUE */ + ICE_IDEMPOTENT = 285, /* ICE_IDEMPOTENT */ + ICE_TAG = 286, /* ICE_TAG */ + ICE_OPTIONAL = 287, /* ICE_OPTIONAL */ + ICE_VALUE = 288, /* ICE_VALUE */ + ICE_STRING_LITERAL = 289, /* ICE_STRING_LITERAL */ + ICE_INTEGER_LITERAL = 290, /* ICE_INTEGER_LITERAL */ + ICE_FLOATING_POINT_LITERAL = 291, /* ICE_FLOATING_POINT_LITERAL */ + ICE_IDENTIFIER = 292, /* ICE_IDENTIFIER */ + ICE_SCOPED_IDENTIFIER = 293, /* ICE_SCOPED_IDENTIFIER */ + ICE_METADATA_OPEN = 294, /* ICE_METADATA_OPEN */ + ICE_METADATA_CLOSE = 295, /* ICE_METADATA_CLOSE */ + ICE_GLOBAL_METADATA_OPEN = 296, /* ICE_GLOBAL_METADATA_OPEN */ + ICE_GLOBAL_METADATA_IGNORE = 297, /* ICE_GLOBAL_METADATA_IGNORE */ + ICE_GLOBAL_METADATA_CLOSE = 298, /* ICE_GLOBAL_METADATA_CLOSE */ + ICE_IDENT_OPEN = 299, /* ICE_IDENT_OPEN */ + ICE_KEYWORD_OPEN = 300, /* ICE_KEYWORD_OPEN */ + ICE_TAG_OPEN = 301, /* ICE_TAG_OPEN */ + ICE_OPTIONAL_OPEN = 302, /* ICE_OPTIONAL_OPEN */ + BAD_CHAR = 303 /* BAD_CHAR */ + }; + typedef enum yytokentype yytoken_kind_t; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; +typedef Slice::GrammarBasePtr YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int slice_parse (void *YYPARSE_PARAM); -#else -int slice_parse (); +/* Location type. */ +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +}; +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 #endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus + + + + int slice_parse (void); -#else -int slice_parse (); -#endif -#endif /* ! YYPARSE_PARAM */ -#endif /* !YY_SLICE_SRC_SLICE_GRAMMAR_HPP_INCLUDED */ + +#endif /* !YY_SLICE_SRC_SLICE_GRAMMAR_H_INCLUDED */ diff --git a/cpp/src/Slice/Grammar.y b/cpp/src/Slice/Grammar.y index 642cafa89a6..6ca192c62f0 100644 --- a/cpp/src/Slice/Grammar.y +++ b/cpp/src/Slice/Grammar.y @@ -1,10 +1,70 @@ -%{ +%code top{ // // Copyright (c) ZeroC, Inc. All rights reserved. // +// Included first to get 'TokenContext' which we need to define YYLTYPE before flex does. #include + +} + +%code requires{ + +// Define a custom location type for storing the location (and filename) of tokens. +#define YYLTYPE Slice::TokenContext + +// I must set the initial stack depth to the maximum stack depth to +// disable bison stack resizing. The bison stack resizing routines use +// simple malloc/alloc/memcpy calls, which do not work for the +// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor, +// assignment operator, etc. +#define YYMAXDEPTH 10000 +#define YYINITDEPTH YYMAXDEPTH + +} + +%code top{ + +// Defines the rule bison uses to reduce token locations. Bison asks that the macro should +// be one-line, and treatable as a single statement when followed by a semi-colon. +// `N` is the number of tokens that are being combined, and (Cur) is their combined location. +#define YYLLOC_DEFAULT(Cur, Rhs, N) \ +do \ + if(N == 1) \ + { \ + (Cur) = (YYRHSLOC((Rhs), 1)); \ + } \ + else \ + { \ + if(N) \ + { \ + (Cur).firstLine = (YYRHSLOC((Rhs), 1)).firstLine; \ + (Cur).firstColumn = (YYRHSLOC((Rhs), 1)).firstColumn; \ + } \ + else \ + { \ + (Cur).firstLine = (YYRHSLOC((Rhs), 0)).lastLine; \ + (Cur).firstColumn = (YYRHSLOC((Rhs), 0)).lastColumn; \ + } \ + (Cur).filename = (YYRHSLOC((Rhs), N)).filename; \ + (Cur).lastLine = (YYRHSLOC((Rhs), N)).lastLine; \ + (Cur).lastColumn = (YYRHSLOC((Rhs), N)).lastColumn; \ + } \ +while(0) + +} + +%code{ + +// Forward declaration of the lexing function generated by flex, so bison knows about it. +// This must match the definition of 'yylex' (or 'slice_lex') in the generated scanner. +int slice_lex(YYSTYPE* lvalp, YYLTYPE* llocp); + +} + +%{ + #include #include #include @@ -16,18 +76,17 @@ # pragma warning(disable:4065) // warning C4244: '=': conversion from 'int' to 'yytype_int16', possible loss of data # pragma warning(disable:4244) +// warning C4127: conditional expression is constant +# pragma warning(disable:4127) #endif -// // Avoid old style cast warnings in generated grammar -// #ifdef __GNUC__ # pragma GCC diagnostic ignored "-Wold-style-cast" +# pragma GCC diagnostic ignored "-Wunused-label" #endif -// -// Avoid clang conversion warnings -// +// Avoid clang warnings in generate grammar #if defined(__clang__) # pragma clang diagnostic ignored "-Wconversion" # pragma clang diagnostic ignored "-Wsign-conversion" @@ -55,13 +114,16 @@ slice_error(const char* s) %} -%pure-parser +// Directs Bison to generate a re-entrant parser. +%define api.pure +// Specifies what type to back the tokens with (their semantic values). +%define api.value.type {Slice::GrammarBasePtr} +// Enables Bison's token location tracking functionality. +%locations -// // All keyword tokens. Make sure to modify the "keyword" rule in this // file if the list of keywords is changed. Also make sure to add the // keyword to the keyword table in Scanner.l. -// %token ICE_MODULE %token ICE_CLASS %token ICE_INTERFACE @@ -90,25 +152,28 @@ slice_error(const char* s) %token ICE_FALSE %token ICE_TRUE %token ICE_IDEMPOTENT +%token ICE_TAG %token ICE_OPTIONAL %token ICE_VALUE -// // Other tokens. -// -%token ICE_IDENTIFIER -%token ICE_SCOPED_IDENTIFIER %token ICE_STRING_LITERAL %token ICE_INTEGER_LITERAL %token ICE_FLOATING_POINT_LITERAL -%token ICE_IDENT_OP -%token ICE_KEYWORD_OP -%token ICE_OPTIONAL_OP +%token ICE_IDENTIFIER +%token ICE_SCOPED_IDENTIFIER %token ICE_METADATA_OPEN %token ICE_METADATA_CLOSE %token ICE_GLOBAL_METADATA_OPEN +%token ICE_GLOBAL_METADATA_IGNORE %token ICE_GLOBAL_METADATA_CLOSE +// Here 'OPEN' means these tokens end with an open parenthesis. +%token ICE_IDENT_OPEN +%token ICE_KEYWORD_OPEN +%token ICE_TAG_OPEN +%token ICE_OPTIONAL_OPEN + %token BAD_CHAR %% @@ -127,7 +192,7 @@ opt_semicolon : ';' { } -| +| %empty { } ; @@ -139,6 +204,11 @@ global_meta_data { $$ = $2; } +| ICE_GLOBAL_METADATA_IGNORE string_list ICE_GLOBAL_METADATA_CLOSE +{ + unit->error("global metadata must appear before any definitions"); + $$ = $2; // Dummy +} ; // ---------------------------------------------------------------------- @@ -148,7 +218,7 @@ meta_data { $$ = $2; } -| +| %empty { $$ = new StringListTok; } @@ -157,26 +227,24 @@ meta_data // ---------------------------------------------------------------------- definitions // ---------------------------------------------------------------------- -: global_meta_data +: definitions global_meta_data { - StringListTokPtr metaData = StringListTokPtr::dynamicCast($1); + StringListTokPtr metaData = StringListTokPtr::dynamicCast($2); if(!metaData->v.empty()) { unit->addGlobalMetaData(metaData->v); } } -definitions -| meta_data definition +| definitions meta_data definition { - StringListTokPtr metaData = StringListTokPtr::dynamicCast($1); - ContainedPtr contained = ContainedPtr::dynamicCast($2); + StringListTokPtr metaData = StringListTokPtr::dynamicCast($2); + ContainedPtr contained = ContainedPtr::dynamicCast($3); if(contained && !metaData->v.empty()) { contained->setMetaData(metaData->v); } } -definitions -| +| %empty { } ; @@ -288,7 +356,6 @@ module_def // ---------------------------------------------------------------------- : ICE_MODULE ICE_IDENTIFIER { - unit->setSeenDefinition(); StringTokPtr ident = StringTokPtr::dynamicCast($2); ContainerPtr cont = unit->currentContainer(); ModulePtr module = cont->createModule(ident->v); @@ -372,7 +439,7 @@ exception_def // ---------------------------------------------------------------------- exception_extends // ---------------------------------------------------------------------- -: ICE_EXTENDS scoped_name +: extends scoped_name { StringTokPtr scoped = StringTokPtr::dynamicCast($2); ContainerPtr cont = unit->currentContainer(); @@ -380,7 +447,7 @@ exception_extends cont->checkIntroduced(scoped->v); $$ = contained; } -| +| %empty { $$ = 0; } @@ -405,7 +472,7 @@ exception_exports { unit->error("`;' missing after definition"); } -| +| %empty { } ; @@ -424,16 +491,16 @@ type_id ; // ---------------------------------------------------------------------- -optional +tag // ---------------------------------------------------------------------- -: ICE_OPTIONAL_OP ICE_INTEGER_LITERAL ')' +: ICE_TAG_OPEN ICE_INTEGER_LITERAL ')' { IntegerTokPtr i = IntegerTokPtr::dynamicCast($2); int tag; if(i->v < 0 || i->v > Int32Max) { - unit->error("tag for optional is out of range"); + unit->error("tag is out of range"); tag = -1; } else @@ -441,12 +508,10 @@ optional tag = static_cast(i->v); } - OptionalDefTokPtr m = new OptionalDefTok; - m->v.optional = tag >= 0; - m->v.tag = tag; + TaggedDefTokPtr m = new TaggedDefTok(tag); $$ = m; } -| ICE_OPTIONAL_OP scoped_name ')' +| ICE_TAG_OPEN scoped_name ')' { StringTokPtr scoped = StringTokPtr::dynamicCast($2); @@ -514,7 +579,132 @@ optional IceUtil::Int64 l = IceUtilInternal::strToInt64(constant->value().c_str(), 0, 0); if(l < 0 || l > Int32Max) { - unit->error("tag for optional is out of range"); + unit->error("tag is out of range"); + } + tag = static_cast(l); + break; + } + default: + break; + } + } + } + else if(enumerator) + { + tag = enumerator->value(); + } + + if(tag < 0) + { + unit->error("invalid tag `" + scoped->v + "'"); + } + + TaggedDefTokPtr m = new TaggedDefTok(tag); + $$ = m; +} +| ICE_TAG_OPEN ')' +{ + unit->error("missing tag"); + TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy + $$ = m; +} +| ICE_TAG +{ + unit->error("missing tag"); + TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy + $$ = m; +} +; + +// ---------------------------------------------------------------------- +optional +// ---------------------------------------------------------------------- +: ICE_OPTIONAL_OPEN ICE_INTEGER_LITERAL ')' +{ + IntegerTokPtr i = IntegerTokPtr::dynamicCast($2); + + int tag; + if(i->v < 0 || i->v > Int32Max) + { + unit->error("tag is out of range"); + tag = -1; + } + else + { + tag = static_cast(i->v); + } + + TaggedDefTokPtr m = new TaggedDefTok(tag); + $$ = m; +} +| ICE_OPTIONAL_OPEN scoped_name ')' +{ + StringTokPtr scoped = StringTokPtr::dynamicCast($2); + ContainerPtr cont = unit->currentContainer(); + assert(cont); + ContainedList cl = cont->lookupContained(scoped->v, false); + if(cl.empty()) + { + EnumeratorList enumerators = cont->enumerators(scoped->v); + if(enumerators.size() == 1) + { + // Found + cl.push_back(enumerators.front()); + scoped->v = enumerators.front()->scoped(); + unit->warning(Deprecated, string("referencing enumerator `") + scoped->v + + "' without its enumeration's scope is deprecated"); + } + else if(enumerators.size() > 1) + { + ostringstream os; + os << "enumerator `" << scoped->v << "' could designate"; + bool first = true; + for(EnumeratorList::iterator p = enumerators.begin(); p != enumerators.end(); ++p) + { + if(first) + { + first = false; + } + else + { + os << " or"; + } + + os << " `" << (*p)->scoped() << "'"; + } + unit->error(os.str()); + } + else + { + unit->error(string("`") + scoped->v + "' is not defined"); + } + } + + if(cl.empty()) + { + YYERROR; // Can't continue, jump to next yyerrok + } + cont->checkIntroduced(scoped->v); + + int tag = -1; + EnumeratorPtr enumerator = EnumeratorPtr::dynamicCast(cl.front()); + ConstPtr constant = ConstPtr::dynamicCast(cl.front()); + if(constant) + { + BuiltinPtr b = BuiltinPtr::dynamicCast(constant->type()); + if(b) + { + switch(b->kind()) + { + case Builtin::KindByte: + case Builtin::KindShort: + case Builtin::KindInt: + case Builtin::KindLong: + { + IceUtil::Int64 l = IceUtilInternal::strToInt64(constant->value().c_str(), 0, 0); + if(l < 0 || l > Int32Max) + { + unit->error("tag is out of range"); } tag = static_cast(l); break; @@ -531,51 +721,53 @@ optional if(tag < 0) { - unit->error("invalid tag `" + scoped->v + "' for optional"); + unit->error("invalid tag `" + scoped->v + "'"); } - OptionalDefTokPtr m = new OptionalDefTok; - m->v.optional = tag >= 0; - m->v.tag = tag; + TaggedDefTokPtr m = new TaggedDefTok(tag); $$ = m; } -| ICE_OPTIONAL_OP ')' +| ICE_OPTIONAL_OPEN ')' { - unit->error("missing tag for optional"); - OptionalDefTokPtr m = new OptionalDefTok; // Dummy - m->v.optional = false; - m->v.tag = -1; + unit->error("missing tag"); + TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy $$ = m; } | ICE_OPTIONAL { - unit->error("missing tag for optional"); - OptionalDefTokPtr m = new OptionalDefTok; // Dummy - m->v.optional = false; - m->v.tag = -1; + unit->error("missing tag"); + TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy $$ = m; } ; // ---------------------------------------------------------------------- -optional_type_id +tagged_type_id // ---------------------------------------------------------------------- -: optional type_id +: tag type_id { - OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast($1); + TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast($1); TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($2); - m->v.type = ts->v.first; - m->v.name = ts->v.second; + + m->type = ts->v.first; + m->name = ts->v.second; + $$ = m; +} +| optional type_id +{ + TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast($1); + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($2); + + m->type = ts->v.first; + m->name = ts->v.second; $$ = m; } | type_id { TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($1); - OptionalDefTokPtr m = new OptionalDefTok; - m->v.type = ts->v.first; - m->v.name = ts->v.second; - m->v.optional = false; - m->v.tag = -1; + TaggedDefTokPtr m = new TaggedDefTok(-1); + m->type = ts->v.first; + m->name = ts->v.second; $$ = m; } ; @@ -672,7 +864,7 @@ struct_exports { unit->error("`;' missing after definition"); } -| +| %empty { } ; @@ -701,7 +893,7 @@ class_name // ---------------------------------------------------------------------- class_id // ---------------------------------------------------------------------- -: ICE_CLASS ICE_IDENT_OP ICE_INTEGER_LITERAL ')' +: ICE_CLASS ICE_IDENT_OPEN ICE_INTEGER_LITERAL ')' { IceUtil::Int64 id = IntegerTokPtr::dynamicCast($3)->v; if(id < 0) @@ -726,7 +918,7 @@ class_id classId->t = static_cast(id); $$ = classId; } -| ICE_CLASS ICE_IDENT_OP scoped_name ')' +| ICE_CLASS ICE_IDENT_OPEN scoped_name ')' { StringTokPtr scoped = StringTokPtr::dynamicCast($3); @@ -862,7 +1054,7 @@ class_def ClassListTokPtr bases = ClassListTokPtr::dynamicCast($4); if(base) { - bases->v.push_front(base); + bases->v.push_front(base); } ClassDefPtr cl = cont->createClassDef(ident->v, ident->t, false, bases->v, local->v); if(cl) @@ -893,7 +1085,7 @@ class_def // ---------------------------------------------------------------------- class_extends // ---------------------------------------------------------------------- -: ICE_EXTENDS scoped_name +: extends scoped_name { StringTokPtr scoped = StringTokPtr::dynamicCast($2); ContainerPtr cont = unit->currentContainer(); @@ -927,12 +1119,23 @@ class_extends } } } -| +| %empty { $$ = 0; } ; +// ---------------------------------------------------------------------- +extends +// ---------------------------------------------------------------------- +: ICE_EXTENDS +{ +} +| ':' +{ +} +; + // ---------------------------------------------------------------------- implements // ---------------------------------------------------------------------- @@ -940,7 +1143,7 @@ implements { $$ = $2; } -| +| %empty { $$ = new ClassListTok; } @@ -965,7 +1168,7 @@ class_exports { unit->error("`;' missing after definition"); } -| +| %empty { } ; @@ -973,53 +1176,53 @@ class_exports // ---------------------------------------------------------------------- data_member // ---------------------------------------------------------------------- -: optional_type_id +: tagged_type_id { - OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast($1); + TaggedDefTokPtr def = TaggedDefTokPtr::dynamicCast($1); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); DataMemberPtr dm; if(cl) { - dm = cl->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, 0, "", ""); + dm = cl->createDataMember(def->name, def->type, def->isTagged, def->tag, 0, "", ""); } StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - dm = st->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, 0, "", ""); + dm = st->createDataMember(def->name, def->type, def->isTagged, def->tag, 0, "", ""); } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) { - dm = ex->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, 0, "", ""); + dm = ex->createDataMember(def->name, def->type, def->isTagged, def->tag, 0, "", ""); } - unit->currentContainer()->checkIntroduced(def->v.name, dm); + unit->currentContainer()->checkIntroduced(def->name, dm); $$ = dm; } -| optional_type_id '=' const_initializer +| tagged_type_id '=' const_initializer { - OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast($1); + TaggedDefTokPtr def = TaggedDefTokPtr::dynamicCast($1); ConstDefTokPtr value = ConstDefTokPtr::dynamicCast($3); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); DataMemberPtr dm; if(cl) { - dm = cl->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + dm = cl->createDataMember(def->name, def->type, def->isTagged, def->tag, value->v, + value->valueAsString, value->valueAsLiteral); } StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - dm = st->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + dm = st->createDataMember(def->name, def->type, def->isTagged, def->tag, value->v, + value->valueAsString, value->valueAsLiteral); } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) { - dm = ex->createDataMember(def->v.name, def->v.type, def->v.optional, def->v.tag, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + dm = ex->createDataMember(def->name, def->type, def->isTagged, def->tag, value->v, + value->valueAsString, value->valueAsLiteral); } - unit->currentContainer()->checkIntroduced(def->v.name, dm); + unit->currentContainer()->checkIntroduced(def->name, dm); $$ = dm; } | type keyword @@ -1085,11 +1288,29 @@ struct_data_member ConstDefTokPtr value = ConstDefTokPtr::dynamicCast($3); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); - DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, value->v, + value->valueAsString, value->valueAsLiteral); unit->currentContainer()->checkIntroduced(ts->v.second, dm); $$ = dm; } +| tag type_id +{ + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($2); + StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); + assert(st); + $$ = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy + assert($$); + unit->error("tagged data members are not supported in structs"); +} +| tag type_id '=' const_initializer +{ + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($2); + StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); + assert(st); + $$ = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy + assert($$); + unit->error("tagged data members are not supported in structs"); +} | optional type_id { TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($2); @@ -1097,7 +1318,7 @@ struct_data_member assert(st); $$ = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy assert($$); - unit->error("optional data members not supported in struct"); + unit->error("tagged data members are not supported in structs"); } | optional type_id '=' const_initializer { @@ -1106,7 +1327,7 @@ struct_data_member assert(st); $$ = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy assert($$); - unit->error("optional data members not supported in struct"); + unit->error("tagged data members are not supported in structs"); } | type keyword { @@ -1132,25 +1353,27 @@ struct_data_member // ---------------------------------------------------------------------- return_type // ---------------------------------------------------------------------- -: optional type +: tag type { - OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast($1); - m->v.type = TypePtr::dynamicCast($2); + TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast($1); + m->type = TypePtr::dynamicCast($2); + $$ = m; +} +| optional type +{ + TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast($1); + m->type = TypePtr::dynamicCast($2); $$ = m; } | type { - OptionalDefTokPtr m = new OptionalDefTok(); - m->v.type = TypePtr::dynamicCast($1); - m->v.optional = false; - m->v.tag = -1; + TaggedDefTokPtr m = new TaggedDefTok(-1); + m->type = TypePtr::dynamicCast($1); $$ = m; } | ICE_VOID { - OptionalDefTokPtr m = new OptionalDefTok; - m->v.optional = false; - m->v.tag = -1; + TaggedDefTokPtr m = new TaggedDefTok(-1); $$ = m; } ; @@ -1158,14 +1381,14 @@ return_type // ---------------------------------------------------------------------- operation_preamble // ---------------------------------------------------------------------- -: return_type ICE_IDENT_OP +: return_type ICE_IDENT_OPEN { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast($1); + TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast($1); string name = StringTokPtr::dynamicCast($2)->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); + OperationPtr op = cl->createOperation(name, returnType->type, returnType->isTagged, returnType->tag); if(op) { cl->checkIntroduced(name, op); @@ -1182,14 +1405,14 @@ operation_preamble $$ = 0; } } -| ICE_IDEMPOTENT return_type ICE_IDENT_OP +| ICE_IDEMPOTENT return_type ICE_IDENT_OPEN { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast($2); + TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast($2); string name = StringTokPtr::dynamicCast($3)->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, + OperationPtr op = cl->createOperation(name, returnType->type, returnType->isTagged, returnType->tag, Operation::Idempotent); if(op) { @@ -1207,14 +1430,14 @@ operation_preamble $$ = 0; } } -| return_type ICE_KEYWORD_OP +| return_type ICE_KEYWORD_OPEN { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast($1); + TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast($1); string name = StringTokPtr::dynamicCast($2)->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); + OperationPtr op = cl->createOperation(name, returnType->type, returnType->isTagged, returnType->tag); if(op) { unit->pushContainer(op); @@ -1231,14 +1454,14 @@ operation_preamble $$ = 0; } } -| ICE_IDEMPOTENT return_type ICE_KEYWORD_OP +| ICE_IDEMPOTENT return_type ICE_KEYWORD_OPEN { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast($2); + TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast($2); string name = StringTokPtr::dynamicCast($3)->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, + OperationPtr op = cl->createOperation(name, returnType->type, returnType->isTagged, returnType->tag, Operation::Idempotent); if(op) { @@ -1351,9 +1574,9 @@ interface_def ClassDefPtr cl = cont->createClassDef(ident->v, -1, true, bases->v, local->v); if(cl) { - cont->checkIntroduced(ident->v, cl); - unit->pushContainer(cl); - $$ = cl; + cont->checkIntroduced(ident->v, cl); + unit->pushContainer(cl); + $$ = cl; } else { @@ -1364,12 +1587,12 @@ interface_def { if($4) { - unit->popContainer(); - $$ = $4; + unit->popContainer(); + $$ = $4; } else { - $$ = 0; + $$ = 0; } } ; @@ -1462,11 +1685,11 @@ interface_list // ---------------------------------------------------------------------- interface_extends // ---------------------------------------------------------------------- -: ICE_EXTENDS interface_list +: extends interface_list { $$ = $2; } -| +| %empty { $$ = new ClassListTok; } @@ -1491,7 +1714,7 @@ interface_exports { unit->error("`;' missing after definition"); } -| +| %empty { } ; @@ -1531,7 +1754,7 @@ exception ExceptionPtr exception = cont->lookupException(scoped->v); if(!exception) { - exception = cont->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy + exception = cont->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy } cont->checkIntroduced(scoped->v, exception); $$ = exception; @@ -1718,7 +1941,7 @@ enumerator EnumeratorListTokPtr ens = new EnumeratorListTok; // Dummy $$ = ens; } -| +| %empty { EnumeratorListTokPtr ens = new EnumeratorListTok; $$ = ens; // Dummy @@ -1777,7 +2000,7 @@ out_qualifier out->v = true; $$ = out; } -| +| %empty { BoolTokPtr out = new BoolTok; out->v = false; @@ -1788,18 +2011,18 @@ out_qualifier // ---------------------------------------------------------------------- parameters // ---------------------------------------------------------------------- -: // empty +: %empty { } -| out_qualifier meta_data optional_type_id +| out_qualifier meta_data tagged_type_id { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast($1); - OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast($3); + TaggedDefTokPtr tsp = TaggedDefTokPtr::dynamicCast($3); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); - unit->currentContainer()->checkIntroduced(tsp->v.name, pd); + ParamDeclPtr pd = op->createParamDecl(tsp->name, tsp->type, isOutParam->v, tsp->isTagged, tsp->tag); + unit->currentContainer()->checkIntroduced(tsp->name, pd); StringListTokPtr metaData = StringListTokPtr::dynamicCast($2); if(!metaData->v.empty()) { @@ -1807,15 +2030,15 @@ parameters } } } -| parameters ',' out_qualifier meta_data optional_type_id +| parameters ',' out_qualifier meta_data tagged_type_id { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast($3); - OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast($5); + TaggedDefTokPtr tsp = TaggedDefTokPtr::dynamicCast($5); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); - unit->currentContainer()->checkIntroduced(tsp->v.name, pd); + ParamDeclPtr pd = op->createParamDecl(tsp->name, tsp->type, isOutParam->v, tsp->isTagged, tsp->tag); + unit->currentContainer()->checkIntroduced(tsp->name, pd); StringListTokPtr metaData = StringListTokPtr::dynamicCast($4); if(!metaData->v.empty()) { @@ -1878,7 +2101,7 @@ throws { $$ = $2; } -| +| %empty { $$ = new ExceptionListTok; } @@ -2045,7 +2268,7 @@ local_qualifier local->v = true; $$ = local; } -| +| %empty { BoolTokPtr local = new BoolTok; local->v = false; @@ -2062,11 +2285,7 @@ const_initializer IntegerTokPtr intVal = IntegerTokPtr::dynamicCast($1); ostringstream sstr; sstr << intVal->v; - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = sstr.str(); - def->v.valueAsLiteral = intVal->literal; + ConstDefTokPtr def = new ConstDefTok(type, sstr.str(), intVal->literal); $$ = def; } | ICE_FLOATING_POINT_LITERAL @@ -2075,25 +2294,18 @@ const_initializer FloatingTokPtr floatVal = FloatingTokPtr::dynamicCast($1); ostringstream sstr; sstr << floatVal->v; - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = sstr.str(); - def->v.valueAsLiteral = floatVal->literal; + ConstDefTokPtr def = new ConstDefTok(type, sstr.str(), floatVal->literal); $$ = def; } | scoped_name { StringTokPtr scoped = StringTokPtr::dynamicCast($1); - ConstDefTokPtr def = new ConstDefTok; + ConstDefTokPtr def; ContainedList cl = unit->currentContainer()->lookupContained(scoped->v, false); if(cl.empty()) { // Could be an enumerator - def->v.type = TypePtr(0); - def->v.value = SyntaxTreeBasePtr(0); - def->v.valueAsString = scoped->v; - def->v.valueAsLiteral = scoped->v; + def = new ConstDefTok(SyntaxTreeBasePtr(0), scoped->v, scoped->v); } else { @@ -2102,20 +2314,16 @@ const_initializer if(enumerator) { unit->currentContainer()->checkIntroduced(scoped->v, enumerator); - def->v.type = enumerator->type(); - def->v.value = enumerator; - def->v.valueAsString = scoped->v; - def->v.valueAsLiteral = scoped->v; + def = new ConstDefTok(enumerator, scoped->v, scoped->v); } else if(constant) { unit->currentContainer()->checkIntroduced(scoped->v, constant); - def->v.value = constant; - def->v.valueAsString = constant->value(); - def->v.valueAsLiteral = constant->value(); + def = new ConstDefTok(constant, constant->value(), constant->value()); } else { + def = new ConstDefTok; string msg = "illegal initializer: `" + scoped->v + "' is a"; static const string vowels = "aeiou"; string kindOf = cl.front()->kindOf(); @@ -2133,33 +2341,21 @@ const_initializer { BuiltinPtr type = unit->builtin(Builtin::KindString); StringTokPtr literal = StringTokPtr::dynamicCast($1); - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = literal->v; - def->v.valueAsLiteral = literal->literal; + ConstDefTokPtr def = new ConstDefTok(type, literal->v, literal->literal); $$ = def; } | ICE_FALSE { BuiltinPtr type = unit->builtin(Builtin::KindBool); StringTokPtr literal = StringTokPtr::dynamicCast($1); - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = "false"; - def->v.valueAsLiteral = "false"; + ConstDefTokPtr def = new ConstDefTok(type, "false", "false"); $$ = def; } | ICE_TRUE { BuiltinPtr type = unit->builtin(Builtin::KindBool); StringTokPtr literal = StringTokPtr::dynamicCast($1); - ConstDefTokPtr def = new ConstDefTok; - def->v.type = type; - def->v.value = type; - def->v.valueAsString = "true"; - def->v.valueAsLiteral = "true"; + ConstDefTokPtr def = new ConstDefTok(type, "true", "true"); $$ = def; } ; @@ -2173,8 +2369,8 @@ const_def TypePtr const_type = TypePtr::dynamicCast($3); StringTokPtr ident = StringTokPtr::dynamicCast($4); ConstDefTokPtr value = ConstDefTokPtr::dynamicCast($6); - $$ = unit->currentContainer()->createConst(ident->v, const_type, metaData->v, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral); + $$ = unit->currentContainer()->createConst(ident->v, const_type, metaData->v, value->v, + value->valueAsString, value->valueAsLiteral); } | ICE_CONST meta_data type '=' const_initializer { @@ -2182,8 +2378,8 @@ const_def TypePtr const_type = TypePtr::dynamicCast($3); ConstDefTokPtr value = ConstDefTokPtr::dynamicCast($5); unit->error("missing constant name"); - $$ = unit->currentContainer()->createConst(IceUtil::generateUUID(), const_type, metaData->v, value->v.value, - value->v.valueAsString, value->v.valueAsLiteral, Dummy); // Dummy + $$ = unit->currentContainer()->createConst(IceUtil::generateUUID(), const_type, metaData->v, value->v, + value->valueAsString, value->valueAsLiteral, Dummy); // Dummy } ; @@ -2274,6 +2470,9 @@ keyword | ICE_IDEMPOTENT { } +| ICE_TAG +{ +} | ICE_OPTIONAL { } diff --git a/cpp/src/Slice/GrammarUtil.h b/cpp/src/Slice/GrammarUtil.h index 082718126ce..beaa57a64b6 100644 --- a/cpp/src/Slice/GrammarUtil.h +++ b/cpp/src/Slice/GrammarUtil.h @@ -21,8 +21,7 @@ class ExceptionListTok; class ClassListTok; class EnumeratorListTok; class ConstDefTok; -class OptionalDefTok; -class OptionalTypeDefTok; +class TaggedDefTok; class ClassIdTok; typedef ::IceUtil::Handle StringTokPtr; @@ -36,7 +35,7 @@ typedef ::IceUtil::Handle ExceptionListTokPtr; typedef ::IceUtil::Handle ClassListTokPtr; typedef ::IceUtil::Handle EnumeratorListTokPtr; typedef ::IceUtil::Handle ConstDefTokPtr; -typedef ::IceUtil::Handle OptionalDefTokPtr; +typedef ::IceUtil::Handle TaggedDefTokPtr; typedef ::IceUtil::Handle ClassIdTokPtr; // ---------------------------------------------------------------------- @@ -171,19 +170,35 @@ class ConstDefTok : public GrammarBase public: ConstDefTok() { } - ConstDef v; + ConstDefTok(SyntaxTreeBasePtr value, std::string stringValue, std::string literalValue) : + v(value), + valueAsString(stringValue), + valueAsLiteral(literalValue) + { } + + SyntaxTreeBasePtr v; + std::string valueAsString; + std::string valueAsLiteral; }; // ---------------------------------------------------------------------- -// OptionalDefTok +// TaggedDefTok // ---------------------------------------------------------------------- -class OptionalDefTok : public GrammarBase +class TaggedDefTok : public GrammarBase { public: - OptionalDefTok() { } - OptionalDef v; + TaggedDefTok() { } + TaggedDefTok(int t) : + isTagged(t >= 0), + tag(t) + { } + + TypePtr type; + std::string name; + bool isTagged; + int tag; }; // ---------------------------------------------------------------------- @@ -199,30 +214,19 @@ class ClassIdTok : public GrammarBase int t; }; -} - -// -// Stuff for flex and bison -// - -#define YYSTYPE Slice::GrammarBasePtr -#define YY_DECL int slice_lex(YYSTYPE* yylvalp) -YY_DECL; +// ---------------------------------------------------------------------- +// TokenContext: stores the location of tokens. +// ---------------------------------------------------------------------- -// -// I must set the initial stack depth to the maximum stack depth to -// disable bison stack resizing. The bison stack resizing routines use -// simple malloc/alloc/memcpy calls, which do not work for the -// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor, -// assignment operator, etc. -// -#define YYMAXDEPTH 10000 -#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above. +struct TokenContext +{ + int firstLine; + int lastLine; + int firstColumn; + int lastColumn; + std::string filename; +}; -// -// Newer bison versions allow to disable stack resizing by defining -// yyoverflow. -// -#define yyoverflow(a, b, c, d, e, f) yyerror(a) +} #endif diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 814066e058a..d4d449e6f34 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -64,10 +64,12 @@ Slice::CompilerException::reason() const return _reason; } +// Forward declare things from Bison and Flex the parser can use. +extern int slice_parse(); +extern int slice_lineno; extern FILE* slice_in; extern int slice_debug; - -int slice_parse(); +extern int slice__flex_debug; // // Operation attributes @@ -6384,6 +6386,16 @@ Slice::Unit::setComment(const string& comment) } } +void +Slice::Unit::addToComment(const string& comment) +{ + if(!_currentComment.empty()) + { + _currentComment += '\n'; + } + _currentComment += comment; +} + string Slice::Unit::currentComment() { @@ -6415,67 +6427,20 @@ Slice::Unit::topLevelFile() const int Slice::Unit::currentLine() const { - return _currentLine; -} - -void -Slice::Unit::nextLine() -{ - _currentLine++; + return slice_lineno; } - -bool -Slice::Unit::scanPosition(const char* s) +int +Slice::Unit::setCurrentFile(const std::string& currentFile, int lineNumber) { - assert(*s == '#'); - - string line(s + 1); // Skip leading # - eraseWhiteSpace(line); - if(line.find("line", 0) == 0) // Erase optional "line" - { - line.erase(0, 4); - eraseWhiteSpace(line); - } - - string::size_type idx; - - _currentLine = atoi(line.c_str()) - 1; // Read line number - - idx = line.find_first_of(" \t\r"); // Erase line number - if(idx != string::npos) - { - line.erase(0, idx); - } - eraseWhiteSpace(line); - - string currentFile; - if(!line.empty()) - { - if(line[0] == '"') - { - idx = line.rfind('"'); - if(idx != string::npos) - { - currentFile = line.substr(1, idx - 1); - } - } - else - { - currentFile = line; - } - } - enum LineType { File, Push, Pop }; LineType type = File; - if(_currentLine == 0) + if(lineNumber == 0) { if(_currentIncludeLevel > 0 || currentFile != _topLevelFile) { type = Push; - line.erase(idx); - eraseWhiteSpace(line); } } else @@ -6484,8 +6449,6 @@ Slice::Unit::scanPosition(const char* s) if(dc != 0 && !dc->filename().empty() && dc->filename() != currentFile) { type = Pop; - line.erase(idx); - eraseWhiteSpace(line); } } @@ -6524,10 +6487,7 @@ Slice::Unit::scanPosition(const char* s) _definitionContextMap.insert(make_pair(currentFile, dc)); } - // - // Return code indicates whether starting parse of a new file. - // - return _currentLine == 0; + return static_cast(type); } int @@ -6574,7 +6534,7 @@ Slice::Unit::setSeenDefinition() void Slice::Unit::error(const string& s) { - emitError(currentFile(), _currentLine, s); + emitError(currentFile(), currentLine(), s); _errors++; } @@ -6583,11 +6543,11 @@ Slice::Unit::warning(WarningCategory category, const string& msg) const { if(_definitionContextStack.empty()) { - emitWarning(currentFile(), _currentLine, msg); + emitWarning(currentFile(), currentLine(), msg); } else { - _definitionContextStack.top()->warning(category, currentFile(), _currentLine, msg); + _definitionContextStack.top()->warning(category, currentFile(), currentLine(), msg); } } @@ -6857,23 +6817,17 @@ int Slice::Unit::parse(const string& filename, FILE* file, bool debug) { slice_debug = debug ? 1 : 0; + slice__flex_debug = debug ? 1 : 0; assert(!Slice::unit); Slice::unit = this; _currentComment = ""; - _currentLine = 1; _currentIncludeLevel = 0; _topLevelFile = fullPath(filename); pushContainer(this); pushDefinitionContext(); - - // - // MCPP Fix: mcpp doesn't always output the first #line when mcpp_lib_main is - // called repeatedly. We scan a fake #line here to ensure the top definition - // context is correctly initialized. - // - scanPosition(string("#line 1 " + _topLevelFile).c_str()); + setCurrentFile(_topLevelFile, 0); slice_in = file; int status = slice_parse(); @@ -6975,7 +6929,6 @@ Slice::Unit::Unit(bool ignRedefs, bool all, bool allowIcePrefix, bool allowUnder _allowUnderscore(allowUnderscore), _defaultGlobalMetaData(defaultGlobalMetadata), _errors(0), - _currentLine(0), _currentIncludeLevel(0) { diff --git a/cpp/src/Slice/Parser.h b/cpp/src/Slice/Parser.h index d1695cef443..fde53d997f8 100644 --- a/cpp/src/Slice/Parser.h +++ b/cpp/src/Slice/Parser.h @@ -1082,13 +1082,13 @@ class Unit : public virtual Container bool allowUnderscore() const; void setComment(const std::string&); + void addToComment(const std::string&); std::string currentComment(); // Not const, as this function removes the current comment. std::string currentFile() const; std::string topLevelFile() const; int currentLine() const; - void nextLine(); - bool scanPosition(const char*); + int setCurrentFile(const std::string&, int); int currentIncludeLevel() const; void addGlobalMetaData(const StringList&); @@ -1153,9 +1153,7 @@ class Unit : public virtual Container StringList _defaultGlobalMetaData; int _errors; std::string _currentComment; - int _currentLine; int _currentIncludeLevel; - std::string _currentFile; std::string _topLevelFile; std::stack _definitionContextStack; StringList _includeFiles; diff --git a/cpp/src/Slice/Scanner.cpp b/cpp/src/Slice/Scanner.cpp index 48466892d19..e016b685d1d 100644 --- a/cpp/src/Slice/Scanner.cpp +++ b/cpp/src/Slice/Scanner.cpp @@ -1,12 +1,19 @@ +#line 2 "src/Slice/Scanner.cpp" +// +// Copyright (c) ZeroC, Inc. All rights reserved. +// + #include -#line 1 "src/Slice/Scanner.cpp" -#line 3 "src/Slice/Scanner.cpp" +#line 9 "src/Slice/Scanner.cpp" -#define YY_INT_ALIGNED short int +#define YY_INT_ALIGNED long int /* A lexical scanner generated by flex */ +/* %not-for-header */ +/* %if-c-only */ +/* %if-not-reentrant */ #define yy_create_buffer slice__create_buffer #define yy_delete_buffer slice__delete_buffer #define yy_scan_buffer slice__scan_buffer @@ -32,6 +39,10 @@ #define yyrealloc slice_realloc #define yyfree slice_free +/* %endif */ +/* %endif */ +/* %ok-for-header */ + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 @@ -40,6 +51,10 @@ #define FLEX_BETA #endif +/* %if-c++-only */ +/* %endif */ + +/* %if-c-only */ #ifdef yy_create_buffer #define slice__create_buffer_ALREADY_DEFINED #else @@ -220,6 +235,32 @@ #define yywrap slice_wrap #endif +/* %endif */ + +#ifdef yyget_lval +#define slice_get_lval_ALREADY_DEFINED +#else +#define yyget_lval slice_get_lval +#endif + +#ifdef yyset_lval +#define slice_set_lval_ALREADY_DEFINED +#else +#define yyset_lval slice_set_lval +#endif + +#ifdef yyget_lloc +#define slice_get_lloc_ALREADY_DEFINED +#else +#define yyget_lloc slice_get_lloc +#endif + +#ifdef yyset_lloc +#define slice_set_lloc_ALREADY_DEFINED +#else +#define yyset_lloc slice_set_lloc +#endif + #ifdef yyalloc #define slice_alloc_ALREADY_DEFINED #else @@ -238,6 +279,8 @@ #define yyfree slice_free #endif +/* %if-c-only */ + #ifdef yytext #define slice_text_ALREADY_DEFINED #else @@ -274,16 +317,23 @@ #define yylineno slice_lineno #endif +/* %endif */ + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ +/* %if-c-only */ #include #include #include #include +/* %endif */ +/* %if-tables-serialization */ +/* %endif */ /* end standard C headers. */ +/* %if-c-or-c++ */ /* flex integer type definitions */ #ifndef FLEXINT_H @@ -352,7 +402,11 @@ typedef unsigned int flex_uint32_t; #endif /* ! FLEXINT_H */ +/* %endif */ + /* begin standard C++ headers. */ +/* %if-c++-only */ +/* %endif */ /* TODO: this is always defined, so inline it */ #define yyconst const @@ -363,13 +417,24 @@ typedef unsigned int flex_uint32_t; #define yynoreturn #endif +/* %not-for-header */ /* Returned upon end-of-file. */ #define YY_NULL 0 +/* %ok-for-header */ +/* %not-for-header */ /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) +/* %ok-for-header */ + +/* %if-reentrant */ +/* %endif */ + +/* %if-not-reentrant */ + +/* %endif */ /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less @@ -415,9 +480,15 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif +/* %if-not-reentrant */ extern int yyleng; +/* %endif */ +/* %if-c-only */ +/* %if-not-reentrant */ extern FILE *yyin, *yyout; +/* %endif */ +/* %endif */ #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 @@ -445,7 +516,12 @@ extern FILE *yyin, *yyout; #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { +/* %if-c-only */ FILE *yy_input_file; +/* %endif */ + +/* %if-c++-only */ +/* %endif */ char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ @@ -506,10 +582,18 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ +/* %if-c-only Standard (non-C++) definition */ +/* %not-for-header */ +/* %if-not-reentrant */ + /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ +/* %endif */ +/* %ok-for-header */ + +/* %endif */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -525,6 +609,10 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] +/* %if-c-only Standard (non-C++) definition */ + +/* %if-not-reentrant */ +/* %not-for-header */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ @@ -539,6 +627,9 @@ static int yy_start = 0; /* start state number */ * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; +/* %ok-for-header */ + +/* %endif */ void yyrestart ( FILE *input_file ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); @@ -557,6 +648,8 @@ YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); +/* %endif */ + void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); @@ -582,10 +675,13 @@ void yyfree ( void * ); } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) +/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ /* Begin user sect3 */ #define slice_wrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP + +#define FLEX_DEBUG typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; @@ -601,22 +697,32 @@ extern char *yytext; #endif #define yytext_ptr yytext +/* %% [1.5] DFA */ + +/* %if-c-only Standard (non-C++) definition */ + static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); static void yynoreturn yy_fatal_error ( const char* msg ); +/* %endif */ + /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ +/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ + (yytext_ptr) -= (yy_more_len); \ + yyleng = (int) (yy_cp - (yytext_ptr)); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ +/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 19 -#define YY_END_OF_BUFFER 20 +/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ +#define YY_NUM_RULES 49 +#define YY_END_OF_BUFFER 50 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -624,16 +730,30 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[76] = +static const flex_int32_t yy_accept[192] = { 0, - 0, 0, 0, 0, 0, 0, 20, 18, 16, 16, - 13, 18, 18, 18, 14, 14, 18, 12, 7, 18, - 8, 18, 18, 0, 14, 14, 15, 6, 5, 15, - 14, 0, 0, 0, 0, 11, 12, 0, 12, 0, - 9, 12, 10, 0, 0, 0, 0, 0, 15, 0, - 15, 14, 0, 1, 0, 17, 0, 15, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, - 0, 0, 0, 4, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 47, 44, 45, 44, 48, + 1, 48, 48, 48, 19, 19, 48, 43, 34, 48, + 47, 44, 44, 28, 25, 25, 26, 24, 25, 25, + 25, 32, 44, 33, 32, 44, 28, 41, 38, 36, + 37, 41, 39, 28, 49, 15, 3, 3, 18, 3, + 17, 3, 3, 44, 45, 0, 19, 19, 20, 23, + 22, 20, 19, 0, 0, 0, 0, 42, 43, 0, + 43, 0, 35, 43, 0, 44, 28, 28, 30, 0, + 25, 25, 26, 27, 22, 25, 25, 25, 25, 25, + + 32, 23, 22, 30, 32, 38, 40, 3, 3, 3, + 3, 16, 4, 5, 8, 6, 14, 2, 7, 13, + 10, 3, 3, 3, 3, 3, 0, 20, 22, 21, + 0, 20, 19, 46, 0, 0, 22, 21, 25, 25, + 22, 21, 32, 3, 3, 8, 14, 14, 0, 13, + 13, 9, 3, 3, 0, 20, 21, 0, 0, 21, + 25, 25, 21, 32, 3, 8, 14, 2, 13, 9, + 3, 0, 31, 29, 25, 25, 25, 29, 14, 13, + 3, 0, 25, 14, 11, 3, 14, 14, 14, 12, + 0 + } ; static const YY_CHAR yy_ec[256] = @@ -641,147 +761,378 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 5, 6, 1, 1, 1, 1, 7, - 1, 8, 9, 1, 10, 11, 12, 13, 14, 14, - 14, 14, 14, 14, 14, 15, 15, 16, 1, 1, - 1, 1, 1, 1, 17, 17, 17, 17, 18, 19, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 21, 22, 23, 1, 20, 1, 17, 17, 17, 17, - - 24, 19, 20, 20, 25, 20, 20, 26, 20, 27, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 28, - 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 29, 1, 1, 1, - 30, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 31, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 + 1, 5, 6, 7, 8, 6, 6, 6, 9, 10, + 6, 11, 12, 13, 14, 15, 16, 17, 18, 18, + 18, 18, 18, 18, 18, 19, 19, 20, 6, 6, + 6, 6, 21, 6, 22, 22, 22, 22, 23, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 26, 25, 25, 25, 25, 25, + 27, 28, 29, 6, 30, 6, 31, 31, 22, 22, + + 32, 33, 25, 25, 34, 25, 25, 35, 25, 36, + 25, 25, 25, 37, 25, 37, 38, 37, 25, 39, + 25, 25, 6, 6, 6, 6, 40, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 42, 41, 41, 41, + 43, 41, 41, 41, 41, 41, 41, 41, 41, 41, + + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 44, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41 } ; -static const YY_CHAR yy_meta[32] = +static const YY_CHAR yy_meta[45] = { 0, - 1, 2, 3, 1, 1, 1, 1, 1, 4, 4, - 1, 1, 5, 5, 5, 1, 6, 6, 6, 7, - 1, 1, 1, 6, 7, 8, 7, 7, 1, 1, - 1 + 1, 2, 3, 2, 2, 4, 1, 4, 4, 5, + 6, 4, 4, 4, 4, 4, 7, 7, 7, 5, + 4, 8, 8, 8, 9, 9, 4, 10, 4, 11, + 8, 8, 8, 9, 9, 9, 9, 9, 9, 1, + 4, 4, 4, 4 } ; -static const flex_int16_t yy_base[87] = +static const flex_int32_t yy_base[217] = { 0, - 0, 140, 0, 26, 0, 139, 137, 197, 197, 197, - 197, 22, 25, 33, 47, 35, 120, 74, 114, 0, - 111, 40, 104, 37, 0, 0, 90, 197, 197, 0, - 104, 34, 0, 97, 52, 197, 0, 99, 0, 0, - 197, 0, 197, 44, 65, 88, 77, 63, 197, 69, - 97, 0, 115, 197, 79, 197, 108, 111, 92, 71, - 81, 82, 72, 66, 197, 125, 77, 126, 197, 59, - 48, 44, 31, 197, 197, 135, 142, 147, 148, 153, - 155, 160, 168, 175, 180, 188 + 0, 43, 50, 65, 363, 54, 362, 55, 75, 80, + 98, 126, 155, 195, 401, 1047, 45, 394, 70, 1047, + 1047, 75, 89, 93, 221, 100, 375, 259, 367, 0, + 336, 108, 133, 146, 0, 120, 374, 351, 110, 141, + 170, 0, 148, 1047, 150, 165, 174, 1047, 349, 1047, + 1047, 166, 306, 199, 1047, 1047, 208, 85, 1047, 204, + 281, 217, 319, 222, 330, 167, 0, 214, 338, 1047, + 306, 0, 233, 254, 0, 288, 279, 1047, 370, 295, + 0, 0, 1047, 0, 268, 289, 240, 308, 327, 271, + 0, 299, 297, 1047, 238, 326, 346, 374, 394, 262, + + 0, 0, 337, 398, 246, 271, 1047, 345, 93, 176, + 417, 1047, 1047, 1047, 47, 1047, 441, 227, 1047, 464, + 0, 400, 502, 536, 418, 380, 413, 1047, 0, 0, + 341, 422, 0, 1047, 442, 211, 232, 230, 446, 194, + 364, 381, 192, 507, 511, 268, 555, 0, 186, 578, + 0, 0, 520, 304, 451, 512, 0, 200, 142, 157, + 129, 122, 424, 88, 542, 1047, 601, 58, 624, 1047, + 452, 64, 1047, 142, 183, 0, 265, 290, 647, 670, + 489, 695, 713, 716, 1047, 741, 744, 767, 790, 1047, + 1047, 829, 840, 851, 862, 872, 876, 887, 898, 908, + + 919, 930, 935, 943, 954, 965, 970, 978, 989, 1000, + 1011, 49, 37, 1016, 1024, 1035 } ; -static const flex_int16_t yy_def[87] = +static const flex_int32_t yy_def[217] = { 0, - 75, 1, 1, 1, 1, 1, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 15, 75, 75, 75, 76, - 75, 77, 75, 75, 15, 16, 75, 75, 75, 27, - 15, 78, 79, 76, 75, 75, 18, 75, 18, 76, - 75, 18, 75, 77, 80, 75, 75, 81, 75, 75, - 75, 79, 75, 75, 75, 75, 75, 75, 82, 75, - 82, 83, 75, 83, 75, 75, 84, 75, 75, 85, - 85, 86, 86, 75, 0, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75 + 191, 1, 192, 192, 1, 1, 1, 1, 193, 193, + 194, 194, 195, 195, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 196, 191, 197, + 191, 191, 191, 191, 198, 198, 191, 191, 198, 198, + 198, 199, 191, 191, 199, 191, 199, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 200, 200, 191, 200, + 201, 200, 200, 191, 191, 191, 25, 191, 191, 191, + 202, 69, 191, 191, 203, 197, 191, 191, 196, 191, + 79, 197, 191, 79, 191, 191, 191, 191, 191, 191, + 198, 198, 191, 191, 204, 198, 198, 198, 198, 198, + + 199, 199, 205, 199, 199, 191, 191, 200, 200, 200, + 206, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 207, 200, 200, 200, 200, 200, 191, 191, 202, 208, + 191, 191, 203, 191, 191, 191, 204, 209, 198, 198, + 205, 210, 199, 206, 211, 191, 191, 212, 191, 191, + 213, 214, 200, 200, 191, 191, 208, 215, 191, 209, + 216, 198, 210, 199, 211, 191, 191, 191, 191, 191, + 200, 215, 191, 191, 216, 198, 198, 199, 191, 191, + 200, 191, 198, 191, 191, 200, 191, 191, 191, 191, + 0, 191, 191, 191, 191, 191, 191, 191, 191, 191, + + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191 } ; -static const flex_int16_t yy_nxt[229] = +static const flex_int32_t yy_nxt[1092] = { 0, - 8, 9, 10, 9, 11, 8, 8, 8, 12, 12, - 13, 14, 15, 16, 16, 17, 18, 18, 18, 18, - 19, 20, 21, 18, 18, 18, 18, 18, 8, 8, - 8, 22, 24, 74, 25, 26, 26, 27, 27, 27, - 28, 44, 50, 50, 29, 44, 74, 26, 26, 27, - 27, 27, 72, 35, 35, 35, 23, 30, 36, 31, - 31, 26, 75, 72, 32, 46, 53, 54, 65, 46, - 32, 57, 57, 66, 33, 35, 35, 35, 68, 69, - 36, 51, 51, 51, 65, 62, 37, 37, 37, 38, - 39, 39, 39, 39, 63, 40, 62, 39, 39, 39, - - 39, 39, 27, 27, 27, 60, 56, 48, 49, 51, - 51, 51, 55, 48, 34, 49, 53, 54, 40, 59, - 58, 58, 58, 58, 58, 58, 66, 68, 69, 49, - 70, 75, 47, 43, 41, 34, 75, 67, 67, 67, - 42, 42, 42, 45, 22, 22, 45, 75, 75, 45, - 51, 51, 52, 52, 45, 45, 75, 45, 58, 58, - 61, 61, 61, 61, 61, 61, 61, 61, 64, 64, - 64, 64, 64, 64, 64, 64, 67, 67, 75, 67, - 71, 71, 71, 71, 71, 71, 71, 71, 73, 73, - 73, 73, 73, 73, 73, 73, 7, 75, 75, 75, - - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75 + 16, 17, 18, 17, 19, 20, 21, 20, 20, 20, + 20, 22, 20, 22, 23, 24, 25, 26, 26, 27, + 20, 28, 28, 28, 28, 28, 29, 30, 20, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 20, + 16, 16, 16, 31, 32, 151, 64, 33, 64, 64, + 34, 36, 37, 36, 36, 32, 32, 148, 33, 33, + 38, 34, 34, 146, 146, 39, 40, 37, 36, 40, + 173, 64, 41, 64, 64, 38, 43, 44, 43, 43, + 39, 46, 44, 43, 46, 149, 191, 47, 191, 66, + 45, 67, 68, 68, 191, 45, 191, 16, 16, 43, + + 49, 43, 43, 70, 50, 69, 69, 69, 71, 86, + 51, 64, 86, 52, 72, 87, 68, 68, 68, 178, + 70, 92, 74, 92, 92, 95, 53, 46, 49, 43, + 46, 74, 50, 54, 86, 176, 64, 86, 51, 172, + 87, 52, 96, 182, 92, 96, 182, 88, 97, 64, + 88, 64, 64, 177, 53, 55, 43, 56, 43, 57, + 102, 59, 89, 89, 89, 103, 86, 157, 64, 86, + 60, 98, 87, 174, 98, 88, 70, 191, 88, 191, + 90, 71, 61, 69, 69, 69, 99, 99, 99, 176, + 104, 104, 104, 172, 55, 55, 46, 56, 43, 62, + + 88, 59, 63, 88, 100, 191, 173, 191, 105, 64, + 60, 64, 108, 168, 110, 89, 89, 89, 86, 111, + 64, 122, 61, 64, 123, 64, 64, 164, 72, 162, + 68, 68, 68, 90, 55, 72, 74, 73, 73, 68, + 157, 88, 129, 74, 88, 74, 159, 72, 129, 73, + 73, 68, 74, 138, 149, 74, 89, 89, 89, 75, + 77, 77, 77, 77, 74, 131, 183, 131, 78, 183, + 132, 132, 132, 106, 90, 79, 79, 79, 80, 143, + 77, 77, 77, 77, 166, 166, 82, 113, 78, 114, + 86, 182, 64, 86, 182, 140, 87, 115, 115, 93, + + 92, 116, 92, 92, 136, 191, 117, 191, 118, 88, + 134, 119, 88, 119, 76, 82, 119, 119, 120, 121, + 88, 130, 191, 124, 89, 89, 89, 96, 135, 92, + 96, 135, 65, 97, 107, 125, 125, 125, 129, 171, + 129, 129, 90, 89, 89, 89, 64, 98, 64, 108, + 98, 106, 142, 126, 69, 69, 69, 132, 132, 132, + 127, 128, 99, 99, 99, 129, 94, 129, 129, 127, + 128, 77, 77, 77, 77, 98, 93, 85, 98, 78, + 100, 191, 157, 191, 157, 157, 79, 79, 79, 80, + 99, 99, 99, 83, 76, 139, 65, 82, 139, 135, + + 191, 86, 135, 64, 122, 16, 16, 123, 100, 191, + 99, 99, 99, 154, 104, 104, 104, 129, 129, 135, + 129, 191, 153, 129, 155, 157, 155, 157, 157, 156, + 156, 156, 145, 191, 125, 125, 125, 191, 132, 132, + 132, 191, 191, 135, 129, 128, 135, 139, 158, 191, + 139, 191, 161, 191, 128, 191, 129, 147, 147, 147, + 191, 191, 147, 147, 147, 148, 148, 156, 156, 156, + 191, 147, 147, 147, 148, 148, 148, 148, 148, 148, + 150, 150, 150, 181, 191, 150, 150, 150, 151, 151, + 182, 191, 191, 186, 150, 150, 150, 151, 151, 151, + + 151, 151, 151, 88, 191, 191, 124, 129, 129, 191, + 129, 157, 157, 129, 157, 191, 191, 157, 125, 125, + 125, 135, 191, 191, 153, 191, 158, 191, 156, 156, + 156, 191, 191, 191, 129, 128, 126, 88, 157, 191, + 124, 191, 157, 157, 128, 157, 129, 191, 157, 191, + 157, 191, 125, 125, 125, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 157, + 126, 167, 167, 167, 191, 191, 167, 167, 167, 148, + 148, 157, 191, 191, 191, 167, 167, 167, 148, 148, + 148, 148, 148, 148, 169, 169, 169, 191, 191, 169, + + 169, 169, 151, 151, 191, 191, 191, 191, 169, 169, + 169, 151, 151, 151, 151, 151, 151, 179, 179, 179, + 191, 191, 179, 179, 179, 148, 148, 191, 191, 191, + 191, 179, 179, 179, 148, 148, 148, 148, 148, 148, + 180, 180, 180, 191, 191, 180, 180, 180, 151, 151, + 191, 191, 191, 191, 180, 180, 180, 151, 151, 151, + 151, 151, 151, 184, 184, 184, 191, 191, 184, 184, + 184, 148, 148, 191, 191, 191, 191, 184, 184, 184, + 148, 148, 148, 148, 148, 148, 185, 185, 185, 191, + 191, 185, 185, 185, 151, 151, 182, 191, 191, 182, + + 185, 185, 185, 151, 151, 151, 151, 151, 151, 191, + 191, 89, 89, 89, 183, 191, 191, 183, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 99, + 99, 99, 187, 187, 187, 191, 191, 187, 187, 187, + 148, 148, 182, 191, 191, 186, 187, 187, 187, 148, + 148, 148, 148, 148, 148, 191, 191, 125, 125, 125, + 188, 188, 188, 191, 191, 188, 188, 188, 148, 148, + 191, 191, 191, 191, 188, 188, 188, 148, 148, 148, + 148, 148, 148, 189, 189, 189, 191, 191, 189, 189, + 189, 148, 148, 191, 191, 191, 191, 189, 189, 189, + + 148, 148, 148, 148, 148, 148, 190, 190, 190, 191, + 191, 190, 190, 190, 148, 148, 191, 191, 191, 191, + 190, 190, 190, 148, 148, 148, 148, 148, 148, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 81, 81, 191, 81, 191, 81, 81, + 81, 81, 81, 84, 84, 191, 84, 91, 91, 191, + 91, 91, 191, 91, 91, 91, 91, 91, 101, 191, + + 191, 101, 101, 101, 101, 101, 101, 101, 101, 109, + 191, 109, 109, 109, 109, 109, 109, 191, 109, 112, + 112, 191, 112, 112, 112, 112, 112, 112, 112, 112, + 129, 129, 191, 129, 129, 129, 129, 129, 129, 129, + 129, 133, 133, 137, 137, 191, 137, 137, 137, 137, + 137, 137, 137, 137, 141, 141, 191, 141, 141, 141, + 141, 141, 141, 141, 141, 144, 144, 191, 144, 144, + 144, 144, 144, 144, 144, 144, 152, 152, 157, 157, + 191, 157, 157, 157, 157, 157, 157, 157, 157, 160, + 160, 191, 160, 160, 160, 160, 160, 160, 160, 160, + + 163, 163, 191, 163, 163, 163, 163, 163, 163, 163, + 163, 165, 165, 191, 165, 165, 165, 165, 165, 165, + 165, 165, 170, 170, 172, 172, 191, 172, 172, 172, + 172, 172, 172, 172, 172, 175, 175, 191, 175, 175, + 175, 175, 175, 175, 175, 175, 15, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191 + } ; -static const flex_int16_t yy_chk[229] = +static const flex_int32_t yy_chk[1092] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 12, 73, 12, 12, 12, 13, 13, 13, - 14, 22, 32, 32, 14, 44, 72, 16, 16, 24, - 24, 24, 71, 35, 35, 35, 4, 15, 35, 15, - 15, 15, 16, 70, 15, 22, 45, 45, 64, 44, - 15, 48, 48, 63, 15, 18, 18, 18, 67, 67, - 18, 50, 50, 50, 62, 61, 18, 18, 18, 18, - 18, 18, 18, 18, 60, 18, 59, 18, 18, 18, - - 18, 18, 27, 27, 27, 55, 47, 27, 27, 51, - 51, 51, 46, 27, 38, 51, 53, 53, 34, 53, - 57, 57, 57, 58, 58, 58, 66, 68, 68, 58, - 68, 31, 23, 21, 19, 17, 7, 66, 66, 66, - 76, 76, 76, 77, 6, 2, 77, 0, 0, 77, - 78, 78, 79, 79, 80, 80, 0, 80, 81, 81, - 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, - 83, 83, 83, 83, 83, 83, 84, 84, 0, 84, - 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, - 86, 86, 86, 86, 86, 86, 75, 75, 75, 75, - - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 213, 17, 2, 17, 17, + 2, 3, 3, 3, 3, 6, 8, 212, 6, 8, + 3, 6, 8, 115, 115, 3, 4, 4, 4, 4, + 172, 19, 4, 19, 19, 4, 9, 9, 9, 9, + 4, 10, 10, 10, 10, 168, 58, 10, 58, 22, + 9, 22, 22, 22, 109, 10, 109, 6, 8, 11, + + 11, 11, 11, 24, 11, 23, 23, 23, 24, 32, + 11, 32, 32, 11, 26, 32, 26, 26, 26, 164, + 39, 36, 26, 36, 36, 39, 11, 12, 12, 12, + 12, 26, 12, 12, 33, 161, 33, 33, 12, 161, + 33, 12, 40, 174, 40, 40, 174, 34, 40, 43, + 34, 43, 43, 162, 12, 13, 13, 13, 13, 13, + 45, 13, 34, 34, 34, 45, 46, 160, 46, 46, + 13, 41, 46, 159, 41, 47, 52, 110, 47, 110, + 34, 52, 13, 66, 66, 66, 41, 41, 41, 175, + 47, 47, 47, 175, 13, 14, 14, 14, 14, 14, + + 54, 14, 14, 54, 41, 60, 158, 60, 47, 57, + 14, 57, 57, 149, 60, 54, 54, 54, 62, 60, + 62, 62, 14, 64, 62, 64, 64, 143, 68, 140, + 68, 68, 68, 54, 14, 25, 68, 25, 25, 25, + 138, 87, 137, 25, 87, 68, 136, 73, 95, 73, + 73, 73, 25, 95, 118, 73, 87, 87, 87, 25, + 28, 28, 28, 28, 73, 74, 177, 74, 28, 177, + 74, 74, 74, 106, 87, 28, 28, 28, 28, 105, + 77, 77, 77, 77, 146, 146, 28, 61, 77, 61, + 86, 178, 86, 86, 178, 100, 86, 61, 61, 93, + + 92, 61, 92, 92, 90, 154, 61, 154, 61, 88, + 85, 61, 88, 61, 80, 76, 61, 61, 61, 61, + 63, 71, 63, 63, 88, 88, 88, 96, 89, 96, + 96, 89, 65, 96, 53, 63, 63, 63, 103, 154, + 103, 103, 88, 89, 89, 89, 108, 97, 108, 108, + 97, 49, 103, 63, 69, 69, 69, 131, 131, 131, + 69, 69, 97, 97, 97, 141, 38, 141, 141, 69, + 69, 79, 79, 79, 79, 98, 37, 31, 98, 79, + 97, 126, 142, 126, 142, 142, 79, 79, 79, 79, + 98, 98, 98, 29, 27, 99, 18, 79, 99, 104, + + 15, 122, 104, 122, 122, 7, 5, 122, 98, 0, + 99, 99, 99, 126, 104, 104, 104, 111, 111, 125, + 111, 125, 125, 111, 127, 163, 127, 163, 163, 127, + 127, 127, 111, 0, 125, 125, 125, 0, 132, 132, + 132, 0, 0, 135, 111, 132, 135, 139, 135, 0, + 139, 0, 139, 171, 132, 171, 111, 117, 117, 117, + 0, 0, 117, 117, 117, 117, 117, 155, 155, 155, + 0, 117, 117, 117, 117, 117, 117, 117, 117, 117, + 120, 120, 120, 171, 0, 120, 120, 120, 120, 120, + 181, 0, 181, 181, 120, 120, 120, 120, 120, 120, + + 120, 120, 120, 123, 0, 123, 123, 144, 144, 0, + 144, 145, 145, 144, 145, 0, 0, 145, 123, 123, + 123, 153, 0, 153, 153, 0, 153, 0, 156, 156, + 156, 0, 0, 0, 144, 156, 123, 124, 145, 124, + 124, 0, 165, 165, 156, 165, 144, 0, 165, 0, + 145, 0, 124, 124, 124, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 165, + 124, 147, 147, 147, 0, 0, 147, 147, 147, 147, + 147, 165, 0, 0, 0, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 150, 150, 150, 0, 0, 150, + + 150, 150, 150, 150, 0, 0, 0, 0, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 167, 167, 167, + 0, 0, 167, 167, 167, 167, 167, 0, 0, 0, + 0, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 169, 169, 169, 0, 0, 169, 169, 169, 169, 169, + 0, 0, 0, 0, 169, 169, 169, 169, 169, 169, + 169, 169, 169, 179, 179, 179, 0, 0, 179, 179, + 179, 179, 179, 0, 0, 0, 0, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 180, 180, 180, 0, + 0, 180, 180, 180, 180, 180, 182, 0, 0, 182, + + 180, 180, 180, 180, 180, 180, 180, 180, 180, 0, + 0, 182, 182, 182, 183, 0, 0, 183, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, + 183, 183, 184, 184, 184, 0, 0, 184, 184, 184, + 184, 184, 186, 0, 186, 186, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 0, 0, 186, 186, 186, + 187, 187, 187, 0, 0, 187, 187, 187, 187, 187, + 0, 0, 0, 0, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 188, 188, 188, 0, 0, 188, 188, + 188, 188, 188, 0, 0, 0, 0, 188, 188, 188, + + 188, 188, 188, 188, 188, 188, 189, 189, 189, 0, + 0, 189, 189, 189, 189, 189, 0, 0, 0, 0, + 189, 189, 189, 189, 189, 189, 189, 189, 189, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 194, 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 196, 196, 0, 196, 0, 196, 196, + 196, 196, 196, 197, 197, 0, 197, 198, 198, 0, + 198, 198, 0, 198, 198, 198, 198, 198, 199, 0, + + 0, 199, 199, 199, 199, 199, 199, 199, 199, 200, + 0, 200, 200, 200, 200, 200, 200, 0, 200, 201, + 201, 0, 201, 201, 201, 201, 201, 201, 201, 201, + 202, 202, 0, 202, 202, 202, 202, 202, 202, 202, + 202, 203, 203, 204, 204, 0, 204, 204, 204, 204, + 204, 204, 204, 204, 205, 205, 0, 205, 205, 205, + 205, 205, 205, 205, 205, 206, 206, 0, 206, 206, + 206, 206, 206, 206, 206, 206, 207, 207, 208, 208, + 0, 208, 208, 208, 208, 208, 208, 208, 208, 209, + 209, 0, 209, 209, 209, 209, 209, 209, 209, 209, + + 210, 210, 0, 210, 210, 210, 210, 210, 210, 210, + 210, 211, 211, 0, 211, 211, 211, 211, 211, 211, + 211, 211, 214, 214, 215, 215, 0, 215, 215, 215, + 215, 215, 215, 215, 215, 216, 216, 0, 216, 216, + 216, 216, 216, 216, 216, 216, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191 + } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; -int yy_flex_debug = 0; +int yy_flex_debug = 1; + +static const flex_int32_t yy_rule_linenum[49] = + { 0, + 142, 156, 157, 164, 165, 166, 173, 192, 205, 215, + 222, 223, 235, 236, 244, 255, 265, 273, 291, 305, + 333, 338, 341, 347, 348, 353, 359, 378, 383, 389, + 390, 405, 410, 418, 423, 438, 448, 453, 457, 462, + 468, 474, 511, 521, 524, 531, 535, 549 + } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 +static int yy_more_flag = 0; +static int yy_more_len = 0; +#define yymore() ((yy_more_flag) = 1) +#define YY_MORE_ADJ (yy_more_len) #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "src/Slice/Scanner.l" -#line 2 "src/Slice/Scanner.l" -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// +#line 11 "src/Slice/Scanner.l" -#include // Before Grammer.h, so that YYSTYPE is defined +#include #include #include @@ -790,34 +1141,9 @@ char *yytext; #include #include -#if defined(_MSC_VER) -// '<' : signed/unsigned mismatch -# pragma warning(disable:4018) +#ifdef _MSC_VER // 'initializing' : conversion from '__int64' to 'int', possible loss of data # pragma warning(disable:4244) - -# if defined(ICE_64) -// -// '=' : conversion from 'size_t' to 'int', possible loss of data -// The result of fread() is a size_t and gets inserted into an int -// -# pragma warning(disable:4267) -# endif -#endif - -#if defined(__GNUC__) -# pragma GCC diagnostic ignored "-Wsign-compare" -#endif - -// -// Avoid clang conversion warnings -// -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wconversion" -# pragma clang diagnostic ignored "-Wsign-conversion" -#endif - -#ifdef _MSC_VER # ifdef slice_wrap # undef slice_wrap # define slice_wrap() 1 @@ -830,9 +1156,6 @@ char *yytext; # undef slice_wrap # define slice_wrap() 1 # endif -# ifdef ICE_64 -# pragma error_messages(off,truncwarn) -# endif #endif using namespace std; @@ -841,70 +1164,113 @@ using namespace Slice; namespace Slice { -// // Definitions for the case-insensitive keyword-token map. -// -typedef std::map StringTokenMap; -static StringTokenMap keywordMap; +typedef map StringTokenMap; +StringTokenMap keywordMap; -void initScanner(); int checkKeyword(string&); -int checkIdentifier(string&); +int checkIdentifier(const string&); + +} + +// Stores the scanner's current column position. Flex also automatically +// generates 'yylineno', which stores the scanner's current line number. +int yycolno = 0; +// Stores a copy of the filename that the scanner is currently scanning. +string yyfilename; + +namespace +{ + +void nextLine(int = 1); +int scanPosition(const char*); +void setLocation(TokenContext*); +void startLocation(TokenContext*); +void endLocation(TokenContext*); + +void initScanner(); +void preAction(); } +// Override some of the functions flex auto-generates with our own implementations. #define YY_USER_INIT initScanner(); +#define YY_USER_ACTION preAction(); + +#line 1201 "src/Slice/Scanner.cpp" +#line 80 "src/Slice/Scanner.l" + /* Changes the default prefix of 'yy' to 'slice_' for functions and variables in the generated code. */ + /* Instructs flex to not suppress any warnings when generating the scanner. */ + /* Instructs flex to generate a scanner that supports verbose outputting (debug mode). */ + /* By default flex will 'default match' any text it encounters that doesn't match any specified rules. This + * option disables default-matching (it throws 'scanner jammed' instead) to make grammar holes more obvious. */ + /* Directs flex to generate a scanner tailored for use by bison, and that supports bison's token location mechanism. + * These options change the signature of the main lexing function, which must match the one declared in Grammar.y */ + /* Enables the use of flex's built in start-condition state stack. */ + /* Ensures flex generates a scanner that supports reading 8-bit characters. */ + /* Directs flex to generate lookup tables that are better aligned in memory to + * improve access speeds, even if this means allocating larger tables. */ + /* Enables batching for improved performance. */ + /* Directs flex to store matched text as 'char *' instead of char arrays, for improved performance. */ + /* Disables the scanner's interactive modes for improved performance. */ + /* Disables the generation of functions we don't use to reduce clutter, and possibly improve performance. */ +#define YY_NO_INPUT 1 + /* List of start-condition states the scanner can be in. This lets the scanning be context dependent. */ + + -#line 857 "src/Slice/Scanner.cpp" -#line 859 "src/Slice/Scanner.cpp" + + + /* The scanner also has a built in 'INITIAL' start-condition state, which is the state the scanner is initialized in. + * We use it solely to check for and consume any BOMs at the start of files. See Bug 3140. */ +#line 1228 "src/Slice/Scanner.cpp" #define INITIAL 0 -#define BOMSCAN 1 -#define MAINSCAN 2 +#define C_COMMENT 1 +#define PRE_SLICE 2 +#define SLICE 3 +#define PREPROCESS 4 +#define METADATA 5 +#define STRING_LITERAL 6 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ +/* %if-c-only */ #include +/* %endif */ +/* %if-c++-only */ +/* %endif */ #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif +/* %if-c-only Reentrant structure and macros (non-C++). */ +/* %if-reentrant */ +/* %if-c-only */ + static int yy_init_globals ( void ); +/* %endif */ +/* %if-reentrant */ +/* %endif */ +/* %endif End reentrant structures and macros. */ + /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy ( void ); -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); +/* %if-bison-bridge */ -char *yyget_text ( void ); +void yyset_lval ( YYSTYPE * yylval_param ); -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); +/* %endif */ /* Macros after this point can all be overridden by user definitions in * section 1. @@ -918,11 +1284,13 @@ extern int yywrap ( void ); #endif #endif +/* %not-for-header */ #ifndef YY_NO_UNPUT - static void yyunput ( int c, char *buf_ptr ); - #endif +/* %ok-for-header */ + +/* %endif */ #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); @@ -933,14 +1301,32 @@ static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT +/* %if-c-only Standard (non-C++) definition */ +/* %not-for-header */ #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif +/* %ok-for-header */ +/* %endif */ #endif +/* %if-c-only */ + + static int yy_start_stack_ptr = 0; + static int yy_start_stack_depth = 0; + static int *yy_start_stack = NULL; + + static void yy_push_state ( int _new_state ); + + static void yy_pop_state ( void ); + + static int yy_top_state ( void ); + +/* %endif */ + /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ @@ -953,10 +1339,14 @@ static int input ( void ); /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO +/* %if-c-only Standard (non-C++) definition */ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +/* %endif */ +/* %if-c++-only C++ definition */ +/* %endif */ #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -964,6 +1354,7 @@ static int input ( void ); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ +/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ @@ -992,6 +1383,8 @@ static int input ( void ); } \ }\ \ +/* %if-c++-only C++ definition \ */\ +/* %endif */ #endif @@ -1010,20 +1403,39 @@ static int input ( void ); /* Report a fatal error. */ #ifndef YY_FATAL_ERROR +/* %if-c-only */ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ #endif +/* %if-tables-serialization structures and prototypes */ +/* %not-for-header */ +/* %ok-for-header */ + +/* %not-for-header */ +/* %tables-yydmap generated elements */ +/* %endif */ /* end tables serialization structures and prototypes */ +/* %ok-for-header */ + /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 +/* %if-c-only Standard (non-C++) definition */ -extern int yylex (void); +extern int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param ); -#define YY_DECL int yylex (void) +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param ) +/* %endif */ +/* %if-c++-only C++ definition */ +/* %endif */ #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -1038,12 +1450,14 @@ extern int yylex (void); #define YY_BREAK /*LINTED*/break; #endif +/* %% [6.0] YY_RULE_SETUP definition goes here */ #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION +/* %not-for-header */ /** The main scanner function which does all the work. */ YY_DECL @@ -1052,6 +1466,14 @@ YY_DECL char *yy_cp, *yy_bp; int yy_act; + YYSTYPE * yylval; + + YYLTYPE * yylloc; + + yylval = yylval_param; + + yylloc = yylloc_param; + if ( !(yy_init) ) { (yy_init) = 1; @@ -1064,10 +1486,18 @@ YY_DECL (yy_start) = 1; /* first start state */ if ( ! yyin ) +/* %if-c-only */ yyin = stdin; +/* %endif */ +/* %if-c++-only */ +/* %endif */ if ( ! yyout ) +/* %if-c-only */ yyout = stdout; +/* %endif */ +/* %if-c++-only */ +/* %endif */ if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); @@ -1079,13 +1509,23 @@ YY_DECL } { -#line 96 "src/Slice/Scanner.l" +/* %% [7.0] user's declarations go here */ +#line 138 "src/Slice/Scanner.l" -#line 1084 "src/Slice/Scanner.cpp" + /* ========== Literals ========== */ + /* Matches the start of a double-quoted string literal. */ +#line 1519 "src/Slice/Scanner.cpp" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { +/* %% [8.0] yymore()-related code goes here */ + (yy_more_len) = 0; + if ( (yy_more_flag) ) + { + (yy_more_len) = (int) ((yy_c_buf_p) - (yytext_ptr)); + (yy_more_flag) = 0; + } yy_cp = (yy_c_buf_p); /* Support of yytext. */ @@ -1096,6 +1536,7 @@ YY_DECL */ yy_bp = yy_cp; +/* %% [9.0] code to set up and find next match goes here */ yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); yy_match: @@ -1110,25 +1551,46 @@ YY_DECL while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 76 ) + if ( yy_current_state >= 192 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_current_state != 75 ); + while ( yy_current_state != 191 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_find_action: +/* %% [10.0] code to find the action number goes here */ yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; +/* %% [11.0] code for yylineno update goes here */ + do_action: /* This label is used only to access EOF actions. */ +/* %% [12.0] debug code goes here */ + if ( yy_flex_debug ) + { + if ( yy_act == 0 ) + fprintf( stderr, "--scanner backing up\n" ); + else if ( yy_act < 49 ) + fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", + (long)yy_rule_linenum[yy_act], yytext ); + else if ( yy_act == 49 ) + fprintf( stderr, "--accepting default rule (\"%s\")\n", + yytext ); + else if ( yy_act == 50 ) + fprintf( stderr, "--(end of buffer or a NUL)\n" ); + else + fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); + } + switch ( yy_act ) { /* beginning of action switch */ +/* %% [13.0] actions go here */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); @@ -1137,439 +1599,226 @@ YY_DECL goto yy_find_action; case 1: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 98 "src/Slice/Scanner.l" +#line 142 "src/Slice/Scanner.l" { - if(unit->scanPosition(yytext)) - { - BEGIN(BOMSCAN); - } + yy_push_state(STRING_LITERAL); + startLocation(yylloc); + + StringTokPtr str = new StringTok; + str->literal = "\""; + *yylval = str; } YY_BREAK +/* Matches a single escaped backslash, or as many characters as it can, + * except backslashes, new-lines, double quotes, and non-printable ASCII characters. */ +/* Matches Escaped backslashes and any other valid string characters. Invalid characters are + * new-lines, non-printable ASCII characters, and double-quotes. */ case 2: -/* rule 2 can match eol */ -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -YY_LINENO_REWIND_TO(yy_cp - 1); -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ +#line 157 "src/Slice/Scanner.l" +case 3: YY_RULE_SETUP -#line 105 "src/Slice/Scanner.l" +#line 157 "src/Slice/Scanner.l" { - if(unit->scanPosition(yytext)) - { - BEGIN(BOMSCAN); - } + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += yytext; } YY_BREAK -case 3: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ +/* Matches an escaped double-quote, single-quote, or question mark. */ +case 4: +#line 165 "src/Slice/Scanner.l" +case 5: +#line 166 "src/Slice/Scanner.l" +case 6: YY_RULE_SETUP -#line 112 "src/Slice/Scanner.l" +#line 166 "src/Slice/Scanner.l" { - if(unit->scanPosition(yytext)) - { - BEGIN(BOMSCAN); - } + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += yytext[1]; } YY_BREAK -case 4: -/* rule 4 can match eol */ -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -YY_LINENO_REWIND_TO(yy_cp - 1); -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ +/* Matches an ANSI-C escape code pattern. */ +case 7: YY_RULE_SETUP -#line 119 "src/Slice/Scanner.l" +#line 173 "src/Slice/Scanner.l" { - if(unit->scanPosition(yytext)) + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + char ansiCode; + switch(yytext[1]) { - BEGIN(BOMSCAN); + case 'a': ansiCode = '\a'; break; + case 'b': ansiCode = '\b'; break; + case 'f': ansiCode = '\f'; break; + case 'n': ansiCode = '\n'; break; + case 'r': ansiCode = '\r'; break; + case 't': ansiCode = '\t'; break; + case 'v': ansiCode = '\v'; break; + default: ansiCode = '\0'; assert(false); } + str->literal += yytext; + str->v += ansiCode; } YY_BREAK -case 5: +/* Matches an escaped octal value. Octal literals are limited to a max of 3 digits. */ +case 8: YY_RULE_SETUP -#line 126 "src/Slice/Scanner.l" +#line 192 "src/Slice/Scanner.l" { - // C++-style comment - BEGIN(MAINSCAN); - int c; - do + IceUtil::Int64 value = strtoull((yytext + 1), 0, 8); + if(value > 255) { - c = yyinput(); - if(c == '\n') - { - unit->nextLine(); - } + unit->error("octal escape sequence out of range: `\\" + string(yytext + 1) + "'"); } - while(c != '\n' && c != EOF); + + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += static_cast(value); } YY_BREAK -case 6: +/* Matches an escaped hexadecimal value. Hexadecimal literals are limited to a max of 2 digits. */ +case 9: YY_RULE_SETUP -#line 141 "src/Slice/Scanner.l" +#line 205 "src/Slice/Scanner.l" { - // C-style comment - BEGIN(MAINSCAN); - string comment = yytext + 2; - while(true) - { - int c = yyinput(); - if(c == '\n') - { - comment += static_cast(c); - unit->nextLine(); - } - else if(c == '*') - { - int next = yyinput(); - if(next == '/') - { - break; - } - else - { - comment += static_cast(c); - unput(next); - } - } - else if(c == EOF) - { - unit->warning(All, "EOF in comment"); - break; - } - else - { - comment += static_cast(c); - } - } - if(!comment.empty() && comment[0] == '*') - { - unit->setComment(comment); - } + IceUtil::Int64 value = strtoull((yytext + 2), 0, 16); + assert(value <= 255); + + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += static_cast(value); } YY_BREAK -case 7: +/* Matches an empty hexadecimal escape value. */ +case 10: YY_RULE_SETUP -#line 182 "src/Slice/Scanner.l" +#line 215 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); - return ICE_METADATA_OPEN; + unit->error("no hex digit in hex escape sequence"); + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; } YY_BREAK -case 8: +/* Matches a 4-char or 8-char size universal character code. */ +case 11: +#line 223 "src/Slice/Scanner.l" +case 12: YY_RULE_SETUP -#line 187 "src/Slice/Scanner.l" +#line 223 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); - return ICE_METADATA_CLOSE; + IceUtil::Int64 codePoint = strtoull((yytext + 2), 0, 16); + if(codePoint <= 0xdfff && codePoint >= 0xd800) + { + unit->error("a universal character name cannot designate a surrogate: `" + string(yytext) + "'"); + } + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += yytext; } YY_BREAK -case 9: +/* Matches a universal character code that isn't the correct size, or uses incorrect characters. */ +case 13: +#line 236 "src/Slice/Scanner.l" +case 14: YY_RULE_SETUP -#line 192 "src/Slice/Scanner.l" +#line 236 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); - return ICE_GLOBAL_METADATA_OPEN; + unit->error("unknown escape sequence in string literal: `" + string(yytext) + "'"); + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += yytext; } YY_BREAK -case 10: +/* Matches an unescaped newline in a string literal, and issues an error. */ +case 15: +/* rule 15 can match eol */ YY_RULE_SETUP -#line 197 "src/Slice/Scanner.l" +#line 244 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); - return ICE_GLOBAL_METADATA_CLOSE; + yy_pop_state(); + endLocation(yylloc); + nextLine(); + + unit->error("encountered un-escaped EOL while scanning a string literal."); + return ICE_STRING_LITERAL; } YY_BREAK -case 11: -/* rule 11 can match eol */ +/* Matches an unknown escape value. This rule has a lower priority than all the other escape rules because + * it only matches 2 characters (the lowest any match), and it's beneath the others. */ +case 16: YY_RULE_SETUP -#line 202 "src/Slice/Scanner.l" +#line 255 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); - StringTokPtr ident = new StringTok; - ident->v = *yytext == '\\' ? yytext + 1 : yytext; - ident->v.erase(ident->v.find_first_of(" \t\v\n\r\f(")); - *yylvalp = ident; - if(*yytext == '\\') - { - if(checkIdentifier(ident->v) == ICE_SCOPED_IDENTIFIER) - { - unit->error("Operation identifiers cannot be scoped: `" + (ident->v) + "'"); - } - return ICE_IDENT_OP; - } - int st = checkKeyword(ident->v); - if(st == ICE_IDENTIFIER) - { - return ICE_IDENT_OP; - } - else if(st == ICE_SCOPED_IDENTIFIER) - { - unit->error("Operation identifiers cannot be scoped: `" + (ident->v) + "'"); - return ICE_IDENT_OP; - } - else if(st == ICE_OPTIONAL) - { - return ICE_OPTIONAL_OP; - } - else - { - return ICE_KEYWORD_OP; - } + unit->warning(All, "unknown escape sequence in string literal: `" + string(yytext) + "'"); + + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + // Escape the entire sequence. + str->literal += yytext; + str->v += "\\" + string(yytext); } YY_BREAK -case 12: +/* Matches a dangling backslash, with nothing to escape. This rule is mostly included for grammar completeness. */ +case 17: YY_RULE_SETUP -#line 236 "src/Slice/Scanner.l" +#line 265 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); - StringTokPtr ident = new StringTok; - ident->v = *yytext == '\\' ? yytext + 1 : yytext; - *yylvalp = ident; - return *yytext == '\\' ? checkIdentifier(ident->v) : checkKeyword(ident->v); + unit->warning(All, "dangling backslash in string literal"); + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; } YY_BREAK -case 13: +/* Matches the end of a double-quoted string literal, but only while scanning a string literal. Flex always prefers + * to match the longest string it can, so quotes preceeded with a literal '\' will match the rules above this one. */ +case 18: YY_RULE_SETUP -#line 244 "src/Slice/Scanner.l" +#line 273 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); - StringTokPtr str = new StringTok; - str->literal = "\""; - while(true) - { - int c = yyinput(); - str->literal += static_cast(c); - if(c == '"') - { - break; - } - else if(c == EOF) - { - unit->error("EOF in string"); - break; - } - else if(c < 32 || c == 127) - { - unit->error("a string literal can only contain printable ASCII characters and non-ASCII characters"); - break; - } - else if(c == '\\') - { - int next = yyinput(); - str->literal += static_cast(next); - switch(next) - { - case '\\': - { - // - // add extra escape to our internal string - // - str->v += '\\'; - str->v += '\\'; - break; - } - case '"': - case '\'': - case '?': - { - str->v += static_cast(next); - break; - } - case 'a': - { - str->v += '\a'; - break; - } - case 'b': - { - str->v += '\b'; - break; - } - case 'f': - { - str->v += '\f'; - break; - } - case 'n': - { - str->v += '\n'; - break; - } - case 'r': - { - str->v += '\r'; - break; - } - case 't': - { - str->v += '\t'; - break; - } - case 'v': - { - str->v += '\v'; - break; - } - - // - // Octal value \nnn limited to three octal digits but terminate at the first character - // that is not a valid octal digit if encountered sooner. - // - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - { - static string octalDigits = "01234567"; - string escape; - escape += static_cast(next); - for(int i = 0; i < 2; ++i) - { - next = yyinput(); - if(octalDigits.find_first_of(static_cast(next)) == string::npos) - { - unput(next); - break; - } - escape += static_cast(next); - } - str->literal += escape; - IceUtil::Int64 value = IceUtilInternal::strToInt64(escape.c_str(), 0, 8); - if(value > 255) - { - unit->error(string("octal escape sequence out of range: `\\") + escape + "'"); - } - str->v += static_cast(value); - break; - } - - case 'x': - { - string escape = ""; - next = yyinput(); - - // - // Unlike C++, we limit hex escape sequences to 2 hex digits - // - while(isxdigit(static_cast(next)) && escape.length() < 2) - { - escape += static_cast(next); - next = yyinput(); - } - unput(next); - - if(escape.length() == 0) - { - unit->error("no hex digit in hex escape sequence"); - } - - str->literal += escape; - IceUtil::Int64 value = IceUtilInternal::strToInt64(escape.c_str(), 0, 16); - - assert(value >= 0 && value <= 255); - str->v += static_cast(value); - break; - } - - // - // Universal character name - // - case 'u': - case 'U': - { - string escape = ""; - c = next; - int size = (c == 'u') ? 4 : 8; - while(size > 0) - { - next = yyinput(); - if(!isxdigit(next)) - { - unit->error(string("unknown escape sequence in string literal: `\\") + - static_cast(c) + escape + static_cast(next) + "'"); - unput(next); - break; - } - escape += static_cast(next); - --size; - } - - if(size == 0) - { - // All digits read, check value - IceUtil::Int64 codePoint = IceUtilInternal::strToInt64(escape.c_str(), 0, 16); - if(codePoint >= 0xd800 && codePoint <= 0xdfff) - { - unit->error(string("a universal character name cannot designate a surrogate: `\\") + - static_cast(c) + escape + "'"); - } - } - - str->literal += escape; - str->v += string("\\") + static_cast(c) + escape; - break; - } - - default: - { - ostringstream os; - os << "unknown escape sequence `\\" << static_cast(next) << "'"; - unit->warning(All, os.str()); - - // Escape the \ in this unknown escape sequence - str->v += '\\'; - str->v += '\\'; - unput(next); - } - } - } - else - { - str->v += static_cast(c); - } - } - *yylvalp = str; + yy_pop_state(); + endLocation(yylloc); + + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; return ICE_STRING_LITERAL; } YY_BREAK -case 14: +/* Matches EOF, but only while scanning a string literal. */ +case YY_STATE_EOF(STRING_LITERAL): +#line 283 "src/Slice/Scanner.l" +{ + yy_pop_state(); + endLocation(yylloc); + + unit->error("encountered EOF while scanning a string literal"); + return ICE_STRING_LITERAL; +} + YY_BREAK +case 19: YY_RULE_SETUP -#line 449 "src/Slice/Scanner.l" +#line 291 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); + setLocation(yylloc); + IntegerTokPtr itp = new IntegerTok; itp->literal = string(yytext); - *yylvalp = itp; + *yylval = itp; if(!IceUtilInternal::stringToInt64(string(yytext), itp->v)) { assert(itp->v != 0); - string msg = "integer constant `"; - msg += yytext; - msg += "' out of range"; - unit->error(msg); + unit->error("integer constant `" + string(yytext) + "' out of range"); } return ICE_INTEGER_LITERAL; } YY_BREAK -case 15: +case 20: YY_RULE_SETUP -#line 465 "src/Slice/Scanner.l" +#line 305 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); + setLocation(yylloc); + errno = 0; FloatingTokPtr ftp = new FloatingTok; - *yylvalp = ftp; + *yylval = ftp; string literal(yytext); ftp->literal = literal; char lastChar = literal[literal.size() - 1]; @@ -1580,75 +1829,332 @@ YY_RULE_SETUP ftp->v = strtod(literal.c_str(), 0); if((ftp->v == HUGE_VAL || ftp->v == -HUGE_VAL) && errno == ERANGE) { - string msg = "floating-point constant `"; - msg += yytext; - msg += "' too large (overflow)"; - unit->error(msg); + unit->error("floating-point constant `" + string(yytext) + "' too large (overflow)"); } else if(ftp->v == 0 && errno == ERANGE) { - string msg = "floating-point constant `"; - msg += yytext; - msg += "' too small (underflow)"; - unit->error(msg); + unit->error("floating-point constant `" + string(yytext) + "' too small (underflow)"); } return ICE_FLOATING_POINT_LITERAL; } YY_BREAK -case 16: -/* rule 16 can match eol */ +/* ========== Comments ========== */ +/* Matches and records a triple-slash style doc comment. */ +case 21: YY_RULE_SETUP -#line 495 "src/Slice/Scanner.l" +#line 333 "src/Slice/Scanner.l" { - // Ignore white-space - - if(unit->currentLine() != 0) - { - BEGIN(MAINSCAN); - } - if(yytext[0] == '\n') - { - unit->nextLine(); - } + unit->addToComment(yytext + 3); } YY_BREAK -case 17: +/* Matches and consumes a C++ style comment. */ +case 22: +YY_RULE_SETUP +#line 338 "src/Slice/Scanner.l" +{} + YY_BREAK +/* Matches the start of a C style comment, and switches the scanner to the C_COMMENT state. */ +case 23: YY_RULE_SETUP -#line 508 "src/Slice/Scanner.l" +#line 341 "src/Slice/Scanner.l" { - // Ignore UTF-8 BOM, rule only active when parsing start of file. - - BEGIN(MAINSCAN); + yy_push_state(C_COMMENT); } YY_BREAK -case 18: +/* Matches any character except for newlines and adds them to the comments. '*' are matched one at a time to ensure + * Flex scans '* /' correctly. Flex prioritizes longer matches over shorter ones, so '* /' will match before '*'. */ +case 24: +#line 348 "src/Slice/Scanner.l" +case 25: YY_RULE_SETUP -#line 514 "src/Slice/Scanner.l" +#line 348 "src/Slice/Scanner.l" { - BEGIN(MAINSCAN); - if(yytext[0] < 32 || yytext[0] > 126) - { - stringstream s; - s << "illegal input character: '\\"; - s.width(3); - s.fill('0'); - s << oct << static_cast(static_cast(yytext[0])); - s << "'"; - unit->error(s.str()); - return BAD_CHAR; + yymore(); +} + YY_BREAK +/* Matches as many newlines as are available and adds them to the comment, after incrementing the line count. */ +case 26: +/* rule 26 can match eol */ +YY_RULE_SETUP +#line 353 "src/Slice/Scanner.l" +{ + nextLine(yyleng); + yymore(); +} + YY_BREAK +/* Matches the end of a C style comment, and reverts the scanner state to what it previously was. */ +case 27: +YY_RULE_SETUP +#line 359 "src/Slice/Scanner.l" +{ + yy_pop_state(); + + string comment(yytext); + // The last 2 characters are the '*/' matched by this rule. + unit->setComment(comment.substr(0, yyleng - 2)); +} + YY_BREAK +/* Handles reaching EOF while scanning a C style comment by issuing a warning but continuing normally. */ +case YY_STATE_EOF(C_COMMENT): +#line 368 "src/Slice/Scanner.l" +{ + yy_pop_state(); + + unit->error("encountered EOF while scanning a comment"); + unit->setComment(yytext); +} + YY_BREAK +/* ========== Preprocessor Statements ========== */ +/* Matches the empty preprocessor directive. */ +case 28: +YY_RULE_SETUP +#line 378 "src/Slice/Scanner.l" +{ + yy_push_state(PREPROCESS); +} + YY_BREAK +/* Matches a line preprocessor directive, but missing a line number. */ +case 29: +YY_RULE_SETUP +#line 383 "src/Slice/Scanner.l" +{ + yy_push_state(PREPROCESS); + unit->error("missing line number in line preprocessor directive"); +} + YY_BREAK +/* Matches a line preprocessor directive (optionally with a file specified afterwards). */ +case 30: +#line 390 "src/Slice/Scanner.l" +case 31: +YY_RULE_SETUP +#line 390 "src/Slice/Scanner.l" +{ + int includeAction = scanPosition(yytext); + if(yylineno == 0 || includeAction == 1) // Push: Indicated the scanner has started scanning a new file. + { + yy_push_state(INITIAL); + } + else if(includeAction == 2) // Pop: Indicates the scanner has completed scanning a file. + { + yy_pop_state(); } + yy_push_state(PREPROCESS); +} + YY_BREAK +/* Matches any non white-space character. This is a catch-all to report any invalid characters + * found while scanning a preprocessor directive. */ +case 32: +YY_RULE_SETUP +#line 405 "src/Slice/Scanner.l" +{ + unit->error("encountered unexpected token while scanning preprocessor directive: `" + string(yytext) + "'"); +} + YY_BREAK +/* Matches a new-line character or EOF. This signals the end of the preprocessor statement. */ +case 33: +/* rule 33 can match eol */ +#line 411 "src/Slice/Scanner.l" +YY_RULE_SETUP +case YY_STATE_EOF(PREPROCESS): +#line 411 "src/Slice/Scanner.l" +{ + yy_pop_state(); + nextLine(); +} + YY_BREAK +/* ========== Metadata ========== */ +case 34: +YY_RULE_SETUP +#line 418 "src/Slice/Scanner.l" +{ + yy_push_state(METADATA); + return ICE_METADATA_OPEN; +} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 423 "src/Slice/Scanner.l" +{ + yy_push_state(METADATA); + + // We use a different token to indicate metadata that should be ignored (if it came after a slice definition). + if(yy_top_state() == PRE_SLICE) + { + return ICE_GLOBAL_METADATA_OPEN; + } + else + { + return ICE_GLOBAL_METADATA_IGNORE; + } +} + YY_BREAK +/* Matches the start of a metadata string, then switches the scanner into STRING_LITERAL mode. */ +case 36: +YY_RULE_SETUP +#line 438 "src/Slice/Scanner.l" +{ + yy_push_state(STRING_LITERAL); + startLocation(yylloc); + + StringTokPtr str = new StringTok; + str->literal = "\""; + *yylval = str; +} + YY_BREAK +/* Matches commas between string literals in quoted metadata and forwards them to the parser. */ +case 37: +YY_RULE_SETUP +#line 448 "src/Slice/Scanner.l" +{ return yytext[0]; } YY_BREAK -case 19: +/* Matches and consumes newlines in between metadata after incrementing the line count. */ +case 38: +/* rule 38 can match eol */ +YY_RULE_SETUP +#line 453 "src/Slice/Scanner.l" +{ + nextLine(yyleng); +} + YY_BREAK +case 39: YY_RULE_SETUP -#line 530 "src/Slice/Scanner.l" -ECHO; +#line 457 "src/Slice/Scanner.l" +{ + yy_pop_state(); + return ICE_METADATA_CLOSE; +} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 462 "src/Slice/Scanner.l" +{ + yy_pop_state(); + return ICE_GLOBAL_METADATA_CLOSE; +} YY_BREAK -#line 1647 "src/Slice/Scanner.cpp" +/* Matches any characters not matched by another metadata rule (except whitespace), and reports an error. */ +case 41: +YY_RULE_SETUP +#line 468 "src/Slice/Scanner.l" +{ + unit->error("invalid character between metadata"); +} + YY_BREAK +/* ========== Identifiers and Keywords ========== */ +case 42: +/* rule 42 can match eol */ +YY_RULE_SETUP +#line 474 "src/Slice/Scanner.l" +{ + StringTokPtr ident = new StringTok; + ident->v = *yytext == '\\' ? yytext + 1 : yytext; + ident->v.erase(ident->v.find_first_of(" \t\v\n\r\f(")); + *yylval = ident; + if(*yytext == '\\') + { + if(checkIdentifier(ident->v) == ICE_SCOPED_IDENTIFIER) + { + unit->error("Operation identifiers cannot be scoped: `" + (ident->v) + "'"); + } + return ICE_IDENT_OPEN; + } + int st = checkKeyword(ident->v); + if(st == ICE_IDENTIFIER) + { + return ICE_IDENT_OPEN; + } + else if(st == ICE_SCOPED_IDENTIFIER) + { + unit->error("Operation identifiers cannot be scoped: `" + (ident->v) + "'"); + return ICE_IDENT_OPEN; + } + else if(st == ICE_TAG) + { + return ICE_TAG_OPEN; + } + else if(st == ICE_OPTIONAL) + { + return ICE_OPTIONAL_OPEN; + } + else + { + return ICE_KEYWORD_OPEN; + } +} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 511 "src/Slice/Scanner.l" +{ + StringTokPtr ident = new StringTok; + ident->v = *yytext == '\\' ? yytext + 1 : yytext; + *yylval = ident; + return *yytext == '\\' ? checkIdentifier(ident->v) : checkKeyword(ident->v); +} + YY_BREAK +/* ========== Whitespace ========== */ +/* Matches and consumes any whitespace, except for newlines. */ +case 44: +YY_RULE_SETUP +#line 521 "src/Slice/Scanner.l" +{} + YY_BREAK +/* Matches and consumes newlines, but only when the scanner isn't in a sub-scanner. */ +case 45: +/* rule 45 can match eol */ +YY_RULE_SETUP +#line 524 "src/Slice/Scanner.l" +{ + nextLine(yyleng); +} + YY_BREAK +/* ========== Others ========== */ +/* Matches and consumes a BOM, but only when the scanner has just started scanning a new file. */ +case 46: +YY_RULE_SETUP +#line 531 "src/Slice/Scanner.l" +{} + YY_BREAK +/* Matches invalid characters, one at a time to make this the 2nd lowest priority rule. All printable ASCII + * characters are valid (those between 32 and 127 inclusively), anything outside this range is invalid. */ +case 47: +/* rule 47 can match eol */ +YY_RULE_SETUP +#line 535 "src/Slice/Scanner.l" +{ + stringstream s; + s << "illegal input character: '\\"; + s.width(3); + s.fill('0'); + s << oct << static_cast(static_cast(yytext[0])); + s << "'"; + + unit->error(s.str()); + return BAD_CHAR; +} + YY_BREAK +/* Matches any valid character (except newlines) not matched by another rule and fowards it to the parser. + * This is the lowest priority rule in the scanner, and is only active while not in a sub-scanner. */ +case 48: +YY_RULE_SETUP +#line 549 "src/Slice/Scanner.l" +{ + setLocation(yylloc); + return yytext[0]; +} + YY_BREAK +case 49: +YY_RULE_SETUP +#line 554 "src/Slice/Scanner.l" +YY_FATAL_ERROR( "flex scanner jammed" ); + YY_BREAK +#line 2154 "src/Slice/Scanner.cpp" case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(BOMSCAN): -case YY_STATE_EOF(MAINSCAN): +case YY_STATE_EOF(PRE_SLICE): +case YY_STATE_EOF(SLICE): +case YY_STATE_EOF(METADATA): yyterminate(); case YY_END_OF_BUFFER: @@ -1672,7 +2178,11 @@ case YY_STATE_EOF(MAINSCAN): * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; +/* %if-c-only */ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; +/* %endif */ +/* %if-c++-only */ +/* %endif */ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -1714,6 +2224,7 @@ case YY_STATE_EOF(MAINSCAN): else { +/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; @@ -1781,6 +2292,13 @@ case YY_STATE_EOF(MAINSCAN): } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ +/* %ok-for-header */ + +/* %if-c++-only */ +/* %not-for-header */ +/* %ok-for-header */ + +/* %endif */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1789,7 +2307,11 @@ case YY_STATE_EOF(MAINSCAN): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ +/* %if-c-only */ static int yy_get_next_buffer (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); @@ -1927,16 +2449,23 @@ static int yy_get_next_buffer (void) /* yy_get_previous_state - get the state just before the EOB char was reached */ +/* %if-c-only */ +/* %not-for-header */ static yy_state_type yy_get_previous_state (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { yy_state_type yy_current_state; char *yy_cp; +/* %% [15.0] code to get the start state into yy_current_state goes here */ yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { +/* %% [16.0] code to find the next state goes here */ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { @@ -1946,7 +2475,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 76 ) + if ( yy_current_state >= 192 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -1960,10 +2489,15 @@ static int yy_get_next_buffer (void) * synopsis * next_state = yy_try_NUL_trans( current_state ); */ +/* %if-c-only */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { int yy_is_jam; - char *yy_cp = (yy_c_buf_p); + /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ + char *yy_cp = (yy_c_buf_p); YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) @@ -1974,56 +2508,22 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 76 ) + if ( yy_current_state >= 192 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 75); + yy_is_jam = (yy_current_state == 191); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT +/* %if-c-only */ - static void yyunput (int c, char * yy_bp ) -{ - char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - int number_to_move = (yy_n_chars) + 2; - char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - +/* %endif */ #endif +/* %if-c-only */ #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -2031,6 +2531,9 @@ static int yy_get_next_buffer (void) static int input (void) #endif +/* %endif */ +/* %if-c++-only */ +/* %endif */ { int c; @@ -2094,18 +2597,25 @@ static int yy_get_next_buffer (void) *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); +/* %% [19.0] update BOL and yylineno */ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; } +/* %if-c-only */ #endif /* ifndef YY_NO_INPUT */ +/* %endif */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ +/* %if-c-only */ void yyrestart (FILE * input_file ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { if ( ! YY_CURRENT_BUFFER ){ @@ -2118,11 +2628,18 @@ static int yy_get_next_buffer (void) yy_load_buffer_state( ); } +/* %if-c++-only */ +/* %endif */ + /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ +/* %if-c-only */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { /* TODO. We should be able to replace this entire function body @@ -2153,11 +2670,19 @@ static int yy_get_next_buffer (void) (yy_did_buffer_switch_on_eof) = 1; } +/* %if-c-only */ static void yy_load_buffer_state (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; +/* %if-c-only */ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; +/* %endif */ +/* %if-c++-only */ +/* %endif */ (yy_hold_char) = *(yy_c_buf_p); } @@ -2167,7 +2692,11 @@ static void yy_load_buffer_state (void) * * @return the allocated buffer state. */ +/* %if-c-only */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { YY_BUFFER_STATE b; @@ -2191,11 +2720,18 @@ static void yy_load_buffer_state (void) return b; } +/* %if-c++-only */ +/* %endif */ + /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ +/* %if-c-only */ void yy_delete_buffer (YY_BUFFER_STATE b ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { if ( ! b ) @@ -2214,14 +2750,22 @@ static void yy_load_buffer_state (void) * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ +/* %if-c-only */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { int oerrno = errno; yy_flush_buffer( b ); +/* %if-c-only */ b->yy_input_file = file; +/* %endif */ +/* %if-c++-only */ +/* %endif */ b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ @@ -2233,8 +2777,13 @@ static void yy_load_buffer_state (void) b->yy_bs_column = 0; } +/* %if-c-only */ + b->yy_is_interactive = 0; +/* %endif */ +/* %if-c++-only */ +/* %endif */ errno = oerrno; } @@ -2242,7 +2791,11 @@ static void yy_load_buffer_state (void) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ +/* %if-c-only */ void yy_flush_buffer (YY_BUFFER_STATE b ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { if ( ! b ) return; @@ -2265,13 +2818,18 @@ static void yy_load_buffer_state (void) yy_load_buffer_state( ); } +/* %if-c-or-c++ */ /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ +/* %if-c-only */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { if (new_buffer == NULL) return; @@ -2296,12 +2854,18 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } +/* %endif */ +/* %if-c-or-c++ */ /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ +/* %if-c-only */ void yypop_buffer_state (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { if (!YY_CURRENT_BUFFER) return; @@ -2316,11 +2880,17 @@ void yypop_buffer_state (void) (yy_did_buffer_switch_on_eof) = 1; } } +/* %endif */ +/* %if-c-or-c++ */ /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ +/* %if-c-only */ static void yyensure_buffer_stack (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { yy_size_t num_to_alloc; @@ -2362,102 +2932,71 @@ static void yyensure_buffer_stack (void) (yy_buffer_stack_max) = num_to_alloc; } } +/* %endif */ -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +/* %if-c-only */ + static void yy_push_state (int _new_state ) +/* %endif */ +/* %if-c++-only */ +/* %endif */ { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; + if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) + { + yy_size_t new_size; - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; + (yy_start_stack_depth) += YY_START_STACK_INCR; + new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); - yy_switch_to_buffer( b ); + if ( ! (yy_start_stack) ) + (yy_start_stack) = (int *) yyalloc( new_size ); - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) -{ - - return yy_scan_bytes( yystr, (int) strlen(yystr) ); -} + else + (yy_start_stack) = (int *) yyrealloc( + (void *) (yy_start_stack), new_size ); -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + if ( ! (yy_start_stack) ) + YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); + } - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; + (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + BEGIN(_new_state); +} - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); +/* %if-c-only */ + static void yy_pop_state (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + if ( --(yy_start_stack_ptr) < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; + BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); +} - return b; +/* %if-c-only */ + static int yy_top_state (void) +/* %endif */ +/* %if-c++-only */ +/* %endif */ +{ + return (yy_start_stack)[(yy_start_stack_ptr) - 1]; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif +/* %if-c-only */ static void yynoreturn yy_fatal_error (const char* msg ) { fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } +/* %endif */ +/* %if-c++-only */ +/* %endif */ /* Redefine yyless() so it works in section 3 code. */ @@ -2478,84 +3017,25 @@ static void yynoreturn yy_fatal_error (const char* msg ) /* Accessor methods (get/set functions) to struct members. */ -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} +/* %if-c-only */ +/* %if-reentrant */ +/* %endif */ /** Get the current token. * */ -char *yyget_text (void) -{ - return yytext; -} +/* %if-reentrant */ +/* %endif */ -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; -} +/* %endif */ -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; -} - -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; -} +/* %if-reentrant */ +/* %if-bison-bridge */ +/* %endif */ +/* %endif if-c-only */ +/* %if-c-only */ static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. @@ -2569,6 +3049,10 @@ static int yy_init_globals (void) (yy_init) = 0; (yy_start) = 0; + (yy_start_stack_ptr) = 0; + (yy_start_stack_depth) = 0; + (yy_start_stack) = NULL; + /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; @@ -2583,7 +3067,9 @@ static int yy_init_globals (void) */ return 0; } +/* %endif */ +/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { @@ -2599,12 +3085,19 @@ int yylex_destroy (void) yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; + /* Destroy the start condition stack. */ + yyfree( (yy_start_stack) ); + (yy_start_stack) = NULL; + /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); +/* %if-reentrant */ +/* %endif */ return 0; } +/* %endif */ /* * Internal utility routines. @@ -2654,71 +3147,32 @@ void yyfree (void * ptr ) free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } +/* %if-tables-serialization definitions */ +/* %define-yytables The name for this specific scanner's tables. */ #define YYTABLES_NAME "yytables" +/* %endif */ -#line 530 "src/Slice/Scanner.l" +/* %ok-for-header */ +#line 554 "src/Slice/Scanner.l" -namespace Slice { -// -// initScanner() fills the keyword map with all keyword-token pairs. -// - -void -initScanner() +namespace Slice { - keywordMap["module"] = ICE_MODULE; - keywordMap["class"] = ICE_CLASS; - keywordMap["interface"] = ICE_INTERFACE; - keywordMap["exception"] = ICE_EXCEPTION; - keywordMap["struct"] = ICE_STRUCT; - keywordMap["sequence"] = ICE_SEQUENCE; - keywordMap["dictionary"] = ICE_DICTIONARY; - keywordMap["enum"] = ICE_ENUM; - keywordMap["out"] = ICE_OUT; - keywordMap["extends"] = ICE_EXTENDS; - keywordMap["implements"] = ICE_IMPLEMENTS; - keywordMap["throws"] = ICE_THROWS; - keywordMap["void"] = ICE_VOID; - keywordMap["byte"] = ICE_BYTE; - keywordMap["bool"] = ICE_BOOL; - keywordMap["short"] = ICE_SHORT; - keywordMap["int"] = ICE_INT; - keywordMap["long"] = ICE_LONG; - keywordMap["float"] = ICE_FLOAT; - keywordMap["double"] = ICE_DOUBLE; - keywordMap["string"] = ICE_STRING; - keywordMap["Object"] = ICE_OBJECT; - keywordMap["LocalObject"] = ICE_LOCAL_OBJECT; - keywordMap["local"] = ICE_LOCAL; - keywordMap["const"] = ICE_CONST; - keywordMap["false"] = ICE_FALSE; - keywordMap["true"] = ICE_TRUE; - keywordMap["idempotent"] = ICE_IDEMPOTENT; - keywordMap["optional"] = ICE_OPTIONAL; - keywordMap["Value"] = ICE_VALUE; -} -// // Check if an identifier looks like a keyword. // If the identifier is a keyword, return the // corresponding keyword token; otherwise, return // an identifier token. -// - -int -checkKeyword(string& id) +int checkKeyword(string& id) { - StringTokenMap::const_iterator pos = keywordMap.find(id); + const StringTokenMap::const_iterator pos = keywordMap.find(id); if(pos != keywordMap.end()) { if(pos->first != id) { - string msg; - msg = "illegal identifier: `" + id + "' differs from keyword `"; - msg += pos->first + "' only in capitalization"; - unit->error(msg); + unit->error("illegal identifier: `" + id + "' differs from keyword `" + pos->first + + "' only in capitalization"); id = pos->first; } return pos->second; @@ -2726,14 +3180,11 @@ checkKeyword(string& id) return checkIdentifier(id); } -// // Checks an identifier for any illegal syntax and // determines whether it's scoped. If it is, this // returns a scoped identifier token; otherwise this // returns a normal identifier token. -// - -int checkIdentifier(string& id) +int checkIdentifier(const string& id) { // check whether the identifier is scoped size_t scopeIndex = id.rfind("::"); @@ -2805,3 +3256,129 @@ int checkIdentifier(string& id) } +namespace +{ + +void nextLine(int count) +{ + yylineno += count; + yycolno = 0; +} + +int scanPosition(const char* s) +{ + string line(s); + // Skip the leading '#', optional 'line', and any whitespace before the line number. + string::size_type idx = line.find_first_not_of(" \t\r", (line.find('#') + 1)); + if(line.find("line", idx) == idx) + { + idx = line.find_first_not_of(" \t\r", (idx + 4)); + } + line.erase(0, idx); + + // Read the line number + yylineno = stoi(line.c_str(), &idx) - 1; + + // Scan the remainder of the line for a filename. + idx = line.find_first_not_of(" \t\r", idx); + line.erase(0, idx); + + int lineTypeCode = 0; + if(!line.empty()) + { + if(line[0] == '"') + { + string::size_type edx = line.rfind('"'); + if(edx != string::npos) + { + line = line.substr(1, edx - 1); + } + else + { + unit->error("mismatched quotations in line directive"); + line = line.substr(1); + } + } + lineTypeCode = unit->setCurrentFile(line, yylineno); + yyfilename = string(line); + } + return lineTypeCode; +} + +void setLocation(TokenContext* location) +{ + startLocation(location); + endLocation(location); +} + +void startLocation(TokenContext* location) +{ + location->firstLine = yylineno; + // The string has already been scanned, so the scanner is positioned at the end of it. + location->firstColumn = yycolno - yyleng; + location->filename = yyfilename; +} + +void endLocation(TokenContext* location) +{ + location->lastLine = yylineno; + location->lastColumn = yycolno; +} + +// This function is always called once, right before scanning begins. +void initScanner() +{ + // Ensure the scanner starts at line number 1, column position 0. + yylineno = 1; + + keywordMap["module"] = ICE_MODULE; + keywordMap["class"] = ICE_CLASS; + keywordMap["interface"] = ICE_INTERFACE; + keywordMap["exception"] = ICE_EXCEPTION; + keywordMap["struct"] = ICE_STRUCT; + keywordMap["sequence"] = ICE_SEQUENCE; + keywordMap["dictionary"] = ICE_DICTIONARY; + keywordMap["enum"] = ICE_ENUM; + keywordMap["out"] = ICE_OUT; + keywordMap["extends"] = ICE_EXTENDS; + keywordMap["implements"] = ICE_IMPLEMENTS; + keywordMap["throws"] = ICE_THROWS; + keywordMap["void"] = ICE_VOID; + keywordMap["byte"] = ICE_BYTE; + keywordMap["bool"] = ICE_BOOL; + keywordMap["short"] = ICE_SHORT; + keywordMap["int"] = ICE_INT; + keywordMap["long"] = ICE_LONG; + keywordMap["float"] = ICE_FLOAT; + keywordMap["double"] = ICE_DOUBLE; + keywordMap["string"] = ICE_STRING; + keywordMap["Object"] = ICE_OBJECT; + keywordMap["const"] = ICE_CONST; + keywordMap["LocalObject"] = ICE_LOCAL_OBJECT; + keywordMap["local"] = ICE_LOCAL; + keywordMap["false"] = ICE_FALSE; + keywordMap["true"] = ICE_TRUE; + keywordMap["idempotent"] = ICE_IDEMPOTENT; + keywordMap["tag"] = ICE_TAG; + // 'optional' is kept as an alias for 'tag' for backwards compatability. + // We need a separate token type since we infer 'optional T' to mean 'tag T?'. + // But for 'tag' we require an optional (nullable) type. No inferencing is done. + keywordMap["optional"] = ICE_OPTIONAL; + keywordMap["Value"] = ICE_VALUE; +} + +// This function is always called directly after a match has been made, but directly before it's action block is run. +void preAction() +{ + yycolno += yyleng; + + // We only use the 'INITIAL' state to consume BOMs, which can only validly be the first match in a file. This + // function being called means a match has already been made, so we switch states since BOMs are no longer valid. + if(YY_START == INITIAL) + { + BEGIN(PRE_SLICE); + } +} + +} + diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 3ec429323c5..8b95f5839b8 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -1,10 +1,15 @@ -%{ - +%top{ // // Copyright (c) ZeroC, Inc. All rights reserved. // -#include // Before Grammer.h, so that YYSTYPE is defined +#include + +} + +%{ + +#include #include #include @@ -13,34 +18,9 @@ #include #include -#if defined(_MSC_VER) -// '<' : signed/unsigned mismatch -# pragma warning(disable:4018) +#ifdef _MSC_VER // 'initializing' : conversion from '__int64' to 'int', possible loss of data # pragma warning(disable:4244) - -# if defined(ICE_64) -// -// '=' : conversion from 'size_t' to 'int', possible loss of data -// The result of fread() is a size_t and gets inserted into an int -// -# pragma warning(disable:4267) -# endif -#endif - -#if defined(__GNUC__) -# pragma GCC diagnostic ignored "-Wsign-compare" -#endif - -// -// Avoid clang conversion warnings -// -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wconversion" -# pragma clang diagnostic ignored "-Wsign-conversion" -#endif - -#ifdef _MSC_VER # ifdef slice_wrap # undef slice_wrap # define slice_wrap() 1 @@ -53,9 +33,6 @@ # undef slice_wrap # define slice_wrap() 1 # endif -# ifdef ICE_64 -# pragma error_messages(off,truncwarn) -# endif #endif using namespace std; @@ -64,531 +41,533 @@ using namespace Slice; namespace Slice { -// // Definitions for the case-insensitive keyword-token map. -// -typedef std::map StringTokenMap; -static StringTokenMap keywordMap; +typedef map StringTokenMap; +StringTokenMap keywordMap; -void initScanner(); int checkKeyword(string&); -int checkIdentifier(string&); +int checkIdentifier(const string&); + +} + +// Stores the scanner's current column position. Flex also automatically +// generates 'yylineno', which stores the scanner's current line number. +int yycolno = 0; +// Stores a copy of the filename that the scanner is currently scanning. +string yyfilename; + +namespace +{ + +void nextLine(int = 1); +int scanPosition(const char*); +void setLocation(TokenContext*); +void startLocation(TokenContext*); +void endLocation(TokenContext*); + +void initScanner(); +void preAction(); } +// Override some of the functions flex auto-generates with our own implementations. #define YY_USER_INIT initScanner(); +#define YY_USER_ACTION preAction(); %} -%option noyywrap -%option never-interactive + /* Changes the default prefix of 'yy' to 'slice_' for functions and variables in the generated code. */ %option prefix="slice_" + /* Instructs flex to not suppress any warnings when generating the scanner. */ +%option warn + /* Instructs flex to generate a scanner that supports verbose outputting (debug mode). */ +%option debug + /* By default flex will 'default match' any text it encounters that doesn't match any specified rules. This + * option disables default-matching (it throws 'scanner jammed' instead) to make grammar holes more obvious. */ +%option nodefault + /* Directs flex to generate a scanner tailored for use by bison, and that supports bison's token location mechanism. + * These options change the signature of the main lexing function, which must match the one declared in Grammar.y */ +%option bison-bridge bison-locations + + /* Enables the use of flex's built in start-condition state stack. */ +%option stack + /* Ensures flex generates a scanner that supports reading 8-bit characters. */ +%option 8bit + /* Directs flex to generate lookup tables that are better aligned in memory to + * improve access speeds, even if this means allocating larger tables. */ +%option align + /* Enables batching for improved performance. */ +%option batch + /* Directs flex to store matched text as 'char *' instead of char arrays, for improved performance. */ +%option pointer + /* Disables the scanner's interactive modes for improved performance. */ +%option never-interactive + /* Disables the generation of functions we don't use to reduce clutter, and possibly improve performance. */ +%option noinput nounput noyywrap +%option noyy_scan_buffer noyy_scan_bytes noyy_scan_string +%option noyyget_extra noyyset_extra noyyget_leng noyyget_text +%option noyyget_in noyyset_in noyyget_out noyyset_out +%option noyyget_lineno noyyset_lineno noyyget_lloc noyyset_lloc +%option noyyget_lval noyyset_lval noyyget_debug noyyset_debug + + /* List of start-condition states the scanner can be in. This lets the scanning be context dependent. */ +%x C_COMMENT +%s PRE_SLICE +%s SLICE +%x PREPROCESS +%x METADATA +%x STRING_LITERAL + /* The scanner also has a built in 'INITIAL' start-condition state, which is the state the scanner is initialized in. + * We use it solely to check for and consume any BOMs at the start of files. See Bug 3140. */ + +oct [0-7] +dec [0-9] +hex [0-9a-fA-F] +bom "\357\273\277" +whitespace ([[:space:]]{-}[\n])+ +preprocessor_prefix [[:blank:]]*#[[:blank:]]* +preprocessor_lineno {preprocessor_prefix}(line[[:blank:]]+)?{dec}+ identifier ((::)?\\?[[:alpha:]_][[:alnum:]_]*)+ -integer_constant (\+|-)?((0[0-7]+)|(0x[[:xdigit:]]+)|([[:digit:]]+)) -fractional_constant (\+|-)?(([[:digit:]]*\.[[:digit:]]+)|([[:digit:]]+\.)) -exponent_part (e|E)(\+|-)?[[:digit:]]+ -floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{exponent_part}))[fF]? - -%s BOMSCAN -%s MAINSCAN +integer_constant (\+|-)?((0{oct}+)|(0x{hex}+)|({dec}+)) +fractional_constant (\+|-)?(({dec}*\.{dec}+)|({dec}+\.)) +exponent_part (e|E)(\+|-)?{dec}+ +floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?{dec}+{exponent_part}))[fF]? %% -^"#"[[:blank:]]*[[:digit:]]+[[:blank:]]*$ { - if(unit->scanPosition(yytext)) + /* ========== Literals ========== */ + /* Matches the start of a double-quoted string literal. */ +"\"" { + yy_push_state(STRING_LITERAL); + startLocation(yylloc); + + StringTokPtr str = new StringTok; + str->literal = "\""; + *yylval = str; +} + + /* Matches a single escaped backslash, or as many characters as it can, + * except backslashes, new-lines, double quotes, and non-printable ASCII characters. */ + + /* Matches Escaped backslashes and any other valid string characters. Invalid characters are + * new-lines, non-printable ASCII characters, and double-quotes. */ +"\\\\"+ | +[^\\\n"\x0-\x1f\x7f]+ { + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += yytext; +} + + /* Matches an escaped double-quote, single-quote, or question mark. */ +"\\\"" | +"\\\'" | +"\\?" { + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += yytext[1]; +} + + /* Matches an ANSI-C escape code pattern. */ +"\\"[abfnrtv] { + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + char ansiCode; + switch(yytext[1]) { - BEGIN(BOMSCAN); + case 'a': ansiCode = '\a'; break; + case 'b': ansiCode = '\b'; break; + case 'f': ansiCode = '\f'; break; + case 'n': ansiCode = '\n'; break; + case 'r': ansiCode = '\r'; break; + case 't': ansiCode = '\t'; break; + case 'v': ansiCode = '\v'; break; + default: ansiCode = '\0'; assert(false); } + str->literal += yytext; + str->v += ansiCode; } -^"#"[[:blank:]]*[[:digit:]]+[[:blank:]]+"\""[^\"]*"\"".*$ { - if(unit->scanPosition(yytext)) + /* Matches an escaped octal value. Octal literals are limited to a max of 3 digits. */ +"\\"{oct}{1,3} { + IceUtil::Int64 value = strtoull((yytext + 1), 0, 8); + if(value > 255) { - BEGIN(BOMSCAN); + unit->error("octal escape sequence out of range: `\\" + string(yytext + 1) + "'"); } + + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += static_cast(value); +} + + /* Matches an escaped hexadecimal value. Hexadecimal literals are limited to a max of 2 digits. */ +"\\x"{hex}{1,2} { + IceUtil::Int64 value = strtoull((yytext + 2), 0, 16); + assert(value <= 255); + + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += static_cast(value); +} + + /* Matches an empty hexadecimal escape value. */ +"\\x" { + unit->error("no hex digit in hex escape sequence"); + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; } -^"#"[[:blank:]]*"line"[[:blank:]]+[[:digit:]]+[[:blank:]]*$ { - if(unit->scanPosition(yytext)) + /* Matches a 4-char or 8-char size universal character code. */ +"\\u"{hex}{4} | +"\\U"{hex}{8} { + IceUtil::Int64 codePoint = strtoull((yytext + 2), 0, 16); + if(codePoint <= 0xdfff && codePoint >= 0xd800) { - BEGIN(BOMSCAN); + unit->error("a universal character name cannot designate a surrogate: `" + string(yytext) + "'"); } + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += yytext; } -^"#"[[:blank:]]*"line"[[:blank:]]+[[:digit:]]+[[:blank:]]+"\""[^\"]*"\"".*$ { - if(unit->scanPosition(yytext)) + /* Matches a universal character code that isn't the correct size, or uses incorrect characters. */ +"\\u"{hex}{0,3}[g-zG-Z]* | +"\\U"{hex}{0,7}[g-zG-Z]* { + unit->error("unknown escape sequence in string literal: `" + string(yytext) + "'"); + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + str->v += yytext; +} + + /* Matches an unescaped newline in a string literal, and issues an error. */ +\n { + yy_pop_state(); + endLocation(yylloc); + nextLine(); + + unit->error("encountered un-escaped EOL while scanning a string literal."); + return ICE_STRING_LITERAL; +} + + /* Matches an unknown escape value. This rule has a lower priority than all the other escape rules because + * it only matches 2 characters (the lowest any match), and it's beneath the others. */ +"\\". { + unit->warning(All, "unknown escape sequence in string literal: `" + string(yytext) + "'"); + + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + // Escape the entire sequence. + str->literal += yytext; + str->v += "\\" + string(yytext); +} + + /* Matches a dangling backslash, with nothing to escape. This rule is mostly included for grammar completeness. */ +\\ { + unit->warning(All, "dangling backslash in string literal"); + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; +} + + /* Matches the end of a double-quoted string literal, but only while scanning a string literal. Flex always prefers + * to match the longest string it can, so quotes preceeded with a literal '\' will match the rules above this one. */ +"\"" { + yy_pop_state(); + endLocation(yylloc); + + StringTokPtr str = StringTokPtr::dynamicCast(*yylval); + str->literal += yytext; + return ICE_STRING_LITERAL; +} + + /* Matches EOF, but only while scanning a string literal. */ +<> { + yy_pop_state(); + endLocation(yylloc); + + unit->error("encountered EOF while scanning a string literal"); + return ICE_STRING_LITERAL; +} + +{integer_constant} { + setLocation(yylloc); + + IntegerTokPtr itp = new IntegerTok; + itp->literal = string(yytext); + *yylval = itp; + if(!IceUtilInternal::stringToInt64(string(yytext), itp->v)) { - BEGIN(BOMSCAN); + assert(itp->v != 0); + unit->error("integer constant `" + string(yytext) + "' out of range"); } + return ICE_INTEGER_LITERAL; } -"//" { - // C++-style comment - BEGIN(MAINSCAN); - int c; - do +{floating_literal} { + setLocation(yylloc); + + errno = 0; + FloatingTokPtr ftp = new FloatingTok; + *yylval = ftp; + string literal(yytext); + ftp->literal = literal; + char lastChar = literal[literal.size() - 1]; + if(lastChar == 'f' || lastChar == 'F') { - c = yyinput(); - if(c == '\n') - { - unit->nextLine(); - } + literal = literal.substr(0, literal.size() - 1); // Clobber trailing 'f' or 'F' suffix + } + ftp->v = strtod(literal.c_str(), 0); + if((ftp->v == HUGE_VAL || ftp->v == -HUGE_VAL) && errno == ERANGE) + { + unit->error("floating-point constant `" + string(yytext) + "' too large (overflow)"); } - while(c != '\n' && c != EOF); + else if(ftp->v == 0 && errno == ERANGE) + { + unit->error("floating-point constant `" + string(yytext) + "' too small (underflow)"); + } + return ICE_FLOATING_POINT_LITERAL; +} + + /* ========== Comments ========== */ + + /* Matches and records a triple-slash style doc comment. */ +<*>"///".* { + unit->addToComment(yytext + 3); +} + + /* Matches and consumes a C++ style comment. */ +<*>"//".* {} + + /* Matches the start of a C style comment, and switches the scanner to the C_COMMENT state. */ +<*>"/*" { + yy_push_state(C_COMMENT); } -"/*" { - // C-style comment - BEGIN(MAINSCAN); - string comment = yytext + 2; - while(true) + /* Matches any character except for newlines and adds them to the comments. '*' are matched one at a time to ensure + * Flex scans '* /' correctly. Flex prioritizes longer matches over shorter ones, so '* /' will match before '*'. */ +"*" | +[^\n*]+ { + yymore(); +} + + /* Matches as many newlines as are available and adds them to the comment, after incrementing the line count. */ +\n+ { + nextLine(yyleng); + yymore(); +} + + /* Matches the end of a C style comment, and reverts the scanner state to what it previously was. */ +"*/" { + yy_pop_state(); + + string comment(yytext); + // The last 2 characters are the '*/' matched by this rule. + unit->setComment(comment.substr(0, yyleng - 2)); +} + + /* Handles reaching EOF while scanning a C style comment by issuing a warning but continuing normally. */ +<> { + yy_pop_state(); + + unit->error("encountered EOF while scanning a comment"); + unit->setComment(yytext); +} + + /* ========== Preprocessor Statements ========== */ + + /* Matches the empty preprocessor directive. */ +<*>^{preprocessor_prefix} { + yy_push_state(PREPROCESS); +} + + /* Matches a line preprocessor directive, but missing a line number. */ +<*>^{preprocessor_prefix}line { + yy_push_state(PREPROCESS); + unit->error("missing line number in line preprocessor directive"); +} + + /* Matches a line preprocessor directive (optionally with a file specified afterwards). */ +<*>^{preprocessor_lineno} | +<*>^{preprocessor_lineno}[[:blank:]]+\"[^\"\n]*\" { + int includeAction = scanPosition(yytext); + if(yylineno == 0 || includeAction == 1) // Push: Indicated the scanner has started scanning a new file. { - int c = yyinput(); - if(c == '\n') - { - comment += static_cast(c); - unit->nextLine(); - } - else if(c == '*') - { - int next = yyinput(); - if(next == '/') - { - break; - } - else - { - comment += static_cast(c); - unput(next); - } - } - else if(c == EOF) - { - unit->warning(All, "EOF in comment"); - break; - } - else - { - comment += static_cast(c); - } + yy_push_state(INITIAL); } - if(!comment.empty() && comment[0] == '*') + else if(includeAction == 2) // Pop: Indicates the scanner has completed scanning a file. { - unit->setComment(comment); + yy_pop_state(); } + yy_push_state(PREPROCESS); } + /* Matches any non white-space character. This is a catch-all to report any invalid characters + * found while scanning a preprocessor directive. */ +[^[:space:]]+ { + unit->error("encountered unexpected token while scanning preprocessor directive: `" + string(yytext) + "'"); +} + + /* Matches a new-line character or EOF. This signals the end of the preprocessor statement. */ +\n | +<> { + yy_pop_state(); + nextLine(); +} + + /* ========== Metadata ========== */ + "[" { - BEGIN(MAINSCAN); + yy_push_state(METADATA); return ICE_METADATA_OPEN; } -"]" { - BEGIN(MAINSCAN); - return ICE_METADATA_CLOSE; +"[[" { + yy_push_state(METADATA); + + // We use a different token to indicate metadata that should be ignored (if it came after a slice definition). + if(yy_top_state() == PRE_SLICE) + { + return ICE_GLOBAL_METADATA_OPEN; + } + else + { + return ICE_GLOBAL_METADATA_IGNORE; + } } -"[[" { - BEGIN(MAINSCAN); - return ICE_GLOBAL_METADATA_OPEN; + /* Matches the start of a metadata string, then switches the scanner into STRING_LITERAL mode. */ +"\"" { + yy_push_state(STRING_LITERAL); + startLocation(yylloc); + + StringTokPtr str = new StringTok; + str->literal = "\""; + *yylval = str; +} + + /* Matches commas between string literals in quoted metadata and forwards them to the parser. */ +"," { + return yytext[0]; +} + + /* Matches and consumes newlines in between metadata after incrementing the line count. */ +\n+ { + nextLine(yyleng); +} + +"]" { + yy_pop_state(); + return ICE_METADATA_CLOSE; } -"]]" { - BEGIN(MAINSCAN); +"]]" { + yy_pop_state(); return ICE_GLOBAL_METADATA_CLOSE; } + /* Matches any characters not matched by another metadata rule (except whitespace), and reports an error. */ +[^[:space:]] { + unit->error("invalid character between metadata"); +} + + /* ========== Identifiers and Keywords ========== */ + {identifier}[[:space:]]*"(" { - BEGIN(MAINSCAN); StringTokPtr ident = new StringTok; ident->v = *yytext == '\\' ? yytext + 1 : yytext; ident->v.erase(ident->v.find_first_of(" \t\v\n\r\f(")); - *yylvalp = ident; + *yylval = ident; if(*yytext == '\\') { if(checkIdentifier(ident->v) == ICE_SCOPED_IDENTIFIER) { unit->error("Operation identifiers cannot be scoped: `" + (ident->v) + "'"); } - return ICE_IDENT_OP; + return ICE_IDENT_OPEN; } int st = checkKeyword(ident->v); if(st == ICE_IDENTIFIER) { - return ICE_IDENT_OP; + return ICE_IDENT_OPEN; } else if(st == ICE_SCOPED_IDENTIFIER) { unit->error("Operation identifiers cannot be scoped: `" + (ident->v) + "'"); - return ICE_IDENT_OP; + return ICE_IDENT_OPEN; + } + else if(st == ICE_TAG) + { + return ICE_TAG_OPEN; } else if(st == ICE_OPTIONAL) { - return ICE_OPTIONAL_OP; + return ICE_OPTIONAL_OPEN; } else { - return ICE_KEYWORD_OP; + return ICE_KEYWORD_OPEN; } } {identifier} { - BEGIN(MAINSCAN); StringTokPtr ident = new StringTok; ident->v = *yytext == '\\' ? yytext + 1 : yytext; - *yylvalp = ident; + *yylval = ident; return *yytext == '\\' ? checkIdentifier(ident->v) : checkKeyword(ident->v); } -\" { - BEGIN(MAINSCAN); - StringTokPtr str = new StringTok; - str->literal = "\""; - while(true) - { - int c = yyinput(); - str->literal += static_cast(c); - if(c == '"') - { - break; - } - else if(c == EOF) - { - unit->error("EOF in string"); - break; - } - else if(c < 32 || c == 127) - { - unit->error("a string literal can only contain printable ASCII characters and non-ASCII characters"); - break; - } - else if(c == '\\') - { - int next = yyinput(); - str->literal += static_cast(next); - switch(next) - { - case '\\': - { - // - // add extra escape to our internal string - // - str->v += '\\'; - str->v += '\\'; - break; - } - case '"': - case '\'': - case '?': - { - str->v += static_cast(next); - break; - } - case 'a': - { - str->v += '\a'; - break; - } - case 'b': - { - str->v += '\b'; - break; - } - case 'f': - { - str->v += '\f'; - break; - } - case 'n': - { - str->v += '\n'; - break; - } - case 'r': - { - str->v += '\r'; - break; - } - case 't': - { - str->v += '\t'; - break; - } - case 'v': - { - str->v += '\v'; - break; - } - - // - // Octal value \nnn limited to three octal digits but terminate at the first character - // that is not a valid octal digit if encountered sooner. - // - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - { - static string octalDigits = "01234567"; - string escape; - escape += static_cast(next); - for(int i = 0; i < 2; ++i) - { - next = yyinput(); - if(octalDigits.find_first_of(static_cast(next)) == string::npos) - { - unput(next); - break; - } - escape += static_cast(next); - } - str->literal += escape; - IceUtil::Int64 value = IceUtilInternal::strToInt64(escape.c_str(), 0, 8); - if(value > 255) - { - unit->error(string("octal escape sequence out of range: `\\") + escape + "'"); - } - str->v += static_cast(value); - break; - } - - case 'x': - { - string escape = ""; - next = yyinput(); - - // - // Unlike C++, we limit hex escape sequences to 2 hex digits - // - while(isxdigit(static_cast(next)) && escape.length() < 2) - { - escape += static_cast(next); - next = yyinput(); - } - unput(next); - - if(escape.length() == 0) - { - unit->error("no hex digit in hex escape sequence"); - } - - str->literal += escape; - IceUtil::Int64 value = IceUtilInternal::strToInt64(escape.c_str(), 0, 16); - - assert(value >= 0 && value <= 255); - str->v += static_cast(value); - break; - } - - // - // Universal character name - // - case 'u': - case 'U': - { - string escape = ""; - c = next; - int size = (c == 'u') ? 4 : 8; - while(size > 0) - { - next = yyinput(); - if(!isxdigit(next)) - { - unit->error(string("unknown escape sequence in string literal: `\\") + - static_cast(c) + escape + static_cast(next) + "'"); - unput(next); - break; - } - escape += static_cast(next); - --size; - } - - if(size == 0) - { - // All digits read, check value - IceUtil::Int64 codePoint = IceUtilInternal::strToInt64(escape.c_str(), 0, 16); - if(codePoint >= 0xd800 && codePoint <= 0xdfff) - { - unit->error(string("a universal character name cannot designate a surrogate: `\\") + - static_cast(c) + escape + "'"); - } - } - - str->literal += escape; - str->v += string("\\") + static_cast(c) + escape; - break; - } - - default: - { - ostringstream os; - os << "unknown escape sequence `\\" << static_cast(next) << "'"; - unit->warning(All, os.str()); - - // Escape the \ in this unknown escape sequence - str->v += '\\'; - str->v += '\\'; - unput(next); - } - } - } - else - { - str->v += static_cast(c); - } - } - *yylvalp = str; - return ICE_STRING_LITERAL; -} + /* ========== Whitespace ========== */ -{integer_constant} { - BEGIN(MAINSCAN); - IntegerTokPtr itp = new IntegerTok; - itp->literal = string(yytext); - *yylvalp = itp; - if(!IceUtilInternal::stringToInt64(string(yytext), itp->v)) - { - assert(itp->v != 0); - string msg = "integer constant `"; - msg += yytext; - msg += "' out of range"; - unit->error(msg); - } - return ICE_INTEGER_LITERAL; -} + /* Matches and consumes any whitespace, except for newlines. */ +<*>{whitespace}+ {} -{floating_literal} { - BEGIN(MAINSCAN); - errno = 0; - FloatingTokPtr ftp = new FloatingTok; - *yylvalp = ftp; - string literal(yytext); - ftp->literal = literal; - char lastChar = literal[literal.size() - 1]; - if(lastChar == 'f' || lastChar == 'F') - { - literal = literal.substr(0, literal.size() - 1); // Clobber trailing 'f' or 'F' suffix - } - ftp->v = strtod(literal.c_str(), 0); - if((ftp->v == HUGE_VAL || ftp->v == -HUGE_VAL) && errno == ERANGE) - { - string msg = "floating-point constant `"; - msg += yytext; - msg += "' too large (overflow)"; - unit->error(msg); - } - else if(ftp->v == 0 && errno == ERANGE) - { - string msg = "floating-point constant `"; - msg += yytext; - msg += "' too small (underflow)"; - unit->error(msg); - } - return ICE_FLOATING_POINT_LITERAL; + /* Matches and consumes newlines, but only when the scanner isn't in a sub-scanner. */ +\n+ { + nextLine(yyleng); } -[[:space:]] { - // Ignore white-space + /* ========== Others ========== */ - if(unit->currentLine() != 0) - { - BEGIN(MAINSCAN); - } - if(yytext[0] == '\n') - { - unit->nextLine(); - } -} + /* Matches and consumes a BOM, but only when the scanner has just started scanning a new file. */ +{bom} {} -^"\357\273\277" { - // Ignore UTF-8 BOM, rule only active when parsing start of file. + /* Matches invalid characters, one at a time to make this the 2nd lowest priority rule. All printable ASCII + * characters are valid (those between 32 and 127 inclusively), anything outside this range is invalid. */ +[^\x20-\x7f] { + stringstream s; + s << "illegal input character: '\\"; + s.width(3); + s.fill('0'); + s << oct << static_cast(static_cast(yytext[0])); + s << "'"; - BEGIN(MAINSCAN); + unit->error(s.str()); + return BAD_CHAR; } + /* Matches any valid character (except newlines) not matched by another rule and fowards it to the parser. + * This is the lowest priority rule in the scanner, and is only active while not in a sub-scanner. */ . { - BEGIN(MAINSCAN); - if(yytext[0] < 32 || yytext[0] > 126) - { - stringstream s; - s << "illegal input character: '\\"; - s.width(3); - s.fill('0'); - s << oct << static_cast(static_cast(yytext[0])); - s << "'"; - unit->error(s.str()); - return BAD_CHAR; - } + setLocation(yylloc); return yytext[0]; } %% -namespace Slice { - -// -// initScanner() fills the keyword map with all keyword-token pairs. -// - -void -initScanner() +namespace Slice { - keywordMap["module"] = ICE_MODULE; - keywordMap["class"] = ICE_CLASS; - keywordMap["interface"] = ICE_INTERFACE; - keywordMap["exception"] = ICE_EXCEPTION; - keywordMap["struct"] = ICE_STRUCT; - keywordMap["sequence"] = ICE_SEQUENCE; - keywordMap["dictionary"] = ICE_DICTIONARY; - keywordMap["enum"] = ICE_ENUM; - keywordMap["out"] = ICE_OUT; - keywordMap["extends"] = ICE_EXTENDS; - keywordMap["implements"] = ICE_IMPLEMENTS; - keywordMap["throws"] = ICE_THROWS; - keywordMap["void"] = ICE_VOID; - keywordMap["byte"] = ICE_BYTE; - keywordMap["bool"] = ICE_BOOL; - keywordMap["short"] = ICE_SHORT; - keywordMap["int"] = ICE_INT; - keywordMap["long"] = ICE_LONG; - keywordMap["float"] = ICE_FLOAT; - keywordMap["double"] = ICE_DOUBLE; - keywordMap["string"] = ICE_STRING; - keywordMap["Object"] = ICE_OBJECT; - keywordMap["LocalObject"] = ICE_LOCAL_OBJECT; - keywordMap["local"] = ICE_LOCAL; - keywordMap["const"] = ICE_CONST; - keywordMap["false"] = ICE_FALSE; - keywordMap["true"] = ICE_TRUE; - keywordMap["idempotent"] = ICE_IDEMPOTENT; - keywordMap["optional"] = ICE_OPTIONAL; - keywordMap["Value"] = ICE_VALUE; -} -// // Check if an identifier looks like a keyword. // If the identifier is a keyword, return the // corresponding keyword token; otherwise, return // an identifier token. -// - -int -checkKeyword(string& id) +int checkKeyword(string& id) { - StringTokenMap::const_iterator pos = keywordMap.find(id); + const StringTokenMap::const_iterator pos = keywordMap.find(id); if(pos != keywordMap.end()) { if(pos->first != id) { - string msg; - msg = "illegal identifier: `" + id + "' differs from keyword `"; - msg += pos->first + "' only in capitalization"; - unit->error(msg); + unit->error("illegal identifier: `" + id + "' differs from keyword `" + pos->first + + "' only in capitalization"); id = pos->first; } return pos->second; @@ -596,14 +575,11 @@ checkKeyword(string& id) return checkIdentifier(id); } -// // Checks an identifier for any illegal syntax and // determines whether it's scoped. If it is, this // returns a scoped identifier token; otherwise this // returns a normal identifier token. -// - -int checkIdentifier(string& id) +int checkIdentifier(const string& id) { // check whether the identifier is scoped size_t scopeIndex = id.rfind("::"); @@ -674,3 +650,129 @@ int checkIdentifier(string& id) } } + +namespace +{ + +void nextLine(int count) +{ + yylineno += count; + yycolno = 0; +} + +int scanPosition(const char* s) +{ + string line(s); + // Skip the leading '#', optional 'line', and any whitespace before the line number. + string::size_type idx = line.find_first_not_of(" \t\r", (line.find('#') + 1)); + if(line.find("line", idx) == idx) + { + idx = line.find_first_not_of(" \t\r", (idx + 4)); + } + line.erase(0, idx); + + // Read the line number + yylineno = stoi(line.c_str(), &idx) - 1; + + // Scan the remainder of the line for a filename. + idx = line.find_first_not_of(" \t\r", idx); + line.erase(0, idx); + + int lineTypeCode = 0; + if(!line.empty()) + { + if(line[0] == '"') + { + string::size_type edx = line.rfind('"'); + if(edx != string::npos) + { + line = line.substr(1, edx - 1); + } + else + { + unit->error("mismatched quotations in line directive"); + line = line.substr(1); + } + } + lineTypeCode = unit->setCurrentFile(line, yylineno); + yyfilename = string(line); + } + return lineTypeCode; +} + +void setLocation(TokenContext* location) +{ + startLocation(location); + endLocation(location); +} + +void startLocation(TokenContext* location) +{ + location->firstLine = yylineno; + // The string has already been scanned, so the scanner is positioned at the end of it. + location->firstColumn = yycolno - yyleng; + location->filename = yyfilename; +} + +void endLocation(TokenContext* location) +{ + location->lastLine = yylineno; + location->lastColumn = yycolno; +} + +// This function is always called once, right before scanning begins. +void initScanner() +{ + // Ensure the scanner starts at line number 1, column position 0. + yylineno = 1; + + keywordMap["module"] = ICE_MODULE; + keywordMap["class"] = ICE_CLASS; + keywordMap["interface"] = ICE_INTERFACE; + keywordMap["exception"] = ICE_EXCEPTION; + keywordMap["struct"] = ICE_STRUCT; + keywordMap["sequence"] = ICE_SEQUENCE; + keywordMap["dictionary"] = ICE_DICTIONARY; + keywordMap["enum"] = ICE_ENUM; + keywordMap["out"] = ICE_OUT; + keywordMap["extends"] = ICE_EXTENDS; + keywordMap["implements"] = ICE_IMPLEMENTS; + keywordMap["throws"] = ICE_THROWS; + keywordMap["void"] = ICE_VOID; + keywordMap["byte"] = ICE_BYTE; + keywordMap["bool"] = ICE_BOOL; + keywordMap["short"] = ICE_SHORT; + keywordMap["int"] = ICE_INT; + keywordMap["long"] = ICE_LONG; + keywordMap["float"] = ICE_FLOAT; + keywordMap["double"] = ICE_DOUBLE; + keywordMap["string"] = ICE_STRING; + keywordMap["Object"] = ICE_OBJECT; + keywordMap["const"] = ICE_CONST; + keywordMap["LocalObject"] = ICE_LOCAL_OBJECT; + keywordMap["local"] = ICE_LOCAL; + keywordMap["false"] = ICE_FALSE; + keywordMap["true"] = ICE_TRUE; + keywordMap["idempotent"] = ICE_IDEMPOTENT; + keywordMap["tag"] = ICE_TAG; + // 'optional' is kept as an alias for 'tag' for backwards compatability. + // We need a separate token type since we infer 'optional T' to mean 'tag T?'. + // But for 'tag' we require an optional (nullable) type. No inferencing is done. + keywordMap["optional"] = ICE_OPTIONAL; + keywordMap["Value"] = ICE_VALUE; +} + +// This function is always called directly after a match has been made, but directly before it's action block is run. +void preAction() +{ + yycolno += yyleng; + + // We only use the 'INITIAL' state to consume BOMs, which can only validly be the first match in a file. This + // function being called means a match has already been made, so we switch states since BOMs are no longer valid. + if(YY_START == INITIAL) + { + BEGIN(PRE_SLICE); + } +} + +} diff --git a/cpp/src/icegriddb/DBTypes.ice b/cpp/src/icegriddb/DBTypes.ice index 0e738da2753..af8b9a3ccb8 100644 --- a/cpp/src/icegriddb/DBTypes.ice +++ b/cpp/src/icegriddb/DBTypes.ice @@ -10,16 +10,14 @@ module IceGrid { + dictionary StringLongDict; -dictionary StringLongDict; - -struct AllData -{ - ApplicationInfoSeq applications; - AdapterInfoSeq adapters; - ObjectInfoSeq objects; - ObjectInfoSeq internalObjects; - StringLongDict serials; -} - + struct AllData + { + ApplicationInfoSeq applications; + AdapterInfoSeq adapters; + ObjectInfoSeq objects; + ObjectInfoSeq internalObjects; + StringLongDict serials; + } } diff --git a/cpp/test/Slice/errorDetection/ConstDef.err b/cpp/test/Slice/errorDetection/ConstDef.err index 7c4707dfbcc..3188d5f65d8 100644 --- a/cpp/test/Slice/errorDetection/ConstDef.err +++ b/cpp/test/Slice/errorDetection/ConstDef.err @@ -22,7 +22,7 @@ ConstDef.ice:118: initializer `256' for constant `b4' out of range for type byte ConstDef.ice:130: initializer `32767' for constant `c5' out of range for type byte ConstDef.ice:131: initializer `2147483647' for constant `c6' out of range for type short ConstDef.ice:132: initializer `9223372036854775807' for constant `c7' out of range for type int -ConstDef.ice:143: warning: unknown escape sequence `\g' +ConstDef.ice:143: warning: unknown escape sequence in string literal: `\g' ConstDef.ice:144: unknown escape sequence in string literal: `\u000N' ConstDef.ice:145: unknown escape sequence in string literal: `\U0000000K' ConstDef.ice:146: octal escape sequence out of range: `\455' diff --git a/cpp/test/Slice/errorDetection/OptionalMembers.err b/cpp/test/Slice/errorDetection/OptionalMembers.err index 525dad3dda5..c54d01807c9 100644 --- a/cpp/test/Slice/errorDetection/OptionalMembers.err +++ b/cpp/test/Slice/errorDetection/OptionalMembers.err @@ -1,33 +1,33 @@ -OptionalMembers.ice:21: missing tag for optional -OptionalMembers.ice:22: missing tag for optional -OptionalMembers.ice:23: `abc' is not defined -OptionalMembers.ice:24: tag for optional is out of range -OptionalMembers.ice:25: tag for optional is out of range -OptionalMembers.ice:26: tag for optional is out of range -OptionalMembers.ice:28: tag for optional data member `m8' is already in use -OptionalMembers.ice:29: tag for optional is out of range -OptionalMembers.ice:29: invalid tag `C3' for optional -OptionalMembers.ice:30: tag for optional is out of range -OptionalMembers.ice:30: invalid tag `C4' for optional -OptionalMembers.ice:31: invalid tag `C5' for optional -OptionalMembers.ice:33: tag for optional data member `m13' is already in use -OptionalMembers.ice:34: enumerator `e2' could designate `::Test::E::e2' or `::Test::Ebis::e2' or `::Test::Eter::e2' -OptionalMembers.ice:35: warning: referencing enumerator `::Test::E::e3' without its enumeration's scope is deprecated -OptionalMembers.ice:36: tag for optional data member `m16' is already in use -OptionalMembers.ice:51: missing tag for optional -OptionalMembers.ice:52: missing tag for optional -OptionalMembers.ice:53: `abc' is not defined -OptionalMembers.ice:54: tag for optional is out of range -OptionalMembers.ice:55: tag for optional is out of range -OptionalMembers.ice:56: tag for optional is out of range -OptionalMembers.ice:58: tag for optional data member `m8' is already in use -OptionalMembers.ice:59: tag for optional is out of range -OptionalMembers.ice:59: invalid tag `C3' for optional -OptionalMembers.ice:60: tag for optional is out of range -OptionalMembers.ice:60: invalid tag `C4' for optional -OptionalMembers.ice:61: invalid tag `C5' for optional -OptionalMembers.ice:63: tag for optional data member `m13' is already in use -OptionalMembers.ice:65: warning: referencing enumerator `::Test::E::e3' without its enumeration's scope is deprecated -OptionalMembers.ice:66: tag for optional data member `m16' is already in use -OptionalMembers.ice:81: optional data members not supported in struct -OptionalMembers.ice:82: optional data members not supported in struct +TaggedMembers.ice:21: missing tag +TaggedMembers.ice:22: missing tag +TaggedMembers.ice:23: `abc' is not defined +TaggedMembers.ice:24: tag is out of range +TaggedMembers.ice:25: tag is out of range +TaggedMembers.ice:26: tag is out of range +TaggedMembers.ice:28: tag for optional data member `m8' is already in use +TaggedMembers.ice:29: tag is out of range +TaggedMembers.ice:29: invalid tag `C3' +TaggedMembers.ice:30: tag is out of range +TaggedMembers.ice:30: invalid tag `C4' +TaggedMembers.ice:31: invalid tag `C5' +TaggedMembers.ice:33: tag for optional data member `m13' is already in use +TaggedMembers.ice:34: enumerator `e2' could designate `::Test::E::e2' or `::Test::Ebis::e2' or `::Test::Eter::e2' +TaggedMembers.ice:35: warning: referencing enumerator `::Test::E::e3' without its enumeration's scope is deprecated +TaggedMembers.ice:36: tag for optional data member `m16' is already in use +TaggedMembers.ice:51: missing tag +TaggedMembers.ice:52: missing tag +TaggedMembers.ice:53: `abc' is not defined +TaggedMembers.ice:54: tag is out of range +TaggedMembers.ice:55: tag is out of range +TaggedMembers.ice:56: tag is out of range +TaggedMembers.ice:58: tag for optional data member `m8' is already in use +TaggedMembers.ice:59: tag is out of range +TaggedMembers.ice:59: invalid tag `C3' +TaggedMembers.ice:60: tag is out of range +TaggedMembers.ice:60: invalid tag `C4' +TaggedMembers.ice:61: invalid tag `C5' +TaggedMembers.ice:63: tag for optional data member `m13' is already in use +TaggedMembers.ice:65: warning: referencing enumerator `::Test::E::e3' without its enumeration's scope is deprecated +TaggedMembers.ice:66: tag for optional data member `m16' is already in use +TaggedMembers.ice:81: tagged data members are not supported in structs +TaggedMembers.ice:82: tagged data members are not supported in structs \ No newline at end of file diff --git a/cpp/test/Slice/errorDetection/OptionalParams.err b/cpp/test/Slice/errorDetection/OptionalParams.err deleted file mode 100644 index 17f61e5e6f9..00000000000 --- a/cpp/test/Slice/errorDetection/OptionalParams.err +++ /dev/null @@ -1,40 +0,0 @@ -OptionalParams.ice:20: missing tag for optional -OptionalParams.ice:21: missing tag for optional -OptionalParams.ice:22: `abc' is not defined -OptionalParams.ice:23: tag for optional is out of range -OptionalParams.ice:24: tag for optional is out of range -OptionalParams.ice:25: tag for optional is out of range -OptionalParams.ice:27: tag for optional is out of range -OptionalParams.ice:27: invalid tag `C3' for optional -OptionalParams.ice:28: tag for optional is out of range -OptionalParams.ice:28: invalid tag `C4' for optional -OptionalParams.ice:29: invalid tag `C5' for optional -OptionalParams.ice:32: syntax error -OptionalParams.ice:34: missing tag for optional -OptionalParams.ice:35: missing tag for optional -OptionalParams.ice:36: `abc' is not defined -OptionalParams.ice:37: tag for optional is out of range -OptionalParams.ice:38: tag for optional is out of range -OptionalParams.ice:39: tag for optional is out of range -OptionalParams.ice:41: tag for optional is out of range -OptionalParams.ice:41: invalid tag `C3' for optional -OptionalParams.ice:42: tag for optional is out of range -OptionalParams.ice:42: invalid tag `C4' for optional -OptionalParams.ice:43: invalid tag `C5' for optional -OptionalParams.ice:45: warning: referencing enumerator `::Test::E::e2' without its enumeration's scope is deprecated -OptionalParams.ice:47: missing tag for optional -OptionalParams.ice:48: missing tag for optional -OptionalParams.ice:49: `abc' is not defined -OptionalParams.ice:50: tag for optional is out of range -OptionalParams.ice:51: tag for optional is out of range -OptionalParams.ice:52: tag for optional is out of range -OptionalParams.ice:54: tag for optional is out of range -OptionalParams.ice:54: invalid tag `C3' for optional -OptionalParams.ice:55: tag for optional is out of range -OptionalParams.ice:55: invalid tag `C4' for optional -OptionalParams.ice:56: invalid tag `C5' for optional -OptionalParams.ice:58: enumerator `e1' could designate `::Test::E::e1' or `::Test::Ebis::e1' -OptionalParams.ice:62: tag for optional parameter `o' is already in use -OptionalParams.ice:63: tag for optional parameter `o' is already in use -OptionalParams.ice:64: tag for optional parameter `o' is already in use -OptionalParams.ice:65: tag for optional parameter `o' is already in use diff --git a/cpp/test/Slice/errorDetection/TaggedMembers.err b/cpp/test/Slice/errorDetection/TaggedMembers.err new file mode 100644 index 00000000000..956726865a5 --- /dev/null +++ b/cpp/test/Slice/errorDetection/TaggedMembers.err @@ -0,0 +1,33 @@ +TaggedMembers.ice:21: missing tag +TaggedMembers.ice:22: missing tag +TaggedMembers.ice:23: `abc' is not defined +TaggedMembers.ice:24: tag is out of range +TaggedMembers.ice:25: tag is out of range +TaggedMembers.ice:26: tag is out of range +TaggedMembers.ice:28: tag for optional data member `m8' is already in use +TaggedMembers.ice:29: tag is out of range +TaggedMembers.ice:29: invalid tag `C3' +TaggedMembers.ice:30: tag is out of range +TaggedMembers.ice:30: invalid tag `C4' +TaggedMembers.ice:31: invalid tag `C5' +TaggedMembers.ice:33: tag for optional data member `m13' is already in use +TaggedMembers.ice:34: enumerator `e2' could designate `::Test::E::e2' or `::Test::Ebis::e2' or `::Test::Eter::e2' +TaggedMembers.ice:35: warning: referencing enumerator `::Test::E::e3' without its enumeration's scope is deprecated +TaggedMembers.ice:36: tag for optional data member `m16' is already in use +TaggedMembers.ice:51: missing tag +TaggedMembers.ice:52: missing tag +TaggedMembers.ice:53: `abc' is not defined +TaggedMembers.ice:54: tag is out of range +TaggedMembers.ice:55: tag is out of range +TaggedMembers.ice:56: tag is out of range +TaggedMembers.ice:58: tag for optional data member `m8' is already in use +TaggedMembers.ice:59: tag is out of range +TaggedMembers.ice:59: invalid tag `C3' +TaggedMembers.ice:60: tag is out of range +TaggedMembers.ice:60: invalid tag `C4' +TaggedMembers.ice:61: invalid tag `C5' +TaggedMembers.ice:63: tag for optional data member `m13' is already in use +TaggedMembers.ice:65: warning: referencing enumerator `::Test::E::e3' without its enumeration's scope is deprecated +TaggedMembers.ice:66: tag for optional data member `m16' is already in use +TaggedMembers.ice:81: tagged data members are not supported in structs +TaggedMembers.ice:82: tagged data members are not supported in structs diff --git a/cpp/test/Slice/errorDetection/OptionalMembers.ice b/cpp/test/Slice/errorDetection/TaggedMembers.ice similarity index 100% rename from cpp/test/Slice/errorDetection/OptionalMembers.ice rename to cpp/test/Slice/errorDetection/TaggedMembers.ice diff --git a/cpp/test/Slice/errorDetection/TaggedParams.err b/cpp/test/Slice/errorDetection/TaggedParams.err new file mode 100644 index 00000000000..927d6904540 --- /dev/null +++ b/cpp/test/Slice/errorDetection/TaggedParams.err @@ -0,0 +1,40 @@ +TaggedParams.ice:20: missing tag +TaggedParams.ice:21: missing tag +TaggedParams.ice:22: `abc' is not defined +TaggedParams.ice:23: tag is out of range +TaggedParams.ice:24: tag is out of range +TaggedParams.ice:25: tag is out of range +TaggedParams.ice:27: tag is out of range +TaggedParams.ice:27: invalid tag `C3' +TaggedParams.ice:28: tag is out of range +TaggedParams.ice:28: invalid tag `C4' +TaggedParams.ice:29: invalid tag `C5' +TaggedParams.ice:32: syntax error +TaggedParams.ice:34: missing tag +TaggedParams.ice:35: missing tag +TaggedParams.ice:36: `abc' is not defined +TaggedParams.ice:37: tag is out of range +TaggedParams.ice:38: tag is out of range +TaggedParams.ice:39: tag is out of range +TaggedParams.ice:41: tag is out of range +TaggedParams.ice:41: invalid tag `C3' +TaggedParams.ice:42: tag is out of range +TaggedParams.ice:42: invalid tag `C4' +TaggedParams.ice:43: invalid tag `C5' +TaggedParams.ice:45: warning: referencing enumerator `::Test::E::e2' without its enumeration's scope is deprecated +TaggedParams.ice:47: missing tag +TaggedParams.ice:48: missing tag +TaggedParams.ice:49: `abc' is not defined +TaggedParams.ice:50: tag is out of range +TaggedParams.ice:51: tag is out of range +TaggedParams.ice:52: tag is out of range +TaggedParams.ice:54: tag is out of range +TaggedParams.ice:54: invalid tag `C3' +TaggedParams.ice:55: tag is out of range +TaggedParams.ice:55: invalid tag `C4' +TaggedParams.ice:56: invalid tag `C5' +TaggedParams.ice:58: enumerator `e1' could designate `::Test::E::e1' or `::Test::Ebis::e1' +TaggedParams.ice:62: tag for optional parameter `o' is already in use +TaggedParams.ice:63: tag for optional parameter `o' is already in use +TaggedParams.ice:64: tag for optional parameter `o' is already in use +TaggedParams.ice:65: tag for optional parameter `o' is already in use diff --git a/cpp/test/Slice/errorDetection/OptionalParams.ice b/cpp/test/Slice/errorDetection/TaggedParams.ice similarity index 100% rename from cpp/test/Slice/errorDetection/OptionalParams.ice rename to cpp/test/Slice/errorDetection/TaggedParams.ice diff --git a/java-compat/test/src/main/java/test/Ice/impl/Test.ice b/java-compat/test/src/main/java/test/Ice/impl/Test.ice index 0321946ddce..021bcbbf68e 100644 --- a/java-compat/test/src/main/java/test/Ice/impl/Test.ice +++ b/java-compat/test/src/main/java/test/Ice/impl/Test.ice @@ -323,9 +323,9 @@ const string ss0 = "\'\"\?\\\a\b\f\n\r\t\v\6"; const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b\u0006"; const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b\U00000006"; -const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */ -const string ss4 = "\\\u0041\\"; /* \A\ */ -const string ss5 = "\\u0041\\"; /* \u0041\ */ +const string ss3 = "\\\\U\\u\\"; +const string ss4 = "\\\u0041\\"; +const string ss5 = "\\u0041\\"; // // Ĩ - Unicode Character 'LATIN CAPITAL LETTER I WITH TILDE' (U+0128) diff --git a/java-compat/test/src/main/java/test/Ice/impl/TestAMD.ice b/java-compat/test/src/main/java/test/Ice/impl/TestAMD.ice index f3bd6397015..360d0386577 100644 --- a/java-compat/test/src/main/java/test/Ice/impl/TestAMD.ice +++ b/java-compat/test/src/main/java/test/Ice/impl/TestAMD.ice @@ -323,9 +323,9 @@ const string ss0 = "\'\"\?\\\a\b\f\n\r\t\v\6"; const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b\u0006"; const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b\U00000006"; -const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */ -const string ss4 = "\\\u0041\\"; /* \A\ */ -const string ss5 = "\\u0041\\"; /* \u0041\ */ +const string ss3 = "\\\\U\\u\\"; +const string ss4 = "\\\u0041\\"; +const string ss5 = "\\u0041\\"; // // Ĩ - Unicode Character 'LATIN CAPITAL LETTER I WITH TILDE' (U+0128) diff --git a/java-compat/test/src/main/java/test/Ice/operations/Test.ice b/java-compat/test/src/main/java/test/Ice/operations/Test.ice index e5b6561d884..61ba4e9e6af 100644 --- a/java-compat/test/src/main/java/test/Ice/operations/Test.ice +++ b/java-compat/test/src/main/java/test/Ice/operations/Test.ice @@ -327,9 +327,9 @@ const string ss0 = "\'\"\?\\\a\b\f\n\r\t\v\6"; const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b\u0006"; const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b\U00000006"; -const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */ -const string ss4 = "\\\u0041\\"; /* \A\ */ -const string ss5 = "\\u0041\\"; /* \u0041\ */ +const string ss3 = "\\\\U\\u\\"; +const string ss4 = "\\\u0041\\"; +const string ss5 = "\\u0041\\"; // // Ĩ - Unicode Character 'LATIN CAPITAL LETTER I WITH TILDE' (U+0128) diff --git a/java-compat/test/src/main/java/test/Ice/operations/TestAMD.ice b/java-compat/test/src/main/java/test/Ice/operations/TestAMD.ice index 6d3bcb651ad..490d1bba2b0 100644 --- a/java-compat/test/src/main/java/test/Ice/operations/TestAMD.ice +++ b/java-compat/test/src/main/java/test/Ice/operations/TestAMD.ice @@ -327,9 +327,9 @@ const string ss0 = "\'\"\?\\\a\b\f\n\r\t\v\6"; const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b\u0006"; const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b\U00000006"; -const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */ -const string ss4 = "\\\u0041\\"; /* \A\ */ -const string ss5 = "\\u0041\\"; /* \u0041\ */ +const string ss3 = "\\\\U\\u\\"; +const string ss4 = "\\\u0041\\"; +const string ss5 = "\\u0041\\"; // // Ĩ - Unicode Character 'LATIN CAPITAL LETTER I WITH TILDE' (U+0128) diff --git a/java/test/src/main/java/test/Ice/impl/Test.ice b/java/test/src/main/java/test/Ice/impl/Test.ice index 11a9597aed7..8bd541d08b7 100644 --- a/java/test/src/main/java/test/Ice/impl/Test.ice +++ b/java/test/src/main/java/test/Ice/impl/Test.ice @@ -323,9 +323,9 @@ const string ss0 = "\'\"\?\\\a\b\f\n\r\t\v\6"; const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b\u0006"; const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b\U00000006"; -const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */ -const string ss4 = "\\\u0041\\"; /* \A\ */ -const string ss5 = "\\u0041\\"; /* \u0041\ */ +const string ss3 = "\\\\U\\u\\"; +const string ss4 = "\\\u0041\\"; +const string ss5 = "\\u0041\\"; // // Ĩ - Unicode Character 'LATIN CAPITAL LETTER I WITH TILDE' (U+0128) diff --git a/java/test/src/main/java/test/Ice/impl/TestAMD.ice b/java/test/src/main/java/test/Ice/impl/TestAMD.ice index 1281e86b71d..8f761563e14 100644 --- a/java/test/src/main/java/test/Ice/impl/TestAMD.ice +++ b/java/test/src/main/java/test/Ice/impl/TestAMD.ice @@ -323,9 +323,9 @@ const string ss0 = "\'\"\?\\\a\b\f\n\r\t\v\6"; const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b\u0006"; const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b\U00000006"; -const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */ -const string ss4 = "\\\u0041\\"; /* \A\ */ -const string ss5 = "\\u0041\\"; /* \u0041\ */ +const string ss3 = "\\\\U\\u\\"; // \\U\u\ +const string ss4 = "\\\u0041\\"; // \A\ +const string ss5 = "\\u0041\\"; // \u0041\ // // Ĩ - Unicode Character 'LATIN CAPITAL LETTER I WITH TILDE' (U+0128) diff --git a/java/test/src/main/java/test/Ice/operations/Test.ice b/java/test/src/main/java/test/Ice/operations/Test.ice index 6e3b4e2d226..0baeedaf27b 100644 --- a/java/test/src/main/java/test/Ice/operations/Test.ice +++ b/java/test/src/main/java/test/Ice/operations/Test.ice @@ -326,9 +326,9 @@ const string ss0 = "\'\"\?\\\a\b\f\n\r\t\v\6"; const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b\u0006"; const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b\U00000006"; -const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */ -const string ss4 = "\\\u0041\\"; /* \A\ */ -const string ss5 = "\\u0041\\"; /* \u0041\ */ +const string ss3 = "\\\\U\\u\\"; +const string ss4 = "\\\u0041\\"; +const string ss5 = "\\u0041\\"; // // Ĩ - Unicode Character 'LATIN CAPITAL LETTER I WITH TILDE' (U+0128) diff --git a/java/test/src/main/java/test/Ice/operations/TestAMD.ice b/java/test/src/main/java/test/Ice/operations/TestAMD.ice index fdeaece92f1..6ccd10fbb2d 100644 --- a/java/test/src/main/java/test/Ice/operations/TestAMD.ice +++ b/java/test/src/main/java/test/Ice/operations/TestAMD.ice @@ -326,9 +326,9 @@ const string ss0 = "\'\"\?\\\a\b\f\n\r\t\v\6"; const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b\u0006"; const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b\U00000006"; -const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */ -const string ss4 = "\\\u0041\\"; /* \A\ */ -const string ss5 = "\\u0041\\"; /* \u0041\ */ +const string ss3 = "\\\\U\\u\\"; +const string ss4 = "\\\u0041\\"; +const string ss5 = "\\u0041\\"; // // Ĩ - Unicode Character 'LATIN CAPITAL LETTER I WITH TILDE' (U+0128) diff --git a/slice/Glacier2/Metrics.ice b/slice/Glacier2/Metrics.ice index f592e302a60..ec308a8e814 100644 --- a/slice/Glacier2/Metrics.ice +++ b/slice/Glacier2/Metrics.ice @@ -27,62 +27,28 @@ ["objc:prefix:ICEMX", "swift:module:Glacier2:MX"] module IceMX { + /// Provides information on Glacier2 sessions. + class SessionMetrics extends Metrics + { + /// Number of client requests forwarded. + int forwardedClient = 0; -/** - * - * Provides information on Glacier2 sessions. - * - **/ -class SessionMetrics extends Metrics -{ - /** - * - * Number of client requests forwared. - * - **/ - int forwardedClient = 0; - - /** - * - * Number of server requests forwared. - * - **/ - int forwardedServer = 0; + /// Number of server requests forwarded. + int forwardedServer = 0; - /** - * - * The size of the routing table. - * - **/ - int routingTableSize = 0; + /// The size of the routing table. + int routingTableSize = 0; - /** - * - * Number of client requests queued. - * - **/ - int queuedClient = 0; + /// Number of client requests queued. + int queuedClient = 0; - /** - * - * Number of server requests queued. - * - **/ - int queuedServer = 0; + /// Number of server requests queued. + int queuedServer = 0; - /** - * - * Number of client requests overridden. - * - **/ - int overriddenClient = 0; - - /** - * - * Number of server requests overridden. - * - **/ - int overriddenServer = 0; -} + /// Number of client requests overridden. + int overriddenClient = 0; + /// Number of server requests overridden. + int overriddenServer = 0; + } } diff --git a/slice/Glacier2/PermissionsVerifier.ice b/slice/Glacier2/PermissionsVerifier.ice index 3a7adefd088..6637cbd33a6 100644 --- a/slice/Glacier2/PermissionsVerifier.ice +++ b/slice/Glacier2/PermissionsVerifier.ice @@ -26,86 +26,43 @@ ["objc:prefix:GLACIER2"] module Glacier2 { + /// This exception is raised if a client is denied the ability to create a session with the router. + ["preserve-slice"] + exception PermissionDeniedException + { + /// The reason why permission was denied. + string reason; + } -/** - * - * This exception is raised if a client is denied the ability to create - * a session with the router. - * - **/ -["preserve-slice"] -exception PermissionDeniedException -{ - /** - * - * The reason why permission was denied. - * - **/ - string reason; -} - -/** - * - * The Glacier2 permissions verifier. This is called through the - * process of establishing a session. - * - * @see Router - * - **/ -interface PermissionsVerifier -{ - /** - * - * Check whether a user has permission to access the router. - * - * @param userId The user id for which to check permission. - * - * @param password The user's password. - * - * @param reason The reason why access was denied. - * - * @return True if access is granted, or false otherwise. - * - * @throws PermissionDeniedException Raised if the user access is - * denied. This can be raised in place of returning false with a - * reason set in the reason out parameter. - * - **/ - ["nonmutating", "cpp:const", "format:sliced"] - idempotent bool checkPermissions(string userId, string password, out string reason) - throws PermissionDeniedException; -} - -/** - * - * The SSL Glacier2 permissions verifier. This is called through the - * process of establishing a session. - * - * @see Router - * - **/ -interface SSLPermissionsVerifier -{ - /** - * - * Check whether a user has permission to access the router. - * - * @param info The SSL information. - * - * @param reason The reason why access was denied. - * - * @return True if access is granted, or false otherwise. - * - * @throws PermissionDeniedException Raised if the user access is - * denied. This can be raised in place of returning false with a - * reason set in the reason out parameter. - * - * @see SSLInfo - * - **/ - ["nonmutating", "cpp:const", "format:sliced"] - idempotent bool authorize(SSLInfo info, out string reason) - throws PermissionDeniedException; -} + /// The Glacier2 permissions verifier. This is called through the process of establishing a session. + /// @see Router + interface PermissionsVerifier + { + /// Check whether a user has permission to access the router. + /// @param userId The user id for which to check permission. + /// @param password The user's password. + /// @param reason The reason why access was denied. + /// @return True if access is granted, or false otherwise. + /// @throws PermissionDeniedException Raised if the user access is denied. This can be raised in place of + /// returning false with a reason set in the reason out parameter. + ["nonmutating", "cpp:const", "format:sliced"] + idempotent bool checkPermissions(string userId, string password, out string reason) + throws PermissionDeniedException; + } + /// The SSL Glacier2 permissions verifier. This is called through the process of establishing a session. + /// @see Router + interface SSLPermissionsVerifier + { + /// Check whether a user has permission to access the router. + /// @param info The SSL information. + /// @param reason The reason why access was denied. + /// @return True if access is granted, or false otherwise. + /// @throws PermissionDeniedException Raised if the user access is denied. This can be raised in place of + /// returning false with a reason set in the reason out parameter. + /// @see SSLInfo + ["nonmutating", "cpp:const", "format:sliced"] + idempotent bool authorize(SSLInfo info, out string reason) + throws PermissionDeniedException; + } } diff --git a/slice/Glacier2/Router.ice b/slice/Glacier2/Router.ice index e8c70967c1f..3083a45c903 100644 --- a/slice/Glacier2/Router.ice +++ b/slice/Glacier2/Router.ice @@ -25,161 +25,81 @@ [["java:package:com.zeroc"]] #endif -/** - * - * Glacier2 is a firewall solution for Ice. Glacier2 authenticates - * and filters client requests and allows callbacks to the client in a - * secure fashion. In combination with IceSSL, Glacier2 provides a - * security solution that is both non-intrusive and easy to configure. - * - **/ +/// Glacier2 is a firewall solution for Ice. Glacier2 authenticates and filters client requests and allows callbacks to +/// the client in a secure fashion. In combination with IceSSL, Glacier2 provides a security solution that is both +/// non-intrusive and easy to configure. ["objc:prefix:GLACIER2"] module Glacier2 { -/** - * - * This exception is raised if a client tries to destroy a session - * with a router, but no session exists for the client. - * - * @see Router#destroySession - * - **/ +/// This exception is raised if a client tries to destroy a session with a router, but no session exists for the +/// client. +/// @see Router#destroySession exception SessionNotExistException { } -/** - * - * The Glacier2 specialization of the Ice::Router interface. - * - **/ +/// The Glacier2 specialization of the Ice::Router interface. interface Router extends Ice::Router { - /** - * - * This category must be used in the identities of all of the client's - * callback objects. This is necessary in order for the router to - * forward callback requests to the intended client. If the Glacier2 - * server endpoints are not set, the returned category is an empty - * string. - * - * @return The category. - * - **/ + /// This category must be used in the identities of all of the client's callback objects. This is necessary in + /// order for the router to forward callback requests to the intended client. If the Glacier2 server endpoints + /// are not set, the returned category is an empty string. + /// @return The category. ["nonmutating", "cpp:const"] idempotent string getCategoryForClient(); - /** - * - * Create a per-client session with the router. If a - * {@link SessionManager} has been installed, a proxy to a {@link Session} - * object is returned to the client. Otherwise, null is returned - * and only an internal session (i.e., not visible to the client) - * is created. - * - * If a session proxy is returned, it must be configured to route - * through the router that created it. This will happen automatically - * if the router is configured as the client's default router at the - * time the session proxy is created in the client process, otherwise - * the client must configure the session proxy explicitly. - * - * @see Session - * @see SessionManager - * @see PermissionsVerifier - * - * @return A proxy for the newly created session, or null if no - * {@link SessionManager} has been installed. - * - * @param userId The user id for which to check the password. - * - * @param password The password for the given user id. - * - * @throws PermissionDeniedException Raised if the password for - * the given user id is not correct, or if the user is not allowed - * access. - * - * @throws CannotCreateSessionException Raised if the session - * cannot be created. - * - **/ + /// Create a per-client session with the router. If a {@link SessionManager} has been installed, a proxy to a + /// {@link Session} object is returned to the client. Otherwise, null is returned and only an internal session + /// (i.e., not visible to the client) is created. + /// If a session proxy is returned, it must be configured to route through the router that created it. This will + /// happen automatically if the router is configured as the client's default router at the time the session proxy + /// is created in the client process, otherwise the client must configure the session proxy explicitly. + /// @param userId The user id for which to check the password. + /// @param password The password for the given user id. + /// @return A proxy for the newly created session, or null if no {@link SessionManager} has been installed. + /// @throws PermissionDeniedException Raised if the password for the given user id is not correct, or if the user + /// is not allowed access. + /// @throws CannotCreateSessionException Raised if the session cannot be created. + /// @see Session + /// @see SessionManager + /// @see PermissionsVerifier ["amd", "format:sliced"] Session* createSession(string userId, string password) throws PermissionDeniedException, CannotCreateSessionException; - /** - * - * Create a per-client session with the router. The user is - * authenticated through the SSL certificates that have been - * associated with the connection. If a {@link SessionManager} has been - * installed, a proxy to a {@link Session} object is returned to the - * client. Otherwise, null is returned and only an internal - * session (i.e., not visible to the client) is created. - * - * If a session proxy is returned, it must be configured to route - * through the router that created it. This will happen automatically - * if the router is configured as the client's default router at the - * time the session proxy is created in the client process, otherwise - * the client must configure the session proxy explicitly. - * - * @see Session - * @see SessionManager - * @see PermissionsVerifier - * - * @return A proxy for the newly created session, or null if no - * {@link SessionManager} has been installed. - * - * @throws PermissionDeniedException Raised if the user cannot be - * authenticated or if the user is not allowed access. - * - * @throws CannotCreateSessionException Raised if the session - * cannot be created. - * - **/ + /// Create a per-client session with the router. The user is authenticated through the SSL certificates that have + /// been associated with the connection. If a {@link SessionManager} has been installed, a proxy to a + /// {@link Session} object is returned to the client. Otherwise, null is returned and only an internal session + /// (i.e., not visible to the client) is created. + /// If a session proxy is returned, it must be configured to route through the router that created it. This will + /// happen automatically if the router is configured as the client's default router at the time the session proxy + /// is created in the client process, otherwise the client must configure the session proxy explicitly. + /// @see Session + /// @see SessionManager + /// @see PermissionsVerifier + /// @return A proxy for the newly created session, or null if no {@link SessionManager} has been installed. + /// @throws PermissionDeniedException Raised if the user cannot be authenticated or if the user is not allowed + /// access. + /// @throws CannotCreateSessionException Raised if the session cannot be created. ["amd", "format:sliced"] Session* createSessionFromSecureConnection() throws PermissionDeniedException, CannotCreateSessionException; - /** - * - * Keep the calling client's session with this router alive. - * - * @throws SessionNotExistException Raised if no session exists - * for the calling client. - * - **/ + /// Keep the calling client's session with this router alive. + /// @throws SessionNotExistException Raised if no session exists for the calling client. ["amd"] void refreshSession() throws SessionNotExistException; - /** - * - * Destroy the calling client's session with this router. - * - * @throws SessionNotExistException Raised if no session exists - * for the calling client. - * - **/ + /// Destroy the calling client's session with this router. + /// @throws SessionNotExistException Raised if no session exists for the calling client. void destroySession() throws SessionNotExistException; - /** - * - * Get the value of the session timeout. Sessions are destroyed - * if they see no activity for this period of time. - * - * @return The timeout (in seconds). - * - **/ + /// Get the value of the session timeout. Sessions are destroyed if they see no activity for this period of time. + /// @return The timeout (in seconds). ["nonmutating", "cpp:const"] idempotent long getSessionTimeout(); - /** - * - * Get the value of the ACM timeout. Clients supporting connection - * heartbeats can enable them instead of explicitly sending keep - * alives requests. - * - * NOTE: This method is only available since Ice 3.6. - * - * @return The timeout (in seconds). - * - **/ + /// Get the value of the ACM timeout. Clients supporting connection heartbeats can enable them instead of + /// explicitly sending keep alives requests. This method is only available since Ice 3.6. + /// @return The timeout (in seconds). ["nonmutating", "cpp:const"] idempotent int getACMTimeout(); } diff --git a/slice/Glacier2/SSLInfo.ice b/slice/Glacier2/SSLInfo.ice index 66db60d168d..ed8243ba686 100644 --- a/slice/Glacier2/SSLInfo.ice +++ b/slice/Glacier2/SSLInfo.ice @@ -26,34 +26,26 @@ ["objc:prefix:GLACIER2"] module Glacier2 { + /// Information taken from an SSL connection used for permissions verification. + /// @see PermissionsVerifier + struct SSLInfo + { + /// The remote host. + string remoteHost; -/** - * - * Information taken from an SSL connection used for permissions - * verification. - * - * @see PermissionsVerifier - * - */ -struct SSLInfo -{ - /** The remote host. */ - string remoteHost; - - /** The remote port. */ - int remotePort; + /// The remote port. + int remotePort; - /** The router's host. */ - string localHost; + /// The router's host. + string localHost; - /** The router's port. */ - int localPort; + /// The router's port. + int localPort; - /** The negotiated cipher suite. */ - string cipher; - - /** The certificate chain. */ - Ice::StringSeq certs; -} + /// The negotiated cipher suite. + string cipher; + /// The certificate chain. + Ice::StringSeq certs; + } } diff --git a/slice/Glacier2/Session.ice b/slice/Glacier2/Session.ice index 294e4d50667..6c7ac562816 100644 --- a/slice/Glacier2/Session.ice +++ b/slice/Glacier2/Session.ice @@ -28,247 +28,119 @@ ["objc:prefix:GLACIER2"] module Glacier2 { - -/** - * - * This exception is raised if an attempt to create a new session failed. - * - **/ -["preserve-slice"] -exception CannotCreateSessionException -{ - /** - * - * The reason why session creation has failed. - * - **/ - string reason; -} - -/** - * - * A client-visible session object, which is tied to the lifecycle of a {@link Router}. - * - * @see Router - * @see SessionManager - * - **/ -interface Session -{ - /** - * - * Destroy the session. This is called automatically when the router is destroyed. - * - **/ - void destroy(); -} - -/** - * - * An object for managing the set of identity constraints for specific - * parts of object identity on a - * {@link Session}. - * - * @see Session - * @see SessionControl - * - **/ -interface StringSet -{ - /** - * - * Add a sequence of strings to this set of constraints. Order is - * not preserved and duplicates are implicitly removed. - * - * @param additions The sequence of strings to be added. - * - **/ - idempotent void add(Ice::StringSeq additions); - - /** - * - * Remove a sequence of strings from this set of constraints. No - * errors are returned if an entry is not found. - * - * @param deletions The sequence of strings to be removed. - * - **/ - idempotent void remove(Ice::StringSeq deletions); - - /** - * - * Returns a sequence of strings describing the constraints in this - * set. - * - * @return The sequence of strings for this set. - * - **/ - idempotent Ice::StringSeq get(); -} - -/** - * - * An object for managing the set of object identity constraints on a - * {@link Session}. - * - * @see Session - * @see SessionControl - * - **/ -interface IdentitySet -{ - /** - * - * Add a sequence of Ice identities to this set of constraints. Order is - * not preserved and duplicates are implicitly removed. - * - * @param additions The sequence of Ice identities to be added. - * - **/ - idempotent void add(Ice::IdentitySeq additions); - - /** - * - * Remove a sequence of identities from this set of constraints. No - * errors are returned if an entry is not found. - * - * @param deletions The sequence of Ice identities to be removed. - * - **/ - idempotent void remove(Ice::IdentitySeq deletions); - - /** - * - * Returns a sequence of identities describing the constraints in this - * set. - * - * @return The sequence of Ice identities for this set. - * - **/ - idempotent Ice::IdentitySeq get(); -} - -/** - * - * An administrative session control object, which is tied to the - * lifecycle of a {@link Session}. - * - * @see Session - * - **/ -interface SessionControl -{ - /** - * - * Access the object that manages the allowable categories - * for object identities for this session. - * - * @return A StringSet object. - * - **/ - StringSet* categories(); - - /** - * - * Access the object that manages the allowable adapter identities - * for objects for this session. - * - * @return A StringSet object. - * - **/ - StringSet* adapterIds(); - - /** - * - * Access the object that manages the allowable object identities - * for this session. - * - * @return An IdentitySet object. - * - **/ - IdentitySet* identities(); - - /** - * - * Get the session timeout. - * - * @return The timeout. - * - **/ - idempotent int getSessionTimeout(); - - /** - * - * Destroy the associated session. - * - **/ - void destroy(); -} - -/** - * - * The session manager for username/password authenticated users that - * is responsible for managing {@link Session} objects. New session objects - * are created by the {@link Router} object calling on an application-provided - * session manager. If no session manager is provided by the application, - * no client-visible sessions are passed to the client. - * - * @see Router - * @see Session - * - **/ -interface SessionManager -{ - /** - * - * Create a new session. - * - * @param userId The user id for the session. - * - * @param control A proxy to the session control object. - * - * @return A proxy to the newly created session. - * - * @throws CannotCreateSessionException Raised if the session - * cannot be created. - * - **/ - ["format:sliced"] - Session* create(string userId, SessionControl* control) - throws CannotCreateSessionException; -} - -/** - * - * The session manager for SSL authenticated users that is - * responsible for managing {@link Session} objects. New session objects are - * created by the {@link Router} object calling on an application-provided - * session manager. If no session manager is provided by the - * application, no client-visible sessions are passed to the client. - * - * @see Router - * @see Session - * - **/ -interface SSLSessionManager -{ - /** - * - * Create a new session. - * - * @param info The SSL info. - * - * @param control A proxy to the session control object. - * - * @return A proxy to the newly created session. - * - * @throws CannotCreateSessionException Raised if the session - * cannot be created. - * - **/ - ["format:sliced"] - Session* create(SSLInfo info, SessionControl* control) - throws CannotCreateSessionException; -} - + /// This exception is raised if an attempt to create a new session failed. + ["preserve-slice"] + exception CannotCreateSessionException + { + /// The reason why session creation has failed. + string reason; + } + + /// A client-visible session object, which is tied to the lifecycle of a {@link Router}. + /// @see Router + /// @see SessionManager + interface Session + { + /// Destroy the session. This is called automatically when the router is destroyed. + void destroy(); + } + + /// An object for managing the set of identity constraints for specific parts of object identity on a + /// {@link Session}. + /// @see Session + /// @see SessionControl + interface StringSet + { + /// Add a sequence of strings to this set of constraints. Order is not preserved and duplicates are implicitly + /// removed. + /// @param additions The sequence of strings to be added. + idempotent void add(Ice::StringSeq additions); + + /// Remove a sequence of strings from this set of constraints. No errors are returned if an entry is not found. + /// @param deletions The sequence of strings to be removed. + idempotent void remove(Ice::StringSeq deletions); + + /// Returns a sequence of strings describing the constraints in this set. + /// @return The sequence of strings for this set. + idempotent Ice::StringSeq get(); + } + + /// An object for managing the set of object identity constraints on a {@link Session}. + /// @see Session + /// @see SessionControl + interface IdentitySet + { + /// Add a sequence of Ice identities to this set of constraints. Order is not preserved and duplicates are + /// implicitly removed. + /// @param additions The sequence of Ice identities to be added. + idempotent void add(Ice::IdentitySeq additions); + + /// Remove a sequence of identities from this set of constraints. No errors are returned if an entry is not + /// found. + /// @param deletions The sequence of Ice identities to be removed. + idempotent void remove(Ice::IdentitySeq deletions); + + /// Returns a sequence of identities describing the constraints in this set. + /// @return The sequence of Ice identities for this set. + idempotent Ice::IdentitySeq get(); + } + + /// An administrative session control object, which is tied to the lifecycle of a {@link Session}. + /// @see Session + interface SessionControl + { + /// Access the object that manages the allowable categories for object identities for this session. + /// @return A StringSet object. + StringSet* categories(); + + /// Access the object that manages the allowable adapter identities for objects for this session. + /// @return A StringSet object. + StringSet* adapterIds(); + + /// Access the object that manages the allowable object identities for this session. + /// @return An IdentitySet object. + IdentitySet* identities(); + + /// Get the session timeout. + /// @return The timeout. + idempotent int getSessionTimeout(); + + /// Destroy the associated session. + void destroy(); + } + + /// The session manager for username/password authenticated users that is responsible for managing {@link Session} + /// objects. New session objects are created by the {@link Router} object calling on an application-provided + /// session manager. If no session manager is provided by the application, no client-visible sessions are passed to + /// the client. + /// @see Router + /// @see Session + interface SessionManager + { + /// Create a new session. + /// @param userId The user id for the session. + /// @param control A proxy to the session control object. + /// @return A proxy to the newly created session. + /// @throws CannotCreateSessionException Raised if the session cannot be created. + ["format:sliced"] + Session* create(string userId, SessionControl* control) + throws CannotCreateSessionException; + } + + /// The session manager for SSL authenticated users that is responsible for managing {@link Session} objects. New + /// session objects are created by the {@link Router} object calling on an application-provided session manager. If + /// no session manager is provided by the application, no client-visible sessions are passed to the client. + /// @see Router + /// @see Session + interface SSLSessionManager + { + /// Create a new session. + /// @param info The SSL info. + /// @param control A proxy to the session control object. + /// @return A proxy to the newly created session. + /// @throws CannotCreateSessionException Raised if the session cannot be created. + ["format:sliced"] + Session* create(SSLInfo info, SessionControl* control) + throws CannotCreateSessionException; + } } diff --git a/slice/Ice/BuiltinSequences.ice b/slice/Ice/BuiltinSequences.ice index 982fad80193..5f375688d53 100644 --- a/slice/Ice/BuiltinSequences.ice +++ b/slice/Ice/BuiltinSequences.ice @@ -25,35 +25,33 @@ ["objc:prefix:ICE"] module Ice { + /// A sequence of bools. + sequence BoolSeq; -/** A sequence of bools. **/ -sequence BoolSeq; + /// A sequence of bytes. + sequence ByteSeq; -/** A sequence of bytes. **/ -sequence ByteSeq; + /// A sequence of shorts. + sequence ShortSeq; -/** A sequence of shorts. **/ -sequence ShortSeq; + /// A sequence of ints. + sequence IntSeq; -/** A sequence of ints. **/ -sequence IntSeq; + /// A sequence of longs. + sequence LongSeq; -/** A sequence of longs. **/ -sequence LongSeq; + /// A sequence of floats. + sequence FloatSeq; -/** A sequence of floats. **/ -sequence FloatSeq; + /// A sequence of doubles. + sequence DoubleSeq; -/** A sequence of doubles. **/ -sequence DoubleSeq; + /// A sequence of strings. + sequence StringSeq; -/** A sequence of strings. **/ -sequence StringSeq; - -/** A sequence of objects. **/ -sequence ObjectSeq; - -/** A sequence of object proxies. **/ -sequence ObjectProxySeq; + /// A sequence of objects. + sequence ObjectSeq; + /// A sequence of object proxies. + sequence ObjectProxySeq; } diff --git a/slice/Ice/Communicator.ice b/slice/Ice/Communicator.ice index 14dfe6fbe43..b8b98bbe19b 100644 --- a/slice/Ice/Communicator.ice +++ b/slice/Ice/Communicator.ice @@ -32,15 +32,9 @@ #include #include -/** - * - * The Ice core library. Among many other features, the Ice core - * library manages all the communication tasks using an efficient - * protocol (including protocol compression and support for both TCP - * and UDP), provides a thread pool for multi-threaded servers, and - * additional functionality that supports high scalability. - * - **/ +/// The Ice core library. Among many other features, the Ice core library manages all the communication tasks using an +/// efficient protocol (including protocol compression and support for both TCP and UDP), provides a thread pool for +/// multi-threaded servers, and additional functionality that supports high scalability. #ifndef __SLICE2JAVA_COMPAT__ [["java:package:com.zeroc"]] #endif @@ -49,18 +43,12 @@ module Ice { -/** - * - * The central object in Ice. One or more communicators can be - * instantiated for an Ice application. Communicator instantiation - * is language-specific, and not specified in Slice code. - * - * @see Logger - * @see ObjectAdapter - * @see Properties - * @see ValueFactory - * - **/ +/// The central object in Ice. One or more communicators can be instantiated for an Ice application. Communicator +/// instantiation is language-specific, and not specified in Slice code. +/// @see Logger +/// @see ObjectAdapter +/// @see Properties +/// @see ValueFactory ["clr:implements:global::System.IDisposable", "java:implements:java.lang.AutoCloseable"] #if !defined(__SLICE2PHP__) && !defined(__SLICE2MATLAB__) @@ -68,573 +56,295 @@ local interface Communicator { #ifdef __SLICE2JAVA__ - /** - * - * Destroy the communicator. This Java-only method overrides close in - * java.lang.AutoCloseable and does not throw any exception. - * - * @see #destroy - * - **/ + /// Destroy the communicator. This Java-only method overrides close in java.lang.AutoCloseable and does not throw + /// any exception. + /// @see #destroy void close(); #endif - /** - * - * Destroy the communicator. This operation calls {@link #shutdown} - * implicitly. Calling {@link #destroy} cleans up memory, and shuts down - * this communicator's client functionality and destroys all object - * adapters. Subsequent calls to {@link #destroy} are ignored. - * - * @see #shutdown - * @see ObjectAdapter#destroy - * - **/ + /// Destroy the communicator. This operation calls {@link #shutdown} implicitly. Calling {@link #destroy} cleans up + /// memory, and shuts down this communicator's client functionality and destroys all object adapters. Subsequent + /// calls to {@link #destroy} are ignored. + /// @see #shutdown + /// @see ObjectAdapter#destroy ["cpp:noexcept", "swift:noexcept", "js:async"] void destroy(); - /** - * - * Shuts down this communicator's server functionality, which - * includes the deactivation of all object adapters. Attempts to use a - * deactivated object adapter raise ObjectAdapterDeactivatedException. - * Subsequent calls to shutdown are ignored. - * - * After shutdown returns, no new requests are processed. However, requests - * that have been started before shutdown was called might still be active. - * You can use {@link #waitForShutdown} to wait for the completion of all - * requests. - * - * @see #destroy - * @see #waitForShutdown - * @see ObjectAdapter#deactivate - * - **/ + /// Shuts down this communicator's server functionality, which includes the deactivation of all object adapters. + /// Attempts to use a deactivated object adapter raise ObjectAdapterDeactivatedException. Subsequent calls to + /// shutdown are ignored. + /// After shutdown returns, no new requests are processed. However, requests that have been started before shutdown + /// was called might still be active. You can use {@link #waitForShutdown} to wait for the completion of all + /// requests. + /// @see #destroy + /// @see #waitForShutdown + /// @see ObjectAdapter#deactivate ["cpp:noexcept", "swift:noexcept", "js:async"] void shutdown(); - /** - * - * Wait until the application has called {@link #shutdown} (or {@link #destroy}). - * On the server side, this operation blocks the calling thread - * until all currently-executing operations have completed. - * On the client side, the operation simply blocks until another - * thread has called {@link #shutdown} or {@link #destroy}. - * - * A typical use of this operation is to call it from the main thread, - * which then waits until some other thread calls {@link #shutdown}. - * After shut-down is complete, the main thread returns and can do some - * cleanup work before it finally calls {@link #destroy} to shut down - * the client functionality, and then exits the application. - * - * @see #shutdown - * @see #destroy - * @see ObjectAdapter#waitForDeactivate - * - **/ + /// Wait until the application has called {@link #shutdown} (or {@link #destroy}). On the server side, this + /// operation blocks the calling thread until all currently-executing operations have completed. On the client + /// side, the operation simply blocks until another thread has called {@link #shutdown} or {@link #destroy}. + /// A typical use of this operation is to call it from the main thread, which then waits until some other thread + /// calls {@link #shutdown}. After shut-down is complete, the main thread returns and can do some cleanup work + /// before it finally calls {@link #destroy} to shut down the client functionality, and then exits the application. + /// @see #shutdown + /// @see #destroy + /// @see ObjectAdapter#waitForDeactivate ["cpp:noexcept", "swift:noexcept", "js:async"] void waitForShutdown(); - /** - * - * Check whether communicator has been shut down. - * - * @return True if the communicator has been shut down; false otherwise. - * - * @see #shutdown - * - **/ + /// Check whether communicator has been shut down. + /// @return True if the communicator has been shut down; false otherwise. + /// @see #shutdown ["cpp:const", "cpp:noexcept", "swift:noexcept"] bool isShutdown(); - /** - * - * Convert a stringified proxy into a proxy. For example, - * MyCategory/MyObject:tcp -h some_host -p - * 10000 creates a proxy that refers to the Ice object - * having an identity with a name "MyObject" and a category - * "MyCategory", with the server running on host "some_host", port - * 10000. If the stringified proxy does not parse correctly, the - * operation throws one of ProxyParseException, EndpointParseException, - * or IdentityParseException. Refer to the Ice manual for a detailed - * description of the syntax supported by stringified proxies. - * - * @param str The stringified proxy to convert into a proxy. - * - * @return The proxy, or nil if str is an empty string. - * - * @see #proxyToString - * - **/ + /// Convert a stringified proxy into a proxy. + /// For example, MyCategory/MyObject:tcp -h some_host -p 10000 creates a proxy that refers to the Ice + /// object having an identity with a name "MyObject" and a category "MyCategory", with the server running on host + /// "some_host", port 10000. If the stringified proxy does not parse correctly, the operation throws one of + /// ProxyParseException, EndpointParseException, or IdentityParseException. Refer to the Ice manual for a detailed + /// description of the syntax supported by stringified proxies. + /// @param str The stringified proxy to convert into a proxy. + /// @return The proxy, or nil if str is an empty string. + /// @see #proxyToString ["cpp:const"] Object* stringToProxy(string str); - /** - * - * Convert a proxy into a string. - * - * @param obj The proxy to convert into a stringified proxy. - * - * @return The stringified proxy, or an empty string if - * obj is nil. - * - * @see #stringToProxy - * - **/ + /// Convert a proxy into a string. + /// @param obj The proxy to convert into a stringified proxy. + /// @return The stringified proxy, or an empty string if + /// obj is nil. + /// @see #stringToProxy ["cpp:const", "swift:noexcept"] string proxyToString(Object* obj); - /** - * - * Convert a set of proxy properties into a proxy. The "base" - * name supplied in the property argument refers to a - * property containing a stringified proxy, such as - * MyProxy=id:tcp -h localhost -p 10000. Additional - * properties configure local settings for the proxy, such as - * MyProxy.PreferSecure=1. The "Properties" - * appendix in the Ice manual describes each of the supported - * proxy properties. - * - * @param property The base property name. - * - * @return The proxy. - * - **/ + /// Convert a set of proxy properties into a proxy. The "base" name supplied in the property argument + /// refers to a property containing a stringified proxy, such as MyProxy=id:tcp -h localhost -p 10000. + /// Additional properties configure local settings for the proxy, such as MyProxy.PreferSecure=1. The + /// "Properties" appendix in the Ice manual describes each of the supported proxy properties. + /// @param property The base property name. + /// @return The proxy. ["cpp:const"] Object* propertyToProxy(string property); - /** - * - * Convert a proxy to a set of proxy properties. - * - * @param proxy The proxy. - * - * @param property The base property name. - * - * @return The property set. - * - **/ + /// Convert a proxy to a set of proxy properties. + /// @param proxy The proxy. + /// @param property The base property name. + /// @return The property set. ["cpp:const", "swift:noexcept"] PropertyDict proxyToProperty(["swift:nonnull"] Object* proxy, string property); #ifndef __SLICE2SWIFT__ - /** - * - * Convert a string into an identity. If the string does not parse - * correctly, the operation throws IdentityParseException. - * - * @param str The string to convert into an identity. - * - * @return The identity. - * - * @see #identityToString - * - **/ + /// Convert a string into an identity. If the string does not parse correctly, the operation throws + /// IdentityParseException. + /// @param str The string to convert into an identity. + /// @return The identity. + /// @see #identityToString ["cpp:const", "deprecate:stringToIdentity() is deprecated, use the static stringToIdentity() method instead."] Identity stringToIdentity(string str); #endif - /** - * - * Convert an identity into a string. - * - * @param ident The identity to convert into a string. - * - * @return The "stringified" identity. - * - * @see #stringToIdentity - * - **/ + /// Convert an identity into a string. + /// @param ident The identity to convert into a string. + /// @return The "stringified" identity. + /// @see #stringToIdentity ["cpp:const", "swift:noexcept"] string identityToString(Identity ident); - /** - * - * Create a new object adapter. The endpoints for the object - * adapter are taken from the property name.Endpoints. - * - * It is legal to create an object adapter with the empty string as - * its name. Such an object adapter is accessible via bidirectional - * connections or by collocated invocations that originate from the - * same communicator as is used by the adapter. - * - * Attempts to create a named object adapter for which no configuration - * can be found raise InitializationException. - * - * @param name The object adapter name. - * - * @return The new object adapter. - * - * @see #createObjectAdapterWithEndpoints - * @see ObjectAdapter - * @see Properties - * - **/ + /// Create a new object adapter. The endpoints for the object adapter are taken from the property + /// name.Endpoints. + /// It is legal to create an object adapter with the empty string as its name. Such an object adapter is accessible + /// via bidirectional connections or by collocated invocations that originate from the same communicator as is used + /// by the adapter. Attempts to create a named object adapter for which no configuration can be found raise + /// InitializationException. + /// @param name The object adapter name. + /// @return The new object adapter. + /// @see #createObjectAdapterWithEndpoints + /// @see ObjectAdapter + /// @see Properties ["js:async", "swift:nonnull"] ObjectAdapter createObjectAdapter(string name); - /** - * - * Create a new object adapter with endpoints. This operation sets - * the property name.Endpoints, and then calls - * {@link #createObjectAdapter}. It is provided as a convenience - * function. - * - * Calling this operation with an empty name will result in a - * UUID being generated for the name. - * - * @param name The object adapter name. - * - * @param endpoints The endpoints for the object adapter. - * - * @return The new object adapter. - * - * @see #createObjectAdapter - * @see ObjectAdapter - * @see Properties - * - **/ + /// Create a new object adapter with endpoints. This operation sets the property + /// name.Endpoints, and then calls {@link #createObjectAdapter}. It is provided as a + /// convenience function. Calling this operation with an empty name will result in a UUID being generated for the + /// name. + /// @param name The object adapter name. + /// @param endpoints The endpoints for the object adapter. + /// @return The new object adapter. + /// @see #createObjectAdapter + /// @see ObjectAdapter + /// @see Properties ["js:async", "swift:nonnull"] ObjectAdapter createObjectAdapterWithEndpoints(string name, string endpoints); - /** - * - * Create a new object adapter with a router. This operation - * creates a routed object adapter. - * - * Calling this operation with an empty name will result in a - * UUID being generated for the name. - * - * @param name The object adapter name. - * - * @param rtr The router. - * - * @return The new object adapter. - * - * @see #createObjectAdapter - * @see ObjectAdapter - * @see Properties - * - **/ + /// Create a new object adapter with a router. This operation creates a routed object adapter. + /// Calling this operation with an empty name will result in a UUID being generated for the name. + /// @param name The object adapter name. + /// @param rtr The router. + /// @return The new object adapter. + /// @see #createObjectAdapter + /// @see ObjectAdapter + /// @see Properties ["js:async", "swift:nonnull"] ObjectAdapter createObjectAdapterWithRouter(string name, ["objc:param:router", "swift:nonnull"] Router* rtr); #if !defined(__SLICE2SWIFT__) - /** - * - * Add an object factory to this communicator. Installing a - * factory with an id for which a factory is already registered - * throws AlreadyRegisteredException. - * - * When unmarshaling an Ice object, the Ice run time reads the - * most-derived type id off the wire and attempts to create an - * instance of the type using a factory. If no instance is created, - * either because no factory was found, or because all factories - * returned nil, the behavior of the Ice run time depends on the - * format with which the object was marshaled: - * - * If the object uses the "sliced" format, Ice ascends the class - * hierarchy until it finds a type that is recognized by a factory, - * or it reaches the least-derived type. If no factory is found that - * can create an instance, the run time throws NoValueFactoryException. - * - * If the object uses the "compact" format, Ice immediately raises - * NoValueFactoryException. - * - * The following order is used to locate a factory for a type: - * - *
    - * - *
  1. The Ice run-time looks for a factory registered - * specifically for the type.
  2. - * - *
  3. If no instance has been created, the Ice run-time looks - * for the default factory, which is registered with an empty type id. - *
  4. - * - *
  5. If no instance has been created by any of the preceding - * steps, the Ice run-time looks for a factory that may have been - * statically generated by the language mapping for non-abstract classes. - *
  6. - * - *
- * - * @param factory The factory to add. - * - * @param id The type id for which the factory can create instances, or - * an empty string for the default factory. - * - * @see #findObjectFactory - * @see ObjectFactory - * @see ValueFactoryManager#add - * - **/ + /// Add an object factory to this communicator. Installing a factory with an id for which a factory is already + /// registered throws AlreadyRegisteredException. + /// When unmarshaling an Ice object, the Ice run time reads the most-derived type id off the wire and attempts to + /// create an instance of the type using a factory. If no instance is created, either because no factory was found, + /// or because all factories returned nil, the behavior of the Ice run time depends on the format with which the + /// object was marshaled: + /// If the object uses the "sliced" format, Ice ascends the class hierarchy until it finds a type that is + /// recognized by a factory, or it reaches the least-derived type. If no factory is found that can create an + /// instance, the run time throws NoValueFactoryException. + /// If the object uses the "compact" format, Ice immediately raises NoValueFactoryException. + /// The following order is used to locate a factory for a type: + ///
    + ///
  1. The Ice run-time looks for a factory registered specifically for the type.
  2. + ///
  3. If no instance has been created, the Ice run-time looks for the default factory, which is registered with + /// an empty type id.
  4. + ///
  5. If no instance has been created by any of the preceding steps, the Ice run-time looks for a factory that + /// may have been statically generated by the language mapping for non-abstract classes.
  6. + ///
+ /// @param factory The factory to add. + /// @param id The type id for which the factory can create instances, or an empty string for the default factory. + /// @see #findObjectFactory + /// @see ObjectFactory + /// @see ValueFactoryManager#add ["deprecate:addObjectFactory() is deprecated, use ValueFactoryManager::add() instead."] void addObjectFactory(ObjectFactory factory, ["objc:param:sliceId"] string id); - /** - * - * Find an object factory registered with this communicator. - * - * @param id The type id for which the factory can create instances, - * or an empty string for the default factory. - * - * @return The object factory, or null if no object factory was - * found for the given id. - * - * @see #addObjectFactory - * @see ObjectFactory - * @see ValueFactoryManager#find - * - **/ + /// Find an object factory registered with this communicator. + /// @param id The type id for which the factory can create instances, or an empty string for the default factory. + /// @return The object factory, or null if no object factory was found for the given id. + /// @see #addObjectFactory + /// @see ObjectFactory + /// @see ValueFactoryManager#find ["cpp:const", "cpp:noexcept", "deprecate:findObjectFactory() is deprecated, use ValueFactoryManager::find() instead."] ObjectFactory findObjectFactory(string id); #endif - /** - * Get the implicit context associated with this communicator. - * - * @return The implicit context associated with this communicator; - * returns null when the property Ice.ImplicitContext is not set - * or is set to None. - * - **/ + /// Get the implicit context associated with this communicator. + /// @return The implicit context associated with this communicator; returns null when the property Ice.ImplicitContext + /// is not set or is set to None. ["cpp:const", "cpp:noexcept", "swift:noexcept", "swift:nonnull"] ImplicitContext getImplicitContext(); - /** - * - * Get the properties for this communicator. - * - * @return This communicator's properties. - * - * @see Properties - * - **/ + /// Get the properties for this communicator. + /// @return This communicator's properties. + /// @see Properties ["cpp:const", "cpp:noexcept", "swift:noexcept", "swift:nonnull"] Properties getProperties(); - /** - * - * Get the logger for this communicator. - * - * @return This communicator's logger. - * - * @see Logger - * - **/ + /// Get the logger for this communicator. + /// @return This communicator's logger. + /// @see Logger ["cpp:const", "cpp:noexcept", "swift:noexcept", "swift:nonnull"] Logger getLogger(); #if !defined(__SLICE2SWIFT__) && !defined(__SLICE2JS__) - /** - * - * Get the observer resolver object for this communicator. - * - * @return This communicator's observer resolver object. - * - **/ + /// Get the observer resolver object for this communicator. + /// @return This communicator's observer resolver object. ["cpp:const", "cpp:noexcept"] Instrumentation::CommunicatorObserver getObserver(); #endif - /** - * - * Get the default router this communicator. - * - * @return The default router for this communicator. - * - * @see #setDefaultRouter - * @see Router - * - **/ + /// Get the default router for this communicator. + /// @return The default router for this communicator. + /// @see #setDefaultRouter + /// @see Router ["cpp:const", "swift:noexcept"] Router* getDefaultRouter(); - /** - * - * Set a default router for this communicator. All newly - * created proxies will use this default router. To disable the - * default router, null can be used. Note that this - * operation has no effect on existing proxies. - * - * You can also set a router for an individual proxy - * by calling the operation ice_router on the proxy. - * - * @param rtr The default router to use for this communicator. - * - * @see #getDefaultRouter - * @see #createObjectAdapterWithRouter - * @see Router - * - **/ + /// Set a default router for this communicator. All newly created proxies will use this default router. To disable + /// the default router, null can be used. Note that this operation has no effect on existing proxies. + /// You can also set a router for an individual proxy by calling the operation ice_router on the + /// proxy. + /// @param rtr The default router to use for this communicator. + /// @see #getDefaultRouter + /// @see #createObjectAdapterWithRouter + /// @see Router ["swift:noexcept"] void setDefaultRouter(Router* rtr); - /** - * - * Get the default locator this communicator. - * - * @return The default locator for this communicator. - * - * @see #setDefaultLocator - * @see Locator - * - **/ + /// Get the default locator for this communicator. + /// @return The default locator for this communicator. + /// @see #setDefaultLocator + /// @see Locator ["cpp:const", "swift:noexcept"] Locator* getDefaultLocator(); - /** - * - * Set a default Ice locator for this communicator. All newly - * created proxy and object adapters will use this default - * locator. To disable the default locator, null can be used. - * Note that this operation has no effect on existing proxies or - * object adapters. - * - * You can also set a locator for an individual proxy by calling the - * operation ice_locator on the proxy, or for an object adapter - * by calling {@link ObjectAdapter#setLocator} on the object adapter. - * - * @param loc The default locator to use for this communicator. - * - * @see #getDefaultLocator - * @see Locator - * @see ObjectAdapter#setLocator - * - **/ + /// Set a default Ice locator for this communicator. All newly created proxy and object adapters will use this + /// default locator. To disable the default locator, null can be used. Note that this operation has no effect on + /// existing proxies or object adapters. + /// You can also set a locator for an individual proxy by calling the operation ice_locator on the + /// proxy, or for an object adapter by calling {@link ObjectAdapter#setLocator} on the object adapter. + /// @param loc The default locator to use for this communicator. + /// @see #getDefaultLocator + /// @see Locator + /// @see ObjectAdapter#setLocator ["swift:noexcept"] void setDefaultLocator(Locator* loc); #if !defined(__SLICE2SWIFT__) && !defined(__SLICE2JS__) - /** - * - * Get the plug-in manager for this communicator. - * - * @return This communicator's plug-in manager. - * - * @see PluginManager - * - **/ + /// Get the plug-in manager for this communicator. + /// @return This communicator's plug-in manager. + /// @see PluginManager ["cpp:const"] PluginManager getPluginManager(); #endif - /** - * - * Get the value factory manager for this communicator. - * - * @return This communicator's value factory manager. - * - * @see ValueFactoryManager - * - **/ + /// Get the value factory manager for this communicator. + /// @return This communicator's value factory manager. + /// @see ValueFactoryManager ["cpp:const", "cpp:noexcept", "swift:noexcept", "swift:nonnull"] ValueFactoryManager getValueFactoryManager(); - /** - * - * Flush any pending batch requests for this communicator. - * This means all batch requests invoked on fixed proxies - * for all connections associated with the communicator. - * Any errors that occur while flushing a connection are ignored. - * - * @param compress Specifies whether or not the queued batch requests - * should be compressed before being sent over the wire. - * - **/ + /// Flush any pending batch requests for this communicator. This means all batch requests invoked on fixed proxies + /// for all connections associated with the communicator. Any errors that occur while flushing a connection are + /// ignored. + /// @param compress Specifies whether or not the queued batch requests should be compressed before being sent over + /// the wire. ["async-oneway"] void flushBatchRequests(CompressBatch compress); #ifndef __SLICE2JS__ - /** - * - * Add the Admin object with all its facets to the provided object adapter. - * If Ice.Admin.ServerId is set and the provided object adapter has a {@link Locator}, - * createAdmin registers the Admin's Process facet with the {@link Locator}'s {@link LocatorRegistry}. - * - * createAdmin must only be called once; subsequent calls raise InitializationException. - * - * @param adminAdapter The object adapter used to host the Admin object; if null and - * Ice.Admin.Endpoints is set, create, activate and use the Ice.Admin object adapter. - * - * @param adminId The identity of the Admin object. - * - * @return A proxy to the main ("") facet of the Admin object. Never returns a null proxy. - * - * @see #getAdmin - * - **/ + /// Add the Admin object with all its facets to the provided object adapter. If Ice.Admin.ServerId is + /// set and the provided object adapter has a {@link Locator}, createAdmin registers the Admin's Process facet with + /// the {@link Locator}'s {@link LocatorRegistry}. createAdmin must only be called once; subsequent calls raise + /// InitializationException. + /// @param adminAdapter The object adapter used to host the Admin object; if null and Ice.Admin.Endpoints is set, + /// create, activate and use the Ice.Admin object adapter. + /// @param adminId The identity of the Admin object. + /// @return A proxy to the main ("") facet of the Admin object. Never returns a null proxy. + /// @see #getAdmin ["swift:nonnull"] Object* createAdmin(ObjectAdapter adminAdapter, Identity adminId); - /** - * - * Get a proxy to the main facet of the Admin object. - * - * getAdmin also creates the Admin object and creates and activates the Ice.Admin object - * adapter to host this Admin object if Ice.Admin.Enpoints is set. The identity of the Admin - * object created by getAdmin is {value of Ice.Admin.InstanceName}/admin, or {UUID}/admin - * when Ice.Admin.InstanceName is not set. - * - * If Ice.Admin.DelayCreation is 0 or not set, getAdmin is called by the communicator - * initialization, after initialization of all plugins. - * - * @return A proxy to the main ("") facet of the Admin object, or a null proxy if no - * Admin object is configured. - * - * @see #createAdmin - **/ + /// Get a proxy to the main facet of the Admin object. getAdmin also creates the Admin object and creates and + /// activates the Ice.Admin object adapter to host this Admin object if Ice.Admin.Enpoints is set. The identity of + /// the Admin object created by getAdmin is {value of Ice.Admin.InstanceName}/admin, or {UUID}/admin when + /// Ice.Admin.InstanceName is not set. If Ice.Admin.DelayCreation is 0 or not set, getAdmin is called + /// by the communicator initialization, after initialization of all plugins. + /// @return A proxy to the main ("") facet of the Admin object, or a null proxy if no Admin object is configured. + /// @see #createAdmin ["cpp:const"] Object* getAdmin(); - /** - * - * Add a new facet to the Admin object. - * Adding a servant with a facet that is already registered - * throws AlreadyRegisteredException. - * - * @param servant The servant that implements the new Admin facet. - * @param facet The name of the new Admin facet. - * - **/ + /// Add a new facet to the Admin object. Adding a servant with a facet that is already registered throws + /// AlreadyRegisteredException. + /// @param servant The servant that implements the new Admin facet. + /// @param facet The name of the new Admin facet. void addAdminFacet(["swift:nonnull"] Object servant, string facet); - /** - * - * Remove the following facet to the Admin object. - * Removing a facet that was not previously registered throws - * NotRegisteredException. - * - * @param facet The name of the Admin facet. - * @return The servant associated with this Admin facet. - * - **/ + /// Remove the following facet to the Admin object. Removing a facet that was not previously registered throws + /// NotRegisteredException. + /// @param facet The name of the Admin facet. + /// @return The servant associated with this Admin facet. ["swift:nonnull", "swift:attribute:@discardableResult"] Object removeAdminFacet(string facet); - /** - * - * Returns a facet of the Admin object. - * - * @param facet The name of the Admin facet. - * @return The servant associated with this Admin facet, or - * null if no facet is registered with the given name. - * - **/ + /// Returns a facet of the Admin object. + /// @param facet The name of the Admin facet. + /// @return The servant associated with this Admin facet, or null if no facet is registered with the given name. ["swift:noexcept"] Object findAdminFacet(string facet); - /** - * - * Returns a map of all facets of the Admin object. - * - * @return A collection containing all the facet names and - * servants of the Admin object. - * - * @see #findAdminFacet - * - **/ + /// Returns a map of all facets of the Admin object. + /// @return A collection containing all the facet names and servants of the Admin object. + /// @see #findAdminFacet ["swift:noexcept"] FacetMap findAllAdminFacets(); #endif #if defined(__SLICE2SWIFT__) || defined(ICE_SWIFT) - /** - * - * Returns the client dispatch queue. - * - * @return The dispatch queue associated wih this Communicator's - * client thread pool. - * - **/ + /// Returns the client dispatch queue. + /// @return The dispatch queue associated wih this Communicator's client thread pool. ["cpp:const", "swift:nonnull", "cpp:type:dispatch_queue_t", "swift:type:Dispatch.DispatchQueue"] LocalObject getClientDispatchQueue(); - /** - * - * Returns the server dispatch queue. - * - * @return The dispatch queue associated wih the Communicator's - * server thread pool. - * - **/ + /// Returns the server dispatch queue. + /// @return The dispatch queue associated wih the Communicator's server thread pool. ["cpp:const", "swift:nonnull", "cpp:type:dispatch_queue_t", "swift:type:Dispatch.DispatchQueue"] LocalObject getServerDispatchQueue(); #endif @@ -642,34 +352,23 @@ local interface Communicator #endif -/** - * The output mode for xxxToString method such as identityToString and proxyToString. - * The actual encoding format for the string is the same for all modes: you - * don't need to specify an encoding format or mode when reading such a string. - * - **/ +/// The output mode for xxxToString method such as identityToString and proxyToString. The actual encoding format for +/// the string is the same for all modes: you don't need to specify an encoding format or mode when reading such a +/// string. local enum ToStringMode { - /** - * Characters with ordinal values greater than 127 are kept as-is in the resulting string. - * Non-printable ASCII characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) - * or \\unnnn. - **/ + /// Characters with ordinal values greater than 127 are kept as-is in the resulting string. Non-printable ASCII + /// characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or \\unnnn. Unicode, - /** - * Characters with ordinal values greater than 127 are encoded as universal character names in - * the resulting string: \\unnnn for BMP characters and \\Unnnnnnnn for non-BMP characters. - * Non-printable ASCII characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) - * or \\unnnn. - **/ + /// Characters with ordinal values greater than 127 are encoded as universal character names in the resulting + /// string: \\unnnn for BMP characters and \\Unnnnnnnn for non-BMP characters. Non-printable ASCII characters + /// with ordinal values 127 and below are encoded as \\t, \\n (etc.) or \\unnnn. ASCII, - /** - * Characters with ordinal values greater than 127 are encoded as a sequence of UTF-8 bytes using - * octal escapes. Characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or - * an octal escape. Use this mode to generate strings compatible with Ice 3.6 and earlier. - **/ + /// Characters with ordinal values greater than 127 are encoded as a sequence of UTF-8 bytes using octal escapes. + /// Characters with ordinal values 127 and below are encoded as \\t, \\n (etc.) or an octal escape. Use this mode + /// to generate strings compatible with Ice 3.6 and earlier. Compat } diff --git a/slice/Ice/Connection.ice b/slice/Ice/Connection.ice index 10acc37411b..02aa0d788c5 100644 --- a/slice/Ice/Connection.ice +++ b/slice/Ice/Connection.ice @@ -30,484 +30,263 @@ module Ice { -/** - * The batch compression option when flushing queued batch requests. - * - **/ +/// The batch compression option when flushing queued batch requests. ["cpp:scoped", "objc:scoped"] local enum CompressBatch { - /** - * Compress the batch requests. - **/ + /// Compress the batch requests. Yes, - /** - * Don't compress the batch requests. - **/ + /// Don't compress the batch requests. No, - /** - * Compress the batch requests if at least one request was - * made on a compressed proxy. - **/ + /// Compress the batch requests if at least one request was made on a compressed proxy. BasedOnProxy } #if !defined(__SLICE2PHP__) && !defined(__SLICE2MATLAB__) -/** - * - * Base class providing access to the connection details. - * - **/ +/// Base class providing access to the connection details. local class ConnectionInfo { - /** - * - * The information of the underyling transport or null if there's - * no underlying transport. - * - **/ + /// The information of the underyling transport or null if there's no underlying transport. ConnectionInfo underlying; - /** - * - * Whether or not the connection is an incoming or outgoing - * connection. - * - **/ + /// Whether or not the connection is an incoming or outgoing connection. bool incoming; - /** - * - * The name of the adapter associated with the connection. - * - **/ + /// The name of the adapter associated with the connection. string adapterName; - /** - * - * The connection id. - * - **/ + /// The connection id. string connectionId; } #endif local interface Connection; -/** - * - * An application can implement this interface to receive notifications when - * a connection closes. - * - * @see Connection#setCloseCallback - * - **/ +/// An application can implement this interface to receive notifications when a connection closes. +/// @see Connection#setCloseCallback ["delegate"] local interface CloseCallback { - /** - * - * This method is called by the connection when the connection is - * closed. If the callback needs more information about the closure, - * it can call {@link Connection#throwException}. - * - * @param con The connection that closed. - **/ + /// This method is called by the connection when the connection is closed. If the callback needs more information + /// about the closure, it can call {@link Connection#throwException}. + /// @param con The connection that closed. ["swift:noexcept"] void closed(Connection con); } -/** - * - * An application can implement this interface to receive notifications when - * a connection receives a heartbeat message. - * - * @see Connection#setHeartbeatCallback - * - **/ +/// An application can implement this interface to receive notifications when a connection receives a heartbeat +/// message. +/// @see Connection#setHeartbeatCallback ["delegate"] local interface HeartbeatCallback { - /** - * - * This method is called by the connection when a heartbeat is - * received from the peer. - * - * @param con The connection on which a heartbeat was received. - **/ + /// This method is called by the connection when a heartbeat is received from the peer. + /// @param con The connection on which a heartbeat was received. ["swift:noexcept"] void heartbeat(Connection con); } -/** - * Specifies the close semantics for Active Connection Management. - */ +/// Specifies the close semantics for Active Connection Management. local enum ACMClose { - /** Disables automatic connection closure. */ + /// Disables automatic connection closure. CloseOff, - /** Gracefully closes a connection that has been idle for the configured timeout period. */ + /// Gracefully closes a connection that has been idle for the configured timeout period. CloseOnIdle, - /** - * Forcefully closes a connection that has been idle for the configured timeout period, - * but only if the connection has pending invocations. - */ + /// Forcefully closes a connection that has been idle for the configured timeout period, but only if the connection + /// has pending invocations. CloseOnInvocation, - /** Combines the behaviors of CloseOnIdle and CloseOnInvocation. */ + /// Combines the behaviors of CloseOnIdle and CloseOnInvocation. CloseOnInvocationAndIdle, - /** - * Forcefully closes a connection that has been idle for the configured timeout period, - * regardless of whether the connection has pending invocations or dispatch. - */ + /// Forcefully closes a connection that has been idle for the configured timeout period, regardless of whether the + /// connection has pending invocations or dispatch. CloseOnIdleForceful } -/** - * Specifies the heartbeat semantics for Active Connection Management. - */ +/// Specifies the heartbeat semantics for Active Connection Management. local enum ACMHeartbeat { - /** Disables heartbeats. */ + /// Disables heartbeats. HeartbeatOff, - /** Send a heartbeat at regular intervals if the connection is idle and only if there are pending dispatch. */ + /// Send a heartbeat at regular intervals if the connection is idle and only if there are pending dispatch. HeartbeatOnDispatch, - /** Send a heartbeat at regular intervals when the connection is idle. */ + /// Send a heartbeat at regular intervals when the connection is idle. HeartbeatOnIdle, - /** Send a heartbeat at regular intervals until the connection is closed. */ + /// Send a heartbeat at regular intervals until the connection is closed. HeartbeatAlways } -/** - * A collection of Active Connection Management configuration settings. - */ +/// A collection of Active Connection Management configuration settings. local struct ACM { - /** A timeout value in seconds. */ + /// A timeout value in seconds. int timeout; - /** The close semantics. */ + /// The close semantics. ACMClose close; - /** The heartbeat semantics. */ + /// The heartbeat semantics. ACMHeartbeat heartbeat; } -/** - * Determines the behavior when manually closing a connection. - **/ +/// Determines the behavior when manually closing a connection. ["cpp:scoped", "objc:scoped"] local enum ConnectionClose { - /** - * Close the connection immediately without sending a close connection protocol message to the peer - * and waiting for the peer to acknowledge it. - **/ + /// Close the connection immediately without sending a close connection protocol message to the peer and waiting + /// for the peer to acknowledge it. Forcefully, - /** - * Close the connection by notifying the peer but do not wait for pending outgoing invocations to complete. - * On the server side, the connection will not be closed until all incoming invocations have completed. - **/ + /// Close the connection by notifying the peer but do not wait for pending outgoing invocations to complete. On the + /// server side, the connection will not be closed until all incoming invocations have completed. Gracefully, - /** - * Wait for all pending invocations to complete before closing the connection. - **/ + /// Wait for all pending invocations to complete before closing the connection. GracefullyWithWait } #if !defined(__SLICE2PHP__) && !defined(__SLICE2MATLAB__) -/** - * - * The user-level interface to a connection. - * - **/ +/// The user-level interface to a connection. ["swift:inherits:Swift.CustomStringConvertible"] local interface Connection { - /** - * - * Manually close the connection using the specified closure mode. - * - * @param mode Determines how the connection will be closed. - * - * @see ConnectionClose - **/ + /// Manually close the connection using the specified closure mode. + /// @param mode Determines how the connection will be closed. + /// @see ConnectionClose ["cpp:noexcept", "js:async"] void close(ConnectionClose mode); - /** - * - * Create a special proxy that always uses this connection. This - * can be used for callbacks from a server to a client if the - * server cannot directly establish a connection to the client, - * for example because of firewalls. In this case, the server - * would create a proxy using an already established connection - * from the client. - * - * @param id The identity for which a proxy is to be created. - * - * @return A proxy that matches the given identity and uses this - * connection. - * - * @see #setAdapter - **/ + /// Create a special proxy that always uses this connection. This can be used for callbacks from a server to a + /// client if the server cannot directly establish a connection to the client, for example because of firewalls. In + /// this case, the server would create a proxy using an already established connection from the client. + /// @param id The identity for which a proxy is to be created. + /// @return A proxy that matches the given identity and uses this connection. + /// @see #setAdapter ["cpp:const", "swift:nonnull"] Object* createProxy(Identity id); - /** - * - * Explicitly set an object adapter that dispatches requests that - * are received over this connection. A client can invoke an - * operation on a server using a proxy, and then set an object - * adapter for the outgoing connection that is used by the proxy - * in order to receive callbacks. This is useful if the server - * cannot establish a connection back to the client, for example - * because of firewalls. - * - * @param adapter The object adapter that should be used by this - * connection to dispatch requests. The object adapter must be - * activated. When the object adapter is deactivated, it is - * automatically removed from the connection. Attempts to use a - * deactivated object adapter raise {@link ObjectAdapterDeactivatedException} - * - * @see #createProxy - * @see #getAdapter - * - **/ + /// Explicitly set an object adapter that dispatches requests that are received over this connection. A client can + /// invoke an operation on a server using a proxy, and then set an object adapter for the outgoing connection that + /// is used by the proxy in order to receive callbacks. This is useful if the server cannot establish a connection + /// back to the client, for example because of firewalls. + /// @param adapter The object adapter that should be used by this connection to dispatch requests. The object + /// adapter must be activated. When the object adapter is deactivated, it is automatically removed from the + /// connection. Attempts to use a deactivated object adapter raise {@link ObjectAdapterDeactivatedException} + /// @see #createProxy + /// @see #getAdapter void setAdapter(ObjectAdapter adapter); - /** - * - * Get the object adapter that dispatches requests for this - * connection. - * - * @return The object adapter that dispatches requests for the - * connection, or null if no adapter is set. - * - * @see #setAdapter - * - **/ + /// Get the object adapter that dispatches requests for this connection. + /// @return The object adapter that dispatches requests for the connection, or null if no adapter is set. + /// @see #setAdapter ["cpp:const", "cpp:noexcept", "swift:noexcept"] ObjectAdapter getAdapter(); - /** - * - * Get the endpoint from which the connection was created. - * - * @return The endpoint from which the connection was created. - * - **/ + /// Get the endpoint from which the connection was created. + /// @return The endpoint from which the connection was created. ["cpp:const", "cpp:noexcept", "swift:noexcept", "swift:nonnull"] Endpoint getEndpoint(); - /** - * - * Flush any pending batch requests for this connection. - * This means all batch requests invoked on fixed proxies - * associated with the connection. - * - * @param compress Specifies whether or not the queued batch requests - * should be compressed before being sent over the wire. - * - **/ + /// Flush any pending batch requests for this connection. This means all batch requests invoked on fixed proxies + /// associated with the connection. + /// @param compress Specifies whether or not the queued batch requests should be compressed before being sent over + /// the wire. ["async-oneway"] void flushBatchRequests(CompressBatch compress); - /** - * - * Set a close callback on the connection. The callback is called by the - * connection when it's closed. The callback is called from the - * Ice thread pool associated with the connection. If the callback needs - * more information about the closure, it can call {@link Connection#throwException}. - * - * @param callback The close callback object. - * - **/ + /// Set a close callback on the connection. The callback is called by the connection when it's closed. The callback + /// is called from the Ice thread pool associated with the connection. If the callback needs more information about + /// the closure, it can call {@link Connection#throwException}. + /// @param callback The close callback object. void setCloseCallback(CloseCallback callback); - /** - * - * Set a heartbeat callback on the connection. The callback is called by the - * connection when a heartbeat is received. The callback is called - * from the Ice thread pool associated with the connection. - * - * @param callback The heartbeat callback object. - * - **/ + /// Set a heartbeat callback on the connection. The callback is called by the connection when a heartbeat is + /// received. The callback is called from the Ice thread pool associated with the connection. + /// @param callback The heartbeat callback object. ["swift:noexcept"] void setHeartbeatCallback(HeartbeatCallback callback); - /** - * - * Send a heartbeat message. - * - **/ + /// Send a heartbeat message. ["async-oneway"] void heartbeat(); - /** - * - * Set the active connection management parameters. - * - * @param timeout The timeout value in seconds, must be >= 0. - * - * @param close The close condition - * - * @param heartbeat The hertbeat condition - * - **/ + /// Set the active connection management parameters. + /// @param timeout The timeout value in seconds, must be >= 0. + /// @param close The close condition + /// @param heartbeat The hertbeat condition ["swift:noexcept", "java:optional"] void setACM(optional(1) int timeout, optional(2) ACMClose close, optional(3) ACMHeartbeat heartbeat); - /** - * - * Get the ACM parameters. - * - * @return The ACM parameters. - * - **/ + /// Get the ACM parameters. + /// @return The ACM parameters. ["cpp:noexcept", "swift:noexcept"] ACM getACM(); - /** - * - * Return the connection type. This corresponds to the endpoint - * type, i.e., "tcp", "udp", etc. - * - * @return The type of the connection. - * - **/ + /// Return the connection type. This corresponds to the endpoint type, i.e., "tcp", "udp", etc. + /// @return The type of the connection. ["cpp:const", "cpp:noexcept", "swift:noexcept"] string type(); - /** - * - * Get the timeout for the connection. - * - * @return The connection's timeout. - * - **/ + /// Get the timeout for the connection. + /// @return The connection's timeout. ["cpp:const", "cpp:noexcept", "swift:noexcept"] int timeout(); - /** - * - * Return a description of the connection as human readable text, - * suitable for logging or error messages. - * - * @return The description of the connection as human readable - * text. - * - **/ + /// Return a description of the connection as human readable text, suitable for logging or error messages. + /// @return The description of the connection as human readable text. ["cpp:const", "cpp:noexcept", "swift:noexcept"] string toString(); - /** - * - * Returns the connection information. - * - * @return The connection information. - * - **/ + /// Returns the connection information. + /// @return The connection information. ["cpp:const", "swift:nonnull"] ConnectionInfo getInfo(); - /** - * - * Set the connection buffer receive/send size. - * - * @param rcvSize The connection receive buffer size. - * @param sndSize The connection send buffer size. - * - **/ + /// Set the connection buffer receive/send size. + /// @param rcvSize The connection receive buffer size. + /// @param sndSize The connection send buffer size. void setBufferSize(int rcvSize, int sndSize); - /** - * - * Throw an exception indicating the reason for connection closure. For example, - * {@link CloseConnectionException} is raised if the connection was closed gracefully, - * whereas {@link ConnectionManuallyClosedException} is raised if the connection was - * manually closed by the application. This operation does nothing if the connection is - * not yet closed. - * - **/ + /// Throw an exception indicating the reason for connection closure. For example, + /// {@link CloseConnectionException} is raised if the connection was closed gracefully, whereas + /// {@link ConnectionManuallyClosedException} is raised if the connection was manually closed by + /// the application. This operation does nothing if the connection is not yet closed. ["cpp:const"] void throwException(); } -/** - * - * Provides access to the connection details of an IP connection - * - **/ +/// Provides access to the connection details of an IP connection local class IPConnectionInfo extends ConnectionInfo { - /** The local address. */ + /// The local address. string localAddress = ""; - /** The local port. */ + /// The local port. int localPort = -1; - /** The remote address. */ + /// The remote address. string remoteAddress = ""; - /** The remote port. */ + /// The remote port. int remotePort = -1; } -/** - * - * Provides access to the connection details of a TCP connection - * - **/ +/// Provides access to the connection details of a TCP connection local class TCPConnectionInfo extends IPConnectionInfo { - /** - * - * The connection buffer receive size. - * - **/ + /// The connection buffer receive size. int rcvSize = 0; - /** - * - * The connection buffer send size. - * - **/ + /// The connection buffer send size. int sndSize = 0; } -/** - * - * Provides access to the connection details of a UDP connection - * - **/ +/// Provides access to the connection details of a UDP connection local class UDPConnectionInfo extends IPConnectionInfo { - /** - * - * The multicast address. - * - **/ + /// The multicast address. string mcastAddress; - /** - * - * The multicast port. - * - **/ + /// The multicast port. int mcastPort = -1; - /** - * - * The connection buffer receive size. - * - **/ + /// The connection buffer receive size. int rcvSize = 0; - /** - * - * The connection buffer send size. - * - **/ + /// The connection buffer send size. int sndSize = 0; } -/** A collection of HTTP headers. */ +/// A collection of HTTP headers. dictionary HeaderDict; -/** - * - * Provides access to the connection details of a WebSocket connection - * - **/ +/// Provides access to the connection details of a WebSocket connection local class WSConnectionInfo extends ConnectionInfo { - /** The headers from the HTTP upgrade request. */ + /// The headers from the HTTP upgrade request. HeaderDict headers; } diff --git a/slice/Ice/Current.ice b/slice/Ice/Current.ice index bef2208073a..fe980766b7d 100644 --- a/slice/Ice/Current.ice +++ b/slice/Ice/Current.ice @@ -31,139 +31,70 @@ module Ice { -/** - * - * A request context. Context is used to transmit metadata about a - * request from the server to the client, such as Quality-of-Service - * (QoS) parameters. Each operation on the client has a Context as - * its implicit final parameter. - * - **/ +/// A request context. Context is used to transmit metadata about a request from the server to the client, +/// such as Quality-of-Service (QoS) parameters. Each operation on the client has a Context as its +/// implicit final parameter. dictionary Context; -/** - * - * Determines the retry behavior an invocation in case of a (potentially) recoverable error. - * - **/ -// -// Note: The order of definitions here *must* match the order of -// definitions for ::Slice::Operation::Mode in include/Slice/Parser.h! -// +// Note: The order of definitions here *must* match the order of definitions for ::Slice::Operation::Mode in +// include/Slice/Parser.h! + +/// Determines the retry behavior an invocation in case of a (potentially) recoverable error. enum OperationMode { - /** - * Ordinary operations have Normal mode. These operations - * modify object state; invoking such an operation twice in a row - * has different semantics than invoking it once. The Ice run time - * guarantees that it will not violate at-most-once semantics for - * Normal operations. - */ + /// Ordinary operations have Normal mode. These operations modify object state; invoking such an + /// operation twice in a row has different semantics than invoking it once. The Ice run time guarantees that it + /// will not violate at-most-once semantics for Normal operations. Normal, - /** - * Operations that use the Slice nonmutating keyword must not - * modify object state. For C++, nonmutating operations generate - * const member functions in the skeleton. In addition, the Ice - * run time will attempt to transparently recover from certain - * run-time errors by re-issuing a failed request and propagate - * the failure to the application only if the second attempt - * fails. - * - *

Nonmutating is deprecated; Use the - * idempotent keyword instead. For C++, to retain the mapping - * of nonmutating operations to C++ const - * member functions, use the ["cpp:const"] metadata - * directive. - */ + /// Operations that use the Slice nonmutating keyword must not modify object state. For C++, + /// nonmutating operations generate const member functions in the skeleton. In addition, the Ice + /// run time will attempt to transparently recover from certain run-time errors by re-issuing a failed request and + /// propagate the failure to the application only if the second attempt fails. + ///

Nonmutating is deprecated; Use the idempotent keyword instead. + /// For C++, to retain the mapping of nonmutating operations to C++ const member + /// functions, use the ["cpp:const"] metadata directive. \Nonmutating, - /** - * Operations that use the Slice idempotent keyword can modify - * object state, but invoking an operation twice in a row must - * result in the same object state as invoking it once. For - * example, x = 1 is an idempotent statement, - * whereas x += 1 is not. For idempotent - * operations, the Ice run-time uses the same retry behavior - * as for nonmutating operations in case of a potentially - * recoverable error. - */ + /// Operations that use the Slice idempotent keyword can modify object state, but invoking an + /// operation twice in a row must result in the same object state as invoking it once. For example, + /// x = 1 is an idempotent statement, whereas x += 1 is not. For idempotent operations, + /// the Ice run-time uses the same retry behavior as for nonmutating operations in case of a potentially + /// recoverable error. \Idempotent } -/** - * - * Information about the current method invocation for servers. Each - * operation on the server has a Current as its implicit final - * parameter. Current is mostly used for Ice services. Most - * applications ignore this parameter. - * - **/ +/// Information about the current method invocation for servers. Each operation on the server has a +/// Current as its implicit final parameter. Current is mostly used for Ice services. Most +/// applications ignore this parameter. local struct Current { - /** - * - * The object adapter. - * - **/ + /// The object adapter. ObjectAdapter adapter; - /** - * - * Information about the connection over which the current method - * invocation was received. If the invocation is direct due to - * collocation optimization, this value is set to null. - * - **/ + /// Information about the connection over which the current method invocation was received. If the invocation is + /// direct due to collocation optimization, this value is set to null. Connection con; - /** - * - * The Ice object identity. - * - **/ + /// The Ice object identity. Identity id; - /** - * - * The facet. - * - ***/ + /// The facet. string facet; - /** - * - * The operation name. - * - **/ + /// The operation name. string operation; - /** - * - * The mode of the operation. - * - **/ + /// The mode of the operation. OperationMode mode; - /** - * - * The request context, as received from the client. - * - **/ + /// The request context, as received from the client. Context ctx; - /** - * - * The request id unless oneway (0). - * - **/ + /// The request id unless oneway (0). int requestId; - /** - * - * The encoding version used to encode the input and output parameters. - * - **/ + /// The encoding version used to encode the input and output parameters. EncodingVersion encoding; } diff --git a/slice/Ice/Endpoint.ice b/slice/Ice/Endpoint.ice index 05504b2fb72..43b9a9d1195 100644 --- a/slice/Ice/Endpoint.ice +++ b/slice/Ice/Endpoint.ice @@ -30,259 +30,118 @@ module Ice { -/** - * - * Uniquely identifies TCP endpoints. - * - **/ +/// Uniquely identifies TCP endpoints. const short TCPEndpointType = 1; -/** - * - * Uniquely identifies SSL endpoints. - * - **/ +/// Uniquely identifies SSL endpoints. const short SSLEndpointType = 2; -/** - * - * Uniquely identifies UDP endpoints. - * - **/ +/// Uniquely identifies UDP endpoints. const short UDPEndpointType = 3; -/** - * - * Uniquely identifies TCP-based WebSocket endpoints. - * - **/ +/// Uniquely identifies TCP-based WebSocket endpoints. const short WSEndpointType = 4; -/** - * - * Uniquely identifies SSL-based WebSocket endpoints. - * - **/ +/// Uniquely identifies SSL-based WebSocket endpoints. const short WSSEndpointType = 5; -/** - * - * Uniquely identifies Bluetooth endpoints. - * - **/ +/// Uniquely identifies Bluetooth endpoints. const short BTEndpointType = 6; -/** - * - * Uniquely identifies SSL Bluetooth endpoints. - * - **/ +/// Uniquely identifies SSL Bluetooth endpoints. const short BTSEndpointType = 7; -/** - * - * Uniquely identifies iAP-based endpoints. - * - **/ +/// Uniquely identifies iAP-based endpoints. const short iAPEndpointType = 8; -/** - * - * Uniquely identifies SSL iAP-based endpoints. - * - **/ +/// Uniquely identifies SSL iAP-based endpoints. const short iAPSEndpointType = 9; #if !defined(__SLICE2PHP__) && !defined(__SLICE2MATLAB__) -/** - * - * Base class providing access to the endpoint details. - * - **/ + +/// Base class providing access to the endpoint details. local class EndpointInfo { - /** - * - * The information of the underyling endpoint of null if there's - * no underlying endpoint. - * - **/ + /// The information of the underyling endpoint or null if there's no underlying endpoint. EndpointInfo underlying; - /** - * - * The timeout for the endpoint in milliseconds. 0 means - * non-blocking, -1 means no timeout. - * - **/ + /// The timeout for the endpoint in milliseconds. 0 means non-blocking, -1 means no timeout. int timeout; - /** - * - * Specifies whether or not compression should be used if - * available when using this endpoint. - * - */ + /// Specifies whether or not compression should be used if available when using this endpoint. bool compress; - /** - * - * Returns the type of the endpoint. - * - * @return The endpoint type. - * - **/ + /// Returns the type of the endpoint. + /// @return The endpoint type. ["cpp:const", "cpp:noexcept", "swift:noexcept"] short type(); - /** - * - * Returns true if this endpoint is a datagram endpoint. - * - * @return True for a datagram endpoint. - * - **/ + /// Returns true if this endpoint is a datagram endpoint. + /// @return True for a datagram endpoint. ["cpp:const", "cpp:noexcept", "swift:noexcept"] bool datagram(); - /** - * - * Returns true if this endpoint is a secure endpoint. - * - * @return True for a secure endpoint. - * - **/ + /// @return True for a secure endpoint. ["cpp:const", "cpp:noexcept", "swift:noexcept"] bool secure(); } -/** - * - * The user-level interface to an endpoint. - * - **/ +/// The user-level interface to an endpoint. ["cpp:comparable", "js:comparable", "swift:inherits:Swift.CustomStringConvertible"] local interface Endpoint { - /** - * - * Return a string representation of the endpoint. - * - * @return The string representation of the endpoint. - * - **/ + /// Return a string representation of the endpoint. + /// @return The string representation of the endpoint. ["cpp:const", "cpp:noexcept", "swift:noexcept"] string toString(); - /** - * - * Returns the endpoint information. - * - * @return The endpoint information class. - * - **/ + /// Returns the endpoint information. + /// @return The endpoint information class. ["cpp:const", "cpp:noexcept", "swift:noexcept"] EndpointInfo getInfo(); } -/** - * - * Provides access to the address details of a IP endpoint. - * - * @see Endpoint - * - **/ +/// Provides access to the address details of a IP endpoint. +/// @see Endpoint local class IPEndpointInfo extends EndpointInfo { - /** - * - * The host or address configured with the endpoint. - * - **/ + /// The host or address configured with the endpoint. string host; - /** - * - * The port number. - * - **/ + /// The port number. int port; - /** - * - * The source IP address. - * - */ + /// The source IP address. string sourceAddress; } -/** - * - * Provides access to a TCP endpoint information. - * - * @see Endpoint - * - **/ +/// Provides access to a TCP endpoint information. +/// @see Endpoint local class TCPEndpointInfo extends IPEndpointInfo { } -/** - * - * Provides access to an UDP endpoint information. - * - * @see Endpoint - * - **/ +/// Provides access to an UDP endpoint information. +/// @see Endpoint local class UDPEndpointInfo extends IPEndpointInfo { - /** - * - * The multicast interface. - * - **/ + /// The multicast interface. string mcastInterface; - /** - * - * The multicast time-to-live (or hops). - * - **/ - int mcastTtl; + /// The multicast time-to-live (or hops). + int mcastTtl; } -/** - * - * Provides access to a WebSocket endpoint information. - * - **/ +/// Provides access to a WebSocket endpoint information. local class WSEndpointInfo extends EndpointInfo { - /** - * - * The URI configured with the endpoint. - * - **/ + /// The URI configured with the endpoint. string resource; } -/** - * - * Provides access to the details of an opaque endpoint. - * - * @see Endpoint - * - **/ +/// Provides access to the details of an opaque endpoint. +/// @see Endpoint local class OpaqueEndpointInfo extends EndpointInfo { - /** - * - * The encoding version of the opaque endpoint (to decode or - * encode the rawBytes). - * - **/ + /// The encoding version of the opaque endpoint (to decode or encode the rawBytes). EncodingVersion rawEncoding; - /** - * - * The raw encoding of the opaque endpoint. - * - **/ + /// The raw encoding of the opaque endpoint. ByteSeq rawBytes; } diff --git a/slice/Ice/EndpointF.ice b/slice/Ice/EndpointF.ice index 841438a876e..6178c16185f 100644 --- a/slice/Ice/EndpointF.ice +++ b/slice/Ice/EndpointF.ice @@ -33,11 +33,7 @@ local class UDPEndpointInfo; local class WSEndpointInfo; local interface Endpoint; -/** - * - * A sequence of endpoints. - * - **/ +/// A sequence of endpoints. ["swift:nonnull"] local sequence EndpointSeq; } diff --git a/slice/Ice/EndpointTypes.ice b/slice/Ice/EndpointTypes.ice index c9382b7e859..05c97901c5d 100644 --- a/slice/Ice/EndpointTypes.ice +++ b/slice/Ice/EndpointTypes.ice @@ -26,22 +26,12 @@ module Ice { -/** - * - * Determines the order in which the Ice run time uses the endpoints - * in a proxy when establishing a connection. - * - **/ +/// Determines the order in which the Ice run time uses the endpoints in a proxy when establishing a connection. local enum EndpointSelectionType { - /** - * Random causes the endpoints to be arranged in a random order. - */ + /// Random causes the endpoints to be arranged in a random order. Random, - /** - * Ordered forces the Ice run time to use the endpoints in the - * order they appeared in the proxy. - */ + /// Ordered forces the Ice run time to use the endpoints in the order they appeared in the proxy. Ordered } diff --git a/slice/Ice/FacetMap.ice b/slice/Ice/FacetMap.ice index 6a6a40fc19b..d5dae48fa39 100644 --- a/slice/Ice/FacetMap.ice +++ b/slice/Ice/FacetMap.ice @@ -26,11 +26,7 @@ module Ice { -/** - * - * A mapping from facet name to servant. - * - **/ +/// A mapping from facet name to servant. local dictionary FacetMap; } diff --git a/slice/Ice/Identity.ice b/slice/Ice/Identity.ice index 71711b2fcda..ef301b71548 100644 --- a/slice/Ice/Identity.ice +++ b/slice/Ice/Identity.ice @@ -26,50 +26,27 @@ module Ice { -/** - * - * The identity of an Ice object. In a proxy, an empty {@link Identity#name} denotes a nil - * proxy. An identity with an empty {@link Identity#name} and a non-empty {@link Identity#category} - * is illegal. You cannot add a servant with an empty name to the Active Servant Map. - * - * @see ServantLocator - * @see ObjectAdapter#addServantLocator - * - **/ +/// The identity of an Ice object. In a proxy, an empty {@link Identity#name} denotes a nil proxy. An identity with an +/// empty {@link Identity#name} and a non-empty {@link Identity#category} is illegal. You cannot add a servant with an +/// empty name to the Active Servant Map. +/// @see ServantLocator +/// @see ObjectAdapter#addServantLocator struct Identity { - /** - * - * The name of the Ice object. - * - **/ + /// The name of the Ice object. string name; - /** - * - * The Ice object category. - * - **/ + /// The Ice object category. string category; } -/** - * - * A mapping between identities and Ice objects. - * - **/ +/// A mapping between identities and Ice objects. #ifndef __SLICE2PHP__ -// // dictionary key type not supported in PHP -// local dictionary ObjectDict; #endif -/** - * - * A sequence of identities. - * - **/ +/// A sequence of identities. sequence IdentitySeq; } diff --git a/slice/Ice/ImplicitContext.ice b/slice/Ice/ImplicitContext.ice index 64161f70f39..00fde6ba13f 100644 --- a/slice/Ice/ImplicitContext.ice +++ b/slice/Ice/ImplicitContext.ice @@ -29,91 +29,54 @@ module Ice { -/** - * - * An interface to associate implict contexts with communicators. - * - * When you make a remote invocation without an explicit context parameter, - * Ice uses the per-proxy context (if any) combined with the ImplicitContext - * associated with the communicator. - * - * Ice provides several implementations of ImplicitContext. The implementation - * used depends on the value of the Ice.ImplicitContext property. - *

- *
None (default)
- *
No implicit context at all.
- *
PerThread
- *
The implementation maintains a context per thread.
- *
Shared
- *
The implementation maintains a single context shared by all threads.
- *
- * - * ImplicitContext also provides a number of operations to create, update or retrieve - * an entry in the underlying context without first retrieving a copy of the entire - * context. These operations correspond to a subset of the java.util.Map methods, - * with java.lang.Object replaced by string and null replaced by the empty-string. - * - **/ +/// An interface to associate implict contexts with communicators. When you make a remote invocation without an +/// explicit context parameter, Ice uses the per-proxy context (if any) combined with the ImplicitContext +/// associated with the communicator. +/// Ice provides several implementations of ImplicitContext. The implementation used depends on the value +/// of the Ice.ImplicitContext property. +///
+///
None (default)
+///
No implicit context at all.
+///
PerThread
+///
The implementation maintains a context per thread.
+///
Shared
+///
The implementation maintains a single context shared by all threads.
+///
+/// ImplicitContext also provides a number of operations to create, update or retrieve an entry in the +/// underlying context without first retrieving a copy of the entire context. These operations correspond to a subset +/// of the java.util.Map methods, with java.lang.Object replaced by string and +/// null replaced by the empty-string. local interface ImplicitContext { - /** - * Get a copy of the underlying context. - * @return A copy of the underlying context. - * - **/ + /// Get a copy of the underlying context. + /// @return A copy of the underlying context. ["cpp:const", "swift:noexcept"] Context getContext(); - /** - * Set the underlying context. - * - * @param newContext The new context. - * - **/ + /// Set the underlying context. + /// @param newContext The new context. ["swift:noexcept"] void setContext(Context newContext); - /** - * Check if this key has an associated value in the underlying context. - * - * @param key The key. - * - * @return True if the key has an associated value, False otherwise. - * - **/ + /// Check if this key has an associated value in the underlying context. + /// @param key The key. + /// @return True if the key has an associated value, False otherwise. ["cpp:const", "swift:noexcept"] bool containsKey(string key); - /** - * Get the value associated with the given key in the underlying context. - * Returns an empty string if no value is associated with the key. - * {@link #containsKey} allows you to distinguish between an empty-string value and - * no value at all. - * - * @param key The key. - * - * @return The value associated with the key. - * - **/ + /// Get the value associated with the given key in the underlying context. Returns an empty string if no value is + /// associated with the key. {@link #containsKey} allows you to distinguish between an empty-string value and no + /// value at all. + /// @param key The key. + /// @return The value associated with the key. ["cpp:const", "swift:noexcept"] string get(string key); - /** - * Create or update a key/value entry in the underlying context. - * - * @param key The key. - * - * @param value The value. - * - * @return The previous value associated with the key, if any. - * - **/ + /// Create or update a key/value entry in the underlying context. + /// @param key The key. + /// @param value The value. + /// @return The previous value associated with the key, if any. ["swift:noexcept"] string put(string key, string \value); - /** - * Remove the entry for the given key in the underlying context. - * - * @param key The key. - * - * @return The value associated with the key, if any. - * - **/ + /// Remove the entry for the given key in the underlying context. + /// @param key The key. + /// @return The value associated with the key, if any. ["swift:noexcept"] string remove(string key); } } diff --git a/slice/Ice/Instrumentation.ice b/slice/Ice/Instrumentation.ice index 6f4bf03fcf2..31f9cc5f148 100644 --- a/slice/Ice/Instrumentation.ice +++ b/slice/Ice/Instrumentation.ice @@ -30,477 +30,224 @@ module Ice { -/** - * - * The Instrumentation local interfaces enable observing a number of - * Ice core internal components (threads, connections, etc). - * - **/ +/// The Instrumentation local interfaces enable observing a number of Ice core internal components (threads, +/// connections, etc). ["objc:prefix:ICEINSTRUMENTATION"] module Instrumentation { -/** - * - * The object observer interface used by instrumented objects to - * notify the observer of their existence. - * - **/ +/// The object observer interface used by instrumented objects to notify the observer of their existence. local interface Observer { - /** - * - * This method is called when the instrumented object is created - * or when the observer is attached to an existing object. - * - **/ + /// This method is called when the instrumented object is created or when the observer is attached to an existing + /// object. void attach(); - /** - * - * This method is called when the instrumented object is destroyed - * and as a result the observer detached from the object. - * - **/ + /// This method is called when the instrumented object is destroyed and as a result the observer detached from the + /// object. void detach(); - /** - * - * Notification of a failure. - * - * @param exceptionName The name of the exception. - * - **/ + /// Notification of a failure. + /// @param exceptionName The name of the exception. void failed(string exceptionName); } -/** - * - * The thread state enumeration keeps track of the different possible - * states of Ice threads. - * - **/ +/// The thread state enumeration keeps track of the different possible states of Ice threads. local enum ThreadState { - /** - * - * The thread is idle. - * - **/ + /// The thread is idle. ThreadStateIdle, - /** - * - * The thread is in use performing reads or writes for Ice - * connections. This state is only for threads from an Ice thread - * pool. - * - **/ + /// The thread is in use performing reads or writes for Ice connections. This state is only for threads from an Ice + /// thread pool. ThreadStateInUseForIO, - /** - * - * The thread is calling user code (servant implementation, AMI - * callbacks). This state is only for threads from an Ice thread - * pool. - * - **/ + /// The thread is calling user code (servant implementation, AMI callbacks). This state is only for threads from an + /// Ice thread pool. ThreadStateInUseForUser, - /** - * - * The thread is performing other internal activities (DNS - * lookups, timer callbacks, etc). - * - **/ + /// The thread is performing other internal activities (DNS lookups, timer callbacks, etc). ThreadStateInUseForOther, } -/** - * - * The thread observer interface to instrument Ice threads. This can - * be threads from the Ice thread pool or utility threads used by the - * Ice core. - * - **/ +/// The thread observer interface to instrument Ice threads. This can be threads from the Ice thread pool or utility +/// threads used by the Ice core. local interface ThreadObserver extends Observer { - /** - * - * Notification of thread state change. - * - * @param oldState The previous thread state. - * - * @param newState The new thread state. - * - **/ + /// Notification of thread state change. + /// @param oldState The previous thread state. + /// @param newState The new thread state. void stateChanged(ThreadState oldState, ThreadState newState); } -/** - * - * The state of an Ice connection. - * - **/ +/// The state of an Ice connection. local enum ConnectionState { - /** - * - * The connection is being validated. - * - **/ + /// The connection is being validated. ConnectionStateValidating, - /** - * - * The connection is holding the reception of new messages. - * - **/ + /// The connection is holding the reception of new messages. ConnectionStateHolding, - /** - * - * The connection is active and can send and receive messages. - * - **/ + /// The connection is active and can send and receive messages. ConnectionStateActive, - /** - * - * The connection is being gracefully shutdown and waits for the - * peer to close its end of the connection. - * - **/ + /// The connection is being gracefully shutdown and waits for the peer to close its end of the connection. ConnectionStateClosing, - /** - * - * The connection is closed and waits for potential dispatch to be - * finished before being destroyed and detached from the observer. - * - **/ + /// The connection is closed and waits for potential dispatch to be finished before being destroyed and detached + /// from the observer. ConnectionStateClosed } -/** - * - * The connection observer interface to instrument Ice connections. - * - **/ +/// The connection observer interface to instrument Ice connections. local interface ConnectionObserver extends Observer { - /** - * - * Notification of sent bytes over the connection. - * - * @param num The number of bytes sent. - * - **/ + /// Notification of sent bytes over the connection. + /// @param num The number of bytes sent. void sentBytes(int num); - /** - * - * Notification of received bytes over the connection. - * - * @param num The number of bytes received. - * - **/ + /// Notification of received bytes over the connection. + /// @param num The number of bytes received. void receivedBytes(int num); } -/** - * - * The dispatch observer to instrument servant dispatch. - * - **/ +/// The dispatch observer to instrument servant dispatch. local interface DispatchObserver extends Observer { - /** - * - * Notification of a user exception. - * - **/ + /// Notification of a user exception. void userException(); - /** - * - * Reply notification. - * - * @param size The size of the reply. - * - **/ + /// Reply notification. + /// @param size The size of the reply. void reply(int size); } -/** - * - * The child invocation observer to instrument remote or collocated - * invocations. - * - **/ +/// The child invocation observer to instrument remote or collocated invocations. local interface ChildInvocationObserver extends Observer { - /** - * - * Reply notification. - * - * @param size The size of the reply. - * - **/ + /// Reply notification. + /// @param size The size of the reply. void reply(int size); } -/** - * - * The remote observer to instrument invocations that are sent over - * the wire. - * - **/ +/// The remote observer to instrument invocations that are sent over the wire. local interface RemoteObserver extends ChildInvocationObserver { } -/** - * - * The collocated observer to instrument invocations that are - * collocated. - * - **/ +/// The collocated observer to instrument invocations that are collocated. local interface CollocatedObserver extends ChildInvocationObserver { } -/** - * - * The invocation observer to instrument invocations on proxies. A - * proxy invocation can either result in a collocated or remote - * invocation. If it results in a remote invocation, a sub-observer is - * requested for the remote invocation. - * - **/ +/// The invocation observer to instrument invocations on proxies. A proxy invocation can either result in a collocated +/// or remote invocation. If it results in a remote invocation, a sub-observer is requested for the remote invocation. local interface InvocationObserver extends Observer { - /** - * - * Notification of the invocation being retried. - * - **/ + /// Notification of the invocation being retried. void retried(); - /** - * - * Notification of a user exception. - * - **/ + /// Notification of a user exception. void userException(); - /** - * - * Get a remote observer for this invocation. - * - * @param con The connection information. - * - * @param endpt The connection endpoint. - * - * @param requestId The ID of the invocation. - * - * @param size The size of the invocation. - * - * @return The observer to instrument the remote invocation. - * - **/ + /// Get a remote observer for this invocation. + /// @param con The connection information. + /// @param endpt The connection endpoint. + /// @param requestId The ID of the invocation. + /// @param size The size of the invocation. + /// @return The observer to instrument the remote invocation. RemoteObserver getRemoteObserver(ConnectionInfo con, Endpoint endpt, int requestId, int size); - /** - * - * Get a collocated observer for this invocation. - * - * @param adapter The object adapter hosting the collocated Ice object. - * - * @param requestId The ID of the invocation. - * - * @param size The size of the invocation. - * - * @return The observer to instrument the collocated invocation. - * - **/ + /// Get a collocated observer for this invocation. + /// @param adapter The object adapter hosting the collocated Ice object. + /// @param requestId The ID of the invocation. + /// @param size The size of the invocation. + /// @return The observer to instrument the collocated invocation. CollocatedObserver getCollocatedObserver(ObjectAdapter adapter, int requestId, int size); } -/** - * - * The observer updater interface. This interface is implemented by - * the Ice run-time and an instance of this interface is provided by - * the Ice communicator on initialization to the - * {@link CommunicatorObserver} object set with the communicator - * initialization data. The Ice communicator calls - * {@link CommunicatorObserver#setObserverUpdater} to provide the observer - * updater. - * - * This interface can be used by add-ins implementing the - * {@link CommunicatorObserver} interface to update the observers of - * connections and threads. - * - **/ +/// The observer updater interface. This interface is implemented by the Ice run-time and an instance of this interface +/// is provided by the Ice communicator on initialization to the {@link CommunicatorObserver} object set with the +/// communicator initialization data. The Ice communicator calls {@link CommunicatorObserver#setObserverUpdater} to +/// provide the observer updater. +/// This interface can be used by add-ins implementing the {@link CommunicatorObserver} interface to update the +/// observers of connections and threads. local interface ObserverUpdater { - /** - * - * Update connection observers associated with each of the Ice - * connection from the communicator and its object adapters. - * - * When called, this method goes through all the connections and - * for each connection {@link CommunicatorObserver#getConnectionObserver} - * is called. The implementation of getConnectionObserver has the - * possibility to return an updated observer if necessary. - * - **/ + /// Update connection observers associated with each of the Ice connection from the communicator and its object + /// adapters. + /// When called, this method goes through all the connections and for each connection + /// {@link CommunicatorObserver#getConnectionObserver} is called. The implementation of getConnectionObserver has + /// the possibility to return an updated observer if necessary. void updateConnectionObservers(); - /** - * - * Update thread observers associated with each of the Ice thread - * from the communicator and its object adapters. - * - * When called, this method goes through all the threads and for - * each thread {@link CommunicatorObserver#getThreadObserver} is - * called. The implementation of getThreadObserver has the - * possibility to return an updated observer if necessary. - * - **/ + /// Update thread observers associated with each of the Ice thread from the communicator and its object adapters. + /// When called, this method goes through all the threads and for each thread + /// {@link CommunicatorObserver#getThreadObserver} is called. The implementation of getThreadObserver has the + /// possibility to return an updated observer if necessary. void updateThreadObservers(); } -/** - * - * The communicator observer interface used by the Ice run-time to - * obtain and update observers for its observable objects. This - * interface should be implemented by add-ins that wish to observe Ice - * objects in order to collect statistics. An instance of this - * interface can be provided to the Ice run-time through the Ice - * communicator initialization data. - * - **/ +/// The communicator observer interface used by the Ice run-time to obtain and update observers for its observable +/// objects. This interface should be implemented by add-ins that wish to observe Ice objects in order to collect +/// statistics. An instance of this interface can be provided to the Ice run-time through the Ice communicator +/// initialization data. local interface CommunicatorObserver { - /** - * - * This method should return an observer for the given endpoint - * information and connector. The Ice run-time calls this method - * for each connection establishment attempt. - * - * @param endpt The endpoint. - * - * @param connector The description of the connector. For IP - * transports, this is typically the IP address to connect to. - * - * @return The observer to instrument the connection establishment. - * - **/ + /// This method should return an observer for the given endpoint information and connector. The Ice run-time calls + /// this method for each connection establishment attempt. + /// @param endpt The endpoint. + /// @param connector The description of the connector. For IP transports, this is typically the IP address to + /// connect to. + /// @return The observer to instrument the connection establishment. Observer getConnectionEstablishmentObserver(Endpoint endpt, string connector); - /** - * - * This method should return an observer for the given endpoint - * information. The Ice run-time calls this method to resolve an - * endpoint and obtain the list of connectors. - * - * For IP endpoints, this typically involves doing a DNS lookup to - * obtain the IP addresses associated with the DNS name. - * - * @param endpt The endpoint. - * - * @return The observer to instrument the endpoint lookup. - * - **/ + /// This method should return an observer for the given endpoint information. The Ice run-time calls this method to + /// resolve an endpoint and obtain the list of connectors. For IP endpoints, this typically involves doing a DNS + /// lookup to obtain the IP addresses associated with the DNS name. + /// @param endpt The endpoint. + /// @return The observer to instrument the endpoint lookup. Observer getEndpointLookupObserver(Endpoint endpt); - /** - * - * This method should return a connection observer for the given - * connection. The Ice run-time calls this method for each new - * connection and for all the Ice communicator connections when - * {@link ObserverUpdater#updateConnectionObservers} is called. - * - * @param c The connection information. - * - * @param e The connection endpoint. - * - * @param s The state of the connection. - * - * @param o The old connection observer if one is already set or a - * null reference otherwise. - * - * @return The connection observer to instrument the connection. - * - **/ + /// This method should return a connection observer for the given connection. The Ice run-time calls this method + /// for each new connection and for all the Ice communicator connections when + /// {@link ObserverUpdater#updateConnectionObservers} is called. + /// @param c The connection information. + /// @param e The connection endpoint. + /// @param s The state of the connection. + /// @param o The old connection observer if one is already set or a null reference otherwise. + /// @return The connection observer to instrument the connection. ConnectionObserver getConnectionObserver(ConnectionInfo c, Endpoint e, ConnectionState s, ConnectionObserver o); - /** - * - * This method should return a thread observer for the given - * thread. The Ice run-time calls this method for each new thread - * and for all the Ice communicator threads when - * {@link ObserverUpdater#updateThreadObservers} is called. - * - * @param parent The parent of the thread. - * - * @param id The ID of the thread to observe. - * - * @param s The state of the thread. - * - * @param o The old thread observer if one is already set or a - * null reference otherwise. - * - * @return The thread observer to instrument the thread. - * - **/ + /// This method should return a thread observer for the given thread. The Ice run-time calls this method for each + /// new thread and for all the Ice communicator threads when {@link ObserverUpdater#updateThreadObservers} is + /// called. + /// @param parent The parent of the thread. + /// @param id The ID of the thread to observe. + /// @param s The state of the thread. + /// @param o The old thread observer if one is already set or a null reference otherwise. + /// @return The thread observer to instrument the thread. ThreadObserver getThreadObserver(string parent, string id, ThreadState s, ThreadObserver o); - /** - * - * This method should return an invocation observer for the given - * invocation. The Ice run-time calls this method for each new - * invocation on a proxy. - * - * @param prx The proxy used for the invocation. - * - * @param operation The name of the invocation. - * - * @param ctx The context specified by the user. - * - * @return The invocation observer to instrument the invocation. - * - **/ + /// This method should return an invocation observer for the given invocation. The Ice run-time calls this method + /// for each new invocation on a proxy. + /// @param prx The proxy used for the invocation. + /// @param operation The name of the operation. + /// @param ctx The context specified by the user. + /// @return The invocation observer to instrument the invocation. InvocationObserver getInvocationObserver(Object* prx, string operation, Context ctx); - /** - * - * This method should return a dispatch observer for the given - * dispatch. The Ice run-time calls this method each time it - * receives an incoming invocation to be dispatched for an Ice - * object. - * - * @param c The current object as provided to the Ice servant - * dispatching the invocation. - * - * @param size The size of the dispatch. - * - * @return The dispatch observer to instrument the dispatch. - * - **/ + /// This method should return a dispatch observer for the given dispatch. The Ice run-time calls this method each + /// time it receives an incoming invocation to be dispatched for an Ice object. + /// @param c The current object as provided to the Ice servant dispatching the invocation. + /// @param size The size of the dispatch. + /// @return The dispatch observer to instrument the dispatch. DispatchObserver getDispatchObserver(Current c, int size); - /** - * - * The Ice run-time calls this method when the communicator is - * initialized. The add-in implementing this interface can use - * this object to get the Ice run-time to re-obtain observers for - * observed objects. - * - * @param updater The observer updater object. - * - **/ + /// The Ice run-time calls this method when the communicator is initialized. The add-in implementing this + /// interface can use this object to get the Ice run-time to re-obtain observers for observed objects. + /// @param updater The observer updater object. void setObserverUpdater(ObserverUpdater updater); } diff --git a/slice/Ice/LocalException.ice b/slice/Ice/LocalException.ice index 66e66364e2f..eaf13472d04 100644 --- a/slice/Ice/LocalException.ice +++ b/slice/Ice/LocalException.ice @@ -30,1008 +30,533 @@ module Ice { -/** - * - * This exception is raised when a failure occurs during initialization. - * - **/ +/// This exception is raised when a failure occurs during initialization. ["cpp:ice_print"] local exception InitializationException { - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * This exception indicates that a failure occurred while initializing - * a plug-in. - * - **/ +/// This exception indicates that a failure occurred while initializing a plug-in. ["cpp:ice_print"] local exception PluginInitializationException { - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * This exception is raised if a feature is requested that is not - * supported with collocation optimization. - * - **/ +/// This exception is raised if a feature is requested that is not supported with collocation optimization. ["cpp:ice_print", "deprecate:This exception is no longer used by the Ice run time"] local exception CollocationOptimizationException { } -/** - * - * An attempt was made to register something more than once with - * the Ice run time. - * - * This exception is raised if an attempt is made to register a - * servant, servant locator, facet, value factory, plug-in, object - * adapter, object, or user exception factory more than once for the - * same ID. - * - **/ +/// An attempt was made to register something more than once with the Ice run time. This exception is raised if an +/// attempt is made to register a servant, servant locator, facet, value factory, plug-in, object adapter, object, or +/// user exception factory more than once for the same ID. ["cpp:ice_print"] local exception AlreadyRegisteredException { - /** - * - * The kind of object that could not be removed: "servant", "facet", - * "object", "default servant", "servant locator", "value factory", "plugin", - * "object adapter", "object adapter with router", "replica group". - * - **/ + /// The kind of object that could not be removed: "servant", "facet", "object", "default servant", + /// "servant locator", "value factory", "plugin", "object adapter", "object adapter with router", "replica group". string kindOfObject; - /** - * - * The ID (or name) of the object that is registered already. - * - **/ + /// The ID (or name) of the object that is registered already. string id; } -/** - * - * An attempt was made to find or deregister something that is not - * registered with the Ice run time or Ice locator. - * - * This exception is raised if an attempt is made to remove a servant, - * servant locator, facet, value factory, plug-in, object adapter, - * object, or user exception factory that is not currently registered. - * - * It's also raised if the Ice locator can't find an object or object - * adapter when resolving an indirect proxy or when an object adapter - * is activated. - * - **/ +/// An attempt was made to find or deregister something that is not registered with the Ice run time or Ice locator. +/// This exception is raised if an attempt is made to remove a servant, servant locator, facet, value factory, plug-in, +/// object adapter, object, or user exception factory that is not currently registered. It's also raised if the Ice +/// locator can't find an object or object adapter when resolving an indirect proxy or when an object adapter is +/// activated. ["cpp:ice_print"] local exception NotRegisteredException { - /** - * - * The kind of object that could not be removed: "servant", "facet", - * "object", "default servant", "servant locator", "value factory", "plugin", - * "object adapter", "object adapter with router", "replica group". - * - **/ + /// The kind of object that could not be removed: "servant", "facet", "object", "default servant", + /// "servant locator", "value factory", "plugin", "object adapter", "object adapter with router", "replica group". string kindOfObject; - /** - * - * The ID (or name) of the object that could not be removed. - * - **/ + /// The ID (or name) of the object that could not be removed. string id; } -/** - * - * The operation can only be invoked with a twoway request. - * - * This exception is raised if an attempt is made to invoke an - * operation with ice_oneway, ice_batchOneway, ice_datagram, - * or ice_batchDatagram and the operation has a return value, - * out-parameters, or an exception specification. - * - **/ +/// The operation can only be invoked with a twoway request. This exception is raised if an attempt is made to invoke +/// an operation with ice_oneway, ice_batchOneway, ice_datagram, or +/// ice_batchDatagram and the operation has a return value, out-parameters, or an exception specification. ["cpp:ice_print"] local exception TwowayOnlyException { - /** - * - * The name of the operation that was invoked. - * - **/ + /// The name of the operation that was invoked. string operation; } -/** - * - * An attempt was made to clone a class that does not support - * cloning. - * - * This exception is raised if ice_clone is called on - * a class that is derived from an abstract Slice class (that is, - * a class containing operations), and the derived class does not - * provide an implementation of the ice_clone operation (C++ only). - * - **/ +/// An attempt was made to clone a class that does not support cloning. This exception is raised if +/// ice_clone is called on a class that is derived from an abstract Slice class (that is, a class +/// containing operations), and the derived class does not provide an implementation of the ice_clone +/// operation (C++ only). ["cpp:ice_print"] local exception CloneNotImplementedException { } -/** - * - * This exception is raised if an operation call on a server raises an - * unknown exception. For example, for C++, this exception is raised - * if the server throws a C++ exception that is not directly or - * indirectly derived from Ice::LocalException or - * Ice::UserException. - * - **/ +/// This exception is raised if an operation call on a server raises an unknown exception. For example, for C++, this +/// exception is raised if the server throws a C++ exception that is not directly or indirectly derived from +/// Ice::LocalException or Ice::UserException. ["cpp:ice_print"] local exception UnknownException { - /** - * - * This field is set to the textual representation of the unknown - * exception if available. - * - **/ + /// This field is set to the textual representation of the unknown exception if available. string unknown; } -/** - * - * This exception is raised if an operation call on a server raises a - * local exception. Because local exceptions are not transmitted by - * the Ice protocol, the client receives all local exceptions raised - * by the server as {@link UnknownLocalException}. The only exception to this - * rule are all exceptions derived from {@link RequestFailedException}, - * which are transmitted by the Ice protocol even though they are - * declared local. - * - **/ +/// This exception is raised if an operation call on a server raises a local exception. Because local exceptions are +/// not transmitted by the Ice protocol, the client receives all local exceptions raised by the server as +/// {@link UnknownLocalException}. The only exception to this rule are all exceptions derived from +/// {@link RequestFailedException}, which are transmitted by the Ice protocol even though they are declared +/// local. ["cpp:ice_print"] local exception UnknownLocalException extends UnknownException { } -/** - * - * An operation raised an incorrect user exception. - * - * This exception is raised if an operation raises a - * user exception that is not declared in the exception's - * throws clause. Such undeclared exceptions are - * not transmitted from the server to the client by the Ice - * protocol, but instead the client just gets an - * {@link UnknownUserException}. This is necessary in order to not violate - * the contract established by an operation's signature: Only local - * exceptions and user exceptions declared in the - * throws clause can be raised. - * - **/ +/// An operation raised an incorrect user exception. This exception is raised if an operation raises a user exception +/// that is not declared in the exception's throws clause. Such undeclared exceptions are not transmitted +/// from the server to the client by the Ice protocol, but instead the client just gets an {@link UnknownUserException}. +/// This is necessary in order to not violate the contract established by an operation's signature: Only local +/// exceptions and user exceptions declared in the throws clause can be raised. ["cpp:ice_print"] local exception UnknownUserException extends UnknownException { } -/** - * - * This exception is raised if the Ice library version does not match - * the version in the Ice header files. - * - **/ +/// This exception is raised if the Ice library version does not match the version in the Ice header files. ["cpp:ice_print"] local exception VersionMismatchException { } -/** - * - * This exception is raised if the {@link Communicator} has been destroyed. - * - * @see Communicator#destroy - * - **/ +/// This exception is raised if the {@link Communicator} has been destroyed. +/// @see Communicator#destroy ["cpp:ice_print"] local exception CommunicatorDestroyedException { } -/** - * - * This exception is raised if an attempt is made to use a deactivated - * {@link ObjectAdapter}. - * - * @see ObjectAdapter#deactivate - * @see Communicator#shutdown - * - **/ +/// This exception is raised if an attempt is made to use a deactivated {@link ObjectAdapter}. +/// @see ObjectAdapter#deactivate +/// @see Communicator#shutdown ["cpp:ice_print"] local exception ObjectAdapterDeactivatedException { - /** - * - * Name of the adapter. - * - **/ + /// Name of the adapter. string name; } -/** - * - * This exception is raised if an {@link ObjectAdapter} cannot be activated. - * - * This happens if the {@link Locator} detects another active {@link ObjectAdapter} with - * the same adapter id. - * - **/ +/// This exception is raised if an {@link ObjectAdapter} cannot be activated. This happens if the {@link Locator} +/// detects another active {@link ObjectAdapter} with the same adapter id. ["cpp:ice_print"] local exception ObjectAdapterIdInUseException { - /** - * - * Adapter ID. - * - **/ + /// Adapter ID. string id; } -/** - * - * This exception is raised if no suitable endpoint is available. - * - **/ +/// This exception is raised if no suitable endpoint is available. ["cpp:ice_print"] local exception NoEndpointException { - /** - * - * The stringified proxy for which no suitable endpoint is - * available. - * - **/ + /// The stringified proxy for which no suitable endpoint is available. string proxy; } -/** - * - * This exception is raised if there was an error while parsing an - * endpoint. - * - **/ +/// This exception is raised if there was an error while parsing an endpoint. ["cpp:ice_print"] local exception EndpointParseException { - /** - * - * Describes the failure and includes the string that could not be parsed. - * - **/ + /// Describes the failure and includes the string that could not be parsed. string str; } -/** - * - * This exception is raised if there was an error while parsing an - * endpoint selection type. - * - **/ +/// This exception is raised if there was an error while parsing an endpoint selection type. ["cpp:ice_print"] local exception EndpointSelectionTypeParseException { - /** - * - * Describes the failure and includes the string that could not be parsed. - * - **/ + /// Describes the failure and includes the string that could not be parsed. string str; } -/** - * - * This exception is raised if there was an error while parsing a - * version. - * - **/ +/// This exception is raised if there was an error while parsing a version. ["cpp:ice_print"] local exception VersionParseException { - /** - * - * Describes the failure and includes the string that could not be parsed. - * - **/ + /// Describes the failure and includes the string that could not be parsed. string str; } -/** - * - * This exception is raised if there was an error while parsing a - * stringified identity. - * - **/ +/// This exception is raised if there was an error while parsing a stringified identity. ["cpp:ice_print"] local exception IdentityParseException { - /** - * - * Describes the failure and includes the string that could not be parsed. - * - **/ + /// Describes the failure and includes the string that could not be parsed. string str; } -/** - * - * This exception is raised if there was an error while parsing a - * stringified proxy. - * - **/ +/// This exception is raised if there was an error while parsing a stringified proxy. ["cpp:ice_print"] local exception ProxyParseException { - /** - * - * Describes the failure and includes the string that could not be parsed. - * - **/ + /// Describes the failure and includes the string that could not be parsed. string str; } -/** - * - * This exception is raised if an illegal identity is encountered. - * - **/ +/// This exception is raised if an illegal identity is encountered. ["cpp:ice_print"] local exception IllegalIdentityException { - /** - * - * The illegal identity. - * - **/ + /// The illegal identity. Identity id; } -/** - * - * This exception is raised to reject an illegal servant (typically - * a null servant) - * - **/ +/// This exception is raised to reject an illegal servant (typically a null servant). ["cpp:ice_print"] local exception IllegalServantException { - /** - * - * Describes why this servant is illegal. - * - **/ + /// Describes why this servant is illegal. string reason; } -/** - * - * This exception is raised if a request failed. This exception, and - * all exceptions derived from {@link RequestFailedException}, are - * transmitted by the Ice protocol, even though they are declared - * local. - * - **/ +/// This exception is raised if a request failed. This exception, and all exceptions derived from +/// {@link RequestFailedException}, are transmitted by the Ice protocol, even though they are declared +/// local. ["cpp:ice_print"] local exception RequestFailedException { - /** The identity of the Ice Object to which the request was sent. */ + /// The identity of the Ice Object to which the request was sent. Identity id; - /** The facet to which the request was sent. */ + /// The facet to which the request was sent. string facet; - /** The operation name of the request. */ + /// The operation name of the request. string operation; } -/** - * - * This exception is raised if an object does not exist on the server, - * that is, if no facets with the given identity exist. - * - **/ +/// This exception is raised if an object does not exist on the server, that is, if no facets with the given identity +/// exist. ["cpp:ice_print"] local exception ObjectNotExistException extends RequestFailedException { } -/** - * - * This exception is raised if no facet with the given name exists, - * but at least one facet with the given identity exists. - * - **/ +/// This exception is raised if no facet with the given name exists, but at least one facet with the given identity +/// exists. ["cpp:ice_print"] local exception FacetNotExistException extends RequestFailedException { } -/** - * - * This exception is raised if an operation for a given object does - * not exist on the server. Typically this is caused by either the - * client or the server using an outdated Slice specification. - * - **/ +/// This exception is raised if an operation for a given object does not exist on the server. Typically this is caused +/// by either the client or the server using an outdated Slice specification. ["cpp:ice_print"] local exception OperationNotExistException extends RequestFailedException { } -/** - * - * This exception is raised if a system error occurred in the server - * or client process. There are many possible causes for such a system - * exception. For details on the cause, {@link SyscallException#error} - * should be inspected. - * - **/ +/// This exception is raised if a system error occurred in the server or client process. There are many possible causes +/// for such a system exception. For details on the cause, {@link SyscallException#error} should be inspected. ["cpp:ice_print"] local exception SyscallException { - /** - * - * The error number describing the system exception. For C++ and - * Unix, this is equivalent to errno. For C++ - * and Windows, this is the value returned by - * GetLastError() or - * WSAGetLastError(). - * - **/ + /// The error number describing the system exception. For C++ and Unix, this is equivalent to errno. + /// For C++ and Windows, this is the value returned by GetLastError() or + /// WSAGetLastError(). int error = 0; // Don't use errno, as errno is usually a macro. } -/** - * - * This exception indicates socket errors. - * - **/ +/// This exception indicates socket errors. ["cpp:ice_print"] local exception SocketException extends SyscallException { } -/** - * - * This exception indicates CFNetwork errors. - * - **/ +/// This exception indicates CFNetwork errors. ["cpp:ice_print"] local exception CFNetworkException extends SocketException { - /** - * - * The domain of the error. - * - **/ + /// The domain of the error. string domain; } -/** - * - * This exception indicates file errors. - * - **/ +/// This exception indicates file errors. ["cpp:ice_print"] local exception FileException extends SyscallException { - /** The path of the file responsible for the error. */ + /// The path of the file responsible for the error. string path; } -/** - * - * This exception indicates connection failures. - * - **/ +/// This exception indicates connection failures. ["cpp:ice_print"] local exception ConnectFailedException extends SocketException { } -/** - * - * This exception indicates a connection failure for which - * the server host actively refuses a connection. - * - **/ +/// This exception indicates a connection failure for which the server host actively refuses a connection. ["cpp:ice_print"] local exception ConnectionRefusedException extends ConnectFailedException { } -/** - * - * This exception indicates a lost connection. - * - **/ +/// This exception indicates a lost connection. ["cpp:ice_print"] local exception ConnectionLostException extends SocketException { } -/** - * - * This exception indicates a DNS problem. For details on the cause, - * {@link DNSException#error} should be inspected. - * - **/ +/// This exception indicates a DNS problem. For details on the cause, {@link DNSException#error} should be inspected. ["cpp:ice_print"] local exception DNSException { - /** - * - * The error number describing the DNS problem. For C++ and Unix, - * this is equivalent to h_errno. For C++ and - * Windows, this is the value returned by - * WSAGetLastError(). - * - **/ + /// The error number describing the DNS problem. For C++ and Unix, this is equivalent to h_errno. For + /// C++ and Windows, this is the value returned by WSAGetLastError(). int error = 0; // Don't use h_errno, as h_errno is usually a macro. - /** - * - * The host name that could not be resolved. - * - **/ + /// The host name that could not be resolved. string host; } -/** - * - * This exception indicates a request was interrupted. - * - **/ +/// This exception indicates a request was interrupted. ["cpp:ice_print"] local exception OperationInterruptedException { } -/** - * - * This exception indicates a timeout condition. - * - **/ +/// This exception indicates a timeout condition. ["cpp:ice_print"] local exception TimeoutException { } -/** - * - * This exception indicates a connection establishment timeout condition. - * - **/ +/// This exception indicates a connection establishment timeout condition. ["cpp:ice_print"] local exception ConnectTimeoutException extends TimeoutException { } -/** - * - * This exception indicates a connection closure timeout condition. - * - **/ +/// This exception indicates a connection closure timeout condition. ["cpp:ice_print"] local exception CloseTimeoutException extends TimeoutException { } -/** - * - * This exception indicates that a connection has been shut down because it has been - * idle for some time. - * - **/ +/// This exception indicates that a connection has been shut down because it has been idle for some time. ["cpp:ice_print"] local exception ConnectionTimeoutException extends TimeoutException { } -/** - * - * This exception indicates that an invocation failed because it timed - * out. - * - **/ +/// This exception indicates that an invocation failed because it timed out. ["cpp:ice_print"] local exception InvocationTimeoutException extends TimeoutException { } -/** - * - * This exception indicates that an asynchronous invocation failed - * because it was canceled explicitly by the user. - * - **/ +/// This exception indicates that an asynchronous invocation failed because it was canceled explicitly by the user. ["cpp:ice_print"] local exception InvocationCanceledException { } -/** - * - * A generic exception base for all kinds of protocol error - * conditions. - * - **/ +/// A generic exception base for all kinds of protocol error conditions. ["cpp:ice_print"] local exception ProtocolException { - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * This exception indicates that a message did not start with the expected - * magic number ('I', 'c', 'e', 'P'). - * - **/ +/// This exception indicates that a message did not start with the expected magic number ('I', 'c', 'e', 'P'). ["cpp:ice_print"] local exception BadMagicException extends ProtocolException { - /** - * - * A sequence containing the first four bytes of the incorrect message. - * - **/ + /// A sequence containing the first four bytes of the incorrect message. ByteSeq badMagic; } -/** - * - * This exception indicates an unsupported protocol version. - * - **/ +/// This exception indicates an unsupported protocol version. ["cpp:ice_print"] local exception UnsupportedProtocolException extends ProtocolException { - /** - * - * The version of the unsupported protocol. - * - **/ + /// The version of the unsupported protocol. ProtocolVersion bad; - /** - * - * The version of the protocol that is supported. - * - **/ + /// The version of the protocol that is supported. ProtocolVersion supported; } -/** - * - * This exception indicates an unsupported data encoding version. - * - **/ +/// This exception indicates an unsupported data encoding version. ["cpp:ice_print"] local exception UnsupportedEncodingException extends ProtocolException { - /** - * - * The version of the unsupported encoding. - * - **/ + /// The version of the unsupported encoding. EncodingVersion bad; - /** - * - * The version of the encoding that is supported. - * - **/ + /// The version of the encoding that is supported. EncodingVersion supported; } -/** - * - * This exception indicates that an unknown protocol message has been received. - * - **/ +/// This exception indicates that an unknown protocol message has been received. ["cpp:ice_print"] local exception UnknownMessageException extends ProtocolException { } -/** - * - * This exception is raised if a message is received over a connection - * that is not yet validated. - * - **/ +/// This exception is raised if a message is received over a connection that is not yet validated. ["cpp:ice_print"] local exception ConnectionNotValidatedException extends ProtocolException { } -/** - * - * This exception indicates that a response for an unknown request ID has been - * received. - * - **/ +/// This exception indicates that a response for an unknown request ID has been received. ["cpp:ice_print"] local exception UnknownRequestIdException extends ProtocolException { } -/** - * - * This exception indicates that an unknown reply status has been received. - * - **/ +/// This exception indicates that an unknown reply status has been received. ["cpp:ice_print"] local exception UnknownReplyStatusException extends ProtocolException { } -/** - * - * This exception indicates that the connection has been gracefully shut down by the - * server. The operation call that caused this exception has not been - * executed by the server. In most cases you will not get this - * exception, because the client will automatically retry the - * operation call in case the server shut down the connection. However, - * if upon retry the server shuts down the connection again, and the - * retry limit has been reached, then this exception is propagated to - * the application code. - * - **/ +/// This exception indicates that the connection has been gracefully shut down by the server. The operation call that +/// caused this exception has not been executed by the server. In most cases you will not get this exception, because +/// the client will automatically retry the operation call in case the server shut down the connection. However, if +/// upon retry the server shuts down the connection again, and the retry limit has been reached, then this exception is +/// propagated to the application code. ["cpp:ice_print"] local exception CloseConnectionException extends ProtocolException { } -/** - * - * This exception is raised by an operation call if the application - * closes the connection locally using {@link Connection#close}. - * - * @see Connection#close - * - **/ +/// This exception is raised by an operation call if the application closes the connection locally using +/// {@link Connection#close}. +/// @see Connection#close ["cpp:ice_print"] local exception ConnectionManuallyClosedException { - /** True if the connection was closed gracefully, false otherwise. **/ + /// True if the connection was closed gracefully, false otherwise. bool graceful; } -/** - * - * This exception indicates that a message size is less - * than the minimum required size. - * - **/ +/// This exception indicates that a message size is less than the minimum required size. ["cpp:ice_print"] local exception IllegalMessageSizeException extends ProtocolException { } -/** - * - * This exception indicates a problem with compressing or uncompressing data. - * - **/ +/// This exception indicates a problem with compressing or uncompressing data. ["cpp:ice_print"] local exception CompressionException extends ProtocolException { } -/** - * - * A datagram exceeds the configured size. - * - * This exception is raised if a datagram exceeds the configured send or receive buffer - * size, or exceeds the maximum payload size of a UDP packet (65507 bytes). - * - **/ +/// A datagram exceeds the configured size. This exception is raised if a datagram exceeds the configured send or +/// receive buffer size, or exceeds the maximum payload size of a UDP packet (65507 bytes). ["cpp:ice_print"] local exception DatagramLimitException extends ProtocolException { } -/** - * - * This exception is raised for errors during marshaling or unmarshaling data. - * - **/ +/// This exception is raised for errors during marshaling or unmarshaling data. ["cpp:ice_print"] local exception MarshalException extends ProtocolException { } -/** - * - * This exception is raised if inconsistent data is received while unmarshaling a proxy. - * - **/ +/// This exception is raised if inconsistent data is received while unmarshaling a proxy. ["cpp:ice_print"] local exception ProxyUnmarshalException extends MarshalException { } -/** - * - * This exception is raised if an out-of-bounds condition occurs during unmarshaling. - * - **/ +/// This exception is raised if an out-of-bounds condition occurs during unmarshaling. ["cpp:ice_print"] local exception UnmarshalOutOfBoundsException extends MarshalException { } -/** - * - * This exception is raised if no suitable value factory was found during - * unmarshaling of a Slice class instance. - * - * @see ValueFactory - * @see Communicator#getValueFactoryManager - * @see ValueFactoryManager#add - * @see ValueFactoryManager#find - * - **/ +/// This exception is raised if no suitable value factory was found during unmarshaling of a Slice class instance. +/// @see ValueFactory +/// @see Communicator#getValueFactoryManager +/// @see ValueFactoryManager#add +/// @see ValueFactoryManager#find ["cpp:ice_print"] local exception NoValueFactoryException extends MarshalException { - /** - * - * The Slice type ID of the class instance for which no - * no factory could be found. - * - **/ + /// The Slice type ID of the class instance for which no factory could be found. string type; } -/** - * - * This exception is raised if the type of an unmarshaled Slice class instance does - * not match its expected type. - * This can happen if client and server are compiled with mismatched Slice - * definitions or if a class of the wrong type is passed as a parameter - * or return value using dynamic invocation. This exception can also be - * raised if IceStorm is used to send Slice class instances and - * an operation is subscribed to the wrong topic. - * - **/ +/// This exception is raised if the type of an unmarshaled Slice class instance does not match its expected type. This +/// can happen if client and server are compiled with mismatched Slice definitions or if a class of the wrong type is +/// passed as a parameter or return value using dynamic invocation. This exception can also be raised if IceStorm is +/// used to send Slice class instances and an operation is subscribed to the wrong topic. ["cpp:ice_print"] local exception UnexpectedObjectException extends MarshalException { - /** - * - * The Slice type ID of the class instance that was unmarshaled. - * - **/ + /// The Slice type ID of the class instance that was unmarshaled. string type; - /** - * - * The Slice type ID that was expected by the receiving operation. - * - **/ + /// The Slice type ID that was expected by the receiving operation. string expectedType; } -/** - * - * This exception is raised when Ice receives a request or reply - * message whose size exceeds the limit specified by the - * Ice.MessageSizeMax property. - * - **/ +/// This exception is raised when Ice receives a request or reply message whose size exceeds the limit specified by the +/// Ice.MessageSizeMax property. ["cpp:ice_print"] local exception MemoryLimitException extends MarshalException { } -/** - * - * This exception is raised when a string conversion to or from UTF-8 - * fails during marshaling or unmarshaling. - * - **/ +/// This exception is raised when a string conversion to or from UTF-8 fails during marshaling or unmarshaling. ["cpp:ice_print"] local exception StringConversionException extends MarshalException { } -/** - * - * This exception indicates a malformed data encapsulation. - * - **/ +/// This exception indicates a malformed data encapsulation. ["cpp:ice_print"] local exception EncapsulationException extends MarshalException { } -/** - * - * This exception is raised if an unsupported feature is used. The - * unsupported feature string contains the name of the unsupported - * feature - * - **/ +/// This exception is raised if an unsupported feature is used. The unsupported feature string contains the name of the +/// unsupported feature. ["cpp:ice_print"] local exception FeatureNotSupportedException { - /** - * - * The name of the unsupported feature. - * - **/ + /// The name of the unsupported feature. string unsupportedFeature; } -/** - * - * This exception indicates a failure in a security subsystem, - * such as the IceSSL plug-in. - * - **/ +/// This exception indicates a failure in a security subsystem, such as the IceSSL plug-in. ["cpp:ice_print"] local exception SecurityException { - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * This exception indicates that an attempt has been made to - * change the connection properties of a fixed proxy. - * - **/ +/// This exception indicates that an attempt has been made to change the connection properties of a fixed proxy. ["cpp:ice_print"] local exception FixedProxyException { } -/** - * - * Indicates that the response to a request has already been sent; - * re-dispatching such a request is not possible. - * - **/ +/// Indicates that the response to a request has already been sent; re-dispatching such a request is not possible. ["cpp:ice_print"] local exception ResponseSentException { diff --git a/slice/Ice/Locator.ice b/slice/Ice/Locator.ice index 0d7d3ea2370..d55f7abe2bb 100644 --- a/slice/Ice/Locator.ice +++ b/slice/Ice/Locator.ice @@ -29,210 +29,103 @@ module Ice { -/** - * - * This exception is raised if an adapter cannot be found. - * - **/ +/// This exception is raised if an adapter cannot be found. exception AdapterNotFoundException { } -/** - * - * This exception is raised if the replica group provided by the - * server is invalid. - * - **/ +/// This exception is raised if the replica group provided by the server is invalid. exception InvalidReplicaGroupIdException { } -/** - * - * This exception is raised if a server tries to set endpoints for - * an adapter that is already active. - * - **/ +/// This exception is raised if a server tries to set endpoints for an adapter that is already active. exception AdapterAlreadyActiveException { } -/** - * - * This exception is raised if an object cannot be found. - * - **/ +/// This exception is raised if an object cannot be found. exception ObjectNotFoundException { } -/** - * - * This exception is raised if a server cannot be found. - * - **/ +/// This exception is raised if a server cannot be found. exception ServerNotFoundException { } interface LocatorRegistry; -/** - * - * The Ice locator interface. This interface is used by clients to - * lookup adapters and objects. It is also used by servers to get the - * locator registry proxy. - * - *

The {@link Locator} interface is intended to be used by - * Ice internals and by locator implementations. Regular user code - * should not attempt to use any functionality of this interface - * directly. - * - **/ +/// The Ice locator interface. This interface is used by clients to lookup adapters and objects. It is also used by +/// servers to get the locator registry proxy.

The {@link Locator} interface is intended to be used by +/// Ice internals and by locator implementations. Regular user code should not attempt to use any functionality of this +/// interface directly. interface Locator { - /** - * - * Find an object by identity and return a proxy that contains - * the adapter ID or endpoints which can be used to access the - * object. - * - * @param id The identity. - * - * @return The proxy, or null if the object is not active. - * - * @throws ObjectNotFoundException Raised if the object cannot - * be found. - * - **/ + /// Find an object by identity and return a proxy that contains the adapter ID or endpoints which can be used to + /// access the object. + /// @param id The identity. + /// @return The proxy, or null if the object is not active. + /// @throws ObjectNotFoundException Raised if the object cannot be found. ["amd", "nonmutating", "cpp:const"] idempotent Object* findObjectById(Identity id) throws ObjectNotFoundException; - /** - * - * Find an adapter by id and return a proxy that contains - * its endpoints. - * - * @param id The adapter id. - * - * @return The adapter proxy, or null if the adapter is not active. - * - * @throws AdapterNotFoundException Raised if the adapter cannot be - * found. - * - **/ + /// Find an adapter by id and return a proxy that contains its endpoints. + /// @param id The adapter id. + /// @return The adapter proxy, or null if the adapter is not active. + /// @throws AdapterNotFoundException Raised if the adapter cannot be found. ["amd", "nonmutating", "cpp:const"] idempotent Object* findAdapterById(string id) throws AdapterNotFoundException; - /** - * - * Get the locator registry. - * - * @return The locator registry. - * - **/ + /// Get the locator registry. + /// @return The locator registry. ["nonmutating", "cpp:const"] idempotent LocatorRegistry* getRegistry(); } -/** - * - * The Ice locator registry interface. This interface is used by - * servers to register adapter endpoints with the locator. - * - *

The {@link LocatorRegistry} interface is intended to be used - * by Ice internals and by locator implementations. Regular user - * code should not attempt to use any functionality of this interface - * directly. - * - **/ +/// The Ice locator registry interface. This interface is used by servers to register adapter endpoints with the +/// locator.

The {@link LocatorRegistry} interface is intended to be used by Ice internals and by +/// locator implementations. Regular user code should not attempt to use any functionality of this interface directly. interface LocatorRegistry { - /** - * - * Set the adapter endpoints with the locator registry. - * - * @param id The adapter id. - * - * @param proxy The adapter proxy (a dummy direct proxy created - * by the adapter). The direct proxy contains the adapter - * endpoints. - * - * @throws AdapterNotFoundException Raised if the adapter cannot - * be found, or if the locator only allows - * registered adapters to set their active proxy and the - * adapter is not registered with the locator. - * - * @throws AdapterAlreadyActiveException Raised if an adapter with the same - * id is already active. - * - **/ + /// Set the adapter endpoints with the locator registry. + /// @param id The adapter id. + /// @param proxy The adapter proxy (a dummy direct proxy created by the adapter). The direct proxy contains the + /// adapter endpoints. + /// @throws AdapterNotFoundException Raised if the adapter cannot be found, or if the locator only allows + /// registered adapters to set their active proxy and the adapter is not registered with the locator. + /// @throws AdapterAlreadyActiveException Raised if an adapter with the same id is already active. ["amd"] idempotent void setAdapterDirectProxy(string id, Object* proxy) throws AdapterNotFoundException, AdapterAlreadyActiveException; - /** - * - * Set the adapter endpoints with the locator registry. - * - * @param adapterId The adapter id. - * - * @param replicaGroupId The replica group id. - * - * @param p The adapter proxy (a dummy direct proxy created - * by the adapter). The direct proxy contains the adapter - * endpoints. - * - * @throws AdapterNotFoundException Raised if the adapter cannot - * be found, or if the locator only allows registered adapters to - * set their active proxy and the adapter is not registered with - * the locator. - * - * @throws AdapterAlreadyActiveException Raised if an adapter with the same - * id is already active. - * - * @throws InvalidReplicaGroupIdException Raised if the given - * replica group doesn't match the one registered with the - * locator registry for this object adapter. - * - **/ + /// Set the adapter endpoints with the locator registry. + /// @param adapterId The adapter id. + /// @param replicaGroupId The replica group id. + /// @param p The adapter proxy (a dummy direct proxy created by the adapter). The direct proxy contains the adapter + /// endpoints. + /// @throws AdapterNotFoundException Raised if the adapter cannot be found, or if the locator only allows + /// registered adapters to set their active proxy and the adapter is not registered with the locator. + /// @throws AdapterAlreadyActiveException Raised if an adapter with the same id is already active. + /// @throws InvalidReplicaGroupIdException Raised if the given replica group doesn't match the one registered with + /// the locator registry for this object adapter. ["amd"] idempotent void setReplicatedAdapterDirectProxy(string adapterId, string replicaGroupId, Object* p) throws AdapterNotFoundException, AdapterAlreadyActiveException, InvalidReplicaGroupIdException; - /** - * - * Set the process proxy for a server. - * - * @param id The server id. - * - * @param proxy The process proxy. - * - * @throws ServerNotFoundException Raised if the server cannot - * be found. - * - **/ + /// Set the process proxy for a server. + /// @param id The server id. + /// @param proxy The process proxy. + /// @throws ServerNotFoundException Raised if the server cannot be found. ["amd"] idempotent void setServerProcessProxy(string id, Process* proxy) throws ServerNotFoundException; } -/** - * - * This interface should be implemented by services implementing the - * Ice::Locator interface. It should be advertised through an Ice - * object with the identity `Ice/LocatorFinder'. This allows clients - * to retrieve the locator proxy with just the endpoint information of - * the service. - * - **/ +/// This interface should be implemented by services implementing the Ice::Locator interface. It should be +/// advertised through an Ice object with the identity `Ice/LocatorFinder'. This allows clients to +/// retrieve the locator proxy with just the endpoint information of the service. interface LocatorFinder { - /** - * - * Get the locator proxy implemented by the process hosting this - * finder object. The proxy might point to several replicas. - * - * @return The locator proxy. - * - **/ + /// Get the locator proxy implemented by the process hosting this finder object. The proxy might point to several + /// replicas. + /// @return The locator proxy. Locator* getLocator(); } diff --git a/slice/Ice/LocatorF.ice b/slice/Ice/LocatorF.ice index 7723edbbcfe..11ff39cfd53 100644 --- a/slice/Ice/LocatorF.ice +++ b/slice/Ice/LocatorF.ice @@ -25,8 +25,6 @@ ["objc:prefix:ICE"] module Ice { - -interface Locator; -interface LocatorRegistry; - + interface Locator; + interface LocatorRegistry; } diff --git a/slice/Ice/Logger.ice b/slice/Ice/Logger.ice index ce9d4e8c5a3..8395ecbbdf7 100644 --- a/slice/Ice/Logger.ice +++ b/slice/Ice/Logger.ice @@ -26,73 +26,37 @@ module Ice { -/** - * - * The Ice message logger. Applications can provide their own logger - * by implementing this interface and installing it in a communicator. - * - **/ +/// The Ice message logger. Applications can provide their own logger by implementing this interface and installing it +/// in a communicator. local interface Logger { - /** - * - * Print a message. The message is printed literally, without - * any decorations such as executable name or time stamp. - * - * @param message The message to log. - **/ + /// Print a message. The message is printed literally, without any decorations such as executable name or time + /// stamp. + /// @param message The message to log. ["swift:noexcept"] void print(string message); - /** - * - * Log a trace message. - * - * @param category The trace category. - * - * @param message The trace message to log. - * - **/ + /// Log a trace message. + /// @param category The trace category. + /// @param message The trace message to log. ["swift:noexcept"] void trace(string category, string message); - /** - * - * Log a warning message. - * - * @param message The warning message to log. - * - * @see #error - * - **/ + /// Log a warning message. + /// @param message The warning message to log. + /// @see #error ["swift:noexcept"] void warning(string message); - /** - * - * Log an error message. - * - * @param message The error message to log. - * - * @see #warning - * - **/ + /// Log an error message. + /// @param message The error message to log. + /// @see #warning ["swift:noexcept"] void error(string message); - /** - * - * Returns this logger's prefix. - * - * @return The prefix. - * - **/ + /// Returns this logger's prefix. + /// @return The prefix. ["swift:noexcept"] string getPrefix(); - /** - * - * Returns a clone of the logger with a new prefix. - * - * @param prefix The new prefix for the logger. - * @return A logger instance. - * - */ + /// Returns a clone of the logger with a new prefix. + /// @param prefix The new prefix for the logger. + /// @return A logger instance. ["swift:noexcept", "swift:nonnull"] Logger cloneWithPrefix(string prefix); } diff --git a/slice/Ice/Metrics.ice b/slice/Ice/Metrics.ice index ed063499d56..146b9aff732 100644 --- a/slice/Ice/Metrics.ice +++ b/slice/Ice/Metrics.ice @@ -20,13 +20,8 @@ #include -/** - * - * The Ice Management eXtension facility. It provides the - * {@link IceMX#MetricsAdmin} interface for management clients to - * retrieve metrics from Ice applications. - * - **/ +/// The Ice Management eXtension facility. It provides the {@link IceMX#MetricsAdmin} interface for management clients +/// to retrieve metrics from Ice applications. #ifndef __SLICE2JAVA_COMPAT__ [["java:package:com.zeroc"]] #endif @@ -35,401 +30,182 @@ module IceMX { -/** - * - * A dictionary of strings to integers. - * - **/ +/// A dictionary of strings to integers. dictionary StringIntDict; -/** - * - * The base class for metrics. A metrics object represents a - * collection of measurements associated to a given a system. - * - **/ +/// The base class for metrics. A metrics object represents a collection of measurements associated to a given a system. class Metrics { - /** - * - * The metrics identifier. - * - **/ + /// The metrics identifier. string id; - /** - * - * The total number of objects observed by this metrics. This includes - * the number of currently observed objects and the number of objects - * observed in the past. - * - **/ + /// The total number of objects observed by this metrics. This includes the number of currently observed objects + /// and the number of objects observed in the past. long total = 0; - /** - * - * The number of objects currently observed by this metrics. - * - **/ + /// The number of objects currently observed by this metrics. int current = 0; - /** - * - * The sum of the lifetime of each observed objects. This does not - * include the lifetime of objects which are currently observed, - * only the objects observed in the past. - * - **/ + /// The sum of the lifetime of each observed objects. This does not include the lifetime of objects which are + /// currently observed, only the objects observed in the past. long totalLifetime = 0; - /** - * - * The number of failures observed. - * - **/ + /// The number of failures observed. int failures = 0; } -/** - * - * A structure to keep track of failures associated with a given - * metrics. - * - **/ +/// A structure to keep track of failures associated with a given metrics. struct MetricsFailures { - /** - * - * The identifier of the metrics object associated to the - * failures. - * - **/ + /// The identifier of the metrics object associated to the failures. string id; - /** - * - * The failures observed for this metrics. - * - **/ + /// The failures observed for this metrics. StringIntDict failures; } -/** - * - * A sequence of {@link MetricsFailures}. - * - **/ +/// A sequence of {@link MetricsFailures}. sequence MetricsFailuresSeq; -/** - * - * A metrics map is a sequence of metrics. We use a sequence here - * instead of a map because the ID of the metrics is already included - * in the Metrics class and using sequences of metrics objects is more - * efficient than using dictionaries since lookup is not necessary. - * - **/ +/// A metrics map is a sequence of metrics. We use a sequence here instead of a map because the ID of the metrics is +/// already included in the Metrics class and using sequences of metrics objects is more efficient than using +/// dictionaries since lookup is not necessary. sequence MetricsMap; -/** - * - * A metrics view is a dictionary of metrics map. The key of the - * dictionary is the name of the metrics map. - * - **/ +/// A metrics view is a dictionary of metrics map. The key of the dictionary is the name of the metrics map. dictionary MetricsView; -/** - * - * Raised if a metrics view cannot be found. - * - **/ +/// Raised if a metrics view cannot be found. exception UnknownMetricsView { } -/** - * - * The metrics administrative facet interface. This interface allows - * remote administrative clients to access metrics of an application - * that enabled the Ice administrative facility and configured some - * metrics views. - * - **/ +/// The metrics administrative facet interface. This interface allows remote administrative clients to access metrics +/// of an application that enabled the Ice administrative facility and configured some metrics views. ["format:sliced"] interface MetricsAdmin { - /** - * - * Get the names of enabled and disabled metrics. - * - * @param disabledViews The names of the disabled views. - * - * @return The name of the enabled views. - * - **/ + /// Get the names of enabled and disabled metrics. + /// @param disabledViews The names of the disabled views. + /// @return The name of the enabled views. Ice::StringSeq getMetricsViewNames(out Ice::StringSeq disabledViews); - /** - * - * Enables a metrics view. - * - * @param name The metrics view name. - * - * @throws UnknownMetricsView Raised if the metrics view cannot be - * found. - * - **/ + /// Enables a metrics view. + /// @param name The metrics view name. + /// @throws UnknownMetricsView Raised if the metrics view cannot be found. void enableMetricsView(string name) throws UnknownMetricsView; - /** - * - * Disable a metrics view. - * - * @param name The metrics view name. - * - * @throws UnknownMetricsView Raised if the metrics view cannot be - * found. - * - **/ + /// Disable a metrics view. + /// @param name The metrics view name. + /// @throws UnknownMetricsView Raised if the metrics view cannot be found. void disableMetricsView(string name) throws UnknownMetricsView; - /** - * - * Get the metrics objects for the given metrics view. This - * returns a dictionary of metric maps for each metrics class - * configured with the view. The timestamp allows the client to - * compute averages which are not dependent of the invocation - * latency for this operation. - * - * @param view The name of the metrics view. - * - * @param timestamp The local time of the process when the metrics - * object were retrieved. - * - * @return The metrics view data. - * - * @throws UnknownMetricsView Raised if the metrics view cannot be - * found. - * - **/ + /// Get the metrics objects for the given metrics view. This returns a dictionary of metric maps for each metrics + /// class configured with the view. The timestamp allows the client to compute averages which are not dependent of + /// the invocation latency for this operation. + /// @param view The name of the metrics view. + /// @param timestamp The local time of the process when the metrics object were retrieved. + /// @return The metrics view data. + /// @throws UnknownMetricsView Raised if the metrics view cannot be found. MetricsView getMetricsView(string view, out long timestamp) throws UnknownMetricsView; - /** - * - * Get the metrics failures associated with the given view and map. - * - * @param view The name of the metrics view. - * - * @param map The name of the metrics map. - * - * @return The metrics failures associated with the map. - * - * @throws UnknownMetricsView Raised if the metrics view cannot be - * found. - * - **/ + /// Get the metrics failures associated with the given view and map. + /// @param view The name of the metrics view. + /// @param map The name of the metrics map. + /// @return The metrics failures associated with the map. + /// @throws UnknownMetricsView Raised if the metrics view cannot be found. MetricsFailuresSeq getMapMetricsFailures(string view, string map) throws UnknownMetricsView; - /** - * - * Get the metrics failure associated for the given metrics. - * - * @param view The name of the metrics view. - * - * @param map The name of the metrics map. - * - * @param id The ID of the metrics. - * - * @return The metrics failures associated with the metrics. - * - * @throws UnknownMetricsView Raised if the metrics view cannot be - * found. - * - **/ + /// Get the metrics failure associated for the given metrics. + /// @param view The name of the metrics view. + /// @param map The name of the metrics map. + /// @param id The ID of the metrics. + /// @return The metrics failures associated with the metrics. + /// @throws UnknownMetricsView Raised if the metrics view cannot be found. MetricsFailures getMetricsFailures(string view, string map, string id) throws UnknownMetricsView; } -/** - * - * Provides information on the number of threads currently in use and - * their activity. - * - **/ +/// Provides information on the number of threads currently in use and their activity. class ThreadMetrics extends Metrics { - /** - * - * The number of threads which are currently performing socket - * read or writes. - * - **/ + /// The number of threads which are currently performing socket read or writes. int inUseForIO = 0; - /** - * - * The number of threads which are currently calling user code - * (servant dispatch, AMI callbacks, etc). - * - **/ + /// The number of threads which are currently calling user code (servant dispatch, AMI callbacks, etc). int inUseForUser = 0; - /** - * - * The number of threads which are currently performing other - * activities. These are all other that are not counted with - * {@link #inUseForUser} or {@link #inUseForIO}, such as DNS - * lookups, garbage collection). - * - **/ + /// The number of threads which are currently performing other activities. These are all other that are not counted + /// with {@link #inUseForUser} or {@link #inUseForIO}, such as DNS lookups, garbage collection). int inUseForOther = 0; } -/** - * - * Provides information on servant dispatch. - * - **/ +/// Provides information on servant dispatch. class DispatchMetrics extends Metrics { - /** - * - * The number of dispatch that failed with a user exception. - * - **/ + /// The number of dispatch that failed with a user exception. int userException = 0; - /** - * - * The size of the dispatch. This corresponds to the size of the - * marshalled input parameters. - * - **/ + /// The size of the dispatch. This corresponds to the size of the marshalled input parameters. long size = 0; - /** - * - * The size of the dispatch reply. This corresponds to the size of - * the marshalled output and return parameters. - * - **/ + /// The size of the dispatch reply. This corresponds to the size of the marshalled output and return parameters. long replySize = 0; } -/** - * - * Provides information on child invocations. A child invocation is - * either remote (sent over an Ice connection) or collocated. An - * invocation can have multiple child invocation if it is - * retried. Child invocation metrics are embedded within - * {@link InvocationMetrics}. - * - **/ +/// Provides information on child invocations. A child invocation is either remote (sent over an Ice connection) or +/// collocated. An invocation can have multiple child invocation if it is retried. Child invocation metrics are +/// embedded within {@link InvocationMetrics}. class ChildInvocationMetrics extends Metrics { - /** - * - * The size of the invocation. This corresponds to the size of the - * marshalled input parameters. - * - **/ + /// The size of the invocation. This corresponds to the size of the marshalled input parameters. long size = 0; - /** - * - * The size of the invocation reply. This corresponds to the size - * of the marshalled output and return parameters. - * - **/ + /// The size of the invocation reply. This corresponds to the size of the marshalled output and return parameters. long replySize = 0; } -/** - * - * Provides information on invocations that are collocated. Collocated - * metrics are embedded within {@link InvocationMetrics}. - * - **/ +/// Provides information on invocations that are collocated. Collocated metrics are embedded within +/// {@link InvocationMetrics}. class CollocatedMetrics extends ChildInvocationMetrics { } -/** - * - * Provides information on invocations that are specifically sent over - * Ice connections. Remote metrics are embedded within {@link InvocationMetrics}. - * - **/ +/// Provides information on invocations that are specifically sent over Ice connections. Remote metrics are embedded +/// within {@link InvocationMetrics}. class RemoteMetrics extends ChildInvocationMetrics { } -/** - * - * Provide measurements for proxy invocations. Proxy invocations can - * either be sent over the wire or be collocated. - * - **/ +/// Provide measurements for proxy invocations. Proxy invocations can either be sent over the wire or be collocated. class InvocationMetrics extends Metrics { - /** - * - * The number of retries for the invocation(s). - * - **/ + /// The number of retries for the invocation(s). int retry = 0; - /** - * - * The number of invocations that failed with a user exception. - * - **/ + /// The number of invocations that failed with a user exception. int userException = 0; - /** - * - * The remote invocation metrics map. - * - * @see RemoteMetrics - * - **/ + /// The remote invocation metrics map. + /// @see RemoteMetrics MetricsMap remotes; - /** - * - * The collocated invocation metrics map. - * - * @see CollocatedMetrics - * - **/ + /// The collocated invocation metrics map. + /// @see CollocatedMetrics MetricsMap collocated; } -/** - * - * Provides information on the data sent and received over Ice - * connections. - * - **/ +/// Provides information on the data sent and received over Ice connections. class ConnectionMetrics extends Metrics { - /** - * - * The number of bytes received by the connection. - * - **/ + /// The number of bytes received by the connection. long receivedBytes = 0; - /** - * - * The number of bytes sent by the connection. - * - **/ + /// The number of bytes sent by the connection. long sentBytes = 0; } diff --git a/slice/Ice/ObjectAdapter.ice b/slice/Ice/ObjectAdapter.ice index 92c4fa44da5..b888ce14704 100644 --- a/slice/Ice/ObjectAdapter.ice +++ b/slice/Ice/ObjectAdapter.ice @@ -33,675 +33,347 @@ module Ice { -/** - * - * The object adapter provides an up-call interface from the Ice - * run time to the implementation of Ice objects. - * - * The object adapter is responsible for receiving requests - * from endpoints, and for mapping between servants, identities, and - * proxies. - * - * @see Communicator - * @see ServantLocator - * - **/ +/// The object adapter provides an up-call interface from the Ice run time to the implementation of Ice objects. The +/// object adapter is responsible for receiving requests from endpoints, and for mapping between servants, identities, +/// and proxies. +/// @see Communicator +/// @see ServantLocator local interface ObjectAdapter { - /** - * - * Get the name of this object adapter. - * - * @return This object adapter's name. - * - **/ + /// Get the name of this object adapter. + /// @return This object adapter's name. ["cpp:const", "cpp:noexcept", "swift:noexcept"] string getName(); - /** - * - * Get the communicator this object adapter belongs to. - * - * @return This object adapter's communicator. - * - * @see Communicator - * - **/ + /// Get the communicator this object adapter belongs to. + /// @return This object adapter's communicator. + /// @see Communicator ["cpp:const", "cpp:noexcept", "swift:noexcept", "swift:nonnull"] Communicator getCommunicator(); - /** - * - * Activate all endpoints that belong to this object adapter. - * After activation, the object adapter can dispatch requests - * received through its endpoints. - * - * @see #hold - * @see #deactivate - * - **/ + /// Activate all endpoints that belong to this object adapter. After activation, the object adapter can dispatch + /// requests received through its endpoints. + /// @see #hold + /// @see #deactivate ["js:async"] void activate(); - /** - * - * Temporarily hold receiving and dispatching requests. The object - * adapter can be reactivated with the {@link #activate} operation. - * - *

Holding is not immediate, i.e., after {@link #hold} - * returns, the object adapter might still be active for some - * time. You can use {@link #waitForHold} to wait until holding is - * complete. - * - * @see #activate - * @see #deactivate - * @see #waitForHold - * - **/ + /// Temporarily hold receiving and dispatching requests. The object adapter can be reactivated with the + /// {@link #activate} operation.

Holding is not immediate, i.e., after {@link #hold} returns, the + /// object adapter might still be active for some time. You can use {@link #waitForHold} to wait until holding is + /// complete. + /// @see #activate + /// @see #deactivate + /// @see #waitForHold ["swift:noexcept"] void hold(); - /** - * - * Wait until the object adapter holds requests. Calling {@link #hold} - * initiates holding of requests, and {@link #waitForHold} only returns - * when holding of requests has been completed. - * - * @see #hold - * @see #waitForDeactivate - * @see Communicator#waitForShutdown - * - **/ + /// Wait until the object adapter holds requests. Calling {@link #hold} initiates holding of requests, and + /// {@link #waitForHold} only returns when holding of requests has been completed. + /// @see #hold + /// @see #waitForDeactivate + /// @see Communicator#waitForShutdown ["swift:noexcept", "js:async"] void waitForHold(); - /** - * - * Deactivate all endpoints that belong to this object adapter. - * After deactivation, the object adapter stops receiving - * requests through its endpoints. Object adapters that have been - * deactivated must not be reactivated again, and cannot be used - * otherwise. Attempts to use a deactivated object adapter raise - * {@link ObjectAdapterDeactivatedException} however, attempts to - * {@link #deactivate} an already deactivated object adapter are - * ignored and do nothing. Once deactivated, it is possible to - * destroy the adapter to clean up resources and then create and - * activate a new adapter with the same name. - * - *

After {@link #deactivate} returns, no new requests - * are processed by the object adapter. However, requests that - * have been started before {@link #deactivate} was called might - * still be active. You can use {@link #waitForDeactivate} to wait - * for the completion of all requests for this object adapter. - * - * @see #activate - * @see #hold - * @see #waitForDeactivate - * @see Communicator#shutdown - * - **/ + /// Deactivate all endpoints that belong to this object adapter. After deactivation, the object adapter stops + /// receiving requests through its endpoints. Object adapters that have been deactivated must not be reactivated + /// again, and cannot be used otherwise. Attempts to use a deactivated object adapter raise + /// {@link ObjectAdapterDeactivatedException} however, attempts to {@link #deactivate} an already deactivated + /// object adapter are ignored and do nothing. Once deactivated, it is possible to destroy the adapter to clean up + /// resources and then create and activate a new adapter with the same name. + ///

After {@link #deactivate} returns, no new requests are processed by the object adapter. + /// However, requests that have been started before {@link #deactivate} was called might still be active. You can + /// use {@link #waitForDeactivate} to wait for the completion of all requests for this object adapter. + /// @see #activate + /// @see #hold + /// @see #waitForDeactivate + /// @see Communicator#shutdown ["cpp:noexcept", "swift:noexcept", "js:async"] void deactivate(); - /** - * - * Wait until the object adapter has deactivated. Calling - * {@link #deactivate} initiates object adapter deactivation, and - * {@link #waitForDeactivate} only returns when deactivation has - * been completed. - * - * @see #deactivate - * @see #waitForHold - * @see Communicator#waitForShutdown - * - **/ + /// Wait until the object adapter has deactivated. Calling {@link #deactivate} initiates object adapter + /// deactivation, and {@link #waitForDeactivate} only returns when deactivation has been completed. + /// @see #deactivate + /// @see #waitForHold + /// @see Communicator#waitForShutdown ["cpp:noexcept", "swift:noexcept", "js:async"] void waitForDeactivate(); - /** - * - * Check whether object adapter has been deactivated. - * - * @return Whether adapter has been deactivated. - * - * @see Communicator#shutdown - * - **/ + /// Check whether object adapter has been deactivated. + /// @return Whether adapter has been deactivated. + /// @see Communicator#shutdown ["cpp:const", "cpp:noexcept", "swift:noexcept"] bool isDeactivated(); - /** - * - * Destroys the object adapter and cleans up all resources held by - * the object adapter. If the object adapter has not yet been - * deactivated, destroy implicitly initiates the deactivation - * and waits for it to finish. Subsequent calls to destroy are - * ignored. Once destroy has returned, it is possible to create - * another object adapter with the same name. - * - * @see #deactivate - * @see #waitForDeactivate - * @see Communicator#destroy - * - **/ + /// Destroys the object adapter and cleans up all resources held by the object adapter. If the object adapter has + /// not yet been deactivated, destroy implicitly initiates the deactivation and waits for it to finish. Subsequent + /// calls to destroy are ignored. Once destroy has returned, it is possible to create another object adapter with + /// the same name. + /// @see #deactivate + /// @see #waitForDeactivate + /// @see Communicator#destroy ["cpp:noexcept", "swift:noexcept", "js:async"] void destroy(); - /** - * - * Add a servant to this object adapter's Active Servant Map. Note - * that one servant can implement several Ice objects by registering - * the servant with multiple identities. Adding a servant with an - * identity that is in the map already throws {@link AlreadyRegisteredException}. - * - * @param servant The servant to add. - * - * @param id The identity of the Ice object that is implemented by - * the servant. - * - * @return A proxy that matches the given identity and this object - * adapter. - * - * @see Identity - * @see #addFacet - * @see #addWithUUID - * @see #remove - * @see #find - * - **/ + /// Add a servant to this object adapter's Active Servant Map. Note that one servant can implement several Ice + /// objects by registering the servant with multiple identities. Adding a servant with an identity that is in the + /// map already throws {@link AlreadyRegisteredException}. + /// @param servant The servant to add. + /// @param id The identity of the Ice object that is implemented by the servant. + /// @return A proxy that matches the given identity and this object adapter. + /// @see Identity + /// @see #addFacet + /// @see #addWithUUID + /// @see #remove + /// @see #find ["swift:nonnull", "swift:attribute:@discardableResult"] Object* add(["swift:nonnull"] Object servant, ["objc:param:identity"] Identity id); - /** - * - * Like {@link #add}, but with a facet. Calling add(servant, id) - * is equivalent to calling {@link #addFacet} with an empty facet. - * - * @param servant The servant to add. - * - * @param id The identity of the Ice object that is implemented by - * the servant. - * - * @param facet The facet. An empty facet means the default facet. - * - * @return A proxy that matches the given identity, facet, and - * this object adapter. - * - * @see Identity - * @see #add - * @see #addFacetWithUUID - * @see #removeFacet - * @see #findFacet - * - **/ + /// Like {@link #add}, but with a facet. Calling add(servant, id) is equivalent to calling + /// {@link #addFacet} with an empty facet. + /// @param servant The servant to add. + /// @param id The identity of the Ice object that is implemented by the servant. + /// @param facet The facet. An empty facet means the default facet. + /// @return A proxy that matches the given identity, facet, and this object adapter. + /// @see Identity + /// @see #add + /// @see #addFacetWithUUID + /// @see #removeFacet + /// @see #findFacet ["swift:nonnull", "swift:attribute:@discardableResult"] Object* addFacet(["swift:nonnull"] Object servant, ["objc:param:identity"] Identity id, string facet); - /** - * - * Add a servant to this object adapter's Active Servant Map, - * using an automatically generated UUID as its identity. Note that - * the generated UUID identity can be accessed using the proxy's - * ice_getIdentity operation. - * - * @param servant The servant to add. - * - * @return A proxy that matches the generated UUID identity and - * this object adapter. - * - * @see Identity - * @see #add - * @see #addFacetWithUUID - * @see #remove - * @see #find - * - **/ + /// Add a servant to this object adapter's Active Servant Map, using an automatically generated UUID as its + /// identity. Note that the generated UUID identity can be accessed using the proxy's ice_getIdentity + /// operation. + /// @param servant The servant to add. + /// @return A proxy that matches the generated UUID identity and this object adapter. + /// @see Identity + /// @see #add + /// @see #addFacetWithUUID + /// @see #remove + /// @see #find ["swift:nonnull", "swift:attribute:@discardableResult"] Object* addWithUUID(["swift:nonnull"] Object servant); - /** - * - * Like {@link #addWithUUID}, but with a facet. Calling - * addWithUUID(servant) is equivalent to calling - * {@link #addFacetWithUUID} with an empty facet. - * - * @param servant The servant to add. - * - * @param facet The facet. An empty facet means the default - * facet. - * - * @return A proxy that matches the generated UUID identity, - * facet, and this object adapter. - * - * @see Identity - * @see #addFacet - * @see #addWithUUID - * @see #removeFacet - * @see #findFacet - * - **/ + /// Like {@link #addWithUUID}, but with a facet. Calling addWithUUID(servant) is equivalent to calling + /// {@link #addFacetWithUUID} with an empty facet. + /// @param servant The servant to add. + /// @param facet The facet. An empty facet means the default facet. + /// @return A proxy that matches the generated UUID identity, facet, and this object adapter. + /// @see Identity + /// @see #addFacet + /// @see #addWithUUID + /// @see #removeFacet + /// @see #findFacet ["swift:nonnull", "swift:attribute:@discardableResult"] Object* addFacetWithUUID(["swift:nonnull"] Object servant, string facet); - /** - * - * Add a default servant to handle requests for a specific - * category. Adding a default servant for a category for - * which a default servant is already registered throws - * {@link AlreadyRegisteredException}. To dispatch operation - * calls on servants, the object adapter tries to find a servant - * for a given Ice object identity and facet in the following - * order: - * - *

    - * - *
  1. The object adapter tries to find a servant for the identity - * and facet in the Active Servant Map.
  2. - * - *
  3. If no servant has been found in the Active Servant Map, the - * object adapter tries to find a default servant for the category - * component of the identity.
  4. - * - *
  5. If no servant has been found by any of the preceding steps, - * the object adapter tries to find a default servant for an empty - * category, regardless of the category contained in the identity.
  6. - * - *
  7. If no servant has been found by any of the preceding steps, - * the object adapter gives up and the caller receives - * {@link ObjectNotExistException} or {@link FacetNotExistException}.
  8. - * - *
- * - * @param servant The default servant. - * - * @param category The category for which the default servant is - * registered. An empty category means it will handle all categories. - * - * @see #removeDefaultServant - * @see #findDefaultServant - * - **/ + /// Add a default servant to handle requests for a specific category. Adding a default servant for a category for + /// which a default servant is already registered throws {@link AlreadyRegisteredException}. To dispatch operation + /// calls on servants, the object adapter tries to find a servant for a given Ice object identity and facet in the + /// following order: + ///
    + ///
  1. The object adapter tries to find a servant for the identity and facet in the Active Servant Map.
  2. + ///
  3. If no servant has been found in the Active Servant Map, the object adapter tries to find a default servant + /// for the category component of the identity.
  4. + ///
  5. If no servant has been found by any of the preceding steps, the object adapter tries to find a default + /// servant for an empty category, regardless of the category contained in the identity.
  6. + ///
  7. If no servant has been found by any of the preceding steps, the object adapter gives up and the caller + /// receives {@link ObjectNotExistException} or {@link FacetNotExistException}.
  8. + ///
+ /// @param servant The default servant. + /// @param category The category for which the default servant is registered. An empty category means it will + /// handle all categories. + /// @see #removeDefaultServant + /// @see #findDefaultServant void addDefaultServant(["swift:nonnull"] Object servant, string category); - /** - * - * Remove a servant (that is, the default facet) from the object - * adapter's Active Servant Map. - * - * @param id The identity of the Ice object that is implemented by - * the servant. If the servant implements multiple Ice objects, - * {@link #remove} has to be called for all those Ice objects. - * Removing an identity that is not in the map throws - * {@link NotRegisteredException}. - * - * @return The removed servant. - * - * @see Identity - * @see #add - * @see #addWithUUID - * - **/ + /// Remove a servant (that is, the default facet) from the object adapter's Active Servant Map. + /// @param id The identity of the Ice object that is implemented by the servant. If the servant implements multiple + /// Ice objects, {@link #remove} has to be called for all those Ice objects. Removing an identity that is not in + /// the map throws {@link NotRegisteredException}. + /// @return The removed servant. + /// @see Identity + /// @see #add + /// @see #addWithUUID ["swift:nonnull", "swift:attribute:@discardableResult"] Object remove(Identity id); - /** - * - * Like {@link #remove}, but with a facet. Calling remove(id) - * is equivalent to calling {@link #removeFacet} with an empty facet. - * - * @param id The identity of the Ice object that is implemented by - * the servant. - * - * @param facet The facet. An empty facet means the default facet. - * - * @return The removed servant. - * - * @see Identity - * @see #addFacet - * @see #addFacetWithUUID - * - **/ + /// Like {@link #remove}, but with a facet. Calling remove(id) is equivalent to calling + /// {@link #removeFacet} with an empty facet. + /// @param id The identity of the Ice object that is implemented by the servant. + /// @param facet The facet. An empty facet means the default facet. + /// @return The removed servant. + /// @see Identity + /// @see #addFacet + /// @see #addFacetWithUUID ["swift:nonnull", "swift:attribute:@discardableResult"] Object removeFacet(Identity id, string facet); - /** - * - * Remove all facets with the given identity from the Active - * Servant Map. The operation completely removes the Ice object, - * including its default facet. Removing an identity that - * is not in the map throws {@link NotRegisteredException}. - * - * @param id The identity of the Ice object to be removed. - * - * @return A collection containing all the facet names and - * servants of the removed Ice object. - * - * @see #remove - * @see #removeFacet - * - **/ + /// Remove all facets with the given identity from the Active Servant Map. The operation completely removes the Ice + /// object, including its default facet. Removing an identity that is not in the map throws + /// {@link NotRegisteredException}. + /// @param id The identity of the Ice object to be removed. + /// @return A collection containing all the facet names and servants of the removed Ice object. + /// @see #remove + /// @see #removeFacet ["swift:attribute:@discardableResult"] FacetMap removeAllFacets(Identity id); - /** - * - * Remove the default servant for a specific category. Attempting - * to remove a default servant for a category that is not - * registered throws {@link NotRegisteredException}. - * - * @param category The category of the default servant to remove. - * - * @return The default servant. - * - * @see #addDefaultServant - * @see #findDefaultServant - * - **/ + /// Remove the default servant for a specific category. Attempting to remove a default servant for a category that + /// is not registered throws {@link NotRegisteredException}. + /// @param category The category of the default servant to remove. + /// @return The default servant. + /// @see #addDefaultServant + /// @see #findDefaultServant ["swift:nonnull", "swift:attribute:@discardableResult"] Object removeDefaultServant(string category); - /** - * - * Look up a servant in this object adapter's Active Servant Map - * by the identity of the Ice object it implements. - * - *

This operation only tries to look up a servant in - * the Active Servant Map. It does not attempt to find a servant - * by using any installed {@link ServantLocator}. - * - * @param id The identity of the Ice object for which the servant - * should be returned. - * - * @return The servant that implements the Ice object with the - * given identity, or null if no such servant has been found. - * - * @see Identity - * @see #findFacet - * @see #findByProxy - * - **/ + /// Look up a servant in this object adapter's Active Servant Map by the identity of the Ice object it implements. + ///

This operation only tries to look up a servant in the Active Servant Map. It does not attempt + /// to find a servant by using any installed {@link ServantLocator}. + /// @param id The identity of the Ice object for which the servant should be returned. + /// @return The servant that implements the Ice object with the given identity, or null if no such servant has been + /// found. + /// @see Identity + /// @see #findFacet + /// @see #findByProxy ["swift:noexcept", "cpp:const"] Object find(Identity id); - /** - * - * Like {@link #find}, but with a facet. Calling find(id) - * is equivalent to calling {@link #findFacet} with an empty - * facet. - * - * @param id The identity of the Ice object for which the - * servant should be returned. - * - * @param facet The facet. An empty facet means the default - * facet. - * - * @return The servant that implements the Ice object with the - * given identity and facet, or null if no such servant has been - * found. - * - * @see Identity - * @see #find - * @see #findByProxy - * - **/ + /// Like {@link #find}, but with a facet. Calling find(id) is equivalent to calling {@link #findFacet} + /// with an empty facet. + /// @param id The identity of the Ice object for which the servant should be returned. + /// @param facet The facet. An empty facet means the default facet. + /// @return The servant that implements the Ice object with the given identity and facet, or null if no such + /// servant has been found. + /// @see Identity + /// @see #find + /// @see #findByProxy ["swift:noexcept", "cpp:const"] Object findFacet(Identity id, string facet); - /** - * - * Find all facets with the given identity in the Active Servant - * Map. - * - * @param id The identity of the Ice object for which the facets - * should be returned. - * - * @return A collection containing all the facet names and - * servants that have been found, or an empty map if there is no - * facet for the given identity. - * - * @see #find - * @see #findFacet - * - **/ + /// Find all facets with the given identity in the Active Servant Map. + /// @param id The identity of the Ice object for which the facets should be returned. + /// @return A collection containing all the facet names and servants that have been found, or an empty map if there + /// is no facet for the given identity. + /// @see #find + /// @see #findFacet ["swift:noexcept", "cpp:const"] FacetMap findAllFacets(Identity id); - /** - * - * Look up a servant in this object adapter's Active Servant Map, - * given a proxy. - * - *

This operation only tries to lookup a servant in - * the Active Servant Map. It does not attempt to find a servant - * by using any installed {@link ServantLocator}. - * - * @param proxy The proxy for which the servant should be returned. - * - * @return The servant that matches the proxy, or null if no such - * servant has been found. - * - * @see #find - * @see #findFacet - * - **/ + /// Look up a servant in this object adapter's Active Servant Map, given a proxy. + ///

This operation only tries to lookup a servant in the Active Servant Map. It does not attempt to + /// find a servant by using any installed {@link ServantLocator}. + /// @param proxy The proxy for which the servant should be returned. + /// @return The servant that matches the proxy, or null if no such servant has been found. + /// @see #find + /// @see #findFacet ["swift:noexcept", "cpp:const"] Object findByProxy(["swift:nonnull"] Object* proxy); - /** - * - * Add a Servant Locator to this object adapter. Adding a servant - * locator for a category for which a servant locator is already - * registered throws {@link AlreadyRegisteredException}. To dispatch - * operation calls on servants, the object adapter tries to find a - * servant for a given Ice object identity and facet in the - * following order: - * - *

    - * - *
  1. The object adapter tries to find a servant for the identity - * and facet in the Active Servant Map.
  2. - * - *
  3. If no servant has been found in the Active Servant Map, - * the object adapter tries to find a servant locator for the - * category component of the identity. If a locator is found, the - * object adapter tries to find a servant using this locator.
  4. - * - *
  5. If no servant has been found by any of the preceding steps, - * the object adapter tries to find a locator for an empty category, - * regardless of the category contained in the identity. If a - * locator is found, the object adapter tries to find a servant - * using this locator.
  6. - * - *
  7. If no servant has been found by any of the preceding steps, - * the object adapter gives up and the caller receives - * {@link ObjectNotExistException} or {@link FacetNotExistException}.
  8. - * - *
- * - *

Only one locator for the empty category can be - * installed. - * - * @param locator The locator to add. - * - * @param category The category for which the Servant Locator can - * locate servants, or an empty string if the Servant Locator does - * not belong to any specific category. - * - * @see Identity - * @see #removeServantLocator - * @see #findServantLocator - * @see ServantLocator - * - **/ + /// Add a Servant Locator to this object adapter. Adding a servant locator for a category for which a servant + /// locator is already registered throws {@link AlreadyRegisteredException}. To dispatch operation calls on + /// servants, the object adapter tries to find a servant for a given Ice object identity and facet in the following + /// order: + ///

    + ///
  1. The object adapter tries to find a servant for the identity and facet in the Active Servant Map.
  2. + ///
  3. If no servant has been found in the Active Servant Map, the object adapter tries to find a servant locator + /// for the category component of the identity. If a locator is found, the object adapter tries to find a servant + /// using this locator.
  4. + ///
  5. If no servant has been found by any of the preceding steps, the object adapter tries to find a locator for + /// an empty category, regardless of the category contained in the identity. If a locator is found, the object + /// adapter tries to find a servant using this locator.
  6. + ///
  7. If no servant has been found by any of the preceding steps, the object adapter gives up and the caller + /// receives {@link ObjectNotExistException} or {@link FacetNotExistException}.
  8. + ///
+ ///

Only one locator for the empty category can be installed. + /// @param locator The locator to add. + /// @param category The category for which the Servant Locator can locate servants, or an empty string if the + /// Servant Locator does not belong to any specific category. + /// @see Identity + /// @see #removeServantLocator + /// @see #findServantLocator + /// @see ServantLocator void addServantLocator(["swift:nonnull"] ServantLocator locator, string category); - /** - * - * Remove a Servant Locator from this object adapter. - * - * @param category The category for which the Servant Locator can - * locate servants, or an empty string if the Servant Locator does - * not belong to any specific category. - * - * @return The Servant Locator, or throws {@link NotRegisteredException} - * if no Servant Locator was found for the given category. - * - * @see Identity - * @see #addServantLocator - * @see #findServantLocator - * @see ServantLocator - * - **/ + /// Remove a Servant Locator from this object adapter. + /// @param category The category for which the Servant Locator can locate servants, or an empty string if the + /// Servant Locator does not belong to any specific category. + /// @return The Servant Locator, or throws {@link NotRegisteredException} if no Servant Locator was found for the + /// given category. + /// @see Identity + /// @see #addServantLocator + /// @see #findServantLocator + /// @see ServantLocator ["swift:nonnull", "swift:attribute:@discardableResult"] ServantLocator removeServantLocator(string category); - /** - * - * Find a Servant Locator installed with this object adapter. - * - * @param category The category for which the Servant Locator can - * locate servants, or an empty string if the Servant Locator does - * not belong to any specific category. - * - * @return The Servant Locator, or null if no Servant Locator was - * found for the given category. - * - * @see Identity - * @see #addServantLocator - * @see #removeServantLocator - * @see ServantLocator - * - **/ + /// Find a Servant Locator installed with this object adapter. + /// @param category The category for which the Servant Locator can locate servants, or an empty string if the + /// Servant Locator does not belong to any specific category. + /// @return The Servant Locator, or null if no Servant Locator was found for the given category. + /// @see Identity + /// @see #addServantLocator + /// @see #removeServantLocator + /// @see ServantLocator ["swift:noexcept", "cpp:const"] ServantLocator findServantLocator(string category); - /** - * - * Find the default servant for a specific category. - * - * @param category The category of the default servant to find. - * - * @return The default servant or null if no default servant was - * registered for the category. - * - * @see #addDefaultServant - * @see #removeDefaultServant - * - **/ + /// Find the default servant for a specific category. + /// @param category The category of the default servant to find. + /// @return The default servant or null if no default servant was registered for the category. + /// @see #addDefaultServant + /// @see #removeDefaultServant ["swift:noexcept", "cpp:const"] Object findDefaultServant(string category); - /** - * - * Create a proxy for the object with the given identity. If this - * object adapter is configured with an adapter id, the return - * value is an indirect proxy that refers to the adapter id. If - * a replica group id is also defined, the return value is an - * indirect proxy that refers to the replica group id. Otherwise, - * if no adapter id is defined, the return value is a direct - * proxy containing this object adapter's published endpoints. - * - * @param id The object's identity. - * - * @return A proxy for the object with the given identity. - * - * @see Identity - * - **/ + /// Create a proxy for the object with the given identity. If this object adapter is configured with an adapter id, + /// the return value is an indirect proxy that refers to the adapter id. If a replica group id is also defined, the + /// return value is an indirect proxy that refers to the replica group id. Otherwise, if no adapter id is defined, + /// the return value is a direct proxy containing this object adapter's published endpoints. + /// @param id The object's identity. + /// @return A proxy for the object with the given identity. + /// @see Identity ["cpp:const", "swift:nonnull"] Object* createProxy(Identity id); - /** - * - * Create a direct proxy for the object with the given identity. - * The returned proxy contains this object adapter's published - * endpoints. - * - * @param id The object's identity. - * - * @return A proxy for the object with the given identity. - * - * @see Identity - * - **/ + /// Create a direct proxy for the object with the given identity. The returned proxy contains this object adapter's + /// published endpoints. + /// @param id The object's identity. + /// @return A proxy for the object with the given identity. + /// @see Identity ["cpp:const", "swift:nonnull"] Object* createDirectProxy(Identity id); - /** - * - * Create an indirect proxy for the object with the given identity. - * If this object adapter is configured with an adapter id, the - * return value refers to the adapter id. Otherwise, the return - * value contains only the object identity. - * - * @param id The object's identity. - * - * @return A proxy for the object with the given identity. - * - * @see Identity - * - **/ + /// Create an indirect proxy for the object with the given identity. If this object adapter is configured with an + /// adapter id, the return value refers to the adapter id. Otherwise, the return value contains only the object + /// identity. + /// @param id The object's identity. + /// @return A proxy for the object with the given identity. + /// @see Identity ["cpp:const", "swift:nonnull"] Object* createIndirectProxy(Identity id); - /** - * Set an Ice locator for this object adapter. By doing so, the - * object adapter will register itself with the locator registry - * when it is activated for the first time. Furthermore, the proxies - * created by this object adapter will contain the adapter identifier - * instead of its endpoints. The adapter identifier must be configured - * using the AdapterId property. - * - * @param loc The locator used by this object adapter. - * - * @see #createDirectProxy - * @see Locator - * @see LocatorRegistry - * - **/ + /// Set an Ice locator for this object adapter. By doing so, the object adapter will register itself with the + /// locator registry when it is activated for the first time. Furthermore, the proxies created by this object + /// adapter will contain the adapter identifier instead of its endpoints. The adapter identifier must be configured + /// using the AdapterId property. + /// @param loc The locator used by this object adapter. + /// @see #createDirectProxy + /// @see Locator + /// @see LocatorRegistry void setLocator(Locator* loc); - /** - * Get the Ice locator used by this object adapter. - * - * @return The locator used by this object adapter, or null if no locator is - * used by this object adapter. - * - * @see Locator - * @see #setLocator - * - **/ + /// Get the Ice locator used by this object adapter. + /// @return The locator used by this object adapter, or null if no locator is used by this object adapter. + /// @see Locator + /// @see #setLocator ["cpp:const", "cpp:noexcept", "swift:noexcept"] Locator* getLocator(); - /** - * - * Get the set of endpoints configured with this object adapter. - * - * @return The set of endpoints. - * - * @see Endpoint - * - **/ + /// Get the set of endpoints configured with this object adapter. + /// @return The set of endpoints. + /// @see Endpoint ["cpp:const", "cpp:noexcept", "swift:noexcept"] EndpointSeq getEndpoints(); - /** - * Refresh the set of published endpoints. The run time re-reads - * the PublishedEndpoints property if it is set and re-reads the - * list of local interfaces if the adapter is configured to listen - * on all endpoints. This operation is useful to refresh the endpoint - * information that is published in the proxies that are created by - * an object adapter if the network interfaces used by a host changes. - * - **/ + /// Refresh the set of published endpoints. The run time re-reads the PublishedEndpoints property if it is set and + /// re-reads the list of local interfaces if the adapter is configured to listen on all endpoints. This operation + /// is useful to refresh the endpoint information that is published in the proxies that are created by an object + /// adapter if the network interfaces used by a host changes. ["js:async"] void refreshPublishedEndpoints(); - /** - * - * Get the set of endpoints that proxies created by this object - * adapter will contain. - * - * @return The set of published endpoints. - * - * @see #refreshPublishedEndpoints - * @see Endpoint - * - **/ + /// Get the set of endpoints that proxies created by this object adapter will contain. + /// @return The set of published endpoints. + /// @see #refreshPublishedEndpoints + /// @see Endpoint ["cpp:const", "cpp:noexcept", "swift:noexcept"] EndpointSeq getPublishedEndpoints(); - /** - * - * Set of the endpoints that proxies created by this object - * adapter will contain. - * - * @param newEndpoints The new set of endpoints that the object adapter will embed in proxies. - * - * @see #refreshPublishedEndpoints - * @see Endpoint - * - **/ + /// Set of the endpoints that proxies created by this object adapter will contain. + /// @param newEndpoints The new set of endpoints that the object adapter will embed in proxies. + /// @see #refreshPublishedEndpoints + /// @see Endpoint void setPublishedEndpoints(EndpointSeq newEndpoints); #if defined(__SLICE2SWIFT__) || defined(ICE_SWIFT) - /* - * Returns the dispatch queue. - * - * @return The dispatch queue associated wih this Object Adapter. - **/ + /// Returns the dispatch queue. + /// @return The dispatch queue associated wih this Object Adapter. ["cpp:const", "swift:nonnull", "cpp:type:dispatch_queue_t", "swift:type:Dispatch.DispatchQueue"] LocalObject getDispatchQueue(); #endif diff --git a/slice/Ice/ObjectFactory.ice b/slice/Ice/ObjectFactory.ice index 7c8ff8323db..04bb7877eb6 100644 --- a/slice/Ice/ObjectFactory.ice +++ b/slice/Ice/ObjectFactory.ice @@ -27,42 +27,21 @@ module Ice { #if !defined(__SLICE2PHP__) && !defined(__SLICE2SWIFT__) -/** - * - * A factory for objects. Object factories are used when receiving "objects by value". - * An object factory must be implemented by the application writer and registered - * with the communicator. - * - **/ +/// A factory for objects. Object factories are used when receiving "objects by value". An object factory must be +/// implemented by the application writer and registered with the communicator. ["deprecate:ObjectFactory has been deprecated, use ValueFactory instead."] local interface ObjectFactory { - /** - * - * Create a new object for a given object type. The type is the - * absolute Slice type id, i.e., the id relative to the - * unnamed top-level Slice module. For example, the absolute - * Slice type id for interfaces of type Bar in the module - * Foo is "::Foo::Bar". - * - *

The leading "::" is required. - * - * @param type The object type. - * - * @return The object created for the given type, or nil if the - * factory is unable to create the object. - * - **/ + /// Create a new object for a given object type. The type is the absolute Slice type id, i.e., the id relative to + /// the unnamed top-level Slice module. For example, the absolute Slice type id for interfaces of type + /// Bar in the module Foo is "::Foo::Bar". + ///

The leading "::" is required. + /// @param type The object type. + /// @return The object created for the given type, or nil if the factory is unable to create the object. Value create(string type); - /** - * - * Called when the factory is removed from the communicator, or if - * the communicator is destroyed. - * - * @see Communicator#destroy - * - **/ + /// Called when the factory is removed from the communicator, or if the communicator is destroyed. + /// @see Communicator#destroy void destroy(); } diff --git a/slice/Ice/Plugin.ice b/slice/Ice/Plugin.ice index 87821fa7324..b1af3b370a3 100644 --- a/slice/Ice/Plugin.ice +++ b/slice/Ice/Plugin.ice @@ -31,98 +31,47 @@ module Ice { #if !defined(__SLICE2PHP__) -/** - * - * A communicator plug-in. A plug-in generally adds a feature to a - * communicator, such as support for a protocol. - * - * The communicator loads its plug-ins in two stages: the first stage - * creates the plug-ins, and the second stage invokes {@link Plugin#initialize} on - * each one. - * - **/ +/// A communicator plug-in. A plug-in generally adds a feature to a communicator, such as support for a protocol. +/// The communicator loads its plug-ins in two stages: the first stage creates the plug-ins, and the second stage +/// invokes {@link Plugin#initialize} on each one. local interface Plugin { - /** - * - * Perform any necessary initialization steps. - * - **/ + /// Perform any necessary initialization steps. void initialize(); - /** - * - * Called when the communicator is being destroyed. - * - **/ + /// Called when the communicator is being destroyed. void destroy(); } -/** - * - * Each communicator has a plug-in manager to administer the set of - * plug-ins. - * - **/ +/// Each communicator has a plug-in manager to administer the set of plug-ins. local interface PluginManager { - /** - * - * Initialize the configured plug-ins. The communicator automatically initializes - * the plug-ins by default, but an application may need to interact directly with - * a plug-in prior to initialization. In this case, the application must set - * Ice.InitPlugins=0 and then invoke {@link #initializePlugins} - * manually. The plug-ins are initialized in the order in which they are loaded. - * If a plug-in raises an exception during initialization, the communicator - * invokes destroy on the plug-ins that have already been initialized. - * - * @throws InitializationException Raised if the plug-ins have already been initialized. - * - **/ + /// Initialize the configured plug-ins. The communicator automatically initializes the plug-ins by default, but an + /// application may need to interact directly with a plug-in prior to initialization. In this case, the application + /// must set Ice.InitPlugins=0 and then invoke {@link #initializePlugins} manually. The plug-ins are + /// initialized in the order in which they are loaded. If a plug-in raises an exception during initialization, the + /// communicator invokes destroy on the plug-ins that have already been initialized. + /// @throws InitializationException Raised if the plug-ins have already been initialized. void initializePlugins(); - /** - * - * Get a list of plugins installed. - * - * @return The names of the plugins installed. - * - * @see #getPlugin - * - **/ + /// Get a list of plugins installed. + /// @return The names of the plugins installed. + /// @see #getPlugin ["cpp:noexcept", "swift:noexcept"] StringSeq getPlugins(); - /** - * - * Obtain a plug-in by name. - * - * @param name The plug-in's name. - * - * @return The plug-in. - * - * @throws NotRegisteredException Raised if no plug-in is found with the given name. - * - **/ + /// Obtain a plug-in by name. + /// @param name The plug-in's name. + /// @return The plug-in. + /// @throws NotRegisteredException Raised if no plug-in is found with the given name. Plugin getPlugin(string name); - /** - * - * Install a new plug-in. - * - * @param name The plug-in's name. - * - * @param pi The plug-in. - * - * @throws AlreadyRegisteredException Raised if a plug-in already exists with the given name. - * - **/ + /// Install a new plug-in. + /// @param name The plug-in's name. + /// @param pi The plug-in. + /// @throws AlreadyRegisteredException Raised if a plug-in already exists with the given name. void addPlugin(string name, Plugin pi); - /** - * - * Called when the communicator is being destroyed. - * - **/ + /// Called when the communicator is being destroyed. ["cpp:noexcept", "swift:noexcept"] void destroy(); } diff --git a/slice/Ice/Process.ice b/slice/Ice/Process.ice index 4921e6a62c7..db160de4534 100644 --- a/slice/Ice/Process.ice +++ b/slice/Ice/Process.ice @@ -25,40 +25,19 @@ ["objc:prefix:ICE"] module Ice { - -/** - * - * An administrative interface for process management. Managed servers must - * implement this interface. - * - *

A servant implementing this interface is a potential target - * for denial-of-service attacks, therefore proper security precautions - * should be taken. For example, the servant can use a UUID to make its - * identity harder to guess, and be registered in an object adapter with - * a secured endpoint. - * - **/ -interface Process -{ - /** - * - * Initiate a graceful shut-down. - * - * @see Communicator#shutdown - * - **/ - void shutdown(); - - /** - * - * Write a message on the process' stdout or stderr. - * - * @param message The message. - * - * @param fd 1 for stdout, 2 for stderr. - * - **/ - void writeMessage(string message, int fd); -} - + /// An administrative interface for process management. Managed servers must implement this interface. + ///

A servant implementing this interface is a potential target for denial-of-service attacks, + /// therefore proper security precautions should be taken. For example, the servant can use a UUID to make its + /// identity harder to guess, and be registered in an object adapter with a secured endpoint. + interface Process + { + /// Initiate a graceful shut-down. + /// @see Communicator#shutdown + void shutdown(); + + /// Write a message on the process' stdout or stderr. + /// @param message The message. + /// @param fd 1 for stdout, 2 for stderr. + void writeMessage(string message, int fd); + } } diff --git a/slice/Ice/ProcessF.ice b/slice/Ice/ProcessF.ice index 9222f74f92c..386055d5864 100644 --- a/slice/Ice/ProcessF.ice +++ b/slice/Ice/ProcessF.ice @@ -25,7 +25,5 @@ ["objc:prefix:ICE"] module Ice { - -interface Process; - + interface Process; } diff --git a/slice/Ice/Properties.ice b/slice/Ice/Properties.ice index 6b8d42a9778..a5c6a269779 100644 --- a/slice/Ice/Properties.ice +++ b/slice/Ice/Properties.ice @@ -30,212 +30,98 @@ module Ice #if !defined(__SLICE2PHP__) -/** - * - * A property set used to configure Ice and Ice applications. - * Properties are key/value pairs, with both keys and values - * being strings. By convention, property keys should have the form - * application-name[.category[.sub-category]].name. - * - **/ +/// A property set used to configure Ice and Ice applications. Properties are key/value pairs, with both keys and +/// values being strings. By convention, property keys should have the form +/// application-name[.category[.sub-category]].name. local interface Properties { - /** - * - * Get a property by key. If the property is not set, an empty - * string is returned. - * - * @param key The property key. - * - * @return The property value. - * - * @see #setProperty - * - **/ + /// Get a property by key. If the property is not set, an empty string is returned. + /// @param key The property key. + /// @return The property value. + /// @see #setProperty ["cpp:noexcept", "swift:noexcept"] string getProperty(string key); - /** - * - * Get a property by key. If the property is not set, the - * given default value is returned. - * - * @param key The property key. - * - * @param value The default value to use if the property does not - * exist. - * - * @return The property value or the default value. - * - * @see #setProperty - * - **/ + /// Get a property by key. If the property is not set, the given default value is returned. + /// @param key The property key. + /// @param value The default value to use if the property does not exist. + /// @return The property value or the default value. + /// @see #setProperty ["cpp:noexcept", "swift:noexcept"] string getPropertyWithDefault(string key, string \value); - /** - * - * Get a property as an integer. If the property is not set, 0 - * is returned. - * - * @param key The property key. - * - * @return The property value interpreted as an integer. - * - * @see #setProperty - * - **/ + /// Get a property as an integer. If the property is not set, 0 is returned. + /// @param key The property key. + /// @return The property value interpreted as an integer. + /// @see #setProperty ["cpp:noexcept", "swift:noexcept"] int getPropertyAsInt(string key); - /** - * - * Get a property as an integer. If the property is not set, the - * given default value is returned. - * - * @param key The property key. - * - * @param value The default value to use if the property does not - * exist. - * - * @return The property value interpreted as an integer, or the - * default value. - * - * @see #setProperty - * - **/ + /// Get a property as an integer. If the property is not set, the given default value is returned. + /// @param key The property key. + /// @param value The default value to use if the property does not exist. + /// @return The property value interpreted as an integer, or the default value. + /// @see #setProperty ["cpp:noexcept", "swift:noexcept"] int getPropertyAsIntWithDefault(string key, int \value); - /** - * - * Get a property as a list of strings. The strings must be - * separated by whitespace or comma. If the property is not set, - * an empty list is returned. The strings in the list can contain - * whitespace and commas if they are enclosed in single or double - * quotes. If quotes are mismatched, an empty list is returned. - * Within single quotes or double quotes, you can escape the - * quote in question with a backslash, e.g. O'Reilly can be written as - * O'Reilly, "O'Reilly" or 'O\'Reilly'. - * - * @param key The property key. - * - * @return The property value interpreted as a list of strings. - * - * @see #setProperty - * - **/ + /// Get a property as a list of strings. The strings must be separated by whitespace or comma. If the property is + /// not set, an empty list is returned. The strings in the list can contain whitespace and commas if they are + /// enclosed in single or double quotes. If quotes are mismatched, an empty list is returned. Within single quotes + /// or double quotes, you can escape the quote in question with a backslash, e.g. O'Reilly can be written as + /// O'Reilly, "O'Reilly" or 'O\'Reilly'. + /// @param key The property key. + /// @return The property value interpreted as a list of strings. + /// @see #setProperty ["cpp:noexcept", "swift:noexcept"] StringSeq getPropertyAsList(string key); - /** - * - * Get a property as a list of strings. The strings must be - * separated by whitespace or comma. If the property is not set, - * the default list is returned. The strings in the list can contain - * whitespace and commas if they are enclosed in single or double - * quotes. If quotes are mismatched, the default list is returned. - * Within single quotes or double quotes, you can escape the - * quote in question with a backslash, e.g. O'Reilly can be written as - * O'Reilly, "O'Reilly" or 'O\'Reilly'. - * - * @param key The property key. - * - * @param value The default value to use if the property is not set. - * - * @return The property value interpreted as list of strings, or the - * default value. - * - * @see #setProperty - * - **/ + /// Get a property as a list of strings. The strings must be separated by whitespace or comma. If the property is + /// not set, the default list is returned. The strings in the list can contain whitespace and commas if they are + /// enclosed in single or double quotes. If quotes are mismatched, the default list is returned. Within single + /// quotes or double quotes, you can escape the quote in question with a backslash, e.g. O'Reilly can be written as + /// O'Reilly, "O'Reilly" or 'O\'Reilly'. + /// @param key The property key. + /// @param value The default value to use if the property is not set. + /// @return The property value interpreted as list of strings, or the default value. + /// @see #setProperty ["cpp:noexcept", "swift:noexcept"] StringSeq getPropertyAsListWithDefault(string key, StringSeq \value); - /** - * - * Get all properties whose keys begins with - * prefix. If - * prefix is an empty string, - * then all properties are returned. - * - * @param prefix The prefix to search for (empty string if none). - * @return The matching property set. - * - **/ + /// Get all properties whose keys begins with prefix. If prefix is an empty string, then all + /// properties are returned. + /// @param prefix The prefix to search for (empty string if none). + /// @return The matching property set. ["cpp:noexcept", "swift:noexcept"] PropertyDict getPropertiesForPrefix(string prefix); - /** - * - * Set a property. To unset a property, set it to - * the empty string. - * - * @param key The property key. - * @param value The property value. - * - * @see #getProperty - * - **/ + /// Set a property. To unset a property, set it to the empty string. + /// @param key The property key. + /// @param value The property value. + /// @see #getProperty ["swift:noexcept"] void setProperty(string key, string \value); - /** - * - * Get a sequence of command-line options that is equivalent to - * this property set. Each element of the returned sequence is - * a command-line option of the form - * --key=value. - * - * @return The command line options for this property set. - * - **/ + /// Get a sequence of command-line options that is equivalent to this property set. Each element of the returned + /// sequence is a command-line option of the form --key=value. + /// @return The command line options for this property set. ["cpp:noexcept", "swift:noexcept"] StringSeq getCommandLineOptions(); - /** - * - * Convert a sequence of command-line options into properties. - * All options that begin with - * --prefix. are - * converted into properties. If the prefix is empty, all options - * that begin with -- are converted to properties. - * - * @param prefix The property prefix, or an empty string to - * convert all options starting with --. - * - * @param options The command-line options. - * - * @return The command-line options that do not start with the specified - * prefix, in their original order. - * - **/ + /// Convert a sequence of command-line options into properties. All options that begin with + /// --prefix. are converted into properties. If the prefix is empty, all options that begin with + /// -- are converted to properties. + /// @param prefix The property prefix, or an empty string to convert all options starting with --. + /// @param options The command-line options. + /// @return The command-line options that do not start with the specified prefix, in their original order. StringSeq parseCommandLineOptions(string prefix, StringSeq options); - /** - * - * Convert a sequence of command-line options into properties. - * All options that begin with one of the following prefixes - * are converted into properties: --Ice, --IceBox, --IceGrid, - * --IcePatch2, --IceSSL, --IceStorm, --Freeze, and --Glacier2. - * - * @param options The command-line options. - * - * @return The command-line options that do not start with one of - * the listed prefixes, in their original order. - * - **/ + /// Convert a sequence of command-line options into properties. All options that begin with one of the following + /// prefixes are converted into properties: --Ice, --IceBox, --IceGrid, + /// --IcePatch2, --IceSSL, --IceStorm, --Freeze, and --Glacier2. + /// @param options The command-line options. + /// @return The command-line options that do not start with one of the listed prefixes, in their original order. StringSeq parseIceCommandLineOptions(StringSeq options); #ifndef __SLICE2JS__ - /** - * - * Load properties from a file. - * - * @param file The property file. - * - **/ + /// Load properties from a file. + /// @param file The property file. void load(string file); #endif - /** - * - * Create a copy of this property set. - * - * @return A copy of this property set. - * - **/ + /// Create a copy of this property set. + /// @return A copy of this property set. ["cpp:noexcept", "swift:noexcept", "swift:nonnull"] Properties clone(); } diff --git a/slice/Ice/PropertiesAdmin.ice b/slice/Ice/PropertiesAdmin.ice index a99ec66e1d3..16e8cd15ecf 100644 --- a/slice/Ice/PropertiesAdmin.ice +++ b/slice/Ice/PropertiesAdmin.ice @@ -27,61 +27,30 @@ ["objc:prefix:ICE"] module Ice { - -/** - * - * A simple collection of properties, represented as a dictionary of - * key/value pairs. Both key and value are strings. - * - * @see Properties#getPropertiesForPrefix - * - **/ -dictionary PropertyDict; - -/** - * - * The PropertiesAdmin interface provides remote access to the properties - * of a communicator. - * - **/ -interface PropertiesAdmin -{ - /** - * - * Get a property by key. If the property is not set, an empty - * string is returned. - * - * @param key The property key. - * - * @return The property value. - * - **/ - string getProperty(string key); - - /** - * - * Get all properties whose keys begin with prefix. If - * prefix is an empty string then all properties are returned. - * - * @param prefix The prefix to search for (empty string if none). - * @return The matching property set. - * - **/ - ["java:type:java.util.TreeMap"] PropertyDict getPropertiesForPrefix(string prefix); - - /** - * - * Update the communicator's properties with the given property set. - * - * @param newProperties Properties to be added, changed, or removed. - * If an entry in newProperties matches the name of an existing property, - * that property's value is replaced with the new value. If the new value - * is an empty string, the property is removed. Any existing properties - * that are not modified or removed by the entries in newProperties are - * retained with their original values. - * - **/ - void setProperties(PropertyDict newProperties); -} - + /// A simple collection of properties, represented as a dictionary of key/value pairs. Both key and value are + /// strings. + /// @see Properties#getPropertiesForPrefix + dictionary PropertyDict; + + /// The PropertiesAdmin interface provides remote access to the properties of a communicator. + interface PropertiesAdmin + { + /// Get a property by key. If the property is not set, an empty string is returned. + /// @param key The property key. + /// @return The property value. + string getProperty(string key); + + /// Get all properties whose keys begin with prefix. If prefix is an empty string then all + /// properties are returned. + /// @param prefix The prefix to search for (empty string if none). + /// @return The matching property set. + ["java:type:java.util.TreeMap"] PropertyDict getPropertiesForPrefix(string prefix); + + /// Update the communicator's properties with the given property set. If an entry in newProperties + /// matches the name of an existing property, that property's value is replaced with the new value. If the new + /// value is an empty string, the property is removed. Any existing properties that are not modified or removed + /// by the entries in newProperties are retained with their original values. + /// @param newProperties Properties to be added, changed, or removed. + void setProperties(PropertyDict newProperties); + } } diff --git a/slice/Ice/RemoteLogger.ice b/slice/Ice/RemoteLogger.ice index 6ef8db1240a..5fcf1c874da 100644 --- a/slice/Ice/RemoteLogger.ice +++ b/slice/Ice/RemoteLogger.ice @@ -28,199 +28,100 @@ ["objc:prefix:ICE"] module Ice { - -/** - * - * An enumeration representing the different types of log messages. - * - **/ -enum LogMessageType -{ - /** - * - * The {@link Logger} received a print message. - * - **/ - PrintMessage, - - /** - * - * The {@link Logger} received a trace message. - * - **/ - TraceMessage, - - /** - * - * The {@link Logger} received a warning message. - * - **/ - WarningMessage, - - /** - * - * The {@link Logger} received an error message. - * - **/ - ErrorMessage -} - -/** - * - * A sequence of {@link LogMessageType} - * - **/ -sequence LogMessageTypeSeq; - -/** - * - * A complete log message. - * - **/ -struct LogMessage -{ - /** - * - * The type of message sent to the {@link Logger}. - * - **/ - LogMessageType type; - - /** - * - * The date and time when the {@link Logger} received this message, expressed - * as the number of microseconds since the Unix Epoch (00:00:00 UTC on 1 January 1970) - * - **/ - long timestamp; - - /** - * - * For a message of type trace, the trace category of this log message; - * otherwise, the empty string. - * - **/ - string traceCategory; - - /** - * - * The log message itself. - * - **/ - string message; -} - -/** - * - * A sequence of {@link LogMessage}. - * - **/ -["cpp:type:std::list"] -sequence LogMessageSeq; - -/** - * - * The Ice remote logger interface. An application can implement a - * RemoteLogger to receive the log messages sent to the local {@link Logger} - * of another Ice application. - * - **/ -interface RemoteLogger -{ - /** - * - * init is called by attachRemoteLogger when a RemoteLogger proxy is attached. - * - * @param prefix The prefix of the associated local Logger. - * - * @param logMessages Old log messages generated before "now". - * - **/ - void init(string prefix, LogMessageSeq logMessages); - - /** - * - * Log a LogMessage. Note that log may be called by LoggerAdmin before init. - * - * @param message The message to log. - * - **/ - void log(LogMessage message); -} - -/** - * - * Thrown when the provided RemoteLogger was previously attached to a LoggerAdmin. - * - **/ -exception RemoteLoggerAlreadyAttachedException -{ -} - -/** - * - * The interface of the admin object that allows an Ice application the attach its - * {@link RemoteLogger} to the {@link Logger} of this admin object's Ice communicator. - * - **/ -interface LoggerAdmin -{ - /** - * - * Attaches a RemoteLogger object to the local logger. - * attachRemoteLogger calls init on the provided RemoteLogger proxy. - * - * @param prx A proxy to the remote logger. - * - * @param messageTypes The list of message types that the remote logger wishes to receive. - * An empty list means no filtering (send all message types). - * - * @param traceCategories The categories of traces that the remote logger wishes to receive. - * This parameter is ignored if messageTypes is not empty and does not include trace. - * An empty list means no filtering (send all trace categories). - * - * @param messageMax The maximum number of log messages (of all types) to be provided - * to init. A negative value requests all messages available. - * - * @throws RemoteLoggerAlreadyAttachedException Raised if this remote logger is already - * attached to this admin object. - * - **/ - void attachRemoteLogger(RemoteLogger* prx, LogMessageTypeSeq messageTypes, StringSeq traceCategories, - int messageMax) - throws RemoteLoggerAlreadyAttachedException; - - /** - * - * Detaches a RemoteLogger object from the local logger. - * - * @param prx A proxy to the remote logger. - * - * @return True if the provided remote logger proxy was detached, and false otherwise. - * - **/ - bool detachRemoteLogger(RemoteLogger* prx); - - /** - * - * Retrieves log messages recently logged. - * - * @param messageTypes The list of message types that the caller wishes to receive. - * An empty list means no filtering (send all message types). - * - * @param traceCategories The categories of traces that caller wish to receive. - * This parameter is ignored if messageTypes is not empty and does not include trace. - * An empty list means no filtering (send all trace categories). - * - * @param messageMax The maximum number of log messages (of all types) to be returned. - * A negative value requests all messages available. - * - * @param prefix The prefix of the associated local logger. - * - * @return The Log messages. - * - **/ - LogMessageSeq getLog(LogMessageTypeSeq messageTypes, StringSeq traceCategories, int messageMax, out string prefix); -} - + /// An enumeration representing the different types of log messages. + enum LogMessageType + { + /// The {@link Logger} received a print message. + PrintMessage, + + /// The {@link Logger} received a trace message. + TraceMessage, + + /// The {@link Logger} received a warning message. + WarningMessage, + + /// The {@link Logger} received an error message. + ErrorMessage + } + + /// A sequence of {@link LogMessageType} + sequence LogMessageTypeSeq; + + /// A complete log message. + struct LogMessage + { + /// The type of message sent to the {@link Logger}. + LogMessageType type; + + /// The date and time when the {@link Logger} received this message, expressed as the number of microseconds + /// since the Unix Epoch (00:00:00 UTC on 1 January 1970) + long timestamp; + + /// For a message of type trace, the trace category of this log message; otherwise, the empty string. + string traceCategory; + + /// The log message itself. + string message; + } + + /// A sequence of {@link LogMessage}. + ["cpp:type:std::list"] + sequence LogMessageSeq; + + /// The Ice remote logger interface. An application can implement a RemoteLogger to receive the log messages sent + /// to the local {@link Logger} of another Ice application. + interface RemoteLogger + { + /// init is called by attachRemoteLogger when a RemoteLogger proxy is attached. + /// @param prefix The prefix of the associated local Logger. + /// @param logMessages Old log messages generated before "now". + void init(string prefix, LogMessageSeq logMessages); + + /// Log a LogMessage. Note that log may be called by LoggerAdmin before init. + /// @param message The message to log. + void log(LogMessage message); + } + + /// Thrown when the provided RemoteLogger was previously attached to a LoggerAdmin. + exception RemoteLoggerAlreadyAttachedException + { + } + + /// The interface of the admin object that allows an Ice application the attach its + /// {@link RemoteLogger} to the {@link Logger} of this admin object's Ice communicator. + interface LoggerAdmin + { + /// Attaches a RemoteLogger object to the local logger. attachRemoteLogger calls init on the provided + /// RemoteLogger proxy. + /// @param prx A proxy to the remote logger. + /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means + /// no filtering (send all message types). + /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is + /// ignored if messageTypes is not empty and does not include trace. An empty list means no filtering (send all + /// trace categories). + /// @param messageMax The maximum number of log messages (of all types) to be provided to init. A negative + /// value requests all messages available. + /// @throws RemoteLoggerAlreadyAttachedException Raised if this remote logger is already attached to this admin + /// object. + void attachRemoteLogger(RemoteLogger* prx, LogMessageTypeSeq messageTypes, StringSeq traceCategories, + int messageMax) + throws RemoteLoggerAlreadyAttachedException; + + /// Detaches a RemoteLogger object from the local logger. + /// @param prx A proxy to the remote logger. + /// @return True if the provided remote logger proxy was detached, and false otherwise. + bool detachRemoteLogger(RemoteLogger* prx); + + /// Retrieves log messages recently logged. + /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no + /// filtering (send all message types). + /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if + /// messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace + /// categories). + /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value + /// requests all messages available. + /// @param prefix The prefix of the associated local logger. + /// @return The Log messages. + LogMessageSeq getLog(LogMessageTypeSeq messageTypes, StringSeq traceCategories, int messageMax, out string prefix); + } } diff --git a/slice/Ice/Router.ice b/slice/Ice/Router.ice index 911fba9ae09..41fa7486aa2 100644 --- a/slice/Ice/Router.ice +++ b/slice/Ice/Router.ice @@ -28,75 +28,37 @@ module Ice { -/** - * - * The Ice router interface. Routers can be set either globally with - * {@link Communicator#setDefaultRouter}, or with ice_router on specific - * proxies. - * - **/ +/// The Ice router interface. Routers can be set either globally with {@link Communicator#setDefaultRouter}, or with +/// ice_router on specific proxies. interface Router { - /** - * - * Get the router's client proxy, i.e., the proxy to use for - * forwarding requests from the client to the router. - * - * If a null proxy is returned, the client will forward requests - * to the router's endpoints. - * - * @param hasRoutingTable Indicates whether or not the router supports a routing - * table. If it is supported, the Ice runtime will call addProxies to populate the - * routing table. This out parameter is only supported starting with Ice 3.7. - * The Ice runtime assumes the router has a routing table if the optional is not - * set. - * - * @return The router's client proxy. - * - **/ - ["nonmutating", "cpp:const"] idempotent Object* getClientProxy(out optional(1) bool hasRoutingTable); + /// Get the router's client proxy, i.e., the proxy to use for forwarding requests from the client to the router. + /// If a null proxy is returned, the client will forward requests to the router's endpoints. + /// @param hasRoutingTable Indicates whether or not the router supports a routing table. If it is supported, the + /// Ice runtime will call addProxies to populate the routing table. This out parameter is only supported starting + /// with Ice 3.7. + /// The Ice runtime assumes the router has a routing table if the hasRoutingTable is not set. + /// @return The router's client proxy. + ["nonmutating", "cpp:const"] idempotent Object* getClientProxy(out tag(1) bool hasRoutingTable); - /** - * - * Get the router's server proxy, i.e., the proxy to use for - * forwarding requests from the server to the router. - * - * @return The router's server proxy. - * - **/ + /// Get the router's server proxy, i.e., the proxy to use for forwarding requests from the server to the router. + /// @return The router's server proxy. ["nonmutating", "cpp:const"] idempotent Object* getServerProxy(); - /** - * - * Add new proxy information to the router's routing table. - * - * @param proxies The proxies to add. - * - * @return Proxies discarded by the router. - * - **/ + /// Add new proxy information to the router's routing table. + /// @param proxies The proxies to add. + /// @return Proxies discarded by the router. idempotent ObjectProxySeq addProxies(ObjectProxySeq proxies); } -/** - * - * This interface should be implemented by services implementing the - * Ice::Router interface. It should be advertised through an Ice - * object with the identity `Ice/RouterFinder'. This allows clients to - * retrieve the router proxy with just the endpoint information of the - * service. - * - **/ +/// This interface should be implemented by services implementing the Ice::Router interface. It should be advertised +/// through an Ice object with the identity `Ice/RouterFinder'. This allows clients to retrieve the router proxy with +/// just the endpoint information of the service. interface RouterFinder { - /** - * - * Get the router proxy implemented by the process hosting this - * finder object. The proxy might point to several replicas. - * - * @return The router proxy. - * - **/ + /// Get the router proxy implemented by the process hosting this finder object. The proxy might point to several + /// replicas. + /// @return The router proxy. Router* getRouter(); } diff --git a/slice/Ice/RouterF.ice b/slice/Ice/RouterF.ice index 6200e3e7ca5..8fa33b70102 100644 --- a/slice/Ice/RouterF.ice +++ b/slice/Ice/RouterF.ice @@ -25,7 +25,5 @@ ["objc:prefix:ICE"] module Ice { - -interface Router; - + interface Router; } diff --git a/slice/Ice/ServantLocator.ice b/slice/Ice/ServantLocator.ice index f43661180a1..45d435c4d26 100644 --- a/slice/Ice/ServantLocator.ice +++ b/slice/Ice/ServantLocator.ice @@ -29,107 +29,58 @@ module Ice { -/** - * - * A servant locator is called by an object adapter to - * locate a servant that is not found in its active servant map. - * - * @see ObjectAdapter - * @see ObjectAdapter#addServantLocator - * @see ObjectAdapter#findServantLocator - * - **/ +/// A servant locator is called by an object adapter to locate a servant that is not found in its active servant map. +/// @see ObjectAdapter +/// @see ObjectAdapter#addServantLocator +/// @see ObjectAdapter#findServantLocator local interface ServantLocator { - /** - * - * Called before a request is dispatched if a - * servant cannot be found in the object adapter's active servant - * map. Note that the object adapter does not automatically insert - * the returned servant into its active servant map. This must be - * done by the servant locator implementation, if this is desired. - * - * locate can throw any user exception. If it does, that exception - * is marshaled back to the client. If the Slice definition for the - * corresponding operation includes that user exception, the client - * receives that user exception; otherwise, the client receives - * {@link UnknownUserException}. - * - * If locate throws any exception, the Ice run time does not - * call finished. - * - *

If you call locate from your own code, you - * must also call finished when you have finished using the - * servant, provided that locate returned a non-null servant; - * otherwise, you will get undefined behavior if you use - * servant locators such as the Freeze Evictor. - * - * @param curr Information about the current operation for which - * a servant is required. - * - * @param cookie A "cookie" that will be passed to finished. - * - * @return The located servant, or null if no suitable servant has - * been found. - * - * @throws UserException The implementation can raise a UserException - * and the run time will marshal it as the result of the invocation. - * - * @see ObjectAdapter - * @see Current - * @see #finished - * - **/ + /// Called before a request is dispatched if a servant cannot be found in the object adapter's active servant map. + /// Note that the object adapter does not automatically insert the returned servant into its active servant map. + /// This must be done by the servant locator implementation, if this is desired. locate can throw any + /// user exception. If it does, that exception is marshaled back to the client. If the Slice definition for the + /// corresponding operation includes that user exception, the client receives that user exception; otherwise, the + /// client receives {@link UnknownUserException}. + /// If locate throws any exception, the Ice run time does notcall finished. + ///

If you call locate from your own code, you must also call finished + /// when you have finished using the servant, provided that locate returned a non-null servant; + /// otherwise, you will get undefined behavior if you use servant locators such as the Freeze Evictor. + /// @param curr Information about the current operation for which a servant is required. + /// @param cookie A "cookie" that will be passed to finished. + /// @return The located servant, or null if no suitable servant has been found. + /// @throws UserException The implementation can raise a UserException and the run time will marshal it as the + /// result of the invocation. + /// @see ObjectAdapter + /// @see Current + /// @see #finished ["java:UserException"] Object locate(Current curr, out LocalObject cookie); - /** - * - * Called by the object adapter after a request has been - * made. This operation is only called if locate was called - * prior to the request and returned a non-null servant. This - * operation can be used for cleanup purposes after a request. - * - * finished can throw any user exception. If it does, that exception - * is marshaled back to the client. If the Slice definition for the - * corresponding operation includes that user exception, the client - * receives that user exception; otherwise, the client receives - * {@link UnknownUserException}. - * - * If both the operation and finished throw an exception, the - * exception thrown by finished is marshaled back to the client. - * - * @param curr Information about the current operation call for - * which a servant was located by locate. - * - * @param servant The servant that was returned by locate. - * - * @param cookie The cookie that was returned by locate. - * - * @throws UserException The implementation can raise a UserException - * and the run time will marshal it as the result of the invocation. - * - * @see ObjectAdapter - * @see Current - * @see #locate - * - **/ + /// Called by the object adapter after a request has been made. This operation is only called if + /// locate was called prior to the request and returned a non-null servant. This operation can be used + /// for cleanup purposes after a request. + /// finished can throw any user exception. If it does, that exception is marshaled back to the client. + /// If the Slice definition for the corresponding operation includes that user exception, the client receives that + /// user exception; otherwise, the client receives {@link UnknownUserException}. + /// If both the operation and finished throw an exception, the exception thrown by + /// finished is marshaled back to the client. + /// @param curr Information about the current operation call for which a servant was located by + /// locate. + /// @param servant The servant that was returned by locate. + /// @param cookie The cookie that was returned by locate. + /// @throws UserException The implementation can raise a UserException and the run time will marshal it as the + /// result of the invocation. + /// @see ObjectAdapter + /// @see Current + /// @see #locate ["java:UserException"] void finished(Current curr, ["swift:nonnull"] Object servant, LocalObject cookie); - /** - * - * Called when the object adapter in which this servant locator is - * installed is destroyed. - * - * @param category Indicates for which category the servant locator - * is being deactivated. - * - * @see ObjectAdapter#destroy - * @see Communicator#shutdown - * @see Communicator#destroy - * - **/ + /// Called when the object adapter in which this servant locator is installed is destroyed. + /// @param category Indicates for which category the servant locator is being deactivated. + /// @see ObjectAdapter#destroy + /// @see Communicator#shutdown + /// @see Communicator#destroy ["swift:noexcept"] void deactivate(string category); } diff --git a/slice/Ice/ValueFactory.ice b/slice/Ice/ValueFactory.ice index e2c6516cfcc..7b444413c5e 100644 --- a/slice/Ice/ValueFactory.ice +++ b/slice/Ice/ValueFactory.ice @@ -27,105 +27,51 @@ module Ice { #if !defined(__SLICE2PHP__) -/** - * - * A factory for values. Value factories are used in several - * places, such as when Ice receives a class instance and - * when Freeze restores a persistent value. Value factories - * must be implemented by the application writer and registered - * with the communicator. - * - **/ +/// A factory for values. Value factories are used in several places, such as when Ice receives a class instance and +/// when Freeze restores a persistent value. Value factories must be implemented by the application writer and +/// registered with the communicator. ["delegate"] local interface ValueFactory { - /** - * - * Create a new value for a given value type. The type is the - * absolute Slice type id, i.e., the id relative to the - * unnamed top-level Slice module. For example, the absolute - * Slice type id for an interface Bar in the module - * Foo is "::Foo::Bar". - * - * Note that the leading "::" is required. - * - * @param type The value type. - * - * @return The value created for the given type, or nil if the - * factory is unable to create the value. - * - **/ + /// Create a new value for a given value type. The type is the absolute Slice type id, i.e., the id relative to the + /// unnamed top-level Slice module. For example, the absolute Slice type id for an interface Bar in + /// the module Foo is "::Foo::Bar". + /// Note that the leading "::" is required. + /// @param type The value type. + /// @return The value created for the given type, or nil if the factory is unable to create the value. ["swift:noexcept"] Value create(string type); } -/** - * - * A value factory manager maintains a collection of value factories. - * An application can supply a custom implementation during communicator - * initialization, otherwise Ice provides a default implementation. - * - * @see ValueFactory - * - **/ +/// A value factory manager maintains a collection of value factories. An application can supply a custom +/// implementation during communicator initialization, otherwise Ice provides a default implementation. +/// @see ValueFactory local interface ValueFactoryManager { - /** - * - * Add a value factory. Attempting to add a factory with an id for - * which a factory is already registered throws AlreadyRegisteredException. - * - * When unmarshaling an Ice value, the Ice run time reads the - * most-derived type id off the wire and attempts to create an - * instance of the type using a factory. If no instance is created, - * either because no factory was found, or because all factories - * returned nil, the behavior of the Ice run time depends on the - * format with which the value was marshaled: - * - * If the value uses the "sliced" format, Ice ascends the class - * hierarchy until it finds a type that is recognized by a factory, - * or it reaches the least-derived type. If no factory is found that - * can create an instance, the run time throws NoValueFactoryException. - * - * If the value uses the "compact" format, Ice immediately raises - * NoValueFactoryException. - * - * The following order is used to locate a factory for a type: - * - *

    - * - *
  1. The Ice run-time looks for a factory registered - * specifically for the type.
  2. - * - *
  3. If no instance has been created, the Ice run-time looks - * for the default factory, which is registered with an empty type id. - *
  4. - * - *
  5. If no instance has been created by any of the preceding - * steps, the Ice run-time looks for a factory that may have been - * statically generated by the language mapping for non-abstract classes. - *
  6. - * - *
- * - * @param factory The factory to add. - * - * @param id The type id for which the factory can create instances, or - * an empty string for the default factory. - * - **/ + /// Add a value factory. Attempting to add a factory with an id for which a factory is already registered throws + /// AlreadyRegisteredException. + /// When unmarshaling an Ice value, the Ice run time reads the most-derived type id off the wire and attempts to + /// create an instance of the type using a factory. If no instance is created, either because no factory was found, + /// or because all factories returned nil, the behavior of the Ice run time depends on the format with which the + /// value was marshaled: + /// If the value uses the "sliced" format, Ice ascends the class hierarchy until it finds a type that is recognized + /// by a factory, or it reaches the least-derived type. If no factory is found that can create an instance, the run + /// time throws NoValueFactoryException. + /// If the value uses the "compact" format, Ice immediately raises NoValueFactoryException. + /// The following order is used to locate a factory for a type: + ///
    + ///
  1. The Ice run-time looks for a factory registered specifically for the type.
  2. + ///
  3. If no instance has been created, the Ice run-time looks for the default factory, which is registered with + /// an empty type id.
  4. + ///
  5. If no instance has been created by any of the preceding steps, the Ice run-time looks for a factory that + /// may have been statically generated by the language mapping for non-abstract classes.
  6. + ///
+ /// @param factory The factory to add. + /// @param id The type id for which the factory can create instances, or an empty string for the default factory. void add(["swift:nonnull"] ValueFactory factory, ["objc:param:sliceId"] string id); - /** - * - * Find an value factory registered with this communicator. - * - * @param id The type id for which the factory can create instances, - * or an empty string for the default factory. - * - * @return The value factory, or null if no value factory was - * found for the given id. - * - **/ + /// Find an value factory registered with this communicator. + /// @param id The type id for which the factory can create instances, or an empty string for the default factory. + /// @return The value factory, or null if no value factory was found for the given id. ["cpp:const", "cpp:noexcept", "swift:noexcept"] ValueFactory find(string id); } #endif diff --git a/slice/Ice/Version.ice b/slice/Ice/Version.ice index c8926b51baa..aeab72480ec 100644 --- a/slice/Ice/Version.ice +++ b/slice/Ice/Version.ice @@ -26,22 +26,14 @@ module Ice { -/** - * - * A version structure for the protocol version. - * - **/ +/// A version structure for the protocol version. struct ProtocolVersion { byte major; byte minor; } -/** - * - * A version structure for the encoding version. - * - **/ +/// A version structure for the encoding version. struct EncodingVersion { byte major; diff --git a/slice/IceBT/ConnectionInfo.ice b/slice/IceBT/ConnectionInfo.ice index 3a7140adc0f..176e6dde0f2 100644 --- a/slice/IceBT/ConnectionInfo.ice +++ b/slice/IceBT/ConnectionInfo.ice @@ -27,32 +27,28 @@ module IceBT { -/** - * - * Provides access to the details of a Bluetooth connection. - * - **/ +/// Provides access to the details of a Bluetooth connection. local class ConnectionInfo extends Ice::ConnectionInfo { - /** The local Bluetooth address. */ + /// The local Bluetooth address. string localAddress = ""; - /** The local RFCOMM channel. */ + /// The local RFCOMM channel. int localChannel = -1; - /** The remote Bluetooth address. */ + /// The remote Bluetooth address. string remoteAddress = ""; - /** The remote RFCOMM channel. */ + /// The remote RFCOMM channel. int remoteChannel = -1; - /** The UUID of the service being offered (in a server) or targeted (in a client). */ + /// The UUID of the service being offered (in a server) or targeted (in a client). string uuid = ""; - /** The connection buffer receive size. **/ + /// The connection buffer receive size. int rcvSize = 0; - /** The connection buffer send size. **/ + /// The connection buffer send size. int sndSize = 0; } diff --git a/slice/IceBT/EndpointInfo.ice b/slice/IceBT/EndpointInfo.ice index 50bf9ddf9c6..8f9a1d3e67d 100644 --- a/slice/IceBT/EndpointInfo.ice +++ b/slice/IceBT/EndpointInfo.ice @@ -23,34 +23,18 @@ [["java:package:com.zeroc"]] #endif -/** - * - * IceBT provides a Bluetooth transport for Ice. - * - **/ +/// IceBT provides a Bluetooth transport for Ice. ["objc:prefix:ICEBT", "swift:module:Ice:SSL"] module IceBT { -/** - * - * Provides access to Bluetooth endpoint information. - * - **/ +/// Provides access to Bluetooth endpoint information. local class EndpointInfo extends Ice::EndpointInfo { - /** - * - * The address configured with the endpoint. - * - **/ + /// The address configured with the endpoint. string addr; - /** - * - * The UUID configured with the endpoint. - * - **/ + /// The UUID configured with the endpoint. string uuid; } diff --git a/slice/IceBT/Types.ice b/slice/IceBT/Types.ice index 3a09b6ae873..85775f25df8 100644 --- a/slice/IceBT/Types.ice +++ b/slice/IceBT/Types.ice @@ -21,24 +21,16 @@ [["java:package:com.zeroc"]] #endif -/** - * - * IceBT provides a Bluetooth transport for Ice. - * - **/ +/// IceBT provides a Bluetooth transport for Ice. ["objc:prefix:ICEBT"] module IceBT { -/** - * - * Indicates a failure in the Bluetooth plug-in. - * - **/ +/// Indicates a failure in the Bluetooth plug-in. ["cpp:ice_print"] local exception BluetoothException { - /** Provides more information about the failure. */ + /// Provides more information about the failure. string reason; } diff --git a/slice/IceBox/IceBox.ice b/slice/IceBox/IceBox.ice index b5a43025c95..484484ddc3c 100644 --- a/slice/IceBox/IceBox.ice +++ b/slice/IceBox/IceBox.ice @@ -26,180 +26,87 @@ [["java:package:com.zeroc"]] #endif -/** - * - * IceBox is an application server specifically for Ice - * applications. IceBox can easily run and administer Ice services - * that are dynamically loaded as a DLL, shared library, or Java - * class. - * - **/ +/// IceBox is an application server specifically for Ice applications. IceBox can easily run and administer Ice +/// services that are dynamically loaded as a DLL, shared library, or Java class. module IceBox { -/** - * - * This exception is a general failure notification. It is thrown - * for errors such as a service encountering an error during - * initialization, or the service manager being unable - * to load a service executable. - * - **/ +/// This exception is a general failure notification. It is thrown for errors such as a service encountering an error +/// during initialization, or the service manager being unable to load a service executable. ["cpp:ice_print"] local exception FailureException { - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * This exception is thrown if an attempt is made to start an - * already-started service. - * - **/ +/// This exception is thrown if an attempt is made to start an already-started service. exception AlreadyStartedException { } -/** - * - * This exception is thrown if an attempt is made to stop an - * already-stopped service. - * - **/ +/// This exception is thrown if an attempt is made to stop an already-stopped service. exception AlreadyStoppedException { } -/** - * - * This exception is thrown if a service name does not refer - * to an existing service. - * - **/ +/// This exception is thrown if a service name does not refer to an existing service. exception NoSuchServiceException { } -/** - * - * An application service managed by a {@link ServiceManager}. - * - **/ +/// An application service managed by a {@link ServiceManager}. local interface Service { - /** - * - * Start the service. The given communicator is created by the - * {@link ServiceManager} for use by the service. This communicator may - * also be used by other services, depending on the service - * configuration. - * - *

The {@link ServiceManager} owns this communicator, and is - * responsible for destroying it. - * - * @param name The service's name, as determined by the - * configuration. - * - * @param communicator A communicator for use by the service. - * - * @param args The service arguments that were not converted into - * properties. - * - * @throws FailureException Raised if {@link #start} failed. - * - **/ + /// Start the service. The given communicator is created by the {@link ServiceManager} for use by the service. This + /// communicator may also be used by other services, depending on the service configuration. + ///

The {@link ServiceManager} owns this communicator, and is responsible for destroying it. + /// @param name The service's name, as determined by the configuration. + /// @param communicator A communicator for use by the service. + /// @param args The service arguments that were not converted into properties. + /// @throws FailureException Raised if {@link #start} failed. void start(string name, Ice::Communicator communicator, Ice::StringSeq args); - /** - * - * Stop the service. - * - **/ + /// Stop the service. void stop(); } -/** - * - * An Observer interface implemented by admin clients interested in the status - * of services. - * - * @see ServiceManager - * - **/ +/// An Observer interface implemented by admin clients interested in the status of services. +/// @see ServiceManager interface ServiceObserver { - /** - * - * Receives the names of the services that were started. - * - * @param services The names of the services. - * - **/ + /// Receives the names of the services that were started. + /// @param services The names of the services. void servicesStarted(Ice::StringSeq services); - /** - * - * Receives the names of the services that were stopped. - * - * @param services The names of the services. - * - **/ + /// Receives the names of the services that were stopped. + /// @param services The names of the services. void servicesStopped(Ice::StringSeq services); } -/** - * - * Administers a set of {@link Service} instances. - * - * @see Service - * - **/ +/// Administers a set of {@link Service} instances. +/// @see Service interface ServiceManager { - /** - * - * Start an individual service. - * - * @param service The service name. - * - * @throws AlreadyStartedException If the service is already running. - * @throws NoSuchServiceException If no service could be found with the given name. - **/ + /// Start an individual service. + /// @param service The service name. + /// @throws AlreadyStartedException If the service is already running. + /// @throws NoSuchServiceException If no service could be found with the given name. void startService(string service) throws AlreadyStartedException, NoSuchServiceException; - /** - * - * Stop an individual service. - * - * @param service The service name. - * - * @throws AlreadyStoppedException If the service is already stopped. - * @throws NoSuchServiceException If no service could be found with the given name. - **/ + /// Stop an individual service. + /// @param service The service name. + /// @throws AlreadyStoppedException If the service is already stopped. + /// @throws NoSuchServiceException If no service could be found with the given name. void stopService(string service) throws AlreadyStoppedException, NoSuchServiceException; - /** - * - * Registers a new observer with the ServiceManager. - * - * @param observer The new observer - * - **/ + /// Registers a new observer with the ServiceManager. + /// @param observer The new observer void addObserver(ServiceObserver* observer); - /** - * - * Shut down all services. This causes stop to be invoked on all configured services. - * - **/ + /// Shut down all services. This causes stop to be invoked on all configured services. void shutdown(); } diff --git a/slice/IceDiscovery/IceDiscovery.ice b/slice/IceDiscovery/IceDiscovery.ice index b873bb79146..828c8eb5754 100644 --- a/slice/IceDiscovery/IceDiscovery.ice +++ b/slice/IceDiscovery/IceDiscovery.ice @@ -24,75 +24,40 @@ module IceDiscovery { - -/** - * - * The LookupReply interface is used by IceDiscovery clients to answer requests - * received on the Lookup interface. - * - **/ -interface LookupReply -{ - /** - * Reply to the findObjectById request. - * - * @param id The identity of the object. - * - * @param prx The proxy of the object. - * - **/ - void foundObjectById(Ice::Identity id, Object* prx); - - /** - * Reply to the findAdpaterById request. - * - * @param id The adapter ID. - * - * @param prx The adapter proxy (a dummy proxy created by the adapter). - * The proxy provides the adapter endpoints. - * - * @param isReplicaGroup True if the adapter is also a member of a - * replica group. - * - **/ - void foundAdapterById(string id, Object* prx, bool isReplicaGroup); -} - -/** - * - * The Lookup interface is used by IceDiscovery clients to look for objects - * and adapters using UDP multicast. - * - **/ -interface Lookup -{ - /** - * Request to find an Ice object - * - * @param domainId The IceDiscovery domain identifier. An IceDiscovery client only - * replies to requests with a matching domain identifier. - * - * @param id The object identity. - * - * @param reply The proxy of the LookupReply interface that should be used to send - * the reply if a matching object is found. - * - **/ - idempotent void findObjectById(string domainId, Ice::Identity id, LookupReply* reply); - - /** - * Request to find an object adapter - * - * @param domainId The IceDiscovery domain identifier. An IceDiscovery client only - * replies to requests with a matching domain identifier. - * - * @param id The adapter ID. - * - * @param reply The proxy of the LookupReply interface that should be used to send - * the reply if a matching adapter is found. - * - **/ - idempotent void findAdapterById(string domainId, string id, LookupReply* reply); -} - + /// The LookupReply interface is used by IceDiscovery clients to answer requests + /// received on the Lookup interface. + interface LookupReply + { + /// Reply to the findObjectById request. + /// @param id The identity of the object. + /// @param prx The proxy of the object. + void foundObjectById(Ice::Identity id, Object* prx); + + /// Reply to the findAdpaterById request. + /// @param id The adapter ID. + /// @param prx The adapter proxy (a dummy proxy created by the adapter). The proxy provides the adapter + /// endpoints. + /// @param isReplicaGroup True if the adapter is also a member of a replica group. + void foundAdapterById(string id, Object* prx, bool isReplicaGroup); + } + + /// The Lookup interface is used by IceDiscovery clients to look for objects and adapters using UDP multicast. + interface Lookup + { + /// Request to find an Ice object + /// @param domainId The IceDiscovery domain identifier. An IceDiscovery client only replies to requests with a + /// matching domain identifier. + /// @param id The object identity. + /// @param reply The proxy of the LookupReply interface that should be used to send the reply if a matching + /// object is found. + idempotent void findObjectById(string domainId, Ice::Identity id, LookupReply* reply); + + /// Request to find an object adapter + /// @param domainId The IceDiscovery domain identifier. An IceDiscovery client only replies to requests with a + /// matching domain identifier. + /// @param id The adapter ID. + /// @param reply The proxy of the LookupReply interface that should be used to send the reply if a matching + /// adapter is found. + idempotent void findAdapterById(string domainId, string id, LookupReply* reply); + } } diff --git a/slice/IceGrid/Admin.ice b/slice/IceGrid/Admin.ice index 26e9f204677..ce7ff449476 100644 --- a/slice/IceGrid/Admin.ice +++ b/slice/IceGrid/Admin.ice @@ -34,1911 +34,878 @@ module IceGrid { -/** - * - * An enumeration representing the state of the server. - * - **/ +/// An enumeration representing the state of the server. enum ServerState { - /** - * - * The server is not running. - * - **/ + /// The server is not running. Inactive, - /** - * - * The server is being activated and will change to the active - * state when the registered server object adapters are activated - * or to the activation timed out state if the activation timeout - * expires. - * - **/ + /// The server is being activated and will change to the active state when the registered server object adapters + /// are activated or to the activation timed out state if the activation timeout expires. Activating, - /** - * - * The activation timed out state indicates that the server - * activation timed out. - * - **/ + /// The activation timed out state indicates that the server activation timed out. ActivationTimedOut, - /** - * - * The server is running. - * - **/ + /// The server is running. Active, - /** - * - * The server is being deactivated. - * - **/ + /// The server is being deactivated. Deactivating, - /** - * - * The server is being destroyed. - * - **/ + /// The server is being destroyed. Destroying, - /** - * - * The server is destroyed. - * - **/ + /// The server is destroyed. Destroyed } -/** - * - * A dictionary of proxies. - * - **/ +/// A dictionary of proxies. dictionary StringObjectProxyDict; -/** - * - * Information about an Ice object. - * - **/ +/// Information about an Ice object. ["cpp:comparable"] struct ObjectInfo { - /** - * - * The proxy of the object. - * - **/ + /// The proxy of the object. Object* proxy; - /** - * - * The type of the object. - * - **/ + /// The type of the object. string type; } -/** - * - * A sequence of object information structures. - * - **/ +/// A sequence of object information structures. sequence ObjectInfoSeq; -/** - * - * Information about an adapter registered with the IceGrid registry. - * - **/ +/// Information about an adapter registered with the IceGrid registry. ["cpp:comparable"] struct AdapterInfo { - /** - * - * The id of the adapter. - * - **/ + /// The id of the adapter. string id; - /** - * - * A dummy direct proxy that contains the adapter endpoints. - * - **/ + /// A dummy direct proxy that contains the adapter endpoints. Object* proxy; - /** - * - * The replica group id of the object adapter, or empty if the - * adapter doesn't belong to a replica group. - * - **/ + /// The replica group id of the object adapter, or empty if the adapter doesn't belong to a replica group. string replicaGroupId; } -/** - * - * A sequence of adapter information structures. - * - **/ +/// A sequence of adapter information structures. sequence AdapterInfoSeq; -/** - * - * Information about a server managed by an IceGrid node. - * - **/ +/// Information about a server managed by an IceGrid node. struct ServerInfo { - /** - * - * The server application. - * - **/ + /// The server application. string application; - /** - * - * The application uuid. - * - **/ + /// The application uuid. string uuid; - /** - * - * The application revision. - * - **/ + /// The application revision. int revision; - /** - * - * The server node. - * - **/ + /// The server node. string node; - /** - * - * The server descriptor. - * - **/ + /// The server descriptor. ServerDescriptor descriptor; - /** - * - * The id of the session which allocated the server. - * - **/ + /// The id of the session which allocated the server. string sessionId; } -/** - * - * Information about an IceGrid node. - * - **/ +/// Information about an IceGrid node. struct NodeInfo { - /** - * - * The name of the node. - * - **/ + /// The name of the node. string name; - /** - * - * The operating system name. - * - **/ + /// The operating system name. string os; - /** - * - * The network name of the host running this node (as defined in - * uname()). - * - **/ + /// The network name of the host running this node (as defined in uname()). string hostname; - /** - * - * The operation system release level (as defined in uname()). - * - **/ + /// The operation system release level (as defined in uname()). string release; - /** - * - * The operation system version (as defined in uname()). - * - **/ + /// The operation system version (as defined in uname()). string version; - /** - * - * The machine hardware type (as defined in uname()). - * - **/ + /// The machine hardware type (as defined in uname()). string machine; - /** - * - * The number of processor threads on the node. - * For example, nProcessors is 8 on a computer with a single quad-core - * processor and two HT threads per core. - * - **/ + /// The number of processor threads on the node. For example, nProcessors is 8 on a computer with a single + /// quad-core processor and two HT threads per core. int nProcessors; - /** - * - * The path to the node data directory. - * - **/ + /// The path to the node data directory. string dataDir; } -/** - * - * Information about an IceGrid registry replica. - * - **/ +/// Information about an IceGrid registry replica. struct RegistryInfo { - /** - * - * The name of the registry. - * - **/ + /// The name of the registry. string name; - /** - * - * The network name of the host running this registry (as defined in - * uname()). - * - **/ + /// The network name of the host running this registry (as defined in uname()). string hostname; } -/** - * - * A sequence of {@link RegistryInfo} structures. - * - **/ +/// A sequence of {@link RegistryInfo} structures. sequence RegistryInfoSeq; -/** - * - * Information about the load of a node. - * - **/ +/// Information about the load of a node. struct LoadInfo { - /** The load average over the past minute. */ + /// The load average over the past minute. float avg1; - /** The load average over the past 5 minutes. */ + /// The load average over the past 5 minutes. float avg5; - /** The load average over the past 15 minutes. */ + /// The load average over the past 15 minutes. float avg15; } -/** - * - * Information about an IceGrid application. - * - **/ +/// Information about an IceGrid application. struct ApplicationInfo { - /** Unique application identifier. */ + /// Unique application identifier. string uuid; - /** The creation time. */ + /// The creation time. long createTime; - /** The user who created the application. */ + /// The user who created the application. string createUser; - /** The update time. */ + /// The update time. long updateTime; - /** The user who updated the application. */ + /// The user who updated the application. string updateUser; - /** The application revision number. */ + /// The application revision number. int revision; - /** The application descriptor */ + /// The application descriptor ApplicationDescriptor descriptor; } -/** - * - * A sequence of {@link ApplicationInfo} structures. - * - **/ +/// A sequence of {@link ApplicationInfo} structures. ["java:type:java.util.LinkedList"] sequence ApplicationInfoSeq; -/** - * - * Information about updates to an IceGrid application. - * - **/ +/// Information about updates to an IceGrid application. struct ApplicationUpdateInfo { - /** The update time. */ + /// The update time. long updateTime; - /** The user who updated the application. */ + /// The user who updated the application. string updateUser; - /** The application revision number. */ + /// The application revision number. int revision; - /** The update descriptor. */ + /// The update descriptor. ApplicationUpdateDescriptor descriptor; } -/** - * - * The IceGrid administrative interface. - *

Allowing access to this interface - * is a security risk! Please see the IceGrid documentation - * for further information. - * - **/ +/// The IceGrid administrative interface.

Allowing access to this interface is a security risk! +/// Please see the IceGrid documentation for further information. interface Admin { - /** - * - * Add an application to IceGrid. - * - * @param descriptor The application descriptor. - * - * @throws AccessDeniedException Raised if the session doesn't - * hold the exclusive lock or if another session is holding the - * lock. - * - * @throws DeploymentException Raised if application deployment - * failed. - * - **/ + /// Add an application to IceGrid. + /// @param descriptor The application descriptor. + /// @throws AccessDeniedException Raised if the session doesn't hold the exclusive lock or if another session is + /// holding the lock. + /// @throws DeploymentException Raised if application deployment failed. void addApplication(ApplicationDescriptor descriptor) throws AccessDeniedException, DeploymentException; - /** - * - * Synchronize a deployed application with the given application - * descriptor. This operation will replace the current descriptor - * with this new descriptor. - * - * @param descriptor The application descriptor. - * - * @throws AccessDeniedException Raised if the session doesn't - * hold the exclusive lock or if another session is holding the - * lock. - * - * @throws DeploymentException Raised if application deployment - * failed. - * - * @throws ApplicationNotExistException Raised if the application - * doesn't exist. - * - **/ + /// Synchronize a deployed application with the given application descriptor. This operation will replace the + /// current descriptor with this new descriptor. + /// @param descriptor The application descriptor. + /// @throws AccessDeniedException Raised if the session doesn't hold the exclusive lock or if another session is + /// holding the lock. + /// @throws DeploymentException Raised if application deployment failed. + /// @throws ApplicationNotExistException Raised if the application doesn't exist. void syncApplication(ApplicationDescriptor descriptor) throws AccessDeniedException, DeploymentException, ApplicationNotExistException; - /** - * - * Update a deployed application with the given update application - * descriptor. - * - * @param descriptor The update descriptor. - * - * @throws AccessDeniedException Raised if the session doesn't - * hold the exclusive lock or if another session is holding the - * lock. - * - * @throws DeploymentException Raised if application deployment - * failed. - * - * @throws ApplicationNotExistException Raised if the application - * doesn't exist. - * - **/ + /// Update a deployed application with the given update application descriptor. + /// @param descriptor The update descriptor. + /// @throws AccessDeniedException Raised if the session doesn't hold the exclusive lock or if another session is + /// holding the lock. + /// @throws DeploymentException Raised if application deployment failed. + /// @throws ApplicationNotExistException Raised if the application doesn't exist. void updateApplication(ApplicationUpdateDescriptor descriptor) throws AccessDeniedException, DeploymentException, ApplicationNotExistException; - /** - * - * Synchronize a deployed application with the given application - * descriptor. This operation will replace the current descriptor - * with this new descriptor only if no server restarts are - * necessary for the update of the application. If some servers - * need to be restarted, the synchronization is rejected with a - * DeploymentException. - * - * @param descriptor The application descriptor. - * - * @throws AccessDeniedException Raised if the session doesn't - * hold the exclusive lock or if another session is holding the - * lock. - * - * @throws DeploymentException Raised if application deployment - * failed. - * - * @throws ApplicationNotExistException Raised if the application - * doesn't exist. - * - **/ + /// Synchronize a deployed application with the given application descriptor. This operation will replace the + /// current descriptor with this new descriptor only if no server restarts are necessary for the update of the + /// application. If some servers need to be restarted, the synchronization is rejected with a DeploymentException. + /// @param descriptor The application descriptor. + /// @throws AccessDeniedException Raised if the session doesn't hold the exclusive lock or if another session is + /// holding the lock. + /// @throws DeploymentException Raised if application deployment failed. + /// @throws ApplicationNotExistException Raised if the application doesn't exist. void syncApplicationWithoutRestart(ApplicationDescriptor descriptor) throws AccessDeniedException, DeploymentException, ApplicationNotExistException; - /** - * - * Update a deployed application with the given update application - * descriptor only if no server restarts are necessary for the - * update of the application. If some servers need to be - * restarted, the synchronization is rejected with a - * DeploymentException. - * - * @param descriptor The update descriptor. - * - * @throws AccessDeniedException Raised if the session doesn't - * hold the exclusive lock or if another session is holding the - * lock. - * - * @throws DeploymentException Raised if application deployment - * failed. - * - * @throws ApplicationNotExistException Raised if the application - * doesn't exist. - * - **/ + /// Update a deployed application with the given update application descriptor only if no server restarts are + /// necessary for the update of the application. If some servers need to be restarted, the synchronization is + /// rejected with a DeploymentException. + /// @param descriptor The update descriptor. + /// @throws AccessDeniedException Raised if the session doesn't hold the exclusive lock or if another session is + /// holding the lock. + /// @throws DeploymentException Raised if application deployment failed. + /// @throws ApplicationNotExistException Raised if the application doesn't exist. void updateApplicationWithoutRestart(ApplicationUpdateDescriptor descriptor) throws AccessDeniedException, DeploymentException, ApplicationNotExistException; - /** - * - * Remove an application from IceGrid. - * - * @param name The application name. - * - * @throws AccessDeniedException Raised if the session doesn't - * hold the exclusive lock or if another session is holding the - * lock. - * - * @throws DeploymentException Raised if application deployment failed. - * - * @throws ApplicationNotExistException Raised if the application - * doesn't exist. - * - **/ + /// Remove an application from IceGrid. + /// @param name The application name. + /// @throws AccessDeniedException Raised if the session doesn't hold the exclusive lock or if another session is + /// holding the lock. + /// @throws DeploymentException Raised if application deployment failed. + /// @throws ApplicationNotExistException Raised if the application doesn't exist. void removeApplication(string name) throws AccessDeniedException, DeploymentException, ApplicationNotExistException; - /** - * - * Instantiate a server template from an application on the given - * node. - * - * @param application The application name. - * - * @param node The name of the node where the server will be - * deployed. - * - * @param desc The descriptor of the server instance to deploy. - * - * @throws AccessDeniedException Raised if the session doesn't - * hold the exclusive lock or if another session is holding the - * lock. - * - * @throws DeploymentException Raised if server instantiation - * failed. - * - * @throws ApplicationNotExistException Raised if the application - * doesn't exist. - * - **/ + /// Instantiate a server template from an application on the given node. + /// @param application The application name. + /// @param node The name of the node where the server will be deployed. + /// @param desc The descriptor of the server instance to deploy. + /// @throws AccessDeniedException Raised if the session doesn't hold the exclusive lock or if another session is + /// holding the lock. + /// @throws DeploymentException Raised if server instantiation failed. + /// @throws ApplicationNotExistException Raised if the application doesn't exist. void instantiateServer(string application, string node, ServerInstanceDescriptor desc) throws AccessDeniedException, ApplicationNotExistException, DeploymentException; - /** - * - * Patch the given application data. - * - * @param name The application name. - * - * @param shutdown If true, the servers depending on the data to - * patch will be shut down if necessary. - * - * @throws ApplicationNotExistException Raised if the application - * doesn't exist. - * - * @throws PatchException Raised if the patch failed. - * - **/ + /// Patch the given application data. + /// @param name The application name. + /// @param shutdown If true, the servers depending on the data to patch will be shut down if necessary. + /// @throws ApplicationNotExistException Raised if the application doesn't exist. + /// @throws PatchException Raised if the patch failed. ["amd"] void patchApplication(string name, bool shutdown) throws ApplicationNotExistException, PatchException; - /** - * - * Get an application descriptor. - * - * @param name The application name. - * - * @return The application descriptor. - * - * @throws ApplicationNotExistException Raised if the application - * doesn't exist. - * - **/ + /// Get an application descriptor. + /// @param name The application name. + /// @return The application descriptor. + /// @throws ApplicationNotExistException Raised if the application doesn't exist. ["nonmutating", "cpp:const"] idempotent ApplicationInfo getApplicationInfo(string name) throws ApplicationNotExistException; - /** - * - * Get the default application descriptor. - * - * @return The default application descriptor. - * - * @throws DeploymentException Raised if the default application - * descriptor can't be accessed or is invalid. - * - **/ + /// Get the default application descriptor. + /// @return The default application descriptor. + /// @throws DeploymentException Raised if the default application descriptor can't be accessed or is invalid. ["nonmutating", "cpp:const"] idempotent ApplicationDescriptor getDefaultApplicationDescriptor() throws DeploymentException; - /** - * - * Get all the IceGrid applications currently registered. - * - * @return The application names. - * - **/ + /// Get all the IceGrid applications currently registered. + /// @return The application names. ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getAllApplicationNames(); - /** - * - * Get the server information for the server with the given id. - * - * @param id The server id. - * - * @throws ServerNotExistException Raised if the server doesn't exist. - * - * @return The server information. - * - **/ + /// Get the server information for the server with the given id. + /// @param id The server id. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @return The server information. ["nonmutating", "cpp:const"] idempotent ServerInfo getServerInfo(string id) throws ServerNotExistException; - /** - * - * Get a server's state. - * - * @param id The server id. - * - * @return The server state. - * - * @throws ServerNotExistException Raised if the server doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Get a server's state. + /// @param id The server id. + /// @return The server state. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. ["nonmutating", "cpp:const"] idempotent ServerState getServerState(string id) throws ServerNotExistException, NodeUnreachableException, DeploymentException; - /** - * - * Get a server's system process id. The process id is operating - * system dependent. - * - * @param id The server id. - * - * @return The server's process id. - * - * @throws ServerNotExistException Raised if the server doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Get a server's system process id. The process id is operating system dependent. + /// @param id The server id. + /// @return The server's process id. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. ["nonmutating", "cpp:const"] idempotent int getServerPid(string id) throws ServerNotExistException, NodeUnreachableException, DeploymentException; - /** - * - * Get the category for server admin objects. You can manufacture a server admin - * proxy from the admin proxy by changing its identity: use the server ID as name - * and the returned category as category. - * - * @return The category for server admin objects. - * - **/ + /// Get the category for server admin objects. You can manufacture a server admin proxy from the admin proxy by + /// changing its identity: use the server ID as name and the returned category as category. + /// @return The category for server admin objects. ["cpp:const"] idempotent string getServerAdminCategory(); - /** - * - * Get a proxy to the server's admin object. - * - * @param id The server id. - * - * @return A proxy to the server's admin object - * - * @throws ServerNotExistException Raised if the server doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not - * be reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Get a proxy to the server's admin object. + /// @param id The server id. + /// @return A proxy to the server's admin object + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. ["cpp:const"] idempotent Object* getServerAdmin(string id) throws ServerNotExistException, NodeUnreachableException, DeploymentException; - /** - * - * Enable or disable a server. A disabled server can't be started - * on demand or administratively. The enable state of the server - * is not persistent: if the node is shut down and restarted, the - * server will be enabled by default. - * - * @param id The server id. - * - * @param enabled True to enable the server, false to disable it. - * - * @throws ServerNotExistException Raised if the server doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not - * be reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Enable or disable a server. A disabled server can't be started on demand or administratively. The enable state + /// of the server is not persistent: if the node is shut down and restarted, the server will be enabled by default. + /// @param id The server id. + /// @param enabled True to enable the server, false to disable it. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. idempotent void enableServer(string id, bool enabled) throws ServerNotExistException, NodeUnreachableException, DeploymentException; - /** - * - * Check if the server is enabled or disabled. - * - * @param id The server id. - * - * @return True if the server is enabled. - * - * @throws ServerNotExistException Raised if the server doesn't - * exist. - * - * @throws NodeUnreachableException Raised if the node could not - * be reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Check if the server is enabled or disabled. + /// @param id The server id. + /// @return True if the server is enabled. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. ["nonmutating", "cpp:const"] idempotent bool isServerEnabled(string id) throws ServerNotExistException, NodeUnreachableException, DeploymentException; - /** - * - * Start a server and wait for its activation. - * - * @param id The server id. - * - * @throws ServerNotExistException Raised if the server doesn't - * exist. - * - * @throws ServerStartException Raised if the server couldn't be - * started. - * - * @throws NodeUnreachableException Raised if the node could not - * be reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Start a server and wait for its activation. + /// @param id The server id. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws ServerStartException Raised if the server couldn't be started. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. ["amd"] void startServer(string id) throws ServerNotExistException, ServerStartException, NodeUnreachableException, DeploymentException; - /** - * - * Stop a server. - * - * @param id The server id. - * - * @throws ServerNotExistException Raised if the server doesn't - * exist. - * - * @throws ServerStopException Raised if the server couldn't be - * stopped. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Stop a server. + /// @param id The server id. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws ServerStopException Raised if the server couldn't be stopped. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. ["amd"] void stopServer(string id) throws ServerNotExistException, ServerStopException, NodeUnreachableException, DeploymentException; - /** - * - * Patch a server. - * - * @param id The server id. - * - * @param shutdown If true, servers depending on the data to patch - * will be shut down if necessary. - * - * @throws ServerNotExistException Raised if the server doesn't - * exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - * @throws PatchException Raised if the patch failed. - * - **/ + /// Patch a server. + /// @param id The server id. + /// @param shutdown If true, servers depending on the data to patch will be shut down if necessary. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. + /// @throws PatchException Raised if the patch failed. ["amd"] void patchServer(string id, bool shutdown) throws ServerNotExistException, NodeUnreachableException, DeploymentException, PatchException; - /** - * - * Send signal to a server. - * - * @param id The server id. - * - * @param signal The signal, for example SIGTERM or 15. - * - * @throws ServerNotExistException Raised if the server doesn't - * exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - * @throws BadSignalException Raised if the signal is not recognized - * by the target server. - * - **/ + /// Send signal to a server. + /// @param id The server id. + /// @param signal The signal, for example SIGTERM or 15. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. + /// @throws BadSignalException Raised if the signal is not recognized by the target server. void sendSignal(string id, string signal) throws ServerNotExistException, NodeUnreachableException, DeploymentException, BadSignalException; - /** - * - * Get all the server ids registered with IceGrid. - * - * @return The server ids. - * - **/ + /// Get all the server ids registered with IceGrid. + /// @return The server ids. ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getAllServerIds(); - /** - * - * Get the adapter information for the replica group or adapter - * with the given id. - * - * @param id The adapter id. - * - * @return A sequence of adapter information structures. If the - * given id refers to an adapter, this sequence will contain only - * one element. If the given id refers to a replica group, the - * sequence will contain the adapter information of each member of - * the replica group. - * - * @throws AdapterNotExistException Raised if the adapter or - * replica group doesn't exist. - * - **/ + /// Get the adapter information for the replica group or adapter with the given id. + /// @param id The adapter id. + /// @return A sequence of adapter information structures. If the given id refers to an adapter, this sequence will + /// contain only one element. If the given id refers to a replica group, the sequence will contain the adapter + /// information of each member of the replica group. + /// @throws AdapterNotExistException Raised if the adapter or replica group doesn't exist. ["nonmutating", "cpp:const"] idempotent AdapterInfoSeq getAdapterInfo(string id) throws AdapterNotExistException; - /** - * - * Remove the adapter with the given id. - * - * @param id The adapter id. - * @throws AdapterNotExistException Raised if the adapter doesn't - * exist. - * - * @throws DeploymentException Raised if application deployment failed. - * - **/ + /// Remove the adapter with the given id. + /// @param id The adapter id. + /// @throws AdapterNotExistException Raised if the adapter doesn't exist. + /// @throws DeploymentException Raised if application deployment failed. void removeAdapter(string id) throws AdapterNotExistException, DeploymentException; - /** - * - * Get all the adapter ids registered with IceGrid. - * - * @return The adapter ids. - * - **/ + /// Get all the adapter ids registered with IceGrid. + /// @return The adapter ids. ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getAllAdapterIds(); - /** - * - * Add an object to the object registry. IceGrid will get the - * object type by calling ice_id on the given proxy. The object - * must be reachable. - * - * @param obj The object to be added to the registry. - * - * @throws ObjectExistsException Raised if the object is already - * registered. - * - * @throws DeploymentException Raised if the object can't be - * added. This might be raised if the invocation on the proxy to - * get the object type failed. - * - **/ + /// Add an object to the object registry. IceGrid will get the object type by calling ice_id on the + /// given proxy. The object must be reachable. + /// @param obj The object to be added to the registry. + /// @throws ObjectExistsException Raised if the object is already registered. + /// @throws DeploymentException Raised if the object can't be added. This might be raised if the invocation on the + /// proxy to get the object type failed. void addObject(Object* obj) throws ObjectExistsException, DeploymentException; - /** - * - * Update an object in the object registry. Only objects added - * with this interface can be updated with this operation. Objects - * added with deployment descriptors should be updated with the - * deployment mechanism. - * - * @param obj The object to be updated to the registry. - * - * @throws ObjectNotRegisteredException Raised if the object isn't - * registered with the registry. - * - * @throws DeploymentException Raised if the object can't be - * updated. This might happen if the object was added with a - * deployment descriptor. - * - **/ + /// Update an object in the object registry. Only objects added with this interface can be updated with this + /// operation. Objects added with deployment descriptors should be updated with the deployment mechanism. + /// @param obj The object to be updated to the registry. + /// @throws ObjectNotRegisteredException Raised if the object isn't registered with the registry. + /// @throws DeploymentException Raised if the object can't be updated. This might happen if the object was added + /// with a deployment descriptor. void updateObject(Object* obj) throws ObjectNotRegisteredException, DeploymentException; - /** - * - * Add an object to the object registry and explicitly specify - * its type. - * - * @param obj The object to be added to the registry. - * - * @param type The object type. - * - * @throws ObjectExistsException Raised if the object is already - * registered. - * - * @throws DeploymentException Raised if application deployment failed. - * - **/ + /// Add an object to the object registry and explicitly specify its type. + /// @param obj The object to be added to the registry. + /// @param type The object type. + /// @throws ObjectExistsException Raised if the object is already registered. + /// @throws DeploymentException Raised if application deployment failed. void addObjectWithType(Object* obj, string type) throws ObjectExistsException, DeploymentException; - /** - * - * Remove an object from the object registry. Only objects added - * with this interface can be removed with this operation. Objects - * added with deployment descriptors should be removed with the - * deployment mechanism. - * - * @param id The identity of the object to be removed from the - * registry. - * - * @throws ObjectNotRegisteredException Raised if the object isn't - * registered with the registry. - * - * @throws DeploymentException Raised if the object can't be - * removed. This might happen if the object was added with a - * deployment descriptor. - * - **/ + /// Remove an object from the object registry. Only objects added with this interface can be removed with this + /// operation. Objects added with deployment descriptors should be removed with the deployment mechanism. + /// @param id The identity of the object to be removed from the registry. + /// @throws ObjectNotRegisteredException Raised if the object isn't registered with the registry. + /// @throws DeploymentException Raised if the object can't be removed. This might happen if the object was added + /// with a deployment descriptor. void removeObject(Ice::Identity id) throws ObjectNotRegisteredException, DeploymentException; - /** - * - * Get the object info for the object with the given identity. - * - * @param id The identity of the object. - * - * @return The object info. - * - * @throws ObjectNotRegisteredException Raised if the object isn't - * registered with the registry. - * - **/ + /// Get the object info for the object with the given identity. + /// @param id The identity of the object. + /// @return The object info. + /// @throws ObjectNotRegisteredException Raised if the object isn't registered with the registry. ["nonmutating", "cpp:const"] idempotent ObjectInfo getObjectInfo(Ice::Identity id) throws ObjectNotRegisteredException; - /** - * - * Get the object info of all the registered objects with the - * given type. - * - * @param type The type of the object. - * - * @return The object infos. - * - **/ + /// Get the object info of all the registered objects with the given type. + /// @param type The type of the object. + /// @return The object infos. ["nonmutating", "cpp:const"] idempotent ObjectInfoSeq getObjectInfosByType(string type); - /** - * - * Get the object info of all the registered objects whose stringified - * identities match the given expression. - * - * @param expr The expression to match against the stringified - * identities of registered objects. The expression may contain - * a trailing wildcard (*) character. - * - * @return All the object infos with a stringified identity - * matching the given expression. - * - **/ + /// Get the object info of all the registered objects whose stringified identities match the given expression. + /// @param expr The expression to match against the stringified identities of registered objects. The expression + /// may contain a trailing wildcard (*) character. + /// @return All the object infos with a stringified identity matching the given expression. ["nonmutating", "cpp:const"] idempotent ObjectInfoSeq getAllObjectInfos(string expr); - /** - * - * Ping an IceGrid node to see if it is active. - * - * @param name The node name. - * - * @return true if the node ping succeeded, false otherwise. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - **/ + /// Ping an IceGrid node to see if it is active. + /// @param name The node name. + /// @return true if the node ping succeeded, false otherwise. + /// @throws NodeNotExistException Raised if the node doesn't exist. ["nonmutating", "cpp:const"] idempotent bool pingNode(string name) throws NodeNotExistException; - /** - * - * Get the load averages of the node. - * - * @param name The node name. - * - * @return The node load information. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - **/ + /// Get the load averages of the node. + /// @param name The node name. + /// @return The node load information. + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. ["nonmutating", "cpp:const"] idempotent LoadInfo getNodeLoad(string name) throws NodeNotExistException, NodeUnreachableException; - /** - * - * Get the node information for the node with the given name. - * - * @param name The node name. - * - * @return The node information. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - **/ + /// Get the node information for the node with the given name. + /// @param name The node name. + /// @return The node information. + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. ["nonmutating", "cpp:const"] idempotent NodeInfo getNodeInfo(string name) throws NodeNotExistException, NodeUnreachableException; - /** - * - * Get a proxy to the IceGrid node's admin object. - * - * @param name The IceGrid node name - * - * @return A proxy to the IceGrid node's admin object - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - **/ + /// Get a proxy to the IceGrid node's admin object. + /// @param name The IceGrid node name + /// @return A proxy to the IceGrid node's admin object + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. ["cpp:const"] idempotent Object* getNodeAdmin(string name) throws NodeNotExistException, NodeUnreachableException; - /** - * - * Get the number of physical processor sockets for the machine - * running the node with the given name. - * - * Note that this method will return 1 on operating systems where - * this can't be automatically determined and where the - * IceGrid.Node.ProcessorSocketCount property for the node is not - * set. - * - * @param name The node name. - * - * @return The number of processor sockets or 1 if the number of - * sockets can't determined. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - **/ + /// Get the number of physical processor sockets for the machine running the node with the given name. + /// Note that this method will return 1 on operating systems where this can't be automatically determined and where + /// the IceGrid.Node.ProcessorSocketCount property for the node is not set. + /// @param name The node name. + /// @return The number of processor sockets or 1 if the number of sockets can't determined. + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. ["nonmutating", "cpp:const"] idempotent int getNodeProcessorSocketCount(string name) throws NodeNotExistException, NodeUnreachableException; - /** - * - * Shutdown an IceGrid node. - * - * @param name The node name. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - **/ + /// Shutdown an IceGrid node. + /// @param name The node name. + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. void shutdownNode(string name) throws NodeNotExistException, NodeUnreachableException; - /** - * - * Get the hostname of this node. - * - * @param name The node name. - * - * @return The node hostname. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - **/ + /// Get the hostname of this node. + /// @param name The node name. + /// @return The node hostname. + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. ["nonmutating", "cpp:const"] idempotent string getNodeHostname(string name) throws NodeNotExistException, NodeUnreachableException; - /** - * - * Get all the IceGrid nodes currently registered. - * - * @return The node names. - * - **/ + /// Get all the IceGrid nodes currently registered. + /// @return The node names. ["nonmutating", "cpp:const"] idempotent Ice::StringSeq getAllNodeNames(); - /** - * - * Ping an IceGrid registry to see if it is active. - * - * @param name The registry name. - * - * @return true if the registry ping succeeded, false otherwise. - * - * @throws RegistryNotExistException Raised if the registry doesn't exist. - * - **/ + /// Ping an IceGrid registry to see if it is active. + /// @param name The registry name. + /// @return true if the registry ping succeeded, false otherwise. + /// @throws RegistryNotExistException Raised if the registry doesn't exist. ["cpp:const"] idempotent bool pingRegistry(string name) throws RegistryNotExistException; - /** - * - * Get the registry information for the registry with the given name. - * - * @param name The registry name. - * - * @return The registry information. - * - * @throws RegistryNotExistException Raised if the registry doesn't exist. - * - * @throws RegistryUnreachableException Raised if the registry could not be - * reached. - * - **/ + /// Get the registry information for the registry with the given name. + /// @param name The registry name. + /// @return The registry information. + /// @throws RegistryNotExistException Raised if the registry doesn't exist. + /// @throws RegistryUnreachableException Raised if the registry could not be reached. ["cpp:const"] idempotent RegistryInfo getRegistryInfo(string name) throws RegistryNotExistException, RegistryUnreachableException; - /** - * - * Get a proxy to the IceGrid registry's admin object. - * - * @param name The registry name - * - * @return A proxy to the IceGrid registry's admin object - * - * @throws RegistryNotExistException Raised if the registry doesn't exist. - * - **/ + /// Get a proxy to the IceGrid registry's admin object. + /// @param name The registry name + /// @return A proxy to the IceGrid registry's admin object + /// @throws RegistryNotExistException Raised if the registry doesn't exist. ["cpp:const"] idempotent Object* getRegistryAdmin(string name) throws RegistryNotExistException; - /** - * - * Shutdown an IceGrid registry. - * - * @param name The registry name. - * - * @throws RegistryNotExistException Raised if the registry doesn't exist. - * - * @throws RegistryUnreachableException Raised if the registry could not be - * reached. - * - **/ + /// Shutdown an IceGrid registry. + /// @param name The registry name. + /// @throws RegistryNotExistException Raised if the registry doesn't exist. + /// @throws RegistryUnreachableException Raised if the registry could not be reached. idempotent void shutdownRegistry(string name) throws RegistryNotExistException, RegistryUnreachableException; - /** - * - * Get all the IceGrid registries currently registered. - * - * @return The registry names. - * - **/ + /// Get all the IceGrid registries currently registered. + /// @return The registry names. ["cpp:const"] idempotent Ice::StringSeq getAllRegistryNames(); - /** - * - * Shut down the IceGrid registry. - * - **/ + /// Shut down the IceGrid registry. void shutdown(); } -/** - * - * This interface provides access to IceGrid log file contents. - * - **/ +/// This interface provides access to IceGrid log file contents. interface FileIterator { - /** - * - * Read lines from the log file. - * - * @param size Specifies the maximum number of bytes to be - * received. The server will ensure that the returned message - * doesn't exceed the given size. - * - * @param lines The lines read from the file. If there was nothing to - * read from the file since the last call to read, an empty - * sequence is returned. The last line of the sequence is always - * incomplete (and therefore no '\n' should be added when writing - * the last line to the to the output device). - * - * @return True if EOF is encountered. - * - * @throws FileNotAvailableException Raised if there was a problem - * to read lines from the file. - * - **/ + /// Read lines from the log file. + /// @param size Specifies the maximum number of bytes to be received. The server will ensure that the returned + /// message doesn't exceed the given size. + /// @param lines The lines read from the file. If there was nothing to read from the file since the last call to + /// read, an empty sequence is returned. The last line of the sequence is always incomplete (and therefore no '\n' + /// should be added when writing the last line to the to the output device). + /// @return True if EOF is encountered. + /// @throws FileNotAvailableException Raised if there was a problem to read lines from the file. bool read(int size, out Ice::StringSeq lines) throws FileNotAvailableException; - /** - * - * Destroy the iterator. - * - **/ + /// Destroy the iterator. void destroy(); } -/** - * - * Dynamic information about the state of a server. - * - **/ +/// Dynamic information about the state of a server. struct ServerDynamicInfo { - /** - * - * The id of the server. - * - **/ + /// The id of the server. string id; - /** - * - * The state of the server. - * - **/ + /// The state of the server. ServerState state; - /** - * - * The process id of the server. - * - **/ + /// The process id of the server. int pid; - /** - * - * Indicates whether the server is enabled. - * - **/ + /// Indicates whether the server is enabled. bool enabled; } -/** - * - * A sequence of server dynamic information structures. - * - **/ +/// A sequence of server dynamic information structures. ["java:type:java.util.LinkedList"] sequence ServerDynamicInfoSeq; -/** - * - * Dynamic information about the state of an adapter. - * - **/ +/// Dynamic information about the state of an adapter. struct AdapterDynamicInfo { - /** - * - * The id of the adapter. - * - **/ + /// The id of the adapter. string id; - /** - * - * The direct proxy containing the adapter endpoints. - * - **/ + /// The direct proxy containing the adapter endpoints. Object* proxy; } -/** - * - * A sequence of adapter dynamic information structures. - * - **/ +/// A sequence of adapter dynamic information structures. ["java:type:java.util.LinkedList"] sequence AdapterDynamicInfoSeq; -/** - * - * Dynamic information about the state of a node. - * - **/ +/// Dynamic information about the state of a node. struct NodeDynamicInfo { - /** - * - * Some static information about the node. - * - **/ + /// Some static information about the node. NodeInfo info; - /** - * - * The dynamic information of the servers deployed on this node. - * - **/ + /// The dynamic information of the servers deployed on this node. ServerDynamicInfoSeq servers; - /** - * - * The dynamic information of the adapters deployed on this node. - * - **/ + /// The dynamic information of the adapters deployed on this node. AdapterDynamicInfoSeq adapters; } -/** - * - * This interface allows applications to monitor changes the state - * of the registry. - * - **/ +/// This interface allows applications to monitor changes the state of the registry. interface RegistryObserver { - /** - * - * The registryInit operation is called after registration of - * an observer to indicate the state of the registries. - * - * @param registries The current state of the registries. - * - **/ + /// The registryInit operation is called after registration of an observer to indicate the state of + /// the registries. + /// @param registries The current state of the registries. void registryInit(RegistryInfoSeq registries); - /** - * - * The nodeUp operation is called to notify an observer that a node - * came up. - * - * @param node The node state. - * - **/ + /// The nodeUp operation is called to notify an observer that a node came up. + /// @param node The node state. void registryUp(RegistryInfo node); - /** - * - * The nodeDown operation is called to notify an observer that a node - * went down. - * - * @param name The node name. - * - **/ + /// The nodeDown operation is called to notify an observer that a node went down. + /// @param name The node name. void registryDown(string name); } -/** - * - * A sequence of node dynamic information structures. - * - **/ +/// A sequence of node dynamic information structures. sequence NodeDynamicInfoSeq; -/** - * - * The node observer interface. Observers should implement this - * interface to receive information about the state of the IceGrid - * nodes. - * - **/ +/// The node observer interface. Observers should implement this interface to receive information about the state of +/// the IceGrid nodes. interface NodeObserver { - /** - * - * The nodeInit operation indicates the current state - * of nodes. It is called after the registration of an observer. - * - * @param nodes The current state of the nodes. - * - **/ + /// The nodeInit operation indicates the current state of nodes. It is called after the registration + /// of an observer. + /// @param nodes The current state of the nodes. void nodeInit(NodeDynamicInfoSeq nodes); - /** - * - * The nodeUp operation is called to notify an observer that a node - * came up. - * - * @param node The node state. - * - **/ + /// The nodeUp operation is called to notify an observer that a node came up. + /// @param node The node state. void nodeUp(NodeDynamicInfo node); - /** - * - * The nodeDown operation is called to notify an observer that a node - * went down. - * - * @param name The node name. - * - **/ + /// The nodeDown operation is called to notify an observer that a node went down. + /// @param name The node name. void nodeDown(string name); - /** - * - * The updateServer operation is called to notify an observer that - * the state of a server changed. - * - * @param node The node hosting the server. - * - * @param updatedInfo The new server state. - * - **/ + /// The updateServer operation is called to notify an observer that the state of a server changed. + /// @param node The node hosting the server. + /// @param updatedInfo The new server state. void updateServer(string node, ServerDynamicInfo updatedInfo); - /** - * - * The updateAdapter operation is called to notify an observer that - * the state of an adapter changed. - * - * @param node The node hosting the adapter. - * - * @param updatedInfo The new adapter state. - * - **/ + /// The updateAdapter operation is called to notify an observer that the state of an adapter changed. + /// @param node The node hosting the adapter. + /// @param updatedInfo The new adapter state. void updateAdapter(string node, AdapterDynamicInfo updatedInfo); } -/** - * - * The database observer interface. Observers should implement this - * interface to receive information about the state of the IceGrid - * registry database. - * - **/ +/// The database observer interface. Observers should implement this interface to receive information about the state +/// of the IceGrid registry database. interface ApplicationObserver { - /** - * - * applicationInit is called after the registration - * of an observer to indicate the state of the registry. - * - * @param serial The current serial number of the registry - * database. This serial number allows observers to make sure that - * their internal state is synchronized with the registry. - * - * @param applications The applications currently registered with - * the registry. - * - **/ + /// applicationInit is called after the registration of an observer to indicate the state of the + /// registry. + /// @param serial The current serial number of the registry database. This serial number allows observers to make + /// sure that their internal state is synchronized with the registry. + /// @param applications The applications currently registered with the registry. void applicationInit(int serial, ApplicationInfoSeq applications); - /** - * - * The applicationAdded operation is called to notify an observer - * that an application was added. - * - * @param serial The new serial number of the registry database. - * - * @param desc The descriptor of the new application. - * - **/ + /// The applicationAdded operation is called to notify an observer that an application was added. + /// @param serial The new serial number of the registry database. + /// @param desc The descriptor of the new application. void applicationAdded(int serial, ApplicationInfo desc); - /** - * - * The applicationRemoved operation is called to notify an observer - * that an application was removed. - * - * @param serial The new serial number of the registry database. - * - * @param name The name of the application that was removed. - * - **/ + /// The applicationRemoved operation is called to notify an observer that an application was removed. + /// @param serial The new serial number of the registry database. + /// @param name The name of the application that was removed. void applicationRemoved(int serial, string name); - /** - * - * The applicationUpdated operation is called to notify an observer - * that an application was updated. - * - * @param serial The new serial number of the registry database. - * - * @param desc The descriptor of the update. - * - **/ + /// The applicationUpdated operation is called to notify an observer that an application was updated. + /// @param serial The new serial number of the registry database. + /// @param desc The descriptor of the update. void applicationUpdated(int serial, ApplicationUpdateInfo desc); } -/** - * - * This interface allows applications to monitor the state of object - * adapters that are registered with IceGrid. - * - **/ +/// This interface allows applications to monitor the state of object adapters that are registered with IceGrid. interface AdapterObserver { - /** - * - * adapterInit is called after registration of - * an observer to indicate the state of the registry. - * - * @param adpts The adapters that were dynamically registered - * with the registry (not through the deployment mechanism). - * - **/ + /// adapterInit is called after registration of an observer to indicate the state of the registry. + /// @param adpts The adapters that were dynamically registered with the registry (not through the deployment + /// mechanism). void adapterInit(AdapterInfoSeq adpts); - /** - * - * The adapterAdded operation is called to notify an observer when - * a dynamically-registered adapter was added. - * - * @param info The details of the new adapter. - **/ + /// The adapterAdded operation is called to notify an observer when a dynamically-registered adapter + /// was added. + /// @param info The details of the new adapter. void adapterAdded(AdapterInfo info); - /** - * - * The adapterUpdated operation is called to notify an observer when - * a dynamically-registered adapter was updated. - * - * @param info The details of the updated adapter. - * - **/ + /// The adapterUpdated operation is called to notify an observer when a dynamically-registered adapter was updated. + /// @param info The details of the updated adapter. void adapterUpdated(AdapterInfo info); - /** - * - * The adapterRemoved operation is called to notify an observer when - * a dynamically-registered adapter was removed. - * - * @param id The ID of the removed adapter. - * - **/ + /// The adapterRemoved operation is called to notify an observer when a dynamically-registered adapter was removed. + /// @param id The ID of the removed adapter. void adapterRemoved(string id); } -/** - * - * This interface allows applications to monitor IceGrid well-known objects. - * - **/ +/// This interface allows applications to monitor IceGrid well-known objects. interface ObjectObserver { - /** - * - * objectInit is called after the registration of - * an observer to indicate the state of the registry. - * - * @param objects The objects registered with the {@link Admin} - * interface (not through the deployment mechanism). - * - **/ + /// objectInit is called after the registration of an observer to indicate the state of the registry. + /// @param objects The objects registered with the {@link Admin} interface (not through the deployment mechanism). void objectInit(ObjectInfoSeq objects); - /** - * - * The objectAdded operation is called to notify an observer when an - * object was added to the {@link Admin} interface. - * - * @param info The details of the added object. - * - **/ + /// The objectAdded operation is called to notify an observer when an object was added to the + /// {@link Admin} interface. + /// @param info The details of the added object. void objectAdded(ObjectInfo info); - /** - * - * objectUpdated is called to notify an observer when - * an object registered with the {@link Admin} interface was updated. - * - * @param info The details of the updated object. - * - **/ + /// objectUpdated is called to notify an observer when an object registered with the {@link Admin} + /// interface was updated. + /// @param info The details of the updated object. void objectUpdated(ObjectInfo info); - /** - * - * objectRemoved is called to notify an observer when - * an object registered with the {@link Admin} interface was removed. - * - * @param id The identity of the removed object. - * - **/ + /// objectRemoved is called to notify an observer when an object registered with the {@link Admin} + /// interface was removed. + /// @param id The identity of the removed object. void objectRemoved(Ice::Identity id); } -/** - * - * Used by administrative clients to view, - * update, and receive observer updates from the IceGrid - * registry. Admin sessions are created either via the {@link Registry} - * object or via the registry admin SessionManager object. - * - * @see Registry - * - **/ +/// Used by administrative clients to view, update, and receive observer updates from the IceGrid registry. Admin +/// sessions are created either via the {@link Registry} object or via the registry admin SessionManager +/// object. +/// @see Registry interface AdminSession extends Glacier2::Session { - /** - * - * Keep the session alive. Clients should call this operation - * regularly to prevent the server from reaping the session. - * - * @see Registry#getSessionTimeout - * - **/ + /// Keep the session alive. Clients should call this operation regularly to prevent the server from reaping the + /// session. + /// @see Registry#getSessionTimeout idempotent void keepAlive(); - /** - * - * Get the admin interface. The admin object returned by this - * operation can only be accessed by the session. - * - * @return The admin interface proxy. - * - **/ + /// Get the admin interface. The admin object returned by this operation can only be accessed by the session. + /// @return The admin interface proxy. ["nonmutating", "cpp:const"] idempotent Admin* getAdmin(); - /** - * - * Get a "template" proxy for admin callback objects. - * An Admin client uses this proxy to set the category of its callback - * objects, and the published endpoints of the object adapter hosting - * the admin callback objects. - * - * @return A template proxy. The returned proxy is null when the Admin - * session was established using Glacier2. - * - **/ + /// Get a "template" proxy for admin callback objects. An Admin client uses this proxy to set the category of its + /// callback objects, and the published endpoints of the object adapter hosting the admin callback objects. + /// @return A template proxy. The returned proxy is null when the Admin session was established using Glacier2. ["cpp:const"] idempotent Object* getAdminCallbackTemplate(); - /** - * - * Set the observer proxies that receive - * notifications when the state of the registry - * or nodes changes. - * - * @param registryObs The registry observer. - * - * @param nodeObs The node observer. - * - * @param appObs The application observer. - * - * @param adptObs The adapter observer. - * - * @param objObs The object observer. - * - * @throws ObserverAlreadyRegisteredException Raised if an - * observer is already registered with this registry. - * - **/ + /// Set the observer proxies that receive notifications when the state of the registry or nodes changes. + /// @param registryObs The registry observer. + /// @param nodeObs The node observer. + /// @param appObs The application observer. + /// @param adptObs The adapter observer. + /// @param objObs The object observer. + /// @throws ObserverAlreadyRegisteredException Raised if an observer is already registered with this registry. idempotent void setObservers(RegistryObserver* registryObs, NodeObserver* nodeObs, ApplicationObserver* appObs, AdapterObserver* adptObs, ObjectObserver* objObs) throws ObserverAlreadyRegisteredException; - /** - * - * Set the observer identities that receive - * notifications the state of the registry - * or nodes changes. This operation should be used by clients that - * are using a bidirectional connection to communicate with the - * session. - * - * @param registryObs The registry observer identity. - * - * @param nodeObs The node observer identity. - * - * @param appObs The application observer. - * - * @param adptObs The adapter observer. - * - * @param objObs The object observer. - * - * @throws ObserverAlreadyRegisteredException Raised if an - * observer is already registered with this registry. - * - **/ + /// Set the observer identities that receive notifications the state of the registry or nodes changes. This + /// operation should be used by clients that are using a bidirectional connection to communicate with the session. + /// @param registryObs The registry observer identity. + /// @param nodeObs The node observer identity. + /// @param appObs The application observer. + /// @param adptObs The adapter observer. + /// @param objObs The object observer. + /// @throws ObserverAlreadyRegisteredException Raised if an observer is already registered with this registry. idempotent void setObserversByIdentity(Ice::Identity registryObs, Ice::Identity nodeObs, Ice::Identity appObs, Ice::Identity adptObs, Ice::Identity objObs) throws ObserverAlreadyRegisteredException; - /** - * - * Acquires an exclusive lock to start updating the registry applications. - * - * @return The current serial. - * - * @throws AccessDeniedException Raised if the exclusive lock can't be - * acquired. This might happen if the lock is currently acquired by - * another session. - * - **/ + /// Acquires an exclusive lock to start updating the registry applications. + /// @return The current serial. + /// @throws AccessDeniedException Raised if the exclusive lock can't be acquired. This might happen if the lock is + /// currently acquired by another session. int startUpdate() throws AccessDeniedException; - /** - * - * Finish updating the registry and release the exclusive lock. - * - * @throws AccessDeniedException Raised if the session doesn't hold the - * exclusive lock. - * - **/ + /// Finish updating the registry and release the exclusive lock. + /// @throws AccessDeniedException Raised if the session doesn't hold the exclusive lock. void finishUpdate() throws AccessDeniedException; - /** - * - * Get the name of the registry replica hosting this session. - * - * @return The replica name of the registry. - * - **/ + /// Get the name of the registry replica hosting this session. + /// @return The replica name of the registry. ["cpp:const"] idempotent string getReplicaName(); - /** - * - * Open the given server log file for reading. The file can be - * read with the returned file iterator. - * - * @param id The server id. - * - * @param path The path of the log file. A log file can be opened - * only if it's declared in the server or service deployment - * descriptor. - * - * @param count Specifies where to start reading the file. If - * negative, the file is read from the begining. If 0 or positive, - * the file is read from the last count lines. - * - * @return An iterator to read the file. - * - * @throws FileNotAvailableException Raised if the file can't be - * read. - * - * @throws ServerNotExistException Raised if the server doesn't - * exist. - * - * @throws NodeUnreachableException Raised if the node could not - * be reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Open the given server log file for reading. The file can be read with the returned file iterator. + /// @param id The server id. + /// @param path The path of the log file. A log file can be opened only if it's declared in the server or service + /// deployment descriptor. + /// @param count Specifies where to start reading the file. If negative, the file is read from the begining. If 0 + /// or positive, the file is read from the last count lines. + /// @return An iterator to read the file. + /// @throws FileNotAvailableException Raised if the file can't be read. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. FileIterator* openServerLog(string id, string path, int count) throws FileNotAvailableException, ServerNotExistException, NodeUnreachableException, DeploymentException; - /** - * - * Open the given server stderr file for reading. The file can be - * read with the returned file iterator. - * - * @param id The server id. - * - * @param count Specifies where to start reading the file. If - * negative, the file is read from the begining. If 0 or positive, - * the file is read from the last count lines. - * - * @return An iterator to read the file. - * - * @throws FileNotAvailableException Raised if the file can't be - * read. - * - * @throws ServerNotExistException Raised if the server doesn't - * exist. - * - * @throws NodeUnreachableException Raised if the node could not - * be reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Open the given server stderr file for reading. The file can be read with the returned file iterator. + /// @param id The server id. + /// @param count Specifies where to start reading the file. If negative, the file is read from the begining. If 0 + /// or positive, the file is read from the last count lines. + /// @return An iterator to read the file. + /// @throws FileNotAvailableException Raised if the file can't be read. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. FileIterator* openServerStdErr(string id, int count) throws FileNotAvailableException, ServerNotExistException, NodeUnreachableException, DeploymentException; - /** - * - * Open the given server stdout file for reading. The file can be - * read with the returned file iterator. - * - * @param id The server id. - * - * @param count Specifies where to start reading the file. If - * negative, the file is read from the begining. If 0 or positive, - * the file is read from the last count lines. - * - * @return An iterator to read the file. - * - * @throws FileNotAvailableException Raised if the file can't be - * read. - * - * @throws ServerNotExistException Raised if the server doesn't - * exist. - * - * @throws NodeUnreachableException Raised if the node could not - * be reached. - * - * @throws DeploymentException Raised if the server couldn't be - * deployed on the node. - * - **/ + /// Open the given server stdout file for reading. The file can be read with the returned file iterator. + /// @param id The server id. + /// @param count Specifies where to start reading the file. If negative, the file is read from the begining. + /// If 0 or positive, the file is read from the last count lines. + /// @return An iterator to read the file. + /// @throws FileNotAvailableException Raised if the file can't be read. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. + /// @throws DeploymentException Raised if the server couldn't be deployed on the node. FileIterator* openServerStdOut(string id, int count) throws FileNotAvailableException, ServerNotExistException, NodeUnreachableException, DeploymentException; - /** - * - * Open the given node stderr file for reading. The file can be - * read with the returned file iterator. - * - * @param name The node name. - * - * @param count Specifies where to start reading the file. If - * negative, the file is read from the begining. If 0 or positive, - * the file is read from the last count lines. - * - * @return An iterator to read the file. - * - * @throws FileNotAvailableException Raised if the file can't be - * read. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not - * be reached. - * - **/ + /// Open the given node stderr file for reading. The file can be read with the returned file iterator. + /// @param name The node name. + /// @param count Specifies where to start reading the file. If negative, the file is read from the begining. If 0 + /// or positive, the file is read from the last count lines. + /// @return An iterator to read the file. + /// @throws FileNotAvailableException Raised if the file can't be read. + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. FileIterator* openNodeStdErr(string name, int count) throws FileNotAvailableException, NodeNotExistException, NodeUnreachableException; - /** - * - * Open the given node stdout file for reading. The file can be - * read with the returned file iterator. - * - * @param name The node name. - * - * @param count Specifies where to start reading the file. If - * negative, the file is read from the begining. If 0 or positive, - * the file is read from the last count lines. - * - * @return An iterator to read the file. - * - * @throws FileNotAvailableException Raised if the file can't be - * read. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not - * be reached. - * - **/ + /// Open the given node stdout file for reading. The file can be read with the returned file iterator. + /// @param name The node name. + /// @param count Specifies where to start reading the file. If negative, the file is read from the begining. If 0 + /// or positive, the file is read from the last count lines. + /// @return An iterator to read the file. + /// @throws FileNotAvailableException Raised if the file can't be read. + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. FileIterator* openNodeStdOut(string name, int count) throws FileNotAvailableException, NodeNotExistException, NodeUnreachableException; - /** - * - * Open the given registry stderr file for reading. The file can be - * read with the returned file iterator. - * - * @param name The registry name. - * - * @param count Specifies where to start reading the file. If - * negative, the file is read from the begining. If 0 or positive, - * the file is read from the last count lines. - * - * @return An iterator to read the file. - * - * @throws FileNotAvailableException Raised if the file can't be - * read. - * - * @throws RegistryNotExistException Raised if the registry - * doesn't exist. - * - * @throws RegistryUnreachableException Raised if the registry - * could not be reached. - * - **/ + /// Open the given registry stderr file for reading. The file can be read with the returned file iterator. + /// @param name The registry name. + /// @param count Specifies where to start reading the file. If negative, the file is read from the begining. If 0 + /// or positive, the file is read from the last count lines. + /// @return An iterator to read the file. + /// @throws FileNotAvailableException Raised if the file can't be read. + /// @throws RegistryNotExistException Raised if the registry doesn't exist. + /// @throws RegistryUnreachableException Raised if the registry could not be reached. FileIterator* openRegistryStdErr(string name, int count) throws FileNotAvailableException, RegistryNotExistException, RegistryUnreachableException; - /** - * - * Open the given registry stdout file for reading. The file can be - * read with the returned file iterator. - * - * @param name The registry name. - * - * @param count Specifies where to start reading the file. If - * negative, the file is read from the begining. If 0 or positive, - * the file is read from the last count lines. - * - * @return An iterator to read the file. - * - * @throws FileNotAvailableException Raised if the file can't be - * read. - * - * @throws RegistryNotExistException Raised if the registry - * doesn't exist. - * - * @throws RegistryUnreachableException Raised if the registry - * could not be reached. - * - **/ + /// Open the given registry stdout file for reading. The file can be read with the returned file iterator. + /// @param name The registry name. + /// @param count Specifies where to start reading the file. If negative, the file is read from the begining. If 0 + /// or positive, the file is read from the last count lines. + /// @return An iterator to read the file. + /// @throws FileNotAvailableException Raised if the file can't be read. + /// @throws RegistryNotExistException Raised if the registry doesn't exist. + /// @throws RegistryUnreachableException Raised if the registry could not be reached. FileIterator * openRegistryStdOut(string name, int count) throws FileNotAvailableException, RegistryNotExistException, RegistryUnreachableException; diff --git a/slice/IceGrid/Descriptor.ice b/slice/IceGrid/Descriptor.ice index 94fac23ec72..a3a90065a32 100644 --- a/slice/IceGrid/Descriptor.ice +++ b/slice/IceGrid/Descriptor.ice @@ -34,1006 +34,455 @@ module IceGrid { -/** - * - * A mapping of string to string. - * - **/ +/// A mapping of string to string. dictionary StringStringDict; -/** - * - * Property descriptor. - * - **/ +/// Property descriptor. struct PropertyDescriptor { - /** - * - * The name of the property. - * - **/ + /// The name of the property. string name; - /** - * - * The value of the property. - * - **/ + /// The value of the property. string value; } -/** - * - * A sequence of property descriptors. - * - **/ +/// A sequence of property descriptors. ["java:type:java.util.LinkedList"] sequence PropertyDescriptorSeq; -/** - * - * A property set descriptor. - * - **/ +/// A property set descriptor. ["cpp:comparable"] struct PropertySetDescriptor { - /** - * - * References to named property sets. - * - **/ + /// References to named property sets. Ice::StringSeq references; - /** - * - * The property set properties. - * - **/ + /// The property set properties. PropertyDescriptorSeq properties; } -/** - * - * A mapping of property set name to property set descriptor. - * - **/ +/// A mapping of property set name to property set descriptor. dictionary PropertySetDescriptorDict; -/** - * - * An Ice object descriptor. - * - **/ +/// An Ice object descriptor. struct ObjectDescriptor { - /** - * - * The identity of the object. - * - **/ + /// The identity of the object. Ice::Identity id; - /** - * - * The object type. - * - **/ + /// The object type. string type; - /** - * - * Proxy options to use with the proxy created for this Ice object. If empty, - * the proxy will be created with the proxy options specified on the object - * adapter or replica group. - * - **/ + /// Proxy options to use with the proxy created for this Ice object. If empty, the proxy will be created with the + /// proxy options specified on the object adapter or replica group. string proxyOptions; } -/** - * - * A sequence of object descriptors. - * - **/ +/// A sequence of object descriptors. ["java:type:java.util.LinkedList"] sequence ObjectDescriptorSeq; -/** - * - * An Ice object adapter descriptor. - * - **/ +/// An Ice object adapter descriptor. ["cpp:comparable"] struct AdapterDescriptor { - /** - * - * The object adapter name. - * - **/ + /// The object adapter name. string name; - /** - * - * The description of this object adapter. - * - **/ + /// The description of this object adapter. string description; - /** - * - * The object adapter id. - * - **/ + /// The object adapter id. string id; - /** - * - * The replica id of this adapter. - * - **/ + /// The replica id of this adapter. string replicaGroupId; - /** - * - * The adapter priority. This is eventually used when the adapter - * is member of a replica group to sort the adapter endpoints by - * priority. - * - **/ + /// The adapter priority. This is eventually used when the adapter is member of a replica group to sort the adapter + /// endpoints by priority. string priority; - /** - * - * Flag to specify if the object adapter will register a process object. - * - **/ + /// Flag to specify if the object adapter will register a process object. bool registerProcess; - /** - * - * If true the lifetime of this object adapter is the same of the - * server lifetime. This information is used by the IceGrid node - * to figure out the server state: the server is active only if - * all its "server lifetime" adapters are active. - * - **/ + /// If true the lifetime of this object adapter is the same of the server lifetime. This information is used by the + /// IceGrid node to figure out the server state: the server is active only if all its "server lifetime" adapters + /// are active. bool serverLifetime; - /** - * - * The well-known object descriptors associated with this object adapter. - * - **/ + /// The well-known object descriptors associated with this object adapter. ObjectDescriptorSeq objects; - /** - * - * The allocatable object descriptors associated with this object adapter. - * - **/ + /// The allocatable object descriptors associated with this object adapter. ObjectDescriptorSeq allocatables; } -/** - * - * A sequence of adapter descriptors. - * - **/ +/// A sequence of adapter descriptors. ["java:type:java.util.LinkedList"] sequence AdapterDescriptorSeq; -/** - * - * A communicator descriptor. - * - **/ +/// A communicator descriptor. class CommunicatorDescriptor { - /** - * - * The object adapters. - * - **/ + /// The object adapters. AdapterDescriptorSeq adapters; - /** - * - * The property set. - * - **/ + /// The property set. PropertySetDescriptor propertySet; - /** - * - * The path of each log file. - * - **/ + /// The path of each log file. Ice::StringSeq logs; - /** - * - * A description of this descriptor. - * - **/ + /// A description of this descriptor. string description; } -/** - * - * A distribution descriptor defines an IcePatch2 server and the - * directories to retrieve from the patch server. - * - **/ +/// A distribution descriptor defines an IcePatch2 server and the directories to retrieve from the patch server. ["cpp:comparable"] struct DistributionDescriptor { - /** The proxy of the IcePatch2 server. */ + /// The proxy of the IcePatch2 server. string icepatch; - /** The source directories. */ + /// The source directories. ["java:type:java.util.LinkedList"] Ice::StringSeq directories; } -/** - * - * An Ice server descriptor. - * - **/ +/// An Ice server descriptor. class ServerDescriptor extends CommunicatorDescriptor { - /** - * - * The server id. - * - **/ + /// The server id. string id; - /** - * - * The path of the server executable. - * - **/ + /// The path of the server executable. string exe; - /** - * - * The Ice version used by this server. This is only required if - * backward compatibility with servers using old Ice versions is - * needed (otherwise the registry will assume the server is using - * the same Ice version). - * For example "3.1.1", "3.2", "3.3.0". - * - **/ + /// The Ice version used by this server. This is only required if backward compatibility with servers using old + /// Ice versions is needed (otherwise the registry will assume the server is using the same Ice version). + /// For example "3.1.1", "3.2", "3.3.0". string iceVersion; - /** - * - * The path to the server working directory. - * - **/ + /// The path to the server working directory. string pwd; - /** - * - * The command line options to pass to the server executable. - * - **/ + /// The command line options to pass to the server executable. ["java:type:java.util.LinkedList"] Ice::StringSeq options; - /** - * - * The server environment variables. - * - **/ + /// The server environment variables. ["java:type:java.util.LinkedList"] Ice::StringSeq envs; - /** - * - * The server activation mode (possible values are "on-demand" or - * "manual"). - * - **/ + //// The server activation mode (possible values are "on-demand" or "manual"). string activation; - /** - * - * The activation timeout (an integer value representing the - * number of seconds to wait for activation). - * - **/ + /// The activation timeout (an integer value representing the number of seconds to wait for activation). string activationTimeout; - /** - * - * The deactivation timeout (an integer value representing the - * number of seconds to wait for deactivation). - * - **/ + /// The deactivation timeout (an integer value representing the number of seconds to wait for deactivation). string deactivationTimeout; - /** - * - * Specifies if the server depends on the application - * distribution. - * - **/ + /// Specifies if the server depends on the application distribution. bool applicationDistrib; - /** - * - * The distribution descriptor. - * - **/ + /// The distribution descriptor. DistributionDescriptor distrib; - /** - * - * Specifies if the server is allocatable. - * - **/ + /// Specifies if the server is allocatable. bool allocatable; - /** - * - * The user account used to run the server. - * - **/ + /// The user account used to run the server. string user; } -/** - * - * A sequence of server descriptors. - * - **/ +/// A sequence of server descriptors. ["java:type:java.util.LinkedList"] sequence ServerDescriptorSeq; -/** - * - * An IceBox service descriptor. - * - **/ +/// An IceBox service descriptor. class ServiceDescriptor extends CommunicatorDescriptor { - /** - * - * The service name. - * - **/ + /// The service name. string name; - /** - * - * The entry point of the IceBox service. - * - **/ + /// The entry point of the IceBox service. string entry; } -/** - * - * A sequence of service descriptors. - * - **/ +/// A sequence of service descriptors. ["java:type:java.util.LinkedList"] sequence ServiceDescriptorSeq; -/** - * - * A server template instance descriptor. - * - **/ +/// A server template instance descriptor. ["cpp:comparable"] struct ServerInstanceDescriptor { - /** - * - * The template used by this instance. - * - **/ + /// The template used by this instance. string template; - /** - * - * The template parameter values. - * - **/ + /// The template parameter values. StringStringDict parameterValues; - /** - * - * The property set. - * - **/ + /// The property set. PropertySetDescriptor propertySet; - /** - * - * The services property sets. It's only valid to set these - * property sets if the template is an IceBox server template. - * - **/ + /// The services property sets. It's only valid to set these property sets if the template is an IceBox server + /// template. PropertySetDescriptorDict servicePropertySets; } -/** - * - * A sequence of server instance descriptors. - * - **/ +/// A sequence of server instance descriptors. ["java:type:java.util.LinkedList"] sequence ServerInstanceDescriptorSeq; -/** - * - * A template descriptor for server or service templates. - * - **/ +/// A template descriptor for server or service templates. struct TemplateDescriptor { - /** - * - * The template. - * - **/ + /// The template. CommunicatorDescriptor descriptor; - /** - * - * The parameters required to instantiate the template. - * - **/ + /// The parameters required to instantiate the template. ["java:type:java.util.LinkedList"] Ice::StringSeq parameters; - /** - * - * The parameters default values. - * - **/ + /// The parameters default values. StringStringDict parameterDefaults; } -/** - * - * A mapping of template identifier to template descriptor. - * - **/ +/// A mapping of template identifier to template descriptor. dictionary TemplateDescriptorDict; -/** - * - * A service template instance descriptor. - * - **/ +/// A service template instance descriptor. struct ServiceInstanceDescriptor { - /** - * - * The template used by this instance. - * - **/ + /// The template used by this instance. string template; - /** - * - * The template parameter values. - * - **/ + /// The template parameter values. StringStringDict parameterValues; - /** - * - * The service definition if the instance isn't a template - * instance (i.e.: if the template attribute is empty). - * - **/ + /// The service definition if the instance isn't a template instance (i.e.: if the template attribute is empty). ServiceDescriptor descriptor; - /** - * - * The property set. - * - **/ + /// The property set. PropertySetDescriptor propertySet; } -/** - * - * A sequence of service instance descriptors. - * - **/ +/// A sequence of service instance descriptors. ["java:type:java.util.LinkedList"] sequence ServiceInstanceDescriptorSeq; -/** - * - * An IceBox server descriptor. - * - **/ +/// An IceBox server descriptor. class IceBoxDescriptor extends ServerDescriptor { - /** - * - * The service instances. - * - **/ + /// The service instances. ServiceInstanceDescriptorSeq services; } -/** - * - * A node descriptor. - * - **/ +/// A node descriptor. struct NodeDescriptor { - /** - * - * The variables defined for the node. - * - **/ + /// The variables defined for the node. ["java:type:java.util.TreeMap"] StringStringDict variables; - /** - * - * The server instances. - * - **/ + /// The server instances. ServerInstanceDescriptorSeq serverInstances; - /** - * - * Servers (which are not template instances). - * - **/ + /// Servers (which are not template instances). ServerDescriptorSeq servers; - /** - * - * Load factor of the node. - * - **/ + /// Load factor of the node. string loadFactor; - /** - * - * The description of this node. - * - **/ + /// The description of this node. string description; - /** - * - * Property set descriptors. - * - **/ + /// Property set descriptors. PropertySetDescriptorDict propertySets; } -/** - * - * Mapping of node name to node descriptor. - * - **/ +/// Mapping of node name to node descriptor. dictionary NodeDescriptorDict; -/** - * - * A base class for load balancing policies. - * - **/ +/// A base class for load balancing policies. class LoadBalancingPolicy { - /** - * - * The number of replicas that will be used to gather the - * endpoints of a replica group. - * - **/ + /// The number of replicas that will be used to gather the endpoints of a replica group. string nReplicas; } -/** - * - * Random load balancing policy. - * - **/ +/// Random load balancing policy. class RandomLoadBalancingPolicy extends LoadBalancingPolicy { } -/** - * - * Ordered load balancing policy. - * - **/ +/// Ordered load balancing policy. class OrderedLoadBalancingPolicy extends LoadBalancingPolicy { } -/** - * - * Round robin load balancing policy. - * - **/ +/// Round robin load balancing policy. class RoundRobinLoadBalancingPolicy extends LoadBalancingPolicy { } -/** - * - * Adaptive load balancing policy. - * - **/ +/// Adaptive load balancing policy. class AdaptiveLoadBalancingPolicy extends LoadBalancingPolicy { - /** - * - * The load sample to use for the load balancing. The allowed - * values for this attribute are "1", "5" and "15", representing - * respectively the load average over the past minute, the past 5 - * minutes and the past 15 minutes. - * - **/ + /// The load sample to use for the load balancing. The allowed values for this attribute are "1", "5" and "15", + /// representing respectively the load average over the past minute, the past 5 minutes and the past 15 minutes. string loadSample; } -/** - * - * A replica group descriptor. - * - **/ +/// A replica group descriptor. struct ReplicaGroupDescriptor { - /** - * - * The id of the replica group. - * - **/ + /// The id of the replica group. string id; - /** - * - * The load balancing policy. - * - **/ + /// The load balancing policy. LoadBalancingPolicy loadBalancing; - /** - * - * Default options for proxies created for the replica group. - * - **/ + /// Default options for proxies created for the replica group. string proxyOptions; - /** - * - * The object descriptors associated with this object adapter. - * - **/ + /// The object descriptors associated with this object adapter. ObjectDescriptorSeq objects; - /** - * - * The description of this replica group. - * - **/ + /// The description of this replica group. string description; - /** - * - * The filter to use for this replica group. - * - **/ + /// The filter to use for this replica group. string filter; } -/** - * - * A sequence of replica groups. - * - **/ +/// A sequence of replica groups. ["java:type:java.util.LinkedList"] sequence ReplicaGroupDescriptorSeq; -/** - * - * An application descriptor. - * - **/ +/// An application descriptor. struct ApplicationDescriptor { - /** - * - * The application name. - * - **/ + /// The application name. string name; - /** - * - * The variables defined in the application descriptor. - * - **/ + /// The variables defined in the application descriptor. ["java:type:java.util.TreeMap"] StringStringDict variables; - /** - * - * The replica groups. - * - **/ + /// The replica groups. ReplicaGroupDescriptorSeq replicaGroups; - /** - * - * The server templates. - * - **/ + /// The server templates. TemplateDescriptorDict serverTemplates; - /** - * - * The service templates. - * - **/ + /// The service templates. TemplateDescriptorDict serviceTemplates; - /** - * - * The application nodes. - * - **/ + /// The application nodes. NodeDescriptorDict nodes; - /** - * - * The application distribution. - * - **/ + /// The application distribution. DistributionDescriptor distrib; - /** - * - * The description of this application. - * - **/ + /// The description of this application. string description; - /** - * - * Property set descriptors. - * - **/ + /// Property set descriptors. PropertySetDescriptorDict propertySets; } -/** - * - * A sequence of application descriptors. - * - **/ +/// A sequence of application descriptors. ["java:type:java.util.LinkedList"] sequence ApplicationDescriptorSeq; -/** - * - * A "boxed" string. - * - **/ +/// A "boxed" string. class BoxedString { - /** The value of the boxed string. */ + /// The value of the boxed string. string value; } -/** - * - * A node update descriptor to describe the updates to apply to a - * node of a deployed application. - * - **/ +/// A node update descriptor to describe the updates to apply to a node of a deployed application. struct NodeUpdateDescriptor { - /** - * - * The name of the node to update. - * - **/ + /// The name of the node to update. string name; - /** - * - * The updated description (or null if the description wasn't - * updated.) - * - **/ + /// The updated description (or null if the description wasn't updated.) BoxedString description; - /** - * - * The variables to update. - * - **/ + /// The variables to update. ["java:type:java.util.TreeMap"] StringStringDict variables; - /** - * - * The variables to remove. - * - **/ + /// The variables to remove. Ice::StringSeq removeVariables; - /** - * - * The property sets to update. - * - **/ + /// The property sets to update. PropertySetDescriptorDict propertySets; - /** - * - * The property sets to remove. - * - **/ + /// The property sets to remove. Ice::StringSeq removePropertySets; - /** - * - * The server instances to update. - * - **/ + /// The server instances to update. ServerInstanceDescriptorSeq serverInstances; - /** - * - * The servers which are not template instances to update. - * - **/ + /// The servers which are not template instances to update. ServerDescriptorSeq servers; - /** - * - * The ids of the servers to remove. - * - **/ + /// The ids of the servers to remove. Ice::StringSeq removeServers; - /** - * - * The updated load factor of the node (or null if the load factor - * was not updated). - * - **/ + /// The updated load factor of the node (or null if the load factor was not updated). BoxedString loadFactor; } -/** - * - * A sequence of node update descriptors. - * - **/ +/// A sequence of node update descriptors. ["java:type:java.util.LinkedList"] sequence NodeUpdateDescriptorSeq; -/** - * - * A "boxed" distribution descriptor. - * - **/ +/// A "boxed" distribution descriptor. class BoxedDistributionDescriptor { - /** The value of the boxed distribution descriptor. */ + /// The value of the boxed distribution descriptor. DistributionDescriptor value; } -/** - * - * An application update descriptor to describe the updates to apply - * to a deployed application. - * - **/ +/// An application update descriptor to describe the updates to apply to a deployed application. struct ApplicationUpdateDescriptor { - /** - * - * The name of the application to update. - * - **/ + /// The name of the application to update. string name; - /** - * - * The updated description (or null if the description wasn't - * updated.) - * - **/ + /// The updated description (or null if the description wasn't updated.) BoxedString description; - /** - * - * The updated distribution application descriptor. - * - **/ + /// The updated distribution application descriptor. BoxedDistributionDescriptor distrib; - /** - * - * The variables to update. - * - **/ + /// The variables to update. ["java:type:java.util.TreeMap"] StringStringDict variables; - /** - * - * The variables to remove. - * - **/ + /// The variables to remove. Ice::StringSeq removeVariables; - /** - * - * The property sets to update. - * - **/ + /// The property sets to update. PropertySetDescriptorDict propertySets; - /** - * - * The property sets to remove. - * - **/ + /// The property sets to remove. Ice::StringSeq removePropertySets; - /** - * - * The replica groups to update. - * - **/ + /// The replica groups to update. ReplicaGroupDescriptorSeq replicaGroups; - /** - * - * The replica groups to remove. - * - **/ + /// The replica groups to remove. Ice::StringSeq removeReplicaGroups; - /** - * - * The server templates to update. - * - **/ + /// The server templates to update. TemplateDescriptorDict serverTemplates; - /** - * - * The ids of the server template to remove. - * - **/ + /// The ids of the server template to remove. Ice::StringSeq removeServerTemplates; - /** - * - * The service templates to update. - * - **/ + /// The service templates to update. TemplateDescriptorDict serviceTemplates; - /** - * - * The ids of the service template to remove. - * - **/ + /// The ids of the service template to remove. Ice::StringSeq removeServiceTemplates; - /** - * - * The application nodes to update. - * - **/ + /// The application nodes to update. NodeUpdateDescriptorSeq nodes; - /** - * - * The nodes to remove. - * - **/ + /// The nodes to remove. Ice::StringSeq removeNodes; } diff --git a/slice/IceGrid/Exception.ice b/slice/IceGrid/Exception.ice index bb2a183e712..19c9412a86f 100644 --- a/slice/IceGrid/Exception.ice +++ b/slice/IceGrid/Exception.ice @@ -34,362 +34,171 @@ module IceGrid { -/** - * - * This exception is raised if an application does not exist. - * - **/ +/// This exception is raised if an application does not exist. exception ApplicationNotExistException { - /** - * - * The name of the application. - * - **/ + /// The name of the application. string name; } -/** - * - * This exception is raised if a server does not exist. - * - **/ +/// This exception is raised if a server does not exist. exception ServerNotExistException { - /** - * - * The identifier of the server. - * - */ + /// The identifier of the server. string id; } -/** - * - * This exception is raised if a server failed to start. - * - **/ +/// This exception is raised if a server failed to start. exception ServerStartException { - /** - * - * The identifier of the server. - * - **/ + /// The identifier of the server. string id; - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * This exception is raised if a server failed to stop. - * - **/ +/// This exception is raised if a server failed to stop. exception ServerStopException { - /** - * - * The identifier of the server. - * - **/ + /// The identifier of the server. string id; - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * This exception is raised if an adapter does not exist. - * - **/ +/// This exception is raised if an adapter does not exist. exception AdapterNotExistException { - /** - * - * The id of the object adapter. - * - **/ + /// The id of the object adapter. string id; } -/** - * - * This exception is raised if an object already exists. - * - **/ +/// This exception is raised if an object already exists. exception ObjectExistsException { - /** - * - * The identity of the object. - * - **/ + /// The identity of the object. Ice::Identity id; } -/** - * - * This exception is raised if an object is not registered. - * - **/ +/// This exception is raised if an object is not registered. exception ObjectNotRegisteredException { - /** - * - * The identity of the object. - * - **/ + /// The identity of the object. Ice::Identity id; } -/** - * - * This exception is raised if a node does not exist. - * - **/ +/// This exception is raised if a node does not exist. exception NodeNotExistException { - /** - * - * The node name. - * - **/ + /// The node name. string name; } -/** - * - * This exception is raised if a registry does not exist. - * - **/ +/// This exception is raised if a registry does not exist. exception RegistryNotExistException { - /** - * - * The registry name. - * - **/ + /// The registry name. string name; } -/** - * - * An exception for deployment errors. - * - **/ +/// An exception for deployment errors. exception DeploymentException { - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * This exception is raised if a node could not be reached. - * - **/ +/// This exception is raised if a node could not be reached. exception NodeUnreachableException { - /** - * - * The name of the node that is not reachable. - * - **/ + /// The name of the node that is not reachable. string name; - /** - * - * The reason why the node couldn't be reached. - * - **/ + /// The reason why the node couldn't be reached. string reason; } -/** - * - * This exception is raised if a server could not be reached. - * - **/ +/// This exception is raised if a server could not be reached. exception ServerUnreachableException { - /** - * - * The id of the server that is not reachable. - * - **/ + /// The id of the server that is not reachable. string name; - /** - * - * The reason why the server couldn't be reached. - * - **/ + /// The reason why the server couldn't be reached. string reason; } -/** - * - * This exception is raised if a registry could not be reached. - * - **/ +/// This exception is raised if a registry could not be reached. exception RegistryUnreachableException { - /** - * - * The name of the registry that is not reachable. - * - **/ + /// The name of the registry that is not reachable. string name; - /** - * - * The reason why the registry couldn't be reached. - * - **/ + /// The reason why the registry couldn't be reached. string reason; } -/** - * - * This exception is raised if an unknown signal was sent to - * to a server. - * - **/ +/// This exception is raised if an unknown signal was sent to to a server. exception BadSignalException { - /** - * - * The details of the unknown signal. - * - **/ + /// The details of the unknown signal. string reason; } -/** - * - * This exception is raised if a patch failed. - * - **/ +/// This exception is raised if a patch failed. exception PatchException { - /** - * - * The reasons why the patch failed. - * - **/ + /// The reasons why the patch failed. Ice::StringSeq reasons; } -/** - * - * This exception is raised if a registry lock wasn't - * acquired or is already held by a session. - * - **/ +/// his exception is raised if a registry lock wasn't acquired or is already held by a session. exception AccessDeniedException { - /** - * - * The id of the user holding the lock (if any). - * - **/ + /// The id of the user holding the lock (if any). string lockUserId; } -/** - * - * This exception is raised if the allocation of an object failed. - * - **/ +/// This exception is raised if the allocation of an object failed. exception AllocationException { - /** - * - * The reason why the object couldn't be allocated. - * - **/ + /// The reason why the object couldn't be allocated. string reason; } -/** - * - * This exception is raised if the request to allocate an object times - * out. - * - **/ +/// This exception is raised if the request to allocate an object times out. exception AllocationTimeoutException extends AllocationException { } -/** - * - * This exception is raised if a client is denied the ability to create - * a session with IceGrid. - * - **/ +/// This exception is raised if a client is denied the ability to create a session with IceGrid. exception PermissionDeniedException { - /** - * - * The reason why permission was denied. - * - **/ + /// The reason why permission was denied. string reason; } -/** - * - * This exception is raised if an observer is already registered with - * the registry. - * - * @see AdminSession#setObservers - * @see AdminSession#setObserversByIdentity - * - **/ +/// This exception is raised if an observer is already registered with the registry. +/// @see AdminSession#setObservers +/// @see AdminSession#setObserversByIdentity exception ObserverAlreadyRegisteredException { - /** - * - * The identity of the observer. - * - **/ + /// The identity of the observer. Ice::Identity id; } -/** - * - * This exception is raised if a file is not available. - * - * @see AdminSession#openServerStdOut - * @see AdminSession#openServerStdErr - * @see AdminSession#openNodeStdOut - * @see AdminSession#openNodeStdErr - * @see AdminSession#openRegistryStdOut - * @see AdminSession#openRegistryStdErr - * - **/ +/// This exception is raised if a file is not available. +/// @see AdminSession#openServerStdOut +/// @see AdminSession#openServerStdErr +/// @see AdminSession#openNodeStdOut +/// @see AdminSession#openNodeStdErr +/// @see AdminSession#openRegistryStdOut +/// @see AdminSession#openRegistryStdErr exception FileNotAvailableException { - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } diff --git a/slice/IceGrid/FileParser.ice b/slice/IceGrid/FileParser.ice index e52a3fad224..2585beefcbe 100644 --- a/slice/IceGrid/FileParser.ice +++ b/slice/IceGrid/FileParser.ice @@ -28,45 +28,23 @@ ["objc:prefix:ICEGRID"] module IceGrid { - -/** - * - * This exception is raised if an error occurs during parsing. - * - **/ -exception ParseException -{ - /** The reason for the failure. */ - string reason; -} - -/** - * - * icegridadmin provides a {@link FileParser} - * object to transform XML files into {@link ApplicationDescriptor} - * objects. - * - **/ -interface FileParser -{ - - /** - * - * Parse a file. - * - * @param xmlFile Full pathname to the file. - * - * @param adminProxy An Admin proxy, used only to retrieve default - * templates when needed. May be null. - * - * @return The application descriptor. - * - * @throws ParseException Raised if an error occurred during parsing. - * - **/ - - idempotent ApplicationDescriptor parse(string xmlFile, Admin* adminProxy) - throws ParseException; -} - + /// This exception is raised if an error occurs during parsing. + exception ParseException + { + /// The reason for the failure. + string reason; + } + + /// icegridadmin provides a {@link FileParser} object to transform XML files into + /// {@link ApplicationDescriptor} objects. + interface FileParser + { + /// Parse a file. + /// @param xmlFile Full pathname to the file. + /// @param adminProxy An Admin proxy, used only to retrieve default templates when needed. May be null. + /// @return The application descriptor. + /// @throws ParseException Raised if an error occurred during parsing. + idempotent ApplicationDescriptor parse(string xmlFile, Admin* adminProxy) + throws ParseException; + } } diff --git a/slice/IceGrid/PluginFacade.ice b/slice/IceGrid/PluginFacade.ice index 24e554124c5..42fb6914048 100644 --- a/slice/IceGrid/PluginFacade.ice +++ b/slice/IceGrid/PluginFacade.ice @@ -32,297 +32,143 @@ module IceGrid { -/** - * - * The ReplicaGroupFilter is used by IceGrid to filter adapters - * returned to the client when it resolves a filtered replica group. - * - * IceGrid provides the list of available adapters. The implementation - * of this method can use the provided context and connection to - * filter and return the filtered set of adapters. - * - **/ +/// The ReplicaGroupFilter is used by IceGrid to filter adapters returned to the client when it resolves a filtered +/// replica group. +/// IceGrid provides the list of available adapters. The implementationof this method can use the provided context and +/// connection to filter and return the filtered set of adapters. local interface ReplicaGroupFilter { - /** - * - * Filter the given set of adapters. - * - * @param replicaGroupId The replica group ID. - * - * @param adapterIds The adpater IDs to filter. - * - * @param con The connection from the Ice client which is - * resolving the replica group endpoints. - * - * @param ctx The context from the Ice client which is resolving - * the replica group endpoints. - * - * @return The filtered adapter IDs. - * - **/ + /// Filter the given set of adapters. + /// @param replicaGroupId The replica group ID. + /// @param adapterIds The adpater IDs to filter. + /// @param con The connection from the Ice client which is resolving the replica group endpoints. + /// @param ctx The context from the Ice client which is resolving the replica group endpoints. + /// @return The filtered adapter IDs. Ice::StringSeq filter(string replicaGroupId, Ice::StringSeq adapterIds, Ice::Connection con, Ice::Context ctx); } -/** - * - * The TypeFilter is used by IceGrid to filter well-known proxies - * returned to the client when it searches a well-known object by - * type. - * - * IceGrid provides the list of available proxies. The implementation - * of this method can use the provided context and connection to - * filter and return the filtered set of proxies. - * - **/ +/// The TypeFilter is used by IceGrid to filter well-known proxies returned to the client when it searches a well-known +/// object by type. +/// IceGrid provides the list of available proxies. The implementation of this method can use the provided context and +/// connection to filter and return the filtered set of proxies. local interface TypeFilter { - /** - * - * Filter the given set of proxies. - * - * @param type The type. - * - * @param proxies The proxies to filter. - * - * @param con The connection from the Ice client which is - * looking up well-known objects by type. - * - * @param ctx The context from the Ice client which is looking up - * well-known objects by type. - * - * @return The filtered proxies. - * - **/ + /// Filter the given set of proxies. + /// @param type The type. + /// @param proxies The proxies to filter. + /// @param con The connection from the Ice client which is looking up well-known objects by type. + /// @param ctx The context from the Ice client which is looking up well-known objects by type. + /// @return The filtered proxies. Ice::ObjectProxySeq filter(string type, Ice::ObjectProxySeq proxies, Ice::Connection con, Ice::Context ctx); } -/** - * - * The RegistryPluginFacade is implemented by IceGrid and can be used - * by plugins and filter implementations to retrieve information from - * IceGrid about the well-known objects or adapters. It's also used to - * register/unregister replica group and type filters. - * - **/ +/// The RegistryPluginFacade is implemented by IceGrid and can be used by plugins and filter implementations to +/// retrieve information from IceGrid about the well-known objects or adapters. It's also used to register/unregister +/// replica group and type filters. local interface RegistryPluginFacade { - /** - * - * Get an application descriptor. - * - * @param name The application name. - * - * @return The application descriptor. - * - * @throws ApplicationNotExistException Raised if the application - * doesn't exist. - * - **/ + /// Get an application descriptor. + /// @param name The application name. + /// @return The application descriptor. + /// @throws ApplicationNotExistException Raised if the application doesn't exist. ["nonmutating", "cpp:const"] idempotent ApplicationInfo getApplicationInfo(string name) throws ApplicationNotExistException; - /** - * - * Get the server information for the server with the given id. - * - * @param id The server id. - * - * @throws ServerNotExistException Raised if the server doesn't exist. - * - * @return The server information. - * - **/ + /// Get the server information for the server with the given id. + /// @param id The server id. + /// @throws ServerNotExistException Raised if the server doesn't exist. + /// @return The server information. + ["nonmutating", "cpp:const"] idempotent ServerInfo getServerInfo(string id) throws ServerNotExistException; - /** - * - * Get the ID of the server to which the given adapter belongs. - * - * @param adapterId The adapter ID. - * - * @return The server ID or the empty string if the given - * identifier is not associated to an object adapter defined with - * an application descriptor. - * - * @throws AdapterNotExistException Raised if the adapter doesn't - * exist. - * - **/ + /// Get the ID of the server to which the given adapter belongs. + /// @param adapterId The adapter ID. + /// @return The server ID or the empty string if the given identifier is not associated to an object adapter + /// defined with an application descriptor. + /// @throws AdapterNotExistException Raised if the adapter doesn't exist. ["nonmutating", "cpp:const"] idempotent string getAdapterServer(string adapterId) throws AdapterNotExistException; - /** - * - * Get the name of the application to which the given adapter belongs. - * - * @param adapterId The adapter ID. - * - * @return The application name or the empty string if the given - * identifier is not associated to a replica group or object - * adapter defined with an application descriptor. - * - * @throws AdapterNotExistException Raised if the adapter doesn't - * exist. - * - **/ + /// Get the name of the application to which the given adapter belongs. + /// @param adapterId The adapter ID. + /// @return The application name or the empty string if the given identifier is not associated to a replica group + /// or object adapter defined with an application descriptor. + /// @throws AdapterNotExistException Raised if the adapter doesn't exist. ["nonmutating", "cpp:const"] idempotent string getAdapterApplication(string adapterId) throws AdapterNotExistException; - /** - * - * Get the name of the node to which the given adapter belongs. - * - * @param adapterId The adapter ID. - * - * @return The node name or the empty string if the given - * identifier is not associated to an object adapter defined with - * an application descriptor. - * - * @throws AdapterNotExistException Raised if the adapter doesn't - * exist. - * - **/ + /// Get the name of the node to which the given adapter belongs. + /// @param adapterId The adapter ID. + /// @return The node name or the empty string if the given identifier is not associated to an object adapter + /// defined with an application descriptor. + /// @throws AdapterNotExistException Raised if the adapter doesn't exist. ["nonmutating", "cpp:const"] idempotent string getAdapterNode(string adapterId) throws AdapterNotExistException; - /** - * - * Get the adapter information for the replica group or adapter - * with the given id. - * - * @param id The adapter id. - * - * @return A sequence of adapter information structures. If the - * given id refers to an adapter, this sequence will contain only - * one element. If the given id refers to a replica group, the - * sequence will contain the adapter information of each member of - * the replica group. - * - * @throws AdapterNotExistException Raised if the adapter or - * replica group doesn't exist. - * - **/ + /// Get the adapter information for the replica group or adapter with the given id. + /// @param id The adapter id. + /// @return A sequence of adapter information structures. If the given id refers to an adapter, this sequence will + /// contain only one element. If the given id refers to a replica group, the sequence will contain the adapter + /// information of each member of the replica group. + /// @throws AdapterNotExistException Raised if the adapter or replica group doesn't exist. ["nonmutating", "cpp:const"] idempotent AdapterInfoSeq getAdapterInfo(string id) throws AdapterNotExistException; - /** - * - * Get the object info for the object with the given identity. - * - * @param id The identity of the object. - * - * @return The object info. - * - * @throws ObjectNotRegisteredException Raised if the object isn't - * registered with the registry. - * - **/ + /// Get the object info for the object with the given identity. + /// @param id The identity of the object. + /// @return The object info. + /// @throws ObjectNotRegisteredException Raised if the object isn't registered with the registry. ["nonmutating", "cpp:const"] idempotent ObjectInfo getObjectInfo(Ice::Identity id) throws ObjectNotRegisteredException; - /** - * - * Get the node information for the node with the given name. - * - * @param name The node name. - * - * @return The node information. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - **/ + /// Get the node information for the node with the given name. + /// @param name The node name. + /// @return The node information. + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. ["nonmutating", "cpp:const"] idempotent NodeInfo getNodeInfo(string name) throws NodeNotExistException, NodeUnreachableException; - /** - * - * Get the load averages of the node. - * - * @param name The node name. - * - * @return The node load information. - * - * @throws NodeNotExistException Raised if the node doesn't exist. - * - * @throws NodeUnreachableException Raised if the node could not be - * reached. - * - **/ + /// Get the load averages of the node. + /// @param name The node name. + /// @return The node load information. + /// @throws NodeNotExistException Raised if the node doesn't exist. + /// @throws NodeUnreachableException Raised if the node could not be reached. ["nonmutating", "cpp:const"] idempotent LoadInfo getNodeLoad(string name) throws NodeNotExistException, NodeUnreachableException; - /** - * - * Get the property value for the given property and adapter. The - * property is looked up in the server or service descriptor where - * the adapter is defined. - * - * @param adapterId The adapter ID - * - * @param name The name of the property. - * - * @return The property value. - * - * @throws AdapterNotExistException Raised if the adapter doesn't exist. - * - **/ + /// Get the property value for the given property and adapter. The property is looked up in the server or service + /// descriptor where the adapter is defined. + /// @param adapterId The adapter ID + /// @param name The name of the property. + /// @return The property value. + /// @throws AdapterNotExistException Raised if the adapter doesn't exist. ["nonmutating", "cpp:const"] idempotent string getPropertyForAdapter(string adapterId, string name) throws AdapterNotExistException; - /** - * - * Add a replica group filter. - * - * @param id The identifier of the filter. This identifier must - * match the value of the "filter" attribute specified in the - * replica group descriptor. To filter dynamically registered - * replica groups, you should use the empty filter id. - * - * @param filter The filter implementation. - * - **/ + /// Add a replica group filter. + /// @param id The identifier of the filter. This identifier must match the value of the "filter" attribute + /// specified in the replica group descriptor. To filter dynamically registered replica groups, you should use the + /// empty filter id. + /// @param filter The filter implementation. ["cpp:noexcept", "swift:noexcept"] void addReplicaGroupFilter(string id, ReplicaGroupFilter filter); - /** - * - * Remove a replica group filter. - * - * @param id The identifier of the filter. - * - * @param filter The filter implementation. - * - * @return True of the filter was removed, false otherwise. - * - **/ + /// Remove a replica group filter. + /// @param id The identifier of the filter. + /// @param filter The filter implementation. + /// @return True of the filter was removed, false otherwise. ["cpp:noexcept", "swift:noexcept"] bool removeReplicaGroupFilter(string id, ReplicaGroupFilter filter); - /** - * - * Add a type filter. - * - * @param type The type to register this filter with. - * - * @param filter The filter implementation. - * - **/ + /// Add a type filter. + /// @param type The type to register this filter with. + /// @param filter The filter implementation. ["cpp:noexcept", "swift:noexcept"] void addTypeFilter(string type, TypeFilter filter); - /** - * - * Remove a type filter. - * - * @param type The type to register this filter with. - * - * @param filter The filter implementation. - * - * @return True of the filter was removed, false otherwise. - * - **/ + /// Remove a type filter. + /// @param type The type to register this filter with. + /// @param filter The filter implementation. + /// @return True of the filter was removed, false otherwise. ["cpp:noexcept", "swift:noexcept"] bool removeTypeFilter(string type, TypeFilter filter); } diff --git a/slice/IceGrid/Registry.ice b/slice/IceGrid/Registry.ice index 15d3319cc58..e34e310db68 100644 --- a/slice/IceGrid/Registry.ice +++ b/slice/IceGrid/Registry.ice @@ -31,239 +31,117 @@ ["objc:prefix:ICEGRID"] module IceGrid { - -/** - * - * Determines which load sampling interval to use. - * - **/ -enum LoadSample -{ - /** - * Sample every minute. - **/ - LoadSample1, - - /** - * Sample every five minutes. - **/ - LoadSample5, - - /** - * Sample every fifteen minutes. - **/ - LoadSample15 -} - -/** - * - * The IceGrid query interface. This interface is accessible to - * Ice clients who wish to look up well-known objects. - * - **/ -interface Query -{ - /** - * - * Find a well-known object by identity. - * - * @param id The identity. - * - * @return The proxy or null if no such object has been found. - * - **/ - ["nonmutating", "cpp:const"] idempotent Object* findObjectById(Ice::Identity id); - - /** - * - * Find a well-known object by type. If there are several objects - * registered for the given type, the object is randomly - * selected. - * - * @param type The object type. - * - * @return The proxy or null, if no such object has been found. - * - **/ - ["nonmutating", "cpp:const"] idempotent Object* findObjectByType(string type); - - /** - * - * Find a well-known object by type on the least-loaded node. If - * the registry does not know which node hosts the object - * (for example, because the object was registered with a direct proxy), the - * registry assumes the object is hosted on a node that has a load - * average of 1.0. - * - * @param type The object type. - * - * @param sample The sampling interval. - * - * @return The proxy or null, if no such object has been found. - * - **/ - ["nonmutating", "cpp:const"] idempotent Object* findObjectByTypeOnLeastLoadedNode(string type, LoadSample sample); - - /** - * - * Find all the well-known objects with the given type. - * - * @param type The object type. - * - * @return The proxies or an empty sequence, if no such objects - * have been found. - * - **/ - ["nonmutating", "cpp:const"] idempotent Ice::ObjectProxySeq findAllObjectsByType(string type); - - /** - * - * Find all the object replicas associated with the given - * proxy. If the given proxy is not an indirect proxy from a - * replica group, an empty sequence is returned. - * - * @param proxy The object proxy. - * - * @return The proxies of each object replica or an empty sequence, - * if the given proxy is not from a replica group. - * - **/ - ["cpp:const"] idempotent Ice::ObjectProxySeq findAllReplicas(Object* proxy); -} - -/** - * - * The IceGrid registry allows clients create sessions - * directly with the registry. - * - * @see Session - * @see AdminSession - * - **/ -interface Registry -{ - /** - * - * Create a client session. - * - * @return A proxy for the newly created session. - * - * @param userId The user id. - * - * @param password The password for the given user id. - * - * @throws PermissionDeniedException Raised if the password for - * the given user id is not correct, or if the user is not allowed - * access. - * - **/ - Session* createSession(string userId, string password) - throws PermissionDeniedException; - - /** - * - * Create an administrative session. - * - * @return A proxy for the newly created session. - * - * @param userId The user id. - * - * @param password The password for the given user id. - * - * @throws PermissionDeniedException Raised if the password for - * the given user id is not correct, or if the user is not allowed - * access. - * - **/ - AdminSession* createAdminSession(string userId, string password) - throws PermissionDeniedException; - - /** - * - * Create a client session from a secure connection. - * - * @return A proxy for the newly created session. - * - * @throws PermissionDeniedException Raised if the password for - * the given user id is not correct, or if the user is not allowed - * access. - * - **/ - Session* createSessionFromSecureConnection() - throws PermissionDeniedException; - - /** - * - * Create an administrative session from a secure connection. - * - * @return A proxy for the newly created session. - * - * @throws PermissionDeniedException Raised if the password for - * the given user id is not correct, or if the user is not allowed - * access. - * - **/ - AdminSession* createAdminSessionFromSecureConnection() - throws PermissionDeniedException; - - /** - * - * Get the session timeout. If a client or administrative client - * doesn't call the session keepAlive method in the time interval - * defined by this timeout, IceGrid might reap the session. - * - * @see Session#keepAlive - * @see AdminSession#keepAlive - * - * @return The timeout (in seconds). - * - **/ - ["nonmutating", "cpp:const"] idempotent int getSessionTimeout(); - - /** - * - * Get the value of the ACM timeout. Clients supporting ACM - * connection heartbeats can enable them instead of explicitly - * sending keep alives requests. - * - * NOTE: This method is only available since Ice 3.6. - * - * @return The timeout (in seconds). - * - **/ - ["nonmutating", "cpp:const"] idempotent int getACMTimeout(); -} - -/** - * - * The IceGrid locator interface provides access to the {@link Query} - * and {@link Registry} object of the IceGrid registry. - * - * @see Query - * @see Registry - * - **/ -interface Locator extends Ice::Locator -{ - /** - * - * Get the proxy of the registry object hosted by this IceGrid - * registry. - * - * @return The proxy of the registry object. - * - **/ - ["cpp:const"] idempotent Registry* getLocalRegistry(); - - /** - * - * Get the proxy of the query object hosted by this IceGrid - * registry. - * - * @return The proxy of the query object. - * - **/ - ["cpp:const"] idempotent Query* getLocalQuery(); -} - + /// Determines which load sampling interval to use. + enum LoadSample + { + /// Sample every minute. + LoadSample1, + + /// Sample every five minutes. + LoadSample5, + + /// Sample every fifteen minutes. + LoadSample15 + } + + /// The IceGrid query interface. This interface is accessible to Ice clients who wish to look up well-known + /// objects. + interface Query + { + /// Find a well-known object by identity. + /// @param id The identity. + /// @return The proxy or null if no such object has been found. + ["nonmutating", "cpp:const"] idempotent Object* findObjectById(Ice::Identity id); + + /// Find a well-known object by type. If there are several objects registered for the given type, the object is + /// randomly selected. + /// @param type The object type. + /// @return The proxy or null, if no such object has been found. + ["nonmutating", "cpp:const"] idempotent Object* findObjectByType(string type); + + /// Find a well-known object by type on the least-loaded node. If the registry does not know which node hosts + /// the object (for example, because the object was registered with a direct proxy), the registry assumes the + /// object is hosted on a node that has a load average of 1.0. + /// @param type The object type. + /// @param sample The sampling interval. + /// @return The proxy or null, if no such object has been found. + ["nonmutating", "cpp:const"] idempotent Object* findObjectByTypeOnLeastLoadedNode(string type, LoadSample sample); + + /// Find all the well-known objects with the given type. + /// @param type The object type. + /// @return The proxies or an empty sequence, if no such objects have been found. + ["nonmutating", "cpp:const"] idempotent Ice::ObjectProxySeq findAllObjectsByType(string type); + + /// Find all the object replicas associated with the given proxy. If the given proxy is not an indirect proxy + /// from a replica group, an empty sequence is returned. + /// @param proxy The object proxy. + /// @return The proxies of each object replica or an empty sequence, if the given proxy is not from a replica + /// group. + ["cpp:const"] idempotent Ice::ObjectProxySeq findAllReplicas(Object* proxy); + } + + /// The IceGrid registry allows clients create sessions directly with the registry. + /// @see Session + /// @see AdminSession + interface Registry + { + /// Create a client session. + /// @param userId The user id. + /// @param password The password for the given user id. + /// @return A proxy for the newly created session. + /// @throws PermissionDeniedException Raised if the password for the given user id is not correct, or if the + /// user is not allowed access. + Session* createSession(string userId, string password) + throws PermissionDeniedException; + + /// Create an administrative session. + /// @return A proxy for the newly created session. + /// @param userId The user id. + /// @param password The password for the given user id. + /// @throws PermissionDeniedException Raised if the password for the given user id is not correct, or if the + /// user is not allowed access. + AdminSession* createAdminSession(string userId, string password) + throws PermissionDeniedException; + + /// Create a client session from a secure connection. + /// @return A proxy for the newly created session. + /// @throws PermissionDeniedException Raised if the password for the given user id is not correct, or if the + /// user is not allowed access. + Session* createSessionFromSecureConnection() + throws PermissionDeniedException; + + /// Create an administrative session from a secure connection. + /// @return A proxy for the newly created session. + /// @throws PermissionDeniedException Raised if the password for the given user id is not correct, or if the + /// user is not allowed access. + AdminSession* createAdminSessionFromSecureConnection() + throws PermissionDeniedException; + + /// Get the session timeout. If a client or administrative client doesn't call the session keepAlive method in + /// the time interval defined by this timeout, IceGrid might reap the session. + /// @see Session#keepAlive + /// @see AdminSession#keepAlive + /// @return The timeout (in seconds). + ["nonmutating", "cpp:const"] idempotent int getSessionTimeout(); + + /// Get the value of the ACM timeout. Clients supporting ACM connection heartbeats can enable them instead of + /// explicitly sending keep alives requests. This method is only available since Ice 3.6. + /// @return The timeout (in seconds). + ["nonmutating", "cpp:const"] idempotent int getACMTimeout(); + } + + /// The IceGrid locator interface provides access to the {@link Query} and {@link Registry} object of the IceGrid + /// registry. + /// @see Query + /// @see Registry + interface Locator extends Ice::Locator + { + /// Get the proxy of the registry object hosted by this IceGrid registry. + /// @return The proxy of the registry object. + ["cpp:const"] idempotent Registry* getLocalRegistry(); + + /// Get the proxy of the query object hosted by this IceGrid registry. + /// @return The proxy of the query object. + ["cpp:const"] idempotent Query* getLocalQuery(); + } } diff --git a/slice/IceGrid/Session.ice b/slice/IceGrid/Session.ice index 8905a2e8abb..5330e874430 100644 --- a/slice/IceGrid/Session.ice +++ b/slice/IceGrid/Session.ice @@ -29,100 +29,52 @@ ["objc:prefix:ICEGRID"] module IceGrid { + /// A session object is used by IceGrid clients to allocate and release objects. Client sessions are created either + /// via the {@link Registry} object or via the registry client SessionManager object. + /// @see Registry + interface Session extends Glacier2::Session + { + /// Keep the session alive. Clients should call this operation regularly to prevent the server from reaping the + /// session. + /// @see Registry#getSessionTimeout + idempotent void keepAlive(); -/** - * - * A session object is used by IceGrid clients to allocate and - * release objects. Client sessions are created either via the - * {@link Registry} object or via the registry client SessionManager - * object. - * - * @see Registry - * - **/ -interface Session extends Glacier2::Session -{ - /** - * - * Keep the session alive. Clients should call this operation - * regularly to prevent the server from reaping the session. - * - * @see Registry#getSessionTimeout - * - **/ - idempotent void keepAlive(); - - /** - * - * Allocate an object. Depending on the allocation timeout, this - * operation might hang until the object is available or until the - * timeout is reached. - * - * @param id The identity of the object to allocate. - * - * @return The proxy of the allocated object. - * - * @throws ObjectNotRegisteredException Raised if the object with - * the given identity is not registered with the registry. - * - * @throws AllocationException Raised if the object can't be - * allocated. - * - * @see #setAllocationTimeout - * @see #releaseObject - * - **/ - ["amd"] Object* allocateObjectById(Ice::Identity id) - throws ObjectNotRegisteredException, AllocationException; + /// Allocate an object. Depending on the allocation timeout, this operation might hang until the object is + /// available or until the timeout is reached. + /// @param id The identity of the object to allocate. + /// @return The proxy of the allocated object. + /// @throws ObjectNotRegisteredException Raised if the object with the given identity is not registered with + /// the registry. + /// @throws AllocationException Raised if the object can't be allocated. + /// @see #setAllocationTimeout + /// @see #releaseObject + ["amd"] Object* allocateObjectById(Ice::Identity id) + throws ObjectNotRegisteredException, AllocationException; - /** - * - * Allocate an object with the given type. Depending on the - * allocation timeout, this operation can block until an object - * becomes available or until the timeout is reached. - * - * @param type The type of the object. - * - * @return The proxy of the allocated object. - * - * @throws AllocationException Raised if the object could not be allocated. - * - * @see #setAllocationTimeout - * @see #releaseObject - * - **/ - ["amd"] Object* allocateObjectByType(string type) - throws AllocationException; + /// Allocate an object with the given type. Depending on the allocation timeout, this operation can block until + /// an object becomes available or until the timeout is reached. + /// @param type The type of the object. + /// @return The proxy of the allocated object. + /// @throws AllocationException Raised if the object could not be allocated. + /// @see #setAllocationTimeout + /// @see #releaseObject + ["amd"] Object* allocateObjectByType(string type) + throws AllocationException; - /** - * - * Release an object that was allocated using allocateObjectById or - * allocateObjectByType. - * - * @param id The identity of the object to release. - * - * @throws ObjectNotRegisteredException Raised if the object with - * the given identity is not registered with the registry. - * - * @throws AllocationException Raised if the given object can't be - * released. This might happen if the object isn't allocatable or - * isn't allocated by the session. - * - **/ - void releaseObject(Ice::Identity id) - throws ObjectNotRegisteredException, AllocationException; - - /** - * - * Set the allocation timeout. If no objects are available for an - * allocation request, a call to allocateObjectById or - * allocateObjectByType will block for the duration of this - * timeout. - * - * @param timeout The timeout in milliseconds. - * - **/ - idempotent void setAllocationTimeout(int timeout); -} + /// Release an object that was allocated using allocateObjectById or + /// allocateObjectByType. + /// @param id The identity of the object to release. + /// @throws ObjectNotRegisteredException Raised if the object with the given identity is not registered with + /// the registry. + /// @throws AllocationException Raised if the given object can't be released. This might happen if the object + /// isn't allocatable or isn't allocated by the session. + void releaseObject(Ice::Identity id) + throws ObjectNotRegisteredException, AllocationException; + /// Set the allocation timeout. If no objects are available for an allocation request, a call to + /// allocateObjectById or allocateObjectByType will block for the duration of this + /// timeout. + /// @param timeout The timeout in milliseconds. + idempotent void setAllocationTimeout(int timeout); + } } diff --git a/slice/IceGrid/UserAccountMapper.ice b/slice/IceGrid/UserAccountMapper.ice index d9984601b9c..909f31705e5 100644 --- a/slice/IceGrid/UserAccountMapper.ice +++ b/slice/IceGrid/UserAccountMapper.ice @@ -26,44 +26,22 @@ ["objc:prefix:ICEGRID"] module IceGrid { - -/** - * - * This exception is raised if a user account for a given session - * identifier can't be found. - * - **/ -exception UserAccountNotFoundException -{ -} - -/** - * - * A user account mapper object is used by IceGrid nodes to map - * session identifiers to user accounts. - * - **/ -interface UserAccountMapper -{ - /** - * - * Get the name of the user account for the given user. This is - * used by IceGrid nodes to figure out the user account to use - * to run servers. - * - * @param user The value of the server descriptor's user - * attribute. If this attribute is not defined, and the server's - * activation mode is session, the default value of - * user is the session identifier. - * - * @return The user account name. - * - * @throws UserAccountNotFoundException Raised if no user account - * is found for the given user. - * - **/ - string getUserAccount(string user) - throws UserAccountNotFoundException; -} - + /// This exception is raised if a user account for a given session identifier can't be found. + exception UserAccountNotFoundException + { + } + + /// A user account mapper object is used by IceGrid nodes to map session identifiers to user accounts. + interface UserAccountMapper + { + /// Get the name of the user account for the given user. This is used by IceGrid nodes to figure out the user + /// account to use to run servers. + /// @param user The value of the server descriptor's user attribute. If this attribute is not + /// defined, and the server's activation mode is session, the default value of user + /// is the session identifier. + /// @return The user account name. + /// @throws UserAccountNotFoundException Raised if no user account is found for the given user. + string getUserAccount(string user) + throws UserAccountNotFoundException; + } } diff --git a/slice/IceIAP/ConnectionInfo.ice b/slice/IceIAP/ConnectionInfo.ice index 6f6006e1165..163e793ff10 100644 --- a/slice/IceIAP/ConnectionInfo.ice +++ b/slice/IceIAP/ConnectionInfo.ice @@ -21,53 +21,25 @@ module IceIAP { -/** - * - * Provides access to the connection details of an IAP connection - * - **/ +/// Provides access to the connection details of an IAP connection. local class ConnectionInfo extends Ice::ConnectionInfo { - /** - * - * The accessory name. - * - **/ + /// The accessory name. string name; - /** - * - * The accessory manufacturer. - * - **/ + /// The accessory manufacturer. string manufacturer; - /** - * - * The accessory model number. - * - **/ + /// The accessory model number. string modelNumber; - /** - * - * The accessory firmare revision. - * - **/ + /// The accessory firmare revision. string firmwareRevision; - /** - * - * The accessory hardware revision. - * - **/ + /// The accessory hardware revision. string hardwareRevision; - /** - * - * The protocol used by the accessory. - * - **/ + /// The protocol used by the accessory. string protocol; } diff --git a/slice/IceIAP/EndpointInfo.ice b/slice/IceIAP/EndpointInfo.ice index 625ce499fe0..61cbc57ddcc 100644 --- a/slice/IceIAP/EndpointInfo.ice +++ b/slice/IceIAP/EndpointInfo.ice @@ -17,51 +17,24 @@ #include -/** - * - * IceIAP provides a secure transport for Ice. - * - **/ +/// IceIAP provides a secure transport for Ice. ["objc:prefix:ICEIAP", "swift:module:Ice:IAP"] module IceIAP { -/** - * - * Provides access to an IAP endpoint information. - * - **/ +/// Provides access to an IAP endpoint information. local class EndpointInfo extends Ice::EndpointInfo { - /** - * - * The accessory manufacturer or empty to not match against - * a manufacturer. - * - **/ + /// The accessory manufacturer or empty to not match against a manufacturer. string manufacturer; - /** - * - * The accessory model number or empty to not match against - * a model number. - * - **/ + /// The accessory model number or empty to not match against a model number. string modelNumber; - /** - * - * The accessory name or empty to not match against - * the accessory name. - * - **/ + /// The accessory name or empty to not match against the accessory name. string name; - /** - * - * The protocol supported by the accessory. - * - **/ + /// The protocol supported by the accessory. string protocol; } diff --git a/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice b/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice index f5fb2c2806f..608eaa836af 100644 --- a/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +++ b/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice @@ -22,62 +22,30 @@ [["java:package:com.zeroc"]] #endif -/** - * IceLocatorDiscovery is an Ice plug-in that enables the discovery of IceGrid and custom locators via - * UDP multicast. - **/ +/// IceLocatorDiscovery is an Ice plug-in that enables the discovery of IceGrid and custom locators via UDP multicast. module IceLocatorDiscovery { - -/** - * - * The Ice lookup reply interface must be implemented by clients which - * are searching for Ice locators. Ice locator implementations invoke - * on this interface to provide their locator proxy. - * - * @see Lookup - * - **/ -interface LookupReply -{ - /** - * - * This method is called by the implementation of the Lookup - * interface to reply to a findLocator request. - * - * @param prx The proxy of the locator. - * - **/ - void foundLocator(Ice::Locator* prx); -} - -/** - * - * The Ice lookup interface is implemented by Ice locator - * implementations and can be used by clients to find available Ice - * locators on the network. - * - * Ice locator implementations provide a well-known `Ice/LocatorLookup' - * object accessible through UDP multicast. Clients typically make a - * multicast findLocator request to find the locator proxy. - * - * @see LookupReply - * - **/ -interface Lookup -{ - /** - * - * Find a locator proxy with the given instance name. - * - * @param instanceName Restrict the search to Ice registries - * configured with the given instance name. If empty, all the - * available registries will reply. - * - * @param reply The reply object to use to send the reply. - * - **/ - idempotent void findLocator(string instanceName, LookupReply* reply); -} - + /// The Ice lookup reply interface must be implemented by clients which are searching for Ice locators. Ice locator + /// implementations invoke on this interface to provide their locator proxy. + /// @see Lookup + interface LookupReply + { + /// This method is called by the implementation of the Lookup interface to reply to a findLocator request. + /// @param prx The proxy of the locator. + void foundLocator(Ice::Locator* prx); + } + + /// The Ice lookup interface is implemented by Ice locator implementations and can be used by clients to find + /// available Ice locators on the network. + /// Ice locator implementations provide a well-known `Ice/LocatorLookup' object accessible through UDP multicast. + /// Clients typically make a multicast findLocator request to find the locator proxy. + /// @see LookupReply + interface Lookup + { + /// Find a locator proxy with the given instance name. + /// @param instanceName Restrict the search to Ice registries configured with the given instance name. If + /// empty, all the available registries will reply. + /// @param reply The reply object to use to send the reply. + idempotent void findLocator(string instanceName, LookupReply* reply); + } } diff --git a/slice/IcePatch2/FileInfo.ice b/slice/IcePatch2/FileInfo.ice index 6e36a96cbf5..3ff0df6e9b4 100644 --- a/slice/IcePatch2/FileInfo.ice +++ b/slice/IcePatch2/FileInfo.ice @@ -28,58 +28,42 @@ module IcePatch2 { -/** - * - * Basic information about a single file. - * - **/ +/// Basic information about a single file. struct FileInfo { - /** The pathname. **/ + /// The pathname. string path; - /** The SHA-1 checksum of the file. **/ + /// The SHA-1 checksum of the file. Ice::ByteSeq checksum; - /** The size of the compressed file in number of bytes. **/ + /// The size of the compressed file in number of bytes. int size; - /** The executable flag. */ + /// The executable flag. bool executable; } -/** - * - * A sequence with information about many files. - * - **/ +/// A sequence with information about many files. sequence FileInfoSeq; -/** - * - * Basic information about a single file. - * - **/ +/// Basic information about a single file. struct LargeFileInfo { - /** The pathname. **/ + /// The pathname. string path; - /** The SHA-1 checksum of the file. **/ + /// The SHA-1 checksum of the file. Ice::ByteSeq checksum; - /** The size of the compressed file in number of bytes. **/ + /// The size of the compressed file in number of bytes. long size; - /** The executable flag. */ + /// The executable flag. bool executable; } -/** - * - * A sequence with information about many files. - * - **/ +/// A sequence with information about many files. sequence LargeFileInfoSeq; } diff --git a/slice/IcePatch2/FileServer.ice b/slice/IcePatch2/FileServer.ice index 27fa8633977..3099bda8255 100644 --- a/slice/IcePatch2/FileServer.ice +++ b/slice/IcePatch2/FileServer.ice @@ -24,165 +24,85 @@ [["java:package:com.zeroc"]] #endif -/** - * - * IcePatch can be used to update file hierarchies in a simple and - * efficient manner. Checksums ensure file integrity, and data is - * compressed before downloading. - * - **/ +/// IcePatch can be used to update file hierarchies in a simple and efficient manner. Checksums ensure file integrity, +/// and data is compressed before downloading. ["objc:prefix:ICEPATCH2"] module IcePatch2 { -/** - * - * A sequence of byte sequences. Each element is the checksum for a - * partition. - * - **/ +/// A sequence of byte sequences. Each element is the checksum for a partition. sequence ByteSeqSeq; -/** - * - * A partition argument was not in the range 0-255. - * - **/ +/// A partition argument was not in the range 0-255. exception PartitionOutOfRangeException { } -/** - * - * This exception is raised if a file's contents cannot be read. - * - **/ +/// This exception is raised if a file's contents cannot be read. exception FileAccessException { - /** - * - * An explanation of the reason for the failure. - * - **/ + /// An explanation of the reason for the failure. string reason; } -/** - * - * This exception is raised if an operation tries to use a file whose size is - * larger than 2.1 GB. Use the "large" versions of the operations instead. - * - **/ +/// This exception is raised if an operation tries to use a file whose size is larger than 2.1 GB. Use the "large" +/// versions of the operations instead. exception FileSizeRangeException extends FileAccessException { } -/** - * - * The interface that provides access to files. - * - **/ +/// The interface that provides access to files. interface FileServer { - /** - * - * Return file information for the specified partition. - * - *

This operation is deprecated and only present for - * compatibility with old Ice clients (older than version 3.6). - * - * @param partition The partition number in the range 0-255. - * - * @return A sequence containing information about the files in the - * specified partition. - * - * @throws PartitionOutOfRangeException If the partition number is out of range. - * @throws FileSizeRangeException If a file is larger than 2.1GB. - **/ + /// Return file information for the specified partition.

This operation is deprecated and + /// only present for compatibility with old Ice clients (older than version 3.6). + /// @param partition The partition number in the range 0-255. + /// @return A sequence containing information about the files in the specified partition. + /// @throws PartitionOutOfRangeException If the partition number is out of range. + /// @throws FileSizeRangeException If a file is larger than 2.1GB. ["deprecate:getFileInfoSeq() is deprecated, use getLargeFileInfoSeq() instead.", "nonmutating", "cpp:const"] idempotent FileInfoSeq getFileInfoSeq(int partition) throws PartitionOutOfRangeException, FileSizeRangeException; - /** - * - * Returns file information for the specified partition. - * - * @param partition The partition number in the range 0-255. - * - * @return A sequence containing information about the files in the - * specified partition. - * - * @throws PartitionOutOfRangeException If the partition number is out of range. - **/ + /// Returns file information for the specified partition. + /// @param partition The partition number in the range 0-255. + /// @return A sequence containing information about the files in the specified partition. + /// @throws PartitionOutOfRangeException If the partition number is out of range. ["nonmutating", "cpp:const"] idempotent LargeFileInfoSeq getLargeFileInfoSeq(int partition) throws PartitionOutOfRangeException; - /** - * - * Return the checksums for all partitions. - * - * @return A sequence containing 256 checksums. Partitions with a - * checksum that differs from the previous checksum for the same - * partition contain updated files. Partitions with a checksum - * that is identical to the previous checksum do not contain - * updated files. - * - **/ + /// Return the checksums for all partitions. + /// @return A sequence containing 256 checksums. Partitions with a checksum that differs from the previous checksum + /// for the same partition contain updated files. Partitions with a checksum that is identical to the previous + /// checksum do not contain updated files. ["nonmutating", "cpp:const"] idempotent ByteSeqSeq getChecksumSeq(); - /** - * - * Return the master checksum for all partitions. If this checksum is the same - * as for a previous run, the entire file set is up-to-date. - * - * @return The master checksum for the file set. - * - **/ + /// Return the master checksum for all partitions. If this checksum is the same as for a previous run, the entire + /// file set is up-to-date. + /// @return The master checksum for the file set. ["nonmutating", "cpp:const"] idempotent Ice::ByteSeq getChecksum(); - /** - * - * Read the specified file. This operation may only return fewer bytes than requested - * in case there was an end-of-file condition. - * - *

This operation is deprecated and only present for - * compatibility with old Ice clients (older than version 3.6). - * - * @param path The pathname (relative to the data directory) for - * the file to be read. - * - * @param pos The file offset at which to begin reading. - * - * @param num The number of bytes to be read. - * - * @return A sequence containing the compressed file contents. - * - * @throws FileAccessException If an error occurred while trying to read the file. - * @throws FileSizeRangeException If a file is larger than 2.1GB. - * - **/ + /// Read the specified file. This operation may only return fewer bytes than requested in case there was an end-of-file + /// condition.

This operation is deprecated and only present for compatibility with old Ice + /// clients (older than version 3.6). + /// @param path The pathname (relative to the data directory) for the file to be read. + /// @param pos The file offset at which to begin reading. + /// @param num The number of bytes to be read. + /// @return A sequence containing the compressed file contents. + /// @throws FileAccessException If an error occurred while trying to read the file. + /// @throws FileSizeRangeException If a file is larger than 2.1GB. ["deprecate:getFileCompressed() is deprecated, use getLargeFileCompressed() instead.", "amd", "nonmutating", "cpp:const", "cpp:array"] idempotent Ice::ByteSeq getFileCompressed(string path, int pos, int num) throws FileAccessException, FileSizeRangeException; - /** - * - * Read the specified file. This operation may only return fewer bytes than requested - * in case there was an end-of-file condition. - * - * @param path The pathname (relative to the data directory) for - * the file to be read. - * - * @param pos The file offset at which to begin reading. - * - * @param num The number of bytes to be read. - * - * @return A sequence containing the compressed file contents. - * - * @throws FileAccessException If an error occurred while trying to read the file. - * - **/ + /// Read the specified file. This operation may only return fewer bytes than requested in case there was an + /// end-of-file condition. + /// @param path The pathname (relative to the data directory) for the file to be read. + /// @param pos The file offset at which to begin reading. + /// @param num The number of bytes to be read. + /// @return A sequence containing the compressed file contents. + /// @throws FileAccessException If an error occurred while trying to read the file. ["amd", "nonmutating", "cpp:const", "cpp:array"] idempotent Ice::ByteSeq getLargeFileCompressed(string path, long pos, int num) throws FileAccessException; diff --git a/slice/IceSSL/ConnectionInfo.ice b/slice/IceSSL/ConnectionInfo.ice index 61f30636b6b..c4a354814eb 100644 --- a/slice/IceSSL/ConnectionInfo.ice +++ b/slice/IceSSL/ConnectionInfo.ice @@ -30,24 +30,20 @@ module IceSSL { -/** - * - * Provides access to the connection details of an SSL connection - * - **/ +/// Provides access to the connection details of an SSL connection local class ConnectionInfo extends Ice::ConnectionInfo { - /** The negotiated cipher suite. */ + /// The negotiated cipher suite. string cipher; - /** The certificate chain. */ + /// The certificate chain. ["cpp:type:std::vector", "java:type:java.security.cert.Certificate[]", "cs:type:System.Security.Cryptography.X509Certificates.X509Certificate2[]", "swift:type:[SecCertificate]"] Ice::StringSeq certs; - /** The certificate chain verification status. */ + /// The certificate chain verification status. bool verified; } diff --git a/slice/IceSSL/EndpointInfo.ice b/slice/IceSSL/EndpointInfo.ice index 7c4b3d4b748..c31c274ccba 100644 --- a/slice/IceSSL/EndpointInfo.ice +++ b/slice/IceSSL/EndpointInfo.ice @@ -20,11 +20,7 @@ #include -/** - * - * IceSSL provides a secure transport for Ice. - * - **/ +/// IceSSL provides a secure transport for Ice. #ifndef __SLICE2JAVA_COMPAT__ [["java:package:com.zeroc"]] #endif @@ -33,11 +29,7 @@ module IceSSL { -/** - * - * Provides access to an SSL endpoint information. - * - **/ +/// Provides access to an SSL endpoint information. local class EndpointInfo extends Ice::EndpointInfo { } diff --git a/slice/IceStorm/IceStorm.ice b/slice/IceStorm/IceStorm.ice index ebc12fbade4..9e745fd0327 100644 --- a/slice/IceStorm/IceStorm.ice +++ b/slice/IceStorm/IceStorm.ice @@ -27,377 +27,172 @@ [["java:package:com.zeroc"]] #endif -/** - * - * A messaging service with support for federation. In contrast to - * most other messaging or event services, IceStorm supports typed - * events, meaning that broadcasting a message over a federation is as - * easy as invoking a method on an interface. - * - **/ +/// A messaging service with support for federation. In contrast to most other messaging or event services, IceStorm +/// supports typed events, meaning that broadcasting a message over a federation is as easy as invoking a method on an +/// interface. ["objc:prefix:ICESTORM"] module IceStorm { interface Topic; -/** - * - * Information on the topic links. - * - **/ +/// Information on the topic links. struct LinkInfo { - /** - * - * The linked topic. - * - **/ + /// The linked topic. Topic* theTopic; - /** - * - * The name of the linked topic. - * - **/ + /// The name of the linked topic. string name; - /** - * - * The cost of traversing this link. - * - **/ + /// The cost of traversing this link. int cost; } -/** - * - * A sequence of {@link LinkInfo} objects. - * - **/ +/// A sequence of {@link LinkInfo} objects. sequence LinkInfoSeq; -/** - * - * This dictionary represents quality of service parameters. - * - * @see Topic#subscribeAndGetPublisher - * - */ +/// This dictionary represents quality of service parameters. +/// @see Topic#subscribeAndGetPublisher dictionary QoS; -/** - * - * This exception indicates that an attempt was made to create a link - * that already exists. - * - **/ +/// This exception indicates that an attempt was made to create a link that already exists. exception LinkExists { - /** - * - * The name of the linked topic. - * - */ + /// The name of the linked topic. string name; } -/** - * - * This exception indicates that an attempt was made to remove a - * link that does not exist. - * - **/ +/// This exception indicates that an attempt was made to remove a link that does not exist. exception NoSuchLink { - /** - * - * The name of the link that does not exist. - * - */ + /// The name of the link that does not exist. string name; } -/** - * - * This exception indicates that an attempt was made to subscribe - * a proxy for which a subscription already exists. - * - **/ +/// This exception indicates that an attempt was made to subscribe a proxy for which a subscription already exists. exception AlreadySubscribed { } -/** - * - * This exception indicates that an attempt was made to subscribe - * a proxy that is null. - * - **/ +/// This exception indicates that an attempt was made to subscribe a proxy that is null. exception InvalidSubscriber { - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * This exception indicates that a subscription failed due to an - * invalid QoS. - * - **/ +/// This exception indicates that a subscription failed due to an invalid QoS. exception BadQoS { - /** - * - * The reason for the failure. - * - **/ + /// The reason for the failure. string reason; } -/** - * - * Publishers publish information on a particular topic. A topic - * logically represents a type. - * - * @see TopicManager - * - **/ +/// Publishers publish information on a particular topic. A topic logically represents a type. A +/// @see TopicManager interface Topic { - /** - * - * Get the name of this topic. - * - * @return The name of the topic. - * - * @see TopicManager#create - * - **/ + /// Get the name of this topic. + /// @return The name of the topic. + /// @see TopicManager#create ["nonmutating", "cpp:const"] idempotent string getName(); - /** - * - * Get a proxy to a publisher object for this topic. To publish - * data to a topic, the publisher calls getPublisher and then - * casts to the topic type. An unchecked cast must be used on this - * proxy. If a replicated IceStorm deployment is used this call - * may return a replicated proxy. - * - * @return A proxy to publish data on this topic. - * - **/ + /// Get a proxy to a publisher object for this topic. To publish data to a topic, the publisher calls getPublisher + /// and then casts to the topic type. An unchecked cast must be used on this proxy. If a replicated IceStorm + /// deployment is used this call may return a replicated proxy. + /// @return A proxy to publish data on this topic. ["nonmutating", "cpp:const"] idempotent Object* getPublisher(); - /** - * - * Get a non-replicated proxy to a publisher object for this - * topic. To publish data to a topic, the publisher calls - * getPublisher and then casts to the topic type. An unchecked - * cast must be used on this proxy. - * - * @return A proxy to publish data on this topic. - * - **/ + /// Get a non-replicated proxy to a publisher object for this topic. To publish data to a topic, the publisher + /// calls getPublisher and then casts to the topic type. An unchecked cast must be used on this proxy. + /// @return A proxy to publish data on this topic. ["nonmutating", "cpp:const"] idempotent Object* getNonReplicatedPublisher(); - /** - * - * Subscribe with the given qos to this topic. A - * per-subscriber publisher object is returned. - * - * @param theQoS The quality of service parameters for this - * subscription. - * - * @param subscriber The subscriber's proxy. - * - * @return The per-subscriber publisher object. - * - * @throws AlreadySubscribed Raised if the subscriber object is - * already subscribed. - * - * @throws InvalidSubscriber Raised if the subscriber object is null. - * - * @throws BadQoS Raised if the requested quality of service - * is unavailable or invalid. - * - * @see #unsubscribe - * - **/ + /// Subscribe with the given qos to this topic. A per-subscriber publisher object is returned. + /// @param theQoS The quality of service parameters for this subscription. + /// @param subscriber The subscriber's proxy. + /// @return The per-subscriber publisher object. + /// @throws AlreadySubscribed Raised if the subscriber object is already subscribed. + /// @throws InvalidSubscriber Raised if the subscriber object is null. + /// @throws BadQoS Raised if the requested quality of service is unavailable or invalid. + /// @see #unsubscribe Object* subscribeAndGetPublisher(QoS theQoS, Object* subscriber) throws AlreadySubscribed, InvalidSubscriber, BadQoS; - /** - * - * Unsubscribe the given subscriber. - * - * @param subscriber The proxy of an existing subscriber. - * - * @see #subscribeAndGetPublisher - * - **/ + /// Unsubscribe the given subscriber. + /// @param subscriber The proxy of an existing subscriber. + /// @see #subscribeAndGetPublisher idempotent void unsubscribe(Object* subscriber); - /** - * - * Create a link to the given topic. All events originating - * on this topic will also be sent to linkTo. - * - * @param linkTo The topic to link to. - * - * @param cost The cost to the linked topic. - * - * @throws LinkExists Raised if a link to the same topic already - * exists. - * - **/ + /// Create a link to the given topic. All events originating on this topic will also be sent to + /// linkTo. + /// @param linkTo The topic to link to. + /// @param cost The cost to the linked topic. + /// @throws LinkExists Raised if a link to the same topic already exists. void link(Topic* linkTo, int cost) throws LinkExists; - /** - * - * Destroy the link from this topic to the given topic linkTo. - * - * @param linkTo The topic to destroy the link to. - * - * @throws NoSuchLink Raised if a link to the topic does not exist. - * - **/ + /// Destroy the link from this topic to the given topic linkTo. + /// @param linkTo The topic to destroy the link to. + /// @throws NoSuchLink Raised if a link to the topic does not exist. void unlink(Topic* linkTo) throws NoSuchLink; - /** - * - * Retrieve information on the current links. - * - * @return A sequence of LinkInfo objects. - * - **/ + /// Retrieve information on the current links. + /// @return A sequence of LinkInfo objects. ["nonmutating", "cpp:const"] idempotent LinkInfoSeq getLinkInfoSeq(); - /** - * - * Retrieve the list of subscribers for this topic. - * - * @return The sequence of Ice identities for the subscriber objects. - * - **/ + /// Retrieve the list of subscribers for this topic. + /// @return The sequence of Ice identities for the subscriber objects. ["nonmutating", "cpp:const"] Ice::IdentitySeq getSubscribers(); - /** - * - * Destroy the topic. - * - **/ + /// Destroy the topic. void destroy(); } -/** - * - * Mapping of topic name to topic proxy. - * - **/ +/// Mapping of topic name to topic proxy. dictionary TopicDict; -/** - * - * This exception indicates that an attempt was made to create a topic - * that already exists. - * - **/ +/// This exception indicates that an attempt was made to create a topic that already exists. exception TopicExists { - /** - * - * The name of the topic that already exists. - * - */ + /// The name of the topic that already exists. string name; } -/** - * - * This exception indicates that an attempt was made to retrieve a - * topic that does not exist. - * - **/ +/// This exception indicates that an attempt was made to retrieve a topic that does not exist. exception NoSuchTopic { - /** - * - * The name of the topic that does not exist. - * - */ + /// The name of the topic that does not exist. string name; } -/** - * - * A topic manager manages topics, and subscribers to topics. - * - * @see Topic - * - **/ +/// A topic manager manages topics, and subscribers to topics. +/// @see Topic interface TopicManager { - /** - * - * Create a new topic. The topic name must be unique. - * - * @param name The name of the topic. - * - * @return A proxy to the topic instance. - * - * @throws TopicExists Raised if a topic with the same name already - * exists. - * - **/ + /// Create a new topic. The topic name must be unique. + /// @param name The name of the topic. + /// @return A proxy to the topic instance. + /// @throws TopicExists Raised if a topic with the same name already exists. Topic* create(string name) throws TopicExists; - /** - * - * Retrieve a topic by name. - * - * @param name The name of the topic. - * - * @return A proxy to the topic instance. - * - * @throws NoSuchTopic Raised if the topic does not exist. - * - **/ + /// Retrieve a topic by name. + /// @param name The name of the topic. + /// @return A proxy to the topic instance. + /// @throws NoSuchTopic Raised if the topic does not exist. ["nonmutating", "cpp:const"] idempotent Topic* retrieve(string name) throws NoSuchTopic; - /** - * - * Retrieve all topics managed by this topic manager. - * - * @return A dictionary of string, topic proxy pairs. - * - **/ + /// Retrieve all topics managed by this topic manager. + /// @return A dictionary of string, topic proxy pairs. ["nonmutating", "cpp:const"] idempotent TopicDict retrieveAll(); } -/** - * - * This interface is advertised by the IceStorm service through the - * Ice object with the identity `IceStorm/Finder'. This allows clients - * to retrieve the topic manager with just the endpoint information of - * the IceStorm service. - * - **/ +/// This interface is advertised by the IceStorm service through the Ice object with the identity `IceStorm/Finder'. +/// This allows clients to retrieve the topic manager with just the endpoint information of the IceStorm service. interface Finder { - /** - * - * Get the topic manager proxy. The proxy might point to several - * replicas. - * - * @return The topic manager proxy. - * - **/ + /// Get the topic manager proxy. The proxy might point to several replicas. + /// @return The topic manager proxy. TopicManager* getTopicManager(); } diff --git a/slice/IceStorm/Metrics.ice b/slice/IceStorm/Metrics.ice index f4f110ea931..dcfb592ffd5 100644 --- a/slice/IceStorm/Metrics.ice +++ b/slice/IceStorm/Metrics.ice @@ -28,56 +28,26 @@ ["objc:prefix:ICEMX", "swift:module:IceStorm:MX"] module IceMX { - -/** - * - * Provides information on IceStorm topics. - * - **/ -class TopicMetrics extends Metrics -{ - /** - * - * Number of events published on the topic by publishers. - * - **/ - long published = 0; - - /** - * - * Number of events forwarded on the topic by IceStorm topic links. - * - **/ - long forwarded = 0; -} - -/** - * - * Provides information on IceStorm subscribers. - * - **/ -class SubscriberMetrics extends Metrics -{ - /** - * - * Number of queued events. - * - **/ - int queued = 0; - - /** - * - * Number of outstanding events. - * - **/ - int outstanding = 0; - - /** - * - * Number of forwarded events. - * - **/ - long delivered = 0; -} - + /// Provides information on IceStorm topics. + class TopicMetrics extends Metrics + { + /// Number of events published on the topic by publishers. + long published = 0; + + /// Number of events forwarded on the topic by IceStorm topic links. + long forwarded = 0; + } + + /// Provides information on IceStorm subscribers. + class SubscriberMetrics extends Metrics + { + /// Number of queued events. + int queued = 0; + + /// Number of outstanding events. + int outstanding = 0; + + /// Number of forwarded events. + long delivered = 0; + } }