private void parseProtoc (TokenNode node, TypeProtocol t, InvarContext ctx) throws Exception
    {
        TokenNode nClient = null;
        TokenNode nServer = null;
        String pName = node.getName();
        int len = node.numChildren();
        for (int i = 0; i < len; i++)
        {
            TokenNode n = node.getChild(i);
            if (n.getName().equals("client"))
            {
                if (nClient == null)
                    nClient = n;
                else
                    throw new Exception(error(node, "Repeated client in protocol '" + pName + "'"));
            }
            else if (n.getName().equals("server"))
            {
                if (nServer == null)
                    nServer = n;
                else
                    throw new Exception(error(node, "Repeated server in protocol '" + pName + "'"));
            }
            else
            {
                throw new Exception(error(node, "Invalid element in protocol '" + pName + "'"));
            }

        }
        if (nClient != null)
        {
            parseStruct(nClient, t.getClient(), ctx);
            t.setNoClient(false);
        }
        if (nClient != null)
        {
            parseStruct(nServer, t.getServer(), ctx);
            t.setNoServer(false);
        }
    }